Lua functions

SetSpellVisualState

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

Historical signature: SetSpellVisualState(…) via current binding

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

Function: SetSpellVisualState(target, state_id)

Description: Sets a visual state 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. The state must have a name/range mapping in app_states.dat. 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 state.
  • state_id (integer) - Mapped visual state ID from 1 through 65534.

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

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.

SetSpellVisualState(Target,626)

Evidence: server/Spells/Mage/NPCStaticPulse.lua:18; binding EQ2Emu_lua_SetSpellVisualState.

Current registration: WorldServer/Lua/LuaInterface.cpp.