From f5c4fe86e8b51c52348d0e384ba1264a28dad84e Mon Sep 17 00:00:00 2001 From: bloutix Date: Sun, 14 Dec 2008 23:14:17 +0300 Subject: [PATCH] Correctly select GM level in case heroic class. Signed-off-by: bloutix Move heroic class starting level to mangos.conf Signed-off-by: VladimirMangos --- src/game/Player.cpp | 15 +++++++++------ src/game/World.cpp | 14 ++++++++++++++ src/game/World.h | 1 + src/mangosd/mangosd.conf.dist.in | 7 ++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 176211868..ead650591 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -599,16 +599,19 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8 } // set starting level + uint32 start_level = getClass() != CLASS_DEATH_KNIGHT + ? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) + : sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); + if (GetSession()->GetSecurity() >= SEC_MODERATOR) - SetUInt32Value(UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_GM_LEVEL)); - else { - if(getClass() == CLASS_DEATH_KNIGHT) - SetUInt32Value(UNIT_FIELD_LEVEL, 55); - else - SetUInt32Value(UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL)); + uint32 gm_level = sWorld.getConfig(CONFIG_START_GM_LEVEL); + if(gm_level > start_level) + start_level = gm_level; } + SetUInt32Value(UNIT_FIELD_LEVEL, start_level); + InitRunes(); SetUInt32Value (PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_START_PLAYER_MONEY)); diff --git a/src/game/World.cpp b/src/game/World.cpp index e20f9c416..8da99d209 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -675,6 +675,20 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_START_PLAYER_LEVEL] = m_configs[CONFIG_MAX_PLAYER_LEVEL]; } + m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = sConfig.GetIntDefault("StartHeroicPlayerLevel", 55); + if(m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1) + { + sLog.outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.", + m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]); + m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55; + } + else if(m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_configs[CONFIG_MAX_PLAYER_LEVEL]) + { + sLog.outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.", + m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]); + m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = m_configs[CONFIG_MAX_PLAYER_LEVEL]; + } + m_configs[CONFIG_START_PLAYER_MONEY] = sConfig.GetIntDefault("StartPlayerMoney", 0); if(m_configs[CONFIG_START_PLAYER_MONEY] < 0) { diff --git a/src/game/World.h b/src/game/World.h index a89ef9abd..7af514469 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -103,6 +103,7 @@ enum WorldConfigs CONFIG_SKIP_CINEMATICS, CONFIG_MAX_PLAYER_LEVEL, CONFIG_START_PLAYER_LEVEL, + CONFIG_START_HEROIC_PLAYER_LEVEL, CONFIG_START_PLAYER_MONEY, CONFIG_MAX_HONOR_POINTS, CONFIG_START_HONOR_POINTS, diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index e2ce71475..c42da5204 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -417,12 +417,16 @@ LogColors = "" # MaxPlayerLevel # Max level that can be reached by player for experience (in range from 1 to 100). # Change not recommended -# Default: 70 +# Default: 80 # # StartPlayerLevel # Staring level that have character at creating (in range 1 to MaxPlayerLevel) # Default: 1 # +# StartHeroicPlayerLevel +# Staring level that have character of heroic class at creating (in range 1 to MaxPlayerLevel) +# Default: 55 +# # StartPlayerMoney # Amount of money that new players will start with. # If you want to start with silver, use for example 100 (100 copper = 1 silver) @@ -573,6 +577,7 @@ CharactersPerRealm = 10 SkipCinematics = 0 MaxPlayerLevel = 80 StartPlayerLevel = 1 +StartHeroicPlayerLevel = 55 StartPlayerMoney = 0 MaxHonorPoints = 75000 StartHonorPoints = 0