From aedbf45750536d3e50f25b00ef0b862e6a8bea2a Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sun, 20 May 2018 15:10:15 +0200 Subject: [PATCH] Core/Spells: * updated and fixed Exorcism damage forumlar * added missing coefficients for Shield of the Righteous and Crusader Strike * updated coefficients for Holy Wrath --- .../custom/custom_2018_05_20_00_world.sql | 12 +++++ src/server/scripts/Spells/spell_paladin.cpp | 54 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 sql/updates/world/custom/custom_2018_05_20_00_world.sql diff --git a/sql/updates/world/custom/custom_2018_05_20_00_world.sql b/sql/updates/world/custom/custom_2018_05_20_00_world.sql new file mode 100644 index 00000000000..5f1b6ab7c82 --- /dev/null +++ b/sql/updates/world/custom/custom_2018_05_20_00_world.sql @@ -0,0 +1,12 @@ +DELETE FROM `spell_bonus_data` WHERE `entry` IN (53600, 35395, 879); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(53600, 0, 0, 0.1, 0, 'Paladin - Shield of the Righteous'), +(35395, 0, 0, 0.0, 0, 'Paladin - Crusader Strike'), +(879, 0, 0, 0, 0, 'Paladin - Exorcism'); + +-- Holy Wrath +UPDATE `spell_bonus_data` SET `direct_bonus`= 0.61, `dot_bonus`= 0, `ap_bonus`= 0, `ap_dot_bonus`= 0 WHERE `entry`= 2812; + +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_pal_exorcism'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(879, 'spell_pal_exorcism'); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index b139841d461..d1e46731aca 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1443,6 +1443,59 @@ class spell_pal_judgements_of_the_wise : public SpellScriptLoader } }; +// 879 - Exorcism +class spell_pal_exorcism : public SpellScriptLoader +{ + public: + spell_pal_exorcism() : SpellScriptLoader("spell_pal_exorcism") { } + + class spell_pal_exorcism_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_exorcism_SpellScript); + + void ChangeDamage(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + { + int32 damage = GetHitDamage(); + + float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.344f; + float holy = caster->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY); + holy += GetHitUnit()->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY); + holy *= 0.344f; + + SetHitDamage(damage + (holy > ap ? holy : ap)); + } + } + + void ApplyDotBonus() + { + if (Unit* target = GetHitUnit()) + if (Unit* caster = GetCaster()) + if (Aura* aura = target->GetAura(GetSpellInfo()->Id)) + { + float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.0688f; + float holy = caster->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY); + holy += GetHitUnit()->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY); + holy *= 0.0688f; + + aura->GetEffect(EFFECT_1)->SetAmount(aura->GetEffect(EFFECT_1)->GetAmount() + holy > ap ? holy : ap); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_pal_exorcism_SpellScript::ChangeDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + AfterHit += SpellHitFn(spell_pal_exorcism_SpellScript::ApplyDotBonus); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_pal_exorcism_SpellScript(); + } +}; + void AddSC_paladin_spell_scripts() { //new spell_pal_ardent_defender(); @@ -1454,6 +1507,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_divine_sacrifice(); new spell_pal_divine_storm(); new spell_pal_divine_storm_dummy(); + new spell_pal_exorcism(); new spell_pal_exorcism_and_holy_wrath_damage(); new spell_pal_eye_for_an_eye(); new spell_pal_glyph_of_holy_light();