Lua functions

UnequipSlot

Registered in this checkout as EQ2Emu_lua_UnequipSlot; implementation found at WorldServer/Lua/LuaFunctions.cpp:7701.

Historical signature: UnequipSlot(…) via current binding

Parameter and behavior details in the historical explanation are under review against the current implementation.

Function: UnequipSlot(entity, slot, keep_item)

Description: For a connected Player in a zone, requests removal of the exact original item from the native equipment slot. With keep_item = true, it transfers that item to the same Player's inventory; lack of legal inventory space leaves equipment unchanged. Omitted/false deletes the original with exact removal records. Deleting an equipped quiver includes its original inventory subtree. The operation uses the native slot rather than an incidental packet index.

A Player without a current original connection and zone returns false unchanged. For an NPC, omitted/false detaches only the exact currently owned allocation. NPC keep_item = true returns false unchanged because there is no inventory destination or returned item channel. A valid empty slot reports true for a current Player, or for NPC deletion.

Parameters: entity: Player or NPC Entity spawn. slot: integer native equipment slot from 0 through 24. Optional boolean keep_item defaults to false.

Returns: Boolean admission result (or true for a supported empty slot). Player true acknowledges owned in-memory work, which may defer or cancel if the original intent becomes stale; it does not promise synchronous mutation or a durable database commit. Invalid entity or an invalid, fractional, negative or out-of-range slot returns no value (nil).

Checked example

No checked example is published for this function yet. No suitable maintained runtime-script example passed the argument and source review.

Current registration: WorldServer/Lua/LuaInterface.cpp.