QUEST_HELIAS_TIME = 60 * 90
------------------------------------------------------------------------------------------------------------------------------------
function createQuestHelias()

    questHeliasTimer = 0
	
	randompos = 0
	HunterWPs = {}
	HunterWPs[300] = {"HeadHunterSpawn","Headhunter_Shot1",90} --120
	HunterWPs[966] = {"Headhunter_Shot1","Headhunter_Shot2",45} --105
	HunterWPs[1632] = {"Headhunter_Shot2","Headhunter_Shot3",0} --90
	HunterWPs[2298] = {"Headhunter_Shot3","Headhunter_Shot4",90} --75
	HunterWPs[3630] = {"Headhunter_Shot4","Headhunter_Shot5",55} --60
	HunterWPs[4296] = {"Headhunter_Shot5","Headhunter_Shot6",90} --45
	HunterWPs[4962] = {"Headhunter_Shot6","Headhunter_Shot7",225} --30
	HunterWPs[5628] = {"Headhunter_Shot7","Helias",135} --15
	HunterWPs[6300] = function() Stream.Start( "sounds\\military\\so_rifleman_rnd_3.wav",200) end --0 PENG
	
	Huntercounter = 0
	
	availableCaves = {1,2,3,4}

    StartSimpleJob("controlQuestHelias")

    end
------------------------------------------------------------------------------------------------------------------------------------
function controlQuestHelias()

    questHeliasTimer = questHeliasTimer +1

    if questHeliasTimer > QUEST_HELIAS_TIME then

        Defeat()

        return true

        end
	if questHeliasTimer == 3000 then
		createQuestCaves()
	end
	if questHeliasTimer == 300 then
		MapLocal_StartCountDown(QUEST_HELIAS_TIME-300)
	end
	if type(HunterWPs[questHeliasTimer]) == "table" then
		local hunterpos = GetPosition(HunterWPs[questHeliasTimer][1])
		local hunterID = Logic.CreateEntity(Entities.PU_Hero10, hunterpos.X, hunterpos.Y, HunterWPs[questHeliasTimer][3], 7)
		GUI.ScriptSignal(hunterpos.X,hunterpos.Y,1)
		Logic.SetEntityExplorationRange(GetID(HunterWPs[questHeliasTimer][1]), 4)
		Stream.Start(Folders.Map.."rington.wav",100)
		StartSimpleJob("MoveHunterAndFadeVision",HunterWPs[questHeliasTimer][2],HunterWPs[questHeliasTimer][1],hunterID)
	elseif type(HunterWPs[questHeliasTimer]) == "function" then
		
	end
	if math.mod(questHeliasTimer,300) == 0 then
		if table.getn(availableCaves) <= 0 then
			return false
		end
		--spawntroops bei Höhlen
		--if not bridgeopen then
			randompos = availableCaves[math.random(1,table.getn(availableCaves))]
			
		--else
			--randompos = math.random(1,5)
			
		--end
		local cavepos = GetPosition("s_army"..randompos)
		local switch = true
		for i = 1,6+(cavesdestroid*2)+bridgeflag,1 do
			villageAttackers[randompos]:CreateLeaderForArmy(switch and Entities.CU_Evil_LeaderBearman1 or Entities.CU_Evil_LeaderSkirmisher1,16,cavepos,3)
			switch = not switch
		end
	end
	return false
    end
	
function MoveHunterAndFadeVision(_nextPos,_fadeVisionEnt,_hunter)
	if Huntercounter >= 13 then
		Logic.SetEntityExplorationRange(GetID(_fadeVisionEnt), 0)
		Huntercounter = 0
		return true
	elseif Huntercounter == 10 then
		MoveAndVanish(_hunter,_nextPos)
	end
	Huntercounter = Huntercounter + 1
	return false
end
	