-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmirrorImages.lua
61 lines (45 loc) · 1.32 KB
/
mirrorImages.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
49
50
51
52
53
54
55
56
57
58
59
60
61
-- TSU: TRIGGER:1, TRIGGER:2, TRIGGER:3
function(allstates, event, triggerNum, triggerStates)
if event ~= 'TRIGGER' then
return false
end
local state = allstates['']
if triggerNum == 1 then
-- Spell cast succeeded.
if state == nil then
state = {
['show'] = true,
['progressType'] = 'timed',
['duration'] = 40,
['autoHide'] = true,
}
allstates[''] = state
end
state['expirationTime'] = GetTime() + 40
state['stacks'] = 3
state['changed'] = true
return true
end
if state == nil then
-- We don't have a state to modify. Return early.
return false
end
-- Not sure why we're getting duplicate events for the same trigger, but
-- ignore the one with a nil CLEU timestamp.
local eventTime, _ = CombatLogGetCurrentEventInfo()
if eventTime == nil then
return false
end
if triggerNum == 2 then
-- Spell aura removed dose.
state['stacks'] = state['stacks'] - 1
state['changed'] = true
return true
elseif triggerNum == 3 then
-- Spell aura removed.
state['show'] = false
state['changed'] = true
return true
end
return false
end