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:
result
(tes3.effect, integer)
effectIndex
⚓︎
The index of the effect in the spell.
Returns:
result
(integer)
effectInstance
⚓︎
Access to the magic effect instance.
Returns:
result
(tes3magicEffectInstance)
sourceInstance
⚓︎
Access to the magic source of the effect instance.
Returns:
result
(tes3magicSourceInstance)
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 istrue
, 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 intes3.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 callingtes3.modStatistic
. Maps to values intes3.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 ates3mobileActor
. The type of the passed variable must match the type of thetype
parameter.resistanceCheck
(fun(e: tes3magicEffectResistenceCheckEventData): boolean?): Optional. The function passed asresistanceCheck
will be used on any of the game's spell resistance checks. Returningtrue
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 passedvalue
, scaled by resistance. The returned type depends on the passedtype
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.