diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 19 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 37 |
2 files changed, 36 insertions, 20 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 943a197e6da..116dac3c4ab 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1281,25 +1281,6 @@ void Spell::EffectHeal(SpellEffIndex effIndex) if (!unitCaster->HasAura(54824)) unitTarget->RemoveAura(targetAura->GetId(), targetAura->GetCasterGUID()); } - // Nourish - else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x2000000) - { - addhealth = unitCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL, effIndex, { }); - - // Glyph of Nourish - if (AuraEffect const* aurEff = unitCaster->GetAuraEffect(62971, 0)) - { - uint32 auraCount = 0; - Unit::AuraEffectList const& periodicHeals = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL); - for (AuraEffect const* hot : periodicHeals) - { - if (unitCaster->GetGUID() == hot->GetCasterGUID()) - ++auraCount; - } - - AddPct(addhealth, aurEff->GetAmount() * auraCount); - } - } // Death Pact - return pct of max health to caster else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) addhealth = unitCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, int32(unitCaster->CountPctFromMaxHealth(damage)), HEAL, effIndex, { }); 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); |
