vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 tinsert(UISpecialFrames, "CT_RA_SlashCmdFrame");
2 function CT_RASlashCmd_DisplayDialog()
3 table.sort(CT_RA_SlashCmds, function(t1, t2)
4 return t1[2] < t2[2]
5 end);
6 -- Initialize dialog
7 local totalHeight = 0;
8 for i = 1, 30, 1 do
9 local obj = getglobal("CT_RA_SlashCmdFrameScrollFrameCmdsCmd" .. i);
10 if ( CT_RA_SlashCmds[i] ) then
11 obj.slashCommand = CT_RA_SlashCmds[i][2];
12 obj:Show();
13 getglobal(obj:GetName() .. "Text"):SetText(CT_RA_SlashCmds[i][2]);
14 getglobal(obj:GetName() .. "Description"):SetText(CT_RA_SlashCmds[i][3]);
15 if ( strlen(CT_RA_SlashCmds[i][4]) > 0 ) then
16 getglobal(obj:GetName() .. "Available"):SetText("Shortcuts Available: |c00FFFFFF" .. CT_RA_SlashCmds[i][4] .. "|r");
17 obj:SetHeight(CT_RA_SlashCmds[i][1]+33);
18 else
19 getglobal(obj:GetName() .. "Available"):SetText("");
20 obj:SetHeight(CT_RA_SlashCmds[i][1]+25);
21 end
22 getglobal(obj:GetName() .. "Description"):SetHeight(CT_RA_SlashCmds[i][1]);
23 totalHeight = totalHeight + CT_RA_SlashCmds[i][1];
24 else
25 obj:Hide();
26 end
27 if ( i > 1 ) then
28 obj:SetPoint("TOPLEFT", "CT_RA_SlashCmdFrameScrollFrameCmdsCmd" .. (i-1), "BOTTOMLEFT");
29 end
30 end
31 CT_RA_SlashCmdFrameScrollFrameCmds:SetHeight(totalHeight);
32 ShowUIPanel(CT_RA_SlashCmdFrame);
33 CT_RA_SlashCmdFrameScrollFrame:UpdateScrollChildRect();
34  
35 local minVal, maxVal = CT_RA_SlashCmdFrameScrollFrameScrollBar:GetMinMaxValues();
36 if ( maxVal == 0 ) then
37 CT_RA_SlashCmdFrameScrollFrameScrollBar:Hide();
38 else
39 CT_RA_SlashCmdFrameScrollFrameScrollBar:Show();
40 end
41 end
42  
43 CT_RA_SlashCmds = { };
44  
45 function CT_RA_RegisterSlashCmd(title, description, height, identifier, func, ...)
46 SlashCmdList[identifier] = func;
47 local otherCmds = "";
48 for i = 1, arg.n, 1 do
49 setglobal("SLASH_" .. identifier .. i, arg[i]);
50 if ( i > 1 ) then
51 if ( strlen(otherCmds) > 0 ) then
52 otherCmds = otherCmds .. ", ";
53 end
54 otherCmds = otherCmds .. arg[i];
55 end
56 end
57 local num = 0;
58 while ( string.find(description, "|b.-|eb") ) do
59 description = string.gsub(description, "^(.*)|b(.-)|eb(.*)$", "%1|c00FFD100%2|r%3");
60 num = num + 1;
61 if ( num > 10 ) then
62 break;
63 end
64 end
65 tinsert(CT_RA_SlashCmds, { height, title, description, otherCmds });
66 end
67  
68  
69 -- Functions used by slash commands
70 function CT_RA_CheckReady()
71 if ( CT_RA_Level >= 1 ) then
72 SendChatMessage("<CTRaid> " .. UnitName("player") .. " has performed a ready check.", "RAID");
73 CT_RA_AddMessage("CHECKREADY");
74 local numValid = 0;
75 for i = 1, GetNumRaidMembers(), 1 do
76 local name, rank, subgroup, level, class, fileName, zone, online, isDead = GetRaidRosterInfo(i);
77 if ( name ~= UnitName("player") and CT_RA_Stats[name] and CT_RA_Stats[name]["Reporting"] and online and CT_RA_Stats[name]["Version"] and CT_RA_Stats[name]["Version"] >= 1.097 ) then
78 numValid = numValid + 1;
79 CT_RA_Stats[name]["notready"] = 1;
80 end
81 end
82 if ( numValid == 1 ) then
83 CT_RA_Print("<CTRaid> Ready status is being checked for |c00FFFFFF" .. numValid .. "|r raid member.", 1, 1, 0);
84 else
85 CT_RA_Print("<CTRaid> Ready status is being checked for |c00FFFFFF" .. numValid .. "|r raid members.", 1, 1, 0);
86 end
87 CT_RA_UpdateFrame.readyTimer = 30;
88 CT_RA_UpdateRaidGroup(0);
89 else
90 CT_RA_Print("<CTRaid> You need to be promoted or leader to do that!", 1, 1, 0);
91 end
92 end
93  
94 function CT_RA_CheckVote(question)
95 if ( CT_RA_Level >= 1 ) then
96 SendChatMessage("<CTRaid> " .. UnitName("player") .. " has performed a vote: " .. question, "RAID");
97 CT_RA_AddMessage("VOTE " .. question);
98 CT_RA_Print("<CTRaid> Performing raid vote: |c00FFFFFF" .. question .. "|r", 1, 1, 0);
99 CT_RA_UpdateFrame.voteTimer = 30;
100 else
101 CT_RA_Print("<CTRaid> You need to be promoted or leader to do that!", 1, 1, 0);
102 end
103 end
104  
105 function CT_RA_CheckRly()
106 if ( CT_RA_Level >= 1 ) then
107 --~ SendChatMessage("<CTRaid> " .. UnitName("player") .. " asks the raid: O RLY?", "RAID");
108 CT_RA_AddMessage("CHECKRLY");
109 local numValid = 0;
110 for i = 1, GetNumRaidMembers(), 1 do
111 local name, rank, subgroup, level, class, fileName, zone, online, isDead = GetRaidRosterInfo(i);
112 if ( name ~= UnitName("player") and CT_RA_Stats[name] and CT_RA_Stats[name]["Reporting"] and online and CT_RA_Stats[name]["Version"] and CT_RA_Stats[name]["Version"] >= 1.097 ) then
113 numValid = numValid + 1;
114 CT_RA_Stats[name]["rly"] = 1;
115 end
116 end
117 if ( numValid == 1 ) then
118 CT_RA_Print("<CTRaid> O RLY status is being checked for |c00FFFFFF" .. numValid .. "|r raid member.", 1, 1, 0);
119 else
120 CT_RA_Print("<CTRaid> O RLY status is being checked for |c00FFFFFF" .. numValid .. "|r raid members.", 1, 1, 0);
121 end
122 CT_RA_UpdateFrame.rlyTimer = 30;
123 CT_RA_UpdateRaidGroup(0);
124 else
125 CT_RA_Print("<CTRaid> You need to be promoted or leader to do that!", 1, 1, 0);
126 end
127 end
128  
129 function CT_RA_Invite(msg)
130 if ( not GetGuildInfo("player") ) then
131 CT_RA_Print("<CTRaid> You need to be in a guild to mass invite.");
132 return;
133 end
134 if ( ( not CT_RA_Level or CT_RA_Level == 0 ) and GetNumRaidMembers() > 0 ) then
135 CT_RA_Print("<CTRaid> You must be promoted or raid leader to mass invite.", 1, 1, 0);
136 return;
137 end
138 local inZone = "";
139 if ( CT_RA_ZoneInvite ) then
140 inZone = " in " .. GetRealZoneText();
141 end
142 local useless, useless, min, max = string.find(msg, "^(%d+)-(%d+)$");
143 min = tonumber(min);
144 max = tonumber(max);
145 if ( min and max ) then
146 if ( min > max ) then
147 local temp = min;
148 min = max;
149 max = temp;
150 end
151 if ( min < 1 ) then min = 1; end
152 if ( max > 60 ) then max = 60; end
153 if ( min == max ) then
154 SendChatMessage("Raid invites are coming in 10 seconds for players level " .. min .. inZone .. ", leave your groups.", "GUILD");
155 else
156 SendChatMessage("Raid invites are coming in 10 seconds for players level " .. min .. " to " .. max .. inZone .. ", leave your groups.", "GUILD");
157 end
158 GuildRoster();
159 CT_RA_MinLevel = min;
160 CT_RA_MaxLevel = max;
161 CT_RA_UpdateFrame.startinviting = 10;
162 else
163 useless, useless, min = string.find(msg, "^(%d+)$");
164 min = tonumber(min);
165 if ( min ) then
166 if ( min < 1 ) then min = 1; end
167 if ( min > 60 ) then min = 60; end
168 GuildRoster();
169 SendChatMessage("Raid invites are coming in 10 seconds for players level " .. min .. inZone .. ", leave your groups.", "GUILD");
170 CT_RA_MinLevel = min;
171 CT_RA_MaxLevel = min;
172 CT_RA_UpdateFrame.startinviting = 10;
173 else
174 if ( CT_RA_ZoneInvite ) then
175 CT_RA_Print("<CTRaid> Syntax Error. Usage: |c00FFFFFF/razinvite level|r or |c00FFFFFF/razinvite minlevel-maxlevel|r.", 1, 0.5, 0);
176 CT_RA_Print("<CTRaid> This command mass invites everybody in the guild in the current zone within the selected level range (or only selected level if maxlevel is omitted).", 1, 0.5, 0);
177 else
178 CT_RA_Print("<CTRaid> Syntax Error. Usage: |c00FFFFFF/rainvite level|r or |c00FFFFFF/rainvite minlevel-maxlevel|r.", 1, 0.5, 0);
179 CT_RA_Print("<CTRaid> This command mass invites everybody in the guild within the selected level range (or only selected level if maxlevel is omitted).", 1, 0.5, 0);
180 end
181 end
182 end
183 end
184  
185 -- Slash commands
186 -- /raslash
187 CT_RA_RegisterSlashCmd("/rahelp", "Shows this dialog.", 15, "RAHELP", CT_RASlashCmd_DisplayDialog, "/rahelp");
188  
189 -- /rares
190 CT_RA_RegisterSlashCmd("/rares", "Usable via |b/rares [show/hide]|eb, this shows or hides the resurrection monitor.", 15, "RARES", function(msg)
191 if ( msg == "show" ) then
192 if ( GetNumRaidMembers() > 0 ) then
193 CT_RA_ResFrame:Show();
194 end
195 CT_RAMenu_Options["temp"]["ShowMonitor"] = 1;
196 elseif ( msg == "hide" ) then
197 CT_RA_ResFrame:Hide();
198 CT_RAMenu_Options["temp"]["ShowMonitor"] = nil;
199 else
200 CT_RA_Print("<CTRaid> Usage: |c00FFFFFF/rares [show/hide]|r - Shows/hides the Resurrection Monitor.", 1, 0.5, 0);
201 end
202 end, "/rares");
203  
204 -- /rs
205 CT_RA_RegisterSlashCmd("/rs", "Usable via |b/rs [text]|eb, this sends a message to all CTRA users in the raid, which appears in the center of the screen (|brequires leader or promoted status|eb).", 30, "RS", function(msg)
206 if ( CT_RA_Level >= 1 ) then
207 if ( CT_RAMenu_Options["temp"]["SendRARS"] ) then
208 SendChatMessage(msg, "RAID");
209 end
210 CT_RA_AddMessage("MS " .. string.gsub(msg, "%%t", UnitName("target") or TARGET_TOKEN_NOT_FOUND));
211 else
212 CT_RA_Print("<CTRaid> You must be promoted or leader to do that!", 1, 1, 0);
213 end
214 end, "/rs");
215  
216 -- /raupdate
217 CT_RA_RegisterSlashCmd("/raupdate", "Updates raid stats (|brequires leader or promoted status|eb).", 15, "RAUPDATE", function()
218 if ( CT_RA_Level >= 1 ) then
219 CT_RA_AddMessage("SR");
220 CT_RA_Print("<CTRaid> Stats have been updated for the raid group.", 1, 0.5, 0);
221 else
222 CT_RA_Print("<CTRaid> You must be promoted or leader to do that!", 1, 0.5, 0);
223 end
224 end, "/raupdate", "/raupd");
225  
226 -- /rakeyword
227 CT_RA_RegisterSlashCmd("/rakeyword", "Automatically invites people whispering you the set keyword.", 15, "RAKEYWORD", function(msg)
228 if ( msg == "off" ) then
229 CT_RAMenu_Options["temp"]["KeyWord"] = nil;
230 CT_RA_Print("<CTRaid> Keyword Inviting has been turned off.", 1, 0.5, 0);
231 elseif ( msg == "" ) then
232 local kw = CT_RAMenu_Options["temp"]["KeyWord"];
233 if ( kw ) then
234 CT_RA_Print("<CTRaid> The Invite Keyword is: '|c00FFFFFF" .. kw .. "|r'. Use |c00FFFFFF/rakeyword off|r to turn Keyword Inviting off.", 1, 0.5, 0);
235 else
236 CT_RA_Print("<CTRaid> There is no Invite Keyword set.", 1, 0.5, 0);
237 end
238 else
239 CT_RAMenu_Options["temp"]["KeyWord"] = msg;
240 CT_RA_Print("<CTRaid> Invite Keyword has been set to '|c00FFFFFF" .. msg .. "|r'. Use |c00FFFFFF/rakeyword off|r to turn Keyword Inviting off.", 1, 0.5, 0);
241 end
242 end, "/rakeyword", "/rakw");
243  
244 -- /radisband
245 CT_RA_RegisterSlashCmd("/radisband", "Disbands the raid (|brequires leader or promoted status|eb)", 15, "RADISBAND", function(msg)
246 if ( CT_RA_Level and CT_RA_Level >= 1 ) then
247 CT_RA_Print("<CTRaid> Disbanding raid...", 1, 0.5, 0);
248 SendChatMessage("<CTRaid> Disbanding raid on request by " .. UnitName("player") .. ".", "RAID");
249 for i = 1, GetNumRaidMembers(), 1 do
250 local name, rank, subgroup, level, class, fileName, zone, online, isDead = GetRaidRosterInfo(i);
251 if ( online and rank <= CT_RA_Level and name ~= UnitName("player") ) then
252 UninviteByName(name);
253 end
254 end
255 CT_RA_AddMessage("DB");
256 LeaveParty();
257 else
258 CT_RA_Print("<CTRaid> You need to be raid leader or promoted to do that!", 1, 0.5, 0);
259 end
260 end, "/radisband");
261  
262 -- /rashow
263 CT_RA_RegisterSlashCmd("/rashow", "Usable via |b/rashow|eb or |b/rashow all|eb, this shows groups hidden, or all groups.", 15, "RASHOW", function(msg)
264 if ( msg == "all" ) then
265 CT_RAMenu_Options["temp"]["ShowGroups"] = { 1, 1, 1, 1, 1, 1, 1, 1 };
266 CT_RACheckAllGroups:SetChecked(1);
267 for i = 1, 8, 1 do
268 getglobal("CT_RAOptionsGroupCB" .. i):SetChecked(1);
269 end
270 else
271 if ( not CT_RAMenu_Options["temp"]["HiddenGroups"] ) then return; end
272 CT_RAMenu_Options["temp"]["ShowGroups"] = CT_RAMenu_Options["temp"]["HiddenGroups"];
273 CT_RAMenu_Options["temp"]["HiddenGroups"] = nil;
274 local num = 0;
275 for k, v in CT_RAMenu_Options["temp"]["ShowGroups"] do
276 num = num + 1;
277 getglobal("CT_RAOptionsGroupCB" .. k):SetChecked(1);
278 end
279 if ( num > 0 ) then
280 CT_RACheckAllGroups:SetChecked(1);
281 else
282 CT_RACheckAllGroups:SetChecked(nil);
283 end
284 end
285 CT_RA_UpdateRaidGroup(0);
286 end, "/rashow");
287  
288 -- /rahide
289 CT_RA_RegisterSlashCmd("/rahide", "Hides all shown groups.", 15, "RAHIDE", function()
290 CT_RAMenu_Options["temp"]["HiddenGroups"] = CT_RAMenu_Options["temp"]["ShowGroups"];
291 CT_RAMenu_Options["temp"]["ShowGroups"] = { };
292 CT_RACheckAllGroups:SetChecked(nil);
293 for i = 1, 8, 1 do
294 getglobal("CT_RAOptionsGroupCB" .. i):SetChecked(nil);
295 end
296 CT_RA_UpdateRaidGroup(0);
297 end, "/rahide");
298  
299 -- /raoptions
300 CT_RA_RegisterSlashCmd("/raoptions", "Shows the options dialog.", 20, "RAOPTIONS", function(msg)
301 CT_RAMenuFrame:Show();
302 end, "/raoptions");
303  
304 -- /raready
305 CT_RA_RegisterSlashCmd("/raready", "Performs a ready check, asking all CTRA users if they are ready (|brequires promoted or leader status|eb).", 30, "RAREADY", CT_RA_CheckReady, "/raready", "/rar");
306  
307 -- /ravote
308 CT_RA_RegisterSlashCmd("/ravote", "Usage: |b/ravote [question]|eb - Performs a vote, asking the raid for their opinion on the question. Results are broadcasted to raid chat after 30 seconds.", 30, "RAVOTE", CT_RA_CheckVote, "/ravote");
309  
310 -- /rarly
311 CT_RA_RegisterSlashCmd("/rarly", "Performs a rly check, asking all CTRA users if they are rly (|brequires promoted or leader status|eb).", 30, "RARLY", CT_RA_CheckRly, "/rarly", "/rly");
312  
313 -- /rainvite
314 CT_RA_RegisterSlashCmd("/rainvite", "Usable via |b/rainvite minlevel-maxlevel|eb or |b/rainvite level|eb this will invite all guild members within the chosen level range.", 30, "RAINVITE", function(msg)
315 CT_RA_ZoneInvite = nil;
316 CT_RA_Invite(msg);
317 end, "/rainvite", "/rainv");
318  
319 -- /razinvite
320 CT_RA_RegisterSlashCmd("/razinvite", "Usable via |b/rainvite minlevel-maxlevel|eb or |b/rainvite level|eb this will invite all guild members within the chosen level range in your own zone.", 30, "RAZINVITE", function(msg)
321 CT_RA_ZoneInvite = 1;
322 CT_RA_Invite(msg);
323 end, "/razinvite", "/razinv");
324  
325 -- /radur
326 CT_RA_RegisterSlashCmd("/radur", "Performs a durability check, which shows every CTRA member's durability percent (|brequires promoted or leader status|eb).", 30, "RADUR", function()
327 if ( CT_RA_Level >= 1 ) then
328 CT_RADurability_Shown = { };
329 CT_RADurability_Sorting = {
330 ["curr"] = 4,
331 [3] = { "a", "a" },
332 [4] = { "a", "a" }
333 };
334 CT_RA_DurabilityFrame.type = "RADUR";
335 CT_RA_DurabilityFrame.arg = nil;
336 CT_RADurability_Update();
337 ShowUIPanel(CT_RA_DurabilityFrame);
338 CT_RA_DurabilityFrameValueTab:SetText("Durability Percent");
339 CT_RA_DurabilityFrameValueTab:Show();
340 for i = 1, 5, 1 do
341 getglobal("CT_RA_DurabilityFrameResistTab" .. i):Hide();
342 end
343 CT_RA_DurabilityFrameTitle:SetText("Durability Check");
344 CT_RA_AddMessage("DURC");
345 else
346 CT_RA_Print("<CTRaid> You need to be promoted or leader to do that!", 1, 0.5, 0);
347 end
348 end, "/radur");
349  
350 -- /rareg
351 CT_RA_RegisterSlashCmd("/rareg", "Performs a reagent check, which shows every CTRA member's reagent count (|brequires promoted or leader status|eb).", 30, "RAREG", function()
352 if ( CT_RA_Level >= 1 ) then
353 CT_RADurability_Shown = { };
354 CT_RADurability_Sorting = {
355 ["curr"] = 3,
356 [3] = { "a", "a" },
357 [4] = { "a", "a" }
358 };
359 CT_RA_DurabilityFrame.type = "RAREG";
360 CT_RA_DurabilityFrame.arg = nil;
361 CT_RA_DurabilityFrameValueTab:SetText("Reagent Count");
362 CT_RA_DurabilityFrameValueTab:Show();
363 for i = 1, 5, 1 do
364 getglobal("CT_RA_DurabilityFrameResistTab" .. i):Hide();
365 end
366 CT_RADurability_Update();
367 ShowUIPanel(CT_RA_DurabilityFrame);
368 CT_RA_DurabilityFrameTitle:SetText("Reagent Check");
369 CT_RA_AddMessage("REAC");
370 else
371 CT_RA_Print("<CTRaid> You need to be promoted or leader to do that!", 1, 0.5, 0);
372 end
373 end, "/rareg");
374  
375  
376 -- /raitem
377 CT_RA_RegisterSlashCmd("/raitem", " Usable via |b/raitem ItemName|eb or |b/raitem [Item Link]|eb; allowing for you to type in or shift+click a link to see everyone in raid who has the item listed. (Very useful to do |b/raitem Aqual Quintessence|eb to see who came to MC prepared).", 45, "RAITEM", function(itemName)
378 if ( CT_RA_Level >= 1 ) then
379 if ( not itemName ) then
380 CT_RA_Print("<CTRaid> Usage: |c00FFFFFF/raitem Item Name|r NOTE: You can also use item links.", 1, 0.5, 0);
381 return;
382 end
383 local _, _, linkName = string.find(itemName, "%[(.+)%]");
384 if ( linkName ) then
385 itemName = linkName;
386 end
387 CT_RADurability_Shown = { };
388 CT_RADurability_Sorting = {
389 ["curr"] = 4,
390 [3] = { "a", "a" },
391 [4] = { "a", "a" }
392 };
393 CT_RA_DurabilityFrame.type = "RAITEM";
394 CT_RA_DurabilityFrame.arg = itemName;
395 CT_RA_DurabilityFrameValueTab:SetText("Item Count");
396 CT_RA_DurabilityFrameValueTab:Show();
397 for i = 1, 5, 1 do
398 getglobal("CT_RA_DurabilityFrameResistTab" .. i):Hide();
399 end
400 CT_RADurability_Update();
401 ShowUIPanel(CT_RA_DurabilityFrame);
402 CT_RA_DurabilityFrameTitle:SetText("Item Check");
403 CT_RA_AddMessage("ITMC " .. itemName);
404 else
405 CT_RA_Print("<CTRaid> You need to be promoted or leader to do that!", 1, 0.5, 0);
406 end
407 end, "/raitem");
408  
409 -- /raversion
410 CT_RA_RegisterSlashCmd("/raversion", " Performs a version check, which shows every member's CTRA version.", 15, "RAVERSION", function()
411 CT_RADurability_Shown = { };
412 CT_RADurability_Sorting = {
413 ["curr"] = 4,
414 [3] = { "a", "b" },
415 [4] = { "a", "b" }
416 };
417 CT_RA_DurabilityFrame.type = "RAVERSION";
418 CT_RA_DurabilityFrameValueTab:SetText("Version");
419 CT_RA_DurabilityFrameValueTab:Show();
420 for i = 1, 5, 1 do
421 getglobal("CT_RA_DurabilityFrameResistTab" .. i):Hide();
422 end
423 CT_RADurability_Update();
424 ShowUIPanel(CT_RA_DurabilityFrame);
425 CT_RA_DurabilityFrameTitle:SetText("Version Check");
426 for i = 1, GetNumRaidMembers(), 1 do
427 local name = UnitName("raid" .. i);
428 if ( CT_RA_Stats[name] and CT_RA_Stats[name]["Version"] ) then
429 local name, rank, subgroup, level, class, fileName = GetRaidRosterInfo(i);
430 CT_RADurability_Add(name, CT_RA_Stats[name]["Version"], fileName, CT_RA_Stats[name]["Version"]);
431 else
432 local name, rank, subgroup, level, class, fileName = GetRaidRosterInfo(i);
433 CT_RADurability_Add(name, "|c00666666No CTRA Found|r", fileName, 0);
434 end
435 end
436 end, "/raversion", "/raver");
437  
438 -- /raresist (Thanks Sudo!)
439 CT_RA_RegisterSlashCmd("/raresist", "Performs a resistance check, which shows every CTRA member's resistances (|brequires promoted or leader status|eb).", 30, "RARST", function(msg)
440 if ( CT_RA_Level >= 1 ) then
441 CT_RADurability_Shown = { };
442 CT_RADurability_Sorting = {
443 ["curr"] = 3,
444 [3] = { "a", "a" },
445 [4] = { "b", "b" },
446 [5] = { "b", "b" },
447 [6] = { "b", "b" },
448 [7] = { "b", "b" },
449 [8] = { "b", "b" },
450 };
451  
452 CT_RA_DurabilityFrame.type = "RARST";
453 CT_RA_DurabilityFrameValueTab:Hide();
454 for i = 1, 5, 1 do
455 getglobal("CT_RA_DurabilityFrameResistTab" .. i):Show();
456 end
457 CT_RADurability_Update();
458 ShowUIPanel(CT_RA_DurabilityFrame);
459 CT_RA_DurabilityFrameTitle:SetText("Resist Check");
460 CT_RA_AddMessage("RSTC");
461 else
462 CT_RA_Print("<CTRaid> You need to be promoted or leader to do that!", 1, 0.5, 0);
463 end
464 end, "/raresist", "/raresists");
465  
466 -- /razone
467 CT_RA_RegisterSlashCmd("/razone", "Performs a zone check, which shows every CTRA member outside of your zone.", 30, "RAZONE", function(msg)
468 CT_RADurability_Shown = { };
469 CT_RADurability_Sorting = {
470 ["curr"] = 3,
471 [3] = { "a", "a" },
472 [4] = { "a", "a" }
473 };
474 CT_RA_DurabilityFrame.type = "RAZONE";
475 CT_RA_DurabilityFrameValueTab:Show();
476 for i = 1, 5, 1 do
477 getglobal("CT_RA_DurabilityFrameResistTab" .. i):Hide();
478 end
479 CT_RADurability_Update();
480 ShowUIPanel(CT_RA_DurabilityFrame);
481 CT_RA_DurabilityFrameTitle:SetText("Zone Check");
482 CT_RA_DurabilityFrameValueTab:SetText("Zone Name");
483  
484 local name, rank, subgroup, level, class, fileName, zone;
485 for i = 1, GetNumRaidMembers(), 1 do
486 name, rank, subgroup, level, class, fileName, zone = GetRaidRosterInfo(i);
487 if ( name ~= UnitName("player") and zone and zone ~= "" and zone ~= "Offline" and zone ~= GetRealZoneText() ) then
488 CT_RADurability_Add(name, zone, fileName);
489 end
490 end
491 end, "/razone");
492  
493 -- /raquiet (by Angarth)
494 CT_RA_RegisterSlashCmd("/raquiet", "Stop the raid from talking while leaders talk (|brequires leader or promoted status|eb).", 15, "RASQUELCH", function()
495 if ( not CT_RA_Channel ) then
496 CT_RA_Print("<CTRaid> No channel set, cannot broadcast the message!", 1, 0.5, 0);
497 else
498 if ( CT_RA_Level >= 1 ) then
499 if ( CT_RA_Squelch > 0 ) then
500 SendChatMessage("<CTRaid> Quiet mode is over.", "RAID");
501 CT_RA_Print("<CTRaid> Quiet Mode has been disabled.", 1, 0.5, 0);
502 CT_RA_Squelch = 0;
503 else
504 SendChatMessage("<CTRaid> Quiet mode, no talking.", "RAID");
505 CT_RA_Print("<CTRaid> Quiet Mode has been enabled.", 1, 0.5, 0);
506 CT_RA_Squelch = 5*60;
507 end
508 else
509 CT_RA_Print("<CTRaid> You must be promoted or leader to do that!", 1, 0.5, 0);
510 end
511 end
512 end, "/raquiet", "/rasquelch");
513  
514 oldSendChatMessage = SendChatMessage;
515 function SendChatMessage(msg, type, language, target)
516 if ( type == "RAID" ) then
517 if ( CT_RA_Squelch > 0 and CT_RA_Level < 1 ) then
518 CT_RA_Print("<CTRaid> You can't talk in the raid channel at this time (Quiet Mode enabled).", 1, 0.5, 0);
519 return;
520 end
521 end
522 oldSendChatMessage(msg, type, language, target);
523 end