Scripts/Spells: Fix druid talent Lunar Inspiration (#28027)

This commit is contained in:
Aqua Deus
2022-06-16 12:32:40 +02:00
committed by GitHub
parent 4a8bacc634
commit 16c70f2dd5
2 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_dru_lunar_inspiration';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (155580, 'spell_dru_lunar_inspiration');

View File

@@ -77,6 +77,7 @@ enum DruidSpells
SPELL_DRUID_LANGUISH = 71023,
SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372,
SPELL_DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
SPELL_DRUID_LUNAR_INSPIRATION_OVERRIDE = 155627,
SPELL_DRUID_MANGLE = 33917,
SPELL_DRUID_MOONFIRE_DAMAGE = 164812,
SPELL_DRUID_PROWL = 5215,
@@ -810,6 +811,33 @@ class spell_dru_lifebloom : public AuraScript
}
};
// 155580 - Lunar Inspiration
class spell_dru_lunar_inspiration : public AuraScript
{
PrepareAuraScript(spell_dru_lunar_inspiration);
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_LUNAR_INSPIRATION_OVERRIDE });
}
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->CastSpell(GetTarget(), SPELL_DRUID_LUNAR_INSPIRATION_OVERRIDE, true);
}
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_LUNAR_INSPIRATION_OVERRIDE);
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_dru_lunar_inspiration::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lunar_inspiration::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
// 8921 - Moonfire
class spell_dru_moonfire : public SpellScript
{
@@ -1604,6 +1632,7 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_innervate);
RegisterSpellScript(spell_dru_item_t6_trinket);
RegisterSpellScript(spell_dru_lifebloom);
RegisterSpellScript(spell_dru_lunar_inspiration);
RegisterSpellScript(spell_dru_moonfire);
RegisterSpellScript(spell_dru_omen_of_clarity);
RegisterSpellScript(spell_dru_prowl);