diff options
author | Faq <ainarsh@gmail.com> | 2012-09-18 23:19:31 +0300 |
---|---|---|
committer | Faq <ainarsh@gmail.com> | 2012-09-18 23:28:46 +0300 |
commit | 0e7ed5ec857706f27378b00773aa46b8825c3f27 (patch) | |
tree | cc1220c7797237fd247351381c17fe0d565aaa26 /src/server/scripts | |
parent | 378f83df4e363b1160291d411e7c31f78e604358 (diff) |
Core/Spells: Implementing some hooks for split damage taken, fixes the limitation of dmg such auras can split, for example at Hand of Sacrifice. Might have unexpected results, but they are called unexpected for a reason.. .Author Tibbi
closes #6025
Made new one as https://github.com/TrinityCore/TrinityCore/pull/7423/ was closed.
Diffstat (limited to 'src/server/scripts')
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 0bf2e5664a0..43c4dc139a3 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -47,6 +47,8 @@ enum PaladinSpells SPELL_FORBEARANCE = 25771, SPELL_AVENGING_WRATH_MARKER = 61987, SPELL_IMMUNE_SHIELD_MARKER = 61988, + + SPELL_HAND_OF_SACRIFICE = 6940, }; // 31850 - Ardent Defender @@ -566,6 +568,52 @@ class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader } }; +class spell_pal_hand_of_sacrifice : public SpellScriptLoader +{ + public: + spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { } + + class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); + + uint32 splitPct; + int32 remainingAmount; + Unit* caster; + + bool Load() + { + caster = GetCaster(); + if (!caster) + return false; + remainingAmount = caster->GetMaxHealth(); + splitPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + return true; + } + + void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) + { + remainingAmount -= splitAmount; + + if (remainingAmount <= 0) + { + Unit* target = GetTarget(); + target->RemoveAura(SPELL_HAND_OF_SACRIFICE); + } + } + + void Register() + { + OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pal_hand_of_sacrifice_AuraScript(); + } +}; + void AddSC_paladin_spell_scripts() { new spell_pal_ardent_defender(); @@ -579,4 +627,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); new spell_pal_exorcism_and_holy_wrath_damage(); + new spell_pal_hand_of_sacrifice(); } |