Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool isSpecialItem(int vnum)
- {
- bool bPass = false;
- switch(vnum)
- {
- case ITEM_AUTO_HP_RECOVERY_S:
- case ITEM_AUTO_HP_RECOVERY_M:
- case ITEM_AUTO_HP_RECOVERY_L:
- case ITEM_AUTO_HP_RECOVERY_X:
- case ITEM_AUTO_SP_RECOVERY_S:
- case ITEM_AUTO_SP_RECOVERY_M:
- case ITEM_AUTO_SP_RECOVERY_L:
- case ITEM_AUTO_SP_RECOVERY_X:
- case REWARD_BOX_ITEM_AUTO_SP_RECOVERY_XS:
- case REWARD_BOX_ITEM_AUTO_SP_RECOVERY_S:
- case REWARD_BOX_ITEM_AUTO_HP_RECOVERY_XS:
- case REWARD_BOX_ITEM_AUTO_HP_RECOVERY_S:
- case FUCKING_BRAZIL_ITEM_AUTO_SP_RECOVERY_S:
- case FUCKING_BRAZIL_ITEM_AUTO_HP_RECOVERY_S:
- bPass = true;
- break;
- default:
- bPass = false;
- }
- return bPass;
- }
- void CHARACTER::EditMyInven()
- {
- if (IsDead())
- return;
- static std::vector<LPITEM> v;
- LPITEM myitems;
- ///clear vector
- v.clear();
- #ifdef ENABLE_EXTEND_INVEN_SYSTEM
- int size = Inventory_Size();
- #else
- int size = INVENTORY_MAX_NUM;
- #endif
- for (int i = 0; i < size; ++i)
- {
- if (!(myitems = GetInventoryItem(i)))
- continue;
- ///add all items inven to vector
- v.push_back(myitems);
- ///delete items from inven
- myitems->RemoveFromCharacter();
- }
- ///Sort items
- std::sort(v.begin(), v.end(), SortMyItems);
- ///Send vector items to inven
- itertype(v) it = v.begin();
- while (it != v.end()) {
- LPITEM item = *(it++);
- if (item) {
- TItemTable * p = ITEM_MANAGER::instance().GetTable(item->GetVnum());
- /// isn't same function !
- if (p && p->dwFlags & ITEM_FLAG_STACKABLE && p->bType != ITEM_BLEND && p->bType != ITEM_POLYMORPH && !isSpecialItem(item->GetVnum()))
- AutoGiveItem(item->GetVnum(), item->GetCount(), -1, false); // create new item for stackable items
- else
- AutoGiveItem(item); // copy orginal items
- }
- }
- #ifdef ENABLE_SORT_INENT_QUCKSLOT_FIX // clear quckslot, bsc you can put sword on fast slot type (this is only for pots & skills) // Bambus3k.
- for (int i = 0; i < QUICKSLOT_MAX_NUM; ++i)
- {
- TQuickslot *pSlot;
- if (GetQuickslot(i,&pSlot))
- {
- if (pSlot->type == QUICKSLOT_TYPE_NONE)
- continue;
- else if (pSlot->pos <= 8 and pSlot->type != QUICKSLOT_TYPE_SKILL)
- {
- DelQuickslot(i);
- break;
- }
- }
- }
- #endif
- ///message
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ITEMS_HAS_BEEN_SORTED"));
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement