Scriptname tegdemonseyescript01 extends Quest  

Actor Property TEGTelGolanJordanRef  Auto  
ObjectReference Property chest1  Auto  
ObjectReference Property chest2  Auto  
ObjectReference Property chest3  Auto  
Quest Property DM02  Auto  
SoulGem Property TEGDemonseyeSoulGemQuestitem  Auto  
Actor Property tegtelollyactor  Auto
  
Function GolanJordanEnabled()
TEGTelGolanJordanRef.Enable()
endfunction

Function Removequestchests()
chest1.Disable()
chest2.Disable()
chest3.Disable()
endfunction

Function enablestage30()
chest1.Enable()
chest2.Enable()
chest3.Enable()
SetCurrentStageID(30)
SetObjectiveDisplayed(30)
SetObjectiveDisplayed(31)
SetObjectiveDisplayed(32)
SetObjectiveCompleted(20)
endfunction

Function enablestage50()
SetCurrentStageID(50)
SetObjectiveCompleted(40)
SetObjectiveDisplayed(50)
endfunction

Function cleanup()
SetCurrentStageID(60)
tegtelollyactor.Disable()
SetObjectiveCompleted(50)
chest1.Disable()
chest2.Disable()
chest3.Disable()
DM02.Start()
endfunction

Function soulgemcheck()
RegisterForUpdate(5)
endfunction

Event OnUpdate()
if (Game.GetPlayer().GetItemCount(TEGDemonseyeSoulGemQuestitem) == 3)
tegtelollyactor.Enable()
SetCurrentStageID(40)  
UnregisterForUpdate()
TEGTelGolanJordanRef.Disable()
SetObjectiveDisplayed(40)
endIf
endEvent

