mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
OnTooltipSetItem now gets the shown item's GUID as arg1, and as (self, itemGUID) under modern script args. It is nil when no item object is behind the tooltip. This is a ClassicAPI extension. The value is p3 of CGTooltip::BuildItem (0x52b650), the item object's GUID. It is read from the builder call, not from tooltip+0x380, because an incremental build (p7 = 1, a recipe's created item) skips that copy. SetBagItem, SetBuybackItem, SetSendMailItem, SetInventoryItem, SetTradePlayerItem and SetAction pass a real GUID. SetLootItem passes a zero GUID, as do the other setters whose item is a loot, merchant, auction, mail or link row. The fire goes through Frame::ScriptArgs::RunWithValues, which, like FUN_00704d50, does not touch the exec context. The stack save/restore, recursion guard and compare Suppressor stay as before. Every GUID-to-item lookup now goes through one search, Item::Location::FindByGUID. It reads the player's inventory list as a GUID array, the way FUN_INVMGR_WALK (0x6223f0) does: equipment and bag slots, backpack, bank 39..68, buyback 69..80 and keyring 81+. It also reads each equipped bag's and bank bag's own list. A GUID string passed to C_Item.GetStackCount and the other item accessors now finds bank, keyring and buyback items. C_Item.GetItemLocation and the location form of the action APIs now return keyring, bank and equipped-bag locations. Buyback has no location. The bank counts only while the banker GUID at 0xbdd038 is set, the same gate GetItemBySlot applies. The search does not resolve through the object manager alone, because a deleted, mailed or traded item stays there. Equipment sets had their own copy of this walk. They now use the shared search and keep their scope: gear, bags and bank, never equipped bags, the keyring or buyback. BankerOpen moves to Item::Location. The buyback range is the server's BUYBACK_SLOT_START/END.