Core/Chat: Send broadcast text id in sound packets to allow playing encrypted sound files

This commit is contained in:
Shauren
2020-12-27 22:43:36 +01:00
parent 88301ec3be
commit 2e4609f6e1
10 changed files with 26 additions and 15 deletions

View File

@@ -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)