Monster Loot / Item Dropping Position (#8347)

- When a monster is killed, its first item will now always drop at the exact cell the monster was on
- When a monster drops more than one item, the items will be deployed on 3 cells around the monster (looping): SE, W and N
- Fixed drop position of looted items (similar to regular drops but independent to it and starts north)
- Fixed item drop order (script-granted -> regular drops -> looted drops)
- Fixed looted items showing special drop effects
- Searching for a free cell to drop an item on now uses the official algorithm
- When a monster drops an item, it will no longer drop on cells that are occupied by characters or pets
- When a player drops an item, it will now drop in a 5x5 area around the player
- Items dropped by players can now stack on the same cell unless the new "item_stacking" config is disabled
- When an MVP drop drops to the floor because the player's inventory was full, it will now always drop on that player's cell
- Fixes #8345
This commit is contained in:
Playtester
2024-06-07 18:29:01 +02:00
committed by GitHub
parent e8f1c7f9e7
commit ec9a5fae4b
7 changed files with 191 additions and 113 deletions

View File

@@ -6052,9 +6052,12 @@ bool pc_dropitem(map_session_data *sd,int n,int amount)
return false;
}
// bypass drop restriction in map_addflooritem because we've already checked it above
if (!map_addflooritem(&sd->inventory.u.items_inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2|4, 0))
// Bypass drop restriction in map_addflooritem because we've already checked it above
if (!map_addflooritem(&sd->inventory.u.items_inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2|4, 0,
false, DIR_MAX, battle_config.item_stacking?BL_NUL:BL_ITEM))
{
return false;
}
pc_delitem(sd, n, amount, 1, 0, LOG_TYPE_PICKDROP_PLAYER);
clif_dropitem( *sd, n, amount );