diff options
author | jackpoz <giacomopoz@gmail.com> | 2014-08-24 13:37:44 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2014-08-24 13:38:54 +0200 |
commit | 05d9dcd37f5a124eed5ee370fe59c224de6949a5 (patch) | |
tree | 2f0b4fc0eefbe593505d2c18f27bda43f131c751 /src | |
parent | 9ef63d7e8de30b32045faa4ff3abcdcc7a54cbc7 (diff) | |
parent | 92068907f53719212ce84aa0832947f49294f3e8 (diff) |
Merge branch 'Xanvia/ShoR' into 4.3.4
Close pull request #9071
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 53e86c586a5..e6ad3e83477 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1078,6 +1078,55 @@ class spell_pal_sacred_shield : public SpellScriptLoader } }; +// 53600 - Shield of the Righteous +/// Updated 4.3.4 +class spell_pal_shield_of_the_righteous : public SpellScriptLoader +{ + public: + spell_pal_shield_of_the_righteous() : SpellScriptLoader("spell_pal_shield_of_the_righteous") { } + + class spell_pal_shield_of_the_righteous_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_shield_of_the_righteous_SpellScript); + + bool Load() + { + if (GetCaster()->GetTypeId() != TYPEID_PLAYER) + return false; + + if (GetCaster()->ToPlayer()->getClass() != CLASS_PALADIN) + return false; + + return true; + } + + void ChangeDamage(SpellEffIndex /*effIndex*/) + { + int32 damage = GetHitDamage(); + + // Because 1 Holy Power (HP) is consumed when casting spell, + // GetPower(POWER_HOLY_POWER) will return 0 when player has 1 HP, + // return 1 at 2 HP, and 2 at 3 HP + int32 hp = GetCaster()->GetPower(POWER_HOLY_POWER); + + // Holy Power Scaling: 3 times damage at 2 HP, 6 times at 3 HP + damage *= 0.5*hp*hp + 1.5*hp + 1; + + SetHitDamage(damage); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pal_shield_of_the_righteous_SpellScript::ChangeDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pal_shield_of_the_righteous_SpellScript(); + } +}; + // 85256 - Templar's Verdict /// Updated 4.3.4 class spell_pal_templar_s_verdict : public SpellScriptLoader @@ -1218,6 +1267,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); new spell_pal_sacred_shield(); + new spell_pal_shield_of_the_righteous(); new spell_pal_templar_s_verdict(); new spell_pal_seal_of_righteousness(); } |