Lua functions

SendUpdateDefaultCommand

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

Historical signature: SendUpdateDefaultCommand(Spawn, Distance, CommandString, Player)

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

Function: SendUpdateDefaultCommand(Spawn, Distance, CommandString, Player)

Description: Updates the default highlighted command for an entity, as seen on hover or target window. This is often used after changing accessible commands to ensure the correct default action (usually the first allowed command) is highlighted.

Parameters:

  • Spawn: Spawn – The entity to update.
  • Distance: Float – The maximum distance the command can be used.
  • CommandString: String – The command to provide access.
  • Player: Spawn – The player whom has access to the command (optional to specify a specific Player).

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.

SendUpdateDefaultCommand(NPC, 5.0, "Shop", nil)

Evidence: server/SpawnScripts/House/HouseShop.lua:12; binding EQ2Emu_lua_SendUpdateDefaultCommand.

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