Files
ClassicAPI/docs
Brues 9a92089ab7 C_MerchantFrame: GetItemInfo, GetBuybackItemID, junk handling
Six functions matching the retail namespace:

- GetItemInfo(slot) reads the 28-byte merchant entry directly.
- GetBuybackItemID(slot) walks buyback storage → player invMgr →
  CGItem instance block. No GetBuybackItemLink roundtrip.
- GetNumJunkItems / SellAllJunkItems iterate bags via the existing
  ResolveBag helper and read quality from the ItemStats cache.
- IsMerchantItemRefundable / IsSellAllJunkEnabled stub to false /
  true to match retail's API contract in a version that has no
  refund mechanic or sell-junk-disabled setting.

SellAllJunkItems calls the engine's internal MerchantSellItem
dispatcher (CMSG_SELL_ITEM) directly rather than going through
Script_UseContainerItem. The dispatcher uses an irregular fastcall
(count in ECX, four stack args, EDX ignored); a dummy EDX in the
typedef forces MSVC to lay the args out the callee expects.

Sells are deferred one per frame via the shared WorldTick
subscriber. Burst-sending 10 CMSG_SELL_ITEM packets in one frame
consistently dropped the 2nd-to-last sell (verified empirically).
Spreading them across frames matches the cadence of click-by-
click selling.

GetNumJunkItems also returns 0 away from a merchant frame to
match retail's contract — the count is meant as a "what would the
sell button do right now" signal, not a passive inventory query.

Includes a small refactor: factored GUID→CGItem resolution out of
EquipmentSet::Locations into Item::Location::ResolveByGUID so it's
shared cleanly between modules, and renamed VAR_MERCHANT_FLAG_A/B
to VAR_MERCHANT_NPC_GUID_LO/HI now that the semantic is decoded.

Cursor-clearing-when-holding-junk left as TODO #93.
2026-05-16 02:08:02 -05:00
..
2026-05-07 15:08:45 -05:00
2026-05-07 15:52:48 -05:00
2026-05-13 19:41:55 -05:00
2026-05-10 14:24:46 -05:00
2026-05-10 00:10:06 -05:00
2026-05-07 12:23:57 -05:00
2026-05-07 16:28:32 -05:00
2026-05-07 12:23:57 -05:00
2026-05-07 15:08:45 -05:00
2026-05-07 15:08:45 -05:00
2026-05-09 14:23:40 -05:00