Core/Spells: implement SPELL_AURA_MOD_SPELL_POWER_PCT
This commit is contained in:
1 parent
5f00b6a59a
commit
3f72985dfa
3 files changed
+41
-1
No files matched your search
@@ -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)
|
||||
|
||||
@@ -381,7 +381,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
|
||||
&AuraEffect::HandlePreventResurrection, //314 SPELL_AURA_PREVENT_RESURRECTION todo
|
||||
&AuraEffect::HandleNoImmediateEffect, //315 SPELL_AURA_UNDERWATER_WALKING todo
|
||||
&AuraEffect::HandleNoImmediateEffect, //316 unused (4.3.4) old SPELL_AURA_PERIODIC_HASTE
|
||||
&AuraEffect::HandleNULL, //317 SPELL_AURA_MOD_SPELL_POWER_PCT
|
||||
&AuraEffect::HandleAuraModSpellPowerPct, //317 SPELL_AURA_MOD_SPELL_POWER_PCT
|
||||
&AuraEffect::HandleMastery, //318 SPELL_AURA_MASTERY
|
||||
&AuraEffect::HandleModMeleeSpeedPct, //319 SPELL_AURA_MOD_MELEE_HASTE_3
|
||||
&AuraEffect::HandleAuraModRangedHaste, //320 SPELL_AURA_MOD_RANGED_HASTE_2
|
||||
@@ -5125,6 +5125,17 @@ void AuraEffect::HandlePreventResurrection(AuraApplication const* aurApp, uint8
|
||||
aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_RELEASE_TIMER);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModSpellPowerPct(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
{
|
||||
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
|
||||
return;
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (Player* player = target->ToPlayer())
|
||||
player->UpdateSpellDamageAndHealingBonus();
|
||||
}
|
||||
|
||||
void AuraEffect::HandleMastery(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
|
||||
{
|
||||
if (!(mode & AURA_EFFECT_HANDLE_REAL))
|
||||
|
||||
@@ -294,6 +294,7 @@ class TC_GAME_API AuraEffect
|
||||
void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSpellPowerPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleMastery(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraForceWeather(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleEnableAltPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
|
||||
Reference in new issue
Block a user