Lua functions

DespawnByLocationID

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

Historical signature: DespawnByLocationID(zone, location_id, delay)

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

Function: DespawnByLocationID(zone, location_id, delay)

Description: Selects a current spawn by location ID and requests its despawn. For a non-Player anchor with a runtime spawn group, also requests despawn of the acquired non-Player peers, then the original anchor. delay is passed to the ordinary despawn scheduler in milliseconds; zero requests immediate processing.

The operation retains the selected original anchor and a snapshot of its original group peers. A callback that retires or regroups actors cannot replace the remaining work with new actors under reused IDs. Retired or unowned construction peers are omitted from fresh snapshots. An acquired peer without a current zone is skipped. Returning true acknowledges selection and the requests; it does not assert that a delayed despawn has already completed.

The deferred removal queue also remembers each original actor. Reusing a runtime ID does not transfer its deadline to a replacement. Removal callbacks run outside the queue lock. A failed removal can retry while its registration remains current; cancellation, clearing or newer scheduling supersedes that older work.

Parameters:

  • zone (Zone) - Zone to search for the anchor.
  • location_id (uint32) - Spawn location ID.
  • delay (uint32, optional) - Despawn delay in milliseconds; defaults to zero.

Returns: Boolean: true when a matching anchor was acquired and requests were issued; false when no zone or matching anchor is available.

Checked example

No checked example is published for this function yet. No active script call with the current C++ argument count was found.

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