diff options
author | Matan Shukry <matanshukry@gmail.com> | 2021-02-16 00:04:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-15 23:04:04 +0100 |
commit | 907fc00f191fe6e1c7ad0362c30b093f961bb6a7 (patch) | |
tree | 7f50fff20d4e7176af9670eb7d581972804daf32 /src | |
parent | 8581bf28158754625ed606d8d0bb379efd3971db (diff) |
Scripts/Spells: Casting druid spell Prowl will now auto shapeshift into cat form (#26088)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
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(); |