wiki says "Cast" is for non-actors ... there's a guy with a big fox, on here, somewhere, who would probably benefit from that bit of knowledge.
But I assume you are talking about using this on an Actor?
In which case, Packages are better - http://www.creationkit.com/Procedure_UseMagic
(What you want to do should work, other than that)
... be aware of the last note on the linked page! ...
I don't neccesariily need the actor to actually cast it, its more so using them as the epicenter of an explosion. The concept behind the spell is that the player turns an enemy into an ally(trying to figure out what effect archetype does this). So ideally that actor runs into another group of enemies and then after they fight for a little while the effect wears off and at the effect finish an aoe explosion is cast on them. Right now the explosion does actually take place, but it seems the OnEffectFinish event I am using is a bit imprecise. If I could use a timer utilty of sorts it would work much better.
Scriptname PeryiteEffectScript extends activemagiceffectSPELL Property WYDPeryiteExplode AutoEvent OnEffectStart(Actor akTarget,Actor akCaster)akTarget.AddToFaction(CharmFaction)akCaster.StopCombat()akTarget.StopCombat()EndEventEvent OnEffectFinish(Actor akTarget,Actor akCaster)akTarget.RemoveFromFaction(CharmFaction)WYDPeryiteExplode.Cast(akTarget)EndEvent;MagicEffect Property SacrificeProp AutoFaction Property CharmFaction Auto
I think this is going to work for at least the first effect. I'll take a look at some of the other functions under the ActiveMagicEffect script header and hope that one of them provides for a more reliable time-frame.
Edit: Okay so the script works and the timeframe is not an issue at all. I need to get rid of the stop combat call because it makes it so the enemy won't attack anything(even things attacking me or him). I also need to figure out how to do two things to the actor casting the spell, kill them, and force the fx that turns an actor to ashes. I assume that the former can be done by attaching an on self damage effect to the explosion spell( although the explosion spell is supposed to be on self but with an area). The latter, I can probably get an idea of how to do it by looking into what makes the thralls turn to ash once they are killed.