ScriptName _amm_GlenmorilTriggerScript Extends ObjectReference

Actor Property acPlayer Auto
Actor Property acDragonGC Auto
Actor Property acDragonFI Auto
ObjectReference[] Property orChest Auto
ObjectReference Property orBarrel Auto
ObjectReference[] Property orTrChest Auto
ObjectReference Property orDeadOrc Auto
ObjectReference Property orUmbra Auto
GlobalVariable Property gvTreasureQst Auto
Quest Property qstHunt Auto

; The trigger will be enabled after reading Attrebus Mede's note

Event OnTriggerEnter(ObjectReference akActionRef)
	
	Int iNum = 0

	If (akActionRef == acPlayer)
		While (iNum < 5)
			orChest[iNum].Disable()
			orTrChest[iNum].Enable()
			iNum += 1
		EndWhile
		orDeadOrc.Enable()
		orUmbra.Enable()
		orBarrel.Enable()
		gvTreasureQst.SetValue(1)
		acDragonFI.Enable()
		acDragonGC.Disable()
		qstHunt.SetStage(10)
	EndIf

EndEvent
