mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
Plays the noise an item makes when handled, without performing the action. Almost all of it is the engine's: FUN_00457FF0 takes a sound type and an ItemDisplayInfo id, walks that row's ItemGroupSounds id at +0x2C, and plays the SoundEntries id at row + 0x04 + soundType * 4. Those four columns are in the modern Enum.ItemSoundType order (Pickup, Drop, Use, Close), which makes this a backport rather than a reconstruction — the module only turns an item argument into a display id and calls it. The item argument takes an ItemLocation table and the other forms this project's item APIs accept (GUID string, itemID, link, carried item name), through the shared ResolveItemArgOrLocation. Sound type is read off the stack before resolving, since that resolver drives PackBagSlot and stomps the stack. Only Pickup and Drop play on a stock client, and that is the data rather than a limit of the code: of ItemGroupSounds' 24 rows, the 18 any display row points at (~29,000 displays) populate columns 1 and 2 only. The six rows naming a Use sound are unreachable or broken — groups 1 and 2 have no displays, and the ids they name (273/274/275) match no SoundEntries row — and the Close column is zero in all 24. Use and Close fall through the engine's own bounds checks silently, which is why no item can test them; documented so nobody hunts for one. The type stays a pass-through that indexes the row rather than selecting a branch here, so a server filling those columns in gets Use and Close working with no change on this side. Sound keys off the item's display, not its itemID, so items that look alike sound alike — the engine's grouping, and why every item has a sound without one being recorded per item. Verified in game: Pickup and Drop play, and differ by material.