Core/Config: Implement CONFIG_MAX_JUSTICE_POINTS and CONFIG_START_JUSTICE_POINTS options

This commit is contained in:
Shocker
2012-11-14 23:41:32 +02:00
parent 967068d81a
commit 792e636a32
3 changed files with 36 additions and 0 deletions
@@ -1018,6 +1018,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY));
SetCurrency(CURRENCY_TYPE_HONOR_POINTS, sWorld->getIntConfig(CONFIG_START_HONOR_POINTS));
SetCurrency(CURRENCY_TYPE_JUSTICE_POINTS, sWorld->getIntConfig(CONFIG_START_JUSTICE_POINTS));
SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, sWorld->getIntConfig(CONFIG_START_ARENA_POINTS));
// start with every map explored
+21
View File
@@ -803,6 +803,27 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_START_HONOR_POINTS] = m_int_configs[CONFIG_MAX_HONOR_POINTS];
}
m_int_configs[CONFIG_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("MaxJusticePoints", 400000);
if (int32(m_int_configs[CONFIG_MAX_JUSTICE_POINTS]) < 0)
{
sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxJusticePoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_JUSTICE_POINTS]);
m_int_configs[CONFIG_MAX_JUSTICE_POINTS] = 0;
}
m_int_configs[CONFIG_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("StartJusticePoints", 0);
if (int32(m_int_configs[CONFIG_START_JUSTICE_POINTS]) < 0)
{
sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.",
m_int_configs[CONFIG_START_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS], 0);
m_int_configs[CONFIG_START_JUSTICE_POINTS] = 0;
}
else if (m_int_configs[CONFIG_START_JUSTICE_POINTS] > m_int_configs[CONFIG_MAX_JUSTICE_POINTS])
{
sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.",
m_int_configs[CONFIG_START_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS]);
m_int_configs[CONFIG_START_JUSTICE_POINTS] = m_int_configs[CONFIG_MAX_JUSTICE_POINTS];
}
m_int_configs[CONFIG_MAX_ARENA_POINTS] = ConfigMgr::GetIntDefault("MaxArenaPoints", 10000);
if (int32(m_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0)
{
@@ -792,6 +792,20 @@ MaxHonorPoints = 75000
StartHonorPoints = 0
#
# MaxJusticePoints
# Description: Maximum justice points a character can have.
# Default: 400000
MaxJusticePoints = 400000
#
# StartJusticePoints
# Description: Amount of justice points that characters have after creation.
# Default: 0
StartJusticePoints = 0
#
# MaxArenaPoints
# Description: Maximum arena points a character can have.