Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(...)
- local arrowDisplay = "Arrow"
- local RotateDisplayToPoint = function(display, pointX, pointY, offset)
- if display and pointX and pointY then
- local playerX, playerY = UnitPosition('player')
- offset = offset or 0
- local degrees = math.deg(math.atan2((playerY - pointY), (playerX - pointX)) - GetPlayerFacing()) + offset
- local DisplayType = function(name)
- if WeakAuras then
- if WeakAuras.auras and WeakAuras.auras[name] then return 'auras' end
- if WeakAuras.regions and WeakAuras.regions[name] then return 'regions' end
- end
- end
- local displayType = DisplayType(display)
- if not displayType then return end
- if displayType == 'auras' then
- if WeakAuras
- and WeakAuras[displayType]
- and WeakAuras[displayType][display]
- and WeakAuras[displayType][display][0]
- and WeakAuras[displayType][display][0]['region']
- and WeakAuras[displayType][display][0]['region']['Rotate']
- and type(WeakAuras[displayType][display][0]['region']['Rotate']) == 'function' then
- WeakAuras[displayType][display][0]['region']['Rotate'](0, degrees and degrees or 0)
- end
- elseif displayType == 'regions' then
- if WeakAuras
- and WeakAuras[displayType]
- and WeakAuras[displayType][display]
- and WeakAuras[displayType][display]
- and WeakAuras[displayType][display]['region']
- and WeakAuras[displayType][display]['region']['Rotate']
- and type(WeakAuras[displayType][display]['region']['Rotate']) == 'function' then
- WeakAuras[displayType][display]['region']['Rotate'](0, degrees and degrees or 0)
- end
- end
- end
- end
- if 1 == 1 then RotateDisplayToPoint(arrowDisplay, UnitPosition('target'))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement