Commit Graph

1 Commits

Author SHA1 Message Date
troytt c09e237ff8 fix(drop): unify monster and inventory ground drops on 16x8 sub-tile lattice with bilingual metadata parity
1. Sub-Tile Scatter Spacing (D2Common.dll COLLISION_GetFreeCoordinatesImpl 0x6FD9D140):
   - Unify GameEngine.triggerMonsterDrop, GameEngine.dropItem, GameEngine.dropGold,
     and net-scene monster drops on findIsometricDropPosition (16x8 sub-tile diamond
     lattice, 16px orthogonal / 8px vertical spacing) instead of 80x40px macro cells.
   - Derive GroundItemEntity (cellX, cellY) from final scattered (finalX, finalY)
     via worldToCell rather than overwriting with stale origin cell coordinates.

2. Monster vs. Inventory Drop Metadata & Bilingual Name Parity:
   - Add formatBilingualGroundItemName in src/game/ground-items.ts using
     translateItemName / translateMagicName / translateRareName so raw monster-dropped
     Item objects receive identical '中文名 (English Name)' nameZh as UiInventoryItem.
   - Detect runes via isRuneCode in resolveItemQualityString so monster-dropped runes
     render with #ff9c18 orange labels matching inventory-dropped runes.
   - Preserve flippyFile, dropSound, and dropSfxFrame in itemToUiInventoryItem, fix
     socket count resolution so unsocketed items do not inherit base.gemsockets, and
     add embedded drop table fallback in resolveGroundItemMetadata.

3. Anti-Stacking for Sequential Player Inventory/Body Drops:
   - Simplify act-scene onDropItemToGround / onDropGoldToGround to delegate directly
     to engine.dropItem / engine.dropGold at (player.x, player.y) so every dropped
     item checks engine.groundItems.all and scatters to a unique sub-tile slot.

Fixes #479
2026-09-26 04:51:32 +00:00