Mod:Creation Kit/RegisterForMagicEffectApplyEvent - ScriptObject

Member of: ScriptObject

Registers this script to receive a single OnMagicEffectApply event matching the filters given to this function.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

Syntax
Function RegisterForMagicEffectApplyEvent(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 to them.
 * akCasterFilter: The filter to use for the caster.
 * Default: None
 * Reference or actor: Exact match
 * Base object: Base object match
 * Keyword: Keyword match
 * Faction: Actor in faction match
 * Form list: Containing any of the above (not recursed into)
 * Reference alias: Filling this alias
 * Ref collection alias: Filling this alias
 * None: Anything
 * akEffectFilter: The filter to use for the magic effect
 * Default: None
 * Magic effect base object: Base object match
 * Keyword: Keyword match
 * Form list: Containing any of the above (not recursed into)
 * None: Anything
 * 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
RegisterForMagicEffectApplyEvent(Game.GetPlayer) RegisterForMagicEffectApplyEvent(self, akEffectFilter = FlameEffect, abMatch = false)
 * Register for when the player has any effects applied to him
 * Register for when we are hit by anything OTHER then a flame effect