Scriptname SuH_sst_manashroudScript extends activemagiceffect  

Spell property SuH_sp_manashroud auto
Spell property SuH_sst_manashroud auto

MagicEffect property SuH_sp_manashroudeffect auto

Actor property playerRef auto

int cM
actor c

Event OnEffectStart(actor cCaster, actor cTarget)
	c = cCaster
	cM = Math.Floor(c.GetBaseActorValue("magicka"))
	if  c.HasMagicEffect(SuH_sp_manashroudeffect)
		c.RemoveSpell(SuH_sp_manashroud)
		c.DispelSpell(SuH_sst_manashroud)
	elseif cM >= 3
		cM -= 2
		c.SetActorValue("magicka",cM)
		c.AddSpell(SuH_sp_manashroud, false)
		RegisterForSingleUpdate(1.0)
	endIf
endEvent

Event OnUpdate()
	cM = Math.Floor(c.GetBaseActorValue("magicka"))
	if cM >= 3
		cM -= 2
		c.SetActorValue("magicka",cM)
		RegisterForSingleUpdate(1.0)
	else
		c.RemoveSpell(SuH_sp_manashroud)
		c.DispelSpell(SuH_sst_manashroud)
	endIf
endEvent