ScriptName _amm_SelectDestinationScript Extends ObjectReference

Import Debug

Actor Property acPlayer Auto
GlobalVariable Property gvDestination Auto
GlobalVariable Property gvDeparture Auto
Int Property iNdx Auto
Quest Property qDragonborn Auto

Event OnActivate(ObjectReference akActionRef)

	String[] sLoc = New String[11]
	sLoc[0] = "Floating Island"
	sLoc[1] = "Dawnstar"
	sLoc[2] = "Falkreath"
	sLoc[3] = "Markarth"
	sLoc[4] = "Morthal"
	sLoc[5] = "Riften"
	sLoc[6] = "Solitude"
	sLoc[7] = "Whiterun"
	sLoc[8] = "Windhelm"
	sLoc[9] = "Winterhold"
	sLoc[10] = "Raven Rock"

	If (akActionRef == acPlayer)
		If (!qDragonborn.GetStageDone(20) && iNdx == 10 )
			Notification("You cannot go there yet! You should have been on Solstheim at least once")
		Else
			gvDestination.SetValue(iNdx)
			Int iDepart = gvDeparture.GetValue() As Int
			String sMsg = "Travelling from " + sLoc[iDepart] + " to " + sLoc[iNdx] + ".\n"
			sMsg += "Board the airschip or change your destination."
			MessageBox(sMsg)
		EndIf
	EndIf

EndEvent
