dofile("Scripts/mission.lua");
dofile("Scripts/msl.lua");

function PostCreate()
	mission_lua.BasicMissionInitialize()
	AIparts:AddPeriodic("Bahnhof erobert", 100, func_Bahnhof_erobert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Start", 10, func_Start, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Patrol1", 200, func_Patrol1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol2", 200, func_Patrol2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("VBR", 100, func_VBR, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Angriff_Dorf", 50, func_Angriff_Dorf, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Feind im Dorf", 50, func_Feind_im_Dorf, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Spieler am Bahnhof", 50, func_Spieler_am_Bahnhof, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Dorf verloren", 50, func_Dorf_verloren, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Auswertung Dorf", 50, func_Auswertung_Dorf, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Auftrag Öllager", 200, func_Auftrag__llager, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler im Tanklager", 10, func_Spieler_im_Tanklager, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Tanklager Sprengsatz", 10, func_Tanklager_Sprengsatz, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Tanklager explodiert", 10, func_Tanklager_explodiert, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Auswertung Lagerexplosion", 10, func_Auswertung_Lagerexplosion, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Flieger_Bahnhof", 100, func_Flieger_Bahnhof, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol_Bahnhof", 100, func_Patrol_Bahnhof, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auftrag Industrie", 100, func_Auftrag_Industrie, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Vor_Öllager", 100, func_Vor__llager, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Vor_VBRL", 50, func_Vor_VBRL, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Spieler_in_Industrie", 50, func_Spieler_in_Industrie, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Industrie_erobert", 100, func_Industrie_erobert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Angriff Bahn Intervall", 300, func_Angriff_Bahn_Intervall, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Angriff Dorf Intervall", 1000, func_Angriff_Dorf_Intervall, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auslöser_Flieger", 100, func_Ausl_ser_Flieger, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Industrie_Intervall", 2000, func_Industrie_Intervall, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler_Dorf1", 50, func_Spieler_Dorf1, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Waffenfabrik defekt", 10, func_Waffenfabrik_defekt, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Produktion", 3000, func_Produktion, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Bomben auf Waffenfabrik", 100, func_Bomben_auf_Waffenfabrik, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Gegner bei Waffenfabrik", 10, func_Gegner_bei_Waffenfabrik, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Auftrag_Süd", 100, func_Auftrag_S_d, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Ausloeser_Pioniere_Bahnhof", 100, func_Ausloeser_Pioniere_Bahnhof, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Fallis_Bruecke", 400, func_Fallis_Bruecke, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Pioniere_Bahnhof", 200, func_Pioniere_Bahnhof, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Pioniere_am_Bahnhof", 200, func_Pioniere_am_Bahnhof, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Absturz1", 100, func_Absturz1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Absturz2", 100, func_Absturz2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Absturz3", 100, func_Absturz3, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Pilot am Bahnhof", 100, func_Pilot_am_Bahnhof, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler vor Stadt", 50, func_Spieler_vor_Stadt, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Patrol_Stadt", 6000, func_Patrol_Stadt, 0 + RandomHalf(100))
	AIparts:AddPeriodic("General_Süd erledigt", 100, func_General_S_d_erledigt, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Sound Wiederholung1", 12000, func_Sound_Wiederholung1, 2000 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler in Stadt", 50, func_Spieler_in_Stadt, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Auftrag Frachter", 100, func_Auftrag_Frachter, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auftrag Stadt Nord", 100, func_Auftrag_Stadt_Nord, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Brücken_Nord", 50, func_Br_cken_Nord, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Sound Wiederholung2", 12000, func_Sound_Wiederholung2, 1000 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler im Stadtzentrum", 100, func_Spieler_im_Stadtzentrum, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Frachter erledigt", 100, func_Frachter_erledigt, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Stadt_Nord_Verteidigung1", 100, func_Stadt_Nord_Verteidigung1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler in Stadt Nord", 100, func_Spieler_in_Stadt_Nord, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler in Stadt Nord Center", 100, func_Spieler_in_Stadt_Nord_Center, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auftrag Bahnhof Nord", 100, func_Auftrag_Bahnhof_Nord, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Zug Feind", 100, func_Zug_Feind, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Bahnhof Nord erobert", 100, func_Bahnhof_Nord_erobert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Stadt Nord erobert", 100, func_Stadt_Nord_erobert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Frachter_Exit", 100, func_Frachter_Exit, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auftrag Hafen", 100, func_Auftrag_Hafen, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler im Hafen", 100, func_Spieler_im_Hafen, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Hafen erobert", 100, func_Hafen_erobert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auftrag Strasse", 100, func_Auftrag_Strasse, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler vor Strasse", 100, func_Spieler_vor_Strasse, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler in Strasse", 100, func_Spieler_in_Strasse, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Strasse erobert", 100, func_Strasse_erobert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Posten1", 1000, func_Posten1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Posten2", 1000, func_Posten2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Posten3", 1000, func_Posten3, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Posten4", 1000, func_Posten4, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Posten5", 1000, func_Posten5, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Posten6", 1000, func_Posten6, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Posten7", 1000, func_Posten7, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Posten8", 1000, func_Posten8, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Fallis_Dorf_Sued", 100, func_Fallis_Dorf_Sued, 0 + RandomHalf(100))
	AIparts:AddPeriodic("BRQ1", 100, func_BRQ1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("BRQ2", 100, func_BRQ2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("BRQ3", 100, func_BRQ3, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Angriff_Frachter", 1000, func_Angriff_Frachter, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Abwehr_Ost", 100, func_Abwehr_Ost, 0 + RandomHalf(100))
	AIparts:AddPeriodic("calli_Hafen", 3000, func_calli_Hafen, 0 + RandomHalf(100))
	AIparts:AddPeriodic("calli_Vor_Strasse", 100, func_calli_Vor_Strasse, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Zange start", 100, func_Zange_start, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Landungsboote", 4000, func_Landungsboote, 0 + RandomHalf(100))
	msd_vars = {
		Absturz = false,
		Angriff_Bahnhof = false,
		Angriff_Dorf = false,
		Auftrag_Industrie = false,
		br1 = false,
		br2 = false,
		br3 = false,
		br4 = false,
		Flieger_Bahnhof = false,
		Frachter = false,
		Lager_erledigt = false,
		Lager_Explosion = false,
		Patrol_Stadt = false,
		Pioniere_Bahnhof = false,
		Produktion = false,
		Produktion_max = false,
		Produktionscounter = 0,
		Spieler_in_Industrie = false,
		Stadt_Nord = false,
		Waffenfabrik_defekt = false,
		Zange1 = 0,
	}
end

function func_Bahnhof_erobert()
	if NumPlayerUnitsInZone("Player", "Bahnhof1") > 0 and NumPlayerUnitsInZone("Enemy", "Bahnhof1") < 1 then
		ProceedObjective("Bahnhof_Süd", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.OutScreenMessage(100006, 15, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 295*10, function()  RunSpawn("Player", {"Zug_Panzer2", }, "Zug", "Player", "Player", true, true, {{unload=true, }, {dislocation="Exit_Zug", }, {disappear=true, }, }, false, 0) end)
		TransferUnits("Angriff_Dorf", 0, "Angriff_Bahnhof", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  msd_vars.Angriff_Bahnhof = true end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  RunSpawn("Enemy", {"Patrol", }, "Angriff_Dorf_Bahnhof", "Angriff_Bahnhof", "", true, true, {}, false, 5) end)
		SendPlane("Player", "Bahn6", "transport", "SE", 15, 2, "Player")
		AIparts:RemovePeriodic("Bahnhof erobert")
	end
end

function func_Start()
	do
		DisableObjective("Start")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  RunSpawn("Player", {"Start_Player", }, "Start_Player", "Player", "Player", true, true, {}, false, 20) end)
		AcivateObjective("Bahnhof_Süd")
		mission.CameraLock(true)
		mission.CameraAt({-172.584290, 2.852747, -862.922974}, 59.999996, 150.622559, 104.582848, 0.00)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  mission.OutScreenMessage(100001, 15, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  mission.CameraAt({935.913940, 2.610127, -968.946289}, 30.000000, 90.000000, 84.558151, 10.00) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 35*10, function()  mission.CameraLock(false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.OutScreenMessage(100023, 30, "0xFFE0E0E0") end)
		SetPlaneSide(1, "SE")
		AIparts:RemovePeriodic("Start")
	end
end

function func_Patrol1()
	if NumGroupUnitsNearPoint("Patrol1", 0, "Patrol1", 50) > 1 then
		MoveGroupTo("Patrol1", {}, {"Patrol3", }, {}, true, true, "", false, 50)
	end
	if NumGroupUnitsNearPoint("Patrol1", 0, "Patrol3", 50) > 1 then
		MoveGroupTo("Patrol1", {}, {"Patrol1", }, {}, true, true, "", false, 50)
	end
	if NumGroupUnits("Patrol1", 0, false, false, false) < 3 then
		AIparts:RemovePeriodic("Patrol1")
	end
end

function func_Patrol2()
	if NumGroupUnitsNearPoint("Patrol2", 0, "Patrol2", 50) > 1 then
		MoveGroupTo("Patrol2", {}, {"Patrol3", }, {}, true, true, "", false, 50)
	end
	if NumGroupUnitsNearPoint("Patrol2", 0, "Patrol3", 50) > 1 then
		MoveGroupTo("Patrol2", {}, {"Patrol2", }, {}, true, true, "", false, 50)
	end
	if NumGroupUnits("Patrol1", 0, false, false, false) < 3 then
		AIparts:RemovePeriodic("Patrol2")
	end
end

function func_VBR()
	if NumPlayerUnitsInZone("Player", "VBR1") > 0 then
		MoveGroupToZone("VBR1", "VBR1", true, false)
		msd_vars.br1 = true
	end
	if NumPlayerUnitsInZone("Player", "VBR2") > 0 then
		MoveGroupToZone("VBR2", "VBR2", true, false)
		msd_vars.br2 = true
	end
	if NumPlayerUnitsInZone("Player", "VBR3") > 0 then
		MoveGroupToZone("VBR3", "VBR3", true, false)
		msd_vars.br3 = true
	end
	if NumPlayerUnitsInZone("Player", "VBR4") > 0 then
		MoveGroupToZone("VBR4", "VBR4", true, false)
		msd_vars.br4 = true
	end
	if NumGroupUnitsInZone("Pioniere_Bahnhof", "Bahnhof1") > 0 then
		TransferUnits("VBR1", 0, "Wachposten", 0)
		TransferUnits("VBR2", 0, "Wachposten", 0)
		TransferUnits("VBR3", 0, "Wachposten", 0)
		TransferUnits("VBR4", 0, "Wachposten", 0)
		AIparts:RemovePeriodic("VBR")
	end
end

function func_Angriff_Dorf()
	if NumPlayerUnitsInZone("Player", "HBR") > 0 then
		RunSpawn("Enemy", {"Angriff_Dorf", }, "Angriff_Dorf_Bahnhof", "Angriff_Dorf", "Angriff_Dorf", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  msd_vars.Angriff_Dorf = true end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 400*10, function()  TransferUnits("Start_Friend", 0, "Player", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  SendPlane("Enemy", "Falli_Ost3", "transport", "SW", 15, 4, "Angriff_Dorf") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  SendPlane("Enemy", "Patrol3", "transport", "NW", 15, 4, "Angriff_Dorf") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Falli_Ost1", "transport", "NW", 15, 4, "Angriff_Dorf") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Falli_Ost2", "transport", "NW", 15, 4, "Angriff_Dorf") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  RunSpawn("Enemy", {"Patrol", }, "Patrol_Bahnhof", "Patrol_Bahnhof", "", true, true, {}, false, 5) end)
		AIparts:RemovePeriodic("Angriff_Dorf")
	end
end

function func_Feind_im_Dorf()
	if NumGroupUnitsInZone("Angriff_Dorf", "Start_Dorf") > 0 then
		mission.OutScreenMessage(100000, 25, "0xFFE0E0E0")
		TransferUnits("Start_Friend", 0, "Player", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AcivateObjective("Dorf") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Falli_Ost3", "transport", "SW", 15, 4, "Angriff_Dorf") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  SendPlane("Enemy", "Falli_Ost3", "transport", "S", 15, 4, "Angriff_Dorf") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 180*10, function()  SendPlane("Enemy", "Falli_Ost3", "transport", "SW", 15, 4, "Angriff_Dorf") end)
		AIparts:RemovePeriodic("Feind im Dorf")
	end
end

function func_Spieler_am_Bahnhof()
	if NumPlayerUnitsInZone("Player", "Bahnhof1") > 0 then
		TransferUnits("Patrol1", 0, "Angriff_Dorf", 0)
		TransferUnits("Patrol2", 0, "Angriff_Dorf", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  MoveGroupToZone("Angriff_Dorf", "Start_Dorf1", true, false) end)
		RunSpawn("Player", {"Dorf1", }, "Bahnhof1", "Player", "", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  UnloadTransports("Angriff_Bahnhof") end)
		AIparts:RemovePeriodic("Spieler am Bahnhof")
	end
end

function func_Dorf_verloren()
	if IsObjectiveActive("Dorf") and NumPlayerUnitsInZones("Player", {"Start_Dorf", "Start_Dorf1", }) < 2 and NumPlayerUnitsInZones("Enemy", {"Start_Dorf", "Start_Dorf1", }) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  mission.OutScreenMessage(100009, 15, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Dorf verloren")
	end
end

function func_Auswertung_Dorf()
	if IsObjectiveCompleted("Bahnhof_Süd", "Player") and NumPlayerUnitsInZones("Player", {"Start_Dorf", "Start_Dorf1", }) > 1 then
		SetObjectiveComplete("Dorf", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 80*10, function()  RunSpawn("Player", {"Dorf1", }, "Start_Player", "Player", "Player", true, true, {}, false, 20) end)
		AIparts:RemovePeriodic("Auswertung Dorf")
	end
	if IsObjectiveCompleted("Bahnhof_Süd", "Player") and NumPlayerUnitsInZones("Player", {"Start_Dorf", "Start_Dorf1", }) < 2 then
		FailObjective("Dorf")
		AIparts:RemovePeriodic("Auswertung Dorf")
	end
end

function func_Auftrag__llager()
	if IsObjectiveCompleted("Bahnhof_Süd", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  AcivateObjective("Treibstofflager") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  mission.OutScreenMessage(100012, 15, "0xFFE0E0E0") end)
		MoveGroupToZone("Angriff_Bahnhof", "Bahnhof1", false, false)
		AIparts:RemovePeriodic("Auftrag Öllager")
	end
end

function func_Spieler_im_Tanklager()
	if NumPlayerUnitsInZone("Player", "Tanklager") > 0 and IsObjectiveActive("Treibstofflager") then
		mission.OutScreenMessage(100013, 30, "0xFFE0E0E0")
		ProceedObjective("Treibstofflager", "Player")
		AIparts:RemovePeriodic("Spieler im Tanklager")
	end
end

function func_Tanklager_Sprengsatz()
	if IsObjectiveCompleted("Treibstofflager", "Player") and NumPlayerUnitsInZone("Enemy", "Tanklager") > 0 then
		Bombardment("Treibstofflager", 10, 5, 5, 30)
		mission.OutScreenMessage(100014, 15, "0xFFE0E0E0")
		FailObjective("Treibstofflager")
		msd_vars.Lager_erledigt = true
		AIparts:RemovePeriodic("Tanklager Sprengsatz")
	end
	if IsObjectiveCompleted("Treibstofflager", "Player") and NumPlayerUnitsInZone("Enemy", "Tanklager") < 1 then
		mission.OutScreenMessage(100016, 15, "0xFFE0E0E0")
		msd_vars.Lager_erledigt = true
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  SendPlane("Player", "Treibstofflager", "transport", "SE", 15, 2, "Player") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Player", "Treibstofflager", "transport", "SE", 15, 4, "Player") end)
		AIparts:RemovePeriodic("Tanklager Sprengsatz")
	end
end

function func_Tanklager_explodiert()
	do
		local object = GetObject(2805)
		if not object then msd_vars.Lager_Explosion = true end
	end
	if msd_vars.Lager_Explosion then
		AIparts:RemovePeriodic("Tanklager explodiert")
	end
end

function func_Auswertung_Lagerexplosion()
	if msd_vars.Lager_Explosion and not IsObjectiveFailed("Treibstofflager", "Player") then
		mission.OutScreenMessage(100015, 15, "0xFFE0E0E0")
		FailObjective("Treibstofflager")
		msd_vars.Lager_erledigt = true
		AIparts:RemovePeriodic("Auswertung Lagerexplosion")
	end
end

function func_Flieger_Bahnhof()
	if msd_vars.Flieger_Bahnhof then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  SendPlane("Enemy", "Bahn1", "strike_fighter", "N", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  SendPlane("Enemy", "Bahn2", "strike_fighter", "NE", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  SendPlane("Enemy", "Bahn3", "strike_fighter", "NW", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 40*10, function()  SendPlane("Enemy", "Bahn4", "strike_fighter", "N", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 50*10, function()  SendPlane("Enemy", "Bahn5", "strike_fighter", "NE", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Bahn6", "strike_fighter", "NW", 15, -1, "") end)
		MoveGroupToZone("Angriff_Bahnhof", "Bahnhof1a", true, false)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.OutScreenMessage(100017, 15, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 70*10, function()  SendPlane("Enemy", "Bahn1", "bomber", "NW", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 80*10, function()  SendPlane("Enemy", "Bahn2", "bomber", "N", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  SendPlane("Enemy", "Bahn3", "bomber", "NW", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  SendPlane("Enemy", "Bahn4", "bomber", "N", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 110*10, function()  SendPlane("Enemy", "Bahn5", "bomber", "NW", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  SendPlane("Enemy", "Bahn6", "bomber", "N", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  mission.OutScreenMessage(100018, 15, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 240*10, function()  msd_vars.Auftrag_Industrie = true end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 250*10, function()  MoveGroupToZone("Angriff_Bahnhof", "Bahnhof1", false, false) end)
		AIparts:RemovePeriodic("Flieger_Bahnhof")
	end
end

function func_Patrol_Bahnhof()
	if NumGroupUnitsNearPoint("Patrol_Bahnhof", 0, "Patrol2a", 20) > 1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  MoveGroupTo("Patrol_Bahnhof", {}, {"Patrol2d", }, {}, true, true, "", false, 20) end)
	end
	if NumGroupUnitsNearPoint("Patrol_Bahnhof", 0, "Patrol2b", 20) > 1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  MoveGroupTo("Patrol_Bahnhof", {}, {"Patrol2a", }, {}, true, true, "", false, 20) end)
	end
	if NumGroupUnitsNearPoint("Patrol_Bahnhof", 0, "Patrol2c", 20) > 1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  MoveGroupTo("Patrol_Bahnhof", {}, {"Patrol2b", }, {}, true, true, "", false, 20) end)
	end
	if NumGroupUnitsNearPoint("Patrol_Bahnhof", 0, "Patrol2d", 20) > 1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  MoveGroupTo("Patrol_Bahnhof", {}, {"Patrol2c", }, {}, true, true, "", false, 20) end)
	end
	if IsObjectiveCompleted("Bahnhof_Süd", "Player") then
		TransferUnits("Patrol_Bahnhof", 0, "Angriff_Bahnhof", 0)
		AIparts:RemovePeriodic("Patrol_Bahnhof")
	end
end

function func_Auftrag_Industrie()
	if msd_vars.Auftrag_Industrie then
		mission.OutScreenMessage(100019, 30, "0xFFE0E0E0")
		AcivateObjective("Industriegebiet")
		AIparts:RemovePeriodic("Auftrag Industrie")
	end
end

function func_Vor__llager()
	if NumPlayerUnitsInZone("Player", "Vor_Tanklager") > 0 and IsObjectiveCompleted("Bahnhof_Süd", "Player") then
		RunSpawn("Enemy", {"Patrol", }, "Vor_Tanklager", "Wachposten", "", true, true, {}, false, 100)
		AIparts:RemovePeriodic("Vor_Öllager")
	end
end

function func_Vor_VBRL()
	if NumPlayerUnitsInZone("Player", "VBRL1") > 0 then
		MoveGroupToZone("VBRL1", "VBRL1", true, false)
	end
	if NumPlayerUnitsInZone("Player", "VBRL2") > 0 then
		MoveGroupToZone("VBRL2", "VBRL2", true, false)
	end
	if NumPlayerUnitsInZone("Player", "VBRL3") > 0 then
		MoveGroupToZone("VBRL3", "VBRL3", true, false)
	end
	if msd_vars.Lager_erledigt then
		TransferUnits("VBRL1", 0, "Wachposten", 0)
		TransferUnits("VBRL2", 0, "Wachposten", 0)
		TransferUnits("VBRL3", 0, "Wachposten", 0)
		AIparts:RemovePeriodic("Vor_VBRL")
	end
end

function func_Spieler_in_Industrie()
	if NumPlayerUnitsInZones("Player", {"Industrie2", "Industrie1", "Industrie3", }) > 0 then
		RunSpawn("Enemy", {"Industrie", }, "Industrie", "Industrie", "Industrie", true, true, {}, false, 40)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  UnloadTransports("Industrie") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  RunSpawn("Enemy", {"Patrol_Stadt_Süd", }, "Stadt_Nord2", "Stadt_Sued_Patrol", "Stadt_Sued_Patrol", true, true, {}, false, 100) end)
		AIparts:RemovePeriodic("Spieler_in_Industrie")
	end
end

function func_Industrie_erobert()
	if NumPlayerUnitsInZones("Enemy", {"Industrie1", "Industrie2", "Industrie3", }) < 5 and IsObjectiveActive("Industriegebiet") and NumPlayerUnitsInZone("Enemy", "Waffenfabrik") < 2 then
		ProceedObjective("Industriegebiet", "Player")
		RunSpawn("Enemy", {"Patrol", }, "Stadt_Nord1", "Industrie", "Industrie", true, true, {}, false, 50)
		RunSpawn("Player", {"Panzer_4", }, "Süd", "Player", "Player", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupToZone("Industrie", "Industrie1", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 40*10, function()  MoveGroupToZone("Industrie", "Industrie2", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 70*10, function()  MoveGroupToZone("Industrie", "Industrie3", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Industrie", "Industrie1", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  TransferUnits("Angriff_Bahnhof", 0, "Industrie", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.OutScreenMessage(100022, 30, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  msd_vars.Produktion = true end)
		RunSpawn("Player", {"Leichte_Arti", }, "Bahnhof2", "Player", "Player", true, true, {}, false, 10)
		SendPlane("Player", "Abwurf_Fabrik", "transport", "S", 15, 4, "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  SendPlane("Player", "Waffenfabrik", "transport", "S", 15, 2, "Player") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  AcivateObjective("Production1") end)
		AIparts:RemovePeriodic("Industrie_erobert")
	end
end

function func_Angriff_Bahn_Intervall()
	if msd_vars.Angriff_Bahnhof then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  MoveGroupToZone("Angriff_Bahnhof", "Bahnhof1", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  MoveGroupToZone("Angriff_Bahnhof", "Bahnhof1", true, false) end)
	end
end

function func_Angriff_Dorf_Intervall()
	if msd_vars.Angriff_Dorf then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  MoveGroupToZone("Angriff_Dorf", "Start_Dorf", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Angriff_Dorf", "Start_Dorf1", false, false) end)
	end
	if IsObjectiveCompleted("Bahnhof_Süd", "Player") then
		AIparts:RemovePeriodic("Angriff Dorf Intervall")
	end
end

function func_Ausl_ser_Flieger()
	if IsObjectiveActive("Treibstofflager") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  msd_vars.Flieger_Bahnhof = true end)
		AIparts:RemovePeriodic("Auslöser_Flieger")
	end
end

function func_Industrie_Intervall()
	if IsObjectiveActive("Industriegebiet") and NumPlayerUnitsInZones("Player", {"Industrie1", "Industrie2", "Industrie3", }) > 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Industrie", "Industrie1", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  MoveGroupToZone("Industrie", "Industrie2", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 180*10, function()  MoveGroupToZone("Industrie", "Industrie3", true, false) end)
	end
	if IsObjectiveCompleted("Industriegebiet", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Industrie", "Industrie1", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  MoveGroupToZone("Industrie", "Industrie2", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 180*10, function()  MoveGroupToZone("Industrie", "Industrie3", true, false) end)
		AIparts:RemovePeriodic("Industrie_Intervall")
	end
end

function func_Spieler_Dorf1()
	if NumPlayerUnitsInZones("Player", {"VBR1", "VBR2", "VBR3", "VBR4", "HBR", }) > 0 then
		RunSpawn("Player", {"Start_Player1", }, "Start_Player", "Player", "Player", true, true, {}, false, 20)
		AIparts:RemovePeriodic("Spieler_Dorf1")
	end
end

function func_Waffenfabrik_defekt()
	do
		local object = GetObject(1716)
		if not object then msd_vars.Waffenfabrik_defekt = true end
	end
	if msd_vars.Waffenfabrik_defekt then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  mission.OutScreenMessage(100024, 20, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Waffenfabrik defekt")
	end
end

function func_Produktion()
	if msd_vars.Produktion and NumPlayerUnitsInZone("Player", "Waffenfabrik") > 0 and msd_vars.Produktionscounter < 16 and not msd_vars.Waffenfabrik_defekt then
		RunSpawn("Player", {"Fabrik_Panzer4", }, "Industrie1", "Player", "Player", true, true, {}, false, 10)
		msd_vars.Produktionscounter = msd_vars.Produktionscounter + 1
		RunSpawn("Enemy", {"Fabrikangriff", }, "Stadt_Nord1", "Industrie", "Industrie", true, true, {}, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Industrie", "Waffenfabrik", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  MoveGroupToZone("Industrie", "Waffenfabrik", false, false) end)
		mission.OutScreenMessage(100051, 10, "0xFFE0E0E0")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  mission.OutScreenMessage(100067, 10, "0xFFE0E0E0") end)
	end
	if msd_vars.Produktion and NumPlayerUnitsInZone("Player", "Waffenfabrik") > 0 and msd_vars.Produktionscounter == 5 and not msd_vars.Waffenfabrik_defekt then
		RunSpawn("Player", {"Fabrik_Panter", }, "Industrie1", "Player", "Player", true, true, {}, false, 10)
		RunSpawn("Enemy", {"Patrol", }, "Stadt_Nord1", "Industrie", "Industrie", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  SendPlane("Enemy", "Waffenfabrik", "strike_fighter", "N", 5, -1, "") end)
		SendPlane("Enemy", "Falli_SW_1", "transport", "N", 5, 4, "Industrie")
		SendPlane("Enemy", "Falli_Ost4", "transport", "N", 5, 4, "Industrie")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  mission.OutScreenMessage(100049, 15, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  RunSpawn("Enemy", {"Fabrikangriff", }, "Industrie_Angriff", "Industrie", "Industrie", true, true, {}, false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Player", {"Dorf1", }, "Bahnhof2", "Player", "Player", true, true, {}, false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  GroupAttackPlace("Calliscope1", "Abwurf_Fabrik", 50) end)
	end
	if msd_vars.Produktion and NumPlayerUnitsInZone("Player", "Waffenfabrik") > 0 and msd_vars.Produktionscounter == 10 and not msd_vars.Waffenfabrik_defekt then
		RunSpawn("Player", {"Fabrik_Tiger", }, "Industrie1", "Player", "Player", true, true, {}, false, 10)
		RunSpawn("Enemy", {"Patrol", }, "Stadt_Nord1", "Industrie", "Industrie", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  SendPlane("Enemy", "Waffenfabrik", "strike_fighter", "N", 5, -1, "") end)
		SendPlane("Enemy", "Falli_SW_1", "transport", "W", 5, 4, "Industrie")
		SendPlane("Enemy", "Falli_Ost4", "transport", "N", 5, 4, "Industrie")
		SendPlane("Enemy", "Falli_Ost4", "transport", "W", 5, 4, "Industrie")
		SendPlane("Enemy", "Falli_SW_1", "transport", "N", 5, 4, "Industrie")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  mission.OutScreenMessage(100049, 15, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  RunSpawn("Enemy", {"Fabrikangriff", }, "Industrie_Angriff", "Industrie", "Industrie", true, true, {}, false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 999*10, function()  RunSpawn("Enemy", {"Fabrikangriff", }, "Industrie_Angriff", "Industrie", "Industrie", true, true, {}, false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  MoveGroupToZone("Industrie", "Waffenfabrik", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Player", {"Dorf1", }, "Bahnhof2", "Player", "Player", true, true, {}, false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  GroupAttackPlace("Calliscope1", "Waffenfabrik", 50) end)
	end
	if msd_vars.Produktion and NumPlayerUnitsInZone("Player", "Waffenfabrik") > 0 and msd_vars.Produktionscounter == 15 and not msd_vars.Waffenfabrik_defekt then
		RunSpawn("Player", {"Fabrik_Jagdpanzer", }, "Industrie1", "Player", "Player", true, true, {}, false, 10)
		RunSpawn("Enemy", {"Patrol", }, "Stadt_Nord1", "Industrie", "Industrie", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  msd_vars.Produktion_max = true end)
		SendPlane("Enemy", "Waffenfabrik", "bomber", "W", 5, -1, "")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  SendPlane("Enemy", "Waffenfabrik", "strike_fighter", "N", 5, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  mission.OutScreenMessage(100049, 15, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Player", {"Dorf1", }, "Bahnhof2", "Player", "Player", true, true, {}, false, 50) end)
		SetObjectiveComplete("Production1", "Player")
		msd_vars.Produktion = false
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  GroupAttackPlace("Calliscope1", "Waffenfabrik", 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  GroupAttackPlace("Calliscope1", "Bahn3", 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  mission.OutScreenMessage(100070, 10, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Produktion")
	end
	if msd_vars.Produktion and NumPlayerUnitsInZone("Player", "Waffenfabrik") > 0 and msd_vars.Produktionscounter > 11 and not msd_vars.Waffenfabrik_defekt then
		RunSpawn("Player", {"Fabrik_Flammpanzer", }, "Industrie1", "Player", "Player", true, true, {}, false, 10)
	end
end

function func_Bomben_auf_Waffenfabrik()
	if msd_vars.Produktion and NumPlayerUnitsInZone("Enemy", "Waffenfabrik") > 2 then
		SendPlane("Enemy", "Waffenfabrik", "strike_fighter", "SW", 1, -1, "")
		SendPlane("Enemy", "Waffenfabrik", "strike_fighter", "W", 1, -1, "")
		SendPlane("Enemy", "Waffenfabrik", "strike_fighter", "NW", 1, -1, "")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  SendPlane("Enemy", "Waffenfabrik", "bomber", "W", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  SendPlane("Enemy", "Waffenfabrik", "bomber", "SW", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  SendPlane("Enemy", "Waffenfabrik", "bomber", "NW", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Waffenfabrik", "bomber", "W", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Waffenfabrik", "bomber", "SW", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Waffenfabrik", "bomber", "S", 1, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  Bombardment("Waffenfabrik", 5, 30, 6, 30) end)
		msd_vars.Produktion = false
		FailObjective("Industriegebiet")
		FailObjective("Production1")
		AIparts:RemovePeriodic("Bomben auf Waffenfabrik")
	end
end

function func_Gegner_bei_Waffenfabrik()
	if msd_vars.Produktion and NumPlayerUnitsInZone("Enemy", "Waffenfabrik") > 0 then
		mission.OutScreenMessage(100025, 20, "0xFFE0E0E0")
		AIparts:UpdatePeriodic("Gegner bei Waffenfabrik", 600)
	end
	if msd_vars.Produktion_max or msd_vars.Produktion and NumPlayerUnitsInZone("Enemy", "Waffenfabrik") > 2 then
		AIparts:RemovePeriodic("Gegner bei Waffenfabrik")
	end
end

function func_Auftrag_S_d()
	if IsObjectiveCompleted("Industriegebiet", "Player") and msd_vars.Lager_erledigt then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  SendPlane("Player", "g1", "scout", "S", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  SendPlane("Player", "g2", "scout", "SE", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 50*10, function()  SendPlane("Player", "g3", "scout", "SW", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 70*10, function()  SendPlane("Player", "g4", "scout", "S", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  mission.OutScreenMessage(100026, 30, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  AcivateObjective("Britischer_General") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 400*10, function()  Spawn({desc = "Units/Aircrafts/German/fw_189.dsc", position = {200, 150,-1020}, player = "Player", commands = {{attack_place = "Absturz"}, {dislocation = {400, 5,20}}, {disappear = true}}}) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 450*10, function()  msd_vars.Absturz = true end)
		AIparts:RemovePeriodic("Auftrag_Süd")
	end
end

function func_Ausloeser_Pioniere_Bahnhof()
	if msd_vars.Lager_erledigt or IsObjectiveCompleted("Industriegebiet", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  msd_vars.Pioniere_Bahnhof = true end)
		AIparts:RemovePeriodic("Ausloeser_Pioniere_Bahnhof")
	end
end

function func_Fallis_Bruecke()
	if msd_vars.Pioniere_Bahnhof and msd_vars.br4 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  SendPlane("Enemy", "Br4", "transport", "N", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  SendPlane("Enemy", "Br4", "transport", "NW", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Br41", "transport", "NE", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  AIparts:RemovePeriodic("Fallis_Bruecke") end)
	end
	if msd_vars.Pioniere_Bahnhof and msd_vars.br3 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  SendPlane("Enemy", "Br3", "transport", "N", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  SendPlane("Enemy", "Br3", "transport", "NW", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Br31", "transport", "NE", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  AIparts:RemovePeriodic("Fallis_Bruecke") end)
	end
	if msd_vars.Pioniere_Bahnhof and msd_vars.br2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 15*10, function()  SendPlane("Enemy", "Br2", "transport", "N", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 15*10, function()  SendPlane("Enemy", "Br2", "transport", "NW", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Br21", "transport", "NE", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  AIparts:RemovePeriodic("Fallis_Bruecke") end)
	end
	if msd_vars.Pioniere_Bahnhof and msd_vars.br1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  SendPlane("Enemy", "Br1", "transport", "N", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  SendPlane("Enemy", "Br1", "transport", "NW", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "Br11", "transport", "NE", 15, 4, "Wachposten") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  AIparts:RemovePeriodic("Fallis_Bruecke") end)
	end
end

function func_Pioniere_Bahnhof()
	if msd_vars.Pioniere_Bahnhof then
		mission.OutScreenMessage(100029, 30, "0xFFE0E0E0")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  RunSpawn("Player", {"Geleitschutz", }, "Start_Player", "Player", "Player", true, true, {}, false, 10) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  RunSpawn("Player", {"Pioniere_Bahnhof", }, "Dorf_Süd", "Player", "Pioniere_Bahnhof", true, true, {}, false, 5) end)
		AcivateObjective("Pioniere")
		AIparts:RemovePeriodic("Pioniere_Bahnhof")
	end
end

function func_Pioniere_am_Bahnhof()
	if NumGroupUnitsInZone("Pioniere_Bahnhof", "Bahnhof1") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  RunSpawn("Player", {"Zug_Panzer_Panther", }, "Zug", "Player", "Player", true, true, {{unload=true, }, {dislocation="Exit_Zug", }, {disappear=true, }, }, false, 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100030, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  mission.OutScreenMessage(100031, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  SetObjectiveComplete("Pioniere", "Player") end)
		AIparts:RemovePeriodic("Pioniere_am_Bahnhof")
	end
end

function func_Absturz1()
	if msd_vars.Absturz then
		mission.OutScreenMessage(100035, 25, "0xFFE0E0E0")
		AcivateObjective("Offizier")
		AIparts:RemovePeriodic("Absturz1")
	end
end

function func_Absturz2()
	if IsObjectiveActive("Offizier") and NumPlayerUnitsInZone("Player", "Absturz") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100034, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  DisableObjective("Offizier") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AcivateObjective("Offizier1") end)
		AIparts:RemovePeriodic("Absturz2")
	end
end

function func_Absturz3()
	if IsObjectiveActive("Offizier1") and IsPlayerUnitsPresent("Player", "Mühle", 20) then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  mission.OutScreenMessage(100038, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 15*10, function()  RunSpawn("Player", {"Pilot", }, "Mühle", "Offizier", "", true, true, {}, false, 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  DisableObjective("Offizier1") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  AcivateObjective("Offizier2") end)
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Flugabwehr", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Flugabwehr", "Absturz", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupToZone("Flugabwehr", "Bahnhof1", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Flugabwehr", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Absturz3")
	end
end

function func_Pilot_am_Bahnhof()
	if NumGroupUnitsInZone("Offizier", "Bahnhof1") > 0 then
		mission.OutScreenMessage(100041, 20, "0xFFE0E0E0")
		SetPlaneDesc("germany", "fighter", "German/fw_190_bomber.dsc")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AddBonus(1, 0, 3, -1, -1) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AddBonus(1, 8, 5, -1, -1) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AddBonus(1, 1, 5, -1, -1) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  RunSpawn("Player", {"Leichte_Arti", }, "Bahnhof2", "Player", "Player", true, true, {}, false, 10) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  RunSpawn("Player", {"Start_Player", }, "Bahnhof1", "Player", "Player", true, true, {}, false, 10) end)
		SetObjectiveComplete("Offizier2", "Player")
		AIparts:RemovePeriodic("Pilot am Bahnhof")
	end
end

function func_Spieler_vor_Stadt()
	if NumPlayerUnitsInZone("Player", "Vor_Stadt_Sued") > 0 then
		RunSpawn("Enemy", {"Verteidigung_Stadt_Süd", }, "Stadt_Nord1", "Stadt_Sued", "", true, true, {}, false, 100)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Stadt_Sued", "Stadt_Sued", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  MoveGroupToZone("Stadt_Sued", "Stadt_Sued", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Stadt_Sued", "Stadt_Sued", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 400*10, function()  MoveGroupToZone("Stadt_Sued", "Stadt_Sued", true, false) end)
		msd_vars.Patrol_Stadt = true
		AIparts:RemovePeriodic("Spieler vor Stadt")
	end
end

function func_Patrol_Stadt()
	if msd_vars.Patrol_Stadt then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("Stadt_Sued_Patrol", {}, {"g4", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  MoveGroupTo("Stadt_Sued_Patrol", {}, {"g3", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupTo("Stadt_Sued_Patrol", {}, {"g2", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 450*10, function()  MoveGroupTo("Stadt_Sued_Patrol", {}, {"g1", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("Stadt_Sued_Patrol1", {}, {"g2", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  MoveGroupTo("Stadt_Sued_Patrol1", {}, {"g3", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupTo("Stadt_Sued_Patrol1", {}, {"g4", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 450*10, function()  MoveGroupTo("Stadt_Sued_Patrol1", {}, {"g1", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("Patrol_Stadt_Nord_aktiv", {}, {"SN1", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  MoveGroupTo("Patrol_Stadt_Nord_aktiv", {}, {"SN2", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupTo("Patrol_Stadt_Nord_aktiv", {}, {"SN3", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 450*10, function()  MoveGroupTo("Patrol_Stadt_Nord_aktiv", {}, {"SN4", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("Hafen_Patrol", {}, {"H1", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  MoveGroupTo("Hafen_Patrol", {}, {"H2", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupTo("Hafen_Patrol", {}, {"H3", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 450*10, function()  MoveGroupTo("Hafen_Patrol", {}, {"H4", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("Strasse_Patrol", {}, {"PS1", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  MoveGroupTo("Strasse_Patrol", {}, {"PS2", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupTo("Strasse_Patrol", {}, {"PS3", }, {}, false, false, "", false, 50) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 450*10, function()  MoveGroupTo("Strasse_Patrol", {}, {"PS4", }, {}, false, false, "", false, 50) end)
	end
end

function func_General_S_d_erledigt()
	if NumGroupUnits("Brit_General", 0, false, false, false) < 1 and IsObjectiveActive("Britischer_General") then
		SetObjectiveComplete("Britischer_General", "Player")
		mission.OutScreenMessage(100039, 20, "0xFFE0E0E0")
		msd_vars.Stadt_Nord = true
		RunSpawn("Player", {"Panzer_4", }, "Süd_West", "Player", "Player", true, true, {}, false, 30)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  SendPlane("Player", "BritGeneral", "transport", "SE", 15, 2, "Player") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  SendPlane("Player", "BritGeneral", "transport", "S", 15, 4, "Player") end)
		AIparts:RemovePeriodic("General_Süd erledigt")
	end
end

function func_Sound_Wiederholung1()
	if not IsObjectiveCompleted("Bahnhof_Süd", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  mission.OutScreenMessage(100040, 20, "0xFFE0E0E0") end)
	end
	if IsObjectiveCompleted("Bahnhof_Süd", "Player") then
		AIparts:RemovePeriodic("Sound Wiederholung1")
	end
end

function func_Spieler_in_Stadt()
	if NumPlayerUnitsInZone("Player", "Stadt_Sued") > 0 then
		msd_vars.Frachter = true
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  UnloadTransports("Stadt_Sued") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  msd_vars.Stadt_Nord = true end)
		AIparts:RemovePeriodic("Spieler in Stadt")
	end
end

function func_Auftrag_Frachter()
	if msd_vars.Frachter then
		Spawn({desc = "Units/Aircrafts/German/fw_189.dsc", position = {200, 80,-1020}, player = "Player", commands = {{attack_place = "Frachter"},{attack_place = "Frachter"}, {attack_place = "Frachter"}, {dislocation = {200, 80,-1020}}, {disappear = true}}})
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100046, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  AcivateObjective("Frachter") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  RunSpawn("Player", {"Start_Player1", }, "Start_Player", "Player", "Player", true, true, {}, false, 20) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  RunSpawn("Player", {"Start_Player", }, "Dorf_Süd", "Player", "Player", true, true, {}, false, 20) end)
		MoveGroupToZone("Angriff_Dorf2", "Start_Dorf1", false, false)
		AIparts:RemovePeriodic("Auftrag Frachter")
	end
end

function func_Auftrag_Stadt_Nord()
	if msd_vars.Stadt_Nord then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100043, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  AcivateObjective("Stadt_Nord") end)
		AIparts:RemovePeriodic("Auftrag Stadt Nord")
	end
end

function func_Br_cken_Nord()
	if IsPlayerUnitsPresent("Player", "NBR1", 20) and NumPlayerUnitsInZone("Enemy", "NBR1") > 0 then
		Bombardment("NBR1", 15, 8, 15, 30)
		AIparts:UpdatePeriodic("Brücken_Nord", 300)
	end
	if IsPlayerUnitsPresent("Player", "NBR2", 20) and NumPlayerUnitsInZone("Enemy", "NBR2") > 0 then
		Bombardment("NBR2", 15, 8, 15, 30)
		AIparts:UpdatePeriodic("Brücken_Nord", 900)
	end
	if IsPlayerUnitsPresent("Player", "NBR3", 20) and NumPlayerUnitsInZone("Enemy", "NBR3") > 0 then
		Bombardment("NBR3", 15, 8, 15, 30)
		AIparts:UpdatePeriodic("Brücken_Nord", 900)
	end
	if NumPlayerUnitsInZones("Enemy", {"NBR1", "NBR2", "NBR3", }) < 1 then
		AIparts:RemovePeriodic("Brücken_Nord")
	end
end

function func_Sound_Wiederholung2()
	if IsObjectiveCompleted("Bahnhof_Süd", "Player") and not msd_vars.Produktion then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  mission.OutScreenMessage(100042, 20, "0xFFE0E0E0") end)
	end
end

function func_Spieler_im_Stadtzentrum()
	if IsObjectiveActive("Stadt_Nord") and NumPlayerUnitsInZone("Player", "Stadt_Sued_Center") > 1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  TransferUnits("Stadt_Sued", 0, "Stadt_Sued_Patrol1", 0) end)
		RunSpawn("Player", {"Leichte_Arti", }, "Bahnhof1", "Player", "Player", true, true, {}, false, 20)
		RunSpawn("Player", {"Leichte_Arti", }, "Bahnhof2", "Player", "Player", true, true, {}, false, 20)
		UnloadTransports("Stadt_Sued")
		AIparts:RemovePeriodic("Spieler im Stadtzentrum")
	end
end

function func_Frachter_erledigt()
	if IsObjectiveActive("Frachter") and NumPlayerUnitsInZone("Player", "Frachter") > 0 and NumPlayerUnitsInZone("Enemy", "Frachter") < 1 then
		SetObjectiveComplete("Frachter", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  RunSpawn("Player", {"Leichte_Arti", }, "Start_Player", "Player", "Player", true, true, {}, false, 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 80*10, function()  RunSpawn("Player", {"Start_Player1", }, "Start_Player", "Player", "Player", true, true, {}, false, 30) end)
		mission.OutScreenMessage(100050, 20, "0xFFE0E0E0")
		AIparts:RemovePeriodic("Frachter erledigt")
	end
end

function func_Stadt_Nord_Verteidigung1()
	if IsObjectiveActive("Stadt_Nord") then
		RunSpawn("Enemy", {"Angriff_Dorf", }, "Stadt_Nord3", "Stadt_Nord", "Stadt_Nord", true, true, {}, false, 50)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 180*10, function()  MoveGroupToZone("Stadt_Nord", "Stadt_Nord", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 260*10, function()  UnloadTransports("Stadt_Nord") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  RunSpawn("Enemy", {"Patrol", }, "Stadt_Nord1", "Patrol_Stadt_Nord", "", true, true, {}, false, 30) end)
		AIparts:RemovePeriodic("Stadt_Nord_Verteidigung1")
	end
end

function func_Spieler_in_Stadt_Nord()
	if NumPlayerUnitsInZone("Player", "Stadt_Nord") > 0 then
		RunSpawn("Enemy", {"Patrol", }, "Stadt_Nord1", "Stadt_Nord_Center", "", true, true, {}, false, 100)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  MoveGroupToZone("Stadt_Nord_Center", "Stadt_Nord_Center", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Stadt_Nord_Center", "Stadt_Nord_Center", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  MoveGroupToZone("Stadt_Nord_Center", "Stadt_Nord_Center", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupToZone("Stadt_Nord_Center", "Stadt_Nord_Center", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100058, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  RunSpawn("Player", {"Zug_Panzer3", }, "Zug", "Player", "Player", true, true, {{unload=true, }, {dislocation="Exit_Zug", }, {disappear=true, }, }, false, 0) end)
		RunSpawn("Enemy", {"Abwehr_Ost", }, "Ost", "Strasse_Ost", "Strasse_Ost", true, true, {}, false, 100)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupToZone("Strasse_Ost", "Stadt_Nord", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AddBonus(1, 1, 5, -1, -1) end)
		AIparts:RemovePeriodic("Spieler in Stadt Nord")
	end
end

function func_Spieler_in_Stadt_Nord_Center()
	if NumPlayerUnitsInZone("Player", "Stadt_Nord_Center") > 0 and IsObjectiveActive("Stadt_Nord") then
		TransferUnits("Patrol_Stadt_Nord", 0, "Patrol_Stadt_Nord_aktiv", 0)
		MoveGroupToZone("Stadt_Nord", "Stadt_Nord_Center", true, false)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  UnloadTransports("Stadt_Nord") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  MoveGroupToZone("Stadt_Nord", "Stadt_Nord", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Wachposten", "Stadt_Nord_Center", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AddBonus(1, 2, 2, -1, -1) end)
		AIparts:RemovePeriodic("Spieler in Stadt Nord Center")
	end
end

function func_Auftrag_Bahnhof_Nord()
	if IsObjectiveActive("Stadt_Nord") and NumPlayerUnitsInZone("Player", "Stadt_Nord") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  AcivateObjective("Bahnhof Nord") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  mission.OutScreenMessage(100053, 20, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Auftrag Bahnhof Nord")
	end
end

function func_Zug_Feind()
	if NumPlayerUnitsInZone("Player", "VorBahnhofNord") > 0  then
		RunSpawn("Enemy", {"Zug_Feind", }, "Bahnhof Nord", "Zug_Feind", "Zug_Feind", true, true, {{unload=true, }, }, false, 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Zug_Feind", "Hafen", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  RunSpawn("Enemy", {"Stadt_West", }, "NordWest", "Zug_Feind1", "Zug_Feind1", true, true, {}, false, 10) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 400*10, function()  MoveGroupToZone("Zug_Feind", "Hafen", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 190*10, function()  MoveGroupToZone("Zug_Feind1", "Stadt_Nord_Center", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 400*10, function()  MoveGroupToZone("Zug_Feind1", "Stadt_Sued_Center", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 600*10, function()  MoveGroupToZone("Zug_Feind1", "Stadt_Sued", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 800*10, function()  MoveGroupToZone("Zug_Feind1", "Stadt_Nord", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 999*10, function()  MoveGroupToZone("Zug_Feind1", "Hafen", true, false) end)
		AIparts:RemovePeriodic("Zug Feind")
	end
end

function func_Bahnhof_Nord_erobert()
	if IsObjectiveActive("Bahnhof Nord") and NumPlayerUnitsInZone("Player", "BahnhofNord") > 0 and NumPlayerUnitsInZone("Enemy", "BahnhofNord") < 2 then
		ProceedObjective("Bahnhof Nord", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100056, 20, "0xFFE0E0E0") end)
		SendPlane("Player", "Abwurf_Bahn_Nord", "transport", "SE", 15, 4, "Player")
		SendPlane("Player", "Abwurf_Bahn_Nord", "transport", "S", 15, 2, "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AddBonus(1, 8, 5, -1, -1) end)
		AIparts:RemovePeriodic("Bahnhof Nord erobert")
	end
end

function func_Stadt_Nord_erobert()
	if IsObjectiveActive("Stadt_Nord") and NumPlayerUnitsInZones("Enemy", {"Stadt_Nord", "Stadt_Nord_Center", }) < 2 then
		ProceedObjective("Stadt_Nord", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100057, 20, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Stadt Nord erobert")
	end
end

function func_Frachter_Exit()
	if IsObjectiveActive("Frachter") and NumPlayerUnitsInZone("Player", "Frachter") > 0 and NumPlayerUnitsInZone("Enemy", "Frachter") < 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupTo("Frachter", {}, {"Frachter_Exit", }, {}, true, true, "", true, 30) end)
		AIparts:RemovePeriodic("Frachter_Exit")
	end
end

function func_Auftrag_Hafen()
	if IsObjectiveCompleted("Stadt_Nord", "Player") and IsObjectiveCompleted("Bahnhof Nord", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100061, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  AcivateObjective("Hafen") end)
		RunSpawn("Player", {"Panzer_4", }, "Süd_West", "Player", "Player", true, true, {}, false, 30)
		RunSpawn("Player", {"Start_Player", }, "Süd_West", "Player", "Player", true, true, {}, false, 30)
		RunSpawn("Player", {"Leichte_Arti", }, "Süd", "Player", "Player", true, true, {}, false, 30)
		RunSpawn("Player", {"Start_Player1", }, "Süd", "Player", "Player", true, true, {}, false, 30)
		AIparts:RemovePeriodic("Auftrag Hafen")
	end
end

function func_Spieler_im_Hafen()
	if NumPlayerUnitsInZone("Player", "Hafen") > 0 then
		RunSpawn("Enemy", {"Patrol", }, "Ost", "Hafen_Patrol", "", true, true, {}, false, 100)
		SendPlane("Enemy", "Abwurf_Hafen", "transport", "NW", 15, 4, "Enemy")
		AIparts:RemovePeriodic("Spieler im Hafen")
	end
end

function func_Hafen_erobert()
	if IsObjectiveActive("Hafen") and NumPlayerUnitsInZone("Enemy", "Hafen") < 2 and NumPlayerUnitsInZone("Player", "Hafen") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100062, 20, "0xFFE0E0E0") end)
		SendPlane("Player", "Abwurf_Hafen", "transport", "S", 15, 4, "Player")
		ProceedObjective("Hafen", "Player")
		MoveGroupToZone("Angriff_Dorf2", "Stadt_Nord", false, false)
		MoveGroupToZone("Industrie", "Stadt_Nord", false, false)
		MoveGroupToZone("Wachposten", "Stadt_Nord", false, false)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  AddBonus(1, 7, 2, -1, -1) end)
		AIparts:RemovePeriodic("Hafen erobert")
	end
end

function func_Auftrag_Strasse()
	if IsObjectiveCompleted("Hafen", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100063, 30, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  AcivateObjective("Strasse") end)
		AIparts:RemovePeriodic("Auftrag Strasse")
	end
end

function func_Spieler_vor_Strasse()
	if NumPlayerUnitsInZone("Player", "VorStrasse") > 0 then
		RunSpawn("Enemy", {"Patrol", }, "Ost", "Strasse_Patrol", "", true, true, {}, false, 100)
		AIparts:RemovePeriodic("Spieler vor Strasse")
	end
end

function func_Spieler_in_Strasse()
	if NumPlayerUnitsInZone("Player", "Strasse") > 0 then
		RunSpawn("Enemy", {"Patrol_Stadt_Süd", }, "Ost", "Strasse", "Wachposten", true, true, {}, false, 200)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  UnloadTransports("Strasse") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 110*10, function()  MoveGroupToZone("Strasse", "Strasse", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  RunSpawn("Enemy", {"Patrol", }, "Ost", "Vor_Strasse", "", true, true, {}, false, 200) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 110*10, function()  MoveGroupToZone("Vor_Strasse", "VorStrasse", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 180*10, function()  MoveGroupToZone("Vor_Strasse", "VorStrasse", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 400*10, function()  MoveGroupToZone("Vor_Strasse", "VorStrasse", false, false) end)
		AIparts:RemovePeriodic("Spieler in Strasse")
	end
end

function func_Strasse_erobert()
	if IsObjectiveActive("Strasse") and NumPlayerUnitsInZone("Enemy", "Strasse") < 2 and NumPlayerUnitsInZone("Player", "Strasse") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  mission.OutScreenMessage(100066, 30, "0xFFE0E0E0") end)
		ProceedObjective("Strasse", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  PlayerWin("Player") end)
		AIparts:RemovePeriodic("Strasse erobert")
	end
end

function func_Posten1()
	if NumPlayerUnitsInZone("Enemy", "Posten1") < 2 then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Posten1", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Posten1", "Posten1", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Posten1", "Posten1", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Posten1", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Posten1")
	end
end

function func_Posten2()
	if NumPlayerUnitsInZone("Enemy", "Posten2") < 2 then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Posten2", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Posten2", "Posten2", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Posten2", "Posten2", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Posten2", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Posten2")
	end
end

function func_Posten3()
	if NumPlayerUnitsInZone("Enemy", "Posten3") < 2 then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Posten3", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Posten3", "Posten3", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Posten3", "Posten3", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Posten3", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Posten3")
	end
end

function func_Posten4()
	if NumPlayerUnitsInZone("Enemy", "Posten4") < 2 then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Posten4", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Posten4", "Posten4", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Posten4", "Posten4", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Posten4", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Posten4")
	end
end

function func_Posten5()
	if NumPlayerUnitsInZone("Enemy", "Posten5") < 2 then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Posten5", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Posten5", "Posten5", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Posten5", "Posten5", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Posten5", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Posten5")
	end
end

function func_Posten6()
	if NumPlayerUnitsInZone("Enemy", "Posten6") < 2 then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Posten6", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Posten6", "Posten6", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Posten6", "Posten6", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Posten6", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Posten6")
	end
end

function func_Posten7()
	if NumPlayerUnitsInZone("Enemy", "Posten7") < 2 then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Posten7", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Posten7", "Posten7", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Posten7", "Posten7", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Posten7", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Posten7")
	end
end

function func_Posten8()
	if NumPlayerUnitsInZone("Enemy", "Posten8") < 2 then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Posten8", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Posten8", "Posten8", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Posten8", "Posten8", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Posten8", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Posten8")
	end
end

function func_Fallis_Dorf_Sued()
	if msd_vars.Lager_erledigt or IsObjectiveCompleted("Industriegebiet", "Player") and NumPlayerUnitsInZone("Enemy", "Dorf_Sued") < 2 then
		SendPlane("Enemy", "DS1", "transport", "N", 15, 4, "Wachposten")
		SendPlane("Enemy", "DS2", "transport", "N", 15, 1, "Wachposten")
		SendPlane("Enemy", "DS3", "transport", "N", 15, 6, "Wachposten")
		AIparts:RemovePeriodic("Fallis_Dorf_Sued")
	end
end

function func_BRQ1()
	if NumPlayerUnitsInZone("Player", "BRQ1") > 0 then
		SendPlane("Enemy", "BRQ1", "transport", "N", 15, 4, "Wachposten")
		AIparts:RemovePeriodic("BRQ1")
	end
end

function func_BRQ2()
	if NumPlayerUnitsInZone("Player", "BRQ2") > 0 then
		SendPlane("Enemy", "BRQ2", "transport", "N", 15, 4, "Wachposten")
		AIparts:RemovePeriodic("BRQ2")
	end
end

function func_BRQ3()
	if NumPlayerUnitsInZone("Player", "BRQ3") > 0 then
		SendPlane("Enemy", "BRQ3", "transport", "N", 15, 4, "Wachposten")
		AIparts:RemovePeriodic("BRQ3")
	end
end

function func_Angriff_Frachter()
	if IsObjectiveCompleted("Frachter", "Player") then
		RunSpawn("Enemy", {"Landungsboote1", }, "Landungsboote_Ost1", "", "Hafen1", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupToZone("Hafen1", "Frachter", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  MoveGroupToZone("Hafen1", "Frachter", false, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 500*10, function()  TransferUnits("Hafen1", 0, "Wachposten", 0) end)
		AIparts:RemovePeriodic("Angriff_Frachter")
	end
end

function func_Abwehr_Ost()
	if NumGroupUnitsInZone("Strasse_Ost", "Stadt_Nord") > 0 then
		UnloadTransports("Strasse_Ost")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  UnloadTransports("Strasse_Ost") end)
		AIparts:RemovePeriodic("Abwehr_Ost")
	end
end

function func_calli_Hafen()
	if IsObjectiveCompleted("Hafen", "Player") and NumPlayerUnitsInZone("Enemy", "Hafen") == 0 then
		GroupAttackPlace("calliscope2", "Abwurf_Hafen", 100)
		AIparts:RemovePeriodic("calli_Hafen")
	end
end

function func_calli_Vor_Strasse()
	if NumPlayerUnitsInZone("Player", "Vor_Strasse1") > 1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  GroupAttackPlace("calliscope2", "cal1", 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  GroupAttackPlace("calliscope2", "cal2", 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 50*10, function()  GroupAttackPlace("calliscope2", "cal3", 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 70*10, function()  GroupAttackPlace("calliscope2", "cal4", 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  GroupAttackPlace("calliscope2", "cal5", 30) end)
		AIparts:UpdatePeriodic("calli_Vor_Strasse", 999)
	end
end

function func_Zange_start()
	if not msd_vars.Produktion and IsObjectiveCompleted("Britischer_General", "Player") and msd_vars.Zange1 == 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Zange", "Zange1", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Zange3", "Tanklager", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  MoveGroupToZone("Zange3", "Bahnhof1", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 600*10, function()  MoveGroupToZone("Zange3", "Stadt_Sued", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 999*10, function()  MoveGroupToZone("Zange3", "Stadt_Nord_Center", true, false) end)
		GroupAttackPlace("Calliscope1", "BritGeneral", 50)
		msd_vars.Zange1 = msd_vars.Zange1 + 1
	end
	if NumGroupUnitsInZone("Zange", "Zange1") > 2 and msd_vars.Zange1 == 1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  MoveGroupToZone("Zange", "Stadt_Sued", true, false) end)
		msd_vars.Zange1 = msd_vars.Zange1 + 1
	end
	if NumGroupUnitsInZone("Zange", "Stadt_Sued") > 2 and msd_vars.Zange1 == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  MoveGroupToZone("Zange", "Stadt_Sued_Center", true, false) end)
		msd_vars.Zange1 = msd_vars.Zange1 + 1
	end
	if NumGroupUnitsInZone("Zange", "Stadt_Sued_Center") > 2 and msd_vars.Zange1 == 3 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  MoveGroupToZone("Zange", "Stadt_Nord", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  MoveGroupToZone("Zange3", "Stadt_Nord_Center", true, false) end)
		AIparts:RemovePeriodic("Zange start")
	end
end

function func_Landungsboote()
	if msd_vars.Produktion and NumPlayerUnitsInZone("Player", "Waffenfabrik") > 0 and msd_vars.Produktionscounter < 16 and not msd_vars.Waffenfabrik_defekt then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Enemy", {"Landungsboote2", }, "Landungsboote_Ost1", "", "Zange1", true, true, {{unload=true, }, {dislocation="Frachter_Exit", }, {disappear=true, }, }, false, 5) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Enemy", {"Landungsboote2", }, "Landungsboote_West", "", "Zange2", true, true, {{unload=true, }, {dislocation="Boot_Exit", }, {disappear=true, }, }, false, 5) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Zange2", "Zange2", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  MoveGroupToZone("Zange1", "Zange", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Zange2", "Zange2", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  MoveGroupToZone("Zange1", "Zange", true, false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 220*10, function()  TransferUnits("Zange2", 0, "Zange3", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 220*10, function()  TransferUnits("Zange1", 0, "Zange", 0) end)
	end
	if msd_vars.Produktion and NumPlayerUnitsInZone("Player", "Waffenfabrik") > 0 and msd_vars.Produktionscounter == 15 and not msd_vars.Waffenfabrik_defekt then
		AIparts:RemovePeriodic("Landungsboote")
	end
end

