Guest User

Untitled

a guest
Oct 23rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. Kill = {}
  2.  
  3. MaxAttkDist = 16
  4. MinAttkDist = 1
  5. SafeDistance = 9
  6.  
  7. Kill.NPC = function(mob)
  8. local npc = Ao.npcs:find(mob.uid, 0)
  9.  
  10.  
  11. While npc.id == 242 or npc.id == 243 or npc.id == 544
  12. or npc:IsImmune(ResistType.Cold) and npc:IsImmune(ResistType.Fire) do
  13. if npc.life_percent > 65 then
  14. if distance(Ao.me.x, Ao.me.y, npc.x, npc.y) > 12 then
  15. local point = GetPointInQuadrant(npc.x, npc.y, GetLeastPopulusQuadrant(npc.x, npc.y, 10), 10)
  16. Move.ToLocation(point.x, point.y)
  17. end
  18. CastOn("NPC", npc.uid, "StaticField", Ao:getNumber("CastSleep"))
  19. CastOn("NPC", npc.uid, "StaticField", Ao:getNumber("CastSleep"))
  20. npc = Ao.npcs:find(mob.uid)
  21. end
  22. end
  23.  
  24. while npc.uid > 0 and npc.mode == NPCMode.Alive do
  25. if distance(Ao.me.x, Ao.me.y, npc.x, npc.y) > MaxAttkDist then
  26. local point = GetPointInQuadrant(npc.x, npc.y, GetLeastPopulusQuadrant(npc.x, npc.y, SafeDistance), SafeDistance)
  27. Move.ToLocation(point.x, point.y)
  28. npc = Ao.npcs:find(mob.uid)
  29. end
  30. if npc.id == 156 or npc.id == 544
  31. or (npc:IsImmune(ResistType.Cold) and npc:IsImmune(ResistType.Fire)) then
  32. if Ao.me.states:isActive(StateType.SkillDelay) then
  33. SelectSkill("FireBall")
  34. CastOn("NPC", npc.uid, "FireBall", Ao:getNumber("CastSleep"))
  35. npc = Ao.npcs:find(mob.uid)
  36. else
  37. CastOn("NPC", npc.uid, "Blizzard", Ao:getNumber("CastSleep"))
  38. npc = Ao.npcs:find(mob.uid)
  39. end
  40. elseif npc:IsImmune(ResistType.Cold) or (npc:getResist(ResistType.Cold)-150 >= npc:getResist(ResistType.Fire)-80) then
  41. if Ao.me.states:isActive(StateType.SkillDelay) then
  42. SelectSkill("FireBall")
  43. CastOn("NPC", npc.uid, "FireBall", Ao:getNumber("CastSleep"))
  44. npc = Ao.npcs:find(mob.uid)
  45. else
  46. if Ao.npcs:countInRadius(Ao.me.x, Ao.me.y, SafeDistance) <= 10 then
  47. CastOn("NPC", npc.uid, "Meteor", Ao:getNumber("CastSleep"))
  48. npc = Ao.npcs:find(mob.uid)
  49. else
  50. CastAt(Ao.me.x, Ao.me.y, 'Blizzard', Ao:getNumber("CastSleep"))
  51. npc = Ao.npcs:find(mob.uid)
  52. end
  53. end
  54. elseif npc:IsImmune(ResistType.Fire) or (npc:getResist(ResistType.Fire)-80 > npc:getResist(ResistType.Cold)-150) then
  55. if Ao.me.states:isActive(StateType.SkillDelay) then
  56. SelectSkill("IceBlast")
  57. CastOn("NPC", npc.uid, "IceBlast", Ao:getNumber("CastSleep"))
  58. npc = Ao.npcs:find(mob.uid)
  59. else
  60. if Ao.npcs:countInRadius(Ao.me.x, Ao.me.y, SafeDistance) <= 10 then
  61. CastOn("NPC", npc.uid, "Blizzard", Ao:getNumber("CastSleep"))
  62. npc = Ao.npcs:find(mob.uid)
  63. else
  64. CastAt(Ao.me.x, Ao.me.y, 'Blizzard', Ao:getNumber("CastSleep"))
  65. npc = Ao.npcs:find(mob.uid)
  66. end
  67. end
  68. end
  69. end
  70.  
  71. end
  72.  
  73. Kill.AllInRadius = function(x, y, radius)
  74. while Ao.npcs:countInRadius(x, y, radius) > 0 do
  75. local npc = Ao.npcs:findInRadius(x, y, radius)
  76. Kill.NPC(npc)
  77. end
  78. Move.ToLocation(x, y)
  79. end
  80.  
  81. Kill.HeroesInRadius = function(x, y, radius)
  82. local hero = Ao.npcs:findHeroInRadius(x, y, radius)
  83.  
  84. while hero.uid > 0 do
  85. if Ao.npcs:countInRadius(Ao.me.x, Ao.me.y, SafeDistance) > MaxMobs then
  86. local point = GetPointInQuadrant(x, y, GetLeastPopulusQuadrant(x, y, SafeDistance), SafeDistance)
  87. Move.ToLocation(point.x, point.y)
  88. end
  89. Kill.NPC(hero)
  90. hero = Ao.npcs:findHeroInRadius(x, y, radius)
  91. end
  92. end
  93.  
  94. function Kill.Preattack(x, y)
  95. CastAt(x, y, 'Blizzard', Ao:getNumber("CastSleep"))
  96. end
Add Comment
Please, Sign In to add comment