diff options
-rw-r--r-- | sql/updates/world/master/2017_12_23_01_world.sql | 7 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 17 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 14 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 161 |
4 files changed, 129 insertions, 70 deletions
diff --git a/sql/updates/world/master/2017_12_23_01_world.sql b/sql/updates/world/master/2017_12_23_01_world.sql new file mode 100644 index 00000000000..849901121ad --- /dev/null +++ b/sql/updates/world/master/2017_12_23_01_world.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ( +'spell_pal_blessing_of_protection', +'spell_pal_divine_shield'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(1022, 'spell_pal_blessing_of_protection'), +(204018, 'spell_pal_blessing_of_protection'), +(642, 'spell_pal_divine_shield'); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 3f4287becd7..0351e769516 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1331,18 +1331,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b { switch (GetSpellInfo()->SpellFamilyName) { - case SPELLFAMILY_GENERIC: - switch (GetId()) - { - case 61987: // Avenging Wrath - // Remove the immunity shield marker on Avenging Wrath removal if Forbearance is not present - if (target->HasAura(61988) && !target->HasAura(25771)) - target->RemoveAura(61988); - break; - default: - break; - } - break; case SPELLFAMILY_MAGE: switch (GetId()) { @@ -1394,11 +1382,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (GetId() == 1784) target->RemoveAurasWithFamily(SPELLFAMILY_ROGUE, flag128(0x0000800, 0, 0, 0), target->GetGUID()); break; - case SPELLFAMILY_PALADIN: - // Remove the immunity shield marker on Forbearance removal if AW marker is not present - if (GetId() == 25771 && target->HasAura(61988) && !target->HasAura(61987)) - target->RemoveAura(61988); - break; case SPELLFAMILY_DEATHKNIGHT: break; case SPELLFAMILY_HUNTER: diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 65899f518d8..0450fa7fb6c 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2789,20 +2789,6 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint32 effMask) /// @todo move this code to scripts if (m_preCastSpell) { - // Paladin immunity shields - if (m_preCastSpell == 61988) - { - // Cast Forbearance - m_caster->CastSpell(unit, 25771, true); - // Cast Avenging Wrath Marker - unit->CastSpell(unit, 61987, true); - } - - // Avenging Wrath - if (m_preCastSpell == 61987) - // Cast the serverside immunity shield marker - m_caster->CastSpell(unit, 61988, true); - if (sSpellMgr->GetSpellInfo(m_preCastSpell)) // Blizz seems to just apply aura without bothering to cast m_caster->AddAura(m_preCastSpell, unit); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index d2260e5bae9..4c13de4c4a0 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -52,6 +52,8 @@ enum PaladinSpells SPELL_PALADIN_ENDURING_JUDGEMENT = 40472, SPELL_PALADIN_EYE_FOR_AN_EYE_RANK_1 = 9799, SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE = 25997, + SPELL_PALADIN_FINAL_STAND = 204077, + SPELL_PALADIN_FINAL_STAND_EFFECT = 204079, SPELL_PALADIN_FORBEARANCE = 25771, SPELL_PALADIN_HAND_OF_SACRIFICE = 6940, SPELL_PALADIN_HOLY_MENDING = 64891, @@ -335,6 +337,47 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader } }; +// 1022 - Blessing of Protection +// 204018 - Blessing of Spellwarding +class spell_pal_blessing_of_protection : public SpellScript +{ + PrepareSpellScript(spell_pal_blessing_of_protection); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo( + { + SPELL_PALADIN_FORBEARANCE, + // uncomment when we have serverside only spells + //SPELL_PALADIN_IMMUNE_SHIELD_MARKER + }) && spellInfo->ExcludeTargetAuraSpell == SPELL_PALADIN_IMMUNE_SHIELD_MARKER; + } + + SpellCastResult CheckForbearance() + { + Unit* target = GetExplTargetUnit(); + if (!target || target->HasAura(SPELL_PALADIN_FORBEARANCE)) + return SPELL_FAILED_TARGET_AURASTATE; + + return SPELL_CAST_OK; + } + + void TriggerForbearance() + { + if (Unit* target = GetHitUnit()) + { + GetCaster()->CastSpell(target, SPELL_PALADIN_FORBEARANCE, true); + GetCaster()->CastSpell(target, SPELL_PALADIN_IMMUNE_SHIELD_MARKER, true); + } + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_pal_blessing_of_protection::CheckForbearance); + AfterHit += SpellHitFn(spell_pal_blessing_of_protection::TriggerForbearance); + } +}; + // 115750 - Blinding Light class spell_pal_blinding_light : public SpellScript { @@ -357,6 +400,52 @@ class spell_pal_blinding_light : public SpellScript } }; +// 642 - Divine Shield +class spell_pal_divine_shield : public SpellScript +{ + PrepareSpellScript(spell_pal_divine_shield); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo( + { + SPELL_PALADIN_FINAL_STAND, + SPELL_PALADIN_FINAL_STAND_EFFECT, + SPELL_PALADIN_FORBEARANCE, + // uncomment when we have serverside only spells + //SPELL_PALADIN_IMMUNE_SHIELD_MARKER + }) && spellInfo->ExcludeCasterAuraSpell == SPELL_PALADIN_IMMUNE_SHIELD_MARKER; + } + + SpellCastResult CheckForbearance() + { + if (GetCaster()->HasAura(SPELL_PALADIN_FORBEARANCE)) + return SPELL_FAILED_TARGET_AURASTATE; + + return SPELL_CAST_OK; + } + + void HandleFinalStand() + { + if (GetCaster()->HasAura(SPELL_PALADIN_FINAL_STAND)) + GetCaster()->CastSpell((Unit*)nullptr, SPELL_PALADIN_FINAL_STAND_EFFECT, true); + } + + void TriggerForbearance() + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, SPELL_PALADIN_FORBEARANCE, true); + caster->CastSpell(caster, SPELL_PALADIN_IMMUNE_SHIELD_MARKER, true); + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_pal_divine_shield::CheckForbearance); + AfterCast += SpellCastFn(spell_pal_divine_shield::HandleFinalStand); + AfterCast += SpellCastFn(spell_pal_divine_shield::TriggerForbearance); + } +}; + // 190784 - Divine Steed class spell_pal_divine_steed : public SpellScriptLoader { @@ -868,52 +957,44 @@ class spell_pal_judgement : public SpellScriptLoader }; // 633 - Lay on Hands -class spell_pal_lay_on_hands : public SpellScriptLoader +class spell_pal_lay_on_hands : public SpellScript { - public: - spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { } + PrepareSpellScript(spell_pal_lay_on_hands); - class spell_pal_lay_on_hands_SpellScript : public SpellScript + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo( { - PrepareSpellScript(spell_pal_lay_on_hands_SpellScript); - - bool Validate(SpellInfo const* /*spell*/) override - { - return ValidateSpellInfo({ SPELL_PALADIN_FORBEARANCE, SPELL_PALADIN_IMMUNE_SHIELD_MARKER }); - } - - SpellCastResult CheckCast() - { - Unit* caster = GetCaster(); - if (Unit* target = GetExplTargetUnit()) - if (caster == target) - if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER)) - return SPELL_FAILED_TARGET_AURASTATE; - - return SPELL_CAST_OK; - } + SPELL_PALADIN_FORBEARANCE, + // uncomment when we have serverside only spells + //SPELL_PALADIN_IMMUNE_SHIELD_MARKER + }) && spellInfo->ExcludeTargetAuraSpell == SPELL_PALADIN_IMMUNE_SHIELD_MARKER; + } - void HandleScript() - { - Unit* caster = GetCaster(); - if (caster == GetHitUnit()) - { - caster->CastSpell(caster, SPELL_PALADIN_FORBEARANCE, true); - caster->CastSpell(caster, SPELL_PALADIN_IMMUNE_SHIELD_MARKER, true); - } - } + SpellCastResult CheckForbearance() + { + Unit* target = GetExplTargetUnit(); + if (!target || target->HasAura(SPELL_PALADIN_FORBEARANCE)) + return SPELL_FAILED_TARGET_AURASTATE; - void Register() override - { - OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast); - AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript); - } - }; + return SPELL_CAST_OK; + } - SpellScript* GetSpellScript() const override + void TriggerForbearance() + { + Unit* caster = GetCaster(); + if (caster == GetHitUnit()) { - return new spell_pal_lay_on_hands_SpellScript(); + GetCaster()->CastSpell(caster, SPELL_PALADIN_FORBEARANCE, true); + GetCaster()->CastSpell(caster, SPELL_PALADIN_IMMUNE_SHIELD_MARKER, true); } + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands::CheckForbearance); + AfterHit += SpellHitFn(spell_pal_lay_on_hands::TriggerForbearance); + } }; // 53651 - Light's Beacon - Beacon of Light @@ -1352,7 +1433,9 @@ void AddSC_paladin_spell_scripts() new spell_pal_aura_mastery_immune(); new spell_pal_avenging_wrath(); new spell_pal_blessing_of_faith(); + RegisterSpellScript(spell_pal_blessing_of_protection); RegisterSpellScript(spell_pal_blinding_light); + RegisterSpellScript(spell_pal_divine_shield); new spell_pal_divine_steed(); new spell_pal_divine_storm(); new spell_pal_exorcism_and_holy_wrath_damage(); @@ -1364,7 +1447,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_item_healing_discount(); new spell_pal_item_t6_trinket(); new spell_pal_judgement(); - new spell_pal_lay_on_hands(); + RegisterSpellScript(spell_pal_lay_on_hands); new spell_pal_light_s_beacon(); new spell_pal_righteous_defense(); new spell_pal_sacred_shield(); |