Core: add possibility to disable creating of characters of specified races/classes.

--HG--
branch : trunk
This commit is contained in:
azazel
2010-09-06 23:34:16 +06:00
parent d54225189e
commit 7afc640ef4
4 changed files with 52 additions and 14 deletions
@@ -175,7 +175,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
if (GetSecurity() == SEC_PLAYER)
{
if (uint32 mask = sWorld.getIntConfig(CONFIG_CHARACTERS_CREATING_DISABLED))
if (uint32 mask = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED))
{
bool disabled = false;
@@ -224,6 +224,25 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
return;
}
if (GetSecurity() == SEC_PLAYER)
{
uint32 raceMaskDisabled = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
if ((1 << (race_ - 1)) & raceMaskDisabled)
{
data << uint8(CHAR_CREATE_DISABLED);
SendPacket(&data);
return;
}
uint32 classMaskDisabled = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK);
if ((1 << (class_ - 1)) & classMaskDisabled)
{
data << uint8(CHAR_CREATE_DISABLED);
SendPacket(&data);
return;
}
}
// prevent character creating with invalid name
if (!normalizePlayerName(name))
{
@@ -295,7 +314,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
}
// speedup check for heroic class disabled case
uint32 req_level_for_heroic = sWorld.getIntConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING);
uint32 req_level_for_heroic = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER);
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;