diff options
author | azazel <none@none> | 2010-08-18 12:26:17 +0600 |
---|---|---|
committer | azazel <none@none> | 2010-08-18 12:26:17 +0600 |
commit | c0f3a7f9efaa10283260cbedae6e7c7c9180b524 (patch) | |
tree | 67265aaf0233b22a9ac0dcf95ed3e775661cba2c /src | |
parent | 7d8146f9891e69ae1610fd19e3587b6d7048f4b5 (diff) |
Core/spells: move 20425 Guarded by the Light spell from Warlock spells to Paladin spells.
PS Well, this spell used to be in SPELLFAMILY_WARLOCK case, so it seems it never worked before. And that's why I added it to Warlock spells.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 224 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 36 |
2 files changed, 131 insertions, 129 deletions
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 53e85693526..1bac2afe0eb 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -22,9 +22,12 @@ */ #include "ScriptPCH.h" +#include "SpellAuraEffects.h" enum PaladinSpells { + PALADIN_SPELL_DIVINE_PLEA = 54428, + PALADIN_SPELL_HOLY_SHOCK_R1 = 20473, PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE = 25912, PALADIN_SPELL_HOLY_SHOCK_R1_HEALING = 25914, @@ -37,138 +40,173 @@ enum PaladinSpells class spell_pal_blessing_of_faith : public SpellHandlerScript { - public: - spell_pal_blessing_of_faith() : SpellHandlerScript("spell_pal_blessing_of_faith") { } +public: + spell_pal_blessing_of_faith() : SpellHandlerScript("spell_pal_blessing_of_faith") { } - class spell_pal_blessing_of_faith_SpellScript : public SpellScript + class spell_pal_blessing_of_faith_SpellScript : public SpellScript + { + bool Validate(SpellEntry const *spellEntry) { - bool Validate(SpellEntry const *spellEntry) - { - if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_DRUID)) - return false; - if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PALADIN)) - return false; - if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PRIEST)) - return false; - if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN)) - return false; - return true; - } + if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_DRUID)) + return false; + if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PALADIN)) + return false; + if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PRIEST)) + return false; + if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN)) + return false; + return true; + } - void HandleDummy(SpellEffIndex effIndex) + void HandleDummy(SpellEffIndex effIndex) + { + if (Unit *unitTarget = GetHitUnit()) { - if (Unit *unitTarget = GetHitUnit()) + uint32 spell_id = 0; + switch(unitTarget->getClass()) { - uint32 spell_id = 0; - switch(unitTarget->getClass()) - { - case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break; - case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break; - case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break; - case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break; - default: return; // ignore for non-healing classes - } - - GetCaster()->CastSpell(GetCaster(), spell_id, true); + case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break; + case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break; + case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break; + case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break; + default: return; // ignore for non-healing classes } - } - void Register() - { - // add dummy effect spell handler to Blessing of Faith - EffectHandlers += EffectHandlerFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + GetCaster()->CastSpell(GetCaster(), spell_id, true); } - }; + } - SpellScript *GetSpellScript() const + void Register() { - return new spell_pal_blessing_of_faith_SpellScript(); + // add dummy effect spell handler to Blessing of Faith + EffectHandlers += EffectHandlerFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } + }; + + SpellScript *GetSpellScript() const + { + return new spell_pal_blessing_of_faith_SpellScript(); + } }; -class spell_pal_holy_shock : public SpellHandlerScript +// 63521 Guarded by The Light +class spell_pal_guarded_by_the_light : public SpellHandlerScript { - public: - spell_pal_holy_shock() : SpellHandlerScript("spell_pal_holy_shock") { } +public: + spell_pal_guarded_by_the_light() : SpellHandlerScript("spell_pal_guarded_by_the_light") { } - class spell_pal_holy_shock_SpellScript : public SpellScript + class spell_pal_guarded_by_the_light_SpellScript : public SpellScript + { + bool Validate(SpellEntry const * spellEntry) { - bool Validate(SpellEntry const *spellEntry) - { - if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1)) - return false; + if (!sSpellStore.LookupEntry(PALADIN_SPELL_DIVINE_PLEA)) + return false; + return true; + } - // can't use other spell than holy shock due to spell_ranks dependency - if (sSpellMgr.GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr.GetFirstSpellInChain(spellEntry->Id)) - return false; + void HandleScriptEffect(SpellEffIndex effIndex) + { + // Divine Plea + if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA)) + aura->RefreshDuration(); + } - uint8 rank = sSpellMgr.GetSpellRank(spellEntry->Id); - if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true)) - return false; - if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true)) - return false; + void Register() + { + EffectHandlers += EffectHandlerFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; - return true; - } + SpellScript* GetSpellScript() const + { + return new spell_pal_guarded_by_the_light_SpellScript(); + } +}; - void HandleDummy(SpellEffIndex effIndex) - { - if (Unit *unitTarget = GetHitUnit()) - { - Unit *caster = GetCaster(); +class spell_pal_holy_shock : public SpellHandlerScript +{ +public: + spell_pal_holy_shock() : SpellHandlerScript("spell_pal_holy_shock") { } - uint8 rank = sSpellMgr.GetSpellRank(GetSpellInfo()->Id); + class spell_pal_holy_shock_SpellScript : public SpellScript + { + bool Validate(SpellEntry const *spellEntry) + { + if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1)) + return false; - if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0); - else - caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); - } - } + // can't use other spell than holy shock due to spell_ranks dependency + if (sSpellMgr.GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr.GetFirstSpellInChain(spellEntry->Id)) + return false; - void Register() + uint8 rank = sSpellMgr.GetSpellRank(spellEntry->Id); + if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true)) + return false; + if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true)) + return false; + + return true; + } + + void HandleDummy(SpellEffIndex effIndex) + { + if (Unit *unitTarget = GetHitUnit()) { - // add dummy effect spell handler to Holy Shock - EffectHandlers += EffectHandlerFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + Unit *caster = GetCaster(); + + uint8 rank = sSpellMgr.GetSpellRank(GetSpellInfo()->Id); + + if (caster->IsFriendlyTo(unitTarget)) + caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0); + else + caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); } - }; + } - SpellScript *GetSpellScript() const + void Register() { - return new spell_pal_holy_shock_SpellScript(); + // add dummy effect spell handler to Holy Shock + EffectHandlers += EffectHandlerFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } + }; + + SpellScript *GetSpellScript() const + { + return new spell_pal_holy_shock_SpellScript(); + } }; class spell_pal_judgement_of_command : public SpellHandlerScript { - public: - spell_pal_judgement_of_command() : SpellHandlerScript("spell_pal_judgement_of_command") { } +public: + spell_pal_judgement_of_command() : SpellHandlerScript("spell_pal_judgement_of_command") { } - class spell_pal_judgement_of_command_SpellScript : public SpellScript + class spell_pal_judgement_of_command_SpellScript : public SpellScript + { + void HandleDummy(SpellEffIndex effIndex) { - void HandleDummy(SpellEffIndex effIndex) - { - if (Unit *unitTarget = GetHitUnit()) - if (SpellEntry const* spell_proto = sSpellStore.LookupEntry(GetEffectValue())) - GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL); - } - - void Register() - { - // add dummy effect spell handler to Judgement of Command - EffectHandlers += EffectHandlerFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + if (Unit *unitTarget = GetHitUnit()) + if (SpellEntry const* spell_proto = sSpellStore.LookupEntry(GetEffectValue())) + GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL); + } - SpellScript *GetSpellScript() const + void Register() { - return new spell_pal_judgement_of_command_SpellScript(); + // add dummy effect spell handler to Judgement of Command + EffectHandlers += EffectHandlerFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } + }; + + SpellScript *GetSpellScript() const + { + return new spell_pal_judgement_of_command_SpellScript(); + } }; void AddSC_paladin_spell_scripts() { - new spell_pal_blessing_of_faith; - new spell_pal_holy_shock; - new spell_pal_judgement_of_command; + new spell_pal_blessing_of_faith(); + new spell_pal_guarded_by_the_light(); + new spell_pal_holy_shock(); + new spell_pal_judgement_of_command(); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index b330fd0daab..f13c35b3b54 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -27,7 +27,6 @@ enum WarlockSpells { - WARLOCK_DIVINE_PLEA = 54428, WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443, WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508, @@ -134,40 +133,6 @@ public: } }; -// 63521 Guarded by The Light -class spell_warl_guarded_by_the_light : public SpellHandlerScript -{ -public: - spell_warl_guarded_by_the_light() : SpellHandlerScript("spell_warl_guarded_by_the_light") { } - - class spell_warl_guarded_by_the_light_SpellScript : public SpellScript - { - bool Validate(SpellEntry const * spellEntry) - { - if (!sSpellStore.LookupEntry(WARLOCK_DIVINE_PLEA)) - return false; - return true; - } - - void HandleScriptEffect(SpellEffIndex effIndex) - { - // Divine Plea - if (Aura* aura = GetCaster()->GetAura(WARLOCK_DIVINE_PLEA)) - aura->RefreshDuration(); - } - - void Register() - { - EffectHandlers += EffectHandlerFn(spell_warl_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_warl_guarded_by_the_light_SpellScript(); - } -}; - // 6201 Create Healthstone (and ranks) class spell_warl_create_healthstone : public SpellHandlerScript { @@ -238,6 +203,5 @@ void AddSC_warlock_spell_scripts() { new spell_warl_demonic_empowerment(); new spell_warl_everlasting_affliction(); - new spell_warl_guarded_by_the_light(); new spell_warl_create_healthstone(); } |