Scriptname TEG_DemonsEye05ascript extends Quest  

Actor Property tegtelmagewar01ref  Auto  
Actor Property Target01  Auto  
; note to self, watch doonce01
;this var is used in another quest in this mod, will be interesting to see if it works here.
int doonce01
Quest Property DM06  Auto  

Function warnmage01()
tegtelmagewar01ref.enable()
SetObjectiveDisplayed(10)
SetCurrentStageID(10)
endfunction

Function warnmage02()
RegisterForUpdate(5)
SetObjectiveCompleted(10)
SetObjectiveDisplayed(20)
SetCurrentStageID(20)  
Target01.Enable()
endfunction

Function cleanup()
SetObjectiveCompleted(30)
SetCurrentStageID(40)  
Target01.Disable()
CompleteQuest()
DM06.Start()
endfunction

Event OnUpdate()
if (Target01.IsDead() == 1) && (doonce01 != 1)
SetObjectiveCompleted(20)
SetObjectiveDisplayed(30)
SetCurrentStageID(30)  
UnregisterForUpdate()
doonce01 = 1
Endif
EndEvent

