mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
Direct-by-ID item cooldown query. Returns (startTime, duration, enable) — the same multi-return shape 1.12's GetContainerItemCooldown(bag, slot) uses — without requiring a physical slot reference. Routes through FUN_ITEM_QUERY_COOLDOWN at 0x006E2ED0, which looks up the item's ItemStats_C record, finds the slot with trigger=ON_USE (OFF_ITEMSTATS_SPELL_TRIGGER[i] == 0), and queries that spell's cooldown via the shared FUN_006E13E0 against the player-spell cooldown manager. The "ON_USE spell's cooldown" interpretation is how the engine itself surfaces item cooldowns to addons. Calling-convention gotcha worth flagging: Ghidra labels the first arg as uint*, but the ItemStats cache lookup uses the integer both as a hash key and as the cached-entry field-0 match target (which is a uint*-typed slot), so the decomp inherits the pointer typing. The actual fastcall value is the itemID itself — passing &itemID makes ItemStats interpret the stack address as the lookup key and the call silently fails. Verified via the Hearthstone (6948) test: &itemID returned (0, 0, 0); passing itemID directly returns (732120.014, 3600, 1) after use. GetItemCooldown(itemInfo) accepts itemID / link / numeric string / name via the shared Item::Arg helper. C_Container.GetItemCooldown also accepts links because the shared helper extracts them for free, even though modern's spec says links aren't accepted.