Skip to content

tes3magicEffectTickEventData⚓︎

This table is passed to the onTick callback function in a custom magic effect.

Properties⚓︎

deltaTime⚓︎

The time passed since the last tick of the spell.

Returns:

  • result (number)

effectId⚓︎

Maps to values in tes3.effect table.

Returns:


effectIndex⚓︎

The index of the effect in the spell.

Returns:

  • result (integer)

effectInstance⚓︎

Access to the magic effect instance.

Returns:


sourceInstance⚓︎

Access to the magic source of the effect instance.

Returns:


Methods⚓︎

trigger⚓︎

Allows the effect to run through the normal spell event system.

local eventResult, modifiedValue = myObject:trigger({ negateOnExpiry = ..., isUncapped = ..., attribute = ..., type = ..., value = ..., resistanceCheck = ... })

Parameters:

  • params (table): Optional.
    • negateOnExpiry (boolean): Default: true. If this flag is true, the effect will be negated on expiry.
    • isUncapped (boolean): Optional.
    • attribute (tes3.effectAttribute): Default: tes3.effectAttribute.nonResistable. The attribute used in resistance calculations agains this effect. Maps to values in tes3.effectAttribute table.
    • type (tes3.effectEventType): Default: tes3.effectEventType.boolean. This flag controls how the effect behaves. For example, tes3.effectEventType.modStatistic will make the effect work as calling tes3.modStatistic. Maps to values in tes3.effectEventType table.
    • value (boolean, integer, number, tes3statistic): Default: 0. The variable this effect changes. This can be a local variable in a script or a tes3statistic property on a tes3mobileActor. The type of the passed variable must match the type of the type parameter.
    • resistanceCheck (fun(e: tes3magicEffectResistenceCheckEventData): boolean?): Optional. The function passed as resistanceCheck will be used on any of the game's spell resistance checks. Returning true from this function will set your effect to expired, and depending on your trigger code may stop processing.

For example, the only effect in vanilla Morrowind that implements this function is Water Walking. It disallows using a spell with Water Walking when the player is deep underwater, by setting it as expired.

Returns:

  • eventResult (boolean)
  • modifiedValue (boolean, integer, number, tes3statistic): The passed value, scaled by resistance. The returned type depends on the passed type parameter.

triggerBoundArmor⚓︎

Performs vanilla armor summoning logic, but also allows bracers and pauldrons. It can summon one or two armor objects with provided ID(s). When summoning gauntlets, bracers or pauldrons, you can provide two IDs.

myObject:triggerBoundArmor(id, id2)

Parameters:

  • id (string): The ID of the armor object to summon.
  • id2 (string): Optional. The ID of the additional gauntlet, bracer or pauldron object to summon.

triggerBoundWeapon⚓︎

Performs vanilla weapon summoning logic. It will create a summoned version of the weapon with provided ID.

myObject:triggerBoundWeapon(id)

Parameters:

  • id (string): The ID of the weapon object to summon.

triggerSummon⚓︎

Performs vanilla creature summoning logic. It will create a summoned version of a creature with provided ID.

myObject:triggerSummon(id)

Parameters:

  • id (string): The ID of the creature object to summon.