Scriptname TGDisbandJailDoorScript extends ObjectReference  

Event OnActivate(ObjectReference akActionRef)
if TGDisband.GetStage() >= 30
	if akActionRef == Game.GetPlayer()
		if (game.GetPlayer().GetItemCount(dunRiftenJailKey)) >= 1
			MessageOption= RiftenJailDoorMessage.Show()
			if (MessageOption == 0)
				self.setOpen(false)
				self.Lock(255)
			endif
			if (MessageOption == 1)
				self.Lock(false)
				self.setOpen(true)
			endif
		elseIf (game.GetPlayer().GetItemCount(dunRiftenJailKey)) == 0
			 MessageOption = RiftenJailDoorMessageNoKey.Show()
		endif
	endif
endif
endEvent

Int MessageOption = 0
Key Property dunRiftenJailKey Auto
Message Property RiftenJailDoorMessage Auto
Message Property RiftenJailDoorMessageNoKey Auto
Quest Property TGDisband Auto