Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. function(...)
  2. local arrowDisplay = "Arrow"
  3.  
  4. local RotateDisplayToPoint = function(display, pointX, pointY, offset)
  5. if display and pointX and pointY then
  6. local playerX, playerY = UnitPosition('player')
  7. offset = offset or 0
  8. local degrees = math.deg(math.atan2((playerY - pointY), (playerX - pointX)) - GetPlayerFacing()) + offset
  9.  
  10. local DisplayType = function(name)
  11. if WeakAuras then
  12. if WeakAuras.auras and WeakAuras.auras[name] then return 'auras' end
  13. if WeakAuras.regions and WeakAuras.regions[name] then return 'regions' end
  14. end
  15. end
  16. local displayType = DisplayType(display)
  17. if not displayType then return end
  18.  
  19. if displayType == 'auras' then
  20. if WeakAuras
  21. and WeakAuras[displayType]
  22. and WeakAuras[displayType][display]
  23. and WeakAuras[displayType][display][0]
  24. and WeakAuras[displayType][display][0]['region']
  25. and WeakAuras[displayType][display][0]['region']['Rotate']
  26. and type(WeakAuras[displayType][display][0]['region']['Rotate']) == 'function' then
  27. WeakAuras[displayType][display][0]['region']['Rotate'](0, degrees and degrees or 0)
  28. end
  29. elseif displayType == 'regions' then
  30. if WeakAuras
  31. and WeakAuras[displayType]
  32. and WeakAuras[displayType][display]
  33. and WeakAuras[displayType][display]
  34. and WeakAuras[displayType][display]['region']
  35. and WeakAuras[displayType][display]['region']['Rotate']
  36. and type(WeakAuras[displayType][display]['region']['Rotate']) == 'function' then
  37. WeakAuras[displayType][display]['region']['Rotate'](0, degrees and degrees or 0)
  38. end
  39. end
  40. end
  41. end
  42.  
  43. if 1 == 1 then RotateDisplayToPoint(arrowDisplay, UnitPosition('target'))
  44. end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement