mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
C_Loot.LootAllCorpses([max]) loots every nearby lootable corpse in sequence -- coin (CMSG_LOOT_MONEY) plus every item slot (CMSG_LOOT_ITEM) from each window before releasing and advancing. Optional max caps the corpse count. Shares Loot::Scan's existing corpse-walk state machine and its single FUN_LOOT_CONTROLLER hook -- MinHook allows one hook per target, so this can't be a separate module. ScanNearbyLoot scrapes each window and releases; LootAllCorpses does the same walk but actually loots it first. The walk stays silent (LOOT_OPENED/LOOT_CLOSED suppressed, so LootFrame never flickers) while the item-received / money chat + inventory events fire normally. Packet-based and target-clean, matching the rest of the C_Loot suite: no right-click, no target change, no auto-walk toward out-of-range corpses. Money goes through FUN_005ea8c0 (CMSG_LOOT_MONEY) with the SAME player pointer passed to FUN_CMSG_LOOT_UNIT -- whose send wrote this window's target GUID to the player's +0x1D28 guard slot, so the money send's internal guard passes. Item sends bypass the client BoP/unique confirm dialog (the server still enforces real loot permissions). Reimplemented in spirit from WeirdUtils's LootAllCorpses (public domain) on our own packet loot primitives + object-scan helpers, rather than its right-click-autoloot approach. Wires the existing AOELOOT keybinding to it (was ScanNearbyLoot).