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