Lua functions

SetAccessToEntityCommand

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

Historical signature: SetAccessToEntityCommand(Spawn, Player, CommandString, Allowed)

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

Function: SetAccessToEntityCommand(Spawn, Player, CommandString, Allowed)

Description: Controls whether a particular primary entity command (right-click option) is enabled for a given spawn. You can use this to enable or disable specific interactions dynamically.

Parameters:

  • Spawn: Spawn – The entity whose command access to modify.
  • Player: Spawn – The Player who will receive access to the command.
  • CommandString: String – The name of the command (same as used in AddPrimaryEntityCommand).
  • Allowed: UInt8 – 1 to allow players to use this command on the spawn; 0 to remove it.

Returns: Return's true if successfully adding access to the entity command.

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.

SetAccessToEntityCommand(Spawn,NPC,"smash", 0)

Evidence: server/SpawnScripts/Caves/acuriousrock.lua:15; binding EQ2Emu_lua_SetAccessToEntityCommand.

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