diff --git a/sql/updates/world/custom/custom_2018_07_08_04_world.sql b/sql/updates/world/custom/custom_2018_07_08_04_world.sql new file mode 100644 index 00000000000..0320c5f0e9e --- /dev/null +++ b/sql/updates/world/custom/custom_2018_07_08_04_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_dru_moonfire'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(16913, 'spell_dru_moonfire'); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 70879fd6905..cd6e744c004 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1844,6 +1844,43 @@ class spell_dru_wild_mushroom_detonate : public SpellScript } }; +// 16913 - Moonfire (Passive) +class spell_dru_moonfire : public AuraScript +{ + PrepareAuraScript(spell_dru_moonfire); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_DRUID_LUNAR_ECLIPSE_MARKER, + SPELL_DRUID_SOLAR_ECLIPSE_MARKER, + SPELL_DRUID_SOLAR_ECLIPSE, + SPELL_DRUID_LUNAR_ECLIPSE, + SPELL_DRUID_SOLAR_ECLIPSE_SUNFIRE + }); + } + + void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE_SUNFIRE); + caster->RemoveAurasDueToSpell(SPELL_DRUID_LUNAR_ECLIPSE_MARKER); + caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE_MARKER); + caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE); + caster->RemoveAurasDueToSpell(SPELL_DRUID_LUNAR_ECLIPSE); + caster->SetPower(POWER_ECLIPSE, 0); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_dru_moonfire::RemoveEffect, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL); + } +}; + void AddSC_druid_spell_scripts() { RegisterAuraScript(spell_dru_berserk); @@ -1865,6 +1902,7 @@ void AddSC_druid_spell_scripts() new spell_dru_lifebloom(); new spell_dru_living_seed(); new spell_dru_living_seed_proc(); + RegisterAuraScript(spell_dru_moonfire); new spell_dru_predatory_strikes(); new spell_dru_rejuvenation(); new spell_dru_rip();