Kafa 153 Posted November 6, 2021 Share Posted November 6, 2021 Hey, in official i noticed there is this condition. "1465 You need %d perpendicular slots in your inventory to open the Chest." Can someone show me how such a condition would look like? I also think this is something important. Greetings. Link to comment Share on other sites More sharing options...
Premium r00t 123 Posted November 11, 2021 Premium Share Posted November 11, 2021 Maybe the chest contain a weapon, so you need 2 perpendicular slot for a sword and 3 for a great sword. It's just a alternative way to say "you don't have space in your inventory" Link to comment Share on other sites More sharing options...
Active+ Member Abel(Tiger) 1195 Posted November 11, 2021 Active+ Member Share Posted November 11, 2021 (edited) BYTE bMaxItemSize = 1; const CSpecialItemGroup* pGroup = ITEM_MANAGER::instance().GetSpecialItemGroup(dwBoxVnum); if (pGroup) { for (int i = 0; i < pGroup->GetGroupSize(); i++) { const TItemTable* itemTable = ITEM_MANAGER::instance().GetTable(pGroup->GetVnum(i)); if(itemTable) { if(itemTable->bSize > bMaxItemSize) { bMaxItemSize = itemTable->bSize; if(bMaxItemSize == 3) break; } } } } if(GetEmptyInventory(bMaxItemSize) == -1) { ChatPacket(CHAT_TYPE_INFO, "You need %d perpendicular slots in your inventory to open the Chest.", bMaxItemSize); return false; } Place it in char_item.cpp inside case ITEM_GIFTBOX: after dwBoxVnum. (there are other cases for other types of chests, this instruction is only for giftbox type). Also I think the max size from the chest must be a info loaded when the special group is loaded and saved in a variable. The code I posted for you increases the time complexity of the function and it's not a good ideea Edited November 11, 2021 by Abel(Tiger) Link to comment Share on other sites More sharing options...
Kafa 153 Posted November 11, 2021 Author Share Posted November 11, 2021 6 hours ago, Abel(Tiger) said: BYTE bMaxItemSize = 1; const CSpecialItemGroup* pGroup = ITEM_MANAGER::instance().GetSpecialItemGroup(dwBoxVnum); if (pGroup) { for (int i = 0; i < pGroup->GetGroupSize(); i++) { const TItemTable* itemTable = ITEM_MANAGER::instance().GetTable(pGroup->GetVnum(i)); if(itemTable) { if(itemTable->bSize > bMaxItemSize) { bMaxItemSize = itemTable->bSize; if(bMaxItemSize == 3) break; } } } } if(GetEmptyInventory(bMaxItemSize) == -1) { ChatPacket(CHAT_TYPE_INFO, "You need %d perpendicular slots in your inventory to open the Chest.", bMaxItemSize); return false; } Place it in char_item.cpp inside case ITEM_GIFTBOX: after dwBoxVnum. (there are other cases for other types of chests, this instruction is only for giftbox type). Also I think the max size from the chest must be a info loaded when the special group is loaded and saved in a variable. The code I posted for you increases the time complexity of the function and it's not a good ideea It was a patch to a item duplication bug. I'm pretty sure this is something everyone needs (since the dupe-bug appeared on official server) Big thanks to you abel. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now