Guest User

Untitled

a guest
Jun 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. class spell_gen_allow_cast_from_item_only : public SpellScriptLoader
  2. {
  3. public:
  4. spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { }
  5.  
  6. class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript
  7. {
  8. PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript);
  9.  
  10. SpellCastResult CheckRequirement()
  11. {
  12. if (!GetCastItem())
  13. return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
  14.  
  15. return SPELL_CAST_OK;
  16. }
  17.  
  18. void Register()
  19. {
  20. OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement);
  21. }
  22. };
  23.  
  24. SpellScript* GetSpellScript() const
  25. {
  26. return new spell_gen_allow_cast_from_item_only_SpellScript();
  27. }
  28. };
Add Comment
Please, Sign In to add comment