help with correct syntax for Cast Spell

Post » Tue Jun 19, 2012 3:29 am

I just want to apply a random spell to the player on an inventory event, but am confused with the syntax for Cast Spell.
I have attached the property to the RefAlias in the ck. The formlist exists. But the effect are not triggering.

Scriptname _01_RefAliasScript extends ReferenceAliasformlist property RandomSpellList autoSpell Function RandomSpellList()	  int listSize = RandomSpellList.GetSize()  return RandomSpellList.GetAt(RandomInt(0,listSize))endFunctionEvent OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)	  actor player = GetReference() as Actor	 RandomSpellList.Cast(none, player)	  endifendEvent
User avatar
MR.BIGG
 
Posts: 3373
Joined: Sat Sep 08, 2007 7:51 am

Post » Tue Jun 19, 2012 8:10 am

RandomSpellList.Cast(none, player)

The first parameter should not be 'none'. You can try

RandomSpellList.Cast(player, player)

instead. But from what I understand, the player must be able to cast that spell
User avatar
xx_Jess_xx
 
Posts: 3371
Joined: Thu Nov 30, 2006 12:01 pm

Post » Tue Jun 19, 2012 4:52 am

RandomSpellList.Cast( playerRef )

The second parameter is optional and since your applying the spell to the player, it's not required.

http://www.creationkit.com/Cast_-_Spell

It can also be used with scrolls, but do check the notes.

http://www.creationkit.com/Cast_-_Scroll
User avatar
Laura Hicks
 
Posts: 3395
Joined: Wed Jun 06, 2007 9:21 am


Return to V - Skyrim