Background for Skyrim SE
Member of the ObjectReference script
voidfunctionInterruptCast()Native

Description

Wiki Description

Interrupts and stops any spell-casting this object might be doing.

Documentation Comment

Interrupts any spell-casting this object may be doing


Caveats


Examples

; Stop this flame trap from casting
FlameTrap.InterruptCast()
;This example script extends ActiveMagicEffect

float Property max auto

Event OnEffectStart(Actor akTarget, Actor akCaster)

    ; Let's say you want to restore your health through a script.
    If (Game.GetPlayer() == akTarget)
        If (akTarget.GetActorValuePercentage("health") >= max)
            akTarget.InterruptCast()
            Debug.Notification("You cannot cast this spell at this time")
            ; Because your health is at 100% (represented by 1.0) this casting will be interrupted until the condition is met.
        ElseIf (akTarget.GetActorValuePercentage("health") <= max)
            akTarget.RestoreAV("health", 300)
        EndIf
    EndIf

EndEvent

Auto-Generated Example

myObjectReference__toCallFunctionOn.InterruptCast()

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.