Lua functions

SetPlayerProximityFunction

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

Historical signature: SetPlayerProximityFunction(spawn, distance, in_range_function, leaving_range_function)

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

Function: SetPlayerProximityFunction(spawn, distance, in_range_function, leaving_range_function)

Description: The Spawn (NPC) will be notified of a Player entering in range or leaving range.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • distance (int32) - Distance distance.
  • in_range_function (int32) - Distance in_range_function.
  • leaving_range_function (int32) - Distance leaving_range_function.

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.

SetPlayerProximityFunction(NPC, 15, "InRange", Spawn)

Evidence: server/SpawnScripts/antonica/BlartonBlumble.lua:20; binding EQ2Emu_lua_SetPlayerProximityFunction.

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