aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 45722e38267..63178261bf3 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -187,6 +187,34 @@ class spell_warl_create_healthstone : public SpellScript
}
};
+// 108416 - Dark Pact
+class spell_warl_dark_pact : public AuraScript
+{
+ PrepareAuraScript(spell_warl_dark_pact);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 }, { spellInfo->Id, EFFECT_2 } });
+ }
+
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
+ {
+ canBeRecalculated = false;
+ if (Unit* caster = GetCaster())
+ {
+ float extraAmount = caster->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()) * 2.5f;
+ int32 absorb = caster->CountPctFromCurHealth(GetEffectInfo(EFFECT_1).CalcValue(caster));
+ caster->SetHealth(caster->GetHealth() - absorb);
+ amount = CalculatePct(absorb, GetEffectInfo(EFFECT_2).CalcValue(caster)) + extraAmount;
+ }
+ }
+
+ void Register() override
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_dark_pact::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ }
+};
+
// 48018 - Demonic Circle: Summon
class spell_warl_demonic_circle_summon : public AuraScript
{
@@ -998,6 +1026,7 @@ void AddSC_warlock_spell_scripts()
RegisterSpellScript(spell_warl_chaos_bolt);
RegisterSpellScript(spell_warl_chaotic_energies);
RegisterSpellScript(spell_warl_create_healthstone);
+ RegisterSpellScript(spell_warl_dark_pact);
RegisterSpellScript(spell_warl_demonic_circle_summon);
RegisterSpellScript(spell_warl_demonic_circle_teleport);
RegisterSpellScript(spell_warl_devour_magic);