· 6 years ago · Nov 10, 2019, 07:16 PM
1 -- WoW Classic - Battlecry Generator
2 -- Version 2.13 (Beta)
3
4 -- By Mahtrok
5 -- mahtrok@mahtrok.info
6 -- 10/11/2019
7
8 -- This table is gonna be saved on program close, for all chars, it holds all available cries for all classes.
9 BattleCryDB = {};
10
11 -- This table is gonna be saved on program close, only for the current char, it holds this chars general settings.
12 BattleCryPerCharDB = {};
13
14 -- The default settings for BattleCry Generator are stored only for the current character.
15 local defaultSettings = {
16 Enabled = true,
17 Debugger = true,
18 Chance = 10
19 }
20
21 -- Runtime values
22 local playerClass = "";
23 local playerName = "";
24 local playerRace = "";
25
26 -- All available cries.
27 local cries = {
28
29 ["General"] = {
30
31 ["Any"] = {
32 "Ah-ha!"
33 },
34
35 ["SWING_DAMAGE"] = {
36 "Ha!",
37 "Ough!",
38 "Ah-ha!",
39 "He-he!"
40 },
41
42 ["SWING_MISSED"] = {
43 "Bastard.",
44 "Verdammt!",
45 "Halt still!",
46 "Sportlich...",
47 "Wirst du wohl?!"
48 },
49
50 ["SWING_ABSORBED"] = {
51 "Oha!",
52 "Uhhhh!"
53 },
54
55 ["SWING_RESISTED"] = {
56 "Oha!",
57 "Uhhhh!"
58 },
59
60 ["SWING_BLOCKED"] = {
61 "Uh!",
62 "Ouh!",
63 "Huh!",
64 "Urgh!",
65 "Bastard!",
66 "Drecksack!",
67 "Auf's Maul?!",
68 "Wirst du wohl?!"
69 },
70
71 ["RANGE_DAMAGE"] = {
72 "BAM!",
73 "Ouch!",
74 "Jawoll!",
75 "Treffer!",
76 "Nimm das!",
77 "Der hat gesessen!",
78 "Auf 200 Schritt, direkt zwischen die Augen!"
79 },
80
81 ["RANGE_MISSED"] = {
82 "Bastard.",
83 "Verdammt!",
84 "Halt still!",
85 "Sportlich...",
86 "Wirst du wohl?!"
87 },
88
89 ["RANGE_ABSORBED"] = {
90 "Oha!",
91 "Uhhhh!"
92 },
93
94 ["RANGE_RESISTED"] = {
95 "Oha!",
96 "Uhhhh!"
97 },
98
99 ["RANGE_BLOCKED"] = {
100 "Uh!",
101 "Ouh!",
102 "Huh!",
103 "Urgh!",
104 "Bastard!",
105 "Drecksack!",
106 "Auf's Maul?!",
107 "Wirst du wohl?!"
108 },
109
110 ["SPELL_MISSED"] = {
111 "Bastard.",
112 "Verdammt!",
113 "Halt still!",
114 "Sportlich...",
115 "Wirst du wohl?!"
116 },
117
118 ["SPELL_ABSORBED"] = {
119 "Oha!",
120 "Uhhhh!"
121 },
122
123 ["SPELL_RESISTED"] = {
124 "Oha!",
125 "Uhhhh!"
126 },
127
128 ["SPELL_BLOCKED"] = {
129 "Uh!",
130 "Ouh!",
131 "Huh!",
132 "Urgh!",
133 "Bastard!",
134 "Drecksack!",
135 "Auf's Maul?!",
136 "Wirst du wohl?!"
137 },
138
139 ["PARTY_KILL"] = {
140 "Ab in den Dreck!",
141 "Hatter nu' davon!",
142 "Wieder einer weniger!",
143 "Ein weiterer Sieg! Natürlich."
144 }
145
146 },
147
148 ["Racial"] = {
149
150 -- Dwarf
151 ["Stoneform"] = {
152 "Steinhart!",
153 "Die Macht des Steins!",
154 "An mir beißt du dir die Zähne aus!",
155 },
156
157 -- Gnome
158 ["Escape Artist"] = {
159 "Und tschüss!",
160 "Haste gedacht!",
161 "Schwupps und weg."
162 },
163
164 -- Night elf
165 ["Shadowmeld"] = {
166
167 },
168
169 -- Orc
170 ["Blood Fury"] = {
171
172 },
173
174 -- Troll
175 ["Berserking"] = {
176
177 },
178
179 -- Tauren
180 ["War Stomp"] = {
181
182 },
183
184 -- Undead 1
185 ["Cannibalize"] = {
186
187 },
188
189 -- Undead 2
190 ["Will of the Forsaken"] = {
191
192 }
193
194 },
195
196 ["Class"] = {
197
198 ["Druid"] = {
199
200 },
201
202 ["Hunter"] = {
203
204 },
205
206 ["Mage"] = {
207
208 },
209
210 ["Paladin"] = {
211
212 ["Blessing of kings"] = {
213 "Die Könige segnen dich.",
214 "Geh mit dem Segen der Könige.",
215 "Der Segen der Könige erfülle dich.",
216 },
217
218 ["Blessing of might"] = {
219 "Empfange die Macht des Lichts.",
220 "Die Macht des Lichts ist mit dir.",
221 "Sei gesegnet mit der Macht des Lichts.",
222 "Das Licht segne dich mit seiner Macht.",
223 "Geh mit der Macht, die das Licht schenkt.",
224 "Das Licht sei mit dir und schenke dir Macht.",
225 },
226
227 ["Blessing of protection"] = {
228 "Licht, errette diese arme Seele.",
229 "Licht, beschütze diese arme Seele.",
230 "Das Licht möge deiner Seele gnädig sein!",
231 },
232
233 ["Blessing of salvation"] = {
234 "Das Licht ist mit dir.",
235 "Das Licht verdeckt deine Absichten.",
236 },
237
238 ["Blessing of wisdom"] = {
239 "Spüre die Weisheit des Lichts.",
240 "Das Licht segne dich mit Weisheit.",
241 "Geh mit der Weisheit, die das Licht schenkt.",
242 "Das Licht sei mit dir und schenke dir Weisheit.",
243 },
244
245 ["Divine protection"] = {
246 "Licht, beschütz mich!",
247 "Das Licht erfüllt mich!",
248 "Das Licht wacht über mich!",
249 "Licht, schütze deinen Diener.",
250 },
251
252 ["Divine intervention"] = {
253 "Nimm dieses Opfer und ahhhhh",
254 "Ich opfere mich, für die Allianz!",
255 "Nimm mein Leben und rette das Seine.",
256 },
257
258 ["Exorcism"] = {
259 "Es werde Licht!",
260 "Weiche, Kreatur!",
261 "Klaatu, Verata, Nachahaha!",
262 "Zurück in die Schatten, %t!",
263 "Das Licht wird dich bannen, %t!",
264 "Das Licht wird dich richten, %t!",
265 "Du hast hier nichts verloren, %t!",
266 "Zurück in das Loch, aus dem du kamst!",
267 "Ich verbanne dich, zurück in die Schatten!",
268 },
269
270 ["Flash of light"] = {
271 "Halt durch!",
272 "Hilfe ist unterwegs!",
273 "Wird gleich wieder gut.",
274 "Heile, heile, Gänschen!",
275 "Gleich wirds kurz hell!",
276 "Achtung, es blitzt kurz.",
277 "Warte, ich rufe Hilfe! Ach, moment... Die bin ja ich.",
278 },
279
280 ["Judgement"] = {
281 "Das Licht wird dich richten!",
282 "Schuldig, im Sinne der Anklage!",
283 "Ich bin dein Richter und Henker!",
284 "Das hohe Gericht hat entschieden: Tod!",
285 "Höre nun dein Urteil! Tod auf Bewährung!",
286 "Das hohe Gericht serviert heut Tiefschläge!",
287 "Du hast das Recht zu STERBEN! Ein für alle mal!",
288 "Empfange das Urteil: Tod im Sinne von ...naja, tot!",
289 }
290
291 ["Hammer of justice"] = {
292 "Rumms!",
293 "Das gibt Kopfweh!",
294 "Gleich wirds dunkel!",
295 "Hier kommt der HAMMER!",
296 "Alles gute kommt von oben!",
297 },
298
299 ["Holy light"] = {
300 "Heiliges Licht! Hilf uns!",
301 "Das heilige Licht ist mit dir!",
302 "Der Schmerz ist gleich vorbei.",
303 "Das heilige Licht gibt dir neue Kraft!",
304 "Heiliges Licht, errette diese Arme Seele!",
305 "Ist das deine Mils? Naja, ich bau sie erstmal wieder ein.",
306 "Da hängen ja schon die Gedärme raus, ich mach dich mal wieder zu.",
307 },
308
309 ["Lay on hands"] = {
310 "Du stirbst heut' nich!",
311 "Hier wird nich' gestorben!",
312 "Nich, während meiner Wache!",
313 },
314
315 ["Purify"] = {
316 "Ich nehme die Krankheit von dir!",
317 "Hier wird sich nich' krank gemeldet!",
318 "Verzage nicht, ich erlöse dich von dieser Krankheit.",
319 },
320
321 ["Redemption"] = {
322 "REANIMATION!",
323 "Reanimation! Das kann ich.",
324 "Das Licht erfülle dich erneut!",
325 "Empfange erneut das heilige Licht!",
326 "Stirb an einem anderen Tag, Freund.",
327 "Atme wieder die gute Luft mein Freund.",
328 "Kein Licht, kein Ton, ich komm' ja schon!",
329 },
330
331 ["Righteous fury"] = {
332 "Ich werde sie ablenken!",
333 "Ich werde euch beschützen!",
334 "Ich nehme ihren Zorn auf mich!",
335 },
336
337 ["Sense undead"] = {
338 "Ich kann den Tod spüren!",
339 "Untote, ich kann Sie spüren.",
340 "Orks! Ah, ne, riecht nur so ähnlich.",
341 "Ich sehe untote Menschen...und anderes, was mir auch nich' richtig schmeckt.",
342 }
343
344 },
345
346 ["Priest"] = {
347
348 },
349
350 ["Rogue"] = {
351
352 },
353
354 ["Shaman"] = {
355
356 },
357
358 ["Warrior"] = {
359
360 ["Battle shout"] = {
361 "Für Falstad!",
362 "Für den König!",
363 "Für die Allianz",
364 "Für Eisenschmiede!",
365 "Für die Wildhammer!",
366 "Für Falstad und die Wildhammer!",
367 "Für Bronzebart und Eisenschmiede!",
368 },
369
370 ["Bloodrage"] = {
371 "Roarrrr!",
372 "Aaaaargh!",
373 "Aggresssiooon!",
374 "Rrrrrraaaawww!",
375 "Ich bin stinksauer!",
376 "Aaargh, diese WUUUT!",
377 "Ich bin echt wütend!",
378 playerRace.. " ist WÜÜÜTEND!",
379 "Ne ordentliche Keilerei, wird auch Zeit!",
380 },
381
382 ["Charge"] = {
383 "ATTACKE!",
384 "Zum Angriff!",
385 playerRace.. " ist da!",
386 "Hier kommt der SCHMEEERZ!",
387 "Die ersten Zehn sind meine!",
388 },
389
390 ["Demoralizing shout"] = {
391 "Oink, Oink!",
392 "Kommt nur her!",
393 "Ist das hier schon Alles?!",
394 "Jeder kriegt was ab, versprochen!",
395 "Wer hat noch nich, wer will noch mal?!",
396 "Ist genug " ..playerRace.. " für Alle da!",
397 "Gefahr ist mein zweiter Vorname! " ..playerName.. ". Gefahr.",
398 "Ich hab' 'ne Posaune eingepflanzt un' es wurd' 'ne VUVUZELA!",
399 },
400
401 ["Execute"] = {
402 "Stirb!",
403 "SCHMERZEN!",
404 "Jetz' STIRB!",
405 "Und jetz' Stirb!",
406 "Fall. Endlich. Um!",
407 },
408
409 ["Heroic strike"] = {
410 "Ha-ha!",
411 "Treffer!",
412 "Nimm das!",
413 "So geht das!",
414 "Hier kommt der Schmerz!",
415 },
416
417 ["Overpower"] = {
418 "Zack!",
419 "So nich!",
420 "Erwischt!",
421 "Oink Oink!",
422 },
423
424 ["Revenge"] = {
425 "Haha!",
426 "Ha-ha!",
427 "So nicht!",
428 "Dir zeig ich's!",
429 "Oink, Oink, %t!",
430 "Haste gedacht, %t!",
431 "So nicht, mein Freund!",
432 "Hier kommt der Schmerz!",
433 },
434
435 ["Shield bash"] = {
436 "BAM!",
437 "Bist du ruhig!",
438 "Nein, nein, nein!",
439 "Haste gedacht, %t!",
440 "Pssst, %t, Klappe!",
441 "Halt die Klappe, %t!",
442 "Hier wird nich gezaubert, %t!",
443 "Ich zauber dir gleich mal'n Ring um die Augen, %t!",
444 },
445
446 ["Taunt"] = {
447 "Hier bin ich, %t!",
448 "He, Schweinenase?!",
449 "Ich bin hier unten!",
450 "Ich lache über dich, %t!",
451 "Du stinkst ganz schön, %t!",
452 "Wirst du wohl herkommen, %t!?",
453 "Hey %t, hier gibts aufs Maul!",
454 "Deine Nase passt mir nicht, %t!",
455 "Hey, %t, deine Mutter lässt grüßen!",
456 "Wir waren hier noch nich fertig, %t!",
457 "Mit dir bin ich noch nich fertig, %t!",
458 "Leg dich mit Jemand in deiner Größe an, %t!",
459 "Igitt, %t, der Geruch deiner Füße ist unerträglich!",
460 "Mein linker Zeh juckt und ich glaube DU hast Schuld!",
461 }
462
463 },
464
465 ["Warlock"] = {
466
467 }
468 }
469
470 }
471
472 -- Colors used to format the output text inside the ChatBox.
473 local colors = {
474 ["red"] = "|cffFF6969",
475 ["orange"] = "|cffFFA369",
476 ["yellow"] = "|cffFFE169",
477 ["green"] = "|cff6BBD57",
478 ["blue"] = "|cff5799BD",
479 ["violet"] = "|cffBD6FBF",
480 ["pink"] = "|cffFFB8F5",
481 ["white"] = "|cffFFFFFF",
482 ["gold"] = "|cffAD9E63",
483 ["Druid"] = "|cffFFB04F",
484 ["Hunter"] = "|cff8ECF63",
485 ["Mage"] = "|cff80CAFF",
486 ["Paladin"] = "|cffFAB6F7",
487 ["Priest"] = "|cffFDFFFC",
488 ["Rouge"] = "|cffFFEE03",
489 ["Shaman"] = "|cff78F1FF",
490 ["Warrior"] = "|cffCCB89B",
491 ["Warlock"] = "|cffCA86DB"
492 }
493
494 -- Create the main table for BattleCry Generator
495 local BattleCryGenHud = BattleCryGenHud or {};
496
497 -- Create the frame that will be used for any events
498 BattleCryGenHud.frame = CreateFrame("Frame", "BattleCryGenHud", UIParent);
499 BattleCryGenHud.frame:SetFrameStrata("BACKGROUND");
500
501 -- Register all required events.
502 BattleCryGenHud.frame:RegisterEvent("PLAYER_ENTERING_WORLD");
503 BattleCryGenHud.frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
504 BattleCryGenHud.frame:RegisterEvent("ADDON_LOADED");
505
506 -- Fired, when the player has finally entered the world.
507 function BattleCryGenHud.frame:PLAYER_ENTERING_WORLD(...)
508 if (playerClass ~= "Warrior") and (playerClass ~= "Paladin") then
509 BattleCryPerCharDB.Enabled = false;
510 BattleCryPerCharDB.Debugger = false;
511 Show_Msg (colors.gold .. " We're sorry, but your class " .. colors[playerClass] .. "" .. playerClass .. "is not yet supported!");
512 Show_Msg (colors.gold .. " BattleCry Generator has been " .. colors.red .. "disabled" .. colors.gold .. " for this character.");
513 else
514 Show_Status();
515 end;
516 end
517
518 -- Fired, when SAVEDVARIABLES## are loaded and ready.
519 function BattleCryGenHud.frame:ADDON_LOADED(...)
520 -- SETTINGs
521 if (BattleCryPerCharDB ~= {}) then
522 Show_Msg (colors.gold .. " BattleCry Generator settings " .. colors.green .. "found" .. colors.gold .. ", for this character.");
523 else
524 Show_Msg (colors.gold .. " BattleCry Generator settings " .. colors.red .. "not found" .. colors.gold .. ", for this character.");
525 Reset();
526 end;
527
528 -- Load player specific cries for faster access.
529
530 playerClass = inEnglish("class", UnitClass("player"));
531 playerGUID = UnitGUID("player");
532 playerName = UnitName("player");
533 playerRace = inEnglish("race", UnitRace("player"));
534 end
535
536 -- Restore default settings.
537 function Reset ()
538 BattleCryDB = {};
539 BattleCryPerCharDB = {};
540
541 if (BattleCryPerCharDB.Enabled == nil) then
542 BattleCryPerCharDB.Enabled = defaultSettings.Enabled;
543 end;
544 if (BattleCryPerCharDB.Debugger == nil) then
545 BattleCryPerCharDB.Debugger = defaultSettings.Debugger;
546 end;
547 if (BattleCryPerCharDB.Chance == nil) then
548 BattleCryPerCharDB.Chance = defaultSettings.Chance;
549 end;
550 Show_Msg (colors.gold .. " Stored BattleCry Generator settings deleted & reset to defaults.");
551 Show_Status();
552 end;
553
554 -- Fires on any event, non- or combat, registered by wow's combat log, from somewhere near the player.
555 function BattleCryGenHud.frame:COMBAT_LOG_EVENT_UNFILTERED(...)
556 -- If BattleCry Generator has been enabled, otherwise, do nothing.
557 if (BattleCryPerCharDB.Enabled) then
558 local _, subevent, _, sourceGUID, _, _, _, destGUID, _, _, _ = CombatLogGetCurrentEventInfo();
559 -- Only cry, if player is involved, either as source or target of the event.
560 if (sourceGUID == playerGUID) or (destGUID == playerGUID) then
561 -- Randomize to decide wether a cry should be generated or not, depending on 100 - the global cry chance.
562 local _rand = math.random( 100 );
563 -- Did we hit the chance to cry?
564 if (_rand > 100-BattleCryPerCharDB.Chance) then
565 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.gold .. " I rolled" .. colors.green .. " " .. _rand .. "" .. colors.gold .. " against" .. colors.orange .. " " .. BattleCryPerCharDB.Chance .. "" .. colors.gold .. "% Chance, on subevent " .. colors.yellow .. subevent .. "" .. colors.gold .. "."); end;
566 -- Generate a cry.
567 GenerateCry(...);
568 -- We missed the chance to cry, so do nothing.
569 else
570 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.gold .. " I rolled" .. colors.red .. " " .. _rand .. "" .. colors.gold .. " against" .. colors.orange .. " " .. BattleCryPerCharDB.Chance .. "" .. colors.gold .. "% Chance, on subevent " .. colors.yellow .. subevent .. "" .. colors.gold .. "."); end;
571 end;
572 end;
573 end;
574 end
575
576 -- Generates the actual cry.
577 function GenerateCry(...)
578 -- Get event info.
579 local timeStamp, subevent, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = CombatLogGetCurrentEventInfo();
580 local spellId, spellName, spellSchool;
581 local amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand;
582
583 local chnl = "SAY";
584 local tble = {};
585 local tbleCnt = table.getn( tble );
586
587 -- Player acts towards anyone/thing, but himself.
588 if (sourceGUID == playerGUID) and (destGUID ~= playerGUID) then
589 local _, spellName, _, _, _, _, _, _, _, _, _, _, _ = select(12, ...);
590
591 -- Find the table, that contains the exact subevent name.
592 if (keyExists(cries.General[subevent])) then
593 -- Found the correct table in General.
594 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.gold .. " >> Found key in" .. colors.blue .. " generals" .. colors.gold .. " table."); end;
595 tble = cries.General[subevent];
596 elseif (cries.Racial[inEnglish("racial", spellName)]) then
597 -- Found the correct table in Racial.
598 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.gold .. " >> Found key in" .. colors.blue .. " racials" .. colors.gold .. " table."); end;
599 tble = cries.Racial[inEnglish("racial", spellName)];
600 elseif (cries.Class[inEnglish("spell", spellName)]) then
601 -- Found the correct table in the players class spell-set of tables.
602 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.gold .. " >> Found key in" .. colors[playerClass] .. " " .. playerClass .. "" .. colors.gold .. " spell-table."); end;
603 tble = cries.Class[inEnglish("spell", spellName)];
604 else
605 tble = {};
606 end;
607
608 -- Anyone/thing arround acts towards the player.
609 elseif (destGUID == playerGUID) or (subevent == "PARTY_KILL") then
610 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.yellow .. " " .. sourceName .. "" .. colors.gold .. " acts."); end;
611 -- Find the table, that contains the exact subevent name.
612 if (keyExists(cries.General[subevent])) then
613 -- Found the correct table in General.
614 tble = cries.General[subevent];
615 else
616 tble = {};
617 end;
618 end;
619
620 -- Randomize the actual cry & send it to ChatBox 'chnl', if a 'tble' has been found.
621 if(tble ~= nil) and (tble ~= {}) then
622 -- Valid tble found, now randomize selection.
623 local _rand = math.random(table.getn( tble ));
624 -- Send random cry, if there is one.
625 if (tble[_rand] ~= "") and (tble[_rand] ~= nil) then
626 SendChatMessage(tble[_rand], chnl);
627 end;
628 else
629 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.red .. " >> No cry table found, for event '" .. colors.yellow .. "" .. subevent .. "" .. colors.gold .. "'."); end;
630 end;
631 end
632
633 -- Chat box debugger/printer
634 function Show_Msg(_msg)
635 if( DEFAULT_CHAT_FRAME ) then
636 DEFAULT_CHAT_FRAME:AddMessage(_msg);
637 end
638 end
639
640 -- Recieved text command
641 function cmdBCG(_arg)
642 -- Recieved command for turning Battlecry Generator on.
643 if (string.lower(_arg) == "on") then
644 BattleCryPerCharDB.Enabled = true;
645 Show_Msg (colors.gold .. " Stored BattleCry Generator is now " .. colors.green .. "ON" .. colors.gold .. ".");
646 -- Recieved command for turning Battlecry Generator off.
647 elseif (string.lower(_arg) == "off") then
648 BattleCryPerCharDB.Enabled = false;
649 Show_Msg (colors.gold .. " Stored BattleCry Generator is now " .. colors.red .. "OFF" .. colors.gold .. ".");
650 -- Recieved command for turning Battlecry Generators Debugger on/off.
651 elseif (string.lower(_arg) == "debug") then
652 if (BattleCryPerCharDB.Debugger) then
653 BattleCryPerCharDB.Debugger = false;
654 Show_Msg (colors.gold .. " Stored BattleCry Debugger is now " .. colors.red .. "OFF" .. colors.gold .. ".");
655 else
656 BattleCryPerCharDB.Debugger = true;
657 Show_Msg (colors.gold .. " Stored BattleCry Debugger is now " .. colors.green .. "ON" .. colors.gold .. ".");
658 end;
659 -- Display status of BattleCry Generator on the ChatBox.
660 elseif (string.lower(_arg) == "status") then
661 Show_Status();
662 elseif (string.lower(_arg) == "reset") then
663 BattleCryDB = {};
664 BattleCryPerCharDB = {};
665 Reset();
666 -- If anything else comes in, as a command, but is not valid, show the info again.
667 else
668 Show_Info();
669 end;
670 end
671
672 -- Returns the translated, equivalent value of the passed-in _arg, if known (and therefor relevant) from a localized game version.
673 function inEnglish(_loc, _arg)
674 if(string.lower(_loc) == "class") then
675 -- CLASS NAMES in english in german
676 if(string.lower(_arg) == "druid") or (string.lower(_arg) == "druide") then
677 return "Druid";
678 elseif(string.lower(_arg) == "hunter") or (string.lower(_arg) == "jäger") then
679 return "Hunter";
680 elseif(string.lower(_arg) == "mage") or (string.lower(_arg) == "magier") then
681 return "Mage";
682 elseif(string.lower(_arg) == "paladin") or (string.lower(_arg) == "paladin") then
683 return "Paladin";
684 elseif(string.lower(_arg) == "priest") or (string.lower(_arg) == "priester") then
685 return "Priest";
686 elseif(string.lower(_arg) == "shaman") or (string.lower(_arg) == "schamane") then
687 return "Shaman";
688 elseif(string.lower(_arg) == "warrior") or (string.lower(_arg) == "krieger") then
689 return "Warrior";
690 elseif(string.lower(_arg) == "warlock") or (string.lower(_arg) == "hexenmeister") then
691 return "Warlock";
692 end;
693 end;
694 if(string.lower(_loc) == "race") then
695 -- RACE NAMES in english in german
696 if(string.lower(_arg) == "gnome") or (string.lower(_arg) == "gnom") then
697 return "gnome";
698 elseif(string.lower(_arg) == "human") or (string.lower(_arg) == "mensch") then
699 return "human";
700 elseif(string.lower(_arg) == "dwarf") or (string.lower(_arg) == "zwerg") then
701 return "dwarf";
702 elseif(string.lower(_arg) == "night elf") or (string.lower(_arg) == "nachtelf") then
703 return "night elf";
704 elseif(string.lower(_arg) == "orc") or (string.lower(_arg) == "ork") then
705 return "orc";
706 elseif(string.lower(_arg) == "troll") or (string.lower(_arg) == "troll") then
707 return "troll";
708 elseif(string.lower(_arg) == "tauren") or (string.lower(_arg) == "taure") then
709 return "tauren";
710 elseif(string.lower(_arg) == "undead") or (string.lower(_arg) == "untoter") then
711 return "undead";
712 end;
713 end;
714 if(string.lower(_loc) == "racial") then
715 -- RACIAL SPELL NAMES in english in german
716 if(string.lower(_arg) == "escape artist") or (string.lower(_arg) == "entfesselungskünstler") then
717 return "Escape Artist";
718 elseif(string.lower(_arg) == "stoneform") or (string.lower(_arg) == "steingestalt") then
719 return "Stoneform";
720 elseif(string.lower(_arg) == "shadowmeld") or (string.lower(_arg) == "schattenhaftigkeit") then
721 return "Shadowmeld";
722 elseif(string.lower(_arg) == "blood fury") or (string.lower(_arg) == "kochendes blut") then
723 return "Blood Fury";
724 elseif(string.lower(_arg) == "berserking") or (string.lower(_arg) == "Berserker") then
725 return "Berserking";
726 elseif(string.lower(_arg) == "war stomp") or (string.lower(_arg) == "kriegsdonner") then
727 return "War Stomp";
728 elseif(string.lower(_arg) == "cannibalize") or (string.lower(_arg) == "kannibalismus") then
729 return "Cannibalize";
730 elseif(string.lower(_arg) == "will of the forsaken") or (string.lower(_arg) == "wille der verlassenen") then
731 return "Will of the Forsaken";
732 end;
733 end;
734 if(string.lower(_loc) == "spell") then
735 if (string.lower(playerClass) == "druid") then
736
737 end;
738 if (string.lower(playerClass) == "hunter") then
739
740 end;
741 if (string.lower(playerClass) == "mage") then
742
743 end;
744 if (string.lower(playerClass) == "paladin") then
745 -- PALADIN SPELL NAMES in english in german
746 if (string.lower(_arg) == "blessing of kings") or (string.lower(_arg) == "segen der könige") then
747 return "Blessing of kings";
748 elseif (string.lower(_arg) == "blessing of might") or (string.lower(_arg) == "segen der macht") then
749 return "Blessing of might";
750 elseif (string.lower(_arg) == "blessing of protection") or (string.lower(_arg) == "segen des schutzes") then
751 return "Blessing of protection";
752 elseif (string.lower(_arg) == "blessing of salvation") or (string.lower(_arg) == "segen der rettung") then
753 return "Blessing of salvation";
754 elseif (string.lower(_arg) == "blessing of wisdom") or (string.lower(_arg) == "segen der weisheit") then
755 return "Blessing of wisdom";
756 elseif (string.lower(_arg) == "divine protection") or (string.lower(_arg) == "göttlicher schutz") then
757 return "Divine protection";
758 elseif (string.lower(_arg) == "divine intervention") or (string.lower(_arg) == "göttliches eingreifen") then
759 return "Divine intervention";
760 elseif (string.lower(_arg) == "exorcism") or (string.lower(_arg) == "exorzismus") then
761 return "Exorcism";
762 elseif (string.lower(_arg) == "judgement") or (string.lower(_arg) == "richturteil") then
763 return "Judgement";
764 elseif (string.lower(_arg) == "flash of light") or (string.lower(_arg) == "lichtblitz") then
765 return "Flash of light";
766 elseif (string.lower(_arg) == "hammer of justice") or (string.lower(_arg) == "hammer der gerechtigkeit") then
767 return "Hammer of justice";
768 elseif (string.lower(_arg) == "holy light") or (string.lower(_arg) == "heiliges licht") then
769 return "Holy light";
770 elseif (string.lower(_arg) == "lay on hands") or (string.lower(_arg) == "handauflegung") then
771 return "Lay on hands";
772 elseif (string.lower(_arg) == "purify") or (string.lower(_arg) == "läutern") then
773 return "Purify";
774 elseif (string.lower(_arg) == "redemption") or (string.lower(_arg) == "auferstehung") then
775 return "Redemption";
776 elseif (string.lower(_arg) == "righteous fury") or (string.lower(_arg) == "zorn der gerechtigkeit") then
777 return "Righteous fury";
778 elseif (string.lower(_arg) == "sense undead") or (string.lower(_arg) == "untote aufspüren") then
779 return "Sense undead";
780 end;
781 end;
782 if (string.lower(playerClass) == "priest") then
783
784 end;
785 if (string.lower(playerClass) == "shaman") then
786
787 end;
788 if (string.lower(playerClass) == "warrior") then
789 -- WARRIOR SPELL NAMES in english in german
790 if (string.lower(_arg) == "battle shout") or (string.lower(_arg) == "schlachtruf") then
791 return "Battle shout";
792 elseif (string.lower(_arg) == "bloodrage") or (string.lower(_arg) == "blutrausch") then
793 return "Bloodrage";
794 elseif (string.lower(_arg) == "charge") or (string.lower(_arg) == "sturmangriff") then
795 return "Charge";
796 elseif (string.lower(_arg) == "demoralizing shout") or (string.lower(_arg) == "demoralisierungsruf") then
797 return "Demoralizing shout";
798 elseif (string.lower(_arg) == "execute") or (string.lower(_arg) == "hinrichten") then
799 return "Execute";
800 elseif (string.lower(_arg) == "heroic strike") or (string.lower(_arg) == "heldenhafter stoß") then
801 return "Heroic strike";
802 elseif (string.lower(_arg) == "overpower") or (string.lower(_arg) == "überwältigen") then
803 return "Overpower";
804 elseif (string.lower(_arg) == "revenge") or (string.lower(_arg) == "rache") then
805 return "Revenge";
806 elseif (string.lower(_arg) == "shield bash") or (string.lower(_arg) == "schildhieb") then
807 return "Shield bash";
808 elseif (string.lower(_arg) == "taunt") or (string.lower(_arg) == "spott") then
809 return "Taunt";
810 end;
811 end;
812 if (string.lower(playerClass) == "warlock") then
813
814 end;
815 end;
816 -- Return nil, if no valid value has been found until here.
817 return nil;
818 end
819
820 -- Returns true, if the passed-in key exists inside the passed-in table set.
821 function keyExists(set, key)
822 return set[key] ~= nil
823 end
824
825 -- Displays the current status of BattleCry Generator on the ChatBox.
826 function Show_Status()
827 Show_Msg(colors.gold.. " BattleCry Generator Status:\n");
828
829 local _state = colors.red .. "OFF";
830 if (BattleCryPerCharDB.Enabled) then
831 _state = colors.green .. "ON";
832 end;
833
834 Show_Msg(colors.gold .. " Generator is turned " .. _state .. ".");
835 if (BattleCryPerCharDB.Debugger) then
836 _state = colors.green .. "ON";
837 else
838 _state = colors.red .. "OFF";
839 end;
840 Show_Msg(colors.gold .. " Debugger is turned " .. _state .. ".");
841
842 Show_Msg(colors.gold .. " Welcome" .. colors[inEnglish("class", playerClass)] .. " " .. playerName .. "" .. colors.gold .. ", your cry chance is" .. colors.orange .. " " .. BattleCryPerCharDB.Chance .. "" .. colors.gold .. "%");
843 Show_Msg(colors.gold .. " To see the options menu, type" .. colors.green .. " /bcg" .. colors.gold .. ".");
844 end
845
846 -- Displays the tutorial/info for BattleCry Generator on the ChatBox.
847 function Show_Info()
848 Show_Msg(colors.gold .. " BattleCry Generator Options:\n");
849 Show_Msg(colors.white .. " /bcg status " .. colors.gold .. " Show Status");
850 Show_Msg(colors.white .. " /bcg debug " .. colors.gold .. " Debugger On/Off");
851 Show_Msg(colors.white .. " /bcg off " .. colors.red .. " Disable" .. colors.gold .. " BattleCry Generator");
852 Show_Msg(colors.white .. " /bcg on " .. colors.green .. " Enable" .. colors.gold .. " BattleCry Generator");
853 end
854
855 -- Override the OnEvent() method to dispatch events to our processing functions.
856 BattleCryGenHud.frame:SetScript("OnEvent", function(self, event, ...) if self[event] then return self[event](self, ...) end end);
857
858 -- Slash command list
859 SLASH_BCGEN1 = "/bcg";
860 SLASH_BCGEN2 = "/bcg2";
861 SlashCmdList["BCGEN"] = cmdBCG;