Scriptname TEG_DemonsEye02script extends Quest  

Actor Property agent01  Auto  
Actor Property agent02  Auto  
Actor Property agent03  Auto 
int doonce01
int doonce02
int doonce03
int doonce04 
Quest Property DM03  Auto  

Function tegassassin()
RegisterForUpdate(5)
agent01.Enable()
agent02.Enable()
agent03.Enable()
SetObjectiveDisplayed(10)
SetObjectiveDisplayed(20)
SetObjectiveDisplayed(30)
SetCurrentStageID(10)  
endfunction

Event OnUpdate()
if (agent01.IsDead() == 1) && (doonce01 != 1)
SetObjectiveCompleted(10)
doonce01 = 1
Endif

if (agent02.IsDead() == 1) && (doonce02 != 1)
SetObjectiveCompleted(20)
doonce02 = 1
Endif

if (agent03.IsDead() == 1) && (doonce03 != 1)
SetObjectiveCompleted(30)
doonce03 = 1
Endif

if (agent02.IsDead() == 1) && (agent02.IsDead() == 1) && (agent03.IsDead() == 1) && (doonce04 != 1)
SetObjectiveDisplayed(40)
SetCurrentStageID(20)  
UnregisterForUpdate()
doonce03 = 1
Endif
endEvent

Function cleanup()
agent01.Disable()
agent02.Disable()
agent03.Disable()
SetObjectiveCompleted(40)
SetCurrentStageID(30)  
CompleteQuest()
DM03.Start()
endfunction

