diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 981db329ee0..cf7e918935a 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1003,6 +1003,36 @@ class spell_dru_nourish : public SpellScript } }; +// -33872 - Nurturing Instinct +class spell_dru_nurturing_instinct : public AuraScript +{ + PrepareAuraScript(spell_dru_nurturing_instinct); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DRUID_NURTURING_INSTINCT_R1, SPELL_DRUID_NURTURING_INSTINCT_R2 }); + } + + void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + uint32 spellId = GetSpellInfo()->GetRank() == 1 ? SPELL_DRUID_NURTURING_INSTINCT_R1 : SPELL_DRUID_NURTURING_INSTINCT_R2; + target->CastSpell(target, spellId, aurEff); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + uint32 spellId = GetSpellInfo()->GetRank() == 1 ? SPELL_DRUID_NURTURING_INSTINCT_R1 : SPELL_DRUID_NURTURING_INSTINCT_R2; + GetTarget()->RemoveAurasDueToSpell(spellId); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_dru_nurturing_instinct::AfterApply, EFFECT_0, SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dru_nurturing_instinct::AfterRemove, EFFECT_0, SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, AURA_EFFECT_HANDLE_REAL); + } +}; + // 16864 - Omen of Clarity class spell_dru_omen_of_clarity : public AuraScript { @@ -1894,29 +1924,6 @@ class spell_dru_wild_growth_aura : public AuraScript float _baseReduction = 2.f; }; -class spell_dru_nurturing_instinct : public AuraScript -{ - PrepareAuraScript(spell_dru_nurturing_instinct); - - void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Player* player = GetTarget()->ToPlayer()) - player->AddAura(GetSpellInfo()->GetRank() == 1 ? SPELL_DRUID_NURTURING_INSTINCT_R1 : SPELL_DRUID_NURTURING_INSTINCT_R2, player); - } - - void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Player* player = GetTarget()->ToPlayer()) - player->RemoveAura(GetSpellInfo()->GetRank() == 1 ? SPELL_DRUID_NURTURING_INSTINCT_R1 : SPELL_DRUID_NURTURING_INSTINCT_R2); - } - - void Register() override - { - AfterEffectApply += AuraEffectApplyFn(spell_dru_nurturing_instinct::AfterApply, EFFECT_0, SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_dru_nurturing_instinct::AfterRemove, EFFECT_0, SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, AURA_EFFECT_HANDLE_REAL); - } -}; - void AddSC_druid_spell_scripts() { RegisterSpellScript(spell_dru_barkskin); @@ -1944,6 +1951,7 @@ void AddSC_druid_spell_scripts() RegisterSpellScript(spell_dru_living_seed_proc); RegisterSpellScript(spell_dru_moonkin_form_passive); RegisterSpellScript(spell_dru_nourish); + RegisterSpellScript(spell_dru_nurturing_instinct); RegisterSpellScript(spell_dru_omen_of_clarity); RegisterSpellScript(spell_dru_owlkin_frenzy); RegisterSpellScript(spell_dru_predatory_strikes); @@ -1968,5 +1976,4 @@ void AddSC_druid_spell_scripts() RegisterSpellScript(spell_dru_t10_restoration_4p_bonus); RegisterSpellScript(spell_dru_t10_restoration_4p_bonus_dummy); RegisterSpellAndAuraScriptPair(spell_dru_wild_growth, spell_dru_wild_growth_aura); - RegisterSpellScript(spell_dru_nurturing_instinct); } |