Scriptname SuH_spellES_teliWorld extends activemagiceffect  

ObjectReference Property SuH_sdr_returnpoint Auto 
ObjectReference Property SuH_sd_spawn1 Auto 
Actor property PlayerRef auto
Cell property SuH_realm auto
GlobalVariable property SuH_CHKdied auto
GlobalVariable property SuH_SETrandomdeathspawn auto

Event OnEffectStart(actor akTarget, actor akCaster)
	if PlayerRef.GetParentCell() == SuH_realm
		if SuH_CHKdied.GetValue() && SuH_SETrandomdeathspawn.GetValue()
			PlayerRef.MoveTo(SuH_sd_spawn1)
		else
			PlayerRef.MoveTo(SuH_sdr_returnpoint)
		endIf
	else
		Debug.Notification("You must be in the main room to Disconnect!")
	endIf
endEvent