Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Kill = {}
- MaxAttkDist = 16
- MinAttkDist = 1
- SafeDistance = 9
- Kill.NPC = function(mob)
- local npc = Ao.npcs:find(mob.uid, 0)
- While npc.id == 242 or npc.id == 243 or npc.id == 544
- or npc:IsImmune(ResistType.Cold) and npc:IsImmune(ResistType.Fire) do
- if npc.life_percent > 65 then
- if distance(Ao.me.x, Ao.me.y, npc.x, npc.y) > 12 then
- local point = GetPointInQuadrant(npc.x, npc.y, GetLeastPopulusQuadrant(npc.x, npc.y, 10), 10)
- Move.ToLocation(point.x, point.y)
- end
- CastOn("NPC", npc.uid, "StaticField", Ao:getNumber("CastSleep"))
- CastOn("NPC", npc.uid, "StaticField", Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- end
- end
- while npc.uid > 0 and npc.mode == NPCMode.Alive do
- if distance(Ao.me.x, Ao.me.y, npc.x, npc.y) > MaxAttkDist then
- local point = GetPointInQuadrant(npc.x, npc.y, GetLeastPopulusQuadrant(npc.x, npc.y, SafeDistance), SafeDistance)
- Move.ToLocation(point.x, point.y)
- npc = Ao.npcs:find(mob.uid)
- end
- if npc.id == 156 or npc.id == 544
- or (npc:IsImmune(ResistType.Cold) and npc:IsImmune(ResistType.Fire)) then
- if Ao.me.states:isActive(StateType.SkillDelay) then
- SelectSkill("FireBall")
- CastOn("NPC", npc.uid, "FireBall", Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- else
- CastOn("NPC", npc.uid, "Blizzard", Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- end
- elseif npc:IsImmune(ResistType.Cold) or (npc:getResist(ResistType.Cold)-150 >= npc:getResist(ResistType.Fire)-80) then
- if Ao.me.states:isActive(StateType.SkillDelay) then
- SelectSkill("FireBall")
- CastOn("NPC", npc.uid, "FireBall", Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- else
- if Ao.npcs:countInRadius(Ao.me.x, Ao.me.y, SafeDistance) <= 10 then
- CastOn("NPC", npc.uid, "Meteor", Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- else
- CastAt(Ao.me.x, Ao.me.y, 'Blizzard', Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- end
- end
- elseif npc:IsImmune(ResistType.Fire) or (npc:getResist(ResistType.Fire)-80 > npc:getResist(ResistType.Cold)-150) then
- if Ao.me.states:isActive(StateType.SkillDelay) then
- SelectSkill("IceBlast")
- CastOn("NPC", npc.uid, "IceBlast", Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- else
- if Ao.npcs:countInRadius(Ao.me.x, Ao.me.y, SafeDistance) <= 10 then
- CastOn("NPC", npc.uid, "Blizzard", Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- else
- CastAt(Ao.me.x, Ao.me.y, 'Blizzard', Ao:getNumber("CastSleep"))
- npc = Ao.npcs:find(mob.uid)
- end
- end
- end
- end
- end
- Kill.AllInRadius = function(x, y, radius)
- while Ao.npcs:countInRadius(x, y, radius) > 0 do
- local npc = Ao.npcs:findInRadius(x, y, radius)
- Kill.NPC(npc)
- end
- Move.ToLocation(x, y)
- 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)
- Move.ToLocation(point.x, point.y)
- end
- Kill.NPC(hero)
- hero = Ao.npcs:findHeroInRadius(x, y, radius)
- end
- end
- function Kill.Preattack(x, y)
- CastAt(x, y, 'Blizzard', Ao:getNumber("CastSleep"))
- end
Add Comment
Please, Sign In to add comment