Difference between revisions of "InterruptCast - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jlundin
(Created page with 'Category:Scripting Category:Papyrus '''Member of:''' ObjectReference Script Interrupts and stops any spell-casting this object might be doing. == Syntax == <source …')
 
imported>Terra Nova
Line 21: Line 21:
FlameTrap.InterruptCast()
FlameTrap.InterruptCast()
</source>
</source>
<br>
<source lang="papyrus">
;This script example is extending from activemagiceffect.
;The idea is to interrupt a spell the target has.
;properties
Spell property IceStorm1 auto ; spell chosen in the property window is Ice Storm
;akTarget = the enemy this spell effect will be placed on.
Event OnEffectStart(Actor akTarget, Actor akCaster)
        if akTarget.HasSpell(IceStorm1) ;if the target has a certain spell, you would like to interrupt, use the conditional below.
          akTarget.InterruptCast() ;then it will be interrupted by this line.
      endif
EndEvent
</source>
The result is if the enemy attempts to cast the spell Ice Storm, he will be unable to complete the cast.<br>
Very useful for enemies that use wards spells - it will still appear briefly but they will be unable to "turtle" with it because of the script.


== See Also ==
== See Also ==
*[[ObjectReference Script]]
*[[ObjectReference Script]]
*[[Cast - Spell]]
*[[Cast - Spell]]

Revision as of 10:34, 24 February 2012

Member of: ObjectReference Script

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

Syntax

Function InterruptCast() native

Parameters

None.

Return Value

None.

Examples

; Stop this flame trap from casting
FlameTrap.InterruptCast()


;This script example is extending from activemagiceffect. 
;The idea is to interrupt a spell the target has.

;properties
Spell property IceStorm1 auto ; spell chosen in the property window is Ice Storm


;akTarget = the enemy this spell effect will be placed on. 
Event OnEffectStart(Actor akTarget, Actor akCaster)
        if akTarget.HasSpell(IceStorm1) ;if the target has a certain spell, you would like to interrupt, use the conditional below.
           akTarget.InterruptCast() ;then it will be interrupted by this line.
       endif
EndEvent

The result is if the enemy attempts to cast the spell Ice Storm, he will be unable to complete the cast.
Very useful for enemies that use wards spells - it will still appear briefly but they will be unable to "turtle" with it because of the script.

See Also