Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. if (!CanBuyItemFromVendorSlot(vendorguid, creature->GetEntry(), item, count))
  2. return false;
  3.  
  4. if ((bag == NULL_BAG && slot == NULL_SLOT) || IsInventoryPos(bag, slot))
  5. {
  6. if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, true))
  7. return false;
  8. }
  9. else if (IsEquipmentPos(bag, slot))
  10. {
  11. if (pProto->BuyCount * count != 1)
  12. {
  13. SendEquipError(EQUIP_ERR_ITEM_CANT_BE_EQUIPPED, nullptr, nullptr);
  14. return false;
  15. }
  16. if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, false))
  17. return false;
  18. }
  19. else
  20. {
  21. SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
  22. return false;
  23. }
  24.  
  25. return crItem->maxcount != 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement