From 7fe99b1a43dd6fc65dd0955684e7521aa9f72fb0 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 3 May 2019 23:55:19 +0200 Subject: [PATCH] Core/Spells: fixed Empowered Touch talent --- .../custom/custom_2019_05_03_01_world.sql | 14 +++++ src/server/scripts/Spells/spell_druid.cpp | 56 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 sql/updates/world/custom/custom_2019_05_03_01_world.sql diff --git a/sql/updates/world/custom/custom_2019_05_03_01_world.sql b/sql/updates/world/custom/custom_2019_05_03_01_world.sql new file mode 100644 index 00000000000..9b3455a10dd --- /dev/null +++ b/sql/updates/world/custom/custom_2019_05_03_01_world.sql @@ -0,0 +1,14 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN +('spell_dru_empowered_touch', +'spell_dru_empowered_touch_script'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-33879, 'spell_dru_empowered_touch'), +(88433, 'spell_dru_empowered_touch_script'); + +SET @FAMILY_FLAGS0 := 0 | 0x00000020 | 0x00000040; +SET @FAMILY_FLAGS1 := 0 | 0x02000000; + +DELETE FROM `spell_proc` WHERE `SpellId` IN (-33879); +INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `Cooldown`, `Charges`, `Chance`) VALUES +(-33879, 7, @FAMILY_FLAGS0, @FAMILY_FLAGS1, 0, 0x00004000, 2, 2, 0, 16, 0, 0, 100); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index d6d17ac578c..e3355971e0b 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -59,6 +59,7 @@ enum DruidSpells SPELL_DRUID_FUNGAL_GROWTH_SUMMON_R2 = 81283, SPELL_DRUID_FUROR_ENERGIZE_RAGE = 17057, SPELL_DRUID_FUROR_ENERGIZE_ENERGY = 17099, + SPELL_DRUID_EMPOWERED_TOUCH_SCRIPT = 88433, SPELL_DRUID_FURY_OF_STORMRAGE = 81093, SPELL_DRUID_GLYPH_OF_INNERVATE = 54833, SPELL_DRUID_GLYPH_OF_STARFIRE = 54846, @@ -73,6 +74,7 @@ enum DruidSpells SPELL_DRUID_KING_OF_THE_JUNGLE = 48492, SPELL_DRUID_LEADER_OF_THE_PACK_HEAL = 34299, SPELL_DRUID_LEADER_OF_THE_PACK_ENERGIZE = 68285, + SPELL_DRUID_LIFEBLOOM = 33763, SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL = 33778, SPELL_DRUID_LIVING_SEED_HEAL = 48503, @@ -1621,6 +1623,58 @@ class spell_dru_ferocious_bite : public SpellScript } }; +// -33879 - Empowered Touch +class spell_dru_empowered_touch : public AuraScript +{ + PrepareAuraScript(spell_dru_empowered_touch); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DRUID_EMPOWERED_TOUCH_SCRIPT }); + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + return roll_chance_i(GetEffect(EFFECT_1)->GetAmount()); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* target = GetTarget(); + target->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_EMPOWERED_TOUCH_SCRIPT, true, nullptr, aurEff); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_dru_empowered_touch::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_dru_empowered_touch::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); + } +}; + +// 88433 - Empowered Touch +class spell_dru_empowered_touch_script : public SpellScript +{ + PrepareSpellScript(spell_dru_empowered_touch_script); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DRUID_LIFEBLOOM }); + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Aura* aura = GetHitUnit()->GetAura(SPELL_DRUID_LIFEBLOOM, caster->GetGUID())) + aura->RefreshDuration(); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_dru_empowered_touch_script::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_druid_spell_scripts() { RegisterAuraScript(spell_dru_berserk); @@ -1631,6 +1685,8 @@ void AddSC_druid_spell_scripts() RegisterAuraScript(spell_dru_effloresence); RegisterAuraScript(spell_dru_effloresence_aoe); RegisterSpellScript(spell_dru_effloresence_heal); + RegisterAuraScript(spell_dru_empowered_touch); + RegisterSpellScript(spell_dru_empowered_touch_script); RegisterAuraScript(spell_dru_enrage); RegisterSpellScript(spell_dru_ferocious_bite); RegisterAuraScript(spell_dru_furor);