From 107af528536980380c887379b56f6351a9781a2f Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 23 Dec 2013 14:23:49 +0100 Subject: 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 --- src/server/game/Scripting/MapScripts.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server/game/Scripting/MapScripts.cpp') diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 41c18b850a1..7f2e1f095e4 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -335,7 +335,7 @@ void Map::ScriptsProcess() } } - Object* target = NULL; + WorldObject* target = NULL; if (step.targetGUID) { switch (GUID_HIPART(step.targetGUID)) @@ -421,28 +421,28 @@ void Map::ScriptsProcess() switch (step.script->Talk.ChatType) { case CHAT_TYPE_SAY: - cSource->Say(step.script->Talk.TextID, LANG_UNIVERSAL, targetGUID); + cSource->MonsterSay(step.script->Talk.TextID, LANG_UNIVERSAL, target); break; case CHAT_TYPE_YELL: - cSource->Yell(step.script->Talk.TextID, LANG_UNIVERSAL, targetGUID); + cSource->MonsterYell(step.script->Talk.TextID, LANG_UNIVERSAL, target); break; case CHAT_TYPE_TEXT_EMOTE: - cSource->TextEmote(step.script->Talk.TextID, targetGUID); + cSource->MonsterTextEmote(step.script->Talk.TextID, target); break; case CHAT_TYPE_BOSS_EMOTE: - cSource->MonsterTextEmote(step.script->Talk.TextID, targetGUID, true); + cSource->MonsterTextEmote(step.script->Talk.TextID, target, true); break; case CHAT_TYPE_WHISPER: if (!targetGUID || !IS_PLAYER_GUID(targetGUID)) TC_LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); else - cSource->Whisper(step.script->Talk.TextID, targetGUID); + cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer()); break; case CHAT_MSG_RAID_BOSS_WHISPER: if (!targetGUID || !IS_PLAYER_GUID(targetGUID)) TC_LOG_ERROR("scripts", "%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); else - cSource->MonsterWhisper(step.script->Talk.TextID, targetGUID, true); + cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer(), true); break; default: break; // must be already checked at load -- cgit v1.2.3