diff options
author | Gacko <gacko28@gmx.de> | 2012-11-26 15:32:30 +0100 |
---|---|---|
committer | Gacko <gacko28@gmx.de> | 2012-11-26 22:55:12 +0100 |
commit | 7accb42cc4e6959586dd783c2b3a542faf1f2018 (patch) | |
tree | 73c5785437dbcd12122efc5850bd10fd92df291c /src | |
parent | 1ff6b10fb7c19f458f1d28f947849a6a31a7ee34 (diff) |
Core/DB: Convert 25 more scripts to creature text
Diffstat (limited to 'src')
25 files changed, 326 insertions, 367 deletions
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp index f792b861c99..85a54398511 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp @@ -28,7 +28,10 @@ EndScriptData */ #include "ScriptedCreature.h" #include "molten_core.h" -#define EMOTE_SERVICE -1409000 +enum Emotes +{ + EMOTE_SERVICE = 0 +}; enum Spells { @@ -76,7 +79,7 @@ class boss_baron_geddon : public CreatureScript { me->InterruptNonMeleeSpells(true); DoCast(me, SPELL_ARMAGEDDON); - DoScriptText(EMOTE_SERVICE, me); + Talk(EMOTE_SERVICE); return; } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp index 65a630a58f7..42952580d54 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp @@ -30,7 +30,7 @@ EndScriptData */ enum Texts { - EMOTE_FRENZY = -1409001, + EMOTE_FRENZY = 0 }; enum Spells @@ -88,7 +88,7 @@ class boss_magmadar : public CreatureScript switch (eventId) { case EVENT_FRENZY: - DoScriptText(EMOTE_FRENZY, me); + Talk(EMOTE_FRENZY); DoCast(me, SPELL_FRENZY); events.ScheduleEvent(EVENT_FRENZY, 15000); break; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index c7d6b31d2ea..043e5b16330 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -32,17 +32,14 @@ EndScriptData */ enum Texts { - SAY_AGGRO = -1409003, - SAY_SPAWN = -1409004, - SAY_SLAY = -1409005, - SAY_SPECIAL = -1409006, - SAY_DEFEAT = -1409007, - - SAY_SUMMON_MAJ = -1409008, - SAY_ARRIVAL1_RAG = -1409009, - SAY_ARRIVAL2_MAJ = -1409010, - SAY_ARRIVAL3_RAG = -1409011, - SAY_ARRIVAL5_RAG = -1409012, + SAY_AGGRO = 0, + SAY_SPAWN = 1, + SAY_SLAY = 2, + SAY_SPECIAL = 3, + SAY_DEFEAT = 4, + + SAY_SUMMON_MAJ = 5, + SAY_ARRIVAL2_MAJ = 6 }; enum Spells @@ -84,13 +81,13 @@ class boss_majordomo : public CreatureScript void KilledUnit(Unit* /*victim*/) { if (urand(0, 99) < 25) - DoScriptText(SAY_SLAY, me); + Talk(SAY_SLAY); } void EnterCombat(Unit* who) { BossAI::EnterCombat(who); - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); events.ScheduleEvent(EVENT_MAGIC_REFLECTION, 30000); events.ScheduleEvent(EVENT_DAMAGE_REFLECTION, 15000); events.ScheduleEvent(EVENT_BLAST_WAVE, 10000); @@ -111,7 +108,7 @@ class boss_majordomo : public CreatureScript instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me); me->setFaction(35); me->AI()->EnterEvadeMode(); - DoScriptText(SAY_DEFEAT, me); + Talk(SAY_DEFEAT); _JustDied(); events.ScheduleEvent(EVENT_OUTRO_1, 32000); return; @@ -168,7 +165,7 @@ class boss_majordomo : public CreatureScript instance->instance->SummonCreature(NPC_RAGNAROS, RagnarosSummonPos); break; case EVENT_OUTRO_3: - DoScriptText(SAY_ARRIVAL2_MAJ, me); + Talk(SAY_ARRIVAL2_MAJ); break; default: break; @@ -182,7 +179,7 @@ class boss_majordomo : public CreatureScript if (action == ACTION_START_RAGNAROS) { me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DoScriptText(SAY_SUMMON_MAJ, me); + Talk(SAY_SUMMON_MAJ); events.ScheduleEvent(EVENT_OUTRO_2, 8000); events.ScheduleEvent(EVENT_OUTRO_3, 24000); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 0cb2bd7f7bc..4a29a7d929b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -25,6 +25,7 @@ #include "PassiveAI.h" #include "Player.h" #include "SpellInfo.h" +#include "CreatureTextMgr.h" /*###### ##Quest 12848 @@ -32,7 +33,7 @@ #define GCD_CAST 1 -enum eDeathKnightSpells +enum UnworthyInitiate { SPELL_SOUL_PRISON_CHAIN_SELF = 54612, SPELL_SOUL_PRISON_CHAIN = 54613, @@ -41,25 +42,24 @@ enum eDeathKnightSpells SPELL_ICY_TOUCH = 52372, SPELL_PLAGUE_STRIKE = 52373, SPELL_BLOOD_STRIKE = 52374, - SPELL_DEATH_COIL = 52375 -}; + SPELL_DEATH_COIL = 52375, -#define EVENT_ICY_TOUCH 1 -#define EVENT_PLAGUE_STRIKE 2 -#define EVENT_BLOOD_STRIKE 3 -#define EVENT_DEATH_COIL 4 + SAY_EVENT_START = 0, + SAY_EVENT_ATTACK = 1, -//used by 29519, 29520, 29565, 29566, 29567 but signed for 29519 -int32 say_event_start[8] = -{ - -1609000, -1609001, -1609002, -1609003, - -1609004, -1609005, -1609006, -1609007 + EVENT_ICY_TOUCH = 1, + EVENT_PLAGUE_STRIKE = 2, + EVENT_BLOOD_STRIKE = 3, + EVENT_DEATH_COIL = 4 }; -int32 say_event_attack[9] = +enum UnworthyInitiatePhase { - -1609008, -1609009, -1609010, -1609011, -1609012, - -1609013, -1609014, -1609015, -1609016 + PHASE_CHAINED, + PHASE_TO_EQUIP, + PHASE_EQUIPING, + PHASE_TO_ATTACK, + PHASE_ATTACKING, }; uint32 acherus_soul_prison[12] = @@ -87,15 +87,6 @@ uint32 acherus_unworthy_initiate[5] = 29567 }; -enum UnworthyInitiatePhase -{ - PHASE_CHAINED, - PHASE_TO_EQUIP, - PHASE_EQUIPING, - PHASE_TO_ATTACK, - PHASE_ATTACKING, -}; - class npc_unworthy_initiate : public CreatureScript { public: @@ -155,7 +146,7 @@ public: me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true); if (Player* starter = Unit::GetPlayer(*me, playerGUID)) - DoScriptText(say_event_attack[rand()%9], me, starter); + sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter); phase = PHASE_TO_ATTACK; } @@ -174,7 +165,7 @@ public: anchor->GetContactPoint(me, anchorX, anchorY, z, 1.0f); playerGUID = target->GetGUID(); - DoScriptText(say_event_start[rand()%8], me, target); + sCreatureTextMgr->SendChat(me, SAY_EVENT_START, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, target); } void UpdateAI(const uint32 diff) @@ -341,15 +332,7 @@ public: enum eDuelEnums { - SAY_DUEL_A = -1609080, - SAY_DUEL_B = -1609081, - SAY_DUEL_C = -1609082, - SAY_DUEL_D = -1609083, - SAY_DUEL_E = -1609084, - SAY_DUEL_F = -1609085, - SAY_DUEL_G = -1609086, - SAY_DUEL_H = -1609087, - SAY_DUEL_I = -1609088, + SAY_DUEL = 0, SPELL_DUEL = 52996, //SPELL_DUEL_TRIGGERED = 52990, @@ -360,11 +343,6 @@ enum eDuelEnums FACTION_HOSTILE = 2068 }; -int32 m_auiRandomSay[] = -{ - SAY_DUEL_A, SAY_DUEL_B, SAY_DUEL_C, SAY_DUEL_D, SAY_DUEL_E, SAY_DUEL_F, SAY_DUEL_G, SAY_DUEL_H, SAY_DUEL_I -}; - class npc_death_knight_initiate : public CreatureScript { public: @@ -389,8 +367,7 @@ public: creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); - int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); - DoScriptText(m_auiRandomSay[uiSayId], creature, player); + sCreatureTextMgr->SendChat(creature, SAY_EVENT_ATTACK, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); player->CastSpell(creature, SPELL_DUEL, false); player->CastSpell(player, SPELL_DUEL_FLAG, true); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 78fc8d127b2..2b21bb26804 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -20,6 +20,7 @@ #include "ScriptedEscortAI.h" #include "Player.h" #include "SpellInfo.h" +#include "CreatureTextMgr.h" //How to win friends and influence enemies // texts signed for creature 28939 but used for 28939, 28940, 28610 @@ -30,22 +31,14 @@ enum win_friends SAY_PERSUADED2 = 3, SAY_PERSUADED3 = 4, SAY_PERSUADED4 = 5, - SAY_PERSUADED6 = 6, + SAY_PERSUADED5 = 6, + SAY_PERSUADED6 = 7, + SAY_PERSUADE_RAND = 8, SPELL_PERSUASIVE_STRIKE = 52781, SPELL_THREAT_PULSE = 58111, QUEST_HOW_TO_WIN_FRIENDS = 12720, }; -#define SAY_PERSUADED5 "LIES! The pain you are about to endure will be talked about for years to come!" - -#define SAY_PERSUADE1 "I'll tear the secrets from your soul! Tell me about the \"Crimson Dawn\" and your life may be spared!" -#define SAY_PERSUADE2 "Tell me what you know about \"Crimson Dawn\" or the beatings will continue!" -#define SAY_PERSUADE3 "I'm through being courteous with your kind, human! What is the \"Crimson Dawn\"?" -#define SAY_PERSUADE4 "Is your life worth so little? Just tell me what I need to know about \"Crimson Dawn\" and I'll end your suffering quickly." -#define SAY_PERSUADE5 "I can keep this up for a very long time, Scarlet dog! Tell me about the \"Crimson Dawn\"!" -#define SAY_PERSUADE6 "What is the \"Crimson Dawn\"?" -#define SAY_PERSUADE7 "\"Crimson Dawn\"! What is it! Speak!" - class npc_crusade_persuaded : public CreatureScript { public: @@ -90,30 +83,7 @@ public: me->SetReactState(REACT_PASSIVE); DoCastAOE(SPELL_THREAT_PULSE, true); - switch (urand(1, 7)) - { - case 1: - player->Say(SAY_PERSUADE1, LANG_UNIVERSAL); - break; - case 2: - player->Say(SAY_PERSUADE2, LANG_UNIVERSAL); - break; - case 3: - player->Say(SAY_PERSUADE3, LANG_UNIVERSAL); - break; - case 4: - player->Say(SAY_PERSUADE4, LANG_UNIVERSAL); - break; - case 5: - player->Say(SAY_PERSUADE5, LANG_UNIVERSAL); - break; - case 6: - player->Say(SAY_PERSUADE6, LANG_UNIVERSAL); - break; - case 7: - player->Say(SAY_PERSUADE7, LANG_UNIVERSAL); - break; - } + sCreatureTextMgr->SendChat(me, SAY_PERSUADE_RAND, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); Talk(SAY_CRUSADER); } } @@ -156,7 +126,7 @@ public: break; case 5: - player->Say(SAY_PERSUADED5, LANG_UNIVERSAL); + sCreatureTextMgr->SendChat(me, SAY_PERSUADED5, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); speechTimer = 8000; break; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 467b532163b..5da38e21d2f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -83,12 +83,10 @@ public: /*###### ## mob_freed_soul ######*/ - -//Possibly more of these quotes around. -#define SAY_ZAPPED0 -1329000 -#define SAY_ZAPPED1 -1329001 -#define SAY_ZAPPED2 -1329002 -#define SAY_ZAPPED3 -1329003 +enum FreedSoul +{ + SAY_ZAPPED = 0 +}; class mob_freed_soul : public CreatureScript { @@ -106,7 +104,7 @@ public: void Reset() { - DoScriptText(RAND(SAY_ZAPPED0, SAY_ZAPPED1, SAY_ZAPPED2, SAY_ZAPPED3), me); + Talk(SAY_ZAPPED); } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 17c3f5e8ff4..c5639a68860 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -29,9 +29,9 @@ EndScriptData */ enum eYells { - SAY_AGGRO = -1309011, - SAY_FEAST_PANTHER = -1309012, - SAY_DEATH = -1309013, + SAY_AGGRO = 0, + SAY_FEAST_PANTHER = 1, + SAY_DEATH = 2, }; enum eSpells @@ -106,7 +106,7 @@ class boss_arlokk : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void JustReachedHome() @@ -120,7 +120,7 @@ class boss_arlokk : public CreatureScript void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); me->SetDisplayId(MODEL_ID_NORMAL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -131,8 +131,8 @@ class boss_arlokk : public CreatureScript void DoSummonPhanters() { - if (Unit* pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) - DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget); + if (MarkedTargetGUID) + Talk(SAY_FEAST_PANTHER, MarkedTargetGUID); me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998f, -1649.6734f, 41.4800f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970f, -1606.4840f, 41.2979f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index 6cb657f4cff..7d80de88beb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -27,23 +27,26 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SAY_AGGRO -1309020 -#define SAY_FLEEING -1309021 -#define SAY_MINION_DESTROY -1309022 //where does it belong? -#define SAY_PROTECT_ALTAR -1309023 //where does it belong? +enum Hakkar +{ + SAY_AGGRO = 0, + SAY_FLEEING = 1, + SAY_MINION_DESTROY = 2, //where does it belong? + SAY_PROTECT_ALTAR = 3, //where does it belong? -#define SPELL_BLOODSIPHON 24322 -#define SPELL_CORRUPTEDBLOOD 24328 -#define SPELL_CAUSEINSANITY 24327 //Not working disabled. -#define SPELL_WILLOFHAKKAR 24178 -#define SPELL_ENRAGE 24318 + SPELL_BLOODSIPHON = 24322, + SPELL_CORRUPTEDBLOOD = 24328, + SPELL_CAUSEINSANITY = 24327, //Not working disabled. + SPELL_WILLOFHAKKAR = 24178, + SPELL_ENRAGE = 24318, // The Aspects of all High Priests -#define SPELL_ASPECT_OF_JEKLIK 24687 -#define SPELL_ASPECT_OF_VENOXIS 24688 -#define SPELL_ASPECT_OF_MARLI 24686 -#define SPELL_ASPECT_OF_THEKAL 24689 -#define SPELL_ASPECT_OF_ARLOKK 24690 + SPELL_ASPECT_OF_JEKLIK = 24687, + SPELL_ASPECT_OF_VENOXIS = 24688, + SPELL_ASPECT_OF_MARLI = 24686, + SPELL_ASPECT_OF_THEKAL = 24689, + SPELL_ASPECT_OF_ARLOKK = 24690 +}; class boss_hakkar : public CreatureScript { @@ -108,7 +111,7 @@ class boss_hakkar : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index 156ccab5eae..3a2da6fdba9 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -27,22 +27,24 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SAY_AGGRO -1309002 -#define SAY_RAIN_FIRE -1309003 -#define SAY_DEATH -1309004 - -#define SPELL_CHARGE 22911 -#define SPELL_SONICBURST 23918 -#define SPELL_SCREECH 6605 -#define SPELL_SHADOW_WORD_PAIN 23952 -#define SPELL_MIND_FLAY 23953 -#define SPELL_CHAIN_MIND_FLAY 26044 //Right ID unknown. So disabled -#define SPELL_GREATERHEAL 23954 -#define SPELL_BAT_FORM 23966 - -// Batriders Spell - -#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working... +enum Jeklik +{ + SAY_AGGRO = 0, + SAY_RAIN_FIRE = 1, + SAY_DEATH = 2, + + SPELL_CHARGE = 22911, + SPELL_SONICBURST = 23918, + SPELL_SCREECH = 6605, + SPELL_SHADOW_WORD_PAIN = 23952, + SPELL_MIND_FLAY = 23953, + SPELL_CHAIN_MIND_FLAY = 26044, //Right ID unknown. So disabled + SPELL_GREATERHEAL = 23954, + SPELL_BAT_FORM = 23966, + + // Batriders Spell + SPELL_BOMB = 40332 //Wrong ID but Magmadars bomb is not working... +}; class boss_jeklik : public CreatureScript { @@ -91,13 +93,13 @@ class boss_jeklik : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoCast(me, SPELL_BAT_FORM); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_JEKLIK, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index f8d23947e9c..10df778eb7f 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -27,20 +27,23 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SAY_AGGRO -1309014 +enum Jindo +{ + SAY_AGGRO = 0, -#define SPELL_BRAINWASHTOTEM 24262 -#define SPELL_POWERFULLHEALINGWARD 24309 //We will not use this spell. We will summon a totem by script cause the spell totems will not cast. -#define SPELL_HEX 24053 -#define SPELL_DELUSIONSOFJINDO 24306 -#define SPELL_SHADEOFJINDO 24308 //We will not use this spell. We will summon a shade by script. + SPELL_BRAINWASHTOTEM = 24262, + SPELL_POWERFULLHEALINGWARD = 24309, //We will not use this spell. We will summon a totem by script cause the spell totems will not cast. + SPELL_HEX = 24053, + SPELL_DELUSIONSOFJINDO = 24306, + SPELL_SHADEOFJINDO = 24308, //We will not use this spell. We will summon a shade by script. -//Healing Ward Spell -#define SPELL_HEAL 38588 //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting... + //Healing Ward Spell + SPELL_HEAL = 38588, //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting... -//Shade of Jindo Spell -#define SPELL_SHADOWSHOCK 19460 -#define SPELL_INVISIBLE 24699 + //Shade of Jindo Spell + SPELL_SHADOWSHOCK = 19460, + SPELL_INVISIBLE = 24699 +}; class boss_jindo : public CreatureScript { @@ -72,7 +75,7 @@ class boss_jindo : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 32831eb047b..9f3aa315efa 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -27,25 +27,28 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SAY_AGGRO -1309015 -#define SAY_DING_KILL -1309016 -#define SAY_GRATS_JINDO -1309017 -#define SAY_WATCH -1309018 -#define SAY_WATCH_WHISPER -1309019 //is this text for real? easter egg? - -#define SPELL_CHARGE 24408 -#define SPELL_CLEAVE 7160 -#define SPELL_FEAR 29321 -#define SPELL_WHIRLWIND 15589 -#define SPELL_MORTAL_STRIKE 16856 -#define SPELL_ENRAGE 24318 -#define SPELL_WATCH 24314 -#define SPELL_LEVEL_UP 24312 +enum Mandokir +{ + SAY_AGGRO = 0, + SAY_DING_KILL = 1, + SAY_WATCH = 2, + SAY_WATCH_WHISPER = 3, //is this text for real? easter egg? + SAY_GRATS_JINDO = 0, + + SPELL_CHARGE = 24408, + SPELL_CLEAVE = 7160, + SPELL_FEAR = 29321, + SPELL_WHIRLWIND = 15589, + SPELL_MORTAL_STRIKE = 16856, + SPELL_ENRAGE = 24318, + SPELL_WATCH = 24314, + SPELL_LEVEL_UP = 24312, //Ohgans Spells -#define SPELL_SUNDERARMOR 24317 + SPELL_SUNDERARMOR = 24317, -#define NPC_SPEAKER 11391 + NPC_SPEAKER = 11391 +}; class boss_mandokir : public CreatureScript { @@ -119,17 +122,17 @@ class boss_mandokir : public CreatureScript if (KillCount == 3) { - DoScriptText(SAY_DING_KILL, me); + Talk(SAY_DING_KILL); if (instance) { uint64 JindoGUID = instance->GetData64(DATA_JINDO); if (JindoGUID) { - if (Unit* jTemp = Unit::GetUnit(*me, JindoGUID)) + if (Creature* jTemp = Creature::GetCreature(*me, JindoGUID)) { if (jTemp->isAlive()) - DoScriptText(SAY_GRATS_JINDO, jTemp); + jTemp->AI()->Talk(SAY_GRATS_JINDO); } } } @@ -141,7 +144,7 @@ class boss_mandokir : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void UpdateAI(const uint32 diff) @@ -205,7 +208,7 @@ class boss_mandokir : public CreatureScript { if (Unit* p = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - DoScriptText(SAY_WATCH, me, p); + Talk(SAY_WATCH, p->GetGUID()); DoCast(p, SPELL_WATCH); WatchTarget = p->GetGUID(); someWatched = true; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 8e0deda1d0b..17b268b92ef 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -27,19 +27,22 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SAY_AGGRO -1309005 -#define SAY_TRANSFORM -1309006 -#define SAY_SPIDER_SPAWN -1309007 -#define SAY_DEATH -1309008 +enum Marli +{ + SAY_AGGRO = 0, + SAY_TRANSFORM = 1, + SAY_SPIDER_SPAWN = 2, + SAY_DEATH = 3, -#define SPELL_CHARGE 22911 -#define SPELL_ASPECT_OF_MARLI 24686 // A stun spell -#define SPELL_ENVOLWINGWEB 24110 -#define SPELL_POISONVOLLEY 24099 -#define SPELL_SPIDER_FORM 24084 + SPELL_CHARGE = 22911, + SPELL_ASPECT_OF_MARLI = 24686, // A stun spell + SPELL_ENVOLWINGWEB = 24110, + SPELL_POISONVOLLEY = 24099, + SPELL_SPIDER_FORM = 24084, //The Spider Spells -#define SPELL_LEVELUP 24312 //Not right Spell. + SPELL_LEVELUP = 24312 //Not right Spell. +}; class boss_marli : public CreatureScript { @@ -86,12 +89,12 @@ class boss_marli : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_MARLI, DONE); } @@ -117,7 +120,7 @@ class boss_marli : public CreatureScript if (!Spawned && SpawnStartSpiders_Timer <= diff) { - DoScriptText(SAY_SPIDER_SPAWN, me); + Talk(SAY_SPIDER_SPAWN); Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!target) @@ -155,7 +158,7 @@ class boss_marli : public CreatureScript if (!PhaseTwo && Transform_Timer <= diff) { - DoScriptText(SAY_TRANSFORM, me); + Talk(SAY_TRANSFORM); DoCast(me, SPELL_SPIDER_FORM); const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 29495f77f2a..3ea5d932ab0 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -27,11 +27,11 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SAY_AGGRO -1309009 -#define SAY_DEATH -1309010 - -enum eSpells +enum Thekal { + SAY_AGGRO = 0, + SAY_DEATH = 1, + SPELL_MORTALCLEAVE = 22859, SPELL_SILENCE = 22666, SPELL_FRENZY = 8269, @@ -53,7 +53,7 @@ enum eSpells SPELL_SINISTERSTRIKE = 15581, SPELL_GOUGE = 12540, SPELL_KICK = 15614, - SPELL_BLIND = 21060, + SPELL_BLIND = 21060 }; class boss_thekal : public CreatureScript @@ -106,12 +106,12 @@ class boss_thekal : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_THEKAL, DONE); } diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index f62273e583d..c5f9522b23d 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -517,9 +517,12 @@ public: ## npc_infused_crystal ######*/ -#define MOB_ENRAGED_WRAITH 17086 -#define EMOTE -1000283 -#define QUEST_POWERING_OUR_DEFENSES 8490 +enum InfusedCrystal +{ + MOB_ENRAGED_WRAITH = 17086, + EMOTE = 0, + QUEST_POWERING_OUR_DEFENSES = 8490 +}; struct Location { @@ -597,7 +600,7 @@ public: { if (EndTimer < diff && Progress) { - DoScriptText(EMOTE, me); + Talk(EMOTE); Completed = true; if (PlayerGUID) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp index c3a725f2f45..5625b6994d7 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -37,11 +37,13 @@ EndContentData */ /*###### ## npc_converted_sentry ######*/ +enum ConvertedSentry +{ + SAY_CONVERTED = 0, -#define SAY_CONVERTED_1 -1000188 -#define SAY_CONVERTED_2 -1000189 + SPELL_CONVERT_CREDIT = 45009 +}; -#define SPELL_CONVERT_CREDIT 45009 class npc_converted_sentry : public CreatureScript { @@ -75,11 +77,7 @@ public: { if (Timer <= diff) { - uint32 i = urand(1, 2); - if (i == 1) - DoScriptText(SAY_CONVERTED_1, me); - else - DoScriptText(SAY_CONVERTED_2, me); + Talk(SAY_CONVERTED); DoCast(me, SPELL_CONVERT_CREDIT); if (me->isPet()) diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index f04b0111da7..9fa8ac70eed 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -30,11 +30,11 @@ enum eCorporalKeeshan { QUEST_MISSING_IN_ACTION = 219, - SAY_CORPORAL_1 = -1000464, - SAY_CORPORAL_2 = -1000465, - SAY_CORPORAL_3 = -1000466, - SAY_CORPORAL_4 = -1000467, - SAY_CORPORAL_5 = -1000468, + SAY_CORPORAL_1 = 0, + SAY_CORPORAL_2 = 1, + SAY_CORPORAL_3 = 2, + SAY_CORPORAL_4 = 3, + SAY_CORPORAL_5 = 4, SPELL_MOCKING_BLOW = 21008, SPELL_SHIELD_BASH = 11972, @@ -50,7 +50,7 @@ public: if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION) { CAST_AI(npc_corporal_keeshan::npc_corporal_keeshanAI, creature->AI())->Start(true, false, player->GetGUID(), quest); - DoScriptText(SAY_CORPORAL_1, creature); + creature->AI()->Talk(SAY_CORPORAL_1); } return false; @@ -124,23 +124,23 @@ public: uiPhase = 2; break; case 2: - DoScriptText(SAY_CORPORAL_2, me); + Talk(SAY_CORPORAL_2); uiTimer = 15000; uiPhase = 3; break; case 3: - DoScriptText(SAY_CORPORAL_3, me); + Talk(SAY_CORPORAL_3); me->SetStandState(UNIT_STAND_STATE_STAND); SetEscortPaused(false); uiTimer = 0; uiPhase = 0; break; case 4: - DoScriptText(SAY_CORPORAL_4, me); + Talk(SAY_CORPORAL_4); uiTimer = 2500; uiPhase = 5; case 5: - DoScriptText(SAY_CORPORAL_5, me); + Talk(SAY_CORPORAL_5); uiTimer = 0; uiPhase = 0; } diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index 905d34221ed..1960d90f28f 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -39,20 +39,19 @@ EndContentData */ enum eErland { - SAY_QUESTACCEPT = -1000306, - SAY_START = -1000307, - SAY_AGGRO_1 = -1000308, - SAY_AGGRO_2 = -1000309, - SAY_LAST = -1000310, + SAY_QUESTACCEPT = 0, + SAY_START = 1, + SAY_AGGRO = 2, + SAY_PROGRESS = 3, + SAY_LAST = 4, - SAY_THANKS = -1000311, - SAY_RANE = -1000312, - SAY_ANSWER = -1000313, - SAY_MOVE_QUINN = -1000314, + SAY_RANE = 0, + SAY_RANE_ANSWER = 5, + SAY_MOVE_QUINN = 6, - SAY_GREETINGS = -1000315, - SAY_QUINN = -1000316, - SAY_ON_BYE = -1000317, + SAY_QUINN = 7, + SAY_QUINN_ANSWER = 0, + SAY_BYE = 8, QUEST_ESCORTING = 435, NPC_RANE = 1950, @@ -77,34 +76,34 @@ public: switch (waypointId) { case 1: - DoScriptText(SAY_START, me, player); + Talk(SAY_START, player->GetGUID()); + break; + case 10: + Talk(SAY_PROGRESS); break; case 13: - DoScriptText(SAY_LAST, me, player); + Talk(SAY_LAST, player->GetGUID()); player->GroupEventHappens(QUEST_ESCORTING, me); break; - case 14: - DoScriptText(SAY_THANKS, me, player); - break; case 15: - if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20)) - DoScriptText(SAY_RANE, Rane); + if (Creature* rane = me->FindNearestCreature(NPC_RANE, 20.0f)) + rane->AI()->Talk(SAY_RANE); break; case 16: - DoScriptText(SAY_ANSWER, me); + Talk(SAY_RANE_ANSWER); break; case 17: - DoScriptText(SAY_MOVE_QUINN, me); + Talk(SAY_MOVE_QUINN); break; case 24: - DoScriptText(SAY_GREETINGS, me); + Talk(SAY_QUINN); break; case 25: - if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20)) - DoScriptText(SAY_QUINN, Quinn); + if (Creature* quinn = me->FindNearestCreature(NPC_QUINN, 20.0f)) + quinn->AI()->Talk(SAY_QUINN_ANSWER); break; case 26: - DoScriptText(SAY_ON_BYE, me, NULL); + Talk(SAY_BYE); break; } } @@ -113,7 +112,7 @@ public: void EnterCombat(Unit* who) { - DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2), me, who); + Talk(SAY_AGGRO, who->GetGUID()); } }; @@ -121,7 +120,7 @@ public: { if (quest->GetQuestId() == QUEST_ESCORTING) { - DoScriptText(SAY_QUESTACCEPT, creature, player); + creature->AI()->Talk(SAY_QUESTACCEPT, player->GetGUID()); if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI())) pEscortAI->Start(true, false, player->GetGUID()); diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 041f5976a6e..87c28ddd206 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -128,7 +128,7 @@ public: switch (m_uiPhase) { case 1: - DoScriptText(SAY_COMPLETE, me); + Talk(SAY_COMPLETE); ++m_uiPhase; break; case 2: diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 1c2f2624b34..79b49b6a438 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -281,13 +281,13 @@ enum eTruuen QUEST_TOMB_LIGHTBRINGER = 9446, - SAY_WP_0 = -1800064, //Beware! We are attacked! - SAY_WP_1 = -1800065, //It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to attack us. We must proceed with caution lest we be overwhelmed! - SAY_WP_2 = -1800066, //This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now... - SAY_WP_3 = -1800067, //Be welcome, friends! - SAY_WP_4 = -1800068, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart. - SAY_WP_5 = -1800069, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire. - SAY_WP_6 = -1800070 //Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here. + SAY_WP_0 = 0, //Beware! We are attacked! + SAY_WP_1 = 1, //It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to attack us. We must proceed with caution lest we be overwhelmed! + SAY_WP_2 = 2, //This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now... + SAY_WP_3 = 0, //Be welcome, friends! + SAY_WP_4 = 0, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart. + SAY_WP_5 = 1, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire. + SAY_WP_6 = 2 //Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here. }; class npc_anchorite_truuen : public CreatureScript @@ -339,12 +339,12 @@ public: switch (waypointId) { case 8: - DoScriptText(SAY_WP_0, me); + Talk(SAY_WP_0); me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); break; case 9: - DoScriptText(SAY_WP_1, me); + Talk(SAY_WP_1); break; case 14: me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); @@ -353,25 +353,31 @@ public: me->SummonCreature(NPC_GHOUL, me->GetPositionX()+8.0f, me->GetPositionY()+8.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); break; case 15: - DoScriptText(SAY_WP_2, me); + Talk(SAY_WP_2); case 21: Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150); - DoScriptText(SAY_WP_3, Theldanis); + if (Theldanis) + Theldanis->AI()->Talk(SAY_WP_3); break; case 22: break; case 23: Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - Ughost->SetDisableGravity(true); - DoScriptText(SAY_WP_4, Ughost, me); + if (Ughost) + { + Ughost->SetDisableGravity(true); + Ughost->AI()->Talk(SAY_WP_4, me->GetGUID()); + } m_uiChatTimer = 4000; break; case 24: - DoScriptText(SAY_WP_5, Ughost, me); + if (Ughost) + Ughost->AI()->Talk(SAY_WP_5, me->GetGUID()); m_uiChatTimer = 4000; break; case 25: - DoScriptText(SAY_WP_6, Ughost, me); + if (Ughost) + Ughost->AI()->Talk(SAY_WP_6, me->GetGUID()); m_uiChatTimer = 4000; break; case 26: diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp index 1ef15c0ca61..0baa9814970 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -45,17 +45,18 @@ enum Yells //List of text id's. The text is stored in database, also in a localized version //(if translation not exist for the textId, default english text will be used) //Not required to define in this way, but simplify if changes are needed. - SAY_AGGRO = -1999900, - SAY_RANDOM_0 = -1999901, - SAY_RANDOM_1 = -1999902, - SAY_RANDOM_2 = -1999903, - SAY_RANDOM_3 = -1999904, - SAY_RANDOM_4 = -1999905, - SAY_BERSERK = -1999906, - SAY_PHASE = -1999907, - SAY_DANCE = -1999908, - SAY_SALUTE = -1999909, - SAY_EVADE = -1999910, + //These texts must be added to the creature texts of the npc for which the script is assigned. + SAY_AGGRO = 0, // "Let the games begin." + SAY_RANDOM = 1, // "I see endless suffering. I see torment. I see rage. I see everything.", + // "Muahahahaha", + // "These mortal infedels my lord, they have invaded your sanctum and seek to steal your secrets.", + // "You are already dead.", + // "Where to go? What to do? So many choices that all end in pain, end in death." + SAY_BERSERK = 2, // "$N, I sentance you to death!" + SAY_PHASE = 3, // "The suffering has just begun!" + SAY_DANCE = 4, // "I always thought I was a good dancer." + SAY_SALUTE = 5, // "Move out Soldier!" + SAY_EVADE = 6 // "Help $N! I'm under attack!" }; enum Spells @@ -127,7 +128,7 @@ class example_creature : public CreatureScript void EnterCombat(Unit* who) { //Say some stuff - DoScriptText(SAY_AGGRO, me, who); + Talk(SAY_AGGRO, who->GetGUID()); } // *** HANDLED FUNCTION *** @@ -142,7 +143,7 @@ class example_creature : public CreatureScript // Called when going out of combat. Reset is called just after. void EnterEvadeMode() { - DoScriptText(SAY_EVADE, me); + Talk(SAY_EVADE); } // *** HANDLED FUNCTION *** @@ -154,10 +155,10 @@ class example_creature : public CreatureScript switch (uiTextEmote) { case TEXT_EMOTE_DANCE: - DoScriptText(SAY_DANCE, me); + Talk(SAY_DANCE); break; case TEXT_EMOTE_SALUTE: - DoScriptText(SAY_SALUTE, me); + Talk(SAY_SALUTE); break; } } @@ -173,7 +174,7 @@ class example_creature : public CreatureScript if (m_uiSayTimer <= uiDiff) { //Random switch between 5 outcomes - DoScriptText(RAND(SAY_RANDOM_0, SAY_RANDOM_1, SAY_RANDOM_2, SAY_RANDOM_3, SAY_RANDOM_4), me); + Talk(SAY_RANDOM); m_uiSayTimer = 45000; //Say something agian in 45 seconds } @@ -235,7 +236,7 @@ class example_creature : public CreatureScript if (m_uiBeserkTimer <= uiDiff) { //Say our line then cast uber death spell - DoScriptText(SAY_BERSERK, me, me->getVictim()); + Talk(SAY_BERSERK, me->getVictim() ? me->getVictim()->GetGUID() : 0); DoCast(me->getVictim(), SPELL_BERSERK); //Cast our beserk spell agian in 12 seconds if we didn't kill everyone @@ -250,7 +251,7 @@ class example_creature : public CreatureScript { //Go to next phase ++m_uiPhase; - DoScriptText(SAY_PHASE, me); + Talk(SAY_PHASE); DoCast(me, SPELL_FRENZY); } else diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp index 8cf0dad25d2..cd680b31577 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -28,6 +28,7 @@ EndScriptData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" #include "Player.h" +#include "CreatureTextMgr.h" enum eEnums { @@ -37,18 +38,18 @@ enum eEnums SPELL_ELIXIR_OF_FORTITUDE = 3593, SPELL_BLUE_FIREWORK = 11540, - SAY_AGGRO1 = -1999910, - SAY_AGGRO2 = -1999911, - SAY_WP_1 = -1999912, - SAY_WP_2 = -1999913, - SAY_WP_3 = -1999914, - SAY_WP_4 = -1999915, - SAY_DEATH_1 = -1999916, - SAY_DEATH_2 = -1999917, - SAY_DEATH_3 = -1999918, - SAY_SPELL = -1999919, - SAY_RAND_1 = -1999920, - SAY_RAND_2 = -1999921 + SAY_AGGRO1 = 0, + SAY_AGGRO2 = 1, + SAY_WP_1 = 2, + SAY_WP_2 = 3, + SAY_WP_3 = 4, + SAY_WP_4 = 5, + SAY_DEATH_1 = 6, + SAY_DEATH_2 = 7, + SAY_DEATH_3 = 8, + SAY_SPELL = 9, + SAY_RAND_1 = 10, + SAY_RAND_2 = 11 }; #define GOSSIP_ITEM_1 "Click to Test Escort(Attack, Run)" @@ -83,19 +84,19 @@ class example_escort : public CreatureScript switch (waypointId) { case 1: - DoScriptText(SAY_WP_1, me); + Talk(SAY_WP_1); break; case 3: - DoScriptText(SAY_WP_2, me); + Talk(SAY_WP_2); me->SummonCreature(NPC_FELBOAR, me->GetPositionX()+5.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); break; case 4: if (Player* player = GetPlayerForEscort()) { //pTmpPlayer is the target of the text - DoScriptText(SAY_WP_3, me, player); + Talk(SAY_WP_3, player->GetGUID()); //pTmpPlayer is the source of the text - DoScriptText(SAY_WP_4, player); + sCreatureTextMgr->SendChat(me, SAY_WP_4, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); } break; } @@ -106,10 +107,10 @@ class example_escort : public CreatureScript if (HasEscortState(STATE_ESCORT_ESCORTING)) { if (Player* player = GetPlayerForEscort()) - DoScriptText(SAY_AGGRO1, me, player); + Talk(SAY_AGGRO1, player->GetGUID()); } else - DoScriptText(SAY_AGGRO2, me); + Talk(SAY_AGGRO2); } void Reset() @@ -126,13 +127,13 @@ class example_escort : public CreatureScript { // not a likely case, code here for the sake of example if (killer == me) - DoScriptText(SAY_DEATH_1, me, player); + Talk(SAY_DEATH_1, player->GetGUID()); else - DoScriptText(SAY_DEATH_2, me, player); + Talk(SAY_DEATH_2, player->GetGUID()); } } else - DoScriptText(SAY_DEATH_3, me); + Talk(SAY_DEATH_3); } void UpdateAI(const uint32 uiDiff) @@ -145,7 +146,7 @@ class example_escort : public CreatureScript { if (m_uiDeathCoilTimer <= uiDiff) { - DoScriptText(SAY_SPELL, me); + Talk(SAY_SPELL); DoCast(me->getVictim(), SPELL_DEATH_COIL, false); m_uiDeathCoilTimer = 4000; } @@ -161,12 +162,12 @@ class example_escort : public CreatureScript { if (me->HasAura(SPELL_ELIXIR_OF_FORTITUDE, 0)) { - DoScriptText(SAY_RAND_1, me); + Talk(SAY_RAND_1); DoCast(me, SPELL_BLUE_FIREWORK, false); } else { - DoScriptText(SAY_RAND_2, me); + Talk(SAY_RAND_2); DoCast(me, SPELL_ELIXIR_OF_FORTITUDE, false); } diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp index 352c43fc1de..b6be4ce3ce1 100644 --- a/src/server/scripts/Examples/example_gossip_codebox.cpp +++ b/src/server/scripts/Examples/example_gossip_codebox.cpp @@ -34,9 +34,10 @@ enum eEnums SPELL_POLYMORPH = 12826, SPELL_MARK_OF_THE_WILD = 26990, - SAY_NOT_INTERESTED = -1999922, - SAY_WRONG = -1999923, - SAY_CORRECT = -1999924 + //These texts must be added to the creature texts of the npc for which the script is assigned. + SAY_NOT_INTERESTED = 0, // "Normal select, guess you're not interested." + SAY_WRONG = 1, // "Wrong!" + SAY_CORRECT = 2 // "You're right, you are allowed to see my inner secrets." }; #define GOSSIP_ITEM_1 "A quiz: what's your name?" @@ -66,7 +67,8 @@ class example_gossip_codebox : public CreatureScript player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF+2) { - DoScriptText(SAY_NOT_INTERESTED, creature); + //Read comment in enum + creature->AI()->Talk(SAY_NOT_INTERESTED); player->CLOSE_GOSSIP_MENU(); } @@ -83,12 +85,14 @@ class example_gossip_codebox : public CreatureScript case GOSSIP_ACTION_INFO_DEF+1: if (player->GetName() != code) { - DoScriptText(SAY_WRONG, creature); + //Read comment in enum + creature->AI()->Talk(SAY_WRONG); creature->CastSpell(player, SPELL_POLYMORPH, true); } else { - DoScriptText(SAY_CORRECT, creature); + //Read comment in enum + creature->AI()->Talk(SAY_CORRECT); creature->CastSpell(player, SPELL_MARK_OF_THE_WILD, true); } player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Examples/example_misc.cpp b/src/server/scripts/Examples/example_misc.cpp index 5ff66c4a7ed..68986b44496 100644 --- a/src/server/scripts/Examples/example_misc.cpp +++ b/src/server/scripts/Examples/example_misc.cpp @@ -26,11 +26,6 @@ EndScriptData */ #include "ScriptMgr.h" #include "Player.h" -enum eSay -{ - SAY_HI = -1999925 -}; - class AT_example_areatrigger : public AreaTriggerScript { public: @@ -42,7 +37,7 @@ class AT_example_areatrigger : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) { - DoScriptText(SAY_HI, player); + player->Kill(player); return true; } }; diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 3b431d55a2c..7bc2e96e0dc 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -28,7 +28,7 @@ EndScriptData */ enum Say { - SAY_TELEPORT = -1000100 + SAY_TELEPORT = 0 }; enum Spells @@ -89,7 +89,7 @@ public: if (TeleportTimer <= diff) { - DoScriptText(SAY_TELEPORT, me); + Talk(SAY_TELEPORT); ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList(); ThreatContainer::StorageType::const_iterator i = threatlist.begin(); for (i = threatlist.begin(); i != threatlist.end(); ++i) diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index e00ea566c8f..801855e7249 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -37,12 +37,12 @@ EndContentData */ enum AmeData { - SAY_READY = -1000517, - SAY_AGGRO1 = -1000518, - SAY_SEARCH = -1000519, - SAY_AGGRO2 = -1000520, - SAY_AGGRO3 = -1000521, - SAY_FINISH = -1000522, + SAY_READY = 0, + SAY_AGGRO1 = 1, + SAY_SEARCH = 2, + SAY_AGGRO2 = 3, + SAY_AGGRO3 = 4, + SAY_FINISH = 5, SPELL_DEMORALIZINGSHOUT = 13730, @@ -62,7 +62,7 @@ public: if (quest->GetQuestId() == QUEST_CHASING_AME) { CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID()); - DoScriptText(SAY_READY, creature, player); + creature->AI()->Talk(SAY_READY, player->GetGUID()); creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); // Change faction so mobs attack creature->setFaction(113); @@ -89,21 +89,21 @@ public: { case 19: me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO1, me, player); + Talk(SAY_AGGRO1, player->GetGUID()); break; case 28: - DoScriptText(SAY_SEARCH, me, player); + Talk(SAY_SEARCH, player->GetGUID()); break; case 38: me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO2, me, player); + Talk(SAY_AGGRO2, player->GetGUID()); break; case 49: me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO3, me, player); + Talk(SAY_AGGRO3, player->GetGUID()); break; case 55: - DoScriptText(SAY_FINISH, me, player); + Talk(SAY_FINISH, player->GetGUID()); player->GroupEventHappens(QUEST_CHASING_AME, me); break; } @@ -147,27 +147,20 @@ public: enum Ringo { - SAY_RIN_START_1 = -1000416, - SAY_RIN_START_2 = -1000417, - - SAY_FAINT_1 = -1000418, - SAY_FAINT_2 = -1000419, - SAY_FAINT_3 = -1000420, - SAY_FAINT_4 = -1000421, - - SAY_WAKE_1 = -1000422, - SAY_WAKE_2 = -1000423, - SAY_WAKE_3 = -1000424, - SAY_WAKE_4 = -1000425, - - SAY_RIN_END_1 = -1000426, - SAY_SPR_END_2 = -1000427, - SAY_RIN_END_3 = -1000428, - EMOTE_RIN_END_4 = -1000429, - EMOTE_RIN_END_5 = -1000430, - SAY_RIN_END_6 = -1000431, // signed for 6784 - SAY_SPR_END_7 = -1000432, - EMOTE_RIN_END_8 = -1000433, + SAY_RIN_START = 0, + + SAY_FAINT = 1, + + SAY_WAKE = 2, + + SAY_RIN_END_1 = 3, + SAY_SPR_END_2 = 0, + SAY_RIN_END_3 = 4, + EMOTE_RIN_END_4 = 5, + EMOTE_RIN_END_5 = 6, + SAY_RIN_END_6 = 7, + SAY_SPR_END_7 = 1, + EMOTE_RIN_END_8 = 8, SPELL_REVIVE_RINGO = 15591, QUEST_A_LITTLE_HELP = 4491, @@ -184,10 +177,10 @@ public: { if (quest->GetQuestId() == QUEST_A_LITTLE_HELP) { - if (npc_ringoAI* pRingoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI())) + if (npc_ringoAI* ringoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI())) { creature->SetStandState(UNIT_STAND_STATE_STAND); - pRingoAI->StartFollow(player, FACTION_ESCORTEE, quest); + ringoAI->StartFollow(player, FACTION_ESCORTEE, quest); } } @@ -249,7 +242,7 @@ public: { SetFollowPaused(true); - DoScriptText(RAND(SAY_FAINT_1, SAY_FAINT_2, SAY_FAINT_3, SAY_FAINT_4), me); + Talk(SAY_FAINT); } //what does actually happen here? Emote? Aura? @@ -263,7 +256,7 @@ public: if (HasFollowState(STATE_FOLLOW_POSTEVENT)) return; - DoScriptText(RAND(SAY_WAKE_1, SAY_WAKE_2, SAY_WAKE_3, SAY_WAKE_4), me); + Talk(SAY_WAKE); SetFollowPaused(false); } @@ -276,8 +269,8 @@ public: { if (EndEventTimer <= Diff) { - Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID); - if (!pSpraggle || !pSpraggle->isAlive()) + Creature* spraggle = Creature::GetCreature(*me, SpraggleGUID); + if (!spraggle || !spraggle->isAlive()) { SetFollowComplete(); return; @@ -286,37 +279,37 @@ public: switch (EndEventProgress) { case 1: - DoScriptText(SAY_RIN_END_1, me); + Talk(SAY_RIN_END_1); EndEventTimer = 3000; break; case 2: - DoScriptText(SAY_SPR_END_2, pSpraggle); + spraggle->AI()->Talk(SAY_SPR_END_2); EndEventTimer = 5000; break; case 3: - DoScriptText(SAY_RIN_END_3, me); + Talk(SAY_RIN_END_3); EndEventTimer = 1000; break; case 4: - DoScriptText(EMOTE_RIN_END_4, me); + Talk(EMOTE_RIN_END_4); SetFaint(); EndEventTimer = 9000; break; case 5: - DoScriptText(EMOTE_RIN_END_5, me); + Talk(EMOTE_RIN_END_5); ClearFaint(); EndEventTimer = 1000; break; case 6: - DoScriptText(SAY_RIN_END_6, me); + Talk(SAY_RIN_END_6); EndEventTimer = 3000; break; case 7: - DoScriptText(SAY_SPR_END_7, pSpraggle); + spraggle->AI()->Talk(SAY_SPR_END_7); EndEventTimer = 10000; break; case 8: - DoScriptText(EMOTE_RIN_END_8, me); + Talk(EMOTE_RIN_END_8); EndEventTimer = 5000; break; case 9: |