Scriptname tegtelmq04script extends Quest  

ObjectReference Property tegdeadbodymarker  Auto  
ObjectReference Property tegkillers  Auto  
MiscObject Property PlayerGold  Auto  
Actor Property tegkill01ref  Auto  
Actor Property tegkill02ref  Auto  
ActorBase Property tegkiller01base  Auto  
ActorBase Property tegkiller02base  Auto  

Function giveplayergold()
Game.GetPlayer().AddItem(PlayerGold, 200)
endfunction

Function enablebodies()
tegdeadbodymarker.Enable()
tegkillers.Enable()
SetCurrentStageID(10)
endfunction

Function enablekillers()
tegkiller01base.SetEssential(false)
tegkiller02base.SetEssential(false)
SetCurrentStageID(20)
endfunction

Function killersdrawweapons()
tegkill01ref.DrawWeapon()
tegkill02ref.DrawWeapon()
endfunction

Function killersattackplayer()
tegkill01ref.StartCombat(Game.GetPlayer())
tegkill02ref.StartCombat(Game.GetPlayer())
RegisterForUpdate(5)
endfunction

Event OnUpdate()
if (tegkill01ref.IsDead() == 1) && (tegkill02ref.IsDead() == 1) 
SetCurrentStageID(30)
SetObjectiveCompleted(20)
SetObjectiveDisplayed(30)
UnregisterForUpdate()
endif
endEvent

Function telljonakillersRdead()
SetCurrentStageID(40)
endfunction

Function cleanupquest()
tegkillers.disable()
tegdeadbodymarker.disable()
SetObjectiveCompleted(40)
SetCurrentStageID(50)
CompleteQuest()
endfunction




