mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Chat: enable boss whisper chat types for Whisper function
This commit is contained in:
@@ -21235,7 +21235,7 @@ void Player::WhisperAddon(std::string const& text, const std::string& prefix, Pl
|
||||
receiver->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void Player::Whisper(std::string const& text, Language language, Player* target, bool /*= false*/)
|
||||
void Player::Whisper(std::string const& text, Language language, Player* target, bool isBossWhisper)
|
||||
{
|
||||
ASSERT(target);
|
||||
|
||||
@@ -21245,10 +21245,10 @@ void Player::Whisper(std::string const& text, Language language, Player* target,
|
||||
language = LANG_UNIVERSAL; // whispers should always be readable
|
||||
|
||||
std::string _text(text);
|
||||
sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, target);
|
||||
sScriptMgr->OnPlayerChat(this, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_WHISPER, language, _text, target);
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, Language(language), this, this, _text);
|
||||
ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_WHISPER, Language(language), this, this, _text);
|
||||
target->SendDirectMessage(&data);
|
||||
|
||||
// rest stuff shouldn't happen in case of addon message
|
||||
@@ -21271,7 +21271,7 @@ void Player::Whisper(std::string const& text, Language language, Player* target,
|
||||
ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, target->GetName().c_str(), target->autoReplyMsg.c_str());
|
||||
}
|
||||
|
||||
void Player::Whisper(uint32 textId, Player* target, bool /*isBossWhisper = false*/)
|
||||
void Player::Whisper(uint32 textId, Player* target, bool isBossWhisper)
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
@@ -21285,7 +21285,7 @@ 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);
|
||||
ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
|
||||
target->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user