diff options
-rw-r--r-- | sql/updates/world/3.3.5/2020_08_29_01_world.sql | 5 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 55 |
2 files changed, 34 insertions, 26 deletions
diff --git a/sql/updates/world/3.3.5/2020_08_29_01_world.sql b/sql/updates/world/3.3.5/2020_08_29_01_world.sql index 7a217df5fa1..43cf79092a3 100644 --- a/sql/updates/world/3.3.5/2020_08_29_01_world.sql +++ b/sql/updates/world/3.3.5/2020_08_29_01_world.sql @@ -1,3 +1,4 @@ -- [Druid] Nurturing Instinct -DELETE FROM `spell_script_names` WHERE `spell_id` IN (-33872, 33872, 33873); -INSERT INTO `spell_script_names` VALUES (-33872, 'spell_dru_nurturing_instinct'); +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dru_nurturing_instinct'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-33872,'spell_dru_nurturing_instinct'); 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); } |