Skip to content

Commit ef37609

Browse files
committed
loot scan
1 parent 5580868 commit ef37609

2 files changed

Lines changed: 177 additions & 107 deletions

File tree

src/Offsets.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3460,6 +3460,36 @@ enum Offsets {
34603460
// below.
34613461
FUN_CMSG_LOOT_UNIT = 0x005DF2A0,
34623462

3463+
// `__fastcall(int loot_response_struct, undefined4 coin, int unk)`
3464+
// — master loot-window state controller. Called by the
3465+
// `SMSG_LOOT_RESPONSE` handler tail (via `FUN_0048F3A0`) and by
3466+
// `CloseLoot`-inner (via `FUN_0048F200(0, 0, 0)`). Two phases:
3467+
// - **Close prior**: if `VAR_LOOT_GUID_LO/HI != 0`, clears
3468+
// them, releases item-cache callbacks for the prior slots,
3469+
// fires `LOOT_CLOSED` (event id `0x10D`).
3470+
// - **Open new**: if `param_1 != 0`, copies the GUID from
3471+
// `[param_1 + 8]` into `VAR_LOOT_GUID_LO/HI`, zeroes
3472+
// `VAR_LOOT_SLOTS`, walks 16 slots populating itemID via
3473+
// `FUN_005EBC90(slot)` and sibling helpers, sets
3474+
// `VAR_LOOT_LOOTABLE = param_2` (coin), then fires
3475+
// `LOOT_OPENED` (event id `0x10B`).
3476+
// Both event fires go through `FUN_FIRE_EVENT_NO_ARGS` —
3477+
// intercepting that function lets a caller swallow the events
3478+
// without touching this one.
3479+
FUN_LOOT_CONTROLLER = 0x004C1CB0,
3480+
3481+
// `__fastcall(int eventID)` — engine's no-args event dispatcher,
3482+
// the lighter-weight sibling of `FUN_FIRE_EVENT` (variadic).
3483+
// Called from ~100 sites across the engine, including the
3484+
// `LOOT_OPENED` / `LOOT_CLOSED` fires inside
3485+
// `FUN_LOOT_CONTROLLER`. Hooking it lets us conditionally swallow
3486+
// specific event ids while leaving the rest untouched — the
3487+
// mechanism we use to do silent scan loops without flickering
3488+
// the `LootFrame`. Fan-in is wide but call frequency is
3489+
// event-driven (state changes only), not per-frame, so per-call
3490+
// overhead from a hooked predicate is negligible.
3491+
FUN_FIRE_EVENT_NO_ARGS = 0x00703E50,
3492+
34633493
// `__fastcall(int sendRelease, char earlyReturnOnGameObject,
34643494
// char showError)` — engine's "close the current loot window"
34653495
// inner. Behavior keyed off args:

0 commit comments

Comments
 (0)