From 547628fe7014fa0191bb0348d8cde7bfaf9f985d Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 30 Sep 2023 17:59:15 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/Spells):=20Fix=20Dash=20applying=20?= =?UTF-8?q?bonuses=20in=20other=20forms=20(restor=E2=80=A6=20(#17393)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/Spells): Fix Dash applying bonuses in other forms (restores previous code functionality) --- src/server/scripts/Spells/spell_druid.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 27f3cdece..fafeb286a 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -410,6 +410,26 @@ class spell_dru_dash : public SpellScript } }; +// -1850 - Dash +class spell_dru_dash_aura : public AuraScript +{ + PrepareAuraScript(spell_dru_dash_aura); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + // do not set speed if not in cat form + if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT) + { + amount = 0; + } + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_dash_aura::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_INCREASE_SPEED); + } +}; + // 5229 - Enrage class spell_dru_enrage : public AuraScript { @@ -1185,7 +1205,7 @@ void AddSC_druid_spell_scripts() RegisterSpellScript(spell_dru_barkskin); RegisterSpellScript(spell_dru_treant_scaling); RegisterSpellScript(spell_dru_berserk); - RegisterSpellScript(spell_dru_dash); + RegisterSpellAndAuraScriptPair(spell_dru_dash, spell_dru_dash_aura); RegisterSpellScript(spell_dru_enrage); RegisterSpellScript(spell_dru_glyph_of_starfire); RegisterSpellScript(spell_dru_idol_lifebloom);