mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/Chat: Split ChatLevelReq.Say into 3
This commit is contained in:
@@ -296,8 +296,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
switch (type)
|
||||
{
|
||||
case CHAT_MSG_SAY:
|
||||
case CHAT_MSG_EMOTE:
|
||||
case CHAT_MSG_YELL:
|
||||
{
|
||||
// Prevent cheating
|
||||
if (!sender->IsAlive())
|
||||
@@ -309,12 +307,37 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == CHAT_MSG_SAY)
|
||||
sender->Say(msg, Language(lang));
|
||||
else if (type == CHAT_MSG_EMOTE)
|
||||
sender->TextEmote(msg);
|
||||
else if (type == CHAT_MSG_YELL)
|
||||
sender->Yell(msg, Language(lang));
|
||||
sender->Say(msg, Language(lang));
|
||||
break;
|
||||
}
|
||||
case CHAT_MSG_EMOTE:
|
||||
{
|
||||
// Prevent cheating
|
||||
if (!sender->IsAlive())
|
||||
return;
|
||||
|
||||
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
sender->TextEmote(msg);
|
||||
break;
|
||||
}
|
||||
case CHAT_MSG_YELL:
|
||||
{
|
||||
// Prevent cheating
|
||||
if (!sender->IsAlive())
|
||||
return;
|
||||
|
||||
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
sender->Yell(msg, Language(lang));
|
||||
break;
|
||||
}
|
||||
case CHAT_MSG_WHISPER:
|
||||
|
||||
@@ -603,7 +603,9 @@ void World::LoadConfigSettings(bool reload)
|
||||
}
|
||||
m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Channel", 1);
|
||||
m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Whisper", 1);
|
||||
m_int_configs[CONFIG_CHAT_EMOTE_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Emote", 1);
|
||||
m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Say", 1);
|
||||
m_int_configs[CONFIG_CHAT_YELL_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Yell", 1);
|
||||
m_int_configs[CONFIG_PARTY_LEVEL_REQ] = sConfigMgr->GetIntDefault("PartyLevelReq", 1);
|
||||
m_int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Trade", 1);
|
||||
m_int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Ticket", 1);
|
||||
|
||||
@@ -287,7 +287,9 @@ enum WorldIntConfigs
|
||||
CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY,
|
||||
CONFIG_CHAT_STRICT_LINK_CHECKING_KICK,
|
||||
CONFIG_CHAT_CHANNEL_LEVEL_REQ,
|
||||
CONFIG_CHAT_EMOTE_LEVEL_REQ,
|
||||
CONFIG_CHAT_WHISPER_LEVEL_REQ,
|
||||
CONFIG_CHAT_YELL_LEVEL_REQ,
|
||||
CONFIG_CHAT_SAY_LEVEL_REQ,
|
||||
CONFIG_PARTY_LEVEL_REQ,
|
||||
CONFIG_TRADE_LEVEL_REQ,
|
||||
|
||||
@@ -1643,24 +1643,18 @@ Channel.RestrictedLfg = 1
|
||||
|
||||
#
|
||||
# ChatLevelReq.Channel
|
||||
# Description: Level requirement for characters to be able to write in chat channels.
|
||||
# ChatLevelReq.Whisper
|
||||
# ChatLevelReq.Emote
|
||||
# ChatLevelReq.Say
|
||||
# ChatLevelReq.Yell
|
||||
# Description: Level requirement for characters to be able to use chats.
|
||||
# Default: 1
|
||||
|
||||
ChatLevelReq.Channel = 1
|
||||
|
||||
#
|
||||
# ChatLevelReq.Whisper
|
||||
# Description: Level requirement for characters to be able to whisper other characters.
|
||||
# Default: 1
|
||||
|
||||
ChatLevelReq.Whisper = 1
|
||||
|
||||
#
|
||||
# ChatLevelReq.Say
|
||||
# Description: Level requirement for characters to be able to use say/yell/emote.
|
||||
# Default: 1
|
||||
|
||||
ChatLevelReq.Emote = 1
|
||||
ChatLevelReq.Say = 1
|
||||
ChatLevelReq.Yell = 1
|
||||
|
||||
#
|
||||
# PartyLevelReq
|
||||
|
||||
Reference in New Issue
Block a user