Advertisement
Guest User

char_item for fixed bonus for dev

a guest
Apr 14th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. #ifdef SET_ATT_ITEM
  2. case USE_SET_ATT_COSTUME :
  3. {
  4. LPITEM item2;
  5. if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
  6. return false;
  7.  
  8. if (item2->IsEquipped())
  9. {
  10. BuffOnAttr_RemoveBuffsFromItem(item2);
  11. }
  12.  
  13. if (item2->IsExchanging() || item2->IsEquipped()) // @fixme114
  14. return false;
  15.  
  16. if ((item2->GetType() == ITEM_COSTUME) && (item2->GetSubType() == COSTUME_BODY))
  17. {
  18. if (item2->GetAttributeCount() < 2)
  19. {
  20. if (item2->HasAttr(item->GetValue(0)))
  21. {
  22. ChatPacket(CHAT_TYPE_INFO, "You can't add the same bonus two times.");
  23. return false;
  24. }
  25. item2->AddAttribute(item->GetValue(0), item->GetValue(1));
  26. ChatPacket(CHAT_TYPE_INFO, "The bonus has been added successfully.");
  27.  
  28. item->SetCount(item->GetCount() - 1);
  29. }
  30. else
  31. {
  32. ChatPacket(CHAT_TYPE_INFO, "Adding bonus failed. You can only add two bonuses on your costume!");
  33. }
  34. }
  35. else
  36. {
  37. ChatPacket(CHAT_TYPE_INFO, "The bonus goes only on the costume!");
  38. }
  39. }
  40. break;
  41.  
  42. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement