Scriptname KA_TimeSnapBack extends ObjectReference  

Actor property playerRef auto
objectReference property snapBackMarker auto
imageSpaceModifier property AzuraFadeToBlack auto
{Use a basic fade-to-black for the transition}
imageSpaceModifier property FadeToBlackBackImod auto
Sound Property TransitionSFX  Auto 

int property PosXoffset = 0 Auto
{Zero by default}
int property PosYoffset = 0 Auto
{Zero by default}
int property PosZoffset = 0 Auto
{Zero by default}
int property AngleXoffset = 0 Auto
{Zero by default}
int property AngleYoffset = 0 Auto
{Zero by default}
int property AngleZoffset = 0 Auto
{Zero by default}

EVENT onTriggerEnter(objectReference triggerRef)
if triggerRef == playerRef
	AzuraFadeToBlack.apply()
	TransitionSFX.play(triggerRef)
	utility.wait(2.5)
	float posX = ((playerRef.GetPositionX()) + (PosXoffset))
	float posY = ((playerRef.GetPositionY()) + (PosYoffset))
	float posZ = ((playerRef.GetPositionZ()) + (PosZoffset))
	float AngleX = ((playerRef.GetAngleX()) + (AngleXoffset))
	float AngleY = ((playerRef.GetAngleY()) + (AngleYoffset))
	float AngleZ = ((playerRef.GetAngleZ()) + (AngleZoffset))
	triggerRef.moveto(snapBackMarker, abMatchRotation = false)
	triggerRef.setPosition(posX, posY, posZ)
	triggerRef.setAngle(AngleX, AngleY, AngleZ)
	FadeToBlackBackImod.apply()
	AzuraFadeToBlack.remove()
endIf
endEVENT