Background for Skyrim SE
Member of the ActiveMagicEffect script
eventOnEffectFinish(ActorakTarget, ActorakCaster)

Description

Wiki Description

Event called when the active magic effect has just finished on the specified target.

Documentation Comment

Event received when this effect is finished (effect may already be deleted, calling
functions on this effect will fail)


Caveats

CK Wiki - Notes

  • By the time this event is called, the underlying active magic effect may have already been deleted by the game. Attempts to call native functions may fail and throw errors.
    • Even if the effect is simply disabled (due to spell-side conditions not being met) rather than deleted, calls to native functions may fail, because the Papyrus script object itself is detached after OnEffectFinish completes, resetting all properties and script object variables.
  • This event is also called when the owning spell is removed from the target or when its conditions become invalid.
  • If a magic effect is applied to a LeveledCharacter and the actor respawns (e.g. because their parent cell has been reset) before the effect runs out, then OnEffectFinish will not run. The effect will simply cease to exist.

Parameters

  1. ActorakTarget

    CK Wiki Description

    The Actor this effect just finished on.

  2. ActorakCaster

    CK Wiki Description

    The Actor that cast the spell this effect is from.


Examples

Event OnEffectFinish(Actor akTarget, Actor akCaster)
  Debug.Trace("Magic effect fades from " + akTarget)
endEvent

Auto-Generated Example

Scriptname MyCoolScript extends ActiveMagicEffect

event OnEffectFinish(Actor akTarget, Actor akCaster)
    Debug.trace("Event received - OnEffectFinish: akTarget = " + akTarget + " akCaster = " + akCaster)
endEvent

Related Pages


Additional References

View this event’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.