Scriptname aaaHitStopUpdateQuest extends Quest  

Spell property aaaHitStopMenu auto
Spell property aaaHitSlowTimeConstant auto
Actor property player auto

Event OnInit()
	RegisterForSingleUpdate(2)
EndEvent

Event OnUpdate()
	Actor randomActor1 = Game.FindRandomActorFromRef(player, 1000)
	Actor randomActor2 = Game.FindRandomActorFromRef(player, 1000)
	If(!(randomActor1==player) && !(randomActor1.IsDead()))
		If(!randomActor1.IsInCombat())
			randomActor1.RemoveSpell(aaaHitSlowTimeConstant)
		EndIf
		If(randomActor1.GetActorBase() && !(randomActor1.HasSpell(aaaHitSlowTimeConstant)) )
			randomActor1.AddSpell(aaaHitSlowTimeConstant)
		EndIf
	EndIf
	If(!(randomActor2==player) && !(randomActor2.IsDead()))
		If(!randomActor2.IsInCombat())
			randomActor2.RemoveSpell(aaaHitSlowTimeConstant)
		EndIf
		If(randomActor2.GetActorBase() && !(randomActor2.HasSpell(aaaHitSlowTimeConstant)) )
			randomActor2.AddSpell(aaaHitSlowTimeConstant)
		EndIf
	EndIf
	RegisterForSingleUpdate(2)
EndEvent
