Lua functions

Despawn

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

Historical signature: Despawn(spawn, delay)

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

Function: Despawn(spawn, delay)

Description: Requests despawn of a non-Player spawn. The optional delay is in milliseconds; zero queues removal for the next eligible processing pass. Players are not despawned by this function.

The native request retains the original actor through its effects. Its scheduled deadline remembers that actor's original allocation, so a replacement under the same runtime ID does not inherit the removal. Retired actors cannot create fresh scheduled work. A later request for the same original actor replaces its previous deadline.

Parameters:

  • spawn (Spawn) - Actor to despawn.
  • delay (uint32, optional) - Delay in milliseconds; defaults to zero.

Returns: None. Returning from this function does not mean that a delayed removal has completed.

Checked example

Active call in a local runtime Lua script. The delay defaults to zero. This is a contextual call pattern, not a tested standalone script.

Despawn(Camp1Object)

Evidence: server/SpawnScripts/antonica/afociofdecayA.lua:142; binding EQ2Emu_lua_Despawn.

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