Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. class item_custom_summon : public ItemScript
  2. {
  3. public:
  4.     item_custom_summon() : ItemScript("item_custom_summon") {}
  5.  
  6.     bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/)
  7.     {
  8.         if ((pPlayer->isInFlight()) || (pPlayer->isDead()))
  9.         {
  10.             pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
  11.             return false;
  12.         }
  13.  
  14.         if (pPlayer->IsMounted())
  15.         {
  16.             pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
  17.             return false;
  18.         }
  19.        
  20.         if (pPlayer->InBattleground())
  21.         {
  22.             pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
  23.             return false;
  24.         }
  25.        
  26.         pPlayer->SummonCreature(100000, pPlayer->GetPositionX()+1, pPlayer->GetPositionY(), pPlayer->GetPositionZ()+2, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
  27.         return false;
  28.     }
  29. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement