Ok, those scripts compiled with errors but helped me learn quite a bit.
I created a new one that sort of does what I want
The problem is that it is "OnHit" so every time I hit the actor that is under the GetActorValue it will cast the spell, I only want it to be casted once. Also there is no cast animation so I know I am going to have to use InterruptCast() some where in here.
Scriptname akurdbossfight extends actor ; because i get function error with ObjectReference because of GetActorValueSpell Property lamespell AUTO ;assign a spell via properties when attached to NPC ; I asigned a healing spell for testingSpell Property enragespell AUTO ;assign a spell via properties when attached to NPCEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) if Self.GetActorValue("health") <= 8000 lamespell.Cast(Self, Self) if Self.GetActorValue("health") <= 5000 lamespell.Cast(Self, Self) if Self.GetActorValue("health") <= 3000 enragespell.Cast(Self, Self) endif endif endifEndEventDo I have to use something more like the following?
Scriptname akurdbossfight extends actorSpell Property lamespell AUTO ;assign a spell via properties when attached to NPCSpell Property enragespell AUTO ;assign a spell via properties when attached to NPCEvent OnCombatStateChanged(Actor akTarget, int aeCombatState)if (akTarget == Game.GetPlayer()) if (aeCombatState == 0) elseif (aeCombatState == 1) elseif Self.GetActorValue("health") <= 8000 self.InterruptCast() lamespell.Cast(Self, Self) elseif Self.GetActorValue("health") <= 5000 self.InterruptCast() lamespell.Cast(Self, Self) elseif Self.GetActorValue("health") <= 3000 self.InterruptCast() enragespell.Cast(Self, Self) endif endifEndEvent I know the wiki says cast and remotecast "This function casts the spell instantaneously. This is mainly desirable only for non-actors, because it will not animate an actor."
Any solutions
thanks