![]() |
|
auto pickup - Printable Version +- LCKB (https://lckb.dev/forum) +-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109) +--- Forum: Guides & Help Section (https://lckb.dev/forum/forumdisplay.php?fid=193) +---- Forum: Help & Support (https://lckb.dev/forum/forumdisplay.php?fid=157) +----- Forum: Ep4 Support (https://lckb.dev/forum/forumdisplay.php?fid=128) +----- Thread: auto pickup (/showthread.php?tid=4987) |
- kdy - 01-30-2023 Hello, does anyone have the complete code and without any bugs? ^^ - Cryden - 04-20-2023 Inside of Battle_NPCDropItem.cpp around line 234 default: { bool bAvailableDrop = true; if (bAvailableDrop) dropItem = gserver->m_itemProtoList.CreateItem(df->m_proto->m_item[tableindex], -1, 0, 0, 1); // dropItem = df->m_pArea->DropItem(df->m_proto->m_item[tableindex], df, 0, 0, 1, true); else dropItem = NULL; } break; } // switch (df->m_proto->m_item[tableindex]) and then around line 265 we create an if clause which only creates the drop when it cant be added to the inventory and if it returns true we also need to add the line we commented out above again if (opc->m_inventory.addItem(dropItem) == false) { dropItem = df->m_pArea->DropItem(df->m_proto->m_item[tableindex], df, 0, 0, 1, true); CNetMsg::SP rmsg(new CNetMsg); ItemDropMsg(rmsg, df, dropItem); df->m_pArea->SendToCell(rmsg, GET_YLAYER(dropItem), dropItem->m_cellX, dropItem->m_cellZ); } These are the changes to be done for auto picking up normal drops. if you want it to also work for jewels or hardcoded drops you need to change the according parts as well. - kdy - 04-21-2023 this worked but the mobs drop the item on the ground and into my inventory, how to fix this? - kdy - 04-21-2023 . - kdy - 04-21-2023 1 hour ago, kdy said: this worked but the mobs drop the item on the ground and into my inventory, how to fix this? mb, I forgot the line 234, this worked ty - Matt Hias - 04-23-2024 Hello. Does this also work with items that are in the drop list? Because with this code only items that are in the NPC drop list are automatically picked up. - Desarija - 04-23-2024 what do you mean by "in the drop list"? - Matt Hias - 04-25-2024 On 4/23/2024 at 1:04 PM, Desarija said: what do you mean by "in the drop list"? t_npc_drop_all these items are not automatically canceled. - Desarija - 04-29-2024 On 4/25/2024 at 9:25 PM, Matt Hias said: t_npc_drop_all these items are not automatically canceled. GAMELOG << init("MOB DROP ALL ITEM") search for this line in Battle_NPCDropItem.cpp. Above that you have the code that is responsible for dropping items from said table |