magicAbsorb⚓︎
This event is triggered before a magic absorption check. It allows changing the absorption chance.
Each spell absorption effect active on a target will roll separately; the absorb chances are independent. This event also occurs once per effect in a spell, so a multi-effect spell may trigger this multiple times.
--- @param e magicAbsorbEventData
local function magicAbsorbCallback(e)
end
event.register(tes3.event.magicAbsorb, magicAbsorbCallback)
Tip
This event can be filtered based on the target event data.
Tip
This event supports blocking by setting e.block to true or returning false. Blocking the event prevents vanilla behavior from happening. For example, blocking an equip event prevents the item from being equipped.
Tip
An event can be claimed by setting e.claim to true, or by returning false from the callback. Claiming the event prevents any lower priority callbacks from being called.
Event Data⚓︎
absorbChance(number): The % chance that the magic is absorbed. May be modified.absorbEffect(tes3activeMagicEffect): Read-only. The specific spell absorption effect being tested. This is ates3activeMagicEffectinstead of a more common magic instance. You can lookup the magic source instance or effect instance withtes3activeMagicEffectaccessors.mobile(tes3mobileActor): Read-only. The mobile actor that may absorb the spell.source(tes3alchemy, tes3enchantment, tes3spell): Read-only. The magic source.sourceInstance(tes3magicSourceInstance): Read-only. The unique instance of the magic source.target(tes3reference): Read-only. The actor that may absorb the spell.
Examples⚓︎
Example: Reduce spell absorption chance for the player
local function onMagicAbsorb(e)
if e.target == tes3.player then
e.absorbChance = math.max(0, e.absorbChance - 25)
end
end
event.register(tes3.event.magicAbsorb, onMagicAbsorb)