mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 01:53:47 +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);
|
||||
|
||||
Reference in New Issue
Block a user