Files
wow-weakauras/WeakAuras/Projects/Ironfur.lua

45 lines
1.5 KiB
Lua

--COMBAT_LOG_EVENT_UNFILTERED
function(allstates, e, ...)
local aura_env = aura_env
local se = select(2, ...)
if se == "SPELL_CAST_SUCCESS" then
local caster = select(5, ...)
local spell = select(13, ...)
if caster == UnitName("player") and spell == "Ironfur" then
allstates[#allstates + 1] = {
show = true,
changed = true,
resort = true,
index = GetTime(),
progressType = "timed",
expirationTime = GetTime() + aura_env.ironfurDuration,
duration = aura_env.ironfurDuration,
autoHide = true,
}
if aura_env.buff == true then
allstates[#allstates].expirationTime = allstates[#allstates].expirationTime + 2
allstates[#allstates].duration = allstates[#allstates].duration + 2
end
return true
end
elseif se == "SPELL_AURA_APPLIED" then
local caster = select(5, ...)
local spell = select(13, ...)
if caster == UnitName("player") and spell == "Guardian of Elune" then
aura_env.buff = true
end
elseif se == "SPELL_AURA_REMOVED" then
local caster = select(5, ...)
local spell = select(13, ...)
if caster == UnitName("player") and spell == "Guardian of Elune" then
C_Timer.After(0.1, function()
aura_env.buff = false
end)
end
end
end
--INIT
aura_env.ironfurDuration = 6
aura_env.buff = false