Scriptname SuH_ss_dirtytouchScript extends activemagiceffect  

GlobalVariable Property SuH_PCSactstacks auto

Spell Property SuH_sse_dirtytouch auto
Spell Property SuH_sse_dirtytouchA auto

Actor Property playerRef auto

int i
int x

Event OnEffectStart(Actor akTarget, Actor akCaster)
	SuH_sse_dirtytouch.cast(akTarget, akTarget)
	
	i = SuH_PCSactstacks.GetValue() as int
	if i > 5
		x = i - 5
		SuH_PCSactstacks.SetValue(x)
		i = 5
	else
		SuH_PCSactstacks.SetValue(0)
	endIf
	if i > 0
		while i > 0
			SuH_sse_dirtytouchA.cast(akTarget, akTarget)
		i -= 1
		endWhile
	endIf
endEvent