Mod:Creation Kit/UnregisterForMagicEffectApplyEvent - ScriptObject

Member of: ScriptObject

Unregisters this script from a OnMagicEffectApply event matching the filters given to this function. The filters must match the filters given to the RegisterForMagicEffectApplyEvent function.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

Syntax
Function UnregisterForMagicEffectApplyEvent(ScriptObject akTarget, ScriptObject akCasterFilter = None, Form akEffectFilter = None,\ bool abMatch = true) native

Parameters

 * akTarget: The ObjectReference, ReferenceAlias or RefCollectionAlias that is having the effect applied.
 * akCasterFilter: The filter to use for the caster.
 * Default: None
 * akEffectFilter: The filter to use for the magic effect
 * Default: None
 * abMatch: If true, the filter must match the hit - if false, the filter must NOT match the hit (inverted filter)
 * Default: true

Return Value
None

Examples
UnregisterForMagicEffectApplyEvent(Game.GetPlayer) UnregisterForMagicEffectApplyEvent(self, akEffectFilter = FireEffect)
 * We no longer care about the player having effects applied to him
 * We no longer care about the player having fire applied to him