Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Kill = {}
- MaxAttkDist = 20
- MinAttkDist = 15
- MaxMobs = 5
- SafeDistance = 18
- StopAreaAttacks = 4
- Kill.NPC = function(mob)
- local npc = Ao.npcs:find(mob.uid, 0)
- if npc.id == NPCCode.BaalCrab then
- Kill.Baal(mob)
- elseif npc.id == NPCCode.Mephisto then
- Kill.Mephisto(mob)
- elseif npc.id == NPCCode.Andariel then
- Kill.Andariel(mob)
- elseif npc.id == NPCCode.Diablo then
- Kill.Diablo(mob)
- elseif npc.id == NPCCode.Duriel then
- Kill.Duriel(mob)
- end
- while npc.uid > 0 and npc.mode == NPCMode.Alive do
- if Ao.npcs:countInRadius(Ao.me.x, Ao.me.y, SafeDistance) > MaxMobs then
- local point = GetPointInQuadrant(npc.x, npc.y, GetLeastPopulusQuadrant(npc.x, npc.y, SafeDistance), SafeDistance)
- MoveTo(point.x, point.y)
- end
- if distance(Ao.me.x, Ao.me.y, npc.x, npc.y) > MaxAttkDist or distance(Ao.me.x, Ao.me.y, npc.x, npc.y) < MinAttkDist then
- local point = GetPointInQuadrant(npc.x, npc.y, GetLeastPopulusQuadrant(npc.x, npc.y, SafeDistance), SafeDistance)
- MoveTo(point.x, point.y)
- else
- if Ao.me.states:isActive(StateType.SkillDelay) then
- if Ao.npcs:countInRadius(npc.x, npc.y, 5) > 3 then
- CastOn("NPC", npc.uid, "FireBall", Ao:getNumber("CastSleep"))
- else
- CastOn("NPC", npc.uid, "FireBolt", Ao:getNumber("CastSleep"))
- end
- else
- CastOn("NPC", npc.uid, "Meteor", Ao:getNumber("CastSleep"))
- end
- end
- end
- end
- Kill.AllInRadius = function(x, y, radius)
- local allnpc = Ao.npcs:findAllInRadius(x, y, radius)
- for i = 0, allnpc:size() - 1 do
- if allnpc[i]:IsImmune(ResistType.Fire) then
- Ao.npcs:remove(allnpc[i].uid)
- end
- end
- while Ao.npcs:countInRadius(x, y, radius) > 0 do
- allnpc = Ao.npcs:findAllInRadius(x, y, radius)
- for i = 0, allnpc:size() - 1 do
- if allnpc[i]:IsImmune(ResistType.FIre) then
- Ao.npcs:remove(allnpc[i].uid)
- end
- end
- if Ao.npcs:countInRadius(Ao.me.x, Ao.me.y, SafeDistance) > MaxMobs then
- local point = GetPointInQuadrant(x, y, GetLeastPopulusQuadrant(x, y, SafeDistance), SafeDistance)
- MoveTo(point.x, point.y)
- end
- if Ao.npcs:countInRadius(x, y, radius) < StopAreaAttacks then
- Kill.NPC(allnpc[0])
- else
- local point = GetPointInQuadrant(x, y, GetMostPopulusQuadrant(x, y, radius), MinAttkDist)
- if Ao.me.states:isActive(StateType.SkillDelay) then
- CastAt(point.x, point.y, "FireBall", Ao:getNumber("CastSleep"))
- else
- CastAt(point.x, point.y, "FireBolt", Ao:getNumber("CastSleep"))
- end
- end
- end
- end
- Kill.HeroesInRadius = function(x, y, radius)
- local hero = Ao.npcs:findHeroInRadius(x, y, radius)
- while hero.uid > 0 do
- if Ao.npcs:countInRadius(Ao.me.x, Ao.me.y, SafeDistance) > MaxMobs then
- local point = GetPointInQuadrant(x, y, GetLeastPopulusQuadrant(x, y, SafeDistance), SafeDistance)
- MoveTo(point.x, point.y)
- end
- Kill.NPC(hero)
- hero = Ao.npcs:findHeroInRadius(x, y, radius)
- end
- end
- Kill.Player = function(player)
- end
- Kill.Baal = function(mob)
- end
- Kill.Mephisto = function(mob)
- end
- Kill.Andariel = function(mob)
- end
- Kill.Diablo = function(mob)
- end
- Kill.Duriel = function(mob)
- end
- ---------------------------------------------
- -------
- -- FireBall Sorceress Build
- --
- -- Check libs/BuildSkills.lua for skill
- functions --
- -- FrozenArmorCheck() and
- EnergyShieldCheck() --
- ---------------------------------------------
- -------
- function AttackSequence(npc) -- UNTESTED
- if not EnergyShieldCheck() then return
- end
- if not FrozenArmorCheck() then return
- end
- if os.clock() - Ao:getNumber('Meteor') > 1.8 then
- Ao:set('MeteorTimer', os.clock())
- CastOn('NPC', npc.uid, 'Meteor')
- return
- end
- CastOn('NPC', npc.uid, 'FireBall')
- end
- function Precast()
- FrozenArmorCheck()
- EnergyShieldCheck()
- end
- function AttackSequencePlayer(pl)
- if os.clock() - Ao:getNumber('MeteorTimer') > 1.8 then
- Ao:set('MeteorTimer', os.clock())
- CastOn('Player', pl.uid, 'Meteor')
- end
- CastOn('NPC', npc.uid, 'FireBall')
- end
- function PreAttack(x, y)
- if os.clock() - Ao:getNumber('MeteorTimer') > 1.8 then
- Ao:set('MeteorTimer', os.clock())
- CastAt(x, y, 'Meteor')
- end
- end
- function PreWalk()
- end
- function TownCast()
- FrozenArmorCheck()
- EnergyShieldCheck()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement