vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 IMBA_KelThuzad_FrostBlasted={};
2 IMBA_KelThuzad_FrostBlastTexture="Spell_Frost_FreezingBreath"
3  
4 IMBA_KelThuzad_ShadowFissure_Time = 15
5 IMBA_KelThuzad_ShadowFissure_Msg = "Kel'Thuzad casts Shadow Fissure."
6  
7 IMBA_KelThuzad_FrostboltVolley_Time = 15
8 IMBA_KelThuzad_FrostboltVolley_Msg = "Kel'Thuzad ?'s Frostbolt hits ([^%s]+) for ([^%s]+) Frost damage." --(2295-4140)
9  
10 IMBA_KelThuzad_DetonateMana_Time = 20
11 IMBA_KelThuzad_DetonateMana_Msg = "^([^%s]+) ([^%s]+) afflicted by Detonate Mana"
12  
13 IMBA_KelThuzad_FrostBlast_Time = 30
14 IMBA_KelThuzad_FrostBlast_Msg = "^([^%s]+) ([^%s]+) afflicted by Frost Blast."
15  
16 IMBA_KelThuzad_Stage1_Yell = "Minions, servants, soldiers of the cold dark! Obey the call of Kel'Thuzad!"
17 IMBA_KelThuzad_Stage1_Time = 315
18 IMBA_KelThuzad_Stage1_End_Yell1 = "Pray for mercy!"
19 IMBA_KelThuzad_Stage1_End_Yell2 = "Scream your dying breath!"
20 IMBA_KelThuzad_Stage1_End_Yell3 = "The end is upon you!"
21 IMBA_KelThuzad_Stage1_End_Time = 15
22  
23 IMBA_KelThuzad_Stage3_Time = 15
24 IMBA_KelThuzad_Stage3_Yell1 = "Master, I require aid!"
25 IMBA_KelThuzad_Stage3_Yell2 = "Very well. Warriors of the frozen wastes, rise up! I command you to fight, kill and die for your master! Let none survive!"
26  
27 IMBA_KelThuzad_Chains_Msg = "^([^%s]+) ([^%s]+) afflicted by Chains of Kel'Thuzad."
28 IMBA_KelThuzad_Chains_Time = 20
29 IMBA_KelThuzad_Chains_Time2 = 50
30  
31  
32 function IMBA_KelThuzad_FrostBlastWarning()
33 IMBA_KelThuzad_TimerFrostBlast.active=false;
34 IMBA_RangeChecker_Active=true;
35 IMBA_AddRaidAlert("** Frost Blast Incoming! Spread Out! **",IMBA_CheckVar("Kel'Thuzad","AnnounceFrostBlast"),IMBA_CheckVar("Kel'Thuzad","AnnounceFrostBlast"));
36 end
37  
38 function IMBA_KelThuzad_Stage1Start()
39 IMBA_KelThuzad_TimerStage1:SetBarText("Stage 1 Ends in");
40 IMBA_KelThuzad_TimerStage1:StartTimer(IMBA_KelThuzad_Stage1_Time,false);
41 end
42  
43 function IMBA_KelThuzad_Stage1End()
44 IMBA_KelThuzad_TimerStage1:SetBarText("Kel'Thuzad targetable in");
45 IMBA_KelThuzad_TimerStage1:StartTimer(IMBA_KelThuzad_Stage1_End_Time,false);
46 IMBA_RangeChecker_Active=true;
47 end
48  
49 function IMBA_MindControlWarn()
50 IMBA_AddRaidAlert("** Mind Control in the Next 30 Seconds **",IMBA_CheckVar("Kel'Thuzad","WarnMindControl"),IMBA_CheckVar("Kel'Thuzad","WarnMindControl"));
51 IMBA_KelThuzad_TimerStage1.callback=IMBA_Null;
52 end
53  
54 function IMBA_KelThuzad_ChainsNext()
55 IMBA_KelThuzad_TimerStage1:SetBarText("Next Mind Control in");
56 IMBA_KelThuzad_TimerStage1:StartTimer(IMBA_KelThuzad_Chains_Time2,false,IMBA_MindControlWarn);
57 end
58  
59 function IMBA_KelThuzad_ChainsEnd()
60 IMBA_KelThuzad_TimerStage1:SetBarText("Mind Control ends in");
61 IMBA_KelThuzad_TimerStage1:StartTimer(IMBA_KelThuzad_Chains_Time2,false,IMBA_KelThuzad_ChainsNext);
62 end
63  
64 function IMBA_KelThuzad_Stage3Start()
65 IMBA_KelThuzad_TimerStage1:SetBarText("First Guardian in");
66 IMBA_KelThuzad_TimerStage1:StartTimer(IMBA_KelThuzad_Stage3_Time,false);
67 end
68  
69 function IMBA_KelThuzad_YellActivator(arg1)
70 if string.find(arg1,IMBA_KelThuzad_Stage1_Yell) then
71 IMBA_KelThuzad_Stage1Start();
72 if IMBA_CheckVar("Kel'Thuzad","ActivateRangeChecker") then
73 IMBA_RangeChecker:Show();
74 end
75 IMBA_KelThuzad:Show();
76 end
77 end
78  
79 function IMBA_KelThuzad_RegisterEvents()
80 this:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE");
81 this:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_PARTY_DAMAGE");
82 this:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE");
83  
84 this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE");
85 this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE");
86 this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE");
87 this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE");
88  
89 this:RegisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_BUFF");
90 this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS");
91  
92 this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER");
93 this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_PARTY");
94 this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_SELF");
95  
96 this:RegisterEvent("CHAT_MSG_MONSTER_YELL");
97 end
98  
99 function IMBA_KelThuzad_UnregisterEvents()
100 this:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE");
101 this:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_PARTY_DAMAGE");
102 this:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE");
103  
104 this:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE");
105 this:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE");
106 this:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE");
107 this:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE");
108  
109 this:UnregisterEvent("CHAT_MSG_SPELL_CREATURE_VS_CREATURE_BUFF");
110 this:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_BUFFS");
111  
112 this:UnregisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER");
113 this:UnregisterEvent("CHAT_MSG_SPELL_AURA_GONE_PARTY");
114 this:UnregisterEvent("CHAT_MSG_SPELL_AURA_GONE_SELF");
115  
116 this:UnregisterEvent("CHAT_MSG_MONSTER_YELL");
117 end
118  
119 function IMBA_KelThuzad_OnLoad()
120 this:SetBackdropBorderColor(1, 1, 1, 1);
121 this:SetBackdropColor(0.0,0.0,0.0,0.6);
122  
123  
124 IMBA_KelThuzad_Title:SetText("Kel'Thuzad Status");
125  
126 IMBA_KelThuzad_TimerFissure:SetBarText("Shadow Fissure in");
127 IMBA_KelThuzad_TimerVolley:SetBarText("Frostbolt Volley in");
128 IMBA_KelThuzad_TimerDetonateMana:SetBarText("Detonate Mana in");
129 IMBA_KelThuzad_TimerFrostBlast:SetBarText("Frost Blast in");
130 IMBA_KelThuzad_TimerStage1:SetBarText("Stage 1 Ends in");
131  
132 IMBA_KelThuzad_HealthKelThuzad.UnitName="Kel'Thuzad";
133  
134 IMBA_KelThuzad_TitleFrostBlasted:SetText("Frost Blasted Players");
135  
136 IMBA_KelThuzad_FrostBlastCheckTime=0;
137 IMBA_KelThuzad_FrostBlast_Lockout=0;
138 IMBA_KelThuzad_Frostbolt_Lockout=0;
139  
140 IMBA_AddAddon("Kel'Thuzad", "Timers for Shadow Fissure, Frostbolt, Detonate Mana, and Frost Blast", IMBA_LOCATIONS_NAXX_LAIR, nil, "IMBA_KelThuzad_YellActivator", IMBA_KelThuzad_Stage1_Yell,"IMBA_KelThuzad");
141 IMBA_AddOption2("Kel'Thuzad","AnnounceShadow","Announce Shadow Fissure");
142 IMBA_AddOption2("Kel'Thuzad","AnnounceDetonate","Announce Detonate Mana");
143 IMBA_AddOption2("Kel'Thuzad","MarkDetonate","Marks Detonate Mana with Skull");
144 IMBA_AddOption2("Kel'Thuzad","AnnounceMindControl","Announce Mind Controls");
145 IMBA_AddOption2("Kel'Thuzad","WarnMindControl","Warn for Mind Controls");
146 IMBA_AddOption2("Kel'Thuzad","AnnounceFrostBlast","Announce Frost Blasts");
147 IMBA_AddOption2("Kel'Thuzad","AnnounceStage2","Announce Stage Transitions");
148 IMBA_AddOption2("Kel'Thuzad","ActivateRangeChecker","Activate Range Checker");
149 IMBA_KelThuzad_FrostBlastCheckTime=0;
150 end
151  
152 function IMBA_KelThuzad_AddFrostBlasted(name)
153 tinsert(IMBA_KelThuzad_FrostBlasted,{IMBA_FindPlayerUnitByName(name),0});
154 end
155  
156 function IMBA_KelThuzad_Sort(v1,v2)
157 if v1[2]==v2[2] then
158 return v1[1]<v2[1];
159 else
160 return v1[2]<v2[2];
161 end
162 end
163  
164 function IMBA_KelThuzad_OnUpdate()
165 local i, Blasted, Remove;
166 local numEntries = getn(IMBA_KelThuzad_FrostBlasted);
167  
168 for k, v in IMBA_KelThuzad_FrostBlasted do
169 v[2]=UnitHealth(v[1]);
170 end
171  
172 table.sort(IMBA_KelThuzad_FrostBlasted, IMBA_KelThuzad_Sort);
173 for i=1,3,1 do
174 if i<=numEntries then
175 getglobal("IMBA_KelThuzad_FrostBlast"..i).unit=IMBA_KelThuzad_FrostBlasted[i][1];
176 else
177 getglobal("IMBA_KelThuzad_FrostBlast"..i).unit=nil;
178 end
179 end
180  
181 if (numEntries>0) and (IMBA_KelThuzad_FrostBlastCheckTime<GetTime()) then
182 IMBA_KelThuzad_FrostBlastCheckTime=GetTime()+0.5;
183 Removed=0;
184 for i=1,numEntries,1 do
185 Blasted=false
186 for a=1,16 do
187 local t,c = UnitDebuff(IMBA_KelThuzad_FrostBlasted[i-Removed][1],a);
188 if(t == nil) then break; end;
189 if string.find(t,IMBA_KelThuzad_FrostBlastTexture) then
190 Blasted=true;
191 break;
192 end
193 end
194  
195 if (Blasted==false) then
196 tremove(IMBA_KelThuzad_FrostBlasted,i-Removed);
197 Removed=Removed+1;
198 end
199 end
200 end
201 end
202  
203  
204 function IMBA_KelThuzad_OnEvent(event)
205 if (event == "CHAT_MSG_SPELL_PERIODIC_SELF_DAMAGE") or (event == "CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE") or (event == "CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE") or (event == "CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE") then
206  
207 local iStart, iEnd, sPlayer, sType = string.find(arg1, IMBA_KelThuzad_FrostBlast_Msg);
208 if ( sPlayer and sType ) then
209 if ( sPlayer == "You" and sType == "are" ) then
210 IMBA_KelThuzad_AddFrostBlasted(UnitName("player"));
211 IMBA_AddRaidAlert("** "..UnitName("player").." is Frost Blasted **",IMBA_CheckVar("Kel'Thuzad","AnnounceFrostBlast"),IMBA_CheckVar("Kel'Thuzad","AnnounceFrostBlast"));
212 else
213 IMBA_KelThuzad_AddFrostBlasted(sPlayer);
214 IMBA_AddRaidAlert("** "..sPlayer.." is Frost Blasted **",IMBA_CheckVar("Kel'Thuzad","AnnounceFrostBlast"),IMBA_CheckVar("Kel'Thuzad","AnnounceFrostBlast"));
215 end
216 if GetRaidTargetIndex("player")~=8 then
217 IMBA_RangeChecker_Active=false;
218 end
219 if IMBA_KelThuzad_FrostBlast_Lockout<GetTime() then
220 IMBA_KelThuzad_FrostBlast_Lockout=GetTime()+5;
221 IMBA_KelThuzad_TimerFrostBlast:StartTimer(IMBA_KelThuzad_FrostBlast_Time,false,IMBA_KelThuzad_FrostBlastWarning);
222 IMBA_KelThuzad_TimerFrostBlast:StartWarningTimer("** Frost Blast Incoming in ~5 Seconds! **",5.1,IMBA_CheckVar("Kel'Thuzad","AnnounceFrostBlast"),IMBA_CheckVar("Kel'Thuzad","AnnounceFrostBlast"));
223 end
224 return;
225 end
226  
227 iStart, iEnd, sPlayer, sType = string.find(arg1, IMBA_KelThuzad_DetonateMana_Msg);
228 if ( sPlayer and sType ) then
229 if ( sPlayer == "You" and sType == "are" ) then
230 IMBA_RangeChecker_Active=true;
231 IMBA_AddRaidAlert("** "..UnitName("player").."'s Mana is Detonating **",IMBA_CheckVar("Kel'Thuzad","AnnounceDetonate"),IMBA_CheckVar("Kel'Thuzad","AnnounceDetonate"));
232 if IMBA_CheckVar("Kel'Thuzad","MarkDetonate") then
233 SetRaidTarget("player",8);
234 end
235  
236 else
237 if IsRaidLeader() or IsRaidOfficer() then
238 SendChatMessage("YOUR MANA IS DETONATING!!!", "WHISPER", nil, sPlayer);
239 end
240  
241 IMBA_AddRaidAlert("** "..sPlayer.."'s Mana is Detonating **",IMBA_CheckVar("Kel'Thuzad","AnnounceDetonate"),IMBA_CheckVar("Kel'Thuzad","AnnounceDetonate"));
242 if IMBA_CheckVar("Kel'Thuzad","MarkDetonate") then
243 local markUnit=IMBA_FindPlayerUnitByName(sPlayer)
244 if UnitExists(markUnit) then
245 SetRaidTarget(markUnit,8);
246 end
247 end
248 end
249 IMBA_KelThuzad_TimerDetonateMana:StartTimer(IMBA_KelThuzad_DetonateMana_Time,false);
250 return;
251 end
252  
253 iStart, iEnd, sPlayer, sType = string.find(arg1, IMBA_KelThuzad_Chains_Msg);
254 if ( sPlayer and sType ) then
255 if ( sPlayer == "You" and sType == "are" ) then
256 IMBA_AddRaidAlert("** "..UnitName("player").." is Mind Controlled **",IMBA_CheckVar("Kel'Thuzad","AnnounceMindControl"),IMBA_CheckVar("Kel'Thuzad","AnnounceMindControl"));
257 else
258 IMBA_AddRaidAlert("** "..sPlayer.." is Mind Controlled **",IMBA_CheckVar("Kel'Thuzad","AnnounceMindControl"),IMBA_CheckVar("Kel'Thuzad","AnnounceMindControl"));
259 end
260 IMBA_KelThuzad_ChainsEnd();
261 return;
262 end
263  
264 elseif (event == "CHAT_MSG_SPELL_CREATURE_VS_PARTY_DAMAGE") or (event == "CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE") or (event == "CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE") then
265 local iStart, iEnd, sPlayer, dDamage = string.find(arg1, IMBA_KelThuzad_FrostboltVolley_Msg);
266 if sPlayer and dDamage then
267 dDamage=tonumber(dDamage);
268 if (IMBA_KelThuzad_Frostbolt_Lockout<GetTime()) and (dDamage>2290) and (dDamage<4145) then
269 IMBA_KelThuzad_TimerVolley:StartTimer(IMBA_KelThuzad_FrostboltVolley_Time,false);
270 IMBA_KelThuzad_Frostbolt_Lockout=GetTime()+7.5;
271 end
272 return;
273 end
274  
275 if arg1==IMBA_KelThuzad_ShadowFissure_Msg then
276 IMBA_AddRaidAlert("** Shadow Fissure about to Explode **",IMBA_CheckVar("Kel'Thuzad","AnnounceShadow"),IMBA_CheckVar("Kel'Thuzad","AnnounceShadow"));
277 IMBA_KelThuzad_TimerFissure:StartTimer(IMBA_KelThuzad_ShadowFissure_Time,false);
278 return;
279 end
280 elseif (event == "CHAT_MSG_SPELL_AURA_GONE_OTHER") or (event == "CHAT_MSG_SPELL_AURA_GONE_SELF") or (event == "CHAT_MSG_SPELL_AURA_GONE_PARTY") then
281 local iStart, iEnd, sPlayer = string.find(arg1, "Detonate Mana fades from ([^%s]+)[.]");
282 if ( sPlayer ) then
283 if ( sPlayer == "you" ) then
284 if IMBA_KelThuzad_TimerFrostBlast.timeEnd>GetTime() then
285 IMBA_RangeChecker_Active=false;
286 end
287 if IMBA_CheckVar("Kel'Thuzad","MarkDetonate") then
288 SetRaidTarget("player",0);
289 end
290 else
291 if IMBA_CheckVar("Kel'Thuzad","MarkDetonate") then
292 local markUnit=IMBA_FindPlayerUnitByName(sPlayer)
293  
294 if UnitExists(markUnit) then
295 SetRaidTarget(markUnit,0);
296 end
297 end
298 end
299 return;
300 end
301  
302 if string.find(arg1,"Frost Blast fades") then
303 IMBA_KelThuzad_FrostBlasted={};
304 end
305 elseif event == "CHAT_MSG_MONSTER_YELL" then
306 if string.find(arg1,IMBA_KelThuzad_Stage1_End_Yell1) or string.find(arg1,IMBA_KelThuzad_Stage1_End_Yell2) or string.find(arg1,IMBA_KelThuzad_Stage1_End_Yell3) then
307 IMBA_AddRaidAlert("** Stage 1 About to End (Kel'Thuzad Targetable in 15 Seconds) **",IMBA_CheckVar("Kel'Thuzad","AnnounceStage2"),IMBA_CheckVar("Kel'Thuzad","AnnounceStage2"));
308 IMBA_KelThuzad_Stage1End();
309 elseif string.find(arg1,IMBA_KelThuzad_Stage3_Yell1) then
310 IMBA_AddRaidAlert("** First Guardian in ~15 Seconds **",IMBA_CheckVar("Kel'Thuzad","AnnounceStage2"),IMBA_CheckVar("Kel'Thuzad","AnnounceStage2"));
311 IMBA_KelThuzad_Stage3Start();
312 elseif string.find(arg1,IMBA_KelThuzad_Stage3_Yell2) then
313 IMBA_AddRaidAlert("** First Guardian in ~10 Seconds **",IMBA_CheckVar("Kel'Thuzad","AnnounceStage2"),IMBA_CheckVar("Kel'Thuzad","AnnounceStage2"));
314 end
315 end
316 end