Lua functions

SummonItem

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

Historical signature: SummonItem(spawn, item_id, location, item_count)

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

Function: SummonItem(spawn, item_id, send_messages, location, item_count)

Description: Grant a fresh item to the original Player's inventory or bank.

Parameters:

  • spawn (Player): The original recipient.
  • item_id (UInt32): Item definition ID.
  • send_messages (Integer): Use 1 for receive text and popup; otherwise omit or use 0.
  • location (String, optional): A case-insensitive string beginning with "bank" selects the bank; other or omitted values select inventory.
  • item_count (UInt16, optional): Quantity, default one. Zero also means one; values above 65,535 reject.

Returns: On normal return, a boolean: true after native placement or stacking commits; otherwise false. True does not promise synchronous durable database commit.

Original ownership and completion: The original Player and connection are retained before the grant and callbacks. Native admission requires that original Player's current connection, zone and spawn audience. The grant copies an item definition into one fresh construction allocation; native admission consumes its sole construction owner once. Busy/closed/replaced recipients cannot redirect the grant to another Player. Receive messages and popup bytes carry the same original audience, so callback or session replacement suppresses stale output. A funded grant remains owned until its inventory save is accepted; recovery never repeats its native publication or callbacks. Bank grants place the fresh allocation without merging an existing bank stack. They use bank slots, then bank bags, then overflow when needed.

Checked example

Active call in a local runtime Lua script. Location defaults to empty and count defaults to one. This is a contextual call pattern, not a tested standalone script.

SummonItem(Spawn,1619,1)

Evidence: server/SpawnScripts/Caves/acuriousrock.lua:32; binding EQ2Emu_lua_SummonItem.

Current registration: WorldServer/Lua/LuaInterface.cpp. Historical explanation: EQ2Emu Lua documentation.