Merge pull request #16585 from Treeston/3.3.5-flightform

Core/Spells: Disallow druid flight form while shapeshifted
(cherry picked from commit 101c3f9303)
This commit is contained in:
Shauren
2016-02-13 23:56:11 +01:00
parent c0202e2365
commit da0dec4294
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
--
DELETE FROM `spell_script_names` WHERE `spell_id` IN (-33943, 33943, 40120);
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (-33943, "spell_dru_flight_form");

View File

@@ -1018,6 +1018,37 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
}
};
// -33943 - Flight Form
class spell_dru_flight_form : public SpellScriptLoader
{
public:
spell_dru_flight_form() : SpellScriptLoader("spell_dru_flight_form") { }
class spell_dru_flight_form_SpellScript : public SpellScript
{
PrepareSpellScript(spell_dru_flight_form_SpellScript);
SpellCastResult CheckCast()
{
Unit* caster = GetCaster();
if (caster->IsInDisallowedMountForm())
return SPELL_FAILED_NOT_SHAPESHIFT;
return SPELL_CAST_OK;
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_dru_flight_form_SpellScript::CheckCast);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_dru_flight_form_SpellScript();
}
};
// 61391 - Typhoon
class spell_dru_typhoon : public SpellScriptLoader
{
@@ -1195,6 +1226,7 @@ void AddSC_druid_spell_scripts()
new spell_dru_stampede();
new spell_dru_survival_instincts();
new spell_dru_swift_flight_passive();
new spell_dru_flight_form();
new spell_dru_typhoon();
new spell_dru_t10_restoration_4p_bonus();
new spell_dru_wild_growth();