mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core/Players: Fix haste rating formulas. They're supposed to be the addition, not the multiplication of all available bonuses
- This change matches client formulas
This commit is contained in:
@@ -5930,32 +5930,31 @@ float Player::OCTRegenMPPerSpirit()
|
||||
|
||||
void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
|
||||
{
|
||||
float oldRating = m_baseRatingValue[cr];
|
||||
m_baseRatingValue[cr]+=(apply ? value : -value);
|
||||
|
||||
// explicit affected values
|
||||
switch (cr)
|
||||
if (cr == CR_HASTE_MELEE || cr == CR_HASTE_RANGED || cr == CR_HASTE_SPELL)
|
||||
{
|
||||
case CR_HASTE_MELEE:
|
||||
float const mult = GetRatingMultiplier(cr);
|
||||
float const oldVal = oldRating * mult;
|
||||
float const newVal = m_baseRatingValue[cr] * mult;
|
||||
switch (cr)
|
||||
{
|
||||
float RatingChange = value * GetRatingMultiplier(cr);
|
||||
ApplyAttackTimePercentMod(BASE_ATTACK, RatingChange, apply);
|
||||
ApplyAttackTimePercentMod(OFF_ATTACK, RatingChange, apply);
|
||||
break;
|
||||
case CR_HASTE_MELEE:
|
||||
ApplyAttackTimePercentMod(BASE_ATTACK, oldVal, false);
|
||||
ApplyAttackTimePercentMod(OFF_ATTACK, oldVal, false);
|
||||
ApplyAttackTimePercentMod(BASE_ATTACK, newVal, true);
|
||||
ApplyAttackTimePercentMod(OFF_ATTACK, newVal, true);
|
||||
break;
|
||||
case CR_HASTE_RANGED:
|
||||
ApplyAttackTimePercentMod(RANGED_ATTACK, oldVal, false);
|
||||
ApplyAttackTimePercentMod(RANGED_ATTACK, newVal, true);
|
||||
break;
|
||||
case CR_HASTE_SPELL:
|
||||
ApplyCastTimePercentMod(oldVal, false);
|
||||
ApplyCastTimePercentMod(newVal, true);
|
||||
break;
|
||||
}
|
||||
case CR_HASTE_RANGED:
|
||||
{
|
||||
float RatingChange = value * GetRatingMultiplier(cr);
|
||||
ApplyAttackTimePercentMod(RANGED_ATTACK, RatingChange, apply);
|
||||
break;
|
||||
}
|
||||
case CR_HASTE_SPELL:
|
||||
{
|
||||
float RatingChange = value * GetRatingMultiplier(cr);
|
||||
ApplyCastTimePercentMod(RatingChange, apply);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateRating(cr);
|
||||
|
||||
Reference in New Issue
Block a user