auto pickup
#2

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.



Messages In This Thread
[No subject] - by kdy - 01-30-2023, 11:16 AM
[No subject] - by Cryden - 04-20-2023, 09:36 PM
[No subject] - by kdy - 04-21-2023, 08:42 PM
[No subject] - by kdy - 04-21-2023, 08:54 PM
[No subject] - by kdy - 04-21-2023, 09:05 PM
[No subject] - by Matt Hias - 04-23-2024, 10:07 AM
[No subject] - by Desarija - 04-23-2024, 11:04 AM
[No subject] - by Matt Hias - 04-25-2024, 07:25 PM
[No subject] - by Desarija - 04-29-2024, 05:35 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)