Lua functions

KillSpawn

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

Historical signature: KillSpawn(dead, killer)

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

Function: KillSpawn(dead, killer, send_packet)

Description:

Kills an alive, zoned actor that is not protected by GM invisibility. The killer is optional. A pending corpse registration for that same original actor prevents duplicate death processing; an obsolete registration under a reused runtime ID does not block a replacement actor. Subsequent corpse removal remembers the original allocation.

Parameters:

  • dead (Spawn) - Spawn object representing dead.
  • killer (Spawn, optional) - Actor responsible for the kill.
  • send_packet (uint8, optional) - Pass 1 to send the death packet; defaults to 0.

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.

KillSpawn(NPC, nil, 0)

Evidence: server/SpawnScripts/Longshadow/TeahJNar.lua:33; binding EQ2Emu_lua_KillSpawn.

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