Files
wow-weakauras/Complete Projects/trash/Cunting shit 2.lua
2024-08-24 22:43:07 +02:00

38 lines
1.3 KiB
Lua

EVERY FRAME
function()
local function range (val, min, max, max2)
val = 1 - (((max - val) / (max - min)) * max2)
return val
end
local pX = UnitPosition("player") or 0
local pY = select(2,UnitPosition("player")) or 0
local tX = UnitPosition("Alurielle") or 0
local tY = select(2,UnitPosition("Alurielle")) or 0
local X = pX - tX
local Y = pY - tY
local playerFace = GetPlayerFacing() or 0
local playerA = math.floor(playerFace * 100)
playerA = range(playerA, 0, 630, 360) - 1
playerA = - playerA
playerA = playerA - 90
if playerA < 0 then playerA = playerA + 360 end
aura_env.hyp = math.sqrt((math.abs(X^2)) + (math.abs(Y^2)))
aura_env.angle = math.deg(math.atan2(X,Y))
if aura_env.angle < 0 then aura_env.angle = aura_env.angle + 360 end
aura_env.angle = aura_env.angle - playerA
end
DISPLAY
function()
local pX = UnitPosition("player") or 0
local pY = select(2,UnitPosition("player")) or 0
local tX = UnitPosition("Alurielle") or 0
local tY = select(2,UnitPosition("Alurielle")) or 0
local X = pX - tX
local Y = pY - tY
local hyp = math.floor(math.sqrt((math.abs(X^2)) + (math.abs(Y^2))))
return hyp
end
INIT
aura_env.angle = 0