Fix for OnAfterUpdateMaxPower hook

This commit is contained in:
Matteo Emili
2017-01-21 23:10:17 +01:00
committed by Yehonal
parent a67c6eeddf
commit cc0f7cee68

View File

@@ -292,13 +292,12 @@ void Player::UpdateMaxPower(Powers power)
float bonusPower = (power == POWER_MANA && GetCreatePowers(power) > 0) ? GetManaBonusFromIntellect() : 0;
sScriptMgr->OnAfterUpdateMaxPower(this, power, bonusPower);
float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);
value *= GetModifierValue(unitMod, BASE_PCT);
value += GetModifierValue(unitMod, TOTAL_VALUE) + bonusPower;
value *= GetModifierValue(unitMod, TOTAL_PCT);
sScriptMgr->OnAfterUpdateMaxPower(this, power, value);
SetMaxPower(power, uint32(value));
}