bool Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string& receiver, const std::string& text)
{
Player* player = getPlayerByID(playerId);
if(!player || player->isRemoved())
return false;
uint32_t muted = 0;
bool mute = player->[COLOR="#FF0000"]isMuted[/COLOR](channelId, type, muted);
[B] if(muted && mute)
{
char buffer[75];
sprintf(buffer, "You are still muted for %d seconds.", muted);
player->sendTextMessage(MSG_STATUS_SMALL, buffer);
return false;
}[/B]
if(player->isAccountManager())
{
if(mute)
player->removeMessageBuffer();
return internalCreatureSay(player, SPEAK_SAY, text, false);
}
if(g_talkActions->onPlayerSay(player, type == SPEAK_SAY ? (unsigned)CHANNEL_DEFAULT : channelId, text, false))
return true;
ReturnValue ret = RET_NOERROR;
if(!muted)
{
ret = g_spells->onPlayerSay(player, text);
if(ret == RET_NOERROR || (ret == RET_NEEDEXCHANGE && !g_config.getBool(ConfigManager::BUFFER_SPELL_FAILURE)))
return true;
}
[B] if(mute)
player->removeMessageBuffer();[/B]
[..]