New hooks OnAfterUpdateMaxPower and OnBeforeRollMeleeOutcomeAgainst

This commit is contained in:
Matteo Emili
2017-01-21 14:10:00 +01:00
committed by Yehonal
parent f6be52ab40
commit a67c6eeddf
4 changed files with 38 additions and 8 deletions

View File

@@ -12,6 +12,7 @@
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "SpellMgr.h"
#include "ScriptMgr.h"
inline bool _ModifyUInt32(bool apply, uint32& baseValue, int32& amount)
{
@@ -291,6 +292,8 @@ 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;