-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGluth.lua
192 lines (146 loc) · 5.81 KB
/
Gluth.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
------------------------------
-- Are you local? --
------------------------------
local boss = AceLibrary("Babble-Boss-2.2")["Gluth"]
local L = AceLibrary("AceLocale-2.2"):new("BigWigs"..boss)
----------------------------
-- Localization --
----------------------------
L:RegisterTranslations("enUS", function() return {
cmd = "Gluth",
fear_cmd = "fear",
fear_name = "Fear Alert",
fear_desc = "Warn for fear",
frenzy_cmd = "frenzy",
frenzy_name = "Frenzy Alert",
frenzy_desc = "Warn for frenzy",
enrage_cmd = "enrage",
enrage_name = "Enrage Timer",
enrage_desc = "Warn for Enrage",
decimate_cmd = "decimate",
decimate_name = "Decimate Alert",
decimate_desc = "Warn for Decimate",
trigger1 = "%s goes into a frenzy!",
ftrigger1 = "gains Frenzy",
etrigger1 = "gains Berserk",
trigger2 = "by Terrifying Roar.",
starttrigger = "devours all nearby zombies!",
warn1 = "Frenzy Alert!",
warn2 = "5 second until AoE Fear!",
warn3 = "AoE Fear alert - 20 seconds till next!",
enragewarn = "ENRAGE!",
enragebartext = "Enrage",
ewarn1 = "Enrage in 90 seconds",
ewarn2 = "Enrage in 30 seconds",
ewarn3 = "Enrage in 10 seconds",
startwarn = "Gluth Engaged! ~1:45 till Decimate!",
decimatesoonwarn = "Decimate Soon!",
decimatebar = "Decimate Zombies",
zombies_cmd = "zombies",
zombies_name = "Zombie Spawn",
zombies_desc = "Shows timer for zombies",
zombiebar = "Next Zombie - %d",
bar1text = "AoE Fear",
testtrigger = "testtrigger";
} end )
----------------------------------
-- Module Declaration --
----------------------------------
BigWigsGluth = BigWigs:NewModule(boss)
BigWigsGluth.zonename = AceLibrary("Babble-Zone-2.2")["Naxxramas"]
BigWigsGluth.enabletrigger = boss
BigWigsGluth.bossSync = "Gluth"
BigWigsGluth.toggleoptions = {"frenzy", "fear", "decimate", "enrage", "bosskill", "zombies"}
BigWigsGluth.revision = tonumber(string.sub("$Revision: 15380 $", 12, -3))
------------------------------
-- Initialization --
------------------------------
function BigWigsGluth:OnEnable()
self.started = nil
self.prior = nil
self.zomnum = 1
self:RegisterEvent("BigWigs_Message")
self:RegisterEvent("PLAYER_REGEN_DISABLED", "CheckForEngage")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS", "Frenzy")
self:RegisterEvent("CHAT_MSG_MONSTER_EMOTE", "Frenzy")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS", "Enrage")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE", "Fear")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE", "Fear")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE", "Fear")
self:RegisterEvent("BigWigs_RecvSync")
end
function BigWigsGluth:Zombies()
self:TriggerEvent("BigWigs_StartBar", self, string.format(L["zombiebar"],self.zomnum), 10, "Interface\\Icons\\Ability_Seal")
if self.zomnum <= 10
then
self.zomnum = self.zomnum + 1
elseif self.zomnum > 10
then
self:CancelScheduledEvent("bwgluthzbrepop") self:TriggerEvent("BigWigs_StopBar", self, string.format(L["zombiebar"], self.zomnum ))
self.zomnum = 1
end
end
function BigWigsGluth:Zombie()
self:ScheduleRepeatingEvent("bwgluthzbrepop", self.Zombies, 10, self)
end
function BigWigsGluth:Frenzy( msg )
if self.db.profile.zombies and msg == L["trigger1"] then
self:TriggerEvent("BigWigs_Message", L["warn1"], "Important")
end
end
function BigWigsGluth:Fear( msg )
if self.db.profile.fear and not self.prior and string.find(msg, L["trigger2"]) then
self:TriggerEvent("BigWigs_Message", L["warn3"], "Important")
self:TriggerEvent("BigWigs_StartBar", self, L["bar1text"], 20, "Interface\\Icons\\Spell_Shadow_PsychicScream")
self:ScheduleEvent("BigWigs_Message", 15, L["warn2"], "Urgent")
self.prior = true
end
end
function BigWigsGluth:Decimate()
if self.db.profile.decimate then
self:TriggerEvent("BigWigs_StartBar", self, L["decimatebar"], 104, "Interface\\Icons\\INV_Shield_01")
self:ScheduleEvent("bwgluthdecimatewarn", "BigWigs_Message", 97, L["decimatesoonwarn"], "Urgent")
end
if self.db.profile.zombies then
self.zomnum = 1
self:TriggerEvent("BigWigs_StartBar", self, string.format(L["zombiebar"],self.zomnum), 10, "Interface\\Icons\\Ability_Seal")
self.zomnum = self.zomnum + 1
self:Zombie()
end
end
function BigWigsGluth:BigWigs_RecvSync(sync, rest, nick)
if not self.started and sync == "BossEngaged" and rest == self.bossSync then
self:StartFight()
if self:IsEventRegistered("PLAYER_REGEN_DISABLED") then self:UnregisterEvent("PLAYER_REGEN_DISABLED") end
if self.db.profile.decimate then
self:TriggerEvent("BigWigs_Message", L["startwarn"], "Attention")
self:Decimate()
self:ScheduleRepeatingEvent( "bwgluthdecimate", self.Decimate, 104, self )
end
if self.db.profile.zombies then
self.zomnum = 1
self:TriggerEvent("BigWigs_StartBar", self, string.format(L["zombiebar"],self.zomnum), 10, "Interface\\Icons\\Ability_Seal")
self.zomnum = self.zomnum + 1
self:Zombie()
end
if self.db.profile.enrage then
self:TriggerEvent("BigWigs_StartBar", self, L["enragebartext"], 324, "Interface\\Icons\\Spell_Shadow_UnholyFrenzy")
self:ScheduleEvent("bwgluthwarn1", "BigWigs_Message", 254, L["ewarn1"], "Attention")
self:ScheduleEvent("bwgluthwarn2", "BigWigs_Message", 294, L["ewarn2"], "Attention")
self:ScheduleEvent("bwgluthwarn3", "BigWigs_Message", 314, L["ewarn3"], "Urgent")
end
end
end
function BigWigsGluth:Enrage( msg )
if string.find(msg, L["etrigger1"]) then
if self.db.profile.enrage then self:TriggerEvent("BigWigs_Message", L["enragewarn"], "Important") end
self:CancelScheduledEvent("bwgluthdecimate")
self:CancelScheduledEvent("bwgluthdecimatewarn")
self:CancelScheduledEvent("bwgluthwarn1")
self:CancelScheduledEvent("bwgluthwarn2")
self:CancelScheduledEvent("bwgluthwarn3")
end
end
function BigWigsGluth:BigWigs_Message(text)
if text == L["warn2"] then self.prior = nil end
end