Lua functions

AddPersistentSpellVisual

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

Historical signature: AddPersistentSpellVisual(…) via current binding

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

Function: AddPersistentSpellVisual(target, visual_id [, level])

Description: Adds or updates a persistent visual owned by the current spell instance on an entity. The call requires an active, unresisted spell. The target must be its caster, an active tracked target in its zone, or a tracked character/pet target. Pet validation retains the original owner allocation while reading its character ID and pet category; a reused runtime ID cannot substitute another owner.

Parameters:

  • target (Spawn) - Entity receiving the visual.
  • visual_id (integer) - Visual ID from 1 through 4294967294.
  • level (integer, optional) - Visual level from 0 through 255. Defaults to the spell's initial caster level, capped at 255.

Returns: Boolean: true when the visual storage changes; false for rejected input, an unavailable spell/target, an unchanged entry or failed effect admission.

Checked example

Active call in a local runtime Lua script. The visual level comes from the active spell when omitted. The binding also handles arguments dynamically. This is a contextual call pattern, not a tested standalone script.

AddPersistentSpellVisual(Target, 300)

Evidence: server/Spells/Commoner/StingingBarrage.lua:17; binding EQ2Emu_lua_AddPersistentSpellVisual.

Current registration: WorldServer/Lua/LuaInterface.cpp.