Lua functions

AddPrimaryEntityCommand

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

Historical signature: AddPrimaryEntityCommand(Player, Spawn, Name, Distance, Command, ErrorText, CastTime, SpellVisual, DenyListDefault)

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

Function: AddPrimaryEntityCommand(Player, Spawn, Name, Distance, Command, ErrorText, CastTime, SpellVisual, DenyListDefault)

Description: Puts a context menu (right click) entity command on the Spawn for the Player (or all to access if Player is nil).

Parameters:

  • Player: Spawn - The Player that can access the entity command. Optionally set to nil to allow all access.
  • Spawn: Spawn - The spawn to add the entity command.
  • Name: string - Text display of the entity command.
  • Distance: float - Distance the player can access the command otherwise it is gray.
  • Command: string - Command function to call when used by Player.
  • ErrorText: string - Error text displayed when cannot use.
  • CastTime: UInt16 - Time in /10 of a second to complete the command after clicking it.
  • SpellVisual: UInt32 - Optional spell visual when using the entity command.
  • DenyListDefault: UInt8 - Default is 0, add to allow, set to 1 to put on deny list.

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.

AddPrimaryEntityCommand(nil,NPC,"Recover Spirit Shard",10.0,"recovershard","",0,0,1)

Evidence: server/SpawnScripts/Generic/SpiritShard.lua:13; binding EQ2Emu_lua_AddPrimaryEntityCommand.

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