mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[11813] Receiving whispers while being dnd
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
35ad6b2ae5
commit
e89d5db5e3
5 changed files with 22 additions and 28 deletions
|
|
@ -18370,40 +18370,29 @@ void Player::Whisper(const std::string& text, uint32 language, ObjectGuid receiv
|
|||
|
||||
Player *rPlayer = sObjectMgr.GetPlayer(receiver);
|
||||
|
||||
// when player you are whispering to is dnd, he cannot receive your message, unless you are in gm mode
|
||||
if(!rPlayer->isDND() || isGameMaster())
|
||||
{
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildPlayerChat(&data, CHAT_MSG_WHISPER, text, language);
|
||||
rPlayer->GetSession()->SendPacket(&data);
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
BuildPlayerChat(&data, CHAT_MSG_WHISPER, text, language);
|
||||
rPlayer->GetSession()->SendPacket(&data);
|
||||
|
||||
// not send confirmation for addon messages
|
||||
if (language != LANG_ADDON)
|
||||
{
|
||||
data.Initialize(SMSG_MESSAGECHAT, 200);
|
||||
rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, text, language);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
else
|
||||
// not send confirmation for addon messages
|
||||
if (language != LANG_ADDON)
|
||||
{
|
||||
// announce to player that player he is whispering to is dnd and cannot receive his message
|
||||
ChatHandler(this).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName(), rPlayer->dndMsg.c_str());
|
||||
data.Initialize(SMSG_MESSAGECHAT, 200);
|
||||
rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, text, language);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
if(!isAcceptWhispers())
|
||||
if (!isAcceptWhispers())
|
||||
{
|
||||
SetAcceptWhispers(true);
|
||||
ChatHandler(this).SendSysMessage(LANG_COMMAND_WHISPERON);
|
||||
}
|
||||
|
||||
// announce to player that player he is whispering to is afk
|
||||
if(rPlayer->isAFK())
|
||||
// announce afk or dnd message
|
||||
if (rPlayer->isAFK())
|
||||
ChatHandler(this).PSendSysMessage(LANG_PLAYER_AFK, rPlayer->GetName(), rPlayer->afkMsg.c_str());
|
||||
|
||||
// if player whisper someone, auto turn of dnd to be able to receive an answer
|
||||
if(isDND() && !rPlayer->isGameMaster())
|
||||
ToggleDND();
|
||||
else if (rPlayer->isDND())
|
||||
ChatHandler(this).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName(), rPlayer->dndMsg.c_str());
|
||||
}
|
||||
|
||||
void Player::PetSpellInitialize()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue