-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathArlokk.lua
207 lines (181 loc) · 7.43 KB
/
Arlokk.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
------------------------------
-- Are you local? --
------------------------------
local boss = AceLibrary("Babble-Boss-2.2")["High Priestess Arlokk"]
local L = AceLibrary("AceLocale-2.2"):new("BigWigs"..boss)
----------------------------
-- Localization --
----------------------------
L:RegisterTranslations("enUS", function() return {
cmd = "Arlokk",
engage_trigger = "your priestess calls upon your might",
mark_trigger = "Feast on (.+), my pretties!",
mark_warning_self = "You are marked!",
mark_warning_other = "%s is marked!",
mark_fade = "Mark of Arlokk fades from (.+)\.",
ww_trigger = "High Priestess Arlokk gains Whirlwind\.",
ww_bar = "Whirlwind",
trollphase_message = "Troll Phase",
pantherphase_message = "Panther Phase",
vanishphase_message = "Vanish!",
vanish_bar = "Estimated Return",
vanish_Nextbar = "Next Vanish",
vanish_cmd = "vanish",
vanish_name = "Vanish alert",
vanish_desc = "Shows a bar for the Vanish duration.",
mark_cmd = "mark",
mark_name = "Mark of Arlokk alert",
mark_desc = "Warns when people are marked.",
whirlwind_cmd = "whirlwind",
whirlwind_name = "Whirldind alert",
whirlwind_desc = "Shows you when the boss has Whirlwind.",
phase_cmd = "phase",
phase_name = "Phase notification",
phase_desc = "Announces the boss' phase transitions.",
puticon_cmd = "puticon",
puticon_name = "Raid icon on marked players",
puticon_desc = "Place a raid icon on the player with Mark of Arlokk.\n\n(Requires assistant or higher)",
} end )
L:RegisterTranslations("deDE", function() return {
cmd = "Arlokk",
engage_trigger = "your priestess calls upon your might",
mark_trigger = "Feast on (.+), my pretties!",
mark_warning_self = "Du bist markiert!",
mark_warning_other = "%s ist markiert!",
mark_fade = "Arlokks Mal schwindet von (.+)\.",
ww_trigger = "High Priestess Arlokk bekommt \'Wirbelwind\'\.",
ww_bar = "Wirbelwind",
trollphase_message = "Troll Phase",
pantherphase_message = "Panther Phase",
vanishphase_message = "Verschwinden!",
vanish_bar = "Ungefähre Rückkehr",
vanish_Nextbar = "Nächstes Verschwinden",
vanish_cmd = "vanish",
vanish_name = "Verschwinden anzeigen",
vanish_desc = "Verk\195\188ndet Boss' Verschwinden.",
mark_cmd = "mark",
mark_name = "Alarm f\195\188r Arlokks Mal",
mark_desc = "Warnt wenn Spieler markiert sind.",
whirlwind_cmd = "whirlwind",
whirlwind_name = "Alarm f\195\188r Wirbelwind",
whirlwind_desc = "Zeigt Balken f\195\188r Wirbelwind.",
phase_cmd = "phase",
phase_name = "Phasen-Benachrichtigung",
phase_desc = "Verk\195\188ndet den Phasenwechsel des Bosses.",
puticon_cmd = "puticon",
puticon_name = "Schlachtzugsymbol auf die markiert Spieler",
puticon_desc = "Versetzt eine Schlachtzugsymbol auf der markiert Spieler.\n\n(Ben\195\182tigt Schlachtzugleiter oder Assistent)",
} end )
----------------------------------
-- Module Declaration --
----------------------------------
BigWigsArlokk = BigWigs:NewModule(boss)
BigWigsArlokk.zonename = AceLibrary("Babble-Zone-2.2")["Zul'Gurub"]
BigWigsArlokk.enabletrigger = boss
BigWigsArlokk.bossSync = "High Priestess Arlokk"
BigWigsArlokk.toggleoptions = {"phase", "whirlwind", "vanish", "mark", "puticon", "bosskill"}
BigWigsArlokk.revision = tonumber(string.sub("$Revision: 11205 $", 12, -3))
BigWigsArlokk:RegisterYellEngage(L["engage_trigger"])
------------------------------
-- Initialization --
------------------------------
function BigWigsArlokk:OnEnable()
self.started = nil
vanished = nil
self:RegisterEvent("CHAT_MSG_MONSTER_YELL")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS")
self:RegisterEvent("PLAYER_REGEN_DISABLED", "CheckForEngage")
self:RegisterEvent("BigWigs_RecvSync")
self:TriggerEvent("BigWigs_ThrottleSync", "ArlokkPhaseTroll", 3)
self:TriggerEvent("BigWigs_ThrottleSync", "ArlokkPhaseVanish", 3)
self:TriggerEvent("BigWigs_ThrottleSync", "ArlokkPhasePanther", 3)
end
------------------------------
-- Events --
------------------------------
function BigWigsArlokk:CHAT_MSG_MONSTER_YELL(msg)
if string.find(msg,L["engage_trigger"]) then
--self:SendEngageSync()
else
local _,_, n = string.find(msg, L["mark_trigger"])
if n then
if self.db.profile.mark then
if n == UnitName("player") then
self:TriggerEvent("BigWigs_Message", L["mark_warning_self"], "Attention", true, "Alarm")
else
self:TriggerEvent("BigWigs_Message", string.format(L["mark_warning_other"], n), "Attention")
end
end
if self.db.profile.puticon then
self:TriggerEvent("BigWigs_SetRaidIcon", n)
end
self:TriggerEvent("BigWigs_SendSync", "ArlokkPhaseVanish")
end
end
end
function BigWigsArlokk:CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS(msg)
if msg == L["ww_trigger"] and self.db.profile.whirlwind then
self:TriggerEvent("BigWigs_StartBar", self, L["ww_bar"], 2, "Interface\\Icons\\Ability_Whirlwind")
end
end
function BigWigsArlokk:BigWigs_RecvSync(sync, rest, nick)
if not self.started and sync == "BossEngaged" and rest == self.bossSync then
self:StartFight()
self:CancelScheduledEvent("checkvanish")
if self.db.profile.phase then
self:TriggerEvent("BigWigs_Message", L["trollphase_message"], "Attention")
end
self:TriggerEvent("BigWigs_StartBar", self, L["vanish_Nextbar"], 35, "Interface\\Icons\\Ability_Vanish")
elseif sync == "ArlokkPhasePanther" then
self:CancelScheduledEvent("checkunvanish")
if self.db.profile.vanish then
self:TriggerEvent("BigWigs_StopBar", self, L["vanish_bar"])
end
if self.db.profile.phase then
self:TriggerEvent("BigWigs_Message", L["pantherphase_message"], "Attention")
end
if not vanished then
self:ScheduleRepeatingEvent("checkvanish", self.CheckVanish, 0.5, self)
end
elseif sync == "ArlokkPhaseVanish" then
vanished = true
self:CancelScheduledEvent("checkvanish")
self:CancelScheduledEvent("trollphaseinc")
if self.db.profile.phase then
self:TriggerEvent("BigWigs_Message", L["vanishphase_message"], "Attention")
end
if self.db.profile.vanish then
self:TriggerEvent("BigWigs_StartBar", self, L["vanish_bar"], 44.7, "Interface\\Icons\\Ability_Vanish", true, "White")
end
self:ScheduleRepeatingEvent("checkunvanish", self.CheckUnvanish, 0.5, self)
end
end
function BigWigsArlokk:CheckUnvanish()
if UnitExists("target") and UnitName("target") == "High Priestess Arlokk" and UnitExists("targettarget") then
self:TriggerEvent("BigWigs_SendSync", "ArlokkPhasePanther")
self:ScheduleEvent("trollphaseinc", "BigWigs_SendSync", 44.8, "ArlokkPhaseTroll")
return
end
local num = GetNumRaidMembers()
for i = 1, num do
local raidUnit = string.format("raid%starget", i)
if UnitExists(raidUnit) and UnitName(raidUnit) == "High Priestess Arlokk" and UnitExists(raidUnit.."target") then
self:TriggerEvent("BigWigs_SendSync", "ArlokkPhasePanther")
self:ScheduleEvent("trollphaseinc", "BigWigs_SendSync", 44.8, "ArlokkPhaseTroll")
return
end
end
end
function BigWigsArlokk:CheckVanish()
if UnitExists("target") and UnitName("target") == "High Priestess Arlokk" and UnitExists("targettarget") then
return
end
local num = GetNumRaidMembers()
for i = 1, num do
local raidUnit = string.format("raid%starget", i)
if UnitExists(raidUnit) and UnitName(raidUnit) == "High Priestess Arlokk" and UnitExists(raidUnit.."target") then
return
end
end
self:TriggerEvent("BigWigs_SendSync", "ArlokkPhaseVanish")
end