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.