Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class item_custom_summon : public ItemScript
- {
- public:
- item_custom_summon() : ItemScript("item_custom_summon") {}
- bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/)
- {
- if ((pPlayer->isInFlight()) || (pPlayer->isDead()))
- {
- pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
- return false;
- }
- if (pPlayer->IsMounted())
- {
- pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
- return false;
- }
- if (pPlayer->InBattleground())
- {
- pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
- return false;
- }
- pPlayer->SummonCreature(1700, pPlayer->GetPositionX()+1, pPlayer->GetPositionY(), pPlayer->GetPositionZ()+2, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- return false;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement