mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Implement new mangos.conf setting HeroicCharactersPerRealm for set cstiom (default 1) amount heroic class chanarcters for account per realm.
Note: set option to 0 disable heroic characters creating. Also non-player account not have now any limits (except 10 clinet limit) for heroic characters creating.
This commit is contained in:
parent
4090872bfa
commit
c1ae939fb1
5 changed files with 48 additions and 8 deletions
|
|
@ -308,6 +308,15 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
|||
}
|
||||
}
|
||||
|
||||
// speedup check for heroic class disabled case
|
||||
uint32 heroic_free_slots = sWorld.getConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM);
|
||||
if(heroic_free_slots==0 && GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
||||
SendPacket( &data );
|
||||
return;
|
||||
}
|
||||
|
||||
bool AllowTwoSideAccounts = !sWorld.IsPvPRealm() || sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
|
||||
uint32 skipCinematics = sWorld.getConfig(CONFIG_SKIP_CINEMATICS);
|
||||
|
||||
|
|
@ -323,16 +332,22 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
|||
Field* field = result2->Fetch();
|
||||
uint8 acc_race = field[0].GetUInt32();
|
||||
|
||||
if(class_ == CLASS_DEATH_KNIGHT)
|
||||
if(GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
uint8 acc_class = field[1].GetUInt32();
|
||||
if(acc_class == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
if(heroic_free_slots > 0)
|
||||
--heroic_free_slots;
|
||||
|
||||
if(heroic_free_slots==0)
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
||||
SendPacket( &data );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// need to check team only for first character
|
||||
// TODO: what to if account already has characters of both races?
|
||||
|
|
@ -364,10 +379,15 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
|||
if(!have_same_race)
|
||||
have_same_race = race_ == acc_race;
|
||||
|
||||
if(class_ == CLASS_DEATH_KNIGHT)
|
||||
if(GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
uint8 acc_class = field[1].GetUInt32();
|
||||
if(acc_class == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
if(heroic_free_slots > 0)
|
||||
--heroic_free_slots;
|
||||
|
||||
if(heroic_free_slots==0)
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
||||
SendPacket( &data );
|
||||
|
|
@ -375,6 +395,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
delete result2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -690,6 +690,11 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
|
|||
|
||||
uint32 item_id = oEntry->ItemId[j];
|
||||
|
||||
|
||||
// Hack for not existed item id in dbc 3.0.3
|
||||
if(item_id==40582)
|
||||
continue;
|
||||
|
||||
ItemPrototype const* iProto = objmgr.GetItemPrototype(item_id);
|
||||
if(!iProto)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -633,6 +633,13 @@ void World::LoadConfigSettings(bool reload)
|
|||
m_configs[CONFIG_CHARACTERS_PER_REALM] = 10;
|
||||
}
|
||||
|
||||
m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("HeroicCharactersPerRealm", 1);
|
||||
if(m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] < 0 || m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10)
|
||||
{
|
||||
sLog.outError("HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.",m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]);
|
||||
m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1;
|
||||
}
|
||||
|
||||
// must be after CONFIG_CHARACTERS_PER_REALM
|
||||
m_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfig.GetIntDefault("CharactersPerAccount", 50);
|
||||
if(m_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < m_configs[CONFIG_CHARACTERS_PER_REALM])
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ enum WorldConfigs
|
|||
CONFIG_CHARACTERS_CREATING_DISABLED,
|
||||
CONFIG_CHARACTERS_PER_ACCOUNT,
|
||||
CONFIG_CHARACTERS_PER_REALM,
|
||||
CONFIG_HEROIC_CHARACTERS_PER_REALM,
|
||||
CONFIG_SKIP_CINEMATICS,
|
||||
CONFIG_MAX_PLAYER_LEVEL,
|
||||
CONFIG_START_PLAYER_LEVEL,
|
||||
|
|
|
|||
|
|
@ -408,6 +408,11 @@ LogColors = ""
|
|||
# Default: 10 (client limitation)
|
||||
# The number must be between 1 and 10
|
||||
#
|
||||
# HeroicCharactersPerRealm
|
||||
# Limit numbers of heroic class characters for account at realm
|
||||
# Default: 1
|
||||
# The number must be between 0 (not allowed) and 10
|
||||
#
|
||||
# SkipCinematics
|
||||
# Disable in-game script movie at first character's login(allows to prevent buggy intro in case of custom start location coordinates)
|
||||
# Default: 0 - show intro for each new characrer
|
||||
|
|
@ -574,6 +579,7 @@ StrictPetNames = 0
|
|||
CharactersCreatingDisabled = 0
|
||||
CharactersPerAccount = 50
|
||||
CharactersPerRealm = 10
|
||||
HeroicCharactersPerRealm = 1
|
||||
SkipCinematics = 0
|
||||
MaxPlayerLevel = 80
|
||||
StartPlayerLevel = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue