diff options
| author | Shauren <shauren.trinity@gmail.com> | 2020-12-27 22:43:36 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-12-27 22:43:36 +0100 |
| commit | 2e4609f6e18c181fbb54ec851a9ccd5bd3c6eb7b (patch) | |
| tree | 5f14ef55d4a01fad3792fd4819d36636d0b335d0 /src/server/game/Texts | |
| parent | 88301ec3beb81e63896c46b67b14712e69226746 (diff) | |
Core/Chat: Send broadcast text id in sound packets to allow playing encrypted sound files
Diffstat (limited to 'src/server/game/Texts')
| -rw-r--r-- | src/server/game/Texts/CreatureTextMgr.cpp | 7 | ||||
| -rw-r--r-- | src/server/game/Texts/CreatureTextMgr.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 9e27747c60a..e388e5f80a0 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -259,7 +259,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject range = iter->TextRange; if (finalSound) - SendSound(source, finalSound, finalType, whisperTarget, range, team, gmOnly); + SendSound(source, finalSound, finalType, whisperTarget, range, team, gmOnly, iter->BroadcastTextId); Unit* finalSource = source; if (srcPlr) @@ -302,12 +302,13 @@ float CreatureTextMgr::GetRangeForChatType(ChatMsg msgType) return dist; } -void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget /*= nullptr*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/) +void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget /*= nullptr*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, + Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, uint32 keyBroadcastTextId /*= 0*/) { if (!sound || !source) return; - SendNonChatPacket(source, WorldPackets::Misc::PlaySound(source->GetGUID(), sound).Write(), msgType, whisperTarget, range, team, gmOnly); + SendNonChatPacket(source, WorldPackets::Misc::PlaySound(source->GetGUID(), sound, keyBroadcastTextId).Write(), msgType, whisperTarget, range, team, gmOnly); } void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly) diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index cc76ae1588b..9c15000cd42 100644 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -93,7 +93,7 @@ class TC_GAME_API CreatureTextMgr void LoadCreatureTextLocales(); CreatureTextMap const& GetTextMap() const { return mTextMap; } - static void SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false); + static void SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false, uint32 keyBroadcastTextId = 0); static void SendEmote(Unit* source, uint32 emote); //if sent, returns the 'duration' of the text else 0 if error |
