mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 23:56:25 +00:00
feat(Core/Player): Implement option to convert excess honor points int… (#10565)
This commit is contained in:
@@ -6109,7 +6109,19 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
void Player::SetHonorPoints(uint32 value)
|
||||
{
|
||||
if (value > sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS))
|
||||
{
|
||||
if (int32 copperPerPoint = sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT))
|
||||
{
|
||||
// Only convert points on login, not when awarded honor points.
|
||||
if (isBeingLoaded())
|
||||
{
|
||||
int32 excessPoints = value - sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS);
|
||||
ModifyMoney(excessPoints * copperPerPoint);
|
||||
}
|
||||
}
|
||||
|
||||
value = sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS);
|
||||
}
|
||||
SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, value);
|
||||
if (value)
|
||||
AddKnownCurrency(ITEM_HONOR_POINTS_ID);
|
||||
|
||||
@@ -228,6 +228,7 @@ enum WorldIntConfigs
|
||||
CONFIG_START_HEROIC_PLAYER_LEVEL,
|
||||
CONFIG_START_PLAYER_MONEY,
|
||||
CONFIG_MAX_HONOR_POINTS,
|
||||
CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT,
|
||||
CONFIG_START_HONOR_POINTS,
|
||||
CONFIG_MAX_ARENA_POINTS,
|
||||
CONFIG_START_ARENA_POINTS,
|
||||
|
||||
@@ -844,6 +844,13 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_int_configs[CONFIG_MAX_HONOR_POINTS] = 0;
|
||||
}
|
||||
|
||||
m_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT] = sConfigMgr->GetOption<int32>("MaxHonorPointsMoneyPerPoint", 0);
|
||||
if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT]) < 0)
|
||||
{
|
||||
LOG_ERROR("server.loading", "MaxHonorPointsMoneyPerPoint ({}) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT]);
|
||||
m_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT] = 0;
|
||||
}
|
||||
|
||||
m_int_configs[CONFIG_START_HONOR_POINTS] = sConfigMgr->GetOption<int32>("StartHonorPoints", 0);
|
||||
if (int32(m_int_configs[CONFIG_START_HONOR_POINTS]) < 0 || int32(m_int_configs[CONFIG_START_HONOR_POINTS]) > int32(m_int_configs[CONFIG_MAX_HONOR_POINTS]))
|
||||
{
|
||||
|
||||
@@ -868,6 +868,14 @@ StartPlayerMoney = 0
|
||||
|
||||
MaxHonorPoints = 75000
|
||||
|
||||
#
|
||||
# MaxHonorPointsMoneyPerPoint
|
||||
# Description: Convert excess honor points into money if players got more points than allowed after changing the honor cap.
|
||||
# Honor points will be converted into copper according to the value set in this config.
|
||||
# Default: 0 - Disabled
|
||||
|
||||
MaxHonorPointsMoneyPerPoint = 0
|
||||
|
||||
#
|
||||
# StartHonorPoints
|
||||
# Description: Amount of honor points that characters have after creation.
|
||||
|
||||
Reference in New Issue
Block a user