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

Event OnEffectStart(actor cCaster, actor cTarget)
	if playerRef.HasMagicEffect(SuH_sp_manashroudeffect)
		playerRef.RemoveSpell(SuH_sp_manashroud)
		playerRef.DispelSpell(SuH_sst_manashroud)
	else
		playerRef.AddSpell(SuH_sp_manashroud, false)
		RegisterForSingleUpdate(1.0)
	endIf
endEvent

Event OnUpdate()
	int pM = Math.Floor(playerRef.GetBaseActorValue("magicka"))
	if pM >= 11
		pM -= 10
		playerRef.SetActorValue("magicka",pM)
		RegisterForSingleUpdate(1.0)
	else
		playerRef.RemoveSpell(SuH_sp_manashroud)
		playerRef.DispelSpell(SuH_sst_manashroud)
	endIf
endEvent