From 907fc00f191fe6e1c7ad0362c30b093f961bb6a7 Mon Sep 17 00:00:00 2001 From: Matan Shukry Date: Tue, 16 Feb 2021 00:04:04 +0200 Subject: Scripts/Spells: Casting druid spell Prowl will now auto shapeshift into cat form (#26088) --- src/server/scripts/Spells/spell_druid.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 9455ba2b6bc..49f120cc00c 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -68,7 +68,8 @@ enum DruidSpells SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721, SPELL_DRUID_RESTORATION_T10_2P_BONUS = 70658, SPELL_DRUID_SUNFIRE_DAMAGE = 164815, - SPELL_DRUID_SURVIVAL_INSTINCTS = 50322 + SPELL_DRUID_SURVIVAL_INSTINCTS = 50322, + SPELL_DRUID_CAT_FORM = 768 }; // 1850 - Dash @@ -494,6 +495,29 @@ public: } }; +// 5215 - Prowl +class spell_dru_prowl : public SpellScript +{ + PrepareSpellScript(spell_dru_prowl); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DRUID_CAT_FORM }); + } + + void HandleOnCast() + { + // Change into cat form + if (GetCaster()->GetShapeshiftForm() != FORM_CAT_FORM) + GetCaster()->CastSpell(GetCaster(), SPELL_DRUID_CAT_FORM); + } + + void Register() override + { + BeforeCast += SpellCastFn(spell_dru_prowl::HandleOnCast); + } +}; + // 1079 - Rip class spell_dru_rip : public SpellScriptLoader { @@ -1499,6 +1523,7 @@ void AddSC_druid_spell_scripts() new spell_dru_moonfire(); new spell_dru_omen_of_clarity(); new spell_dru_predatory_strikes(); + RegisterSpellScript(spell_dru_prowl); new spell_dru_rip(); new spell_dru_savage_roar(); new spell_dru_stampede(); -- cgit v1.2.3