Scriptname zzzTeleportSpellNPCScript extends activemagiceffect  
Cell Property zzzTeleportSpellNPCCell  Auto  

ObjectReference Property zzzTeleportSpellNPCXMH  Auto  

ObjectReference Property zzzTeleportSpellNPCXM  Auto  

Event OnEffectStart(Actor Target, Actor Caster)
	If (Target.GetParentCell() != zzzTeleportSpellNPCCell)
		zzzTeleportSpellNPCXM.MoveTo(Target)
		Target.MoveTo(zzzTeleportSpellNPCXMH)
	Else
		Target.MoveTo(zzzTeleportSpellNPCXM)
	EndIf
EndEvent