diff options
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 132 |
1 files changed, 80 insertions, 52 deletions
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 7f712dfc8a2..c8329a74b47 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -36,6 +36,57 @@ enum WarlockSpells WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, }; +class spell_warl_banish : public SpellScriptLoader +{ +public: + spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { } + + class spell_warl_banish_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_banish_SpellScript); + + bool Load() + { + _removed = false; + return true; + } + + void HandleBanish() + { + if (Unit* target = GetHitUnit()) + { + if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0)) + { + //No need to remove old aura since its removed due to not stack by current Banish aura + PreventHitDefaultEffect(EFFECT_0); + PreventHitDefaultEffect(EFFECT_1); + PreventHitDefaultEffect(EFFECT_2); + _removed = true; + } + } + } + + void RemoveAura() + { + if (_removed) + PreventHitAura(); + } + + void Register() + { + BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish); + AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura); + } + + bool _removed; + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_banish_SpellScript(); + } +}; + // 47193 Demonic Empowerment class spell_warl_demonic_empowerment : public SpellScriptLoader { @@ -204,88 +255,65 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; -class spell_warl_seed_of_corruption : public SpellScriptLoader +// 18541 Ritual of Doom Effect +class spell_warl_ritual_of_doom_effect : public SpellScriptLoader { - public: - spell_warl_seed_of_corruption() : SpellScriptLoader("spell_warl_seed_of_corruption") { } +public: + spell_warl_ritual_of_doom_effect() : SpellScriptLoader("spell_warl_ritual_of_doom_effect") { } - class spell_warl_seed_of_corruption_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warl_seed_of_corruption_SpellScript); - - void FilterTargets(std::list<Unit*>& unitList) - { - unitList.remove(GetTargetUnit()); - } + class spell_warl_ritual_of_doom_effect_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_ritual_of_doom_effect_SpellScript); - void Register() - { - OnUnitTargetSelect += SpellUnitTargetFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true); + } - SpellScript* GetSpellScript() const + void Register() { - return new spell_warl_seed_of_corruption_SpellScript(); + OnEffect += SpellEffectFn(spell_warl_ritual_of_doom_effect_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_ritual_of_doom_effect_SpellScript(); + } }; -class spell_warl_banish : public SpellScriptLoader +class spell_warl_seed_of_corruption : public SpellScriptLoader { public: - spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { } + spell_warl_seed_of_corruption() : SpellScriptLoader("spell_warl_seed_of_corruption") { } - class spell_warl_banish_SpellScript : public SpellScript + class spell_warl_seed_of_corruption_SpellScript : public SpellScript { - PrepareSpellScript(spell_warl_banish_SpellScript); - - bool Load() - { - _removed = false; - return true; - } - - void HandleBanish() - { - if (Unit* target = GetHitUnit()) - { - if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0)) - { - //No need to remove old aura since its removed due to not stack by current Banish aura - PreventHitDefaultEffect(EFFECT_0); - PreventHitDefaultEffect(EFFECT_1); - PreventHitDefaultEffect(EFFECT_2); - _removed = true; - } - } - } + PrepareSpellScript(spell_warl_seed_of_corruption_SpellScript); - void RemoveAura() + void FilterTargets(std::list<Unit*>& unitList) { - if (_removed) - PreventHitAura(); + unitList.remove(GetTargetUnit()); } void Register() { - BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish); - AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura); + OnUnitTargetSelect += SpellUnitTargetFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } - - bool _removed; }; SpellScript* GetSpellScript() const { - return new spell_warl_banish_SpellScript(); + return new spell_warl_seed_of_corruption_SpellScript(); } }; void AddSC_warlock_spell_scripts() { + new spell_warl_banish(); new spell_warl_demonic_empowerment(); new spell_warl_create_healthstone(); new spell_warl_everlasting_affliction(); + new spell_warl_ritual_of_doom_effect(); new spell_warl_seed_of_corruption(); - new spell_warl_banish(); } |
