Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class spell_gen_allow_cast_from_item_only : public SpellScriptLoader
- {
- public:
- spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { }
- class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript);
- SpellCastResult CheckRequirement()
- {
- if (!GetCastItem())
- return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
- return SPELL_CAST_OK;
- }
- void Register()
- {
- OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement);
- }
- };
- SpellScript* GetSpellScript() const
- {
- return new spell_gen_allow_cast_from_item_only_SpellScript();
- }
- };
Add Comment
Please, Sign In to add comment