-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemonicCallingHoldDuration.lua
83 lines (62 loc) · 2.17 KB
/
demonicCallingHoldDuration.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
-------------------------------------------------------------------------------
-- TSU: TRIGGER:1, TRIGGER:2
function(allstates, event, ...)
if event == 'TRIGGER' then
local triggerNum, triggerStates = ...
local triggerState = triggerStates['']
if triggerNum == 2 then
-- Cache this state.
if triggerState['charges'] == 0 then
-- Call Dreadstalkers is on CD.
aura_env.cdExpiration = triggerState['expirationTime']
return false
else
-- Call Dreadstalkers is now off CD. Unpause the state if
-- there is one.
aura_env.cdExpiration = nil
local state = allstates['']
if state == nil then
return false
end
state['changed'] = true
state['paused'] = false
return true
end
elseif triggerNum == 1 then
if triggerState == nil then
-- Trigger 1 just untriggered. Do nothing.
return false
end
local state = allstates['']
if state == nil then
state = {
['show'] = true,
['progressType'] = 'timed',
['autoHide'] = true,
}
allstates[''] = state
end
local procExpiration = triggerState['expirationTime']
local difference = nil
if aura_env.cdExpiration ~= nil then
difference = procExpiration - aura_env.cdExpiration
state['paused'] = true
state['remaining'] = difference
else
difference = 20
state['paused'] = nil
end
state['changed'] = true
state['expirationTime'] = procExpiration
state['duration'] = difference
return true
end
end
end
-------------------------------------------------------------------------------
-- Custom Variables
{
['expirationTime'] = true,
['duration'] = true,
['paused'] = 'bool',
}