mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
Backport of the MoP C_LootHistory namespace. Vanilla 1.12 has no loot-history store, but it receives the live group-loot roll traffic, which the stock UI only turns into chat. This reconstructs the history client-side (like Aura::Source): four co-hooks on the loot-roll packet handlers accumulate a ring (128) of rolled items with per-player Need/Greed/Pass results and the winner, exposed through the namespace. Handlers, from the opcode dispatch FUN_005E6010: - START_ROLL 0x2A1 FUN_0061B310 (__fastcall(packet), RET 0) - ALL_PASSED 0x29E FUN_0061B640 (msg=EDX, RET 0) - ROLL_WON 0x29F FUN_0061B9E0 (ctx=ECX, msg=EDX, +stack, RET 4) - ROLL 0x2A2 FUN_0061C0B0 (msg=ECX, ctx=EDX, +stack, RET 4) The per-handler ABI (message register, stack arg, RET) is load-bearing: matching it exactly is what keeps the co-hooks from corrupting ESP. Names and class come from the engine NameCache (FUN_0055F080, null- callback read of a loaded entry), captured at roll time — so they resolve even for a roller who has left the group by the time their roll arrives. The item's random suffix is only in SMSG_LOOT_START_ROLL (the result packets send 0), so it's read off the store-head node right after that handler runs, giving a correct item:id:0:suffix:unique link. Surface: C_LootHistory.GetNumItems / GetItem / GetPlayerInfo (name, class token, rollType, roll, isWinner, isMe) + LOOT_HISTORY_ROLL_CHANGED / _ROLL_COMPLETE events (_FULL_UPDATE reserved). The MoP master-loot functions (SetExpiration / GiveMasterLoot / CanMasterLoot) are omitted — they need server support 1.12 lacks. Documented in docs/API.md + README.