Lua functions

KillSpawnByDistance

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

Historical signature: KillSpawnByDistance(spawn, max_distance, include_players, send_packet)

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

Function: KillSpawnByDistance(spawn, max_distance, include_players, send_packet)

Description:

Kill's spawns in the distance radius around the Spawn (Entity based, NPC, Player, Bot). The include_players is false by default, as-is send_packet.

Each victim's later corpse-removal deadline remembers its original allocation. Reusing a runtime ID does not transfer that deferred removal to a replacement actor. This timer contract applies to death processing after radius selection.

Radius selection retains the original origin and each selected victim allocation through native callbacks. Candidate identity includes the spatial publication epoch, so ID reuse cannot substitute a new actor during selection. Actors already marked deleted are skipped when the per-victim action begins. Radius results use the existing distance ordering and filters.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • max_distance (float) - Float value max_distance.
  • include_players (uint8) - Integer value include_players.
  • send_packet (uint8) - Integer value send_packet.

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.

KillSpawnByDistance(NPC, 20, 0, 0)

Evidence: server/SpawnScripts/FrostfangSea/qst_scourgeson_x2_rygorr_tent.lua:47; binding EQ2Emu_lua_KillSpawnByDistance.

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