Lua functions

SetSpellDisplayEffect

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

Historical signature: SetSpellDisplayEffect(spell, idx, field, percentage)

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

Function: SetSpellDisplayEffect(spell, idx, field, value)

Description: Prepares one display-effect field value before publishing the edit under the spell mutex, marking the record for custom-spell persistence.

Parameters:

  • spell (Spell) - Lua spell object whose backing template owns the effect.
  • idx (int32) - Zero-based effect index. Negative/out-of-range indexes are rejected without truncation.
  • field (string) - Case-insensitive description, bullet or percentage.
  • value (string or uint8) - Description string or numeric bullet/percentage value.

Returns: Boolean success for a valid index, including false for an unknown field. Missing spell/data/index returns no values.

Record ownership: The backing template owns child values directly; readers receive copies and setters publish prepared edits. The instance must be admitted as described below; child-value ownership and VM execution are separate contracts. See Lua actor lifetime.

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.

SetSpellDisplayEffect(Spell, 0, "description", "Increases WIS of target by " .. Stat)

Evidence: server/ItemScripts/AssortedJungleNuts.lua:18; binding EQ2Emu_lua_SetSpellDisplayEffect.

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