diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index d7da1c33c..27f3cdece 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -388,20 +388,25 @@ class spell_dru_treant_scaling : public AuraScript }; // -1850 - Dash -class spell_dru_dash : public AuraScript +class spell_dru_dash : public SpellScript { - PrepareAuraScript(spell_dru_dash); + PrepareSpellScript(spell_dru_dash); - void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + SpellCastResult CheckCast() { - // do not set speed if not in cat form - if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT) - amount = 0; + Unit* caster = GetCaster(); + if (caster->GetShapeshiftForm() != FORM_CAT) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_IN_CAT_FORM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; } void Register() override { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_dash::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_INCREASE_SPEED); + OnCheckCast += SpellCheckCastFn(spell_dru_dash::CheckCast); } };