Core/Scripts: apply resilience on Vampiric Touch and Unstable Affliction dispel effect

- Spell with SPELL_ATTR4_FIXED_DAMAGE won't do it by itself to avoid applying resilience twice, but because those are triggered from a periodic aura, those apply resilience on tick, not saved to amount.
- This is one of the cases where you have to call Unit::SpellDamageBonusTaken directly

Closes #21393

(cherry picked from commit 3753ec5647)
This commit is contained in:
ariel-
2018-02-22 02:37:00 -03:00
committed by funjoker
parent 8e7a12a87a
commit 5e7a11f88d
2 changed files with 14 additions and 3 deletions

View File

@@ -1209,8 +1209,12 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
{
// backfire damage
int32 bp = aurEff->GetAmount();
bp = target->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), bp, DOT);
bp *= 8;
CastSpellExtraArgs args(aurEff);
args.AddSpellBP0(aurEff->GetAmount() * 8);
args.AddSpellBP0(bp);
caster->CastSpell(target, SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, args);
}
}

View File

@@ -904,13 +904,20 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
void HandleDispel(DispelInfo* dispelInfo)
{
if (Unit* caster = GetCaster())
{
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
{
Unit* target = dispelInfo->GetDispeller();
int32 bp = aurEff->GetAmount();
bp = target->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), bp, DOT);
bp *= 9;
// backfire damage and silence
CastSpellExtraArgs args(aurEff);
args.AddSpellBP0(aurEff->GetAmount() * 9);
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, args);
args.AddSpellBP0(bp);
caster->CastSpell(target, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, args);
}
}
}
void Register() override