benilla-re systems structs docs

Script::EquipCursorItem

function · ui · primitive

Address
0x489660 · 334 bytes, up to 0x4897ad
Signature
int __fastcall (lua_State *L)
Meaning
Implements the Lua function EquipCursorItem
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/cursor#cursor-functions

Finding: Cursor functions in ui: the cursor payload

ClearCursor() runs ClearCursor(1, 1) and returns 1 result without pushing one. CursorHasItem() returns the number 1 for kinds 1 and 9 and nil otherwise; CursorHasSpell() for kind 3; CursorHasMoney() for kind 2. None returns a boolean. AutoEquipCursorItem() calls the player's equip-from-cursor routine with 0 (objectlayer/inventory#bind-on-equip-confirmation).

EquipCursorItem(slot) needs a number (usage error otherwise) and an item on the cursor. A slot argument of 0 or 256 auto-equips. A slot holding the cursor item only clears the cursor. If CheckItemForSlot accepts the slot it sends a swap from the item's origin and locks the displaced item. If it refuses and the item came from an equipment slot below 19, it clears the cursor; otherwise it auto-equips with 1.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 12

Calls and jumps by a bare address, from tables/calls.tsv.