Scriptname mkDecapBleedEffectScript extends ActiveMagicEffect  

ImpactDataSet Property puddleofBlood auto
ImpactDataSet Property splatter auto
Perk Property LimbSplitter auto
Perk Property Decapitation auto

actor target
actor caster
actor source

int bleedCounter = 0
int bleedCounter02 = 0
int bleed
int decap
int random

EVENT onEffectStart(actor akTarget, actor akCaster)
	target = akTarget
	caster = akCaster
	;random = Utility.RandomInt(0, 10)
	target.PlayImpactEffect(splatter,"",0,0,-1,256,false,true)

	if target.isInKillMove()
		while bleedCounter < 20
		target.PlayImpactEffect(splatter, "NPC Head [Head]", 0, 0, 0, 420, false, true)
		target.PlayImpactEffect(puddleofBlood, "NPC Head [Head]", 0, 0, -1, 256, false, true)
		;bleedRandom = Utility.RandomInt(0, 10)
		bleedCounter += 1
		utility.wait(1)
	endWhile
	endif
endEvent

;Function Decapitation()
;  RegisterForAnimationEvent(caster, "Paired_1hMKillMoveDecapSlash") 
;EndFunction
 
;Event OnAnimationEvent(ObjectReference akSource, string asEventName)
;source = akSource
;		while bleedCounter < 20
;		target.PlayImpactEffect(puddleofBlood, "NPC Head [Head]", 0, 0, 0, 256, false, true)
;		target.PlayImpactEffect(puddleofBlood, "NPC Head [Head]", 0, 0, -1, 256, false, true)
;		;bleedRandom = Utility.RandomInt(0, 10)
;		bleedCounter += 1
;		utility.wait(1)
;	endWhile
;		Debug.Trace("We got the reset animation graph event from ourselves that we were looking for!")
;endEvent