fix(Scripts/Spells): Druid Dash require Cat Form (#17343)
This commit is contained in:
@@ -388,20 +388,25 @@ class spell_dru_treant_scaling : public AuraScript
|
|||||||
};
|
};
|
||||||
|
|
||||||
// -1850 - Dash
|
// -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
|
Unit* caster = GetCaster();
|
||||||
if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT)
|
if (caster->GetShapeshiftForm() != FORM_CAT)
|
||||||
amount = 0;
|
{
|
||||||
|
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_IN_CAT_FORM);
|
||||||
|
return SPELL_FAILED_CUSTOM_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SPELL_CAST_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_dash::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_INCREASE_SPEED);
|
OnCheckCast += SpellCheckCastFn(spell_dru_dash::CheckCast);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user