Lua functions

SetAccessToEntityCommandByCharID

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

Historical signature: SetAccessToEntityCommandByCharID(Spawn, CharID, CommandString, Allowed)

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

Function: SetAccessToEntityCommandByCharID(Spawn, CharID, CommandString, Allowed)

Description: Similar to SetAccessToEntityCommand, but targets a specific player (by character ID) and spawn. It toggles a command’s availability for that one player on the given spawn.

Parameters:

  • Spawn: Spawn – The entity offering the command.
  • CharID: Int32 – The character ID of the player whose access to adjust.
  • CommandString: String – The command name.
  • Allowed: UInt8 – 1 to allow that player to use the command; 0 to deny them.

Returns: If successful at setting permission to the entity command, function return's true.

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.

SetAccessToEntityCommandByCharID(NPC, charID, "recovershard", true)

Evidence: server/SpawnScripts/Generic/SpiritShard.lua:16; binding EQ2Emu_lua_SetAccessToEntityCommandByCharID.

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