mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 15:27:47 -04:00
Stats Limits
This commit is contained in:
@@ -575,6 +575,10 @@ void Player::UpdateBlockPercentage()
|
||||
value += GetTotalAuraModifier(SPELL_AURA_MOD_BLOCK_PERCENT);
|
||||
// Increase from rating
|
||||
value += GetRatingBonusValue(CR_BLOCK);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_BLOCK) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_BLOCK) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
}
|
||||
SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value);
|
||||
@@ -609,6 +613,10 @@ void Player::UpdateCritPercentage(WeaponAttackType attType)
|
||||
float value = GetTotalPercentageModValue(modGroup) + GetRatingBonusValue(cr);
|
||||
// Modify crit from weapon skill and maximized defense skill of same level victim difference
|
||||
value += (int32(GetWeaponSkillValue(attType)) - int32(GetMaxSkillValueForLevel())) * 0.04f;
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_CRIT) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_CRIT) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
SetStatFloatValue(index, value);
|
||||
}
|
||||
@@ -700,6 +708,10 @@ void Player::UpdateParryPercentage()
|
||||
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
|
||||
// apply diminishing formula to diminishing parry chance
|
||||
value = nondiminishing + diminishing * parry_cap[pclass] / (diminishing + parry_cap[pclass] * m_diminishing_k[pclass]);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
}
|
||||
SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value);
|
||||
@@ -735,6 +747,9 @@ void Player::UpdateDodgePercentage()
|
||||
uint32 pclass = getClass()-1;
|
||||
float value = nondiminishing + (diminishing * dodge_cap[pclass] / (diminishing + dodge_cap[pclass] * m_diminishing_k[pclass]));
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user