So it seems that by default no goods are dropped. (The sub u posted is wrong. It just checks if the given item on the ground can be looted. All items are visible to everyone by default I believe.)
So first of we have to actual check whether the player is dead or alive. To do this go to the PlayerAttackPlayer sub. This sub handles the actual damage dealing and checking whether the player is dead.
In this sub there is a if statement that checks whether the damage dealt is greater than that of the players current Hp. This means death. So within this check there are normal statements that shout out to everyone that the attack player is a Pker. And exp is handled out.
Now this is where we add our code. It is quite simple. Loop through the victim players inventory (and equipment) and drop all the stuff. You can do this by looping the players inventory and getting the item num and spawning that item (SpawnItem) at the victim’s coords (x,y). After that the players inventory has to be cleared though. So after the item is spawned just remove that item. This can be done by setting the ItemNum of the slot in the inventory and the value to 0.
But this makes the items visible to everyone. In the MapItemRec add a variable that indicated the time in which the item should be visible to everyone. (Use GetTickCount + <the time="" the="" item="" should="" be="" visible="" to="" that="" player="" only="">) Also add a variable indicating which player the item should be dropped for. Then before the MapItemUpdate packet is sent out to everybody check whether it has a player whom only can see that item. If so then SendAnotherPacket send only to that player.
Now after the fixed time the item should be visible to everyone. To do that in the server loop make a check that checks whether the current tick is > than the value assigned to item. If so then make the item visible to everyone by sending the packet to everyone. And reset the timer and the Player Index.
If you need more help or didn’t understand a certain part, PM me or post below.
P.S I believe there is a sub that handles PlayerDroppingItems. That sub can be used.</the>