Advertisement
a3f

[XB] Alternate between 2 attacking spells

a3f
Sep 11th, 2012
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local swap_between =
  2. {
  3.     {words='exori ico',     range=1,    use=true},
  4.     {words='exori hur',     range=5,    use=true},
  5.     {words='exori con',     range=7,    use=false},
  6.     {words='exori gran con',range=7,    use=false},
  7.     {words='exori san',     range=4,    use=false}
  8. }
  9. local mobs = {'Nightmare', 'Tormentor'} -- Case Sensitive!
  10.  
  11.  
  12. ------ Don't edit anything down from here :)
  13. local attack = { }
  14. for i = 1, #swap_between do
  15.     if swap_between[i].use then
  16.         table.insert(attack, swap_between[i])
  17.     end
  18. end
  19.  
  20.  
  21. while (true) do
  22.     local creature = Creature.GetByID(Self.TargetID())
  23.     for _, x in ipairs(attack)do
  24.         if table.find(mobs, creature:Name(), false) then
  25.             if creature:isValid() and creature:isAlive() and creature:DistanceFromSelf() <= x.range and Self.CanCastSpell(x.words) then
  26.                 Self.Say(x.words)
  27.             end
  28.         end
  29.     end
  30.  
  31. sleep(math.random(900, 1000))
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement