From 5ef1a67a27e869da6a5f511e344b8235dd541784 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 17 Mar 2018 18:55:06 +0100 Subject: [PATCH] Core/Spells: fix Fel Armor healing effect --- .../4.3.4/custom_2018_03_17_03_world.sql | 7 ++++ src/server/scripts/Spells/spell_warlock.cpp | 37 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 sql/updates/world/4.3.4/custom_2018_03_17_03_world.sql diff --git a/sql/updates/world/4.3.4/custom_2018_03_17_03_world.sql b/sql/updates/world/4.3.4/custom_2018_03_17_03_world.sql new file mode 100644 index 0000000000..8a7448e504 --- /dev/null +++ b/sql/updates/world/4.3.4/custom_2018_03_17_03_world.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_warl_fel_armor'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(28176, 'spell_warl_fel_armor'); + +DELETE FROM `spell_proc` WHERE `SpellId`= 28176; +INSERT INTO `spell_proc` (`SpellId`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`) VALUES +(28176, 0x00050000, 0x00000001, 0x00000002, 0, 0x0000010 | 0x0000040); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 71c85173b2..10cc0dec82 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -50,6 +50,7 @@ enum WarlockSpells SPELL_WARLOCK_DRAIN_LIFE_HEAL = 89653, SPELL_WARLOCK_DRAIN_LIFE_SOULBURN = 89420, SPELL_WARLOCK_SOULBURN_DRAIN_LIFE = 74434, + SPELL_WARLOCK_FEL_ARMOR_HEAL = 96379, SPELL_WARLOCK_FEL_SYNERGY_HEAL = 54181, SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME = 63311, SPELL_WARLOCK_GLYPH_OF_SIPHON_LIFE = 63106, @@ -1623,6 +1624,41 @@ class spell_warl_drain_soul : public SpellScriptLoader } }; +// 28176 - Fel Armor +class spell_warl_fel_armor : public SpellScriptLoader +{ + public: + spell_warl_fel_armor() : SpellScriptLoader("spell_warl_fel_armor") { } + + class spell_warl_fel_armor_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_fel_armor_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_WARLOCK_FEL_ARMOR_HEAL }); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 bp = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()); + if (Unit* caster = GetCaster()) + caster->CastCustomSpell(caster, SPELL_WARLOCK_FEL_ARMOR_HEAL, &bp, 0, 0, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_warl_fel_armor_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_warl_fel_armor_AuraScript(); + } +}; + void AddSC_warlock_spell_scripts() { new spell_warl_aftermath(); @@ -1640,6 +1676,7 @@ void AddSC_warlock_spell_scripts() new spell_warl_everlasting_affliction(); new spell_warl_fel_flame(); new spell_warl_fel_synergy(); + new spell_warl_fel_armor(); new spell_warl_glyph_of_shadowflame(); new spell_warl_haunt(); new spell_warl_health_funnel();