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

function PostCreate()
	mission_lua.BasicMissionInitialize()
	AIparts:AddOneTime("Abwurf1", 1, func_Abwurf1)
	AIparts:AddPeriodic("Patrol Lager N", 100, func_Patrol_Lager_N, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol Lager S", 100, func_Patrol_Lager_S, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol Lager W", 100, func_Patrol_Lager_W, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol Lager O", 100, func_Patrol_Lager_O, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol Lager Horz", 100, func_Patrol_Lager_Horz, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol Lager Vert", 100, func_Patrol_Lager_Vert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Alarm Lager", 10, func_Alarm_Lager, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Alarm Lager N", 30, func_Alarm_Lager_N, 0 + RandomHalf(30))
	AIparts:AddPeriodic("Alarm Lager S", 30, func_Alarm_Lager_S, 0 + RandomHalf(30))
	AIparts:AddPeriodic("Alarm Lager O", 30, func_Alarm_Lager_O, 0 + RandomHalf(30))
	AIparts:AddPeriodic("Alarm Lager W", 30, func_Alarm_Lager_W, 0 + RandomHalf(30))
	AIparts:AddPeriodic("Alarm Lager Horz", 30, func_Alarm_Lager_Horz, 0 + RandomHalf(30))
	AIparts:AddPeriodic("Alarm Lager Vert", 30, func_Alarm_Lager_Vert, 0 + RandomHalf(30))
	AIparts:AddPeriodic("Patrol1", 200, func_Patrol1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol2", 200, func_Patrol2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol3", 200, func_Patrol3, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol4", 200, func_Patrol4, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol5", 200, func_Patrol5, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol6", 200, func_Patrol6, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol Street1", 100, func_Patrol_Street1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Patrol Street2", 100, func_Patrol_Street2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler auf Abwurf", 10, func_Spieler_auf_Abwurf, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Spieler im Dorf", 20, func_Spieler_im_Dorf, 0 + RandomHalf(20))
	AIparts:AddPeriodic("Spieler bei Mühle", 10, func_Spieler_bei_M_hle, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Informant kommt", 10, func_Informant_kommt, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Spieler bei Funkstation", 20, func_Spieler_bei_Funkstation, 0 + RandomHalf(20))
	AIparts:AddPeriodic("Spieler in Funkstation", 20, func_Spieler_in_Funkstation, 0 + RandomHalf(20))
	AIparts:AddPeriodic("Alarm Lager Funk", 50, func_Alarm_Lager_Funk, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Versorgungslager erobert", 50, func_Versorgungslager_erobert, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Brücke erobert", 10, func_Br_cke_erobert, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Phase1 abgeschlossen", 100, func_Phase1_abgeschlossen, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Transporter kommt", 10, func_Transporter_kommt, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Transporter Beladung", 50, func_Transporter_Beladung, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Transporter Exit", 100, func_Transporter_Exit, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Transport1", 50, func_Transport1, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Transport2", 100, func_Transport2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Transport3", 100, func_Transport3, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Transport5", 50, func_Transport5, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Transport6", 100, func_Transport6, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Transport7", 100, func_Transport7, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Transport8", 100, func_Transport8, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Transport9", 100, func_Transport9, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Transport10", 50, func_Transport10, 0 + RandomHalf(50))
	AIparts:AddPeriodic("Transport20", 100, func_Transport20, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Spieler verliert", 100, func_Spieler_verliert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auftrag Lager sprengen", 10, func_Auftrag_Lager_sprengen, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Alarm Lager Sprengung", 10, func_Alarm_Lager_Sprengung, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Abfrage Lager", 100, func_Abfrage_Lager, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auswertung Lagersprengung", 100, func_Auswertung_Lagersprengung, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auswertung Lagerexplosion", 100, func_Auswertung_Lagerexplosion, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Auswertung AlarmLagersprengung", 10, func_Auswertung_AlarmLagersprengung, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Lager verloren", 100, func_Lager_verloren, 0 + RandomHalf(100))
	AIparts:AddPeriodic("AriAttack1", 100, func_AriAttack1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Sprengwagen kommt", 100, func_Sprengwagen_kommt, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Sprengwagen auf Brücke", 10, func_Sprengwagen_auf_Br_cke, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Abfrage Brücke", 10, func_Abfrage_Br_cke, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Ari Brücke", 50, func_Ari_Br_cke, 0 + RandomHalf(50))
	AIparts:AddPeriodic("NiederlageBrücke", 100, func_NiederlageBr_cke, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Reinigungszyklus1", 100, func_Reinigungszyklus1, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Reinigungszyklus2", 100, func_Reinigungszyklus2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Kamera auf Transporter", 10, func_Kamera_auf_Transporter, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Start Phase2", 10, func_Start_Phase2, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Spieler am Fluss", 10, func_Spieler_am_Fluss, 0 + RandomHalf(10))
	AIparts:AddPeriodic("AriBrücke Phase2", 600, func_AriBr_cke_Phase2, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Dorf gesauebert", 100, func_Dorf_gesauebert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Wache Brücke", 100, func_Wache_Br_cke, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Brücke gesäubert", 100, func_Br_cke_ges_ubert, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Brücke repariert", 10, func_Br_cke_repariert, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Verstärkung vor Brücke", 10, func_Verst_rkung_vor_Br_cke, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Meldung Fluss", 100, func_Meldung_Fluss, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Verstärkung im Lager", 10, func_Verst_rkung_im_Lager, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Verstärkung in Stellung", 10, func_Verst_rkung_in_Stellung, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Sieg Bergstellung", 100, func_Sieg_Bergstellung, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Sieg", 100, func_Sieg, 0 + RandomHalf(100))
	AIparts:AddPeriodic("Flieger_Uebergang", 10, func_Flieger_Uebergang, 0 + RandomHalf(10))
	AIparts:AddPeriodic("Sound", 20000, func_Sound, 3000 + RandomHalf(100))
	msd_vars = {
		AlarmLager = false,
		Bruecke_zerstoert = 0,
		Bruecke1 = 0,
		Bruecke1Timer = 1,
		Bruecke2Timer = 1,
		Funkstation_gesprengt = 0,
		Lager_erobert = false,
		Lager_Explosion = false,
		Lager_Feind = 0,
		Lager_Sprengung = 0,
		new_var = 0,
		Phase1 = false,
		Phase2 = false,
		Reinigung1 = 0,
		Reinigung2 = 0,
		Spiel_aktiv = false,
		Sprengwagen = 0,
		Transporter_Start = false,
		TransportleerCounter = 0,
		TransportleerTimer = 1,
		TransportvollCounter = 0,
		VorstossBruecke = 0,
		WacheBruecke = 0,
	}
end

function func_Abwurf1()
	do
		Spawn({desc = "Units/Aircrafts/German/ju_52.dsc", position = {800, 50,-200}, player = "Player", commands = {{unload_to = "Abwurf1"}, {dislocation = {800, 80, 0}}, {disappear = true}}, cargo = {{desc = "Units/Europe/Soldiers/german/german_lmg_mg42.dsc", num = 2},{desc = "Units/Europe/Soldiers/german/german_smg.dsc", num = 2},{desc = "Units/Europe/Soldiers/german/german_mech.dsc", num = 3},{desc = "Units/Europe/Soldiers/german/german_rifleman.dsc", num = 4},{desc = "Units/Europe/Soldiers/german/german_officer.dsc", num = 1},{desc = "Units/Europe/Soldiers/german/german_sniper.dsc", num = 4},{desc = "Units/Europe/Soldiers/german/german_medic.dsc", num = 2}}})
		mission.CameraAt({-348.279053, 4.997330, -65.488358}, 44.999992, 90.000000, 129.989609, 0.00)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  mission.CameraAt({-326.040161, 4.997330, -436.841522}, 44.999992, 42.780754, 130.149155, 10.00) end)
		mission.CameraLock(true)
		DisableObjective("Start")
		AcivateObjective("Informant")
		mission.OutScreenMessage(100064, 20, "0xFFE0E0E0")
	end
end

function func_Patrol_Lager_N()
	if NumGroupUnitsNearPoint("LagerN", 0, "LagerN1", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerN", {"", }, {"LagerN2", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("LagerN", 0, "LagerN2", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerN", {"", }, {"LagerN1", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol Lager N")
	end
end

function func_Patrol_Lager_S()
	if NumGroupUnitsNearPoint("LagerS", 0, "LagerS1", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerS", {"", }, {"LagerS2", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("LagerS", 0, "LagerS2", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerS", {"", }, {"LagerS1", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol Lager S")
	end
end

function func_Patrol_Lager_W()
	if NumGroupUnitsNearPoint("LagerW", 0, "LagerW1", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerW", {"", }, {"LagerW2", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("LagerW", 0, "LagerW2", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerW", {"", }, {"LagerW1", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol Lager W")
	end
end

function func_Patrol_Lager_O()
	if NumGroupUnitsNearPoint("LagerO", 0, "LagerO1", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerO", {"", }, {"LagerO2", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("LagerO", 0, "LagerO2", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerO", {"", }, {"LagerO1", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol Lager O")
	end
end

function func_Patrol_Lager_Horz()
	if NumGroupUnitsNearPoint("LagerHorz", 0, "LagerHorz1", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerHorz", {"", }, {"LagerHorz2", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("LagerHorz", 0, "LagerHorz2", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerHorz", {"", }, {"LagerHorz1", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol Lager Horz")
	end
end

function func_Patrol_Lager_Vert()
	if NumGroupUnitsNearPoint("LagerVert", 0, "LagerVert1", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerVert", {"", }, {"LagerVert2", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("LagerVert", 0, "LagerVert2", 20) == 2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("LagerVert", {"", }, {"LagerVert1", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol Lager Vert")
	end
end

function func_Alarm_Lager()
	if NumGroupUnitsNearPoint("AlarmLager", 0, "AlarmLager", 5) > 0 then
		msd_vars.AlarmLager = true
	end
	if IsObjectiveCompleted("Versorgungslager", "Player") then
		AIparts:RemovePeriodic("Alarm Lager")
	end
end

function func_Alarm_Lager_N()
	if NumGroupUnitsInZone("LagerN", "Lager") == 1 then
		TransferUnits("LagerN", 0, "AlarmLager", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("AlarmLager", {"", }, {"AlarmLager", }, {"", }, true, true, "", false, 1) end)
		AIparts:RemovePeriodic("Alarm Lager N")
	end
end

function func_Alarm_Lager_S()
	if NumGroupUnitsInZone("LagerS", "Lager") == 1 then
		TransferUnits("LagerS", 0, "AlarmLager", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("AlarmLager", {"", }, {"AlarmLager", }, {"", }, true, true, "", false, 1) end)
		AIparts:RemovePeriodic("Alarm Lager S")
	end
end

function func_Alarm_Lager_O()
	if NumGroupUnitsInZone("LagerO", "Lager") == 1 then
		TransferUnits("LagerO", 0, "AlarmLager", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("AlarmLager", {"", }, {"AlarmLager", }, {"", }, true, true, "", false, 1) end)
		AIparts:RemovePeriodic("Alarm Lager O")
	end
end

function func_Alarm_Lager_W()
	if NumGroupUnitsInZone("LagerW", "Lager") == 1 then
		TransferUnits("LagerW", 0, "AlarmLager", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("AlarmLager", {"", }, {"AlarmLager", }, {"", }, true, true, "", false, 1) end)
		AIparts:RemovePeriodic("Alarm Lager W")
	end
end

function func_Alarm_Lager_Horz()
	if NumGroupUnitsInZone("LagerHorz", "Lager") == 1 then
		TransferUnits("LagerHorz", 0, "AlarmLager", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("AlarmLager", {"", }, {"AlarmLager", }, {"", }, true, true, "", false, 1) end)
		AIparts:RemovePeriodic("Alarm Lager Horz")
	end
end

function func_Alarm_Lager_Vert()
	if NumGroupUnitsInZone("LagerVert", "Lager") == 1 then
		TransferUnits("LagerVert", 0, "AlarmLager", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  MoveGroupTo("AlarmLager", {"", }, {"AlarmLager", }, {"", }, true, true, "", false, 1) end)
		AIparts:RemovePeriodic("Alarm Lager Vert")
	end
end

function func_Patrol1()
	if NumGroupUnitsNearPoint("Patrol1", 0, "Patrol1a", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol1", {"", }, {"Patrol1b", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("Patrol1", 0, "Patrol1b", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol1", {"", }, {"Patrol1a", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol1")
	end
end

function func_Patrol2()
	if NumGroupUnitsNearPoint("Patrol2", 0, "Patrol2a", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol2", {"", }, {"Patrol2b", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("Patrol2", 0, "Patrol2b", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol2", {"", }, {"Patrol2a", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol2")
	end
end

function func_Patrol3()
	if NumGroupUnitsNearPoint("Patrol3", 0, "Patrol3a", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol3", {"", }, {"Patrol3b", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("Patrol3", 0, "Patrol3b", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol3", {"", }, {"Patrol3a", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol3")
	end
end

function func_Patrol4()
	if NumGroupUnitsNearPoint("Patrol4", 0, "Patrol4a", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol4", {"", }, {"Patrol4b", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("Patrol4", 0, "Patrol4b", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol4", {"", }, {"Patrol4a", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol4")
	end
end

function func_Patrol5()
	if NumGroupUnitsNearPoint("Patrol5", 0, "Patrol5a", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol5", {"", }, {"Patrol5b", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("Patrol5", 0, "Patrol5b", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol5", {"", }, {"Patrol5a", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol5")
	end
end

function func_Patrol6()
	if NumGroupUnitsNearPoint("Patrol6", 0, "Patrol6a", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol6", {"", }, {"Patrol6b", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("Patrol6", 0, "Patrol6b", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Patrol6", {"", }, {"Patrol6a", }, {"", }, true, true, "", false, 5) end)
	end
	if msd_vars.Lager_erobert then
		AIparts:RemovePeriodic("Patrol6")
	end
end

function func_Patrol_Street1()
	if NumGroupUnitsNearPoint("Street1", 0, "Street1a", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Street1", {"", }, {"Street1b", }, {"", }, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("Street1", 0, "Street1b", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Street1", {"", }, {"Street1a", }, {"", }, true, true, "", false, 5) end)
	end
end

function func_Patrol_Street2()
	if NumGroupUnitsNearPoint("Street2", 0, "Street2a", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Street2", {}, {"Street2b", }, {}, true, true, "", false, 5) end)
	end
	if NumGroupUnitsNearPoint("Street2", 0, "Street2b", 20) > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  MoveGroupTo("Street2", {}, {"Street2a", }, {}, true, true, "", false, 5) end)
	end
end

function func_Spieler_auf_Abwurf()
	if NumPlayerUnitsInZone("Player", "Abwurf1") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100010, 20, "0xFFE0E0E0") end)
		AcivateObjective("Informant")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  mission.CameraAt({-305.349426, 4.997330, -444.144531}, 33.911129, 90.000000, 82.680283, 10.00) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.CameraLock(false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.OutScreenMessage(100014, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  msd_vars.Spiel_aktiv = true end)
		AIparts:RemovePeriodic("Spieler auf Abwurf")
	end
end

function func_Spieler_im_Dorf()
	if NumPlayerUnitsInZone("Player", "Dorf") > 1 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100007, 20, "0xFFE0E0E0") end)
		AcivateObjective("Informant1")
		DisableObjective("Informant")
		AIparts:RemovePeriodic("Spieler im Dorf")
	end
end

function func_Spieler_bei_M_hle()
	if IsPlayerUnitsPresent("Player", "Muehle1", 8) then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  TransferUnits("Informant1", 0, "Informant", 0) end)
		AIparts:RemovePeriodic("Spieler bei Mühle")
	end
end

function func_Informant_kommt()
	if NumPlayerUnits("Friend") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 2*10, function()  MoveGroupTo("Informant", {}, {"Muehle1", }, {}, true, true, "", false, 1) end)
		mission.CameraLock(true)
		mission.CameraAt({-334.159027, 4.997330, -8.099815}, 44.999992, 30.491186, 30.000006, 5.00)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100008, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  TransferUnits("Informant", 0, "Informant1", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.CameraLock(false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 25*10, function()  mission.CameraAt({-327.902863, 4.997330, -10.537453}, 30.917957, 89.730843, 73.953552, 5.00) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 25*10, function()  MoveGroupTo("Informant1", {}, {"Abwurf1", }, {}, true, true, "", true, 30) end)
		SetObjectiveComplete("Informant1", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  AddBonus(1, 6, 1, 100015, -1) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  AcivateObjective("Versorgungslager") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 50*10, function()  Spawn({desc = "Units/Aircrafts/German/ju_52.dsc", position = {800, 50,-200}, player = "Player", commands = {{unload_to = "Abwurf3"}, {dislocation = {800, 80, 0}}, {disappear = true}}, cargo = {{desc = "Units/Europe/Soldiers/german/german_lmg_mg42.dsc", num = 1},{desc = "Units/Europe/Soldiers/german/german_smg.dsc", num = 2},{desc = "Units/Europe/Soldiers/german/german_mech.dsc", num = 1},{desc = "Units/Europe/Soldiers/german/german_rifleman.dsc", num = 2},{desc = "Units/Europe/Soldiers/german/german_officer.dsc", num = 1},{desc = "Units/Europe/Soldiers/german/german_sniper.dsc", num = 2},{desc = "Units/Europe/Soldiers/german/german_medic.dsc", num = 1}}}) end)
		AIparts:RemovePeriodic("Informant kommt")
	end
end

function func_Spieler_bei_Funkstation()
	if NumPlayerUnitsInZone("Player", "Funkstation") > 0 and not IsObjectiveCompleted("Versorgungslager", "Player") then
		mission.OutScreenMessage(100002, 20, "0xFFE0E0E0")
		AcivateObjective("Funkstation")
		AIparts:RemovePeriodic("Spieler bei Funkstation")
	end
end

function func_Spieler_in_Funkstation()
	if IsPlayerUnitsPresent("Player", "Funkstation", 5) and not IsObjectiveCompleted("Versorgungslager", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100003, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  ProceedObjective("Funkstation", "Player") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  CreateFXObject("smoke/chimney.dsc", "Funkstation", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  CreateFXObject("smoke/engine.dsc", "Funkstation", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 40*10, function()  CreateFXObject("smoke/house_medium.dsc", "Funkstation", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 50*10, function()  CreateFXObject("smoke/house_bigger.dsc", "Funkstation", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  CreateFXObject("smoke/factory_bigger.dsc", "Funkstation", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 70*10, function()  Bombardment("Funkstation", 2, 15, 12, 1) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  Spawn({desc = "Units/Aircrafts/German/ju_52.dsc", position = {800, 50,-200}, player = "Player", commands = {{unload_to = "Abwurf4"}, {dislocation = {800, 80, 0}}, {disappear = true}}, cargo = {{desc = "Units/Europe/Soldiers/german/german_lmg_mg42.dsc", num = 1},{desc = "Units/Europe/Soldiers/german/german_smg.dsc", num = 2},{desc = "Units/Europe/Soldiers/german/german_mech.dsc", num = 1},{desc = "Units/Europe/Soldiers/german/german_rifleman.dsc", num = 2},{desc = "Units/Europe/Soldiers/german/german_officer.dsc", num = 1},{desc = "Units/Europe/Soldiers/german/german_sniper.dsc", num = 2},{desc = "Units/Europe/Soldiers/german/german_medic.dsc", num = 1}}}) end)
		AIparts:AddOneTime("TIMER_VAR_Funkstation_gesprengt", 70*10, function() msd_vars.Funkstation_gesprengt = 1 end)
		AIparts:RemovePeriodic("Spieler in Funkstation")
	end
end

function func_Alarm_Lager_Funk()
	if ( NumPlayerUnitsInZone("Enemy", "Lager") > 0 and NumPlayerUnitsInZone("Player", "Lager") > 0 and msd_vars.Funkstation_gesprengt == 0  ) or ( msd_vars.AlarmLager and msd_vars.Funkstation_gesprengt == 0  )  then
		mission.OutScreenMessage(100001, 20, "0xFFE0E0E0")
		RunSpawn("Enemy", {"Funk_Alarm", }, "Spawn_00", "FeindLager", "", true, true, {}, false, 10)
		RunSpawn("Enemy", {"Funk_Alarm", }, "Spawn_01", "FeindLager", "", true, true, {}, false, 10)
		RunSpawn("Enemy", {"Funk_Alarm", }, "Spawn_02", "FeindLager", "", true, true, {}, false, 10)
		RunSpawn("Enemy", {"Funk_Alarm", }, "Spawn_04", "FeindLager", "", true, true, {}, false, 10)
		AIparts:RemovePeriodic("Alarm Lager Funk")
	end
end

function func_Versorgungslager_erobert()
	if NumPlayerUnitsInZone("Player", "Lager") > 0 and NumPlayerUnitsInZone("Enemy", "Lager") == 0 and IsObjectiveActive("Versorgungslager") then
		ProceedObjective("Versorgungslager", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.OutScreenMessage(100000, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  AcivateObjective("Brücke") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  Spawn({desc = "Units/Aircrafts/German/ju_52.dsc", position = {-50, 50,-800}, player = "Player", commands = {{unload_to = "Abwurf2"}, {dislocation = {800, 80, 0}}, {disappear = true}}, cargo = {{desc = "Units/Europe/Soldiers/german/german_panzerschreck.dsc", num = 3},{desc = "Units/Europe/Soldiers/german/german_smg.dsc", num = 4},{desc = "Units/Europe/Soldiers/german/german_rifleman.dsc", num = 4},{desc = "Units/Europe/Soldiers/german/german_officer.dsc", num = 1},{desc = "Units/Europe/Soldiers/german/german_sniper.dsc", num = 4},{desc = "Units/Europe/Soldiers/german/german_medic.dsc", num = 2}}}) end)
		AIparts:RemovePeriodic("Versorgungslager erobert")
	end
end

function func_Br_cke_erobert()
	if NumPlayerUnitsInZone("Enemy", "Bruecke1") == 0 and NumPlayerUnitsInZone("Player", "Bruecke1") > 0 and IsObjectiveActive("Brücke") and NumPlayerUnitsInZone("Enemy", "Bruecke2") == 0 then
		ProceedObjective("Brücke", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.OutScreenMessage(100020, 20, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Brücke erobert")
	end
end

function func_Phase1_abgeschlossen()
	if IsObjectiveCompleted("Brücke", "Player") and IsObjectiveCompleted("Versorgungslager", "Player") then
		msd_vars.Phase1 = true
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  mission.OutScreenMessage(100023, 20, "0xFFE0E0E0") end)
		RunSpawn("Player", {"Lager_Inf1", }, "Spawn_00", "Inf_1", "", true, true, {}, false, 20)
		RunSpawn("Player", {"Brücke_Inf1", }, "Spawn_01", "Inf_1", "", true, true, {}, false, 20)
		RunSpawn("Player", {"Brücke_Inf2", }, "Spawn_02", "Inf_1", "", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 300*10, function()  msd_vars.Transporter_Start = true end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 270*10, function()  mission.OutScreenMessage(100024, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  DisableObjective("Versorgungslager") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  AcivateObjective("Transport") end)
		AIparts:RemovePeriodic("Phase1 abgeschlossen")
	end
end

function func_Transporter_kommt()
	if msd_vars.TransportvollCounter == 10 then
		AIparts:RemovePeriodic("Transporter kommt")
	end
	if msd_vars.Transporter_Start and msd_vars.TransportleerTimer == 1 then
		RunSpawn("Friend", {"Transport", }, "Spawn_00", "Transportleer", "", true, true, {}, false, 5)
		msd_vars.TransportleerTimer = 0
		AIparts:AddOneTime("TIMER_VAR_TransportleerTimer", 230*10, function() msd_vars.TransportleerTimer = 1 end)
		msd_vars.TransportleerCounter = msd_vars.TransportleerCounter + 1
		MoveGroupToZone("FeindBruecke", "Bruecke1", true, false)
		MoveGroupToZone("FeindLager", "Lager", true, false)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Enemy", {"5Inf", }, "Spawn_00", "FeindLager", "", true, true, {}, false, 20) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  RunSpawn("Enemy", {"5Inf", }, "Spawn_01", "FeindLager", "", true, true, {}, false, 20) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  RunSpawn("Enemy", {"5Inf", }, "Spawn_03", "FeindLager", "", true, true, {}, false, 20) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  RunSpawn("Enemy", {"5Inf", }, "Spawn_04", "FeindLager", "", true, true, {}, false, 20) end)
	end
end

function func_Transporter_Beladung()
	if NumGroupUnitsInZone("Transportleer", "Lager") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  TransferUnits("Transportleer", 18, "Transportbeladung", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  MoveGroupTo("Transportbeladung", {}, {"Beladung", }, {}, true, true, "", false, 2) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupTo("Transportbeladung", {}, {"Beladung", }, {}, true, true, "", false, 2) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 80*10, function()  TransferUnits("Transportbeladung", 18, "Transportvoll", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 85*10, function()  MoveGroupTo("Transportvoll", {}, {"Exit_Transport", }, {}, true, true, "", false, 1) end)
	end
	if msd_vars.TransportvollCounter > 10 then
		AIparts:RemovePeriodic("Transporter Beladung")
	end
end

function func_Transporter_Exit()
	if NumGroupUnitsNearPoint("Transportvoll", 0, "Exit_Transport", 10) > 0 then
		msd_vars.TransportvollCounter = msd_vars.TransportvollCounter + 1
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 3*10, function()  DisappearUnitsInGroup("Transportvoll") end)
	end
	if msd_vars.TransportvollCounter > 10 then
		AIparts:RemovePeriodic("Transporter Exit")
	end
end

function func_Transport1()
	if msd_vars.TransportvollCounter == 1 then
		mission.OutScreenMessage(100025, 10, "0xFFE0E0E0")
		RunSpawn("Enemy", {"Angriff1", }, "Spawn_00", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff1", }, "Spawn_01", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff1", }, "Spawn_02", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff1", }, "Spawn_04", "FeindBruecke", "", true, true, {}, false, 20)
		AIparts:RemovePeriodic("Transport1")
	end
end

function func_Transport2()
	if msd_vars.TransportvollCounter == 2 then
		RunSpawn("Player", {"Versorgung1", }, "Spawn_03", "", "", true, true, {}, false, 20)
		AIparts:RemovePeriodic("Transport2")
	end
end

function func_Transport3()
	if msd_vars.TransportvollCounter == 3 then
		RunSpawn("Player", {"Versorgung1", }, "Spawn_01", "", "", true, true, {}, false, 10)
		RunSpawn("Enemy", {"Angriff4", }, "Spawn_00", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff2", }, "Spawn_01", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff2", }, "Spawn_02", "FeindLager", "", true, true, {}, false, 20)
		AIparts:RemovePeriodic("Transport3")
	end
end

function func_Transport5()
	if msd_vars.TransportvollCounter == 5 then
		mission.OutScreenMessage(100026, 10, "0xFFE0E0E0")
		RunSpawn("Enemy", {"Angriff2", }, "Spawn_03", "FeindBruecke", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff2", }, "Spawn_05", "FeindBruecke", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff2", }, "Spawn_04", "FeindBruecke", "", true, true, {}, false, 20)
		SendPlane("Enemy", "Beladung", "scout", "W", 15, -1, "")
		AIparts:RemovePeriodic("Transport5")
	end
end

function func_Transport6()
	if msd_vars.TransportvollCounter == 6 then
		RunSpawn("Enemy", {"Angriff3", }, "Spawn_04", "FeindBruecke", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff3", }, "Spawn_06", "", "", true, true, {}, false, 20)
		RunSpawn("Player", {"Panzer1", }, "Spawn_04", "", "", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  RunSpawn("Enemy", {"Angriff4", }, "Spawn_06", "FeindBruecke", "", true, true, {}, false, 20) end)
		mission.OutScreenMessage(100031, 20, "0xFFE0E0E0")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  RunSpawn("Player", {"Brücke_Inf1", }, "Spawn_05", "", "", true, true, {}, false, 10) end)
		AIparts:RemovePeriodic("Transport6")
	end
end

function func_Transport7()
	if msd_vars.TransportvollCounter == 7 then
		RunSpawn("Enemy", {"Angriff2", }, "Spawn_04", "FeindBruecke", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff1", }, "Spawn_00", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff2", }, "Spawn_01", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff3", }, "Spawn_02", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff4", }, "Spawn_03", "FeindBruecke", "", true, true, {}, false, 20)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  RunSpawn("Enemy", {"Angriff4", }, "Spawn_06", "FeindLager", "", true, true, {}, false, 20) end)
		AIparts:RemovePeriodic("Transport7")
	end
end

function func_Transport8()
	if msd_vars.TransportvollCounter == 8  then
		RunSpawn("Player", {"Lager_Inf1", }, "Spawn_00", "Inf_1", "", true, true, {}, false, 20)
		RunSpawn("Player", {"Brücke_Inf2", }, "Spawn_02", "Inf_1", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff3", }, "Spawn_03", "FeindBruecke", "", true, true, {}, false, 20)
		SendPlane("Enemy", "LagerS2", "scout", "W", 15, -1, "")
		AIparts:RemovePeriodic("Transport8")
	end
end

function func_Transport9()
	if msd_vars.TransportvollCounter == 9 then
		mission.OutScreenMessage(100039, 20, "0xFFE0E0E0")
		RunSpawn("Enemy", {"Angriff5", }, "Spawn_03", "FeindBruecke", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff5", }, "Spawn_01", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff5", }, "Spawn_02", "FeindLager", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff5", }, "Spawn_04", "FeindBruecke", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff5", }, "Spawn_05", "FeindBruecke", "", true, true, {}, false, 20)
		RunSpawn("Enemy", {"Angriff5", }, "Spawn_00", "FeindLager", "", true, true, {}, false, 20)
		AIparts:RemovePeriodic("Transport9")
	end
end

function func_Transport10()
	if msd_vars.TransportvollCounter == 10 then
		mission.OutScreenMessage(100028, 10, "0xFFE0E0E0")
		SetObjectiveComplete("Transport", "Player")
		AIparts:AddOneTime("TIMER_VAR_Reinigung1", 5*10, function() msd_vars.Reinigung1 = 1 end)
		AIparts:RemovePeriodic("Transport10")
	end
end

function func_Transport20()
	if msd_vars.TransportleerCounter > 19 then
		mission.OutScreenMessage(100029, 20, "0xFFE0E0E0")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  PlayerDefeat("Player") end)
		AIparts:RemovePeriodic("Transport20")
	end
end

function func_Spieler_verliert()
	if msd_vars.Spiel_aktiv and NumPlayerUnits("Player") < 4 then
		mission.OutScreenMessage(100030, 20, "0xFFE0E0E0")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  PlayerDefeat("Player") end)
		AIparts:RemovePeriodic("Spieler verliert")
	end
end

function func_Auftrag_Lager_sprengen()
	if IsObjectiveCompleted("Transport", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  mission.OutScreenMessage(100035, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  DisableObjective("Transport") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  DisableObjective("Brücke") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  DisableObjective("Informant1") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  DisableObjective("Funkstation") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  AcivateObjective("Versorgungslager sprengen") end)
		msd_vars.Lager_Sprengung = 1
		AIparts:RemovePeriodic("Auftrag Lager sprengen")
	end
end

function func_Alarm_Lager_Sprengung()
	if msd_vars.AlarmLager and IsObjectiveCompleted("Funkstation", "Player") and IsObjectiveActive("Versorgungslager") then
		SetObjectiveComplete("Versorgungslager", "Enemy")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  Bombardment("Beladung", 30, 8, 6, 30) end)
		msd_vars.Lager_Feind = 1
		AIparts:RemovePeriodic("Alarm Lager Sprengung")
	end
end

function func_Abfrage_Lager()
	do
		local object = GetObject(1966)
		if not object then msd_vars.Lager_Explosion = true end
	end
	if msd_vars.Lager_Explosion then
		AIparts:RemovePeriodic("Abfrage Lager")
	end
end

function func_Auswertung_Lagersprengung()
	if msd_vars.Lager_Explosion and msd_vars.Lager_Sprengung == 1 then
		mission.OutScreenMessage(100038, 20, "0xFFE0E0E0")
		SendPlane("Enemy", "LagerVert2", "scout", "W", 15, -1, "")
		SendPlane("Enemy", "LagerVert1", "scout", "W", 15, -1, "")
		SetObjectiveComplete("Versorgungslager sprengen", "Player")
		AIparts:RemovePeriodic("Auswertung Lagersprengung")
	end
end

function func_Auswertung_Lagerexplosion()
	if msd_vars.Lager_Explosion and msd_vars.Lager_Sprengung == 0 and msd_vars.Lager_Feind == 0 then
		mission.OutScreenMessage(100022, 20, "0xFFE0E0E0")
		mission.CameraLock(true)
		mission.CameraAt({-116.848816, 4.997330, 275.421967}, 44.999992, 121.453857, 53.165741, 5.00)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  PlayerDefeat("Player") end)
		AIparts:RemovePeriodic("Auswertung Lagerexplosion")
	end
end

function func_Auswertung_AlarmLagersprengung()
	if msd_vars.Lager_Explosion and msd_vars.Lager_Feind == 1 then
		SetObjectiveComplete("Versorgungslager", "Enemy")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 15*10, function()  mission.CameraLock(true) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 15*10, function()  mission.OutScreenMessage(100021, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 15*10, function()  mission.CameraAt({-73.132065, 4.997330, 265.723755}, 44.999992, 90.000000, 30.000000, 10.00) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 40*10, function()  PlayerDefeat("Player") end)
		AIparts:RemovePeriodic("Auswertung AlarmLagersprengung")
	end
end

function func_Lager_verloren()
	if IsObjectiveActive("Transport") and NumPlayerUnitsInZone("Player", "Lager") < 1 and msd_vars.TransportvollCounter > 1 and msd_vars.TransportvollCounter < 16 then
		mission.OutScreenMessage(100040, 20, "0xFFE0E0E0")
		mission.CameraLock(true)
		mission.CameraAt({-73.132065, 4.997330, 265.723755}, 44.999992, 90.000000, 30.000000, 10.00)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  PlayerDefeat("Player") end)
		AIparts:RemovePeriodic("Lager verloren")
	end
end

function func_AriAttack1()
	if IsObjectiveCompleted("Versorgungslager sprengen", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  SendPlane("Enemy", "Ari2", "fighter", "W", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 150*10, function()  SendPlane("Enemy", "Ari3", "fighter", "W", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 40*10, function()  Bombardment("Ari1", 30, 10, 10, 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  Bombardment("Ari2", 30, 10, 10, 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 80*10, function()  Bombardment("Ari3", 30, 10, 10, 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  Bombardment("Ari4", 30, 10, 10, 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 110*10, function()  Bombardment("Ari5", 30, 10, 10, 30) end)
		AIparts:RemovePeriodic("AriAttack1")
	end
end

function func_Sprengwagen_kommt()
	if IsObjectiveActive("Brücke zerstören") and not IsBridgeBroken(315) then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Player", {"Sprengwagen", }, "Spawn_06", "Sprengwagen", "", true, true, {}, false, 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  mission.OutScreenMessage(100046, 20, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Sprengwagen kommt")
	end
end

function func_Sprengwagen_auf_Br_cke()
	if NumGroupUnitsNearPoint("Sprengwagen", 0, "Bruecke", 10) > 0 and IsObjectiveActive("Brücke zerstören") then
		msd_vars.Sprengwagen = 1
		mission.CameraLock(true)
		mission.CameraAt({196.087433, 4.393005, 239.495514}, 44.999992, 159.862061, 47.203144, 5.00)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 2*10, function()  MoveGroupTo("Sprengwagen", {"", }, {"Bruecke", }, {"", }, true, true, "", true, 5) end)
		CreateFXObject("smoke/house_medium.dsc", "Bruecke", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 2*10, function()  CreateFXObject("smoke/factory_bigger.dsc", "Bruecke", 0) end)
		AIparts:RemovePeriodic("Sprengwagen auf Brücke")
	end
end

function func_Abfrage_Br_cke()
	if IsObjectiveActive("Brücke zerstören") and IsBridgeBroken(315) then
		SetObjectiveComplete("Brücke zerstören", "Player")
		msd_vars.Bruecke_zerstoert = 1
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100044, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  msd_vars.Phase2 = true end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  DisappearUnitsInGroup("FeindBruecke") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  DisappearUnitsInGroup("FeindLager") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 120*10, function()  DisappearUnitsInGroup("Reinigung1") end)
		FlushSpawn(2)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  RunSpawn("Enemy", {"Wache_Brücke", }, "Spawn_08", "Bruecke", "", true, true, {}, false, 10) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 40*10, function()  MoveGroupToZone("Reinigung2", "Abwurf1", false, false) end)
		AIparts:RemovePeriodic("Abfrage Brücke")
	end
end

function func_Ari_Br_cke()
	if msd_vars.Sprengwagen == 1 and msd_vars.Bruecke_zerstoert == 0 then
		CreateFXObject("smoke/house_medium.dsc", "Bruecke", 0)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 3*10, function()  CreateFXObject("smoke/factory_bigger.dsc", "Bruecke", 0) end)
		Bombardment("Bruecke", 10, 10, 5, 30)
	end
	if msd_vars.Bruecke_zerstoert == 1 and msd_vars.Sprengwagen == 1 then
		mission.CameraAt({185.347656, 4.393005, 233.060944}, 30.917957, 89.730843, 73.953560, 5.00)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  mission.CameraLock(false) end)
		AIparts:RemovePeriodic("Ari Brücke")
	end
end

function func_NiederlageBr_cke()
	if NumGroupUnitsInZone("Reinigung2", "Bruecke2") > 0 then
		FailObjective("Brücke zerstören")
		mission.OutScreenMessage(100045, 20, "0xFFE0E0E0")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  PlayerDefeat("Player") end)
		AIparts:RemovePeriodic("NiederlageBrücke")
	end
end

function func_Reinigungszyklus1()
	if NumGroupUnitsInZone("Reinigung1", "Bruecke1") > 2 and NumPlayerUnitsInZone("Player", "Bruecke1") < 20 then
		msd_vars.Reinigung1 = 0
		msd_vars.Reinigung2 = 1
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  UnloadTransports("Reinigung1") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  mission.OutScreenMessage(100043, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 1*10, function()  AcivateObjective("Brücke zerstören") end)
		MoveGroupToZone("FeindBruecke", "Abwurf1", false, false)
		MoveGroupToZone("FeindLager", "Abwurf1", false, false)
		FlushSpawn(2)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  RunSpawn("Enemy", {"Dorf", }, "Spawn_09", "Dorf", "", true, true, {}, false, 30) end)
		AIparts:RemovePeriodic("Reinigungszyklus1")
	end
	if msd_vars.Reinigung1 == 1 and msd_vars.Bruecke1Timer == 1 then
		RunSpawn("Enemy", {"Reinigung", }, "Spawn_07", "Reinigung1", "", true, true, {}, false, 50)
		MoveGroupToZone("Reinigung1", "Bruecke1", false, false)
		msd_vars.Bruecke1Timer = 0
		AIparts:AddOneTime("TIMER_VAR_Bruecke1Timer", 100*10, function() msd_vars.Bruecke1Timer = 1 end)
	end
end

function func_Reinigungszyklus2()
	if msd_vars.Bruecke_zerstoert == 1 then
		msd_vars.Reinigung2 = 0
		UnloadTransports("Reinigung2")
		MoveGroupToZone("Reinigung2", "Bruecke1", false, false)
		AIparts:RemovePeriodic("Reinigungszyklus2")
	end
	if msd_vars.Reinigung2 == 1 and msd_vars.Bruecke2Timer == 1 then
		RunSpawn("Enemy", {"Reinigung", }, "Spawn_08", "Reinigung2", "", true, true, {}, false, 50)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  TransferUnits("Reinigung1", 0, "Reinigung2", 0) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Reinigung2", "Bruecke2", true, false) end)
		msd_vars.Bruecke2Timer = 0
		AIparts:AddOneTime("TIMER_VAR_Bruecke2Timer", 120*10, function() msd_vars.Bruecke2Timer = 1 end)
	end
end

function func_Kamera_auf_Transporter()
	if NumGroupUnitsInZone("Transportleer", "Exit_Transport") > 0 then
		mission.CameraLock(true)
		mission.CameraAt({395.559570, 5.108060, 226.837860}, 44.999989, 177.720139, 90.413780, 5.00)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.CameraLock(false) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.CameraAt({181.784973, 0.000000, 221.811096}, 30.000000, 90.000000, 114.212341, 10.00) end)
		AIparts:RemovePeriodic("Kamera auf Transporter")
	end
end

function func_Start_Phase2()
	if msd_vars.Phase2 then
		AddBonus(1, 6, 1, 100047, -1)
		mission.OutScreenMessage(100027, 20, "0xFFE0E0E0")
		DisableObjective("Brücke zerstören")
		DisableObjective("Versorgungslager sprengen")
		MoveGroupToZone("Dorf", "Dorf", true, false)
		RunSpawn("Enemy", {"Angriff4", }, "Spawn_07", "Verteidigung_Lager", "", true, true, {}, false, 20)
		AIparts:RemovePeriodic("Start Phase2")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  UnloadTransports("Dorf") end)
	end
end

function func_Spieler_am_Fluss()
	if msd_vars.Phase2 and NumPlayerUnitsInZone("Player", "Uebergang") > 0 then
		AcivateObjective("Flussüberquerung")
		AcivateObjective("Dorf besetzen")
		AcivateObjective("Brücke reparieren")
		AcivateObjective("Stellung")
		MoveGroupToZone("Bruecke", "Bruecke1", true, false)
		DisappearUnitsInGroup("Reinigung2")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Player", {"Player_Fluss", }, "Spawn_09", "", "", true, true, {}, false, 10) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  SetObjectiveComplete("Flussüberquerung", "Player") end)
		MoveGroupToZone("Verteidigung_Lager", "Lager", true, false)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  UnloadTransports("Verteidigung_Lager") end)
		AIparts:RemovePeriodic("Spieler am Fluss")
	end
end

function func_AriBr_cke_Phase2()
	if NumGroupUnitsInZone("Bruecke", "Bruecke1") > 2 and NumPlayerUnitsInZone("Player", "Bruecke2") > 0 then
		Bombardment("AriBruecke1", 30, 8, 6, 30)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 3*10, function()  Bombardment("AriBruecke2", 30, 8, 6, 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 6*10, function()  Bombardment("AriBruecke3", 30, 8, 6, 30) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 9*10, function()  Bombardment("AriBruecke4", 30, 8, 6, 30) end)
	end
	if IsObjectiveCompleted("Brücke reparieren", "Player") then
		AIparts:RemovePeriodic("AriBrücke Phase2")
	end
end

function func_Dorf_gesauebert()
	if msd_vars.Phase2 and NumPlayerUnitsInZone("Player", "Dorf") > 0 and NumPlayerUnitsInZone("Enemy", "Dorf") < 2 then
		SetObjectiveComplete("Dorf besetzen", "Player")
		AIparts:RemovePeriodic("Dorf gesauebert")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100056, 20, "0xFFE0E0E0") end)
		Spawn({desc = "Units/Aircrafts/German/ju_52.dsc", position = {800, 80,-200}, player = "Player", commands = {{unload_to = "Abwurf5"}, {dislocation = {800, 80, 0}}, {disappear = true}}, cargo = {{desc = "Objects/ammo_boxes/fuel_800.dsc", num = 4},{desc = "Objects/ammo_boxes/ammo_4000.dsc", num = 2},{desc = "Units/Soldiers/german/german_mech.dsc", num = 2},{desc = "Units/Soldiers/german/german_medic.dsc", num = 2}}})
	end
end

function func_Wache_Br_cke()
	if NumGroupUnitsInZone("Bruecke", "Bruecke1") > 2 then
		msd_vars.WacheBruecke = 1
		AIparts:RemovePeriodic("Wache Brücke")
	end
end

function func_Br_cke_ges_ubert()
	if msd_vars.WacheBruecke == 1 and NumPlayerUnitsInZone("Enemy", "Bruecke1") < 3 and NumPlayerUnitsInZone("Player", "Bruecke1") > 0 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  RunSpawn("Player", {"Pioniere", }, "Spawn_06", "", "", true, true, {}, false, 10) end)
		AIparts:RemovePeriodic("Brücke gesäubert")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100057, 20, "0xFFE0E0E0") end)
	end
end

function func_Br_cke_repariert()
	if msd_vars.Phase2 and not IsBridgeBroken(315) then
		SetObjectiveComplete("Brücke reparieren", "Player")
		AIparts:RemovePeriodic("Brücke repariert")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  RunSpawn("Player", {"Verstärkung3_Phase2", }, "Spawn_08", "Verstaerkung", "", true, true, {}, false, 10) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 5*10, function()  mission.OutScreenMessage(100058, 10, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Player", {"Verstärkung1_Phase2", }, "Spawn_07", "Verstaerkung", "", true, true, {}, false, 10) end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  RunSpawn("Player", {"Verstärkung2_Phase2", }, "Spawn_10", "Verstaerkung", "", true, true, {}, false, 10) end)
	end
end

function func_Verst_rkung_vor_Br_cke()
	if NumGroupUnitsInZone("Verstaerkung", "Bruecke1") > 0 then
		SendPlane("Enemy", "AriBruecke1", "strike_fighter", "W", 15, -1, "")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  SendPlane("Enemy", "Ari4", "strike_fighter", "W", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Enemy", {"Reinigung", }, "Spawn_05", "", "", true, true, {}, false, 10) end)
		AIparts:RemovePeriodic("Verstärkung vor Brücke")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 90*10, function()  RunSpawn("Enemy", {"Reinigung", }, "Spawn_04", "", "", true, true, {}, false, 10) end)
		Spawn({desc = "Units/Aircrafts/German/ju_52.dsc", position = {800, 80,-200}, player = "Player", commands = {{unload_to = "Abwurf2"}, {dislocation = {800, 80, 0}}, {disappear = true}}, cargo = {{desc = "Objects/ammo_boxes/fuel_800.dsc", num = 4},{desc = "Objects/ammo_boxes/ammo_4000.dsc", num = 4},{desc = "Units/Soldiers/german/german_mech.dsc", num = 2},{desc = "Units/Soldiers/german/german_medic.dsc", num = 2}}})
	end
end

function func_Meldung_Fluss()
	if not IsObjectiveCompleted("Flussüberquerung", "Player") and msd_vars.Phase2 then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 200*10, function()  mission.OutScreenMessage(100059, 20, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Meldung Fluss")
	end
end

function func_Verst_rkung_im_Lager()
	if NumGroupUnitsInZone("Verstaerkung", "Lager") > 0 then
		RunSpawn("Enemy", {"Angriff4", }, "Spawn_02", "Verteidigung_Lager", "", true, true, {}, false, 30)
		AIparts:RemovePeriodic("Verstärkung im Lager")
		SendPlane("Enemy", "Ari5", "strike_fighter", "NW", 15, -1, "")
		SendPlane("Enemy", "Ari4", "strike_fighter", "NW", 15, -1, "")
	end
end

function func_Verst_rkung_in_Stellung()
	if NumGroupUnitsInZone("Verstaerkung", "Bergstellung") > 5 then
		MoveGroupToZone("Verteidigung_Lager", "Bergstellung", true, false)
		RunSpawn("Enemy", {"Reinigung", }, "Spawn_05", "Verteidigung_Lager", "", true, true, {}, false, 10)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  MoveGroupToZone("Verteidigung_Lager", "Bergstellung", true, false) end)
		AIparts:RemovePeriodic("Verstärkung in Stellung")
		SendPlane("Enemy", "AriBruecke4", "strike_fighter", "NW", 15, -1, "")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 30*10, function()  RunSpawn("Enemy", {"Reinigung", }, "Spawn_10", "Verteidigung_Lager", "", true, true, {}, false, 10) end)
	end
end

function func_Sieg_Bergstellung()
	if NumPlayerUnitsInZone("Enemy", "Bergstellung") < 3 and NumPlayerUnitsInZone("Player", "Bergstellung") > 0 then
		SetObjectiveComplete("Stellung", "Player")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 10*10, function()  mission.OutScreenMessage(100060, 20, "0xFFE0E0E0") end)
		AIparts:RemovePeriodic("Sieg Bergstellung")
	end
end

function func_Sieg()
	if IsObjectiveCompleted("Brücke reparieren", "Player") and IsObjectiveCompleted("Dorf besetzen", "Player") and IsObjectiveCompleted("Stellung", "Player") then
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 20*10, function()  mission.OutScreenMessage(100061, 20, "0xFFE0E0E0") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 40*10, function()  PlayerWin("Player") end)
		AIparts:RemovePeriodic("Sieg")
	end
end

function func_Flieger_Uebergang()
	if IsObjectiveCompleted("Flussüberquerung", "Player") and NumPlayerUnitsInZone("Player", "Uebergang") > 2 then
		SendPlane("Enemy", "FliegerUebergang", "strike_fighter", "NW", 15, -1, "")
		SendPlane("Enemy", "FliegerUebergang", "strike_fighter", "W", 15, -1, "")
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 60*10, function()  SendPlane("Enemy", "FliegerUebergang", "strike_fighter", "NW", 15, -1, "") end)
		AIparts:AddOneTime(AIparts:GetUniqueId("TIMER_DO_"), 100*10, function()  SendPlane("Enemy", "FliegerUebergang", "strike_fighter", "NW", 15, -1, "") end)
		AIparts:RemovePeriodic("Flieger_Uebergang")
	end
end

function func_Sound()
	do
		mission.OutScreenMessage(100065, 20, "0xFFE0E0E0")
	end
end

