Lua functions

SetSpellList

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

Historical signature: SetSpellList(spawn, primary_list, secondary_list)

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

Function: SetSpellList(spawn, primary_list, secondary_list = 0, override = false)

Description: Sets an NPC's primary and secondary spell lists and loads a complete replacement for that NPC. Both list settings and the replacement request are captured together. If another configuration, clear or publication supersedes that original request, its late replacement is rejected, including when the configured IDs have returned to the same values. A spell selection already in progress may finish using its captured list values.

Parameters:

  • spawn (Spawn) - The NPC to configure.
  • primary_list (uint32) - Primary spell-list ID. Zero preserves the current ID unless override is true.
  • secondary_list (uint32, optional) - Secondary spell-list ID. Defaults to zero and preserves the current ID unless override is true.
  • override (Bool, optional) - Defaults to false. When true, zero explicitly clears the corresponding list setting.

Returns: None. Invalid or non-NPC spawns log an error.

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.

SetSpellList (NPC, 573, 0, 0)

Evidence: server/SpawnScripts/Generic/NPCModule.lua:437; binding EQ2Emu_lua_SetSpellList.

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