-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvoidformExtensions.lua
94 lines (75 loc) · 2.59 KB
/
voidformExtensions.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
84
85
86
87
88
89
90
91
92
93
94
--[[
A small text that shows how many Devouring Plagues you've cast while in
Voidform. Upon expiration/removal of Voidform, this also prints a message to
your chat window the final Devouring Plague cast count. This message can be
modified or disabled in "Actions" -> "On Hide". See "Trigger" -> "Custom
Variables" for the available variables.
]]
-- TSU: UNIT_SPELLCAST_SUCCEEDED:player, UNIT_AURA:player
function(allstates, event, ...)
if event == "UNIT_SPELLCAST_SUCCEEDED" then
local spellId = select(3, ...)
if spellId ~= 335467 then -- Devouring Plague
return false
end
local state = allstates[1]
if state == nil then
return false
end
state.stacks = state.stacks + 1
state.addedDuration = state.stacks * 2.5
state.totalDuration = 20 + state.addedDuration
state.changed = true
return true
elseif event == "UNIT_AURA" then
local updateInfo = select(2, ...)
if updateInfo == nil then
return false
end
local state = allstates[1]
if state == nil then
-- See if we're adding Voidform as an aura.
local addedAuras = updateInfo.addedAuras
if addedAuras == nil then
return false
end
for _, addedAura in ipairs(addedAuras) do
if addedAura.spellId == 194249 then -- Voidform
local state = {}
allstates[1] = state
state.show = true
state.changed = true
state.progressType = "static"
state.value = 1
state.total = 1
state.stacks = 0
state.addedDuration = 0
state.totalDuration = 20
state.instanceId = addedAura.auraInstanceID
return true
end
end
return false
else
-- See if we're removing Voidform as an aura.
local removedAuras = updateInfo.removedAuraInstanceIDs
if removedAuras == nil then
return false
end
for _, instanceId in ipairs(removedAuras) do
if state.instanceId == instanceId then
state.show = false
state.changed = true
return true
end
end
return false
end
end
end
-- Custom Variables
{
stacks = true,
addedDuration = "number",
totalDuration = "number"
}