Jump to content

[LE] Function to stop a spell cast


Quibblonian101

Recommended Posts

I have a spell that uses something other than magicka to work. So I need to add a function that makes the spell fail If I don't have enough of the certain object. This is what I have so far and I'm using steel ingots as an example.

I tried InterruptCast() but it did nothing. It removes the steel ingot and it sends the dubug notification, but it doesn't stop the cast when I have no steel.

Scriptname Remove_SteelIngot_script extends ActiveMagicEffect 


Actor Property PlayerRef Auto

MiscObject Property SteelRef Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
      If (PlayerRef == akCaster)
	    If akCaster.GetItemCount(SteelRef) < 1
		   akCaster.InterruptCast()
		   Debug.Notification("You have no steel!")
		ElseIf akCaster.GetItemCount(SteelRef) >= 1
               akCaster.RemoveItem(SteelRef, 1)
		EndIf
	EndIf
EndEvent	
Edited by Quibblonian101
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...