Lua functions

AddSpellBookEntry

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

Historical signature: AddSpellBookEntry(player, spellid, tier, add_silently, add_to_hotbar)

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

Function: AddSpellBookEntry(player, spellid, tier, add_silently, add_to_hotbar)

Description:

Adds a spell book entry for the Player with the spellid and tier provided. The add_silently (false by default), add_to_hotbar (true by default)

Parameters:

  • player (Spawn) - Spawn object representing player.
  • spellid (uint32) - Integer value spellid.
  • tier (uint16) - Integer value tier.
  • add_silently (bool) - Boolean flag add_silently.
  • add_to_hotbar (bool) - Boolean flag add_to_hotbar.

Returns: None.

Connection lifetime: Each player or group-member connection resolved by this function is retained through the native call. A disconnect or reconnect during a callback cannot destroy that retained connection or switch the ongoing call to a replacement. A later Lua call resolves the current connection. This does not extend the lifetime of unrelated spawn or item userdata.

Checked example

Active call in a local runtime Lua script. The silent flag defaults to false and hotbar placement defaults to true. The binding also handles arguments dynamically. This is a contextual call pattern, not a tested standalone script.

AddSpellBookEntry(Spawn, 8057, 1)

Evidence: server/SpawnScripts/FreeportCitizenshipTrialChamber/ArbbetorTAvi.lua:247; binding EQ2Emu_lua_AddSpellBookEntry.

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