Scriptname BskAbilityDecapScript extends activemagiceffect  

import Utility

Int index

Float Damage

Sound Property BskFXDecap01  Auto
Sound Property BskFXDecap02  Auto
Sound Property BskFXDecap03  Auto

VisualEffect Property BskVisualSlashDecap Auto

Event OnEffectStart(Actor Target, Actor Caster)

	index = RandomInt(1,3)

	if index == 1
		BskFXDecap01.play(Caster)  
	elseif index == 2
		BskFXDecap02.play(Caster)
	else
		BskFXDecap03.play(Caster)
	endif

	Debug.SendAnimationEvent(Target, "BleedOutStart")

	Damage =  Target.getav("Health") as float
	Damage -= 1

	Target.DamageAv("Health", Damage)

	wait(1.0)
	BskVisualSlashDecap.play(Target,3.0)

	wait(1.0)
	BskVisualSlashDecap.play(Target,3.0)

	wait(1.0)
	BskVisualSlashDecap.play(Target,3.0)

	if !Target.IsDead()
		Debug.SendAnimationEvent(Target, "KillMove1HMDecap")

		index = RandomInt(1,3)

		if index == 1
			BskFXDecap01.play(Caster)  
		elseif index == 2
			BskFXDecap02.play(Caster)
		else
			BskFXDecap03.play(Caster)
		endif

	endif

EndEvent

