-
Notifications
You must be signed in to change notification settings - Fork 4
/
Mandokir.lua
242 lines (216 loc) · 10.8 KB
/
Mandokir.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
------------------------------
-- Are you local? --
------------------------------
local boss = AceLibrary("Babble-Boss-2.2")["Bloodlord Mandokir"]
local L = AceLibrary("AceLocale-2.2"):new("BigWigs"..boss)
----------------------------
-- Localization --
----------------------------
L:RegisterTranslations("enUS", function() return {
ohgan = "Ohgan",
cmd = "Mandokir",
engage_trigger = "feed your souls to Hakkar himself",
watch_trigger = "(.+)! I'm watching you!",
gaze_trigger = "Bloodlord Mandokir begins to cast Threatening Gaze\.",
gazeafflictyou = "You are afflicted by Threatening Gaze\.",
gazeafflictother = "(.+) is afflicted by Threatening Gaze\.",
gazeendyou = "Threatening Gaze fades from you\.",
gazeendother = "Threatening Gaze fades from (.+)\.",
gazecast = "Incoming Threatening Gaze!",
gazewatchedbar = "Threatening Gaze: %s",
enragegain = "Bloodlord Mandokir gains Enrage\.",
enragefade = "Enrage fades from Bloodlord Mandokir\.",
enragebar = "Enrage",
wwgain = "Bloodlord Mandokir gains Whirlwind\.",
wwloss = "Whirlwind fades from Bloodlord Mandokir\.",
ww = "Whirlwind",
deathyou = "You die\.",
deathother = "(.+) dies\.",
you = "you",
watched_warning = "You are being watched! Stop everything!",
watched_warning_tell = "You are being watched! Stop everything!",
watched_warning_other = "%s is being watched!",
enraged_message = "Ohgan down! Mandokir enraged!",
announce_cmd = "whispers",
announce_name = "Whisper watched players",
announce_desc = "Warn when boss uses Threatening Gaze.\n\n(Requires assistant or higher)",
puticon_cmd = "puticon",
puticon_name = "Raid icon on watched players",
puticon_desc = "Place a raid icon on the watched person.\n\n(Requires assistant or higher)",
gaze_cmd = "gaze",
gaze_name = "Threatening Gaze alert",
gaze_desc = "Shows bars for Threatening Gaze",
whirlwind_cmd = "whirlwind",
whirlwind_name = "Whirlwind Alert",
whirlwind_desc = "Shows Whirlwind bars",
enraged_cmd = "enraged",
enraged_name = "Enrage alert",
enraged_desc = "Announces the boss' Enrage",
} end )
L:RegisterTranslations("deDE", function() return {
ohgan = "Ohgan",
cmd = "Mandokir",
engage_trigger = "feed your souls to Hakkar himself",
watch_trigger = "(.+)! I'm watching you!",
gaze_trigger = "Bloodlord Mandokir beginnt Bedrohlicher Blick zu wirken\.",
gazeafflictyou = "Ihr seid von Bedrohlicher Blick betroffen\.",
gazeafflictother = "(.+) ist von Bedrohlicher Blick betroffen\.",
gazeendyou = "\'Bedrohlicher Blick\' schwindet von Euch\.",
gazeendother = "Bedrohlicher Blick schwindet von (.+)\.",
gazecast = "Bedrohlicher Blick kommt!",
gazewatchedbar = "Bedrohlicher Blick: %s",
enragegain = "Bloodlord Mandokir bekommt \'Wutanfall\'\.",
enragefade = "Wutanfall schwindet von Bloodlord Mandokir\.",
enragebar = "Wutanfall",
wwgain = "Bloodlord Mandokir bekommt \'Wirbelwind\'\.",
wwloss = "Wirbelwind schwindet von Bloodlord Mandokir\.",
ww = "Wirbelwind",
deathyou = "Du stirbst\.",
deathother = "(.+) stirbt\.",
you = "Euch",
watched_warning = "Du wirst beobachtet! Stoppen Sie alles!",
watched_warning_tell = "You are being watched! Stop everything!",
watched_warning_other = "%s wird beobachtet!",
enraged_message = "Ohgan ist tot! Mandokir w\195\188tend!",
announce_cmd = "whispers",
announce_name = "Warnung, wenn Spieler beobachtet werden",
announce_desc = "Warnen, wenn Bloodlord Mandokir wirft Bedrohlicher Blick\n\n(Ben\195\182tigt Schlachtzugleiter oder Assistent)",
puticon_cmd = "puticon",
puticon_name = "Schlachtzugsymbol auf die beobachtet Spieler",
puticon_desc = "Versetzt eine Schlachtzugsymbol auf der beobachteten Spieler.\n\n(Ben\195\182tigt Schlachtzugleiter oder Assistent)",
gaze_cmd = "gaze",
gaze_name = "Alarm f\195\188r Bedrohlicher Blick",
gaze_desc = "Zeigt Balken f\195\188r Bedrohlicher Blick",
whirlwind_cmd = "whirlwind",
whirlwind_name = "Alarm f\195\188r Wirbelwind",
whirlwind_desc = "Zeigt Balken f\195\188r Wirbelwind",
enraged_cmd = "enraged",
enraged_name = "Verk\195\188ndet Boss' Raserei",
enraged_desc = "L\195\164sst dich wissen, wenn Boss h\195\164rter zuschl\195\164gt",
} end )
----------------------------------
-- Module Declaration --
----------------------------------
BigWigsMandokir = BigWigs:NewModule(boss)
BigWigsMandokir.zonename = AceLibrary("Babble-Zone-2.2")["Zul'Gurub"]
BigWigsMandokir.enabletrigger = boss
BigWigsMandokir.bossSync = "Mandokir"
BigWigsMandokir.wipemobs = { L["ohgan"] }
BigWigsMandokir.toggleoptions = {"gaze", "announce", "puticon", "whirlwind", "enraged", "bosskill"}
BigWigsMandokir.revision = tonumber(string.sub("$Revision: 11206 $", 12, -3))
BigWigsMandokir:RegisterYellEngage(L["engage_trigger"])
------------------------------
-- Initialization --
------------------------------
function BigWigsMandokir:OnEnable()
self.started = nil
self:RegisterEvent("CHAT_MSG_MONSTER_YELL")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_SELF", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_PARTY", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE", "Event")
self:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE", "Event")
self:RegisterEvent("CHAT_MSG_COMBAT_FRIENDLY_DEATH", "Event")
self:RegisterEvent("PLAYER_REGEN_DISABLED", "CheckForEngage")
self:RegisterEvent("BigWigs_RecvSync")
self:TriggerEvent("BigWigs_ThrottleSync", "MandokirWWStart", 5)
self:TriggerEvent("BigWigs_ThrottleSync", "MandokirWWStop", 5)
self:TriggerEvent("BigWigs_ThrottleSync", "MandokirEnrageStart", 5)
self:TriggerEvent("BigWigs_ThrottleSync", "MandokirEnrageEnd", 5)
self:TriggerEvent("BigWigs_ThrottleSync", "MandokirGazeCast", 5)
self:TriggerEvent("BigWigs_ThrottleSync", "MandokirGazeAfflict", 5)
self:TriggerEvent("BigWigs_ThrottleSync", "MandokirGazeEnd", 5)
end
------------------------------
-- Events --
------------------------------
function BigWigsMandokir:CHAT_MSG_MONSTER_YELL(msg)
if string.find(msg, L["engage_trigger"]) then
--self:SendEngageSync()
else
local gazetime
local _,_,watchedplayer,_ = string.find(msg, L["watch_trigger"])
if watchedplayer then
if self.db.profile.announce then
if watchedplayer == UnitName("player") then
self:TriggerEvent("BigWigs_Message", L["watched_warning"], "Personal", true, "Alarm")
else
self:TriggerEvent("BigWigs_Message", string.format(L["watched_warning_other"], watchedplayer), "Attention")
self:TriggerEvent("BigWigs_SendTell", watchedplayer, L["watched_warning_tell"])
end
end
if self.db.profile.puticon then
self:TriggerEvent("BigWigs_SetRaidIcon", watchedplayer)
end
if watchedplayer == UnitName("player") then
self:TriggerEvent("BigWigs_ShowIcon", "Interface\\Icons\\Spell_Shadow_Charm", 7)
end
end
end
end
function BigWigsMandokir:Event(msg)
local _,_,gazedplayer,_ = string.find(msg, L["gazeafflictother"])
local _,_,gazedplayerend,_ = string.find(msg, L["gazeendother"])
local _,_,gazeddeathend,_ = string.find(msg, L["deathother"])
if msg == L["wwgain"] then
self:TriggerEvent("BigWigs_SendSync", "MandokirWWStart")
elseif msg == L["wwloss"] then
self:TriggerEvent("BigWigs_SendSync", "MandokirWWStop")
elseif msg == L["enragegain"] then
self:TriggerEvent("BigWigs_SendSync", "MandokirEnrageStart")
elseif msg == L["enragefade"] then
self:TriggerEvent("BigWigs_SendSync", "MandokirEnrageEnd")
elseif msg == L["gaze_trigger"] then
self:TriggerEvent("BigWigs_SendSync", "MandokirGazeCast")
elseif msg == L["gazeafflictyou"] then
gazetime = GetTime()
self:TriggerEvent("BigWigs_SendSync", "MandokirGazeAfflict "..UnitName("player"))
elseif gazedplayer then
gazetime = GetTime()
self:TriggerEvent("BigWigs_SendSync", "MandokirGazeAfflict "..gazedplayer)
elseif msg == L["gazeendyou"] then
self:TriggerEvent("BigWigs_SendSync", "MandokirGazeEnd "..UnitName("player"))
elseif gazedplayerend and gazedplayerend~=L["you"] then
self:TriggerEvent("BigWigs_SendSync", "MandokirGazeEnd "..gazedplayerend)
elseif msg == L["deathyou"] then
self:TriggerEvent("BigWigs_SendSync", "MandokirGazeEnd "..UnitName("player"))
elseif gazeddeathend then
self:TriggerEvent("BigWigs_SendSync", "MandokirGazeEnd "..gazeddeathend)
end
end
function BigWigsMandokir:BigWigs_RecvSync(sync, rest, nick)
if not self.started and sync == "BossEngaged" and rest == self.bossSync then
self:StartFight()
self:TriggerEvent("BigWigs_StartBar", self, "Charge", 15, "Interface\\Icons\\Ability_Warrior_Charge")
-- todo check combat log regarding CHARGE to trigger the ones following the first
self:TriggerEvent("BigWigs_StartBar", self, "Next Whirlwind", 20, "Interface\\Icons\\Ability_Whirlwind")
self:TriggerEvent("BigWigs_StartBar", self, "Next Gaze", 33, "Interface\\Icons\\Spell_Shadow_Charm")
elseif sync == "MandokirWWStart" and self.db.profile.whirlwind then
self:TriggerEvent("BigWigs_StartBar", self, L["ww"], 2, "Interface\\Icons\\Ability_Whirlwind")
--self:ScheduleEvent("BigWigs_StartBar", 2, self, "Next Whirlwind", 18, "Interface\\Icons\\Ability_Whirlwind")
elseif sync == "MandokirWWStop" and self.db.profile.whirlwind then
self:TriggerEvent("BigWigs_StopBar", self, L["ww"])
self:TriggerEvent("BigWigs_StartBar", self, "Next Whirlwind", 18, "Interface\\Icons\\Ability_Whirlwind")
elseif sync == "MandokirEnrageStart" and self.db.profile.enraged then
self:TriggerEvent("BigWigs_Message", L["enraged_message"], "Urgent")
self:TriggerEvent("BigWigs_StartBar", self, L["enragebar"], 90, "Interface\\Icons\\Spell_Shadow_UnholyFrenzy")
elseif sync == "MandokirEnrageEnd" and self.db.profile.enraged then
self:TriggerEvent("BigWigs_StopBar", self, L["enragebar"])
elseif sync == "MandokirGazeCast" and self.db.profile.gaze then
self:TriggerEvent("BigWigs_StartBar", self, L["gazecast"], 2, "Interface\\Icons\\Spell_Shadow_Charm")
self:TriggerEvent("BigWigs_StopBar", self, "Next Gaze")
elseif sync == "MandokirGazeAfflict" and self.db.profile.gaze then
self:TriggerEvent("BigWigs_StartBar", self, string.format(L["gazewatchedbar"], rest), 5, "Interface\\Icons\\Spell_Shadow_Charm", true, "Black")
elseif sync == "MandokirGazeEnd" then
if self.db.profile.gaze then
self:TriggerEvent("BigWigs_StopBar", self, string.format(L["gazewatchedbar"], rest))
end
if self.db.profile.puticon then
self:TriggerEvent("BigWigs_RemoveRaidIcon", rest)
end
self:TriggerEvent("BigWigs_StartBar", self, "Next Gaze", 11, "Interface\\Icons\\Spell_Shadow_Charm")
end
end