Core/Spells: implement SPELL_AURA_MOD_SPELL_POWER_PCT

This commit is contained in:
Ovahlord committed 2019-04-01 04:09:02 +02:00
1 parent 5f00b6a59a
commit 3f72985dfa
3 files changed
+41 -1

No files matched your search

+28
View File
@@ -7025,6 +7025,20 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
}
}
// Spell power from SPELL_AURA_MOD_SPELL_POWER_PCT
AuraEffectList const& mSpellPowerPct = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_POWER_PCT);
for (AuraEffect const* aurEff : mSpellPowerPct)
{
int32 spellGroupVal = GetHighestExclusiveSameEffectSpellGroupValue(aurEff, SPELL_AURA_MOD_SPELL_POWER_PCT);
if (abs(spellGroupVal) >= abs(aurEff->GetAmount()))
{
AddPct(DoneAdvertisedBenefit, spellGroupVal);
break;
}
else
AddPct(DoneAdvertisedBenefit, aurEff->GetAmount());
}
// ... and attack power
DoneAdvertisedBenefit += static_cast<int32>(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER, schoolMask)));
}
@@ -7677,6 +7691,20 @@ int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
advertisedBenefit += int32(CalculatePct(GetStat(usedStat), (*i)->GetAmount()));
}
// Spell power from SPELL_AURA_MOD_SPELL_POWER_PCT
AuraEffectList const& mSpellPowerPct = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_POWER_PCT);
for (AuraEffect const* aurEff : mSpellPowerPct)
{
int32 spellGroupVal = GetHighestExclusiveSameEffectSpellGroupValue(aurEff, SPELL_AURA_MOD_SPELL_POWER_PCT);
if (abs(spellGroupVal) >= abs(aurEff->GetAmount()))
{
AddPct(advertisedBenefit, spellGroupVal);
break;
}
else
AddPct(advertisedBenefit, aurEff->GetAmount());
}
// ... and attack power
AuraEffectList const& mHealingDonebyAP = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER);
for (AuraEffectList::const_iterator i = mHealingDonebyAP.begin(); i != mHealingDonebyAP.end(); ++i)