ScriptName aaaKimachuuEndOfTheCenturyF Extends ActiveMagicEffect

Faction property f01 auto
Faction property f02 auto
Faction property f03 auto
Message property mes01 auto
Spell property s01 auto

Actor ActorRef

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Float fTime = Utility.RandomFloat(0.5, 1.0)
	Utility.Wait(fTime)

	ActorRef = akTarget

	If ActorRef.GetFactionRank(f03) != -1
		ActorRef.RemoveSpell(s01)
		Return
	EndIf

	ActorRef.SetRestrained()
	ActorRef.BlockActivation()
	ActorRef.AddToFaction(f02)
	Debug.SendAnimationEvent(ActorRef, "IdleBoundKneesStart")
EndEvent

Event OnActivate(ObjectReference akActionRef)
	mes01.Show()
	ActorRef.SetRestrained(false)
	ActorRef.BlockActivation(false)
	ActorRef.AddToFaction(f01)
	ActorRef.RemoveFromFaction(f02)
	ActorRef.RemoveSpell(s01)
	Debug.SendAnimationEvent(ActorRef, "IdleChairExitStart")
EndEvent