diff options
| author | Shauren <shauren.trinity@gmail.com> | 2013-12-23 14:23:49 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2013-12-23 14:23:49 +0100 |
| commit | 107af528536980380c887379b56f6351a9781a2f (patch) | |
| tree | 6a45a8ff9921d6c359216f68d98a3b31dd0c7361 /src/server/scripts/Examples | |
| parent | 6402fa02ac4a4f1d731ed0b6d744328527e2a857 (diff) | |
Core/Chat: Refactored building chat packets
* Moved everything into one specialized method instead of being scattered all over the place
* Allow localizing creature names in chat messages (when using $N)
* Send SMSG_GM_MESSAGECHAT for gm messages
Diffstat (limited to 'src/server/scripts/Examples')
| -rw-r--r-- | src/server/scripts/Examples/example_creature.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Examples/example_escort.cpp | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp index b13ec1e1503..3a675389d1e 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -128,7 +128,7 @@ class example_creature : public CreatureScript void EnterCombat(Unit* who) OVERRIDE { //Say some stuff - Talk(SAY_AGGRO, who->GetGUID()); + Talk(SAY_AGGRO, who); } // *** HANDLED FUNCTION *** @@ -236,7 +236,7 @@ class example_creature : public CreatureScript if (m_uiBeserkTimer <= uiDiff) { //Say our line then cast uber death spell - Talk(SAY_BERSERK, me->GetVictim() ? me->GetVictim()->GetGUID() : 0); + Talk(SAY_BERSERK, me->GetVictim()); DoCastVictim(SPELL_BERSERK); //Cast our beserk spell agian in 12 seconds if we didn't kill everyone diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp index 8cbd2fc4933..e6afc690faf 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -100,9 +100,9 @@ class example_escort : public CreatureScript if (Player* player = GetPlayerForEscort()) { //pTmpPlayer is the target of the text - Talk(SAY_WP_3, player->GetGUID()); + Talk(SAY_WP_3, player); //pTmpPlayer is the source of the text - sCreatureTextMgr->SendChat(me, SAY_WP_4, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); + sCreatureTextMgr->SendChat(me, SAY_WP_4, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); } break; } @@ -113,7 +113,7 @@ class example_escort : public CreatureScript if (HasEscortState(STATE_ESCORT_ESCORTING)) { if (Player* player = GetPlayerForEscort()) - Talk(SAY_AGGRO1, player->GetGUID()); + Talk(SAY_AGGRO1, player); } else Talk(SAY_AGGRO2); @@ -133,9 +133,9 @@ class example_escort : public CreatureScript { // not a likely case, code here for the sake of example if (killer == me) - Talk(SAY_DEATH_1, player->GetGUID()); + Talk(SAY_DEATH_1, player); else - Talk(SAY_DEATH_2, player->GetGUID()); + Talk(SAY_DEATH_2, player); } } else |
