Lua functions

SendStateCommand

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

Historical signature: SendStateCommand(spawn, new_state, player)

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

Function: SendStateCommand(spawn, new_state, player)

Description: Updates the state of the Spawn and it's behavior, can optionally be sent to a single Player. The new_state is based on the Appearance ID's https://eq2emu.com/index.php/developers/references by client version.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • new_state (int32) - Integer value new_state.
  • player (Spawn) - Spawn object representing player.

Returns: None.

Checked example

Active call in a local runtime Lua script. A missing player queues the state command to clients in the zone. This is a contextual call pattern, not a tested standalone script.

SendStateCommand(NPC, 0)

Evidence: server/SpawnScripts/FarJourneyFreeport/CaptainVarlos.lua:78; binding EQ2Emu_lua_SendStateCommand.

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