Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-01-08 23:30:50 +08:00
11 changed files with 2506 additions and 42 deletions

View File

@@ -9366,12 +9366,10 @@ void Player::Whisper(std::string_view text, Language language, Player* target, b
}
}
void Player::Whisper(uint32 textId, Player* target, bool /*isBossWhisper = false*/)
void Player::Whisper(uint32 textId, Player* target, bool isBossWhisper)
{
if (!target)
{
return;
}
BroadcastText const* bct = sObjectMgr->GetBroadcastText(textId);
if (!bct)
@@ -9382,7 +9380,10 @@ void Player::Whisper(uint32 textId, Player* target, bool /*isBossWhisper = false
LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex();
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
if (isBossWhisper)
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_BOSS_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
else
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
target->SendDirectMessage(&data);
}