-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweak_cooldownPulse.lua
48 lines (37 loc) · 1.24 KB
/
weak_cooldownPulse.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-------------------------------------------------------------------------------
-- init
local watchedSpellIds = {}
for _, v in pairs(aura_env.config.spells) do
watchedSpellIds[v.spellId] = true
WeakAuras.WatchSpellCooldown(v.spellId)
end
aura_env.watchedSpellIds = watchedSpellIds
-------------------------------------------------------------------------------
-- trigger (TSU): SPELL_COOLDOWN_READY
function(allstates, event, spellId)
local watchedSpellIds = aura_env.watchedSpellIds
local _
if spellId == nil then
-- This is a dummy event. Create a dummy state to sample the
-- display and animation.
spellId, _ = next(watchedSpellIds)
end
if not watchedSpellIds[spellId] then
return false
end
local state = allstates[spellId]
if state == nil then
state = {}
allstates[spellId] = state
end
state.changed = true
state.show = true
local spellInfo = C_Spell.GetSpellInfo(spellId)
state.name = spellInfo["name"]
state.icon = spellInfo["iconID"]
state.progressType = "timed"
state.duration = math.max(0.01, aura_env.config.dwellDuration)
state.expirationTime = GetTime() + state.duration
state.autoHide = true
return true
end