Lua functions

AddMasterTitle

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

Historical signature: AddMasterTitle(TitleName, IsPrefix)

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

Function: AddMasterTitle(TitleName, IsPrefix)

Description: Creates a master title definition, or returns the existing definition found by a case-insensitive name match.

Parameters:

  • TitleName: string - Nonempty title name. The runtime title value keeps up to 255 bytes and a terminating null byte.
  • IsPrefix: int8 - Nonzero for a prefix; zero for a suffix. Defaults to zero.

Returns: SInt32 - The master title database ID, or -1 when the name is invalid or the insert fails.

Ownership: Catalogue rows are owned values. A lookup or replacement cannot leave this call with a pointer to a deleted title. Local C++ preparation finishes before the Lua result is pushed. Database writes and memory publication remain separate operations.

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.

AddMasterTitle("Lord", 1)

Evidence: server/SpawnScripts/IsleRefuge1/TitleBot.lua:15; binding EQ2Emu_lua_AddMasterTitle.

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