From c6dd149f1bbbdb66fdbe50515c5901da1d37d274 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 14 Jun 2012 21:11:37 +0200 Subject: Core/Spells: Fix Curse of Doom (thx to Warpten / joschiwald for helping) --- src/server/game/Spells/Auras/SpellAuras.cpp | 11 +------ src/server/scripts/Spells/spell_warlock.cpp | 48 +++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 9456a219274..a1ac69826c4 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1373,17 +1373,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_WARLOCK: if (!caster) break; - // Curse of Doom - if (GetSpellInfo()->SpellFamilyFlags[1] & 0x02) - { - if (removeMode == AURA_REMOVE_BY_DEATH) - { - if (caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target)) - caster->CastSpell(target, 18662, true, NULL, GetEffect(0)); - } - } // Improved Fear - else if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400) + if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400) { if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_WARLOCK, 98, 0)) { diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 1b24a9ec09f..be10efc8eae 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -39,6 +39,7 @@ enum WarlockSpells WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, WARLOCK_HAUNT_HEAL = 48210, WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, + WARLOCK_CURSE_OF_DOOM_EFFECT = 18662, }; class spell_warl_banish : public SpellScriptLoader @@ -625,6 +626,52 @@ class spell_warl_unstable_affliction : public SpellScriptLoader } }; +class spell_warl_curse_of_doom : public SpellScriptLoader +{ + public: + spell_warl_curse_of_doom() : SpellScriptLoader("spell_warl_curse_of_doom") { } + + class spell_warl_curse_of_doom_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_curse_of_doom_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(WARLOCK_CURSE_OF_DOOM_EFFECT)) + return false; + return true; + } + + bool Load() + { + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (!GetCaster()) + return; + + AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode(); + if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired()) + return; + + if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget())) + GetCaster()->CastSpell(GetTarget(), WARLOCK_CURSE_OF_DOOM_EFFECT, true, NULL, aurEff); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_curse_of_doom_AuraScript(); + } +}; + void AddSC_warlock_spell_scripts() { new spell_warl_banish(); @@ -639,4 +686,5 @@ void AddSC_warlock_spell_scripts() new spell_warl_demonic_circle_teleport(); new spell_warl_haunt(); new spell_warl_unstable_affliction(); + new spell_warl_curse_of_doom(); } -- cgit v1.2.3