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