need help with Sendanimationevent()

Post » Thu Jun 21, 2012 5:52 am

Hi I am having trouble trying to use sendanimationevent to cast a spell.
The NPC seems to equip the spell but never casts it.
Nothing I seem to try works, has any one had any luck getting it to work during combat?

Spoiler
Scriptname akurdbossfight extends actorSpell Property lamespell AUTOSpell Property enragespell AUTOScene property tauntscene autoScene property tauntscene2 autoScene property tauntscene3 autoScene property tauntscene4 autoScene property tauntscene5 autoInt Toggle = 0Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)				   If									Self.GetActorValuePercentage("health") <= 0.9 && Toggle == 0			   										  self.InterruptCast()														 Self.EquipSpell(lamespell, 1)														 Debug.SendAnimationEvent(Self, "Magic_Equip")																												 Utility.Wait(0.3)																											 Debug.SendAnimationEvent(Self, "MRh_SpellSelfStart")																		  Toggle = 1																												 Utility.Wait(6) ;wait for actor to finish acting before scene														 Self.UnequipSpell(lamespell, 1)														 tauntscene.Start() ;the boss taunts/mocks the player								elseif				 Self.GetActorValuePercentage("health") <= 0.8 && Toggle == 1							   						  self.InterruptCast()														 Self.EquipSpell(lamespell, 1)														 Debug.SendAnimationEvent(Self, "Magic_Equip")														 Utility.Wait(0.3)														 Debug.SendAnimationEvent(Self, "MRh_SpellSelfStart") ;Causes him to cast the spell.																		  Toggle = 2														 Utility.Wait(6) ;wait for actor to finish acting before scene														 Self.UnequipSpell(lamespell, 1)														 tauntscene.Start() ;the boss taunts/mocks the player																					elseif				 Self.GetActorValuePercentage("health") <= 0.6 && Toggle == 2							   						  self.InterruptCast()														 Self.EquipSpell(enragespell, 1)														 Debug.SendAnimationEvent(Self, "Magic_Equip")														 Utility.Wait(0.3)														 Debug.SendAnimationEvent(Self, "MRh_SpellSelfStart") ;Causes him to cast the spell.																	 Toggle = 3 ; Prevents multiple firings of this If																											 Utility.Wait(6) ;wait for actor to finish acting before scene														 Self.UnequipSpell(enragespell, 1)														 tauntscene.Start() ;the boss taunts/mocks the player								endifEndEvent

thanks
User avatar
x_JeNnY_x
 
Posts: 3493
Joined: Wed Jul 05, 2006 3:52 pm

Post » Thu Jun 21, 2012 5:33 am

It appears he equips the spell with out having to use Debug.SendAnimationEvent(Self, "Magic_Equip")
Is there a condition I am not meeting? why is he not casting the spell when Debug.SendAnimationEvent(Self, "MRh_SpellSelfStart") is called?

Thanks
User avatar
Scott
 
Posts: 3385
Joined: Fri Nov 30, 2007 2:59 am

Post » Thu Jun 21, 2012 12:07 pm

Have you tried using that in conjunction with the Cast spell function? I know that cast spell does not do the animation but maybe you need to do both?
User avatar
Chelsea Head
 
Posts: 3433
Joined: Thu Mar 08, 2007 6:38 am

Post » Thu Jun 21, 2012 2:29 am

I tried that at one stage, it did not work.
I think there is a condition that I do not know about that I need to get the animation to work cast the spell.
User avatar
W E I R D
 
Posts: 3496
Joined: Tue Mar 20, 2007 10:08 am


Return to V - Skyrim