fix(Script/Spells): Anti-Magic Zone amount calc (#7438)

* cherry-pick commit (bea682f95c)

Co-authored-by: Lucas Nascimento <keader.android@gmail.com>
This commit is contained in:
Kitzunu
2021-08-24 16:52:54 +02:00
committed by GitHub
parent 92acf6feb8
commit 62058ffbea

View File

@@ -1185,14 +1185,21 @@ public:
return ValidateSpellInfo({ SPELL_DK_ANTI_MAGIC_SHELL_TALENT });
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
SpellInfo const* talentSpell = sSpellMgr->AssertSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT);
amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster());
if (Unit* totem = GetCaster())
if (Unit* owner = totem->ToTotem()->GetSummoner())
amount += int32(2 * owner->GetTotalAttackPowerValue(BASE_ATTACK));
canBeRecalculated = false;
Unit* owner = GetCaster()->GetOwner();
if (!owner)
{
return;
}
amount = talentSpell->Effects[EFFECT_0].CalcValue(owner);
if (Player* player = owner->ToPlayer())
{
amount += int32(2 * player->GetTotalAttackPowerValue(BASE_ATTACK));
}
}
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)