· 6 years ago · Nov 17, 2019, 07:02 PM
1 -- WoW Classic - Battlecry Generator
2 local Version = "2.18";
3 local Client = "(Alpha)"
4 -- By Mahtrok
5 -- mahtrok@mahtrok.info
6 -- 11-17-2019
7
8 -- ##################################################################################################################
9
10 -- ChangeLog 2.18:
11 --
12 -- Added druid cries.
13
14 -- ##################################################################################################################
15
16 -- What is BattleCry Generator?
17
18 -- Custom BattleCry Generator. Cries out specific phrases, either entered inside the code here or added ingame,
19 -- whenever specific combat events happen, depending on the type of spell used, or the current combat action.
20 -- The goal of this addon is in-combat-roleplay, NOT to annoy the people you play with. Therefor the selection
21 -- of cries shouldn't be too small, while the global cry chance shouldn't be too high. I suggest, using a global
22 -- cry chance not greater then 5-10% and around 10-20 cries per spell (larger selection is always a good thing).
23
24
25 -- Supported classes:
26
27 -- At the moment, only Warrior, Rogue & Paladin classes are supported, for testing reasons. More will be added,
28 -- once the generator engine runs as intended.
29
30
31 -- Editing Settings:
32
33 -- Scroll down to the code local defaultSettings = {} and change the values inside the table as you wish.
34 -- After changing the default settings inside this code, you MUST use '/bcg reset' ingame, to reload the settings.
35
36
37 -- Editing/Creating/Removing custom cries:
38
39 -- Ingame adding/removing/editing of cries is not yet implemented, but planned, later on.
40 -- At the moment, only in-code cries are supported. Scroll down and find the code: local cries = {}.
41 -- Search for the event or spell table inside the main table and change the cries or add new ones as strings.
42 -- Don't forget the , at the end!
43 -- ATTENTION: When editing cries inside this code, do NOT USE '%t' for target name! Instead, write 'targetName'
44 -- without the '' to your cry. It will then be replaced later, automatically with the actual '%t' value.
45 -- After changing the cry lists inside this code, you MUST use '/bcg dbreset' ingame, to reload the list completely,
46 -- or your changes will not be available.
47
48
49 -- Ingame command list:
50
51 -- /bcg Show options (and this list) default chatframe.
52 -- /bcg on Enable generator.
53 -- /bcg off Disable generator.
54 -- /bcg debug Toggle ingame debugger.
55 -- /bcg reset Reset settings to defaults. (Cry Chance, critical hit bonus, generator and debugger state.
56 -- /bcg dbreset Delete all custom cries and reset to default cries, offered in this code.
57 -- /bcg status Show ingame generator/debugger state info.
58
59 -- Language localizations currently supported: German, English.
60 -- Default cries language: German
61
62 -- ##################################################################################################################
63
64 -- This table is gonna be saved on program close, for all chars, it holds all available cries for all classes.
65 BattleCryDB = {};
66
67 -- This table is gonna be saved on program close, only for the current char, it holds this chars general settings.
68 BattleCryPerCharDB = {};
69
70 -- The default settings for BattleCry Generator are stored only for the current character.
71 local defaultSettings = {
72 Enabled = true,
73 Debugger = false,
74 Chance = 3,
75 CritBonus = 25
76 }
77
78 -- Runtime values
79 local playerClass = "";
80 local playerName = "";
81 local playerRace = "";
82 local targetName = "";
83 local mySpells = {};
84
85 -- All available cries.
86 local cries = {
87
88 ["General"] = {
89
90 ["Any"] = {
91 "Aye!",
92 "Heureka!",
93 "Hervorragend.",
94 "Ahh, so geht das.",
95 "Besser geht's nich.",
96 "Aye, so macht man das.",
97 "Wusste doch, das klappt.",
98 },
99
100 ["SWING_DAMAGE"] = {
101 "Ho!",
102 "Hah!",
103 "Heya!",
104 "He-he!",
105 "Ha-ha!",
106 "Ah-ha!",
107 "Erwischt!",
108 "Nimm' das!",
109 "Oink oink!",
110 "So sieht's aus!",
111 "Hier kommt der Schmerz!",
112 },
113
114 ["SWING_MISSED"] = {
115 "Mist!",
116 "Hoppla!",
117 "Bastard.",
118 "Verdammt!",
119 "Halt still!",
120 "Sportlich...",
121 "Wirst du wohl?!",
122 },
123
124 ["SWING_ABSORBED"] = {
125 "Oha!",
126 "Uhhhh!",
127 },
128
129 ["SWING_RESISTED"] = {
130 "Oha!",
131 "Uhhhh!",
132 },
133
134 ["SWING_BLOCKED"] = {
135 "Uh!",
136 "Ouh!",
137 "Huh!",
138 "Urgh!",
139 "Bastard!",
140 "Drecksack!",
141 "Auf's Maul?!",
142 "Wirst du wohl?!",
143 },
144
145 ["RANGE_DAMAGE"] = {
146 "Jaawoll!",
147 "Treffer!",
148 "Bullseye!",
149 "Ins Schwarze!",
150 "Der hat gesessen!",
151 "Ich schieße scharf!",
152 "Genau ins Schwarze!",
153 "Zwischen die Augen!",
154 "Augen wie ein Adler!",
155 "Auf 200 Schritt, direkt zwischen die Augen!",
156 },
157
158 ["RANGE_MISSED"] = {
159 "Mist!",
160 "Bastard.",
161 "Daneben!",
162 "Verdammt!",
163 "Halt still!",
164 "Sportlich...",
165 "Wirst du wohl?!",
166 },
167
168 ["RANGE_ABSORBED"] = {
169 "Oha!",
170 "Uhhhh!",
171 },
172
173 ["RANGE_RESISTED"] = {
174 "Oha!",
175 "Uhhhh!",
176 },
177
178 ["RANGE_BLOCKED"] = {
179 "Uh!",
180 "Ouh!",
181 "Huh!",
182 "Urgh!",
183 "Bastard!",
184 "Drecksack!",
185 "Auf's Maul?!",
186 "Wirst du wohl?!",
187 },
188
189 ["SPELL_MISSED"] = {
190 "Mist!",
191 "Daneben!",
192 "Verdammt!",
193 },
194
195 ["SPELL_ABSORBED"] = {
196 "Oha!",
197 "Uhhhh!",
198 },
199
200 ["SPELL_RESISTED"] = {
201 "Oha!",
202 "Uhhhh!",
203 },
204
205 ["SPELL_BLOCKED"] = {
206 "Uh!",
207 "Ouh!",
208 "Huh!",
209 "Urgh!",
210 "Sowas!",
211 "Bastard!",
212 "Drecksack!",
213 "Auf's Maul?!",
214 "Wirst du wohl?!",
215 },
216
217 ["PARTY_KILL"] = {
218 "SIEEG!",
219 "Sonst noch wer?!",
220 "Ein weiterer Sieg!",
221 "wer is der nächste?!",
222 "Wieder einer weniger!",
223 "Der zählt aber für mich!",
224 "Ein weiterer Sieg! War klar.",
225 }
226
227 },
228
229 ["Racial"] = {
230
231 -- Dwarf
232 ["Stoneform"] = {
233 "Irdene Macht!",
234 "Ich bin ein Fels!",
235 "Ich bin Steinhart!",
236 "Bei den Vorfahren!",
237 "Die Macht des Steins!",
238 "Die Macht der Irdenen!",
239 "An mir beißt du dir die Zähne aus!",
240 "Ich bin ein wahrhafter Sohn der Irdenen!",
241 "Ihr Irdenen und Vorfahren, helft mir mit eurer Kraft!",
242 },
243
244 -- Gnome
245 ["Escape artist"] = {
246 "Und tschüss!",
247 "Haste gedacht!",
248 "Schwupps und weg."
249 },
250
251 -- Night elf
252 ["Shadowmeld"] = {
253
254 },
255
256 -- Orc
257 ["Blood Fury"] = {
258
259 },
260
261 -- Troll
262 ["Berserking"] = {
263
264 },
265
266 -- Tauren
267 ["War Stomp"] = {
268
269 },
270
271 -- Undead 1
272 ["Cannibalize"] = {
273
274 },
275
276 -- Undead 2
277 ["Will of the Forsaken"] = {
278
279 }
280
281 },
282
283 ["Class"] = {
284
285 ["Druid"] = {
286
287 -- Vergiftung aufheben
288 ["Abolish poison"] = {
289 "Gift, weiche!",
290 "Nur die Dosis macht das Gift.",
291 "Auf die richtige Dosis kommt es an!",
292 },
293
294 -- Wucherwurzeln
295 ["Entangeling roots"] = {
296 "Bleib stehen!",
297 "Die Natur ist mit mir!",
298 "Cenarius, halte Sie auf!",
299 "Bis hier hin und nicht weiter!",
300 },
301
302 -- Feenfeuer
303 ["Faerie fire"] = {
304 "Brenne!",
305 "Ihr Feen, helft mir!",
306 "Deine Rüstung wird brennen!",
307 "Ihr Feen, leiht mir euer Feuer!",
308 "Ihr Feen, ich benötige euer Feuer!",
309 },
310
311
312 -- Mal der Wildnis
313 ["Mark of the wild"] = {
314 "Geh mir der Kraft der Natur!",
315 "Empfange die Kräfte der Natur!",
316 "Geh mir der Kraft des Cenarius!",
317 },
318
319 -- Heilende Berührung
320 ["Healing touch"] = {
321 "Cenarius, heile diese Wunden.",
322 "Dein Leid möge vergessen sein.",
323 "Heile und entwachse dem Schmerz!",
324 "Die Natur wird dein Leid mindern.",
325 }
326
327 -- Winterschlaf
328 ["Hibernate"] = {
329 "Schlafe!",
330 "Du wirst müde...",
331 "Und du schläfst ein...",
332 "Empfange den Schlaf...",
333 "Deine Augen werden schwer...",
334 "Schließe die Augen und schlafe.",
335 }
336
337 -- Mondfeuer
338 ["Moonfire"] = {
339 "Cenarius Licht strafe dich!",
340 "Das Sternenlicht wird dich strafen!",
341 },
342
343 -- Wiedergeburt
344 ["Rebirth"] = {
345 "Erstehe erneut!",
346 "Cenarius, errette diese Seele!",
347 "Cenarius, schenke uns deine Gunst!",
348 "Erwache und atme erneut die frische Luft!",
349 },
350
351 -- Nachwachsen
352 ["Regrowth"] = {
353 "Deine Kraft wird zurückkehren.",
354 "Empfange die Kraft des Cenarius!",
355 "Die Natur wird deine Wunden verschliessen.",
356 },
357
358 -- Verjüngung
359 ["Rejuvenation"] = {
360 "Erhole dich.",
361 "Sammle Kraft.",
362 },
363
364 -- Fluch aufheben
365 ["Remove curse"] = {
366 "Der Fluch sei von dir Genommen.",
367 "Kein Fluch soll mehr Bestand haben!",
368 },
369
370 -- Tier besänftigen
371 ["Sooth animal"] = {
372 "Braaav.",
373 "Ruuuhig.",
374 "Bleibe ruhig.",
375 "Bleib Ruuuhig.",
376 "Wir sind keine Gefahr für dich.",
377 },
378
379 -- Dornen
380 ["Thorns"] = {
381 "Die Natur sei dein Schild!",
382 "Die Natur wird dich schützen!",
383 "Dein Leid wird sein Leid sein!",
384 "Die Natur möge dein Schild sein!",
385 "Wer dir böses will, dem soll Schmerz widerfahren!",
386 },
387
388 -- Gelassenheit
389 ["Tranquility"] = {
390 "Nur die Ruhe.",
391 "Nur mit der Ruhe.",
392 "Empfangt die Gelassenheit.",
393 "Keine Aufregung, nur Gelassenheit.",
394 },
395
396 -- Zorn
397 ["Wrath"] = {
398 "Die Natur ist mit mir!",
399 "Spüre den Zorn des Cenarius!",
400 "Cenarius Zorn soll dich treffen!",
401 },
402
403 },
404
405 ["Hunter"] = {
406
407 },
408
409 ["Mage"] = {
410
411 },
412
413 ["Paladin"] = {
414
415 -- Segen der Könige
416 ["Blessing of kings"] = {
417 "Die Könige segnen dich.",
418 "Geh mit dem Segen der Könige.",
419 "Der Segen der Könige erfülle dich."
420 },
421
422 -- Segen der Macht
423 ["Blessing of might"] = {
424 "Empfange die Macht des Lichts.",
425 "Die Macht des Lichts ist mit dir.",
426 "Sei gesegnet mit der Macht des Lichts.",
427 "Das Licht segne dich mit seiner Macht.",
428 "Geh mit der Macht, die das Licht schenkt.",
429 "Das Licht sei mit dir und schenke dir Macht."
430 },
431
432 -- Segen des Schutzes
433 ["Blessing of protection"] = {
434 "Licht, errette diese arme Seele.",
435 "Licht, beschütze diese arme Seele.",
436 "Das Licht möge deiner Seele gnädig sein!"
437 },
438
439 -- Segen der Rettung
440 ["Blessing of salvation"] = {
441 "Das Licht ist mit dir.",
442 "Das Licht verdeckt deine Absichten."
443 },
444
445 -- Segen der Weisheit
446 ["Blessing of wisdom"] = {
447 "Spüre die Weisheit des Lichts.",
448 "Das Licht segne dich mit Weisheit.",
449 "Geh mit der Weisheit, die das Licht schenkt.",
450 "Das Licht sei mit dir und schenke dir Weisheit."
451 },
452
453 -- Göttlicher Schutz
454 ["Divine protection"] = {
455 "Licht, beschütz mich!",
456 "Das Licht erfüllt mich!",
457 "Das Licht wacht über mich!",
458 "Licht, schütze deinen Diener."
459 },
460
461 -- Göttliches Eingreifen
462 ["Divine intervention"] = {
463 "Nimm dieses Opfer und ahhhhh",
464 "Ich opfere mich, für die Allianz!",
465 "Nimm mein Leben und rette das Seine."
466 },
467
468 -- Exorzismus
469 ["Exorcism"] = {
470 "Es werde Licht!",
471 "Weiche, Kreatur!",
472 "Klaatu, Verata, Nachahaha!",
473 "Zurück in die Schatten, targetName!",
474 "Das Licht wird dich bannen, targetName!",
475 "Das Licht wird dich richten, targetName!",
476 "Du hast hier nichts verloren, targetName!",
477 "Zurück in das Loch, aus dem du kamst!",
478 "Ich verbanne dich, zurück in die Schatten!"
479 },
480
481 -- Lichtblitz
482 ["Flash of light"] = {
483 "Halt durch!",
484 "Hilfe ist unterwegs!",
485 "Wird gleich wieder gut.",
486 "Heile, heile, Gänschen!",
487 "Gleich wirds kurz hell!",
488 "Achtung, es blitzt kurz.",
489 "Warte, ich rufe Hilfe! Ach, moment... Die bin ja ich."
490 },
491
492 -- Richturteil
493 ["Judgement"] = {
494 "Das Licht wird dich richten!",
495 "Schuldig, im Sinne der Anklage!",
496 "Ich bin dein Richter und Henker!",
497 "Das hohe Gericht hat entschieden: Tod!",
498 "Höre nun dein Urteil! Tod auf Bewährung!",
499 "Das hohe Gericht serviert heut Tiefschläge!",
500 "Du hast das Recht zu STERBEN! Ein für alle mal!",
501 "Empfange das Urteil: Tod im Sinne von ...naja, tot!"
502 },
503
504 -- Hammer der Gerechtigkeit
505 ["Hammer of justice"] = {
506 "Rumms!",
507 "Das gibt Kopfweh!",
508 "Gleich wirds dunkel!",
509 "Hier kommt der HAMMER!",
510 "Alles gute kommt von oben!"
511 },
512
513 -- Heiliges Licht
514 ["Holy light"] = {
515 "Heiliges Licht! Hilf uns!",
516 "Das heilige Licht ist mit dir!",
517 "Der Schmerz ist gleich vorbei.",
518 "Das heilige Licht gibt dir neue Kraft!",
519 "Heiliges Licht, errette diese Arme Seele!",
520 "Ist das deine Mils? Naja, ich bau sie erstmal wieder ein.",
521 "Da hängen ja schon die Gedärme raus, ich mach dich mal wieder zu."
522 },
523
524 -- Handauflegung
525 ["Lay on hands"] = {
526 "Du stirbst heut' nich!",
527 "Hier wird nich' gestorben!",
528 "Nich, während meiner Wache!"
529 },
530
531 -- Läutern
532 ["Purify"] = {
533 "Ich nehme die Krankheit von dir!",
534 "Hier wird sich nich' krank gemeldet!",
535 "Verzage nicht, ich erlöse dich von dieser Krankheit."
536 },
537
538 -- Erlösung
539 ["Redemption"] = {
540 "REANIMATION!",
541 "Reanimation! Das kann ich.",
542 "Das Licht erfülle dich erneut!",
543 "Empfange erneut das heilige Licht!",
544 "Stirb an einem anderen Tag, Freund.",
545 "Atme wieder die gute Luft mein Freund.",
546 "Kein Licht, kein Ton, ich komm' ja schon!"
547 },
548
549 -- Rechtschaffender Zorn
550 ["Righteous fury"] = {
551 "Ich werde sie ablenken!",
552 "Ich werde euch beschützen!",
553 "Ich nehme ihren Zorn auf mich!"
554 },
555
556 -- Untote spüren
557 ["Sense undead"] = {
558 "Ich kann den Tod spüren!",
559 "Untote, ich kann Sie spüren.",
560 "Orks! Ah, ne, riecht nur so ähnlich.",
561 "Ich sehe untote Menschen...und anderes, was mir auch nich' richtig schmeckt."
562 }
563
564 },
565
566 ["Priest"] = {
567
568 },
569
570 ["Rogue"] = {
571
572 -- Hinterhalt
573 ["Ambush"] = {
574 "Ha-ha!",
575 "Erwischt!",
576 "Nimm das!",
577 "Da bin ich!",
578 "Überraschung!",
579 },
580
581 -- Entrinnen
582 ["Evasion"] = {
583 "1, 2, 3, Cha-Cha-Cha!",
584 "Tanzen wir eine Runde!",
585 "Mich triffst du nicht!",
586 "1, 2, 3, wieder vorbei!",
587 "Komm schon, zeig was du kannst!",
588 "Ich bin einfach zu schnell für dich!",
589 },
590
591 -- Finte
592 ["Feint"] = {
593 "Kuck kuck!",
594 "War ich nicht!",
595 "Ich war's nicht!",
596 "Hier! Nein, hier!",
597 "Ich bin unschuldig!",
598 "Huch, Entschuldigung!",
599 "Rechts äh, links, äh ZACK!",
600 },
601
602 -- Tritt
603 ["Kick"] = {
604 "Ruhe!",
605 "Klappe!",
606 "Vergiss es!",
607 "Netter Versuch!",
608 "Bist du wohl ruhig!?",
609 "Hier wird nicht gezaubert!",
610 },
611
612 -- Nierenhieb
613 ["Kidney shot"] = {
614 "Zack!",
615 "Und Haken!",
616 "Und jetzt der Haken!",
617 "Jetzt kommt der Schmerz!",
618 },
619
620 -- Schloss knacken
621 ["Pick lock"] = {
622 "Kleinigkeit.",
623 "Kinderspiel.",
624 "Hab's gleich.",
625 "Gleich offen.",
626 "Zeig mal her...",
627 },
628
629 -- Verschwinden
630 ["Vanish"] = {
631 "Und weg.",
632 "Bis gleich.",
633 "Ich bin dann mal weg.",
634 "Ich verschwinde dann mal.",
635 "Jetzt siehst du mich...und jetzt nicht.",
636 "Was du nicht siehst, kannst du nicht bekämpfen.",
637 },
638
639 },
640
641 ["Shaman"] = {
642
643 },
644
645 ["Warrior"] = {
646
647 -- Schlachtruf
648 ["Battle shout"] = {
649 "Für Falstad!",
650 "Haltet Stand!",
651 "Für Ironforge!",
652 "Für den König!",
653 "Für die Allianz",
654 "Für die Wildhammer!",
655 "Die ersten 100 sind meine!",
656 "Für Bronzebart und Ironforge!",
657 "Für Falstad und die Wildhammer!",
658 },
659
660 -- Blutrausch
661 ["Bloodrage"] = {
662 "Roarrrr!",
663 "Aaaaargh!",
664 "Aggresssiooon!",
665 "Rrrrrraaaawww!",
666 "Ich bin sauer!",
667 "Aaargh, diese WUUUT!",
668 "Ich bin echt wütend!",
669 "Ne ordentliche Keilerei, wird auch Zeit!",
670 },
671
672 -- Sturmangriff
673 ["Charge"] = {
674 "ATTACKE!",
675 "Auf geht's!",
676 "Zum Angriff!",
677 "Und nu' zu uns!",
678 "Zwerg is daaaa!",
679 "Ich kooooommmmeee!",
680 "Damm-dadada-daaaaaaa!",
681 "Die ersten Zehn sind meine!",
682 "Bluuuutig, bluutig halleluja!",
683 },
684
685 -- Herausforderungsruf
686 ["Challenging shout"] = {
687 "Kommt alle her!",
688 "Zu mir ihr Bastarde!",
689 "Hier spielt die Musik!",
690 "Ich nehm's mit euch allen auf!",
691 "Jeder kriegt was ab, versprochen!",
692 "Wer hat noch nich, wer will noch mal?!",
693 },
694
695 -- Demoralisierungsruf
696 ["Demoralizing shout"] = {
697 "Oink, Oink!",
698 "Kommt nur her!",
699 "Spürt die irdene Kraft!",
700 "Ist das hier schon Alles?!",
701 "Die Vorfahren sind mit mir!",
702 "Endlich 'ne ordentliche Prügelei!",
703 "Ich hab' 'ne Posaune eingepflanzt un' es wurd' 'ne VUVUZELA!",
704 },
705
706 -- Drohruf
707 ["Intimidating shout"] = {
708 "Buh!",
709 "Ahhh, Verstärkung!",
710 "Pfffffft. Huch, 'tschuldigung!",
711 "Kennst du den Witz vom Ork, der den Zwerg nach dem Weg fragte?",
712 },
713
714 -- Hinrichten
715 ["Execute"] = {
716 "Stirb!",
717 "Jetz' STIRB!",
718 "Und jetz' Stirb!",
719 "Fall. Endlich. Um!",
720 "Gleich ist's um dich geschehen!",
721 "Ich kann den Sieg schon schmecken!",
722 },
723
724 -- Heldenhafter Stoß
725 ["Heroic strike"] = {
726 "Ha-ha!",
727 "Treffer!",
728 "Nimm das!",
729 "So geht das!",
730 "Hier kommt der Schmerz!",
731 },
732
733 -- Überwältigen
734 ["Overpower"] = {
735 "Zack!",
736 "So nich!",
737 "Erwischt!",
738 "Dir zeig ich's!",
739 "Haste dir so gedacht!",
740 "So nicht, mein Freund!",
741 "Hier kommt der Schmerz!",
742 "Oink, Oink, targetName!",
743 "Hier kommt der Schmerz!",
744 "Haste gedacht, targetName!",
745 },
746
747 -- Rache
748 ["Revenge"] = {
749 "Zack!",
750 "So nich!",
751 "Erwischt!",
752 "Dir zeig ich's!",
753 "Haste dir so gedacht!",
754 "So nicht, mein Freund!",
755 "Hier kommt der Schmerz!",
756 "Oink, Oink, targetName!",
757 "Hier kommt der Schmerz!",
758 "Haste gedacht, targetName!",
759 },
760
761 -- Schildhieb
762 ["Shield bash"] = {
763 "Bist du ruhig!",
764 "Nein, nein, nein!",
765 "Haste gedacht, targetName!",
766 "Pssst, targetName, Klappe!",
767 "Halt die Klappe, targetName!",
768 "Hier wird nich gezaubert, targetName!",
769 "Ich zauber dir gleich mal'n Ring um die Augen!",
770 },
771
772 -- Spott
773 ["Taunt"] = {
774 "He, Schweinenase?!",
775 "Ich bin hier unten!",
776 "Hier bin ich, targetName!",
777 "Ich lache über dich, targetName!",
778 "Du stinkst ganz schön, targetName!",
779 "Wirst du wohl herkommen, targetName!?",
780 "Hey targetName, hier gibts aufs Maul!",
781 "Deine Nase passt mir nicht, targetName!",
782 "Hey, targetName, deine Mutter lässt grüßen!",
783 "Wir waren hier noch nich fertig, targetName!",
784 "Mit dir bin ich noch nich fertig, targetName!",
785 "Leg dich mit Jemand in deiner Größe an, targetName!",
786 "Igitt, targetName, der Geruch deiner Füße ist unerträglich!",
787 "Mein linker Zeh juckt und ich glaube DU hast Schuld!",
788 }
789
790 },
791
792 ["Warlock"] = {
793
794 }
795
796 }
797
798 }
799
800 -- Colors used to format the output text inside the ChatBox.
801 local colors = {
802 ["red"] = "|cffFF6969",
803 ["orange"] = "|cffFFA369",
804 ["yellow"] = "|cffFFEF2B",
805 ["green"] = "|cff6BBD57",
806 ["blue"] = "|cff4040F2";
807 ["violet"] = "|cffBD6FBF",
808 ["pink"] = "|cffFFB8F5",
809 ["white"] = "|cffFFFFFF",
810 ["gold"] = "|cffAD9E63",
811 ["Druid"] = "|cffFFB04F",
812 ["Hunter"] = "|cff8ECF63",
813 ["Mage"] = "|cff80CAFF",
814 ["Paladin"] = "|cffFAB6F7",
815 ["Priest"] = "|cffFDFFFC",
816 ["Rouge"] = "|cffFFEE03",
817 ["Shaman"] = "|cff78F1FF",
818 ["Warrior"] = "|cffCCB89B",
819 ["Warlock"] = "|cffCA86DB"
820 }
821
822 -- Create the main table for BattleCry Generator
823 local BattleCryGenHud = BattleCryGenHud or {};
824
825 -- Create the frame that will be used for any events
826 BattleCryGenHud.frame = CreateFrame("Frame", "BattleCryGenHud", UIParent);
827 BattleCryGenHud.frame:SetFrameStrata("BACKGROUND");
828
829 -- Register all required events.
830 BattleCryGenHud.frame:RegisterEvent("PLAYER_ENTERING_WORLD");
831 BattleCryGenHud.frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
832 BattleCryGenHud.frame:RegisterEvent("ADDON_LOADED");
833
834
835 -- Fired, when the player has finally entered the world.
836 function BattleCryGenHud.frame:PLAYER_ENTERING_WORLD(...)
837 playerClass = inEnglish("class", UnitClass("player"));
838 playerGUID = UnitGUID("player");
839 playerName = UnitName("player");
840 playerRace = inEnglish("race", UnitRace("player"));
841
842 if (playerClass ~= "Warrior") and (playerClass ~= "Paladin") and (playerClass ~= "Rogue") and (playerClass ~= "Druid") then
843 BattleCryPerCharDB.Enabled = false;
844 BattleCryPerCharDB.Debugger = false;
845 Show_Msg (colors.gold .. "BattleCry Generator " .. colors.yellow .. "has been " .. colors.red .. "disabled" .. colors.yellow .. " for this character.");
846 Show_Msg (colors.yellow .. "We're sorry, but your class " .. colors[playerClass] .. "[" .. playerClass .. "] " .. colors.yellow .. "is not yet supported!");
847 else
848 Show_Status();
849 -- SETTINGs
850 if (BattleCryPerCharDB ~= {}) then
851 Show_Msg (colors.yellow .. "Settings loaded for" .. colors[inEnglish("class", playerClass)] .. " " .. playerName .. "" .. colors.yellow .. ".");
852 else
853 Show_Msg (colors.orange .. "Settings not found for" .. colors[inEnglish("class", playerClass)] .. " " .. playerName .. "" .. colors.orange .. ".");
854 ResetSettings();
855 end;
856
857 -- Store default cries
858 if (BattleCryDB == {}) or (BattleCryDB == nil) then
859 Show_Msg (colors.orange .. "Stored cries not found. Loading defaults.");
860 BattleCryDB = copyTable (cries);
861 else
862 Show_Msg (colors.yellow .. "All cries loaded.");
863 end;
864
865 local _classes = BattleCryDB["Class"];
866 mySpells = _classes[playerClass];
867 end;
868 end
869
870 -- Fires on any event, non- or combat, registered by wow's combat log, from somewhere near the player.
871 function BattleCryGenHud.frame:COMBAT_LOG_EVENT_UNFILTERED(...)
872 -- If BattleCry Generator has been enabled, otherwise, do nothing.
873 if (BattleCryPerCharDB.Enabled) then
874 -- Gather all event info required.
875 local _, subevent, _, sourceGUID, sourceName, _, _, destGUID, destName, _, _ = CombatLogGetCurrentEventInfo();
876 local spellId, spellName, spellSchool;
877 local amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand;
878
879 -- Check if the event should be ignored from the beginning.
880 if (ignoreEvent(subevent) == false) then
881 -- Check if the player or his actual target are involved, or a unit died... otherwise, ignore this event.
882 if (sourceGUID == playerGUID) or (subevent == "PARTY_KILL") then-- or (destGUID == playerGUID) then
883 -- Check if this is a non-spell MELEE or RANGE event?
884 if(string.find(subevent, "SWING")) or (string.find(subevent, "RANGE")) or (subevent == "PARTY_KILL") then
885 _, _, _, resisted, blocked, absorbed, critical, glancing, crushing, _ = select(12, CombatLogGetCurrentEventInfo());
886 -- Non-spell event. Initialize spellName with empty string.
887 spellName = subevent;
888 -- Or is it a SPELL event?
889 elseif(string.find(subevent, "SPELL")) then
890 _, spellName, _, _, _, _, resisted, blocked, absorbed, critical, glancing, crushing, _ = select(12, CombatLogGetCurrentEventInfo());
891 else
892 -- It is neither SPELL, nor MELEE or RANGE event!
893 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.orange .. ">> Event" .. colors.yellow .. " [" .. subevent .. "]" .. colors.orange .. " is neither SPELL, nor MELEE or RANGE!"); end;
894 end;
895
896 -- Now calculate chances for a cry to happen.
897 local _rand = math.random( 100 );
898 -- If this was a critical hit, increase calculated cry chance by CritBonus from BattleCryPerCharDB settings.
899 if (critical) then
900 _rand = _rand + BattleCryPerCharDB.CritBonus;
901 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.orange .. " Hit was a crit, so Chance for a cry was increased by " .. BattleCryPerCharDB.CritBonus .. " to " .. _rand .. "%"); end;
902 end;
903 -- If we hit the cry chance,...
904 if (_rand >= (100-BattleCryPerCharDB.Chance)) then
905 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.green .. "Rolled " .. _rand .. " against " .. (100-BattleCryPerCharDB.Chance) .. " on " .. colors.yellow .. "[" .. spellName .. "]" .. colors.green .. " from " .. sourceName .. "."); end;
906 -- ...generate the cry.
907 GenerateCry ({subevent, spellName, destName});
908 -- If we do not hit the cry chance, do nothing.
909 else
910 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.blue .. "Rolled " .. _rand .. " against " .. (100-BattleCryPerCharDB.Chance) .. " on " .. colors.yellow .. "[" .. spellName .. "]" .. colors.blue .. " from " .. sourceName .. "."); end;
911 end;
912 end;
913 end;
914 end;
915 end
916
917 -- Sends the actual cry to the ChatBox, once the correct table was selected.
918 function GenerateCry(eventData)
919 local subevent, spellName, destName = unpack(eventData);
920 local chnl = "SAY";
921 local tble = {};
922 local tbleCnt = table.getn( tble );
923
924 -- Is this a spell action?
925 if (spellName ~= nil) and (spellName ~= subevent) then
926 -- Ensure that spellName is valid and not only some Number or spellId.
927 if (string.len(spellName) > 3) then
928 -- Try getting the cry from the characters, race specific, 'Racial' table.
929 if (keyExists(cries.Racial, inEnglish("racial", spellName))) then
930 tble = cries.Racial[inEnglish("racial", spellName)];
931 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.green .. ">> Cry table found for" .. colors.yellow .. " [" .. spellName .. "]" .. colors.green .. "inside Racials."); end;
932 -- Now try getting the cry from characters class specific 'mySpells' table.
933 elseif (keyExists(mySpells, inEnglish("spell", spellName))) then
934 tble = mySpells[inEnglish("spell", spellName)];
935 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.green .. ">> Cry table found for" .. colors.yellow .. " [" .. spellName .. "]" .. colors.green .. "inside mySpells."); end;
936 -- No table found!
937 else
938 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.red .. ">> No cry table found for" .. colors.yellow .. " [" .. spellName .. "]" .. colors.red .. "!"); end;
939 end;
940 end;
941 -- It is a non-spell action.
942 else
943 -- Try getting the cry from the 'General' table by using the actual 'subevent' as lookup-key.
944 if (keyExists(cries.General, subevent)) then
945 tble = cries.General[subevent];
946 -- subevent was no valid key, so use the 'Any' table.
947 else
948 --tble = cries.General["Any"];
949 end;
950 end;
951
952 -- There should be a non-empty table, else something went wrong.
953 if(tble ~= nil) and (tble ~= {}) then
954 -- Now select a random cry,...
955 local _rand = math.random(table.getn( tble ));
956 local _cry = tble[_rand];
957
958 -- Check if there is an actual cry.
959 if (_cry ~= "") and (_cry ~= nil) then
960 -- Check if the randomly selected cry uses the targetName.
961 if (string.find(_cry, "targetName") or string.find(_cry, "%'targetName%'")) then
962 -- Check if there IS an actual target.
963 if (UnitExists("target")) then
964 _cry.gsub("targetName", GetFirstOfStrg(UnitName("target")));
965 _cry.gsub("%'targetName%'", GetFirstOfStrg(UnitName("target")));
966 -- There is no target, but targetName should be used, try to use destName instead.
967 elseif (destName ~= "") and (destName ~= nil) then
968 _cry.gsub("targetName", GetFirstOfStrg(destName));
969 _cry.gsub("%'targetName%'", GetFirstOfStrg(destName));
970 -- There is no actual target and also no destName, so delete the _cry.
971 else
972 _cry = nil;
973 end;
974 end;
975
976 -- If cry has been deleted, don't send anything.
977 if (_cry ~= nil) then
978 -- Now send it to the selected chnl.
979 SendChatMessage(_cry, chnl);
980 end;
981 end;
982 else
983 if (BattleCryPerCharDB.Debugger) then Show_Msg (colors.red .. ">> Cry table selection failed."); end;
984 end;
985 end
986
987 -- Recieved text command
988 function TextCommand(_arg)
989 -- Recieved command for turning Battlecry Generator on.
990 if (string.lower(_arg) == "on") then
991 BattleCryPerCharDB.Enabled = true;
992 Show_Msg (colors.yellow .. "BattleCry Generator is now" .. colors.green .. " ON" .. colors.yellow .. ".");
993 -- Recieved command for turning Battlecry Generator off.
994 elseif (string.lower(_arg) == "off") then
995 BattleCryPerCharDB.Enabled = false;
996 Show_Msg (colors.yellow .. "BattleCry Generator is now" .. colors.red .. " OFF" .. colors.yellow .. ".");
997 -- Recieved command for turning Battlecry Generators Debugger on/off.
998 elseif (string.lower(_arg) == "debug") then
999 if (BattleCryPerCharDB.Debugger) then
1000 BattleCryPerCharDB.Debugger = false;
1001 Show_Msg (colors.yellow .. "BattleCry Debugger is now" .. colors.red .. " OFF" .. colors.yellow .. ".");
1002 else
1003 BattleCryPerCharDB.Debugger = true;
1004 Show_Msg (colors.yellow .. "BattleCry Debugger is now" .. colors.green .. " ON" .. colors.yellow .. ".");
1005 end;
1006 -- Display status of BattleCry Generator on the ChatBox.
1007 elseif (string.lower(_arg) == "status") then
1008 Show_Status();
1009 elseif (string.lower(_arg) == "dbreset") then
1010 ResetDB();
1011 elseif (string.lower(_arg) == "reset") then
1012 ResetSettings();
1013 -- If anything else comes in, as a command, but is not valid, show the info again.
1014 else
1015 Show_Info();
1016 end;
1017 end
1018
1019 -- Restore default settings.
1020 function ResetSettings ()
1021 BattleCryPerCharDB = {};
1022
1023 if (BattleCryPerCharDB.Enabled == nil) then
1024 BattleCryPerCharDB.Enabled = defaultSettings.Enabled;
1025 end;
1026 if (BattleCryPerCharDB.Debugger == nil) then
1027 BattleCryPerCharDB.Debugger = defaultSettings.Debugger;
1028 end;
1029 if (BattleCryPerCharDB.Chance == nil) then
1030 BattleCryPerCharDB.Chance = defaultSettings.Chance;
1031 end;
1032 if (BattleCryPerCharDB.CritBonus == nil) then
1033 BattleCryPerCharDB.CritBonus = defaultSettings.CritBonus;
1034 end;
1035 Show_Msg (colors.orange .. "Stored BattleCry Generator settings deleted & reset to defaults.");
1036 Show_Status();
1037 end;
1038
1039 -- Reset all stored cries. ATTENTION! None of the ingame added cries will survive! Use with caution!
1040 function ResetDB ()
1041 BattleCryDB = {};
1042 BattleCryDB = copyTable (cries);
1043 Show_Msg (colors.red .. "All cries deleted from database and restored with defaults!");
1044 end
1045
1046 -- Copy a table with all its contents.
1047 function copyTable(source)
1048 local source_type = type(source)
1049 local dest
1050 if source_type == 'table' then
1051 dest = {}
1052 for source_key, source_value in next, source, nil do
1053 dest[copyTable(source_key)] = copyTable(source_value)
1054 end
1055 setmetatable(dest, copyTable(getmetatable(source)))
1056 else -- number, string, boolean, etc
1057 dest = source
1058 end
1059 return dest
1060 end
1061
1062 -- Ignores specific events, not supported or used (yet).
1063 function ignoreEvent(eventName)
1064 if (eventName == "-1") then
1065 return true;
1066 elseif (eventName == "SPELL_AURA_APPLIED") then
1067 return true;
1068 elseif (eventName == "SPELL_AURA_REMOVED") then
1069 return true;
1070 elseif (eventName == "SPELL_AURA_REFRESH") then
1071 return true;
1072 elseif (eventName == "ENCHANT_APPLIED") then
1073 return true;
1074 elseif (eventName == "ENCHANT_REMOVED") then
1075 return true;
1076 elseif (eventName == "SPELL_CAST_FAILED") then
1077 return true;
1078 elseif (eventName == "SPELL_PERIODIC_HEAL") then
1079 return true;
1080 elseif (eventName == "SPELL_ENERGIZE") then
1081 return true;
1082 elseif (eventName == "SPELL_PERIODIC_ENERGIZE") then
1083 return true;
1084 elseif (eventName == "SPELL_PERIODIC_DAMAGE") then
1085 return true;
1086 elseif (eventName == "DAMAGE_SHIELD") then
1087 return true;
1088 elseif (eventName == "ENVIRONMENTAL_DAMAGE") then
1089 return true;
1090 else
1091 return false;
1092 end;
1093 end;
1094
1095 -- Returns the translated, equivalent value of the passed-in _arg, if known (and therefor relevant) from a localized game version.
1096 function inEnglish(_loc, _arg)
1097 if(string.lower(_loc) == "class") then
1098 -- CLASS NAMES in english in german
1099 if(string.lower(_arg) == "druid") or (string.lower(_arg) == "druide") then
1100 return "Druid";
1101 elseif(string.lower(_arg) == "hunter") or (string.lower(_arg) == "jäger") then
1102 return "Hunter";
1103 elseif(string.lower(_arg) == "mage") or (string.lower(_arg) == "magier") then
1104 return "Mage";
1105 elseif(string.lower(_arg) == "paladin") or (string.lower(_arg) == "paladin") then
1106 return "Paladin";
1107 elseif(string.lower(_arg) == "priest") or (string.lower(_arg) == "priester") then
1108 return "Priest";
1109 elseif(string.lower(_arg) == "rogue") or (string.lower(_arg) == "schurke") then
1110 return "Rogue";
1111 elseif(string.lower(_arg) == "shaman") or (string.lower(_arg) == "schamane") then
1112 return "Shaman";
1113 elseif(string.lower(_arg) == "warrior") or (string.lower(_arg) == "krieger") then
1114 return "Warrior";
1115 elseif(string.lower(_arg) == "warlock") or (string.lower(_arg) == "hexenmeister") then
1116 return "Warlock";
1117 end;
1118 end;
1119 if(string.lower(_loc) == "race") then
1120 -- RACE NAMES in english in german
1121 if(string.lower(_arg) == "gnome") or (string.lower(_arg) == "gnom") then
1122 return "gnome";
1123 elseif(string.lower(_arg) == "human") or (string.lower(_arg) == "mensch") then
1124 return "human";
1125 elseif(string.lower(_arg) == "dwarf") or (string.lower(_arg) == "zwerg") then
1126 return "dwarf";
1127 elseif(string.lower(_arg) == "night elf") or (string.lower(_arg) == "nachtelf") then
1128 return "night elf";
1129 elseif(string.lower(_arg) == "orc") or (string.lower(_arg) == "ork") then
1130 return "orc";
1131 elseif(string.lower(_arg) == "troll") or (string.lower(_arg) == "troll") then
1132 return "troll";
1133 elseif(string.lower(_arg) == "tauren") or (string.lower(_arg) == "taure") then
1134 return "tauren";
1135 elseif(string.lower(_arg) == "undead") or (string.lower(_arg) == "untoter") then
1136 return "undead";
1137 end;
1138 end;
1139 if(string.lower(_loc) == "racial") then
1140 -- RACIAL SPELL NAMES in english in german
1141 if(string.lower(_arg) == "escape artist") or (string.lower(_arg) == "entfesselungskünstler") then
1142 return "Escape Artist";
1143 elseif(string.lower(_arg) == "stoneform") or (string.lower(_arg) == "steingestalt") then
1144 return "Stoneform";
1145 elseif(string.lower(_arg) == "shadowmeld") or (string.lower(_arg) == "schattenhaftigkeit") then
1146 return "Shadowmeld";
1147 elseif(string.lower(_arg) == "blood fury") or (string.lower(_arg) == "kochendes blut") then
1148 return "Blood Fury";
1149 elseif(string.lower(_arg) == "berserking") or (string.lower(_arg) == "Berserker") then
1150 return "Berserking";
1151 elseif(string.lower(_arg) == "war stomp") or (string.lower(_arg) == "kriegsdonner") then
1152 return "War Stomp";
1153 elseif(string.lower(_arg) == "cannibalize") or (string.lower(_arg) == "kannibalismus") then
1154 return "Cannibalize";
1155 elseif(string.lower(_arg) == "will of the forsaken") or (string.lower(_arg) == "wille der verlassenen") then
1156 return "Will of the Forsaken";
1157 end;
1158 end;
1159 if(string.lower(_loc) == "spell") then
1160 if (string.lower(playerClass) == "druid") then
1161 if (string.lower(_arg) == "abolish poison") or (string.lower(_arg) == "vergiftung aufheben") then
1162 return "Abolish poison";
1163 elseif (string.lower(_arg) == "entangeling roots") or (string.lower(_arg) == "wucherwurzeln") then
1164 return "Entangeling roots";
1165 elseif (string.lower(_arg) == "faerie fire") or (string.lower(_arg) == "feenfeuer") then
1166 return "Faerie fire";
1167 elseif (string.lower(_arg) == "healing touch") or (string.lower(_arg) == "heilende berührung") then
1168 return "Healing touch";
1169 elseif (string.lower(_arg) == "hibernate") or (string.lower(_arg) == "winterschlaf") then
1170 return "Hibernate";
1171 elseif (string.lower(_arg) == "mark of the wild") or (string.lower(_arg) == "mal der wildnis") then
1172 return "Mark of the wild";
1173 elseif (string.lower(_arg) == "moonfire") or (string.lower(_arg) == "mondfeuer") then
1174 return "Moonfire";
1175 elseif (string.lower(_arg) == "rebirth") or (string.lower(_arg) == "wiedergeburt") then
1176 return "Rebirth";
1177 elseif (string.lower(_arg) == "regrowth") or (string.lower(_arg) == "nachwachsen") then
1178 return "Regrowth";
1179 elseif (string.lower(_arg) == "rejuvenation") or (string.lower(_arg) == "verjüngung") then
1180 return "Rejuvenation";
1181 elseif (string.lower(_arg) == "remove curse") or (string.lower(_arg) == "fluch aufheben") then
1182 return "Remove curse";
1183 elseif (string.lower(_arg) == "sooth animal") or (string.lower(_arg) == "tier besänftigen") then
1184 return "Sooth animal";
1185 elseif (string.lower(_arg) == "thorns") or (string.lower(_arg) == "dornen") then
1186 return "Thorns";
1187 elseif (string.lower(_arg) == "tranquility") or (string.lower(_arg) == "gelassenheit") then
1188 return "Tranquility";
1189 elseif (string.lower(_arg) == "wrath") or (string.lower(_arg) == "zorn") then
1190 return "Wrath";
1191 end;
1192 end;
1193 if (string.lower(playerClass) == "hunter") then
1194
1195 end;
1196 if (string.lower(playerClass) == "mage") then
1197
1198 end;
1199 if (string.lower(playerClass) == "paladin") then
1200 -- PALADIN SPELL NAMES in english in german
1201 if (string.lower(_arg) == "blessing of kings") or (string.lower(_arg) == "segen der könige") then
1202 return "Blessing of kings";
1203 elseif (string.lower(_arg) == "blessing of might") or (string.lower(_arg) == "segen der macht") then
1204 return "Blessing of might";
1205 elseif (string.lower(_arg) == "blessing of protection") or (string.lower(_arg) == "segen des schutzes") then
1206 return "Blessing of protection";
1207 elseif (string.lower(_arg) == "blessing of salvation") or (string.lower(_arg) == "segen der rettung") then
1208 return "Blessing of salvation";
1209 elseif (string.lower(_arg) == "blessing of wisdom") or (string.lower(_arg) == "segen der weisheit") then
1210 return "Blessing of wisdom";
1211 elseif (string.lower(_arg) == "divine protection") or (string.lower(_arg) == "göttlicher schutz") then
1212 return "Divine protection";
1213 elseif (string.lower(_arg) == "divine intervention") or (string.lower(_arg) == "göttliches eingreifen") then
1214 return "Divine intervention";
1215 elseif (string.lower(_arg) == "exorcism") or (string.lower(_arg) == "exorzismus") then
1216 return "Exorcism";
1217 elseif (string.lower(_arg) == "judgement") or (string.lower(_arg) == "richturteil") then
1218 return "Judgement";
1219 elseif (string.lower(_arg) == "flash of light") or (string.lower(_arg) == "lichtblitz") then
1220 return "Flash of light";
1221 elseif (string.lower(_arg) == "hammer of justice") or (string.lower(_arg) == "hammer der gerechtigkeit") then
1222 return "Hammer of justice";
1223 elseif (string.lower(_arg) == "holy light") or (string.lower(_arg) == "heiliges licht") then
1224 return "Holy light";
1225 elseif (string.lower(_arg) == "lay on hands") or (string.lower(_arg) == "handauflegung") then
1226 return "Lay on hands";
1227 elseif (string.lower(_arg) == "purify") or (string.lower(_arg) == "läutern") then
1228 return "Purify";
1229 elseif (string.lower(_arg) == "redemption") or (string.lower(_arg) == "auferstehung") then
1230 return "Redemption";
1231 elseif (string.lower(_arg) == "righteous fury") or (string.lower(_arg) == "zorn der gerechtigkeit") then
1232 return "Righteous fury";
1233 elseif (string.lower(_arg) == "sense undead") or (string.lower(_arg) == "untote aufspüren") then
1234 return "Sense undead";
1235 end;
1236 end;
1237 if (string.lower(playerClass) == "priest") then
1238
1239 end;
1240 if (string.lower(playerClass) == "rogue") then
1241 if (string.lower(_arg) == "ambush") or (string.lower(_arg) == "hinterhalt") then
1242 return "Ambush";
1243 elseif (string.lower(_arg) == "evasion") or (string.lower(_arg) == "entrinnen") then
1244 return "Evasion";
1245 elseif (string.lower(_arg) == "feint") or (string.lower(_arg) == "finte") then
1246 return "Feint";
1247 elseif (string.lower(_arg) == "kick") or (string.lower(_arg) == "tritt") then
1248 return "Kick";
1249 elseif (string.lower(_arg) == "kidney shot") or (string.lower(_arg) == "nierenhieb") then
1250 return "Kidney shot";
1251 elseif (string.lower(_arg) == "pick lock") or (string.lower(_arg) == "schloss knacken") then
1252 return "Pick lock";
1253 elseif (string.lower(_arg) == "vanish") or (string.lower(_arg) == "verschwinden") then
1254 return "Vanish";
1255 end;
1256 end;
1257 if (string.lower(playerClass) == "shaman") then
1258
1259 end;
1260 if (string.lower(playerClass) == "warrior") then
1261 -- WARRIOR SPELL NAMES in english in german
1262 if (string.lower(_arg) == "battle shout") or (string.lower(_arg) == "schlachtruf") then
1263 return "Battle shout";
1264 elseif (string.lower(_arg) == "bloodrage") or (string.lower(_arg) == "blutrausch") then
1265 return "Bloodrage";
1266 elseif (string.lower(_arg) == "challenging shout") or (string.lower(_arg) == "herausforderungsruf") then
1267 return "Challenging shout";
1268 elseif (string.lower(_arg) == "charge") or (string.lower(_arg) == "sturmangriff") then
1269 return "Charge";
1270 elseif (string.lower(_arg) == "demoralizing shout") or (string.lower(_arg) == "demoralisierungsruf") then
1271 return "Demoralizing shout";
1272 elseif (string.lower(_arg) == "intimidating shout") or (string.lower(_arg) == "drohruf") then
1273 return "Intimidating shout";
1274 elseif (string.lower(_arg) == "execute") or (string.lower(_arg) == "hinrichten") then
1275 return "Execute";
1276 elseif (string.lower(_arg) == "heroic strike") or (string.lower(_arg) == "heldenhafter stoß") then
1277 return "Heroic strike";
1278 elseif (string.lower(_arg) == "overpower") or (string.lower(_arg) == "überwältigen") then
1279 return "Overpower";
1280 elseif (string.lower(_arg) == "revenge") or (string.lower(_arg) == "rache") then
1281 return "Revenge";
1282 elseif (string.lower(_arg) == "shield bash") or (string.lower(_arg) == "schildhieb") then
1283 return "Shield bash";
1284 elseif (string.lower(_arg) == "taunt") or (string.lower(_arg) == "spott") then
1285 return "Taunt";
1286 end;
1287 end;
1288 if (string.lower(playerClass) == "warlock") then
1289
1290 end;
1291 end;
1292 -- Return nil, if no valid value has been found until here.
1293 return nil;
1294 end
1295
1296 -- Returns true, if the passed-in key exists inside the passed-in table set.
1297 function keyExists(set, key)
1298 return set[key] ~= nil
1299 end
1300
1301 -- Returns only the first strg of a longer strg (for exmpl. only the First NAME or TITLE of a mob, without the faction or other additional informations).
1302 function GetFirstOfStrg (str)
1303 local tbl = {}
1304 for substring in str:gmatch("%S+") do
1305 table.insert(tbl, substring)
1306 end
1307 return tbl[1] or "";
1308 end
1309
1310 -- Chat box debugger/printer
1311 function Show_Msg(_msg)
1312 if( DEFAULT_CHAT_FRAME ) then
1313 DEFAULT_CHAT_FRAME:AddMessage(_msg);
1314 end
1315 end
1316
1317 -- Displays the current status of BattleCry Generator on the ChatBox.
1318 function Show_Status()
1319 Show_Msg(colors.gold .. "BattleCry Generator " .. colors.white .. "" .. Version .. " " .. Client .. "" .. colors.yellow .. " - Status:");
1320
1321 local _state = colors.red .. "off";
1322 if (BattleCryPerCharDB.Enabled) then
1323 _state = colors.green .. "on";
1324 end;
1325
1326 Show_Msg(colors.yellow .. "Generator is " .. _state .. colors.yellow .. ".");
1327 if (BattleCryPerCharDB.Debugger) then
1328 _state = colors.green .. "on";
1329 else
1330 _state = colors.red .. "off";
1331 end;
1332 Show_Msg(colors.yellow .. "Debugger is " .. _state .. colors.yellow .. ".");
1333
1334 Show_Msg(colors.white .. "Welcome" .. colors[inEnglish("class", playerClass)] .. " " .. playerClass .. "" .. colors.white .. ".");
1335 Show_Msg(colors.white .. "The cry chance is " .. colors.orange .. "" .. BattleCryPerCharDB.Chance .. "" .. colors.white .. "% The critical hit bonus is " .. colors.orange .. "" .. BattleCryPerCharDB.CritBonus .. "" .. colors.white .. ".");
1336 Show_Msg(colors.white .. "To see the options menu, type" .. colors.green .. " /bcg" .. colors.white .. ".");
1337 end
1338
1339 -- Displays the tutorial/info for BattleCry Generator on the ChatBox.
1340 function Show_Info()
1341 Show_Msg(colors.gold .. "BattleCry Generator " .. colors.white .. "" .. Version .. " " .. Client .. "" .. colors.blue .. " " .. colors.yellow .. "Options:\n");
1342 Show_Msg(colors.white .. "/bcg status " .. colors.yellow .. " Show Status");
1343 Show_Msg(colors.white .. "/bcg debug " .. colors.yellow .. " Debugger On/Off");
1344 Show_Msg(colors.white .. "/bcg off " .. colors.red .. " Disable" .. colors.yellow .. " BattleCry Generator");
1345 Show_Msg(colors.white .. "/bcg on " .. colors.green .. " Enable" .. colors.yellow .. " BattleCry Generator");
1346 end
1347
1348 -- Override the OnEvent() method to dispatch events to our processing functions.
1349 BattleCryGenHud.frame:SetScript("OnEvent", function(self, event, ...) if self[event] then return self[event](self, ...) end end);
1350
1351 -- Slash command list
1352 SLASH_BCGEN1 = "/bcg";
1353 SLASH_BCGEN2 = "/bcgen";
1354 SlashCmdList["BCGEN"] = TextCommand;