Scriptname _00E_StopTimeScript extends ObjectReference  

; Only used in a Kor (NQ07) dungeon. Probably obsolete. Do not reuse!

GlobalVariable Property GameHour Auto
Actor Property PlayerREF Auto

Event onTriggerEnter(ObjectReference akActionRef)

	If akActionRef == PlayerREF
		Float curHour = Gamehour.GetValue()
		; Try to switch the time of day closer to 01:00, but avoid jumping back in time too much
		If curHour >= 23.9
			; Do nothing
		ElseIf curHour >= 5.0
			Gamehour.SetValue(23.9)
			SendModEvent("TimeSkip")
		ElseIf curHour > 1.0
			Gamehour.SetValue(1.0)
		EndIf
	EndIf

EndEvent