Active Member Valki 521 Posted November 10, 2022 Active Member Share Posted November 10, 2022 (edited) Hello! I was testing something on my server and I had to use /i a tons, so I just extended it instead. With this extension you can get as many items as you want (of course with limitation of your max inventory space.) For this we will working in only one file, called "cmd_gm.cpp". So, in cmd_gm.cpp fine ACMD(do_item) and edit the following things in the function. Be careful, because there's a chance that you don't use "g_bItemCountLimit" but "MAX_ITEM_COUNT" (or something like that) instead. //Find this: if (*arg2) { str_to_number(iCount, arg2); iCount = MINMAX(1, iCount, g_bItemCountLimit); } //And comment out iCount limitations like this: if (*arg2) { str_to_number(iCount, arg2); //iCount = MINMAX(1, iCount, g_bItemCountLimit); } //Find this: if (item->IsDragonSoul()) { [...] } //and after that add this: else if (!item->IsStackable()) { M2_DESTROY_ITEM(item); for (int i = 0; i < iCount; i++) { LPITEM newItem = ITEM_MANAGER::instance().CreateItem(dwVnum, 1); int iEmptyPos = ch->GetEmptyInventory(newItem->GetSize()); if (iEmptyPos != -1) { newItem->AddToCharacter(ch, TItemPos(INVENTORY, iEmptyPos)); LogManager::instance().ItemLog(ch, newItem, "GM", item->GetName()); } else { M2_DESTROY_ITEM(item); ch->ChatPacket(CHAT_TYPE_INFO, "Not enough inventory space."); break; } } } else if (item->IsStackable() && iCount > g_bItemCountLimit) { M2_DESTROY_ITEM(item); while (iCount != 0) { LPITEM newItem; if (iCount >= g_bItemCountLimit) { newItem = ITEM_MANAGER::instance().CreateItem(dwVnum, g_bItemCountLimit); iCount -= g_bItemCountLimit; } else { newItem = ITEM_MANAGER::instance().CreateItem(dwVnum, iCount); iCount -= iCount; } int iEmptyPos = ch->GetEmptyInventory(newItem->GetSize()); if (iEmptyPos != -1) { newItem->AddToCharacter(ch, TItemPos(INVENTORY, iEmptyPos)); LogManager::instance().ItemLog(ch, newItem, "GM", item->GetName()); } else { M2_DESTROY_ITEM(newItem); ch->ChatPacket(CHAT_TYPE_INFO, "Not enough inventory space."); break; } } } Edited November 10, 2022 by Valki 1 1 Link to comment Share on other sites More sharing options...
Mafuyu 51 Posted November 10, 2022 Share Posted November 10, 2022 its already public. Dont know where it was but i have something like that already implemented month ago. i guess it was here on metin2dev 1 Link to comment Share on other sites More sharing options...
Active Member Valki 521 Posted November 11, 2022 Author Active Member Share Posted November 11, 2022 21 hours ago, Mafuyu said: its already public. Dont know where it was but i have something like that already implemented month ago. i guess it was here on metin2dev Well, I did not know that. Link to comment Share on other sites More sharing options...
Recommended Posts