From bc82f36f1ff46bb21d32e1cfdaec8271dde08af1 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Fri, 15 Oct 2021 10:25:29 +0200 Subject: [PATCH] refactor(Core/Unit): clean MonsterText methods (#6957) --- .../rev_1634136291669439800.sql | 10 ++ .../pendings/changes_1626351320866318500.md | 53 ++++++ .../game/AI/SmartScripts/SmartScript.cpp | 31 +--- .../game/Achievements/AchievementMgr.cpp | 40 +---- src/server/game/Chat/Chat.cpp | 4 +- src/server/game/Chat/Chat.h | 4 +- src/server/game/Entities/Object/Object.cpp | 169 ------------------ src/server/game/Entities/Object/Object.h | 10 -- src/server/game/Entities/Player/Player.cpp | 101 ++++++----- src/server/game/Entities/Player/Player.h | 16 +- src/server/game/Entities/Unit/Unit.cpp | 89 ++++++++- src/server/game/Entities/Unit/Unit.h | 11 ++ src/server/game/Globals/ObjectMgr.cpp | 12 +- src/server/game/Globals/ObjectMgr.h | 2 +- src/server/game/Handlers/ChatHandler.cpp | 6 +- src/server/game/Miscellaneous/Language.h | 8 +- src/server/game/Scripting/MapScripts.cpp | 100 ++++------- src/server/game/Spells/SpellEffects.cpp | 10 +- src/server/game/Texts/ChatTextBuilder.cpp | 61 +++++++ src/server/game/Texts/ChatTextBuilder.h | 82 +++++++++ src/server/scripts/Commands/cs_misc.cpp | 2 +- src/server/scripts/Commands/cs_npc.cpp | 8 +- src/server/scripts/Commands/cs_wp.cpp | 4 +- .../BlackwingLair/blackwing_lair.h | 2 +- .../BlackwingLair/boss_nefarian.cpp | 1 - .../BlackwingLair/boss_vaelastrasz.cpp | 2 +- .../EasternKingdoms/Karazhan/karazhan.cpp | 18 +- .../instance_scarlet_monastery.cpp | 2 +- src/server/scripts/Events/brewfest.cpp | 22 +-- src/server/scripts/Events/hallows_end.cpp | 32 ++-- src/server/scripts/Events/pilgrims_bounty.cpp | 8 +- .../BattleForMountHyjal/hyjalAI.cpp | 2 +- .../BattleForMountHyjal/instance_hyjal.cpp | 11 +- .../CullingOfStratholme/boss_infinite.cpp | 2 +- .../culling_of_stratholme.cpp | 4 +- .../Kalimdor/OnyxiasLair/boss_onyxia.cpp | 2 +- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 4 +- .../boss_argent_challenge.cpp | 4 +- .../TrialOfTheChampion/boss_black_knight.cpp | 2 +- .../boss_grand_champions.cpp | 2 +- .../instance_trial_of_the_crusader.cpp | 2 +- .../instance_halls_of_reflection.cpp | 2 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 2 +- .../instance_icecrown_citadel.cpp | 2 +- .../Northrend/Nexus/Oculus/boss_drakos.cpp | 2 +- .../Northrend/Nexus/Oculus/boss_eregos.cpp | 2 +- .../Ulduar/HallsOfStone/boss_sjonnir.cpp | 6 +- .../Ulduar/HallsOfStone/brann_bronzebeard.cpp | 8 +- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 14 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 14 +- .../Northrend/Ulduar/Ulduar/boss_freya.cpp | 42 ++--- .../Ulduar/Ulduar/boss_general_vezax.cpp | 20 +-- .../Northrend/Ulduar/Ulduar/boss_ignis.cpp | 18 +- .../Northrend/Ulduar/Ulduar/boss_mimiron.cpp | 46 ++--- .../Ulduar/Ulduar/boss_razorscale.cpp | 10 +- .../Northrend/Ulduar/Ulduar/boss_thorim.cpp | 44 ++--- .../Northrend/Ulduar/Ulduar/boss_xt002.cpp | 24 +-- .../Ulduar/Ulduar/boss_yoggsaron.cpp | 36 ++-- .../Ulduar/Ulduar/instance_ulduar.cpp | 2 +- .../Northrend/Ulduar/Ulduar/ulduar.cpp | 8 +- .../UtgardePinnacle/boss_palehoof.cpp | 2 +- .../UtgardePinnacle/boss_skadi.cpp | 2 +- .../VaultOfArchavon/boss_archavon.cpp | 2 +- .../instance_vault_of_archavon.cpp | 4 +- .../Northrend/VioletHold/boss_zuramat.cpp | 2 +- .../scripts/Northrend/zone_dragonblight.cpp | 14 +- .../scripts/Northrend/zone_howling_fjord.cpp | 8 +- .../scripts/Northrend/zone_icecrown.cpp | 56 +++--- .../scripts/Northrend/zone_sholazar_basin.cpp | 25 +-- .../scripts/Northrend/zone_storm_peaks.cpp | 4 +- src/server/scripts/Northrend/zone_zuldrak.cpp | 24 +-- .../SlavePens/boss_ahune.cpp | 10 +- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/server/scripts/Spells/spell_item.cpp | 8 +- src/server/scripts/World/go_scripts.cpp | 2 +- 75 files changed, 750 insertions(+), 672 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1634136291669439800.sql create mode 100644 doc/changelog/pendings/changes_1626351320866318500.md create mode 100644 src/server/game/Texts/ChatTextBuilder.cpp create mode 100644 src/server/game/Texts/ChatTextBuilder.h diff --git a/data/sql/updates/pending_db_world/rev_1634136291669439800.sql b/data/sql/updates/pending_db_world/rev_1634136291669439800.sql new file mode 100644 index 000000000..1eae92491 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1634136291669439800.sql @@ -0,0 +1,10 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1634136291669439800'); + +-- Flee && Call for Help +DELETE FROM `acore_string` WHERE `entry` IN (5030, 5035); + +-- Vaelastrasz boss fight +-- Nefarian texts +DELETE FROM `creature_text` WHERE `CreatureID`=10162 AND `GroupID`=14 AND `ID`=0; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(10162, 14, 0, 'Ah...the heroes. You are persistent, aren''t you? Your ally here attempted to match his power against mine - and paid the price. Now he shall serve me...by slaughtering you. Get up, little red wyrm...and destroy them!', 14, 0, 100, 23, 0, 8279, 100003, 0, 'Lord Victor Nefarius SAY_NEFARIAN_VAEL_INTRO (BWL)'); diff --git a/doc/changelog/pendings/changes_1626351320866318500.md b/doc/changelog/pendings/changes_1626351320866318500.md new file mode 100644 index 000000000..667fac3dd --- /dev/null +++ b/doc/changelog/pendings/changes_1626351320866318500.md @@ -0,0 +1,53 @@ +### Added + +```cpp +// Unit.cpp + virtual void Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const* target); + virtual void Say(std::string_view text, Language language, WorldObject const* target = nullptr); + virtual void Yell(std::string_view text, Language language, WorldObject const* target = nullptr); + virtual void TextEmote(std::string_view text, WorldObject const* target = nullptr, bool isBossEmote = false); + virtual void Whisper(std::string_view text, Language language, Player* target, bool isBossWhisper = false); + virtual void Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject const* target); + virtual void Say(uint32 textId, WorldObject const* target = nullptr); + virtual void Yell(uint32 textId, WorldObject const* target = nullptr); + virtual void TextEmote(uint32 textId, WorldObject const* target = nullptr, bool isBossEmote = false); + virtual void Whisper(uint32 textId, Player* target, bool isBossWhisper = false); +``` + +### Removed + +```cpp +// Object.cpp + void MonsterSay(const char* text, uint32 language, WorldObject const* target); + void MonsterYell(const char* text, uint32 language, WorldObject const* target); + void MonsterTextEmote(const char* text, WorldObject const* target, bool IsBossEmote = false); + void MonsterWhisper(const char* text, Player const* target, bool IsBossWhisper = false); + void MonsterSay(int32 textId, uint32 language, WorldObject const* target); + void MonsterYell(int32 textId, uint32 language, WorldObject const* target); + void MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote = false); + void MonsterWhisper(int32 textId, Player const* target, bool IsBossWhisper = false); + + void SendPlaySound(uint32 Sound, bool OnlySelf); +``` + +### How to upgrade + +```diff +- creature->MonsterSay(text, LANG_XXX, nullptr); ++ creature->Say(text, LANG_XXX); + +- creature->MonsterTextEmote(text, 0); ++ creature->TextEmote(text); + +- creature->MonsterWhisper(text, receiver); ++ creature->Whisper(text, LANG_XXX, receiver); + +- creature->MonsterYell(text, LANG_XXX, NULL); ++ creature->Yell(text, LANG_XXX); + +- creature->MonsterWhisper(text, target, isBossWhisper); ++ creature->Whisper(text, LANG_XXX, target, isBossWhisper); + +- SendPlaySound(uint32 Sound, bool OnlySelf); + PlayDirectSound(uint32 sound_id, Player* target = nullptr); +``` diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index ae28629f9..04d03ea52 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -17,7 +17,7 @@ #include "Cell.h" #include "CellImpl.h" -#include "Chat.h" +#include "ChatTextBuilder.h" #include "CreatureTextMgr.h" #include "GameEventMgr.h" #include "GossipDef.h" @@ -37,27 +37,6 @@ #include "SpellMgr.h" #include "Vehicle.h" -class AcoreStringTextBuilder -{ -public: - AcoreStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, WorldObject* target) - : _source(obj), _msgType(msgtype), _textId(id), _language(language), _target(target) - { - } - - size_t operator()(WorldPacket* data, LocaleConstant locale) const - { - std::string text = sObjectMgr->GetAcoreString(_textId, locale); - return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale); - } - - WorldObject* _source; - ChatMsg _msgType; - int32 _textId; - uint32 _language; - WorldObject* _target; -}; - SmartScript::SmartScript() { go = nullptr; @@ -259,7 +238,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (IsUnit(*itr)) { - (*itr)->SendPlaySound(e.action.sound.sound, e.action.sound.onlySelf > 0); + (*itr)->PlayDirectSound(e.action.sound.sound, e.action.sound.onlySelf ? (*itr)->ToPlayer() : nullptr); LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: %s (%s), sound: %u, onlyself: %u", (*itr)->GetName().c_str(), (*itr)->GetGUID().ToString().c_str(), e.action.sound.sound, e.action.sound.onlySelf); } @@ -302,7 +281,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsUnit(*itr)) { uint32 sound = temp[urand(0, count - 1)]; - (*itr)->SendPlaySound(sound, e.action.randomSound.onlySelf > 0); + (*itr)->PlayDirectSound(sound, e.action.randomSound.onlySelf ? (*itr)->ToPlayer() : nullptr); LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: %s (%s), sound: %u, onlyself: %u", (*itr)->GetName().c_str(), (*itr)->GetGUID().ToString().c_str(), sound, e.action.randomSound.onlySelf); } @@ -992,7 +971,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->DoFleeToGetAssistance(); if (e.action.flee.withEmote) { - AcoreStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, nullptr); + Acore::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_FLEE_FOR_ASSIST, me->getGender()); sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); } LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %s DoFleeToGetAssistance", me->GetGUID().ToString().c_str()); @@ -1297,7 +1276,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToCreature()->CallForHelp((float)e.action.callHelp.range); if (e.action.callHelp.withEmote) { - AcoreStringTextBuilder builder(*itr, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, nullptr); + Acore::BroadcastTextBuilder builder(*itr, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_CALL_FOR_HELP, LANG_UNIVERSAL, nullptr); sCreatureTextMgr->SendChatPacket(*itr, builder, CHAT_MSG_MONSTER_EMOTE); } } diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 0a37bd9cb..d3af277c5 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -23,6 +23,7 @@ #include "BattlegroundAB.h" #include "CellImpl.h" #include "Chat.h" +#include "ChatTextBuilder.h" #include "Common.h" #include "DatabaseEnv.h" #include "DBCEnums.h" @@ -43,34 +44,6 @@ #include "World.h" #include "WorldPacket.h" -namespace Acore -{ - class AchievementChatBuilder - { - public: - AchievementChatBuilder(Player const* player, ChatMsg msgType, uint32 textId, uint32 achievementId) - : _player(player), _msgType(msgType), _textId(textId), _achievementId(achievementId) { } - - void operator()(WorldPacket& data, LocaleConstant locale) - { - std::string text = ""; - BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId); - if (bct) - { - ObjectMgr::GetLocaleString(_player->getGender() == GENDER_MALE ? bct->MaleText : bct->FemaleText, locale, text); - } - - ChatHandler::BuildChatPacket(data, _msgType, LANG_UNIVERSAL, _player, _player, text, _achievementId); - } - - private: - Player const* _player; - ChatMsg _msgType; - int32 _textId; - uint32 _achievementId; - }; -} // namespace Acore - bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) { if (dataType >= MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE) @@ -702,8 +675,8 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()); if (guild) { - Acore::AchievementChatBuilder _builder(GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, achievement->ID); - Acore::LocalizedPacketDo _localizer(_builder); + Acore::BroadcastTextBuilder _builder(GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetPlayer()->getGender(), GetPlayer(), achievement->ID); + Acore::LocalizedPacketDo _localizer(_builder); guild->BroadcastWorker(_localizer, GetPlayer()); } @@ -745,9 +718,10 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) Cell cell(p); cell.SetNoCreate(); - Acore::AchievementChatBuilder _builder(GetPlayer(), CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, achievement->ID); - Acore::LocalizedPacketDo _localizer(_builder); - Acore::PlayerDistWorker > _worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), _localizer); + Acore::BroadcastTextBuilder _builder(GetPlayer(), CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetPlayer()->getGender(), GetPlayer(), achievement->ID); + Acore::LocalizedPacketDo _localizer(_builder); + Acore::PlayerDistWorker> _worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), _localizer); + TypeContainerVisitor >, WorldTypeMapContainer > message(_worker); Cell::VisitWorldObjects(GetPlayer(), _worker, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); } diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 8f03dbc5e..014c78124 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -609,7 +609,7 @@ bool ChatHandler::ShowHelpForCommand(std::vector const& table, cons return ShowHelpForSubCommands(table, "", cmd); } -size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string const& message, uint8 chatTag, +size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const& senderName /*= ""*/, std::string const& receiverName /*= ""*/, uint32 achievementId /*= 0*/, bool gmMessage /*= false*/, std::string const& channelName /*= ""*/) { @@ -689,7 +689,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag return receiverGUIDPos; } -size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string const& message, +size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string_view message, uint32 achievementId /*= 0*/, std::string const& channelName /*= ""*/, LocaleConstant locale /*= DEFAULT_LOCALE*/) { ObjectGuid senderGUID; diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index d1c2d7eba..08c0d1886 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -57,12 +57,12 @@ public: virtual ~ChatHandler() { } // Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders - static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string const& message, uint8 chatTag, + static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const& senderName = "", std::string const& receiverName = "", uint32 achievementId = 0, bool gmMessage = false, std::string const& channelName = ""); // Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders - static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string const& message, uint32 achievementId = 0, std::string const& channelName = "", LocaleConstant locale = DEFAULT_LOCALE); + static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string_view message, uint32 achievementId = 0, std::string const& channelName = "", LocaleConstant locale = DEFAULT_LOCALE); static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = nullptr; return start; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 16a81af52..bb94793ec 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1936,16 +1936,6 @@ bool WorldObject::CanDetectStealthOf(WorldObject const* obj, bool checkAlert) co return true; } -void WorldObject::SendPlaySound(uint32 Sound, bool OnlySelf) -{ - WorldPacket data(SMSG_PLAY_SOUND, 4); - data << Sound; - if (OnlySelf && GetTypeId() == TYPEID_PLAYER) - this->ToPlayer()->GetSession()->SendPacket(&data); - else - SendMessageToSet(&data, true); // ToSelf ignored in this case -} - void WorldObject::SendPlayMusic(uint32 Music, bool OnlySelf) { WorldPacket data(SMSG_PLAY_MUSIC, 4); @@ -1962,165 +1952,6 @@ void Object::ForceValuesUpdateAtIndex(uint32 i) AddToObjectUpdateIfNeeded(); } -namespace Acore -{ - class MonsterChatBuilder - { - public: - MonsterChatBuilder(WorldObject const* obj, ChatMsg msgtype, int32 textId, uint32 language, WorldObject const* target) - : i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(Language(language)), i_target(target) { } - void operator()(WorldPacket& data, LocaleConstant loc_idx) - { - if (BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(i_textId)) - { - uint8 gender = GENDER_MALE; - if (Unit const* unit = i_object->ToUnit()) - gender = unit->getGender(); - - std::string text = broadcastText->GetText(loc_idx, gender); - ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, text, 0, "", loc_idx); - } - else - LOG_ERROR("entities.object", "MonsterChatBuilder: `broadcast_text` id %i missing", i_textId); - } - - private: - WorldObject const* i_object; - ChatMsg i_msgtype; - int32 i_textId; - Language i_language; - WorldObject const* i_target; - }; - - class MonsterCustomChatBuilder - { - public: - MonsterCustomChatBuilder(WorldObject const* obj, ChatMsg msgtype, const char* text, uint32 language, WorldObject const* target) - : i_object(obj), i_msgtype(msgtype), i_text(text), i_language(Language(language)), i_target(target) - {} - void operator()(WorldPacket& data, LocaleConstant loc_idx) - { - ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, i_text, 0, "", loc_idx); - } - - private: - WorldObject const* i_object; - ChatMsg i_msgtype; - const char* i_text; - Language i_language; - WorldObject const* i_target; - }; -} // namespace Acore - -void WorldObject::MonsterSay(const char* text, uint32 language, WorldObject const* target) -{ - CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY()); - - Cell cell(p); - cell.SetNoCreate(); - - Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target); - Acore::LocalizedPacketDo say_do(say_build); - Acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); -} - -void WorldObject::MonsterSay(int32 textId, uint32 language, WorldObject const* target) -{ - CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY()); - - Cell cell(p); - cell.SetNoCreate(); - - Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target); - Acore::LocalizedPacketDo say_do(say_build); - Acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); -} - -void WorldObject::MonsterYell(const char* text, uint32 language, WorldObject const* target) -{ - CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY()); - - Cell cell(p); - cell.SetNoCreate(); - - Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target); - Acore::LocalizedPacketDo say_do(say_build); - Acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL)); -} - -void WorldObject::MonsterYell(int32 textId, uint32 language, WorldObject const* target) -{ - CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY()); - - Cell cell(p); - cell.SetNoCreate(); - - Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target); - Acore::LocalizedPacketDo say_do(say_build); - Acore::PlayerDistWorker > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL)); -} - -void WorldObject::MonsterTextEmote(const char* text, WorldObject const* target, bool IsBossEmote) -{ - WorldPacket data; - ChatHandler::BuildChatPacket(data, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, LANG_UNIVERSAL, - this, target, text); - SendMessageToSetInRange(&data, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), true); -} - -void WorldObject::MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote) -{ - CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY()); - - Cell cell(p); - cell.SetNoCreate(); - - Acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target); - Acore::LocalizedPacketDo say_do(say_build); - Acore::PlayerDistWorker > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do); - TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE))); -} - -void WorldObject::MonsterWhisper(const char* text, Player const* target, bool IsBossWhisper) -{ - if (!target) - return; - - LocaleConstant loc_idx = target->GetSession()->GetSessionDbLocaleIndex(); - WorldPacket data; - ChatHandler::BuildChatPacket(data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, text, 0, "", loc_idx); - target->GetSession()->SendPacket(&data); -} - -void WorldObject::MonsterWhisper(int32 textId, Player const* target, bool IsBossWhisper) -{ - if (!target) - return; - - uint8 gender = GENDER_MALE; - if (Unit const* unit = ToUnit()) - gender = unit->getGender(); - - LocaleConstant loc_idx = target->GetSession()->GetSessionDbLocaleIndex(); - - BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(textId); - std::string text = broadcastText->GetText(loc_idx, gender); - - WorldPacket data; - ChatHandler::BuildChatPacket(data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, text.c_str(), 0, "", loc_idx); - - target->GetSession()->SendPacket(&data); -} - void Unit::BuildHeartBeatMsg(WorldPacket* data) const { data->Initialize(MSG_MOVE_HEARTBEAT, 32); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index a620651f9..85d425704 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -937,15 +937,6 @@ public: virtual uint8 getLevelForTarget(WorldObject const* /*target*/) const { return 1; } - void MonsterSay(const char* text, uint32 language, WorldObject const* target); - void MonsterYell(const char* text, uint32 language, WorldObject const* target); - void MonsterTextEmote(const char* text, WorldObject const* target, bool IsBossEmote = false); - void MonsterWhisper(const char* text, Player const* target, bool IsBossWhisper = false); - void MonsterSay(int32 textId, uint32 language, WorldObject const* target); - void MonsterYell(int32 textId, uint32 language, WorldObject const* target); - void MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote = false); - void MonsterWhisper(int32 textId, Player const* target, bool IsBossWhisper = false); - void PlayDistanceSound(uint32 sound_id, Player* target = nullptr); void PlayDirectSound(uint32 sound_id, Player* target = nullptr); void PlayDirectMusic(uint32 music_id, Player* target = nullptr); @@ -971,7 +962,6 @@ public: FlaggedValuesArray32 m_serverSideVisibilityDetect; // Low Level Packets - void SendPlaySound(uint32 Sound, bool OnlySelf); void SendPlayMusic(uint32 Music, bool OnlySelf); virtual void SetMap(Map* map); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 87b4a528a..0881c1b1d 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8728,7 +8728,7 @@ void Player::StopCastingCharm() } } -void Player::Say(const std::string& text, const uint32 language) +void Player::Say(std::string_view text, Language language, WorldObject const* /*= nullptr*/) { std::string _text(text); sScriptMgr->OnPlayerChat(this, CHAT_MSG_SAY, language, _text); @@ -8738,11 +8738,16 @@ void Player::Say(const std::string& text, const uint32 language) #endif WorldPacket data; - ChatHandler::BuildChatPacket(data, CHAT_MSG_SAY, Language(language), this, this, _text); + ChatHandler::BuildChatPacket(data, CHAT_MSG_SAY, language, this, this, _text); SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); } -void Player::Yell(const std::string& text, const uint32 language) +void Player::Say(uint32 textId, WorldObject const* target /*= nullptr*/) +{ + Talk(textId, CHAT_MSG_SAY, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), target); +} + +void Player::Yell(std::string_view text, Language language, WorldObject const* /*= nullptr*/) { std::string _text(text); sScriptMgr->OnPlayerChat(this, CHAT_MSG_YELL, language, _text); @@ -8752,11 +8757,16 @@ void Player::Yell(const std::string& text, const uint32 language) #endif WorldPacket data; - ChatHandler::BuildChatPacket(data, CHAT_MSG_YELL, Language(language), this, this, _text); + ChatHandler::BuildChatPacket(data, CHAT_MSG_YELL, language, this, this, _text); SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), true); } -void Player::TextEmote(const std::string& text) +void Player::Yell(uint32 textId, WorldObject const* target /*= nullptr*/) +{ + Talk(textId, CHAT_MSG_YELL, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), target); +} + +void Player::TextEmote(std::string_view text, WorldObject const* /*= nullptr*/, bool /*= false*/) { std::string _text(text); sScriptMgr->OnPlayerChat(this, CHAT_MSG_EMOTE, LANG_UNIVERSAL, _text); @@ -8766,68 +8776,79 @@ void Player::TextEmote(const std::string& text) #endif WorldPacket data; - std::list players; - Acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); - Acore::PlayerListSearcher searcher(this, players, checker); - Cell::VisitWorldObjects(this, searcher, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); - - for (auto const& itr : players) - { - if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE) && this->GetTeamId() != itr->GetTeamId()) - { - LocaleConstant loc_idx = itr->GetSession()->GetSessionDbLocaleIndex(); - if (BroadcastText const* bct = sObjectMgr->GetBroadcastText(EMOTE_BROADCAST_TEXT_ID_STRANGE_GESTURES)) - { - ChatHandler::BuildChatPacket(data, CHAT_MSG_EMOTE, LANG_UNIVERSAL, this, this, bct->GetText(loc_idx, this->getGender())); - itr->SendDirectMessage(&data); - } - } - else - { - ChatHandler::BuildChatPacket(data, CHAT_MSG_EMOTE, LANG_UNIVERSAL, this, this, _text); - itr->SendDirectMessage(&data); - } - } + ChatHandler::BuildChatPacket(data, CHAT_MSG_EMOTE, LANG_UNIVERSAL, this, this, _text); + SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)); } -void Player::Whisper(const std::string& text, uint32 language, ObjectGuid receiver) +void Player::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool /*isBossEmote = false*/) { + Talk(textId, CHAT_MSG_EMOTE, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target); +} + +void Player::Whisper(std::string_view text, Language language, Player* target, bool /*= false*/) +{ + ASSERT(target); + bool isAddonMessage = language == LANG_ADDON; if (!isAddonMessage) // if not addon data language = LANG_UNIVERSAL; // whispers should always be readable - Player* rPlayer = ObjectAccessor::FindConnectedPlayer(receiver); - std::string _text(text); - sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, rPlayer); + sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, target); #ifdef ELUNA - if (!sEluna->OnChat(this, CHAT_MSG_WHISPER, language, _text, rPlayer)) + if (!sEluna->OnChat(this, CHAT_MSG_WHISPER, language, _text, target)) + { return; + } #endif WorldPacket data; - ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, Language(language), this, this, _text); - rPlayer->GetSession()->SendPacket(&data); + ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, language, this, this, _text); + target->GetSession()->SendPacket(&data); // rest stuff shouldn't happen in case of addon message if (isAddonMessage) return; - ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER_INFORM, Language(language), rPlayer, rPlayer, _text); + ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER_INFORM, Language(language), target, target, _text); GetSession()->SendPacket(&data); - if (!isAcceptWhispers() && !IsGameMaster() && !rPlayer->IsGameMaster()) + if (!isAcceptWhispers() && !IsGameMaster() && !target->IsGameMaster()) { SetAcceptWhispers(true); ChatHandler(GetSession()).SendSysMessage(LANG_COMMAND_WHISPERON); } // announce afk or dnd message - if (rPlayer->isAFK()) - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, rPlayer->GetName().c_str(), rPlayer->autoReplyMsg.c_str()); - else if (rPlayer->isDND()) - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName().c_str(), rPlayer->autoReplyMsg.c_str()); + if (target->isAFK()) + { + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, target->GetName().c_str(), target->autoReplyMsg.c_str()); + } + else if (target->isDND()) + { + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, target->GetName().c_str(), target->autoReplyMsg.c_str()); + } +} + +void Player::Whisper(uint32 textId, Player* target, bool /*isBossWhisper = false*/) +{ + if (!target) + { + return; + } + + BroadcastText const* bct = sObjectMgr->GetBroadcastText(textId); + if (!bct) + { + LOG_ERROR("entities.unit", "Player::Whisper: `broadcast_text` was not %u found", textId); + return; + } + + LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex(); + WorldPacket data; + ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale); + target->SendDirectMessage(&data); } void Player::PetSpellInitialize() diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index aeedb4f50..1fa649f82 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1159,10 +1159,18 @@ public: void RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent = false); [[nodiscard]] uint32 GetPhaseMaskForSpawn() const; // used for proper set phase for DB at GM-mode creature/GO spawn - void Say(std::string const& text, const uint32 language); - void Yell(std::string const& text, const uint32 language); - void TextEmote(std::string const& text); - void Whisper(std::string const& text, const uint32 language, ObjectGuid receiver); + /// Handles said message in regular chat based on declared language and in config pre-defined Range. + void Say(std::string_view text, Language language, WorldObject const* = nullptr) override; + void Say(uint32 textId, WorldObject const* target = nullptr) override; + /// Handles yelled message in regular chat based on declared language and in config pre-defined Range. + void Yell(std::string_view text, Language language, WorldObject const* = nullptr) override; + void Yell(uint32 textId, WorldObject const* target = nullptr) override; + /// Outputs an universal text which is supposed to be an action. + void TextEmote(std::string_view text, WorldObject const* = nullptr, bool = false) override; + void TextEmote(uint32 textId, WorldObject const* target = nullptr, bool isBossEmote = false) override; + /// Handles whispers from Addons and players based on sender, receiver's guid and language. + void Whisper(std::string_view text, Language language, Player* receiver, bool = false) override; + void Whisper(uint32 textId, Player* target, bool isBossWhisper = false) override; /*********************************************************/ /*** STORAGE SYSTEM ***/ diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 577f5f13c..85bc69070 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -21,6 +21,8 @@ #include "BattlefieldMgr.h" #include "Battleground.h" #include "CellImpl.h" +#include "Chat.h" +#include "ChatTextBuilder.h" #include "Common.h" #include "ConditionMgr.h" #include "Creature.h" @@ -8788,7 +8790,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg if (triggerEntry == nullptr) { // Don't cast unknown spell - // LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u has 0 in EffectTriggered[%d]. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex()); + LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u (effIndex: %u) has unknown TriggerSpell %u. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex(), trigger_spell_id); return false; } @@ -20083,3 +20085,88 @@ float Unit::GetCollisionHeight() const return collisionHeight == 0.0f ? defaultHeight : collisionHeight; } + +void Unit::Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const* target) +{ + Acore::CustomChatTextBuilder builder(this, msgType, text, language, target); + Acore::LocalizedPacketDo localizer(builder); + Acore::PlayerDistWorker > worker(this, textRange, localizer); + Cell::VisitWorldObjects(this, worker, textRange); +} + +void Unit::Say(std::string_view text, Language language, WorldObject const* target /*= nullptr*/) +{ + Talk(text, CHAT_MSG_MONSTER_SAY, language, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), target); +} + +void Unit::Yell(std::string_view text, Language language, WorldObject const* target /*= nullptr*/) +{ + Talk(text, CHAT_MSG_MONSTER_YELL, language, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), target); +} + +void Unit::TextEmote(std::string_view text, WorldObject const* target /*= nullptr*/, bool isBossEmote /*= false*/) +{ + Talk(text, isBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, LANG_UNIVERSAL, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target); +} + +void Unit::Whisper(std::string_view text, Language language, Player* target, bool isBossWhisper /*= false*/) +{ + if (!target) + { + return; + } + + LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex(); + WorldPacket data; + ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, language, this, target, text, 0, "", locale); + target->SendDirectMessage(&data); +} + +void Unit::Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject const* target) +{ + if (!sObjectMgr->GetBroadcastText(textId)) + { + LOG_ERROR("entities.unit", "Unit::Talk: `broadcast_text` (ID: %u) was not found", textId); + return; + } + + Acore::BroadcastTextBuilder builder(this, msgType, textId, getGender(), target); + Acore::LocalizedPacketDo localizer(builder); + Acore::PlayerDistWorker > worker(this, textRange, localizer); + Cell::VisitWorldObjects(this, worker, textRange); +} + +void Unit::Say(uint32 textId, WorldObject const* target /*= nullptr*/) +{ + Talk(textId, CHAT_MSG_MONSTER_SAY, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), target); +} + +void Unit::Yell(uint32 textId, WorldObject const* target /*= nullptr*/) +{ + Talk(textId, CHAT_MSG_MONSTER_YELL, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), target); +} + +void Unit::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool isBossEmote /*= false*/) +{ + Talk(textId, isBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target); +} + +void Unit::Whisper(uint32 textId, Player* target, bool isBossWhisper /*= false*/) +{ + if (!target) + { + return; + } + + BroadcastText const* bct = sObjectMgr->GetBroadcastText(textId); + if (!bct) + { + LOG_ERROR("entities.unit", "Unit::Whisper: `broadcast_text` was not %u found", textId); + return; + } + + LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex(); + WorldPacket data; + ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale); + target->SendDirectMessage(&data); +} diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4d57902d6..0b0ac246d 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2502,6 +2502,17 @@ public: // Movement info Movement::MoveSpline* movespline; + virtual void Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const* target); + virtual void Say(std::string_view text, Language language, WorldObject const* target = nullptr); + virtual void Yell(std::string_view text, Language language, WorldObject const* target = nullptr); + virtual void TextEmote(std::string_view text, WorldObject const* target = nullptr, bool isBossEmote = false); + virtual void Whisper(std::string_view text, Language language, Player* target, bool isBossWhisper = false); + virtual void Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject const* target); + virtual void Say(uint32 textId, WorldObject const* target = nullptr); + virtual void Yell(uint32 textId, WorldObject const* target = nullptr); + virtual void TextEmote(uint32 textId, WorldObject const* target = nullptr, bool isBossEmote = false); + virtual void Whisper(uint32 textId, Player* target, bool isBossWhisper = false); + [[nodiscard]] float GetCollisionHeight() const override; [[nodiscard]] float GetCollisionWidth() const override; [[nodiscard]] float GetCollisionRadius() const override; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a1eb9e0e3..f65d34ab4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4874,7 +4874,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) tableName.c_str(), tmp.Talk.ChatType, tmp.id); continue; } - if (!tmp.Talk.TextID) + if (!GetBroadcastText(uint32(tmp.Talk.TextID))) { LOG_ERROR("sql.sql", "Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u", tableName.c_str(), tmp.Talk.TextID, tmp.id); @@ -5640,7 +5640,7 @@ void ObjectMgr::LoadGossipText() { if (gText.Options[i].BroadcastTextID) { - if (!sObjectMgr->GetBroadcastText(gText.Options[i].BroadcastTextID)) + if (!GetBroadcastText(gText.Options[i].BroadcastTextID)) { LOG_ERROR("sql.sql", "GossipText (Id: %u) in table `npc_text` has non-existing or incompatible BroadcastTextID%u %u.", id, i, gText.Options[i].BroadcastTextID); gText.Options[i].BroadcastTextID = 0; @@ -8794,7 +8794,7 @@ void ObjectMgr::LoadBroadcastTexts() BroadcastText bct; bct.Id = fields[0].GetUInt32(); - bct.Language = fields[1].GetUInt32(); + bct.LanguageID = fields[1].GetUInt32(); bct.MaleText[DEFAULT_LOCALE] = fields[2].GetString(); bct.FemaleText[DEFAULT_LOCALE] = fields[3].GetString(); bct.EmoteId0 = fields[4].GetUInt32(); @@ -8816,10 +8816,10 @@ void ObjectMgr::LoadBroadcastTexts() } } - if (!GetLanguageDescByID(bct.Language)) + if (!GetLanguageDescByID(bct.LanguageID)) { - LOG_DEBUG("misc", "BroadcastText (Id: %u) in table `broadcast_text` using Language %u but Language does not exist.", bct.Id, bct.Language); - bct.Language = LANG_UNIVERSAL; + LOG_DEBUG("misc", "BroadcastText (Id: %u) in table `broadcast_text` using Language %u but Language does not exist.", bct.Id, bct.LanguageID); + bct.LanguageID = LANG_UNIVERSAL; } if (bct.EmoteId0) diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 9abfd57f3..a094ce2bb 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -439,7 +439,7 @@ struct BroadcastText } uint32 Id{0}; - uint32 Language{0}; + uint32 LanguageID{0}; std::vector MaleText; std::vector FemaleText; uint32 EmoteId0{0}; diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2180f133e..d301b81d9 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -394,11 +394,11 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } if (type == CHAT_MSG_SAY) - sender->Say(msg, lang); + sender->Say(msg, Language(lang)); else if (type == CHAT_MSG_EMOTE) sender->TextEmote(msg); else if (type == CHAT_MSG_YELL) - sender->Yell(msg, lang); + sender->Yell(msg, Language(lang)); } break; case CHAT_MSG_WHISPER: @@ -442,7 +442,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) if (!senderIsPlayer && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID())) sender->AddWhisperWhiteList(receiver->GetGUID()); - GetPlayer()->Whisper(msg, lang, receiver->GetGUID()); + GetPlayer()->Whisper(msg, Language(lang), receiver); } break; case CHAT_MSG_PARTY: diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index afeebec78..a344bac87 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -21,6 +21,8 @@ enum BroadcastTextIds { BROADCAST_TEXT_ACHIEVEMENT_EARNED = 29245, + BROADCAST_TEXT_CALL_FOR_HELP = 2541, + BROADCAST_TEXT_FLEE_FOR_ASSIST = 1150 }; enum AcoreStrings @@ -1142,7 +1144,7 @@ enum AcoreStrings LANG_BATTLEGROUND = 5015, LANG_ARENA = 5016, LANG_RAID = 5017, - //= 5018, + // unused = 5018, LANG_COMMAND_TEMP_FROZEN_PLAYER = 5019, LANG_NPCINFO_PHASEMASK = 5020, LANG_NPCINFO_ARMOR = 5021, @@ -1154,12 +1156,12 @@ enum AcoreStrings LANG_GOINFO_NAME = 5027, LANG_GOINFO_LOOTID = 5028, LANG_COMMAND_LOOKUP_MAX_RESULTS = 5029, - LANG_FLEE = 5030, + // unused = 5030, LANG_NPCINFO_AIINFO = 5031, LANG_COMMAND_NO_BATTLEGROUND_FOUND = 5032, LANG_COMMAND_NO_ACHIEVEMENT_CRITERIA_FOUND = 5033, LANG_COMMAND_NO_OUTDOOR_PVP_FORUND = 5034, - LANG_CALL_FOR_HELP = 5035, + // unused = 5035, LANG_NPCINFO_EQUIPMENT = 5036, LANG_NPCINFO_MECHANIC_IMMUNE = 5037, LANG_NPCINFO_UNIT_FIELD_FLAGS = 5038, diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 404ecaead..27afdcf94 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -359,85 +359,59 @@ void Map::ScriptsProcess() switch (step.script->command) { case SCRIPT_COMMAND_TALK: + { if (step.script->Talk.ChatType > CHAT_TYPE_WHISPER && step.script->Talk.ChatType != CHAT_MSG_RAID_BOSS_WHISPER) { LOG_ERROR("maps.script", "%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType); break; } + if (step.script->Talk.Flags & SF_TALK_USE_PLAYER) { - if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script)) - { - LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); - BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(step.script->Talk.TextID); - std::string text = broadcastText->GetText(loc_idx, player->getGender()); - - switch (step.script->Talk.ChatType) - { - case CHAT_TYPE_SAY: - player->Say(text, LANG_UNIVERSAL); - break; - case CHAT_TYPE_YELL: - player->Yell(text, LANG_UNIVERSAL); - break; - case CHAT_TYPE_TEXT_EMOTE: - case CHAT_TYPE_BOSS_EMOTE: - player->TextEmote(text); - break; - case CHAT_TYPE_WHISPER: - case CHAT_MSG_RAID_BOSS_WHISPER: - { - ObjectGuid targetGUID = target ? target->GetGUID() : ObjectGuid::Empty; - if (!targetGUID || !targetGUID.IsPlayer()) - LOG_ERROR("maps.script", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); - else - player->Whisper(text, LANG_UNIVERSAL, targetGUID); - break; - } - default: - break; // must be already checked at load - } - } + source = _GetScriptPlayerSourceOrTarget(source, target, step.script); } else { - // Source or target must be Creature. - if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script)) + source = _GetScriptCreatureSourceOrTarget(source, target, step.script); + } + + if (source) + { + Unit* sourceUnit = source->ToUnit(); + if (!sourceUnit) { - ObjectGuid targetGUID = target ? target->GetGUID() : ObjectGuid::Empty; - switch (step.script->Talk.ChatType) + LOG_ERROR("scripts", "%s source object (%s) is not an unit, skipping.", step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str()); + break; + } + + switch (step.script->Talk.ChatType) + { + case CHAT_TYPE_SAY: + sourceUnit->Say(step.script->Talk.TextID, target); + break; + case CHAT_TYPE_YELL: + sourceUnit->Yell(step.script->Talk.TextID, target); + break; + case CHAT_TYPE_TEXT_EMOTE: + case CHAT_TYPE_BOSS_EMOTE: + sourceUnit->TextEmote(step.script->Talk.TextID, target, step.script->Talk.ChatType == CHAT_TYPE_BOSS_EMOTE); + break; + case CHAT_TYPE_WHISPER: + case CHAT_MSG_RAID_BOSS_WHISPER: { - case CHAT_TYPE_SAY: - cSource->MonsterSay(step.script->Talk.TextID, LANG_UNIVERSAL, target); - break; - case CHAT_TYPE_YELL: - cSource->MonsterYell(step.script->Talk.TextID, LANG_UNIVERSAL, target); - break; - case CHAT_TYPE_TEXT_EMOTE: - cSource->MonsterTextEmote(step.script->Talk.TextID, target); - break; - case CHAT_TYPE_BOSS_EMOTE: - cSource->MonsterTextEmote(step.script->Talk.TextID, target, true); - break; - case CHAT_TYPE_WHISPER: - if (!targetGUID || !targetGUID.IsPlayer()) - LOG_ERROR("maps.script", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); - else - cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer()); - break; - case CHAT_MSG_RAID_BOSS_WHISPER: - if (!targetGUID || !targetGUID.IsPlayer()) - LOG_ERROR("maps.script", "%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); - else - cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer(), true); - break; - default: - break; // must be already checked at load + Player* receiver = target ? target->ToPlayer() : nullptr; + if (!receiver) + LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); + else + sourceUnit->Whisper(step.script->Talk.TextID, receiver, step.script->Talk.ChatType == CHAT_MSG_RAID_BOSS_WHISPER); + break; } + default: + break; // must be already checked at load } } break; - + } case SCRIPT_COMMAND_EMOTE: // Source or target must be Creature. if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script)) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index f7acffa21..536748a27 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1,4 +1,4 @@ - /* + /* * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it @@ -3970,7 +3970,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) if (m_caster->getGender() > 0) gender = "her"; sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName().c_str(), gender, gender, urand(1, 10), urand(1, 10)); - m_caster->MonsterTextEmote(buf, nullptr); + m_caster->TextEmote(buf); break; } // Roll 'dem Bones - Worn Troll Dice @@ -3981,7 +3981,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) if (m_caster->getGender() > 0) gender = "her"; sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName().c_str(), gender, urand(1, 6), urand(1, 6)); - m_caster->MonsterTextEmote(buf, nullptr); + m_caster->TextEmote(buf); break; } // Death Knight Initiate Visual @@ -6392,9 +6392,7 @@ void Spell::EffectPlaySound(SpellEffIndex effIndex) return; } - WorldPacket data(SMSG_PLAY_SOUND, 4); - data << uint32(soundId); - unitTarget->ToPlayer()->GetSession()->SendPacket(&data); + player->PlayDirectSound(soundId, player); } void Spell::EffectRemoveAura(SpellEffIndex effIndex) diff --git a/src/server/game/Texts/ChatTextBuilder.cpp b/src/server/game/Texts/ChatTextBuilder.cpp new file mode 100644 index 000000000..79f27913c --- /dev/null +++ b/src/server/game/Texts/ChatTextBuilder.cpp @@ -0,0 +1,61 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "ChatTextBuilder.h" +#include "Chat.h" +#include "ObjectMgr.h" +#include + +void Acore::BroadcastTextBuilder::operator()(WorldPacket& data, LocaleConstant locale) const +{ + BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId); + ChatHandler::BuildChatPacket(data, _msgType, bct ? Language(bct->LanguageID) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", _achievementId, "", locale); +} + +size_t Acore::BroadcastTextBuilder::operator()(WorldPacket* data, LocaleConstant locale) const +{ + BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId); + return ChatHandler::BuildChatPacket(*data, _msgType, bct ? Language(bct->LanguageID) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", _achievementId, "", locale); +} + +void Acore::CustomChatTextBuilder::operator()(WorldPacket& data, LocaleConstant locale) const +{ + ChatHandler::BuildChatPacket(data, _msgType, _language, _source, _target, _text, 0, "", locale); +} + +void Acore::AcoreStringChatBuilder::operator()(WorldPacket& data, LocaleConstant locale) const +{ + char const* text = sObjectMgr->GetAcoreString(_textId, locale); + + if (_args) + { + // we need copy va_list before use or original va_list will corrupted + va_list ap; + va_copy(ap, *_args); + + static size_t const BufferSize = 2048; + char strBuffer[BufferSize]; + vsnprintf(strBuffer, BufferSize, text, ap); + va_end(ap); + + ChatHandler::BuildChatPacket(data, _msgType, LANG_UNIVERSAL, _source, _target, strBuffer, 0, "", locale); + } + else + { + ChatHandler::BuildChatPacket(data, _msgType, LANG_UNIVERSAL, _source, _target, text, 0, "", locale); + } +} diff --git a/src/server/game/Texts/ChatTextBuilder.h b/src/server/game/Texts/ChatTextBuilder.h new file mode 100644 index 000000000..ec1fce7d7 --- /dev/null +++ b/src/server/game/Texts/ChatTextBuilder.h @@ -0,0 +1,82 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef __CHATTEXT_BUILDER_H +#define __CHATTEXT_BUILDER_H + +#include "Common.h" +#include "SharedDefines.h" +#include + +class WorldObject; +class WorldPacket; + +namespace Acore +{ + class BroadcastTextBuilder + { + public: + BroadcastTextBuilder(WorldObject const* obj, ChatMsg msgType, uint32 textId, uint8 gender, WorldObject const* target = nullptr, uint32 achievementId = 0) + : _source(obj), _msgType(msgType), _textId(textId), _gender(gender), _target(target), _achievementId(achievementId) { } + + void operator()(WorldPacket& data, LocaleConstant locale) const; + size_t operator()(WorldPacket* data, LocaleConstant locale) const; + + private: + WorldObject const* _source; + ChatMsg _msgType; + uint32 _textId; + uint8 _gender; + WorldObject const* _target; + uint32 _achievementId; + }; + + class CustomChatTextBuilder + { + public: + CustomChatTextBuilder(WorldObject const* obj, ChatMsg msgType, std::string_view text, Language language = LANG_UNIVERSAL, WorldObject const* target = nullptr) + : _source(obj), _msgType(msgType), _text(text), _language(language), _target(target) { } + + void operator()(WorldPacket& data, LocaleConstant locale) const; + + private: + WorldObject const* _source; + ChatMsg _msgType; + std::string _text; + Language _language; + WorldObject const* _target; + }; + + class AcoreStringChatBuilder + { + public: + AcoreStringChatBuilder(WorldObject const* obj, ChatMsg msgType, uint32 textId, WorldObject const* target = nullptr, va_list* args = nullptr) + : _source(obj), _msgType(msgType), _textId(textId), _target(target), _args(args) { } + + void operator()(WorldPacket& data, LocaleConstant locale) const; + + private: + WorldObject const* _source; + ChatMsg _msgType; + uint32 _textId; + WorldObject const* _target; + va_list* _args; + }; +} +// namespace Acore + +#endif // __CHATTEXT_BUILDER_H diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 8e7c3b46e..ff2efdf70 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -3313,7 +3313,7 @@ public: } WorldPacket data(SMSG_PLAY_SOUND, 4); - data << uint32(soundId) << handler->GetSession()->GetPlayer()->GetGUID(); + data << uint32(soundId); sWorld->SendGlobalMessage(&data); handler->PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index ce5fe5fd7..316064707 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1249,7 +1249,7 @@ public: return false; } - creature->MonsterSay(args, LANG_UNIVERSAL, nullptr); + creature->Say(args, LANG_UNIVERSAL); // make some emotes char lastchar = args[strlen(args) - 1]; @@ -1284,7 +1284,7 @@ public: return false; } - creature->MonsterTextEmote(args, 0); + creature->TextEmote(args); return true; } @@ -1346,7 +1346,7 @@ public: if (handler->HasLowerSecurity(receiver, ObjectGuid::Empty)) return false; - creature->MonsterWhisper(text, receiver); + creature->Whisper(text, LANG_UNIVERSAL, receiver); return true; } @@ -1363,7 +1363,7 @@ public: return false; } - creature->MonsterYell(args, LANG_UNIVERSAL, nullptr); + creature->Yell(args, LANG_UNIVERSAL, nullptr); // make an emote creature->HandleEmoteCommand(EMOTE_ONESHOT_SHOUT); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index bfbb27cf1..9b215ee93 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -212,7 +212,7 @@ public: target->LoadPath(pathid); target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); target->GetMotionMaster()->Initialize(); - target->MonsterSay("Path loaded.", LANG_UNIVERSAL, nullptr); + target->Say("Path loaded.", LANG_UNIVERSAL); return true; } @@ -265,7 +265,7 @@ public: target->SetDefaultMovementType(IDLE_MOTION_TYPE); target->GetMotionMaster()->MoveTargetedHome(); target->GetMotionMaster()->Initialize(); - target->MonsterSay("Path unloaded.", LANG_UNIVERSAL, nullptr); + target->Say("Path unloaded.", LANG_UNIVERSAL); return true; } handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h index 09cf8c639..d6706482b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h @@ -88,7 +88,7 @@ enum BWLMisc DATA_EGG_EVENT = 2, TALK_EGG_BROKEN_RAND = 3, - SAY_NEFARIAN_VAEL_INTRO = 100003, // latest id in broadcast_text atm + SAY_NEFARIAN_VAEL_INTRO = 14 }; template diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 6cb917543..88ed38dd4 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -58,7 +58,6 @@ enum Says // BWL SAY_GAMESBEGIN_1 = 12, SAY_GAMESBEGIN_2 = 13, - // SAY_VAEL_INTRO = 14, Not used - when he corrupts Vaelastrasz // Nefarian SAY_RANDOM = 0, diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp index 534f35184..20351a0ce 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp @@ -154,7 +154,7 @@ public: if (Creature* nefarius = me->GetMap()->GetCreature(m_nefariusGuid)) { nefarius->CastSpell(me, SPELL_NEFARIUS_CORRUPTION, TRIGGERED_CAST_DIRECTLY); - nefarius->MonsterYell(SAY_NEFARIAN_VAEL_INTRO, LANG_UNIVERSAL, 0); + nefarius->Yell(SAY_NEFARIAN_VAEL_INTRO); nefarius->SetStandState(UNIT_STAND_STATE_STAND); } events.ScheduleEvent(EVENT_SPEECH_3, 18000); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 8b37cbb20..bb13e5eb7 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -490,25 +490,25 @@ public: switch(nextStep) { case 1: - me->MonsterYell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL, 0); + me->Yell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL); return 10000; case 2: if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID)) - arca->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0); + arca->Yell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL); return 20000; case 3: - me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, 0); + me->Yell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL); return 10000; case 4: if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID)) - arca->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0); + arca->Yell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL); return 20000; case 5: - me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, 0); + me->Yell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL); return 20000; case 6: if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID)) - arca->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0); + arca->Yell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL); ATimer = 5500; MTimer = 6600; @@ -519,7 +519,7 @@ public: me->CastSpell(me, SPELL_MANA_SHIELD, true); return 5500; case 9: - me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); + me->TextEmote(EMOTE_DIALOG_MEDIVH_7); me->CastSpell(me, 30972, true); return 10000; case 10: @@ -529,7 +529,7 @@ public: return 1000; case 11: if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID)) - arca->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0); + arca->Yell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL); return 5000; case 12: if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID)) @@ -540,7 +540,7 @@ public: } return 10000; case 13: - me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, 0); + me->Yell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL); return 10000; case 14: if (me->GetMap()->IsDungeon()) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 8ec7caf70..465c2b9b5 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -385,7 +385,7 @@ public: me->SetSheath(SHEATH_STATE_UNARMED); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->SetFacingToObject(player); - me->MonsterYell(12389, LANG_UNIVERSAL, player); + // me->Yell(12389, LANG_UNIVERSAL, player); // Doesn't exist SayAshbringer = true; } diff --git a/src/server/scripts/Events/brewfest.cpp b/src/server/scripts/Events/brewfest.cpp index 4d63636ee..6eb0e6a7d 100644 --- a/src/server/scripts/Events/brewfest.cpp +++ b/src/server/scripts/Events/brewfest.cpp @@ -226,7 +226,7 @@ public: if (q_status.CreatureOrGOCount[me->GetEntry() - 24202] == 0) { player->KilledMonsterCredit(me->GetEntry()); - player->MonsterSay(GetTextFor(me->GetEntry(), quest).c_str(), LANG_UNIVERSAL, player); + player->Say(GetTextFor(me->GetEntry(), quest).c_str(), LANG_UNIVERSAL, player); } } } @@ -456,16 +456,16 @@ public: if (thrown == 3) { thrown = 0; - sayer->MonsterSay("SOMEONE TRY THIS SUPER BREW!", LANG_UNIVERSAL, 0); + sayer->Say("SOMEONE TRY THIS SUPER BREW!", LANG_UNIVERSAL); //sayer->CastSpell(sayer, SPELL_CREATE_SUPER_BREW, true); sayer->SummonCreature(NPC_SUPER_BREW_TRIGGER, sayer->GetPositionX() + 15 * cos(sayer->GetOrientation()), sayer->GetPositionY() + 15 * sin(sayer->GetOrientation()), sayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); } else { if (urand(0, 1)) - sayer->MonsterSay("Chug and chuck! Chug and chuck!", LANG_UNIVERSAL, 0); + sayer->Say("Chug and chuck! Chug and chuck!", LANG_UNIVERSAL); else - sayer->MonsterSay("Down the free brew and pelt the Guzzlers with your mug!", LANG_UNIVERSAL, 0); + sayer->Say("Down the free brew and pelt the Guzzlers with your mug!", LANG_UNIVERSAL); } break; @@ -479,7 +479,7 @@ public: { char amount[500]; sprintf(amount, "We did it boys! Now back to the Grim Guzzler and we'll drink to the %u that were injured!", guzzlerCounter); - herald->MonsterYell(amount, LANG_UNIVERSAL, 0); + herald->Yell(amount, LANG_UNIVERSAL); } Reset(); @@ -492,7 +492,7 @@ public: { char amount[500]; sprintf(amount, "RETREAT!! We've already lost %u and we can't afford to lose any more!!", guzzlerCounter); - herald->MonsterYell(amount, LANG_UNIVERSAL, 0); + herald->Yell(amount, LANG_UNIVERSAL); } me->CastSpell(me, (me->GetMapId() == 1 ? SPELL_SUMMON_PLANS_H : SPELL_SUMMON_PLANS_A), true); @@ -771,19 +771,19 @@ public: switch (urand(0, 4)) { case 0: - me->MonsterSay("Drink it all boys!", LANG_UNIVERSAL, 0); + me->Say("Drink it all boys!", LANG_UNIVERSAL); break; case 1: - me->MonsterSay("DRINK! BRAWL! DRINK! BRAWL!", LANG_UNIVERSAL, 0); + me->Say("DRINK! BRAWL! DRINK! BRAWL!", LANG_UNIVERSAL); break; case 2: - me->MonsterSay("Did someone say, \"Free Brew\"?", LANG_UNIVERSAL, 0); + me->Say("Did someone say, \"Free Brew\"?", LANG_UNIVERSAL); break; case 3: - me->MonsterSay("No one expects the Dark Iron dwarves!", LANG_UNIVERSAL, 0); + me->Say("No one expects the Dark Iron dwarves!", LANG_UNIVERSAL); break; case 4: - me->MonsterSay("It's not a party without some crashers!", LANG_UNIVERSAL, 0); + me->Say("It's not a party without some crashers!", LANG_UNIVERSAL); break; } } diff --git a/src/server/scripts/Events/hallows_end.cpp b/src/server/scripts/Events/hallows_end.cpp index 2078a1105..2aa089ad2 100644 --- a/src/server/scripts/Events/hallows_end.cpp +++ b/src/server/scripts/Events/hallows_end.cpp @@ -698,7 +698,7 @@ public: switch (events.ExecuteEvent()) { case 1: - me->MonsterYell("Prepare yourselves, the bells have tolled! Shelter your weak, your young and your old! Each of you shall pay the final sum! Cry for mercy; the reckoning has come!", LANG_UNIVERSAL, 0); + me->Yell("Prepare yourselves, the bells have tolled! Shelter your weak, your young and your old! Each of you shall pay the final sum! Cry for mercy; the reckoning has come!", LANG_UNIVERSAL); me->PlayDirectSound(11966); break; case 2: @@ -729,12 +729,12 @@ public: } if (counter == 5) { - me->MonsterYell("The sky is dark. The fire burns. You strive in vain as Fate's wheel turns.", LANG_UNIVERSAL, 0); + me->Yell("The sky is dark. The fire burns. You strive in vain as Fate's wheel turns.", LANG_UNIVERSAL); me->PlayDirectSound(12570); } else if (counter == 10) { - me->MonsterYell("The town still burns. A cleansing fire! Time is short, I'll soon retire!", LANG_UNIVERSAL, 0); + me->Yell("The town still burns. A cleansing fire! Time is short, I'll soon retire!", LANG_UNIVERSAL); me->PlayDirectSound(12571); } @@ -786,7 +786,7 @@ public: { if (failed) { - me->MonsterYell("Fire consumes! You've tried and failed. Let there be no doubt, justice prevailed!", LANG_UNIVERSAL, 0); + me->Yell("Fire consumes! You've tried and failed. Let there be no doubt, justice prevailed!", LANG_UNIVERSAL); me->PlayDirectSound(11967); for (ObjectGuid const& guid : unitList) if (Unit* c = ObjectAccessor::GetUnit(*me, guid)) @@ -796,7 +796,7 @@ public: } else { - me->MonsterYell("My flames have died, left not a spark! I shall send you now to the lifeless dark!", LANG_UNIVERSAL, 0); + me->Yell("My flames have died, left not a spark! I shall send you now to the lifeless dark!", LANG_UNIVERSAL); me->PlayDirectSound(11968); float x, y, z; GetPosToLand(x, y, z); @@ -814,7 +814,7 @@ public: void JustDied(Unit* /*killer*/) override { - me->MonsterYell("So eager you are, for my blood to spill. Yet to vanquish me, 'tis my head you must kill!", LANG_UNIVERSAL, 0); + me->Yell("So eager you are, for my blood to spill. Yet to vanquish me, 'tis my head you must kill!", LANG_UNIVERSAL); me->PlayDirectSound(11969); float x, y, z; GetPosToLand(x, y, z); @@ -979,7 +979,7 @@ public: void JustDied(Unit* /*killer*/) override { summons.DespawnAll(); - me->MonsterSay("This end have I reached before. What new adventure lies in store?", LANG_UNIVERSAL, 0); + me->Say("This end have I reached before. What new adventure lies in store?", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_DEATH); std::list unitList; me->GetCreaturesWithEntryInRange(unitList, 100.0f, NPC_PUMPKIN_FIEND); @@ -993,7 +993,7 @@ public: void KilledUnit(Unit* /*who*/) override { - me->MonsterYell("Your body lies beaten, battered and broken. Let my curse be your own, fate has spoken.", LANG_UNIVERSAL, 0); + me->Yell("Your body lies beaten, battered and broken. Let my curse be your own, fate has spoken.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY); } @@ -1025,7 +1025,7 @@ public: events.CancelEvent(EVENT_HORSEMAN_WHIRLWIND); events.CancelEvent(EVENT_HORSEMAN_CONFLAGRATION); events.CancelEvent(EVENT_SUMMON_PUMPKIN); - me->MonsterYell("Here's my body, fit and pure! Now, your blackened souls I'll cure!", LANG_UNIVERSAL, 0); + me->Yell("Here's my body, fit and pure! Now, your blackened souls I'll cure!", LANG_UNIVERSAL); if (phase == 1) events.ScheduleEvent(EVENT_HORSEMAN_CONFLAGRATION, 6000); @@ -1126,23 +1126,23 @@ public: switch (talkCount) { case 1: - player->MonsterSay("Horseman rise...", LANG_UNIVERSAL, 0); + player->Say("Horseman rise...", LANG_UNIVERSAL); break; case 2: - player->MonsterSay("Your time is nigh...", LANG_UNIVERSAL, 0); + player->Say("Your time is nigh...", LANG_UNIVERSAL); if (Creature* trigger = me->SummonTrigger(1765.28f, 1347.46f, 17.5514f, 0.0f, 15 * IN_MILLISECONDS)) trigger->CastSpell(trigger, SPELL_EARTH_EXPLOSION, true); break; case 3: me->GetMotionMaster()->MovePath(236820, false); me->CastSpell(me, SPELL_SHAKE_CAMERA_SMALL, true); - player->MonsterSay("You felt death once...", LANG_UNIVERSAL, 0); - me->MonsterSay("It is over, your search is done. Let fate choose now, the righteous one.", LANG_UNIVERSAL, 0); + player->Say("You felt death once...", LANG_UNIVERSAL); + me->Say("It is over, your search is done. Let fate choose now, the righteous one.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_AGGRO); break; case 4: me->CastSpell(me, SPELL_SHAKE_CAMERA_MEDIUM, true); - player->MonsterSay("Now, know demise!", LANG_UNIVERSAL, 0); + player->Say("Now, know demise!", LANG_UNIVERSAL); talkCount = 0; return; // pop and return, skip repeat } @@ -1206,7 +1206,7 @@ public: } else { - me->MonsterSay("Soldiers arise, stand and fight! Bring victory at last to this fallen knight!", LANG_UNIVERSAL, 0); + me->Say("Soldiers arise, stand and fight! Bring victory at last to this fallen knight!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SPROUT); events.RepeatEvent(15000); talkCount = 0; @@ -1346,7 +1346,7 @@ public: } me->CastSpell(me, SPELL_HORSEMAN_SPEAKS, true); - me->MonsterTextEmote("Headless Horseman laughs", 0); + me->TextEmote("Headless Horseman laughs"); me->PlayDirectSound(sound); } } diff --git a/src/server/scripts/Events/pilgrims_bounty.cpp b/src/server/scripts/Events/pilgrims_bounty.cpp index 4008f114f..adecac336 100644 --- a/src/server/scripts/Events/pilgrims_bounty.cpp +++ b/src/server/scripts/Events/pilgrims_bounty.cpp @@ -551,16 +551,16 @@ public: switch (stackAmount) { case 10: - target->MonsterTextEmote("Turkey Hunter!", target, true); + target->TextEmote("Turkey Hunter!", target, true); break; case 20: - target->MonsterTextEmote("Turkey Domination!", target, true); + target->TextEmote("Turkey Domination!", target, true); break; case 30: - target->MonsterTextEmote("Turkey Slaughter!", target, true); + target->TextEmote("Turkey Slaughter!", target, true); break; case 40: - target->MonsterTextEmote("TURKEY TRIUMPH!", target, true); + target->TextEmote("TURKEY TRIUMPH!", target, true); target->CastSpell(target, SPELL_ACHI_TURKINATOR_CREDIT, true); aurEff->GetBase()->Remove(); break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index cb67cbd96..9e03197bc 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -926,7 +926,7 @@ void hyjalAI::WaypointReached(uint32 waypointId) { if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL)) { - me->MonsterYell(YELL_HURRY, LANG_UNIVERSAL, nullptr); + me->Yell(YELL_HURRY, LANG_UNIVERSAL); WaitForTeleport = true; TeleportTimer = 20000; if (me->GetEntry() == JAINA) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index 14d8b0093..a6f25dde1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -194,15 +194,12 @@ public: for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { - if (i->GetSource()) + if (Player* player = i->GetSource()) { WorldPacket packet; - ChatHandler::BuildChatPacket(packet, CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, unit, i->GetSource(), YELL_EFFORTS); - i->GetSource()->GetSession()->SendPacket(&packet); - - WorldPacket data2(SMSG_PLAY_SOUND, 4); - data2 << 10986; - i->GetSource()->GetSession()->SendPacket(&data2); + ChatHandler::BuildChatPacket(packet, CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, unit, player, YELL_EFFORTS); + player->SendDirectMessage(&packet); + player->PlayDirectSound(10986, player); } } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp index 38471cb84..b3746a65f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp @@ -98,7 +98,7 @@ public: { cr->DespawnOrUnsummon(5000); cr->RemoveAllAuras(); - cr->MonsterSay("You have my thanks for saving my existence in this timeline. Now i must report back to my superiors. They must know immediately of what i just experienced.", LANG_UNIVERSAL, 0); + cr->Say("You have my thanks for saving my existence in this timeline. Now i must report back to my superiors. They must know immediately of what i just experienced.", LANG_UNIVERSAL); } } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 64b8c9135..80e36d9db 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -566,7 +566,7 @@ public: case 11: if (Creature* cityman = GetEventNpc(NPC_CITY_MAN2)) { - cityman->MonsterSay("Oh no...", LANG_UNIVERSAL, 0); // missing script_text + cityman->Say("Oh no...", LANG_UNIVERSAL); // missing script_text me->CastSpell(cityman, SPELL_ARTHAS_CRUSADER_STRIKE, true); } me->SetReactState(REACT_DEFENSIVE); @@ -1026,7 +1026,7 @@ public: } summons.DespawnAll(); - me->MonsterSay("I can't afford to spare you.", LANG_UNIVERSAL, 0); + me->Say("I can't afford to spare you.", LANG_UNIVERSAL); me->SetFacingTo(0.0f); ScheduleNextEvent(currentEvent, 5000); break; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 45aa336eb..d61d1e6f6 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -467,7 +467,7 @@ public: case EVENT_PHASE_2_STEP_ACROSS: { me->SetFacingTo(OnyxiaMoveData[CurrentWP].o); - me->MonsterTextEmote("Onyxia takes in a deep breath...", 0, true); + me->TextEmote("Onyxia takes in a deep breath...", nullptr, true); me->CastSpell(me, OnyxiaMoveData[CurrentWP].spellId, false); events.ScheduleEvent(EVENT_SPELL_BREATH, 8250); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 5bd471dac..68877fb9f 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -213,7 +213,7 @@ struct boss_twinemperorsAI : public ScriptedAI Creature* pOtherBoss = GetOtherBoss(); if (pOtherBoss) { - //me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); + //me->Yell("Teleporting ...", LANG_UNIVERSAL); Position thisPos; thisPos.Relocate(me); Position otherPos; @@ -257,7 +257,7 @@ struct boss_twinemperorsAI : public ScriptedAI me->ClearUnitState(UNIT_STATE_STUNNED); if (Unit* nearu = me->SelectNearestTarget(100)) { - //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0); + //DoYell(nearu->GetName(), LANG_UNIVERSAL); AttackStart(nearu); me->AddThreat(nearu, 10000); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index 27ad7a427..25542a5c8 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -181,7 +181,7 @@ public: break; case EVENT_SPELL_RADIANCE: me->CastSpell((Unit*)nullptr, SPELL_RADIANCE, false); - me->MonsterTextEmote(TEXT_RADIATE, 0, true); + me->TextEmote(TEXT_RADIATE, nullptr, true); events.RepeatEvent(16000); break; case EVENT_SPELL_HAMMER_RIGHTEOUS: @@ -189,7 +189,7 @@ public: { char buffer[100]; sprintf(buffer, "Eadric the Pure targets %s with the Hammer of the Righteous!", target->GetName().c_str()); - me->MonsterTextEmote(buffer, 0, true); + me->TextEmote(buffer, nullptr, true); Talk(TEXT_EADRIC_HAMMER); me->CastSpell(target, SPELL_HAMMER_JUSTICE, true); me->CastSpell(target, SPELL_HAMMER_RIGHTEOUS, false); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 1093d6499..6dc26aa1c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -249,7 +249,7 @@ public: case EVENT_ANNOUNCER_SAY_ZOMBIE: if( pInstance && !summons.empty() ) if( Creature* ghoul = pInstance->instance->GetCreature(*summons.begin()) ) - ghoul->MonsterYell("[Zombie] .... . Brains ....", LANG_UNIVERSAL, 0); + ghoul->Yell("[Zombie] .... . Brains ....", LANG_UNIVERSAL); break; case EVENT_SPELL_PLAGUE_STRIKE: diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index af94d0104..f33a6cb71 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -650,7 +650,7 @@ public: { char buffer[50]; sprintf(buffer, "%s is trampled!", me->GetName().c_str()); - me->MonsterTextEmote(buffer, 0); + me->TextEmote(buffer); } break; } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index e7cd51bed..ce0799153 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -878,7 +878,7 @@ public: { if( Creature* c = instance->GetCreature(NPC_JaraxxusGUID) ) { - c->MonsterYell("Banished to the Nether!", LANG_UNIVERSAL, 0); + c->Yell("Banished to the Nether!", LANG_UNIVERSAL); c->PlayDirectSound(16146, 0); if( Creature* f = instance->GetCreature(NPC_FizzlebangGUID) ) { diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index c5608ae6f..80494b138 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -1029,7 +1029,7 @@ public: a->SetDuration(8000); } - pMarwyn->MonsterTextEmote("Spirits appear and surround the altar!", 0, true); + pMarwyn->TextEmote("Spirits appear and surround the altar!", nullptr, true); } ++ResumeFirstEventStep; ResumeFirstEventTimer = 7500; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index a81d40830..04240c896 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -834,7 +834,7 @@ public: _bFordringMustFallYell = true; if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HIGHLORD_TIRION_FORDRING))) { - tirion->MonsterYell("The Lich King must fall!", LANG_UNIVERSAL, 0); + tirion->Yell("The Lich King must fall!", LANG_UNIVERSAL); tirion->PlayDirectSound(17389); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 9a17f5144..63fbdae3e 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -1640,7 +1640,7 @@ public: std::string const& text = sCreatureTextMgr->GetLocalizedChatString(NPC_THE_LICH_KING_LH, 0, 20 + id, 0, LOCALE_enUS); WorldPacket data; ChatHandler::BuildChatPacket(data, CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, ObjectGuid::Empty, player->GetGUID(), text, CHAT_TAG_NONE, "The Lich King"); - player->SendPlaySound(17235 + id, true); + player->PlayDirectSound(17235 + id); player->SendDirectMessage(&data); } } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp index 16a53d2e0..3cd75bfef 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp @@ -142,7 +142,7 @@ public: case EVENT_MAGIC_PULL: { Talk(SAY_PULL); - //me->MonsterTextEmote(TEXT_MAGIC_PULL, 0, true); + //me->TextEmote(TEXT_MAGIC_PULL, nullptr, true); me->CastSpell(me, SPELL_MAGIC_PULL, false); events.RepeatEvent(urand(15000, 25000)); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp index 704a49818..727f9647e 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp @@ -219,7 +219,7 @@ public: } break; case EVENT_SPELL_PLANAR_SHIFT: - //me->MonsterYell(TEXT_PLANAR_SHIFT_SAY, LANG_UNIVERSAL, 0); + //me->Yell(TEXT_PLANAR_SHIFT_SAY, LANG_UNIVERSAL); Talk(SAY_SHIELD); me->CastSpell(me, SPELL_PLANAR_SHIFT, false); for( uint8 i = 0; i < 3; ++i ) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 88ae9fb8c..4637f0d6a 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -220,7 +220,7 @@ public: if (pInstance) if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { - brann->MonsterYell("What in the name o' Madoran did THAT do? Oh! Wait: I just about got it...", LANG_UNIVERSAL, 0); + brann->Yell("What in the name o' Madoran did THAT do? Oh! Wait: I just about got it...", LANG_UNIVERSAL); brann->PlayDirectSound(14276); } } @@ -229,7 +229,7 @@ public: { if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { - brann->MonsterYell("Ha, that did it! Help's a-comin'! Take this, ya glowin' iron brute!", LANG_UNIVERSAL, 0); + brann->Yell("Ha, that did it! Help's a-comin'! Take this, ya glowin' iron brute!", LANG_UNIVERSAL); brann->PlayDirectSound(14277); } SummonPhase = PHASE_SUMMON_FRIENDLY_DWARFES; @@ -276,7 +276,7 @@ public: { if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { - brann->MonsterYell("This is a wee bit trickier that before... Oh, bloody--incomin'!", LANG_UNIVERSAL, 0); + brann->Yell("This is a wee bit trickier that before... Oh, bloody--incomin'!", LANG_UNIVERSAL); brann->PlayDirectSound(14275); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp index ea9df6af1..5003a5843 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp @@ -357,12 +357,12 @@ public: break; case ACTION_START_SJONNIR_FIGHT: me->setFaction(35); - me->MonsterYell("Don't worry! Ol' Brann's got yer back! Keep that metal monstrosity busy, and I'll see if I can't sweet talk this machine into helping ye!", LANG_UNIVERSAL, 0); + me->Yell("Don't worry! Ol' Brann's got yer back! Keep that metal monstrosity busy, and I'll see if I can't sweet talk this machine into helping ye!", LANG_UNIVERSAL); me->PlayDirectSound(14274); SetEscortPaused(false); break; case ACTION_SJONNIR_DEAD: - me->MonsterYell("Loken? That's downright bothersome... We might've neutralized the iron dwarves, but I'd lay odds there's another machine somewhere else churnin' out a whole mess o' these iron vrykul!", LANG_UNIVERSAL, 0); + me->Yell("Loken? That's downright bothersome... We might've neutralized the iron dwarves, but I'd lay odds there's another machine somewhere else churnin' out a whole mess o' these iron vrykul!", LANG_UNIVERSAL); me->PlayDirectSound(14278); events.ScheduleEvent(EVENT_END, 14000); break; @@ -538,7 +538,7 @@ public: pInstance->SetData(BRANN_BRONZEBEARD, 6); me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); - me->MonsterYell("I'll use the forge to make batches o' earthen to stand guard... But our greatest challenge still remains: find and stop Loken!", LANG_UNIVERSAL, 0); + me->Yell("I'll use the forge to make batches o' earthen to stand guard... But our greatest challenge still remains: find and stop Loken!", LANG_UNIVERSAL); me->PlayDirectSound(14279); break; } @@ -568,7 +568,7 @@ public: if (cs) { - cs->MonsterYell(Conversation[SpeechCount].text, LANG_UNIVERSAL, 0); + cs->Yell(Conversation[SpeechCount].text, LANG_UNIVERSAL); cs->PlayDirectSound(Conversation[SpeechCount].sound); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 165f92a24..21a322abf 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -186,7 +186,7 @@ public: summons.DoZoneInCombat(NPC_SANCTUM_SENTRY); - me->MonsterYell("Some things are better left alone!", LANG_UNIVERSAL, 0); + me->Yell("Some things are better left alone!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_AGGRO); me->setActive(true); } @@ -198,12 +198,12 @@ public: if (urand(0, 1)) { - me->MonsterYell("The secret dies with you!", LANG_UNIVERSAL, 0); + me->Yell("The secret dies with you!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY1); } else { - me->MonsterYell("There is no escape!", LANG_UNIVERSAL, 0); + me->Yell("There is no escape!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY2); } } @@ -216,7 +216,7 @@ public: EntryCheckPredicate pred(NPC_FERAL_DEFENDER); summons.DoAction(ACTION_DESPAWN_ADDS, pred); summons.DespawnAll(); - me->MonsterTextEmote("Auriaya screams in agony.", 0); + me->TextEmote("Auriaya screams in agony.", nullptr, true); me->PlayDirectSound(SOUND_DEATH); } @@ -240,7 +240,7 @@ public: switch (events.ExecuteEvent()) { case EVENT_SUMMON_FERAL_DEFENDER: - me->MonsterTextEmote("Auriaya begins to activate Feral Defender.", 0, true); + me->TextEmote("Auriaya begins to activate Feral Defender.", nullptr, true); me->CastSpell(me, SPELL_ACTIVATE_FERAL_DEFENDER, true); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); events.ScheduleEvent(EVENT_REMOVE_IMMUNE, 3000); @@ -249,7 +249,7 @@ public: me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); break; case EVENT_TERRIFYING_SCREECH: - me->MonsterTextEmote("Auriaya begins to cast Terrifying Screech.", 0, true); + me->TextEmote("Auriaya begins to cast Terrifying Screech.", nullptr, true); me->CastSpell(me, SPELL_TERRIFYING_SCREECH, false); events.RepeatEvent(35000); break; @@ -273,7 +273,7 @@ public: break; } case EVENT_ENRAGE: - me->MonsterTextEmote("You waste my time!", 0); + me->TextEmote("You waste my time!", nullptr, true); me->PlayDirectSound(SOUND_BERSERK); me->CastSpell(me, SPELL_ENRAGE, true); break; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 5a3434420..a752241a6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -437,27 +437,27 @@ public: if (Unit* seat = vehicle->GetPassenger(i)) if (seat->GetTypeId() == TYPEID_UNIT) seat->ToCreature()->AI()->EnterEvadeMode(); - me->MonsterTextEmote("Flame Leviathan reactivated. Resumming combat functions.", 0, true); + me->TextEmote("Flame Leviathan reactivated. Resumming combat functions.", nullptr, true); return; case EVENT_THORIMS_HAMMER: SummonTowerHelpers(TOWER_OF_STORMS); events.RepeatEvent(60000 + rand() % 60000); - me->MonsterTextEmote("Flame Leviathan activates Thorim's Hammer.", 0, true); + me->TextEmote("Flame Leviathan activates Thorim's Hammer.", nullptr, true); Talk(FLAME_LEVIATHAN_SAY_TOWER_STORM); return; case EVENT_FREYA: SummonTowerHelpers(TOWER_OF_LIFE); - me->MonsterTextEmote("Flame Leviathan activates Freya's Ward.", 0, true); + me->TextEmote("Flame Leviathan activates Freya's Ward.", nullptr, true); Talk(FLAME_LEVIATHAN_SAY_TOWER_NATURE); return; case EVENT_MIMIRONS_INFERNO: SummonTowerHelpers(TOWER_OF_FLAMES); - me->MonsterTextEmote("Flame Leviathan activates Mimiron's Inferno.", 0, true); + me->TextEmote("Flame Leviathan activates Mimiron's Inferno.", nullptr, true); Talk(FLAME_LEVIATHAN_SAY_TOWER_FLAME); return; case EVENT_HODIRS_FURY: SummonTowerHelpers(TOWER_OF_FROST); - me->MonsterTextEmote("Flame Leviathan activates Hodir's Fury.", 0, true); + me->TextEmote("Flame Leviathan activates Hodir's Fury.", nullptr, true); Talk(FLAME_LEVIATHAN_SAY_TOWER_FROST); return; } @@ -1523,11 +1523,11 @@ public: if (!vehicle) return; - Player* driver = vehicle->GetPassenger(0) ? vehicle->GetPassenger(0)->ToPlayer() : nullptr; + Unit* driver = vehicle->GetPassenger(0); if (!driver) return; - driver->MonsterTextEmote("Automatic repair sequence initiated.", driver, true); + driver->TextEmote("Automatic repair sequence initiated.", driver, true); // Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well. vehicle->GetBase()->SetFullHealth(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index a02c0af7d..f0ff23808 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -324,12 +324,12 @@ public: if (urand(0, 1)) { - me->MonsterYell("Forgive me.", LANG_UNIVERSAL, 0); + me->Yell("Forgive me.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY1); } else { - me->MonsterYell("From your death springs life anew!", LANG_UNIVERSAL, 0); + me->Yell("From your death springs life anew!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY2); } } @@ -339,7 +339,7 @@ public: // kaboom! if (damage >= me->GetHealth()) { - me->MonsterYell("His hold on me dissipates. I can see clearly once more. Thank you, heroes.", LANG_UNIVERSAL, 0); + me->Yell("His hold on me dissipates. I can see clearly once more. Thank you, heroes.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_DEATH); damage = 0; @@ -398,7 +398,7 @@ public: // Wave of three if (_waveNumber == 1) { - me->MonsterYell("Children, assist me!", LANG_UNIVERSAL, 0); + me->Yell("Children, assist me!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_TRIO); me->SummonCreature(NPC_ANCIENT_WATER_SPIRIT, me->GetPositionX() + urand(5, 15), me->GetPositionY() + urand(5, 15), me->GetMapHeight(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); me->SummonCreature(NPC_STORM_LASHER, me->GetPositionX() + urand(5, 15), me->GetPositionY() + urand(5, 15), me->GetMapHeight(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); @@ -407,14 +407,14 @@ public: // Ancient Conservator else if (_waveNumber == 2) { - me->MonsterYell("Eonar, your servant requires aid!", LANG_UNIVERSAL, 0); + me->Yell("Eonar, your servant requires aid!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_CONSERVATOR); me->SummonCreature(NPC_ANCIENT_CONSERVATOR, me->GetPositionX() + urand(5, 15), me->GetPositionY() + urand(5, 15), me->GetMapHeight(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()), 0, TEMPSUMMON_CORPSE_DESPAWN); } // Detonating Lashers else if (_waveNumber == 3) { - me->MonsterYell("The swarm of the elements shall overtake you!", LANG_UNIVERSAL, 0); + me->Yell("The swarm of the elements shall overtake you!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_DETONATING); for (uint8 i = 0; i < 10; ++i) me->SummonCreature(NPC_DETONATING_LASHER, me->GetPositionX() + urand(5, 20), me->GetPositionY() + urand(5, 20), me->GetMapHeight(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()), 0, TEMPSUMMON_CORPSE_DESPAWN); @@ -550,12 +550,12 @@ public: if (_elderGUID[0] || _elderGUID[1] || _elderGUID[2]) { - me->MonsterYell("Elders, grant me your strength!", LANG_UNIVERSAL, 0); + me->Yell("Elders, grant me your strength!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_ELDERS); } else { - me->MonsterYell("The Conservatory must be protected!", LANG_UNIVERSAL, 0); + me->Yell("The Conservatory must be protected!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_AGGRO); } } @@ -640,7 +640,7 @@ public: break; } case EVENT_FREYA_BERSERK: - me->MonsterYell("You have strayed too far, wasted too much time!", LANG_UNIVERSAL, 0); + me->Yell("You have strayed too far, wasted too much time!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_BERSERK); me->CastSpell(me, SPELL_BERSERK, true); break; @@ -706,12 +706,12 @@ public: if (urand(0, 1)) { - me->MonsterTextEmote("Angry roar", 0); + me->TextEmote("Angry roar"); me->PlayDirectSound(SOUND_STONEBARK_SLAY1); } else { - me->MonsterYell("Such a waste.", LANG_UNIVERSAL, 0); + me->Yell("Such a waste.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_STONEBARK_SLAY2); } } @@ -720,7 +720,7 @@ public: { if (me->GetEntry() == killer->GetEntry()) return; - me->MonsterYell("Matron, flee! They are ruthless....", LANG_UNIVERSAL, 0); + me->Yell("Matron, flee! They are ruthless....", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_STONEBARK_DEATH); // Lumberjacked @@ -735,7 +735,7 @@ public: events.ScheduleEvent(EVENT_STONEBARK_GROUND_TREMOR, 5000); events.ScheduleEvent(EVENT_STONEBARK_PETRIFIED_BARK, 20000); - me->MonsterYell("This place will serve as your graveyard.", LANG_UNIVERSAL, 0); + me->Yell("This place will serve as your graveyard.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_STONEBARK_AGGRO); } @@ -812,12 +812,12 @@ public: if (urand(0, 1)) { - me->MonsterYell("Fertilizer.", LANG_UNIVERSAL, 0); + me->Yell("Fertilizer.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_BRIGHTLEAF_SLAY1); } else { - me->MonsterYell("Your corpse will nourish the soil!", LANG_UNIVERSAL, 0); + me->Yell("Your corpse will nourish the soil!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_BRIGHTLEAF_SLAY2); } } @@ -826,7 +826,7 @@ public: { if (me->GetEntry() == killer->GetEntry()) return; - me->MonsterYell("Matron, one has fallen!", LANG_UNIVERSAL, 0); + me->Yell("Matron, one has fallen!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_BRIGHTLEAF_DEATH); // Lumberjacked @@ -841,7 +841,7 @@ public: events.ScheduleEvent(EVENT_BRIGHTLEAF_SOLAR_FLARE, 5000); events.ScheduleEvent(EVENT_BRIGHTLEAF_UNSTABLE_SUN_BEAM, 8000); - me->MonsterYell("Matron, the Conservatory has been breached!", LANG_UNIVERSAL, 0); + me->Yell("Matron, the Conservatory has been breached!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_BRIGHTLEAF_AGGRO); } @@ -933,12 +933,12 @@ public: if (urand(0, 1)) { - me->MonsterYell("I return you whence you came!", LANG_UNIVERSAL, 0); + me->Yell("I return you whence you came!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_IRONBRANCH_SLAY1); } else { - me->MonsterYell("BEGONE!", LANG_UNIVERSAL, 0); + me->Yell("BEGONE!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_IRONBRANCH_SLAY2); } } @@ -947,7 +947,7 @@ public: { if (me->GetEntry() == killer->GetEntry()) return; - me->MonsterYell("Freya! They come for you.", LANG_UNIVERSAL, 0); + me->Yell("Freya! They come for you.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_IRONBRANCH_DEATH); // Lumberjacked @@ -962,7 +962,7 @@ public: events.ScheduleEvent(EVENT_IRONBRANCH_IRON_ROOT, 15000); events.ScheduleEvent(EVENT_IRONBRANCH_THORN_SWARM, 3000); - me->MonsterYell("Mortals have no place here!", LANG_UNIVERSAL, 0); + me->Yell("Mortals have no place here!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_IRONBRANCH_AGGRO); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 3a6bfa59d..4139cfabc 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -165,7 +165,7 @@ public: events.RescheduleEvent(EVENT_SPELL_SUMMON_SARONITE_VAPORS, 30000); events.RescheduleEvent(EVENT_BERSERK, 600000); - me->MonsterYell(TEXT_VEZAX_AGGRO, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VEZAX_AGGRO, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VEZAX_AGGRO, 0); if (pInstance) @@ -226,7 +226,7 @@ public: case EVENT_BERSERK: berserk = true; me->CastSpell(me, SPELL_VEZAX_BERSERK, true); - me->MonsterYell(TEXT_VEZAX_BERSERK, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VEZAX_BERSERK, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VEZAX_BERSERK, 0); break; case EVENT_SPELL_VEZAX_SHADOW_CRASH: @@ -261,7 +261,7 @@ public: events.RepeatEvent( me->GetMap()->Is25ManRaid() ? 8000 : 15000 ); break; case EVENT_SPELL_SURGE_OF_DARKNESS: - me->MonsterYell(TEXT_VEZAX_SURGE, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VEZAX_SURGE, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VEZAX_SURGE, 0); me->CastSpell(me, SPELL_SURGE_OF_DARKNESS, false); events.RepeatEvent(63000); @@ -298,7 +298,7 @@ public: { vaporsCount++; me->CastSpell(me, SPELL_SUMMON_SARONITE_VAPORS, false); - me->MonsterTextEmote("A cloud of saronite vapors coalesces nearby!", 0, true); + me->TextEmote("A cloud of saronite vapors coalesces nearby!", nullptr, true); if( vaporsCount < 6 || !hardmodeAvailable ) events.RepeatEvent(30000); @@ -321,7 +321,7 @@ public: case EVENT_SARONITE_VAPORS_SWIRL: if (summons.size()) { - me->MonsterTextEmote("The saronite vapors mass and swirl violently, merging into a monstrous form!", 0, true); + me->TextEmote("The saronite vapors mass and swirl violently, merging into a monstrous form!", nullptr, true); if( Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())) ) sv->CastSpell(sv, SPELL_SARONITE_ANIMUS_FORMATION_VISUAL, true); @@ -332,8 +332,8 @@ public: case EVENT_SPELL_SUMMON_SARONITE_ANIMUS: if (summons.size()) { - me->MonsterTextEmote("A saronite barrier appears around General Vezax!", 0, true); - me->MonsterYell(TEXT_VEZAX_HARDMODE, LANG_UNIVERSAL, 0); + me->TextEmote("A saronite barrier appears around General Vezax!", nullptr, true); + me->Yell(TEXT_VEZAX_HARDMODE, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VEZAX_HARDMODE, 0); me->CastSpell(me, SPELL_SARONITE_BARRIER, true); @@ -358,7 +358,7 @@ public: if (pInstance) pInstance->SetData(TYPE_VEZAX, DONE); - me->MonsterYell(TEXT_VEZAX_DEATH, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VEZAX_DEATH, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VEZAX_DEATH, 0); if( GameObject* door = me->FindNearestGameObject(GO_VEZAX_DOOR, 500.0f) ) @@ -375,12 +375,12 @@ public: { if( urand(0, 1) ) { - me->MonsterYell(TEXT_VEZAX_SLAIN_1, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VEZAX_SLAIN_1, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VEZAX_SLAIN_1, 0); } else { - me->MonsterYell(TEXT_VEZAX_SLAIN_2, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VEZAX_SLAIN_2, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VEZAX_SLAIN_2, 0); } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index dae1892ed..1886cd068 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -259,7 +259,7 @@ public: events.ScheduleEvent(EVENT_SPELL_FLAME_JETS, 32000); events.ScheduleEvent(EVENT_GRAB, 25000); - me->MonsterYell(TEXT_AGGRO, LANG_UNIVERSAL, 0); + me->Yell(TEXT_AGGRO, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_AGGRO); DoZoneInCombat(); @@ -299,19 +299,19 @@ public: { if( rand() % 2 ) { - me->MonsterYell(TEXT_SLAY_1, LANG_UNIVERSAL, 0); + me->Yell(TEXT_SLAY_1, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY_1); } else { - me->MonsterYell(TEXT_SLAY_2, LANG_UNIVERSAL, 0); + me->Yell(TEXT_SLAY_2, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY_2); } } void JustDied(Unit* /*victim*/) override { - me->MonsterYell(TEXT_DEATH, LANG_UNIVERSAL, 0); + me->Yell(TEXT_DEATH, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_DEATH); if( me->GetInstanceScript() ) @@ -359,7 +359,7 @@ public: me->CastCustomSpell(SPELL_ACTIVATE_CONSTRUCT, SPELLVALUE_MAX_TARGETS, 1, (Unit*)nullptr, false); if (++counter >= 20) { - me->MonsterYell(TEXT_BERSERK, LANG_UNIVERSAL, 0); + me->Yell(TEXT_BERSERK, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_BERSERK); me->CastSpell(me, SPELL_BERSERK, true); break; @@ -369,12 +369,12 @@ public: case EVENT_SPELL_SCORCH: if( rand() % 2 ) { - me->MonsterYell(TEXT_SCORCH_1, LANG_UNIVERSAL, 0); + me->Yell(TEXT_SCORCH_1, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SCORCH_1); } else { - me->MonsterYell(TEXT_SCORCH_2, LANG_UNIVERSAL, 0); + me->Yell(TEXT_SCORCH_2, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SCORCH_2); } me->SetControlled(true, UNIT_STATE_ROOT); @@ -389,7 +389,7 @@ public: me->DisableRotate(false); break; case EVENT_SPELL_FLAME_JETS: - me->MonsterTextEmote(TEXT_FLAME_JETS, 0, true); + me->TextEmote(TEXT_FLAME_JETS, nullptr, true); me->CastSpell(me->GetVictim(), S_FLAME_JETS, false); events.RepeatEvent(25000); break; @@ -428,7 +428,7 @@ public: int8 pos = urand(0, playerGUIDs.size() - 1); if( Player* pTarget = ObjectAccessor::GetPlayer(*me, playerGUIDs.at(pos)) ) { - me->MonsterYell(TEXT_SLAG_POT, LANG_UNIVERSAL, 0); + me->Yell(TEXT_SLAG_POT, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAG_POT); me->CastSpell(pTarget, SPELL_GRAB, false); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 6a17305ef..9e2e8936f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -381,7 +381,7 @@ public: if (!hardmode) { - me->MonsterYell(TEXT_LMK2_ACTIVATE, LANG_UNIVERSAL, 0); + me->Yell(TEXT_LMK2_ACTIVATE, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_TANK_ACTIVE); events.ScheduleEvent(EVENT_SIT_LMK2, 6000); events.ScheduleEvent(EVENT_BERSERK, 900000); @@ -447,7 +447,7 @@ public: computer->AI()->Talk(minutesTalkNum++); break; case EVENT_MIMIRON_SAY_HARDMODE: - me->MonsterYell(TEXT_HARDMODE, LANG_UNIVERSAL, 0); + me->Yell(TEXT_HARDMODE, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_TANK_HARD_INTRO); events.ScheduleEvent(EVENT_SPAWN_FLAMES_INITIAL, 0); events.ScheduleEvent(EVENT_SIT_LMK2, 4000); @@ -484,7 +484,7 @@ public: break; case EVENT_BERSERK: berserk = true; - me->MonsterYell(TEXT_BERSERK, LANG_UNIVERSAL, 0); + me->Yell(TEXT_BERSERK, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_BERSERK); if( hardmode ) me->SummonCreature(33576, 2744.78f, 2569.47f, 364.32f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 120000); @@ -532,7 +532,7 @@ public: if (Creature* LMK2 = GetLMK2()) { me->EnterVehicle(LMK2, 1); - me->MonsterYell(TEXT_LMK2_DEATH, LANG_UNIVERSAL, 0); + me->Yell(TEXT_LMK2_DEATH, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_TANK_DEATH); LMK2->SetFacingTo(3.58f); events.ScheduleEvent(EVENT_ELEVATOR_INTERVAL_0, 6000); @@ -573,7 +573,7 @@ public: EnterEvadeMode(); break; case EVENT_SITTING_ON_VX001: - me->MonsterYell(TEXT_VX001_ACTIVATE, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VX001_ACTIVATE, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_TORSO_ACTIVE); events.ScheduleEvent(EVENT_ENTER_VX001, 5000); break; @@ -631,7 +631,7 @@ public: break; case EVENT_SAY_VX001_DEAD: changeAllowedFlameSpreadTime = true; - me->MonsterYell(TEXT_VX001_DEATH, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VX001_DEATH, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_TORSO_DEATH); events.ScheduleEvent(EVENT_ENTER_ACU, 7000); break; @@ -645,7 +645,7 @@ public: EnterEvadeMode(); break; case EVENT_SAY_ACU_ACTIVATE: - me->MonsterYell(TEXT_ACU_ACTIVATE, LANG_UNIVERSAL, 0); + me->Yell(TEXT_ACU_ACTIVATE, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_HEAD_ACTIVE); events.ScheduleEvent(EVENT_ACU_START_ATTACK, 4000); break; @@ -661,7 +661,7 @@ public: EnterEvadeMode(); break; case EVENT_SAY_ACU_DEAD: - me->MonsterYell(TEXT_ACU_DEATH, LANG_UNIVERSAL, 0); + me->Yell(TEXT_ACU_DEATH, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_HEAD_DEATH); events.ScheduleEvent(EVENT_LEVIATHAN_COME_CLOSER, 5000); break; @@ -720,7 +720,7 @@ public: ACU->SetDisableGravity(false); ACU->EnterVehicle(VX001, 3); me->EnterVehicle(VX001, 1); - me->MonsterYell(TEXT_VOLTRON_ACTIVATE, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VOLTRON_ACTIVATE, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VOLTRON_ACTIVE); events.ScheduleEvent(EVENT_START_PHASE4, 10000); } @@ -815,7 +815,7 @@ public: } break; case EVENT_SAY_VOLTRON_DEAD: - me->MonsterYell(TEXT_VOLTRON_DEATH, LANG_UNIVERSAL, 0); + me->Yell(TEXT_VOLTRON_DEATH, LANG_UNIVERSAL); me->PlayDirectSound(SOUND_VOLTRON_DEATH); // spawn chest if( uint32 chestId = (hardmode ? RAID_MODE(GO_MIMIRON_CHEST_HARD, GO_MIMIRON_CHEST_HERO_HARD) : RAID_MODE(GO_MIMIRON_CHEST, GO_MIMIRON_CHEST_HERO)) ) @@ -1163,7 +1163,7 @@ public: case EVENT_SPELL_PLASMA_BLAST: if (Unit* victim = me->GetVictim()) { - me->MonsterTextEmote("Leviathan Mk II begins to cast Plasma Blast!", 0, true); + me->TextEmote("Leviathan Mk II begins to cast Plasma Blast!", nullptr, true); cannon->CastSpell(victim, SPELL_PLASMA_BLAST, false); } events.RepeatEvent(22000); @@ -1196,12 +1196,12 @@ public: { if( rand() % 2 ) { - c->MonsterYell(TEXT_LMK2_SLAIN_1, LANG_UNIVERSAL, 0); + c->Yell(TEXT_LMK2_SLAIN_1, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_TANK_SLAY_1); } else { - c->MonsterYell(TEXT_LMK2_SLAIN_2, LANG_UNIVERSAL, 0); + c->Yell(TEXT_LMK2_SLAIN_2, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_TANK_SLAY_2); } } @@ -1209,12 +1209,12 @@ public: { if( rand() % 2 ) { - c->MonsterYell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL, 0); + c->Yell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_VOLTRON_SLAY_1); } else { - c->MonsterYell(TEXT_VOLTRON_SLAIN_2, LANG_UNIVERSAL, 0); + c->Yell(TEXT_VOLTRON_SLAIN_2, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_VOLTRON_SLAY_2); } } @@ -1551,12 +1551,12 @@ public: { if( rand() % 2 ) { - c->MonsterYell(TEXT_VX001_SLAIN_1, LANG_UNIVERSAL, 0); + c->Yell(TEXT_VX001_SLAIN_1, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_TORSO_SLAY_1); } else { - c->MonsterYell(TEXT_VX001_SLAIN_2, LANG_UNIVERSAL, 0); + c->Yell(TEXT_VX001_SLAIN_2, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_TORSO_SLAY_2); } } @@ -1564,12 +1564,12 @@ public: { if( rand() % 2 ) { - c->MonsterYell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL, 0); + c->Yell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_VOLTRON_SLAY_1); } else { - c->MonsterYell(TEXT_VOLTRON_SLAIN_2, LANG_UNIVERSAL, 0); + c->Yell(TEXT_VOLTRON_SLAIN_2, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_VOLTRON_SLAY_2); } } @@ -1874,12 +1874,12 @@ public: { if( rand() % 2 ) { - c->MonsterYell(TEXT_ACU_SLAIN_1, LANG_UNIVERSAL, 0); + c->Yell(TEXT_ACU_SLAIN_1, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_HEAD_SLAY_1); } else { - c->MonsterYell(TEXT_ACU_SLAIN_2, LANG_UNIVERSAL, 0); + c->Yell(TEXT_ACU_SLAIN_2, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_HEAD_SLAY_2); } } @@ -1887,12 +1887,12 @@ public: { if( rand() % 2 ) { - c->MonsterYell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL, 0); + c->Yell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_VOLTRON_SLAY_1); } else { - c->MonsterYell(TEXT_VOLTRON_SLAIN_2, LANG_UNIVERSAL, 0); + c->Yell(TEXT_VOLTRON_SLAIN_2, LANG_UNIVERSAL); c->PlayDirectSound(SOUND_VOLTRON_SLAY_2); } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 35f0f624d..4d9043225 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -195,7 +195,7 @@ public: break; ExpeditionEngineerGUIDs[i] = (*itr)->GetGUID(); if (!i) - (*itr)->MonsterYell(TEXT_EE_AGGRO, LANG_UNIVERSAL, 0); + (*itr)->Yell(TEXT_EE_AGGRO, LANG_UNIVERSAL); ++i; } if (Creature* c = me->FindNearestCreature(NPC_EXPEDITION_COMMANDER, 300.0f, true)) @@ -360,7 +360,7 @@ public: if (Creature* c = ObjectAccessor::GetCreature(*me, ExpeditionEngineerGUIDs[i])) { if (!i) - c->MonsterYell(TEXT_EE_MOVE_OUT, LANG_UNIVERSAL, 0); + c->Yell(TEXT_EE_MOVE_OUT, LANG_UNIVERSAL); c->AI()->SetData(1, 0); // start repairing } break; @@ -454,7 +454,7 @@ public: } break; case EVENT_WARN_DEEP_BREATH: - me->MonsterTextEmote(TEXT_DEEP_BREATH, 0, true); + me->TextEmote(TEXT_DEEP_BREATH, nullptr, true); me->RemoveAura(62794); events.ScheduleEvent(EVENT_PHASE2_FLAME_BREATH, 2500); break; @@ -527,7 +527,7 @@ public: if (Creature* c = ObjectAccessor::GetCreature(*me, ExpeditionEngineerGUIDs[i])) { if (!i) - c->MonsterYell(TEXT_EE_FIRES_OUT, LANG_UNIVERSAL, 0); + c->Yell(TEXT_EE_FIRES_OUT, LANG_UNIVERSAL); c->AI()->SetData(1, 0); // start repairing } break; @@ -758,7 +758,7 @@ public: if( GameObject* wh = me->SummonGameObject(GetHarpoonGunIdForThisHFS(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 3 * M_PI / 2, 0.0f, 0.0f, 0.0f, 0.0f, 0) ) { me->RemoveGameObject(wh, false); - me->MonsterTextEmote(TEXT_TURRET_READY, 0, true); + me->TextEmote(TEXT_TURRET_READY, nullptr, true); } } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index c8df35db4..fd1db86e0 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -505,12 +505,12 @@ public: if (urand(0, 1)) { - me->MonsterYell("Can't you at least put up a fight!?", LANG_UNIVERSAL, 0); + me->Yell("Can't you at least put up a fight!?", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY1); } else { - me->MonsterYell("Pathetic!", LANG_UNIVERSAL, 0); + me->Yell("Pathetic!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SLAY2); } } @@ -544,7 +544,7 @@ public: me->GetMotionMaster()->MoveJump(Middle.GetPositionX(), Middle.GetPositionY(), Middle.GetPositionZ(), 20, 20); me->RemoveAura(SPELL_SHEATH_OF_LIGHTNING); - me->MonsterYell("Impertinent whelps! You dare challenge me atop my pedestal! I will crush you myself!", LANG_UNIVERSAL, 0); + me->Yell("Impertinent whelps! You dare challenge me atop my pedestal! I will crush you myself!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_JUMPDOWN); // Hard Mode @@ -577,7 +577,7 @@ public: events.Reset(); DisableThorim(true); - me->MonsterYell("Stay your arms! I yield!", LANG_UNIVERSAL, 0); + me->Yell("Stay your arms! I yield!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_DEFEATED); events.SetPhase(EVENT_PHASE_OUTRO); @@ -647,15 +647,15 @@ public: switch (urand(0, 2)) { case 0: - me->MonsterYell("Behold the power of the storms and despair!", LANG_UNIVERSAL, 0); + me->Yell("Behold the power of the storms and despair!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SPECIAL1); break; case 1: - me->MonsterYell("Do not hold back! Destroy them!", LANG_UNIVERSAL, 0); + me->Yell("Do not hold back! Destroy them!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SPECIAL2); break; case 2: - me->MonsterYell("Have you begun to regret your intrusion? ", LANG_UNIVERSAL, 0); + me->Yell("Have you begun to regret your intrusion? ", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SPECIAL3); break; } @@ -683,7 +683,7 @@ public: switch (events.ExecuteEvent()) { case EVENT_THORIM_AGGRO: - me->MonsterYell("Interlopers! You mortals who dare to interfere with my sport will pay... Wait--you...", LANG_UNIVERSAL, 0); + me->Yell("Interlopers! You mortals who dare to interfere with my sport will pay... Wait--you...", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_AGGRO1); events.ScheduleEvent(EVENT_THORIM_AGGRO2, 9000); @@ -693,7 +693,7 @@ public: break; case EVENT_THORIM_AGGRO2: { - me->MonsterYell("I remember you... In the mountains... But you... what is this? Where am--", LANG_UNIVERSAL, 0); + me->Yell("I remember you... In the mountains... But you... what is this? Where am--", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_AGGRO2); EntryCheckPredicate pred(NPC_SIF); @@ -732,7 +732,7 @@ public: } // No players found - me->MonsterYell("Failures! Weaklings!", LANG_UNIVERSAL, 0); + me->Yell("Failures! Weaklings!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_AWIPE); me->SummonCreature(NPC_LIGHTNING_ORB, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); @@ -765,13 +765,13 @@ public: break; case EVENT_THORIM_BERSERK: me->CastSpell(me, SPELL_BERSERK, true); - me->MonsterYell("My patience has reached its limit!", LANG_UNIVERSAL, 0); + me->Yell("My patience has reached its limit!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_BERSERK); break; case EVENT_THORIM_OUTRO1: if (_hardMode) { - me->MonsterYell("You! Fiend! You are not my beloved! Be gone!", LANG_UNIVERSAL, 0); + me->Yell("You! Fiend! You are not my beloved! Be gone!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_HARD1); events.ScheduleEvent(EVENT_THORIM_OUTRO2, 5000, 0, 3); EntryCheckPredicate pred(NPC_SIF); @@ -779,7 +779,7 @@ public: } else { - me->MonsterYell("I feel as though I am awakening from a nightmare, but the shadows in this place yet linger.", LANG_UNIVERSAL, 0); + me->Yell("I feel as though I am awakening from a nightmare, but the shadows in this place yet linger.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_NORM1); events.ScheduleEvent(EVENT_THORIM_OUTRO2, 9000, 0, 3); } @@ -787,13 +787,13 @@ public: case EVENT_THORIM_OUTRO2: if (_hardMode) { - me->MonsterYell("Behold the hand behind all the evil that has befallen Ulduar! Left my kingdom in ruins, corrupted my brother and slain my wife!", LANG_UNIVERSAL, 0); + me->Yell("Behold the hand behind all the evil that has befallen Ulduar! Left my kingdom in ruins, corrupted my brother and slain my wife!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_HARD2); events.ScheduleEvent(EVENT_THORIM_OUTRO3, 12000, 0, 3); } else { - me->MonsterYell("Sif... was Sif here? Impossible--she died by my brother's hand. A dark nightmare indeed....", LANG_UNIVERSAL, 0); + me->Yell("Sif... was Sif here? Impossible--she died by my brother's hand. A dark nightmare indeed....", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_NORM2); events.ScheduleEvent(EVENT_THORIM_OUTRO3, 10000, 0, 3); } @@ -801,12 +801,12 @@ public: case EVENT_THORIM_OUTRO3: if (_hardMode) { - me->MonsterYell("And now it falls to you, champions, to avenge us all! The task before you is great, but I will lend you my aid as I am able. You must prevail!", LANG_UNIVERSAL, 0); + me->Yell("And now it falls to you, champions, to avenge us all! The task before you is great, but I will lend you my aid as I am able. You must prevail!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_HARD3); } else { - me->MonsterYell("I need time to reflect.... I will aid your cause if you should require it. I owe you at least that much. Farewell.", LANG_UNIVERSAL, 0); + me->Yell("I need time to reflect.... I will aid your cause if you should require it. I owe you at least that much. Farewell.", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_NORM3); } @@ -889,16 +889,16 @@ public: { case EVENT_SIF_FINISH_DOMINION: me->PlayDirectSound(SOUND_SIF_DESPAWN); - me->MonsterYell("This pathetic morons are harmless. Relive my station, dispose of them!", LANG_UNIVERSAL, 0); + me->Yell("This pathetic morons are harmless. Relive my station, dispose of them!", LANG_UNIVERSAL); me->DespawnOrUnsummon(5000); break; case EVENT_SIF_START_TALK: - me->MonsterYell("Thorim, my lord, why else would these invaders have come into your sanctum but to slay you? They must be stopped!", LANG_UNIVERSAL, 0); + me->Yell("Thorim, my lord, why else would these invaders have come into your sanctum but to slay you? They must be stopped!", LANG_UNIVERSAL); me->PlayDirectSound(SOUND_SIF_START); break; case EVENT_SIF_JOIN_TALK: me->PlayDirectSound(SOUND_SIF_EVENT); - me->MonsterYell("Impossible! Lord Thorim, I will bring your foes a frigid death!", LANG_UNIVERSAL, 0); + me->Yell("Impossible! Lord Thorim, I will bring your foes a frigid death!", LANG_UNIVERSAL); events.ScheduleEvent(EVENT_SIF_FROST_NOVA_START, 1000); events.ScheduleEvent(EVENT_SIF_FROSTBOLT_VALLEY, 11000); events.ScheduleEvent(EVENT_SIF_BLIZZARD, 15000); @@ -1491,7 +1491,7 @@ public: break; case EVENT_RC_RUNIC_BARRIER: me->CastSpell(me, SPELL_RUNIC_BARRIER, false); - me->MonsterTextEmote("Runic Colossus surrounds itself with a crackling Runic Barrier!", 0, true); + me->TextEmote("Runic Colossus surrounds itself with a crackling Runic Barrier!", nullptr, true); events.RepeatEvent(20000); break; case EVENT_RC_SMASH: @@ -1541,7 +1541,7 @@ public: events.ScheduleEvent(EVENT_ARG_STOMP, 8000); me->CastSpell(me, SPELL_RUNIC_FORTIFICATION, false); - me->MonsterTextEmote("Ancient Rune Giant fortifies nearby allies with runic might", 0, true); + me->TextEmote("Ancient Rune Giant fortifies nearby allies with runic might", nullptr, true); } void JustDied(Unit*) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 45072f84d..664179176 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -203,7 +203,7 @@ public: RescheduleEvents(); // Other events are scheduled here me->setActive(true); - me->MonsterYell("New toys? For me? I promise I won't break them this time!", LANG_UNIVERSAL, 0); + me->Yell("New toys? For me? I promise I won't break them this time!", LANG_UNIVERSAL); me->PlayDirectSound(XT_SOUND_AGGRO); if (m_pInstance) @@ -225,12 +225,12 @@ public: { if (urand(0, 1)) { - me->MonsterYell("I... I think I broke it.", LANG_UNIVERSAL, 0); + me->Yell("I... I think I broke it.", LANG_UNIVERSAL); me->PlayDirectSound(XT_SOUND_SLAY1); } else { - me->MonsterYell("I guess it doesn't bend that way.", LANG_UNIVERSAL, 0); + me->Yell("I guess it doesn't bend that way.", LANG_UNIVERSAL); me->PlayDirectSound(XT_SOUND_SLAY2); } } @@ -238,7 +238,7 @@ public: void JustDied(Unit* /*victim*/) override { - me->MonsterYell("You are bad... Toys... Very... Baaaaad!", LANG_UNIVERSAL, 0); + me->Yell("You are bad... Toys... Very... Baaaaad!", LANG_UNIVERSAL); me->PlayDirectSound(XT_SOUND_DEATH); if (m_pInstance) @@ -279,7 +279,7 @@ public: me->CastSpell(me, SPELL_HEARTBREAK, true); - me->MonsterTextEmote("XT-002 Deconstructor's heart is severed from his body.", 0, true); + me->TextEmote("XT-002 Deconstructor's heart is severed from his body.", nullptr, true); events.ScheduleEvent(EVENT_REMOVE_EMOTE, 4000); return; } @@ -329,7 +329,7 @@ public: me->SetControlled(true, UNIT_STATE_STUNNED); me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_SUBMERGED); // submerge with animation - me->MonsterYell("So tired. I will rest for just a moment!", LANG_UNIVERSAL, 0); + me->Yell("So tired. I will rest for just a moment!", LANG_UNIVERSAL); me->PlayDirectSound(XT_SOUND_HEART_OPEN); events.CancelEventGroup(1); @@ -355,21 +355,21 @@ public: events.ScheduleEvent(EVENT_GRAVITY_BOMB, 10000, 1); break; case EVENT_TYMPANIC_TANTARUM: - me->MonsterTextEmote("XT-002 Deconstructor begins to cause the earth to quake.", 0, true); - me->MonsterYell("NO! NO! NO! NO! NO!", LANG_UNIVERSAL, 0); + me->TextEmote("XT-002 Deconstructor begins to cause the earth to quake.", nullptr, true); + me->Yell("NO! NO! NO! NO! NO!", LANG_UNIVERSAL); me->PlayDirectSound(XT_SOUND_TANTARUM); me->CastSpell(me, SPELL_TYMPANIC_TANTARUM, true); events.RepeatEvent(60000); return; case EVENT_ENRAGE: - me->MonsterYell("I'm tired of these toys. I don't want to play anymore!", LANG_UNIVERSAL, 0); + me->Yell("I'm tired of these toys. I don't want to play anymore!", LANG_UNIVERSAL); me->PlayDirectSound(XT_SOUND_ENRAGE); me->CastSpell(me, SPELL_XT002_ENRAGE, true); break; // Animation events case EVENT_START_SECOND_PHASE: - me->MonsterTextEmote("XT-002 Deconstructor's heart is exposed and leaking energy.", 0, true); + me->TextEmote("XT-002 Deconstructor's heart is exposed and leaking energy.", nullptr, true); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr) heart->GetAI()->DoAction(ACTION_AWAKEN_HEART); @@ -383,7 +383,7 @@ public: return; } - me->MonsterYell("I'm ready to play!", LANG_UNIVERSAL, 0); + me->Yell("I'm ready to play!", LANG_UNIVERSAL); me->PlayDirectSound(XT_SOUND_HEART_CLOSED); me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_STAND); // emerge @@ -619,7 +619,7 @@ public: } if (!urand(0, 2)) - me->MonsterTextEmote("XT-002 Deconstructor consumes scrap bot to repair himself.", 0, true); + me->TextEmote("XT-002 Deconstructor consumes scrap bot to repair himself.", nullptr, true); me->DespawnOrUnsummon(1); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 0c1cc248c..7818fd63d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -484,7 +484,7 @@ public: events.ScheduleEvent(EVENT_SARA_P1_SUMMON, 0, 0, EVENT_PHASE_ONE); events.SetPhase(EVENT_PHASE_ONE); - me->MonsterYell("The time to strike at the head of the beast will soon be upon us! Focus your anger and hatred on his minions!", LANG_UNIVERSAL, 0); + me->Yell("The time to strike at the head of the beast will soon be upon us! Focus your anger and hatred on his minions!", LANG_UNIVERSAL); me->PlayDirectSound(SARA_AGGRO); me->setActive(true); } @@ -584,12 +584,12 @@ public: if (urand(0, 1)) { - me->MonsterYell(_secondPhase ? "Tremble, mortals, before the coming of the end!" : "Yes! YES! Show them no mercy! Give no pause to your attacks!", LANG_UNIVERSAL, 0); + me->Yell(_secondPhase ? "Tremble, mortals, before the coming of the end!" : "Yes! YES! Show them no mercy! Give no pause to your attacks!", LANG_UNIVERSAL); me->PlayDirectSound(_secondPhase ? SARA_P2_CAST2 : SARA_P1_CAST1); } else { - me->MonsterYell(_secondPhase ? "Suffocate upon your own hate!" : "Let hatred and rage guide your blows!", LANG_UNIVERSAL, 0); + me->Yell(_secondPhase ? "Suffocate upon your own hate!" : "Let hatred and rage guide your blows!", LANG_UNIVERSAL); me->PlayDirectSound(_secondPhase ? SARA_P2_CAST1 : SARA_P1_CAST2); } } @@ -601,12 +601,12 @@ public: if (urand(0, 1)) { - me->MonsterYell("Could they have been saved?", LANG_UNIVERSAL, 0); + me->Yell("Could they have been saved?", LANG_UNIVERSAL); me->PlayDirectSound(SARA_P1_KILL2); } else { - me->MonsterYell("Powerless to act...", LANG_UNIVERSAL, 0); + me->Yell("Powerless to act...", LANG_UNIVERSAL); me->PlayDirectSound(SARA_P1_KILL1); } } @@ -706,7 +706,7 @@ public: cr->SetVisible(false); _p2TalkTimer++; - me->MonsterYell("I am the lucid dream.", LANG_UNIVERSAL, 0); + me->Yell("I am the lucid dream.", LANG_UNIVERSAL); me->PlayDirectSound(SARA_P2_START); } return; @@ -747,18 +747,18 @@ public: { EntryCheckPredicate pred(NPC_OMINOUS_CLOUD); summons.DoAction(ACTION_UNSUMMON_CLOUDS, pred); - me->MonsterYell("The monster in your nightmares.", LANG_UNIVERSAL, 0); + me->Yell("The monster in your nightmares.", LANG_UNIVERSAL); _p2TalkTimer = 20000; } else if (_p2TalkTimer >= 25000 && _p2TalkTimer < 40000) { summons.DespawnEntry(NPC_OMINOUS_CLOUD); - me->MonsterYell("The fiend of a thousand faces.", LANG_UNIVERSAL, 0); + me->Yell("The fiend of a thousand faces.", LANG_UNIVERSAL); _p2TalkTimer = 40000; } else if (_p2TalkTimer >= 44500 && _p2TalkTimer < 60000) { - me->MonsterYell("Cower before my true form.", LANG_UNIVERSAL, 0); + me->Yell("Cower before my true form.", LANG_UNIVERSAL); _p2TalkTimer = 60000; } else if (_p2TalkTimer >= 64000) @@ -1079,7 +1079,7 @@ public: summons.DespawnAll(); events.Reset(); - me->MonsterYell("Your fate is sealed. The end of days is finally upon you and ALL who inhabit this miserable little seedling. Uulwi ifis halahs gag erh'ongg w'ssh.", LANG_UNIVERSAL, 0); + me->Yell("Your fate is sealed. The end of days is finally upon you and ALL who inhabit this miserable little seedling. Uulwi ifis halahs gag erh'ongg w'ssh.", LANG_UNIVERSAL); me->PlayDirectSound(YS_P3_DEATH); if (m_pInstance) @@ -1116,11 +1116,11 @@ public: } else if (param == ACTION_YOGG_SARON_START_YELL) { - me->MonsterYell("BOW DOWN BEFORE THE GOD OF DEATH!", LANG_UNIVERSAL, 0); + me->Yell("BOW DOWN BEFORE THE GOD OF DEATH!", LANG_UNIVERSAL); } else if (param == ACTION_YOGG_SARON_OPEN_PORTAL_YELL) { - me->MonsterYell("MADNESS WILL CONSUME YOU!", LANG_UNIVERSAL, 0); + me->Yell("MADNESS WILL CONSUME YOU!", LANG_UNIVERSAL); me->PlayDirectSound(YS_OPEN_PORTALS); } else if (param == ACTION_YOGG_SARON_START_P3) @@ -1135,7 +1135,7 @@ public: events.ScheduleEvent(EVENT_YS_SUMMON_GUARDIAN, 0); _thirdPhase = true; - me->MonsterYell("Look upon the true face of death and know that your end comes soon!", LANG_UNIVERSAL, 0); + me->Yell("Look upon the true face of death and know that your end comes soon!", LANG_UNIVERSAL); me->PlayDirectSound(YS_P3_START); } else if (param == ACTION_YOGG_SARON_HARD_MODE) @@ -1181,14 +1181,14 @@ public: switch (events.ExecuteEvent()) { case EVENT_YS_LUNATIC_GAZE: - me->MonsterYell("Hoohehehahahaha... AHAHAHAHAHAHA!", LANG_UNIVERSAL, 0); + me->Yell("Hoohehehahahaha... AHAHAHAHAHAHA!", LANG_UNIVERSAL); me->PlayDirectSound(YS_P3_LUNATIC_GAZE); me->CastSpell(me, SPELL_LUNATIC_GAZE_YS, true); events.RepeatEvent(12000); break; case EVENT_YS_DEAFENING_ROAR: - me->MonsterTextEmote("Yogg-Saron opens his mouth wide!", 0, true); - me->MonsterYell("Eternal suffering awaits!", LANG_UNIVERSAL, 0); + me->TextEmote("Yogg-Saron opens his mouth wide!", nullptr, true); + me->Yell("Eternal suffering awaits!", LANG_UNIVERSAL); me->PlayDirectSound(YS_P3_DEAFENING_ROAR); me->CastSpell(me, SPELL_DEAFENING_ROAR, false); events.RepeatEvent(50000); @@ -2274,7 +2274,7 @@ public: if (Player* player = ObjectAccessor::GetPlayer(*me, _guid)) { me->PlayDirectSound(15760, player); - me->MonsterWhisper("Destroy them minion, your master commands it!", player, false); + me->Whisper("Destroy them minion, your master commands it!", LANG_UNIVERSAL, player); } break; } @@ -2680,7 +2680,7 @@ public: Unit* caster = GetCaster(); caster->PlayDirectSound(VOYS_INSANE1, target); - caster->MonsterWhisper("Your will is no longer you own...", target, false); + caster->Whisper("Your will is no longer you own...", LANG_UNIVERSAL, target); caster->CastSpell(target, SPELL_INSANE1, true); target->CastSpell(target, SPELL_INSANE2, true); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 82baf907c..25d477d70 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -795,7 +795,7 @@ public: case DATA_BRANN_MEMOTESAY: if (Creature* cr = instance->GetCreature(m_brannBronzebeardBaseCamp)) { - cr->MonsterTextEmote("Go to your vehicles!", 0, true); + cr->TextEmote("Go to your vehicles!", nullptr, true); } break; case DATA_BRANN_EASY_MODE: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp index 38ae5205b..3a0a23b10 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp @@ -42,22 +42,22 @@ public: switch (creature->GetEntry()) { case NPC_FREYA_GOSSIP: - creature->MonsterYell("Eonar, your servant calls for your blessing!", LANG_UNIVERSAL, 0); + creature->Yell("Eonar, your servant calls for your blessing!", LANG_UNIVERSAL); creature->PlayDirectSound(15535); _keeper = KEEPER_FREYA; break; case NPC_HODIR_GOSSIP: - creature->MonsterYell("The veil of winter will protect you, champions!", LANG_UNIVERSAL, 0); + creature->Yell("The veil of winter will protect you, champions!", LANG_UNIVERSAL); creature->PlayDirectSound(15559); _keeper = KEEPER_HODIR; break; case NPC_MIMIRON_GOSSIP: - creature->MonsterYell("Combat matrix enhanced. Behold wonderous rapidity!", LANG_UNIVERSAL, 0); + creature->Yell("Combat matrix enhanced. Behold wonderous rapidity!", LANG_UNIVERSAL); creature->PlayDirectSound(15630); _keeper = KEEPER_MIMIRON; break; case NPC_THORIM_GOSSIP: - creature->MonsterYell("Golganneth, lend me your strengh! Grant my mortal allies the power of thunder!", LANG_UNIVERSAL, 0); + creature->Yell("Golganneth, lend me your strengh! Grant my mortal allies the power of thunder!", LANG_UNIVERSAL); creature->PlayDirectSound(15750); _keeper = KEEPER_THORIM; break; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 47b9a89cb..8b0ed208c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -320,7 +320,7 @@ public: void JustDied(Unit* /*pKiller*/) override { - me->SendPlaySound(SOUND_DEATH, false); + me->PlayDirectSound(SOUND_DEATH); if(m_pInstance) m_pInstance->SetData(DATA_GORTOK_PALEHOOF, DONE); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index db9b94550..578e10182 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -365,7 +365,7 @@ public: if (m_pInstance) m_pInstance->SetData(SKADI_IN_RANGE, 1); - me->MonsterTextEmote(EMOTE_IN_RANGE, 0, true); + me->TextEmote(EMOTE_IN_RANGE, nullptr, true); me->SetFacingTo(M_PI); break; } diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index f0210a498..6fbd488c6 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -153,7 +153,7 @@ class boss_archavon : public CreatureScript { char buffer[100]; sprintf(buffer, "Archavon the Stone Watcher lunges for %s!", me->GetVictim()->GetName().c_str()); - me->MonsterTextEmote(buffer, 0); + me->TextEmote(buffer); DoCastVictim(RAID_MODE(SPELL_STOMP_10, SPELL_STOMP_25)); diff --git a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp index ec57fd61a..9010eab91 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp @@ -81,7 +81,7 @@ public: if (!PlayerList.isEmpty()) for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player* player = i->GetSource()) - player->MonsterTextEmote("This instance will reset in 15 minutes.", 0, true); + player->TextEmote("This instance will reset in 15 minutes.", nullptr, true); } else if (bf->GetTimer() <= (10 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() >= (9 * MINUTE * IN_MILLISECONDS)) { @@ -105,7 +105,7 @@ public: if (!PlayerList.isEmpty()) for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player* player = i->GetSource()) - player->MonsterTextEmote("This instance is about to reset. Prepare to be removed.", 0, true); + player->TextEmote("This instance is about to reset. Prepare to be removed.", nullptr, true); } else if (bf->GetTimer() <= MINUTE * IN_MILLISECONDS) { diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index a186f8c76..ad4a0efe3 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -116,7 +116,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true)) { me->CastSpell(target, SPELL_VOID_SHIFT, false); - me->MonsterWhisper("Gaze... into the void.", target->ToPlayer(), false); + me->Whisper("Gaze... into the void.", LANG_UNIVERSAL, target->ToPlayer()); } events.RepeatEvent(urand(18000, 22000)); break; diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 86b09eca9..80aa515b1 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -104,9 +104,9 @@ public: } if (yell) - c->MonsterYell(text.c_str(), LANG_UNIVERSAL, player); + c->Yell(text.c_str(), LANG_UNIVERSAL, player); else - c->MonsterWhisper(text.c_str(), player, false); + c->Whisper(text.c_str(), LANG_UNIVERSAL, player); } void DespawnOachanoa() @@ -359,12 +359,12 @@ public: { case EVENT_START_EVENT: if (Creature* cr = getFuture()) - cr->MonsterWhisper(IsFuture() ? "Hey there, $N, don't be alarmed. It's me... you... from the future. I'm here to help." : "Whoa! You're me, but from the future! Hey, my equipment got an upgrade! Cool!", getSummoner()); + cr->Whisper(IsFuture() ? "Hey there, $N, don't be alarmed. It's me... you... from the future. I'm here to help." : "Whoa! You're me, but from the future! Hey, my equipment got an upgrade! Cool!", LANG_UNIVERSAL, getSummoner()); events.ScheduleEvent(EVENT_FIGHT_1, 7000); break; case EVENT_FIGHT_1: if (Creature* cr = getFuture()) - cr->MonsterWhisper(IsFuture() ? "Heads up... here they come. I'll help as much as I can. Let's just keep them off the hourglass!" : "Here come the Infinites! I've got to keep the hourglass safe. Can you help?", getSummoner()); + cr->Whisper(IsFuture() ? "Heads up... here they come. I'll help as much as I can. Let's just keep them off the hourglass!" : "Here come the Infinites! I've got to keep the hourglass safe. Can you help?", LANG_UNIVERSAL, getSummoner()); events.ScheduleEvent(EVENT_FIGHT_2, 6000); break; case EVENT_FIGHT_2: @@ -415,13 +415,13 @@ public: if (Player* player = getSummoner()) player->GroupEventHappens(IsFuture() ? QUEST_MYSTERY_OF_THE_INFINITE : QUEST_MYSTERY_OF_THE_INFINITE_REDUX, me); - me->MonsterWhisper(IsFuture() ? "Look, $N, the hourglass has revealed Nozdormu!" : "What the heck? Nozdormu is up there!", getSummoner()); + me->Whisper(IsFuture() ? "Look, $N, the hourglass has revealed Nozdormu!" : "What the heck? Nozdormu is up there!", LANG_UNIVERSAL, getSummoner()); events.ScheduleEvent(EVENT_FINISH_EVENT, 6000); break; } case EVENT_FINISH_EVENT: { - me->MonsterWhisper(IsFuture() ? "Farewell, $N. Keep us alive and get some better equipment!" : "I feel like I'm being pulled away through time. Thanks for the help....", getSummoner()); + me->Whisper(IsFuture() ? "Farewell, $N. Keep us alive and get some better equipment!" : "I feel like I'm being pulled away through time. Thanks for the help....", LANG_UNIVERSAL, getSummoner()); me->DespawnOrUnsummon(500); if (getFuture()) getFuture()->DespawnOrUnsummon(500); @@ -462,7 +462,7 @@ public: } if (Creature* cr = getFuture()) - cr->MonsterWhisper(text.c_str(), getSummoner()); + cr->Whisper(text, LANG_UNIVERSAL, getSummoner()); } }; }; diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 130da2bfa..4f9cd9b59 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -119,16 +119,16 @@ public: switch (newPhase) { case 1: - me->MonsterWhisper("You think that you can get rid of me through meditation?", summoner->ToPlayer()); + me->Whisper("You think that you can get rid of me through meditation?", LANG_UNIVERSAL, summoner->ToPlayer()); return; case 2: - me->MonsterWhisper("Fool! I will destroy you and finally become that which has been building inside of you all these years!", summoner->ToPlayer()); + me->Whisper("Fool! I will destroy you and finally become that which has been building inside of you all these years!", LANG_UNIVERSAL, summoner->ToPlayer()); return; case 3: - me->MonsterWhisper("You cannot defeat me. I'm an inseparable part of you!", summoner->ToPlayer()); + me->Whisper("You cannot defeat me. I'm an inseparable part of you!", LANG_UNIVERSAL, summoner->ToPlayer()); return; case 4: - me->MonsterWhisper("NOOOOOOOoooooooooo!", summoner->ToPlayer()); + me->Whisper("NOOOOOOOoooooooooo!", LANG_UNIVERSAL, summoner->ToPlayer()); me->SetLevel(summoner->getLevel()); me->setFaction(14); if (me->GetExactDist(summoner) < 50.0f) diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 4afdc0219..05211fb49 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -200,22 +200,22 @@ public: switch (quest) { case QUEST_BFV_FALLEN_HEROES: - me->MonsterYell("$N has defeated the fallen heroes of Valhalas battles past. This is only a beginning, but it will suffice.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("$N has defeated the fallen heroes of Valhalas battles past. This is only a beginning, but it will suffice.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_DARK_MASTER: - me->MonsterYell("Khit'rix the Dark Master has been defeated by $N and his band of companions. Let the next challenge be issued!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("Khit'rix the Dark Master has been defeated by $N and his band of companions. Let the next challenge be issued!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_SIGRID: - me->MonsterYell("$N has defeated Sigrid Iceborn for a second time. Well, this time he did it with the help of his friends, but a win is a win!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("$N has defeated Sigrid Iceborn for a second time. Well, this time he did it with the help of his friends, but a win is a win!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_CARNAGE: - me->MonsterYell("The horror known as Carnage is no more. Could it be that $N is truly worthy of battle in Valhalas? We shall see.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("The horror known as Carnage is no more. Could it be that $N is truly worthy of battle in Valhalas? We shall see.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_THANE: - me->MonsterYell("Thane Banahogg the Deathblow has fallen to $N and his fighting companions. He has but one challenge ahead of him. Who will it be?", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("Thane Banahogg the Deathblow has fallen to $N and his fighting companions. He has but one challenge ahead of him. Who will it be?", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_FINAL: - me->MonsterYell("The unthinkable has happened... $N has slain Prince Sandoval!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("The unthinkable has happened... $N has slain Prince Sandoval!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; } player->GroupEventHappens(quest, player); @@ -250,27 +250,27 @@ public: { case QUEST_BFV_FALLEN_HEROES: events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8000); - me->MonsterYell("$N and comrades in arms have chosen to accept honorable combat within the sacred confines of Valhalas.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("$N and comrades in arms have chosen to accept honorable combat within the sacred confines of Valhalas.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_DARK_MASTER: events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8000); - me->MonsterYell("$N has accepted the challenge of Khit'rix the Dark Master. May the gods show mercy upon him for Khit'rix surely will not.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("$N has accepted the challenge of Khit'rix the Dark Master. May the gods show mercy upon him for Khit'rix surely will not.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_SIGRID: PrepareSummons(); - me->MonsterTextEmote("Circling Valhalas, Sigrid Iceborn approaches to seek her revenge!", nullptr, true); + me->TextEmote("Circling Valhalas, Sigrid Iceborn approaches to seek her revenge!", nullptr, true); break; case QUEST_BFV_CARNAGE: events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8000); - me->MonsterYell("From the bowels of the Underhalls comes Carnage. Brave and foolish $N has accepted the challenge. $N and his group stand ready to face the monstrosity.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("From the bowels of the Underhalls comes Carnage. Brave and foolish $N has accepted the challenge. $N and his group stand ready to face the monstrosity.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_THANE: events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8000); - me->MonsterYell("Thane Banahogg returns to Valhalas for the first time in ages to prove that the vrykul are the only beings worthy to fight within its sacred ring. Will $N prove him wrong?", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("Thane Banahogg returns to Valhalas for the first time in ages to prove that the vrykul are the only beings worthy to fight within its sacred ring. Will $N prove him wrong?", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; case QUEST_BFV_FINAL: events.ScheduleEvent(EVENT_VALHALAS_SECOND, 8000); - me->MonsterYell("From the depths of Icecrown Citadel, one of the Lich King's chosen comes to put an end to the existence of $N and his friends.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("From the depths of Icecrown Citadel, one of the Lich King's chosen comes to put an end to the existence of $N and his friends.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); break; } @@ -283,21 +283,21 @@ public: switch (currentQuest) { case QUEST_BFV_FALLEN_HEROES: - me->MonsterYell("There can only be one outcome to such a battle: death for one side or the other. Let $n prove himself upon the bones of these outsiders who have fallen before!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); - me->MonsterTextEmote("The fallen heroes of Valhalas emerge from the ground to do battle once more!", nullptr, true); + me->Yell("There can only be one outcome to such a battle: death for one side or the other. Let $n prove himself upon the bones of these outsiders who have fallen before!", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->TextEmote("The fallen heroes of Valhalas emerge from the ground to do battle once more!", nullptr, true); break; case QUEST_BFV_DARK_MASTER: - me->MonsterTextEmote("Khit'rix the Dark Master skitters into Valhalas from the southeast!", nullptr, true); + me->TextEmote("Khit'rix the Dark Master skitters into Valhalas from the southeast!", nullptr, true); break; case QUEST_BFV_CARNAGE: - me->MonsterTextEmote("Lumbering in from the south, the smell of Carnage precedes him!", nullptr, true); + me->TextEmote("Lumbering in from the south, the smell of Carnage precedes him!", nullptr, true); break; case QUEST_BFV_THANE: - me->MonsterTextEmote("Thane Banahogg appears upon the overlook to the southeast!", nullptr, true); + me->TextEmote("Thane Banahogg appears upon the overlook to the southeast!", nullptr, true); break; case QUEST_BFV_FINAL: - me->MonsterYell("Warriors of Jotunheim, I present to you, Blood Prince Sandoval!", LANG_UNIVERSAL, nullptr); - me->MonsterTextEmote("Without warning, Prince Sandoval magically appears within Valhalas!", nullptr, true); + me->Yell("Warriors of Jotunheim, I present to you, Blood Prince Sandoval!", LANG_UNIVERSAL); + me->TextEmote("Without warning, Prince Sandoval magically appears within Valhalas!", nullptr, true); break; } @@ -306,13 +306,13 @@ public: } case EVENT_VALHALAS_THIRD: { - me->MonsterYell("In defeating him, he and his fighting companions have proven themselves worthy of battle in this most sacred place of vrykul honor.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); + me->Yell("In defeating him, he and his fighting companions have proven themselves worthy of battle in this most sacred place of vrykul honor.", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID)); events.ScheduleEvent(EVENT_VALHALAS_THIRD + 2, 7000); break; } case EVENT_VALHALAS_THIRD+2: { - me->MonsterYell("ALL HAIL $N, CHAMPION OF VALHALAS! ", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID2)); + me->Yell("ALL HAIL $N, CHAMPION OF VALHALAS! ", LANG_UNIVERSAL, ObjectAccessor::GetPlayer(*me, playerGUID2)); break; } case EVENT_VALHALAS_CHECK_PLAYER: @@ -347,22 +347,22 @@ public: switch (quest->GetQuestId()) { case QUEST_BFV_FALLEN_HEROES: - creature->MonsterSay("Valhalas is yours to win or die in, $N. But whatever you do, stay within the bounds of the arena. To flee is to lose and be dishonored.", LANG_UNIVERSAL, player); + creature->Say("Valhalas is yours to win or die in, $N. But whatever you do, stay within the bounds of the arena. To flee is to lose and be dishonored.", LANG_UNIVERSAL, player); break; case QUEST_BFV_DARK_MASTER: - creature->MonsterSay("Prepare yourself. Khit'rix will be entering Valhalas from the southeast. Remember, do not leave the ring or you will lose the battle.", LANG_UNIVERSAL, player); + creature->Say("Prepare yourself. Khit'rix will be entering Valhalas from the southeast. Remember, do not leave the ring or you will lose the battle.", LANG_UNIVERSAL, player); break; case QUEST_BFV_SIGRID: - creature->MonsterYell("Sigrid Iceborn has returned to the heights of Jotunheim to prove herself against $N. When last they met, $N bester her in personal combat. Let us see the outcome of this match.", LANG_UNIVERSAL, player); + creature->Yell("Sigrid Iceborn has returned to the heights of Jotunheim to prove herself against $N. When last they met, $N bester her in personal combat. Let us see the outcome of this match.", LANG_UNIVERSAL, player); break; case QUEST_BFV_CARNAGE: - creature->MonsterSay("Carnage is coming! Remember, no matter what you do, do NOT leave the battle ring or I will disqualify you and your group.", LANG_UNIVERSAL, 0); + creature->Say("Carnage is coming! Remember, no matter what you do, do NOT leave the battle ring or I will disqualify you and your group.", LANG_UNIVERSAL); break; case QUEST_BFV_THANE: - creature->MonsterSay("Look to the southeast and you will see the thane upon the platform near Gjonner the Merciless when he shows himself. Let him come down. Stay within the ring of Valhalas.", LANG_UNIVERSAL, 0); + creature->Say("Look to the southeast and you will see the thane upon the platform near Gjonner the Merciless when he shows himself. Let him come down. Stay within the ring of Valhalas.", LANG_UNIVERSAL); break; case QUEST_BFV_FINAL: - creature->MonsterSay("It's too late to run now. Do not leave the ring. Die bravely, $N!", LANG_UNIVERSAL, 0); + creature->Say("It's too late to run now. Do not leave the ring. Die bravely, $N!", LANG_UNIVERSAL); break; } @@ -1323,7 +1323,7 @@ public: if (Unit* passenger = kit->GetPassenger(SEAT_ENGINEERING)) if (init && !passenger->HasAura(SPELL_BURNING)) { - me->MonsterTextEmote("Your Vehicle is burning!", GetSummoner(), true); + me->TextEmote("Your Vehicle is burning!", GetSummoner(), true); passenger->AddAura(SPELL_BURNING, passenger); } diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 77a2e8d9d..e078eb4da 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -156,7 +156,7 @@ public: void EnterCombat(Unit* /*who*/) override { - me->MonsterYell("Ah, the heroes. Your little friends said you would come. This certainly saves me the trouble of hunting you down myself.", LANG_UNIVERSAL, 0); + me->Yell("Ah, the heroes. Your little friends said you would come. This certainly saves me the trouble of hunting you down myself.", LANG_UNIVERSAL); me->CastSpell(me, SPELL_ARTRUIS_ICY_VEINS, true); events.RescheduleEvent(EVENT_CAST_FROST_BOLT, 4000); events.RescheduleEvent(EVENT_CAST_FROST_NOVA, 15000); @@ -200,7 +200,7 @@ public: } else if (action == ACTION_MAKE_FRIENDLY && me->GetVictim()) { - minion->MonsterSay("Now you not catch us with back turned! Now we hurt you bad undead. BAD!", LANG_UNIVERSAL, 0); + minion->Say("Now you not catch us with back turned! Now we hurt you bad undead. BAD!", LANG_UNIVERSAL); minion->RemoveAurasDueToSpell(SPELL_ARTRUIS_BINDING); minion->setFaction(me->GetVictim()->getFaction()); minion->AddThreat(me, 100000.0f); @@ -228,21 +228,21 @@ public: if (me->GetHealthPct() <= 30) { me->SetControlled(true, UNIT_STATE_STUNNED); - me->MonsterTextEmote("Artruis is shielded. You must choose your side quickly to break his spell.", 0, true); + me->TextEmote("Artruis is shielded. You must choose your side quickly to break his spell.", nullptr, true); SummonsAction(ACTION_BIND_MINIONS); break; } events.RepeatEvent(1000); break; case EVENT_ARTRUIS_TALK1: - me->MonsterYell("I have weathered a hundred years of war and suffering. Do you truly think it wise to pit your mortal bodies against a being that cannot die? I'd venture you have more to lose.", LANG_UNIVERSAL, 0); + me->Yell("I have weathered a hundred years of war and suffering. Do you truly think it wise to pit your mortal bodies against a being that cannot die? I'd venture you have more to lose.", LANG_UNIVERSAL); events.RescheduleEvent(EVENT_ARTRUIS_TALK2, 10000); break; case EVENT_ARTRUIS_TALK2: - me->MonsterYell("Even shattered into countless pieces, the crystals all around weaken me... perhaps i should not have underestimated the titans so...", LANG_UNIVERSAL, 0); + me->Yell("Even shattered into countless pieces, the crystals all around weaken me... perhaps i should not have underestimated the titans so...", LANG_UNIVERSAL); break; case EVENT_ARTRUIS_TALK3: - me->MonsterYell("Arthas once mustered strength... of the very same sort... perhaps he is the path that you will follow.", LANG_UNIVERSAL, 0); + me->Yell("Arthas once mustered strength... of the very same sort... perhaps he is the path that you will follow.", LANG_UNIVERSAL); break; case EVENT_CAST_FROST_BOLT: me->CastSpell(me->GetVictim(), SPELL_ARTRUIS_FROSTBOLT, false); @@ -340,7 +340,7 @@ public: void Say(const char* text) { if (Creature* th = ObjectAccessor::GetCreature(*me, thunderbrewGUID)) - th->MonsterSay(text, LANG_UNIVERSAL, 0); + th->Say(text, LANG_UNIVERSAL); else Reset(); } @@ -841,9 +841,10 @@ public: ## npc_jungle_punch_target #####*/ +constexpr auto SAY_OFFER = "Care to try Grimbooze Thunderbrew's new jungle punch?"; + enum JunglePunch { - SAY_OFFER = 28558, ITEM_TANKARD = 2705, NPC_HEMET = 27986, @@ -1025,7 +1026,7 @@ public: continue; player->KilledMonsterCredit(me->GetEntry()); - player->MonsterSay(SAY_OFFER, LANG_UNIVERSAL, me); + player->Say(SAY_OFFER, LANG_UNIVERSAL); sayStep = 1; break; } @@ -1476,15 +1477,15 @@ public: void HandleScript(SpellEffIndex /*effIndex*/) { - if (Player* player = GetHitUnit()->ToPlayer()) + if (Unit* target = GetHitUnit()) { switch (GetSpellInfo()->Id) { case SPELL_CORRECT_TRACKS: - player->MonsterSay(sObjectMgr->GetAcoreStringForDBCLocale(SAY_CORRECT_TRACKS), LANG_UNIVERSAL, player); + target->Say(SAY_CORRECT_TRACKS, target); break; case SPELL_INCORRECT_TRACKS: - player->MonsterSay(sObjectMgr->GetAcoreStringForDBCLocale(SAY_INCORRECT_TRACKS), LANG_UNIVERSAL, player); + target->Say(SAY_INCORRECT_TRACKS, target); break; default: break; diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index bd4d2fbcf..4bde226a7 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -85,10 +85,10 @@ public: switch (waypointId) { case 0: - me->MonsterTextEmote("You've been seen! Use the net and Freezing elixir to keep the dwarves away!", 0, true); + me->TextEmote("You've been seen! Use the net and Freezing elixir to keep the dwarves away!", nullptr, true); break; case 19: - me->MonsterTextEmote("The frosthound has located the thief's hiding place. Confront him!", 0, true); + me->TextEmote("The frosthound has located the thief's hiding place. Confront him!", 0, true); if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit()) summoner->ToPlayer()->KilledMonsterCredit(29677); break; diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 69f683e17..fdb50feff 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -132,33 +132,33 @@ public: switch (counter) { case 1: - me->MonsterTextEmote("Quickly, get me some...", player, true); - me->MonsterTextEmote(itemName, player, true); + me->TextEmote("Quickly, get me some...", player, true); + me->TextEmote(itemName, player, true); me->CastSpell(player, auraId, true); break; case 2: - me->MonsterTextEmote("Find me some...", player, true); - me->MonsterTextEmote(itemName, player, true); + me->TextEmote("Find me some...", player, true); + me->TextEmote(itemName, player, true); me->CastSpell(player, auraId, true); break; case 3: - me->MonsterTextEmote("I think it needs...", player, true); - me->MonsterTextEmote(itemName, player, true); + me->TextEmote("I think it needs...", player, true); + me->TextEmote(itemName, player, true); me->CastSpell(player, auraId, true); break; case 4: - me->MonsterTextEmote("Alright, now fetch me some...", player, true); - me->MonsterTextEmote(itemName, player, true); + me->TextEmote("Alright, now fetch me some...", player, true); + me->TextEmote(itemName, player, true); me->CastSpell(player, auraId, true); break; case 5: - me->MonsterTextEmote("Before it thickens, we must add...", player, true); - me->MonsterTextEmote(itemName, player, true); + me->TextEmote("Before it thickens, we must add...", player, true); + me->TextEmote(itemName, player, true); me->CastSpell(player, auraId, true); break; case 6: - me->MonsterTextEmote("It's thickening! Quickly get me some...", player, true); - me->MonsterTextEmote(itemName, player, true); + me->TextEmote("It's thickening! Quickly get me some...", player, true); + me->TextEmote(itemName, player, true); me->CastSpell(player, auraId, true); break; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp b/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp index 966754b11..cf57625fd 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp @@ -158,19 +158,19 @@ public: case EVENT_INVOKER_SAY_1: if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID)) { - plr->MonsterSay("The Ice Stone has melted!", LANG_UNIVERSAL, 0); + plr->Say("The Ice Stone has melted!", LANG_UNIVERSAL); plr->CastSpell(plr, SPELL_MAKE_BONFIRE, true); } events.RescheduleEvent(EVENT_INVOKER_SAY_2, 2000); break; case EVENT_INVOKER_SAY_2: if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID)) - plr->MonsterSay("Ahune, your strength grows no more!", LANG_UNIVERSAL, 0); + plr->Say("Ahune, your strength grows no more!", LANG_UNIVERSAL); events.RescheduleEvent(EVENT_INVOKER_SAY_3, 2000); break; case EVENT_INVOKER_SAY_3: if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID)) - plr->MonsterSay("Your frozen reign will not come to pass!", LANG_UNIVERSAL, 0); + plr->Say("Your frozen reign will not come to pass!", LANG_UNIVERSAL); break; case EVENT_ATTACK: events.Reset(); @@ -192,7 +192,7 @@ public: events.RescheduleEvent(EVENT_SUBMERGE, 10000); break; case EVENT_SUBMERGE: - me->MonsterTextEmote(TEXT_RETREAT, 0, true); + me->TextEmote(TEXT_RETREAT, nullptr, true); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->CastSpell(me, SPELL_SUBMERGE_0, true); me->CastSpell(me, SPELL_SELF_STUN, true); @@ -205,7 +205,7 @@ public: events.RescheduleEvent(EVENT_EMERGE_WARNING, 20000); break; case EVENT_EMERGE_WARNING: - me->MonsterTextEmote(TEXT_RESURFACE, 0, true); + me->TextEmote(TEXT_RESURFACE, nullptr, true); break; case EVENT_COMBAT_EMERGE: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 853719f4b..50d42631d 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -162,7 +162,7 @@ public: caster->CastSpell(target, 52605, true); char buff[100]; sprintf(buff, "%s plants the Flag of Ownership in the corpse of %s.", caster->GetName().c_str(), target->GetName().c_str()); - caster->MonsterTextEmote(buff, caster); + caster->TextEmote(buff, caster); haveTarget = true; } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 40cd1f508..439644c0f 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -804,19 +804,19 @@ public: { case SPELL_GREAT_FEAST: if (BroadcastText const* bct = sObjectMgr->GetBroadcastText(GREAT_FEAST_BROADCAST_TEXT_ID_PREPARE)) - player->MonsterTextEmote(bct->GetText(loc_idx, player->getGender()).c_str(), player, false); + player->TextEmote(bct->GetText(loc_idx, player->getGender()).c_str(), player); break; case SPELL_FISH_FEAST: if (BroadcastText const* bct = sObjectMgr->GetBroadcastText(FISH_FEAST_BROADCAST_TEXT_ID_PREPARE)) - player->MonsterTextEmote(bct->GetText(loc_idx, player->getGender()).c_str(), player, false); + player->TextEmote(bct->GetText(loc_idx, player->getGender()).c_str(), player); break; case SPELL_SMALL_FEAST: if (BroadcastText const* bct = sObjectMgr->GetBroadcastText(SMALL_FEAST_BROADCAST_TEXT_ID_PREPARE)) - player->MonsterTextEmote(bct->GetText(loc_idx, player->getGender()).c_str(), player, false); + player->TextEmote(bct->GetText(loc_idx, player->getGender()).c_str(), player); break; case SPELL_GIGANTIC_FEAST: if (BroadcastText const* bct = sObjectMgr->GetBroadcastText(GIGANTIC_FEAST_BROADCAST_TEXT_ID_PREPARE)) - player->MonsterTextEmote(bct->GetText(loc_idx, player->getGender()).c_str(), player, false); + player->TextEmote(bct->GetText(loc_idx, player->getGender()).c_str(), player); break; } } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 8cff3e077..25d865bac 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -92,7 +92,7 @@ public: { if (Creature* cr = go->SummonCreature(28105, 6708.7f, 5115.45f, -18.3f, 0.7f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) { - cr->MonsterYell("My treasure! You no steal from Tartek, dumb big-tongue traitor thing. Tartek and nasty dragon going to kill you! You so dumb.", LANG_UNIVERSAL, 0); + cr->Yell("My treasure! You no steal from Tartek, dumb big-tongue traitor thing. Tartek and nasty dragon going to kill you! You so dumb.", LANG_UNIVERSAL); cr->AI()->AttackStart(pPlayer); } }