diff options
| author | Sorikoff <46191832+Sorikoff@users.noreply.github.com> | 2020-02-08 21:55:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-08 20:55:09 +0100 |
| commit | 53657441aa024ce9db42467a3bf52181b26e4c56 (patch) | |
| tree | 5447b71d3998b9c2d5596882a0fc178cd7d3a142 /src/server/scripts | |
| parent | 98d6c501d7c1a7a632c6ff8b1d46c7d0d4ae5b37 (diff) | |
Scripts/Spells: Nourish (#24057)
* Scripts/Spells: Nourish
* Rename 9999_99_99_99_world.sql to 2020_02_08_02_world.sql
* Update 2020_02_08_02_world.sql
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 9aba151bbeb..94c027853a4 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -90,7 +90,8 @@ enum DruidSpells SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721, SPELL_DRUID_BARKSKIN_01 = 63058, SPELL_DRUID_RESTORATION_T10_2P_BONUS = 70658, - SPELL_DRUID_FRENZIED_REGENERATION_HEAL = 22845 + SPELL_DRUID_FRENZIED_REGENERATION_HEAL = 22845, + SPELL_DRUID_GLYPH_OF_NOURISH = 62971 }; enum MiscSpells @@ -967,6 +968,39 @@ private: } }; +// 50464 - Nourish +class spell_dru_nourish : public SpellScript +{ + PrepareSpellScript(spell_dru_nourish); + + void HandleHeal(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + + // Glyph of Nourish + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DRUID_GLYPH_OF_NOURISH, EFFECT_0)) + { + uint32 auraCount = 0; + int32 heal = GetHitHeal(); + + Unit::AuraEffectList const& periodicHeals = GetHitUnit()->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL); + for (AuraEffect const* hot : periodicHeals) + { + if (caster->GetGUID() == hot->GetCasterGUID()) + ++auraCount; + } + + AddPct(heal, aurEff->GetAmount() * auraCount); + SetHitHeal(heal); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_dru_nourish::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } +}; + // 16864 - Omen of Clarity class spell_dru_omen_of_clarity : public AuraScript { @@ -1884,6 +1918,7 @@ void AddSC_druid_spell_scripts() RegisterAuraScript(spell_dru_living_seed); RegisterAuraScript(spell_dru_living_seed_proc); RegisterAuraScript(spell_dru_moonkin_form_passive); + RegisterSpellScript(spell_dru_nourish); RegisterAuraScript(spell_dru_omen_of_clarity); RegisterAuraScript(spell_dru_owlkin_frenzy); RegisterAuraScript(spell_dru_predatory_strikes); |
