Lua functions

AddLootItem

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

Historical signature: AddLootItem(Spawn, ItemID, Charges)

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

Function: AddLootItem(Spawn, ItemID, Charges)

Description: Add an item and its charges (quantity) to a Spawn's loot table for this instance.

Parameters:

  • Spawn: Spawn - The spawn or entity to add the loot item.
  • ItemID: int32 - ItemID from the items table.
  • Charges: int16 - Amount of charges for the item (or quantity), default is 1.

Returns: None.

Checked example

Active call in a local runtime Lua script. Argument count matches current fixed C++ readers. This is a contextual call pattern, not a tested standalone script.

AddLootItem(NPC, 1286, 1)

Evidence: server/SpawnScripts/Ruins/RingleaderRadko.lua:25; binding EQ2Emu_lua_AddLootItem.

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