Files
wow-weakauras/Complete Projects/Fivver Stuff/Spellbook cooldowns and talent cooldowns/Talent Cooldowns.lua
2024-08-24 22:43:07 +02:00

31 lines
887 B
Lua

--TSU
--SPELL_UPDATE_COOLDOWN RESET_COOLDOWN_MANAGER
function(allstates, e)
if e == "RESET_COOLDOWN_MANAGER" then
for _, state in pairs(allstates) do
state.show = false;
state.changed = true;
end
end
if not aura_env.talents then WeakAuras.ScanEvents("PLAYER_TALENT_UPDATE") end
for k,v in pairs(aura_env.talents) do
local start, duration = GetSpellCooldown(v)
local icon = GetSpellTexture(k)
local enable = 0
if start == 0 then enable = 1 else enable = 0 end
allstates[v] = {
changed = true,
show = true,
resort = true,
progressType = "timed",
icon = icon,
enable = enable,
}
if start > 0 and duration > 1.5 then
allstates[v].expirationTime = start + duration
allstates[v].duration = duration
allstates[v].index = duration
end
end
return true
end