Advertisement
Guest User

Artillery

a guest
Jul 5th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. #this is supposed to go in the custom display
  2. function()
  3. if _G["WA_chaos_player"] then
  4. posx, posy = UnitPosition("player")
  5. posx_chaos, posy_chaos = UnitPosition(_G["WA_chaos_player"])
  6.  
  7. diffx = posx_chaos - posx
  8. diffy = posy_chaos - posy
  9. distance = math.floor(math.sqrt(math.pow(diffx, 2) + math.pow(diffy, 2)) + 0.5)
  10.  
  11. if WA_expiration then
  12. distance = distance.."m\n"..math.floor(_G["WA_expiration"] - GetTime() + 0.5)
  13. end
  14.  
  15. return distance
  16. end
  17.  
  18. return "-"
  19. end
  20.  
  21.  
  22. ---------------------------------------------------------------------------------------------------------------------------
  23.  
  24.  
  25.  
  26. #this goes in the event trigger
  27. function(event, _, type, _, _, sourceName, _, _, _, destName, _, _, _, spellName)
  28. if type == "SPELL_CAST_SUCCESS" then
  29. if string.find(spellName, "Artillery") or string.find(spellName, "Artillery") then
  30. _G["WA_chaos_player"] = destName
  31. _G["WA_expiration"] = GetTime() + 10
  32. return true
  33. end
  34. end
  35.  
  36. return false
  37. end
  38.  
  39.  
  40. ----------------------------------------------------------------------------------------------------------------------------
  41.  
  42.  
  43.  
  44. #this goes in the event hide
  45. function(event, _, type, _, _, destName, _, _, _, _, _, _, _, spellName)
  46. if type == "SPELL_AURA_REMOVED" then
  47. if string.find(spellName, "Artillery") or string.find(spellName, "Artillery") then
  48. return true
  49. end
  50. end
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement