SendCommercialShipsTroughMapA = function()
	local RandomCountry = Utils.Random({ allies, england, france, germany, ussr, russia, ukraine, china })
	local RandomContainerPort = Utils.Random({ TechBuilding13A, TechBuilding13B, TechBuilding13C })
	local RandomUpgradeType = Utils.Random({ "dollar.prefix", "speed.prefix", "earth.prefix", "empulse.prefix", "fpower.prefix", "gps.prefix" })
	local CommercialShip = Actor.Create("ship.container", true, { Owner = RandomCountry, Location = Utils.Random({ RandomEdgeWaterWaypoint0, RandomEdgeWaterWaypoint1, RandomEdgeWaterWaypoint2, RandomEdgeWaterWaypoint3, RandomEdgeWaterWaypoint4 }).Location, Facing = Utils.RandomInteger(0, 255) })
	CommercialShip.Owner = Utils.Random({ neutral, neutral0, neutral1, neutral2, neutral3, gdi, un })
	CommercialShip.GrantTimedUpgrade(RandomUpgradeType, Utils.RandomInteger(333, 666))
	CommercialShip.GrantUpgrade("nocontrol")
	Trigger.OnIdle(CommercialShip, function(CommercialShip) 
		CommercialShip.Move(RandomContainerPort.Location + CVec.New(5, 0))
		CommercialShip.Wait(Utils.RandomInteger(99, 111))
		CommercialShip.Move(Utils.Random({ RandomEdgeWaterWaypoint5, RandomEdgeWaterWaypoint6, RandomEdgeWaterWaypoint7, RandomEdgeWaterWaypoint8 }).Location)
		CommercialShip.Destroy()
	end)
	local CommercialShipCargoType0 = Utils.Random({ "armorcrate0", "ammocrate0", "ammocrate1", "woodcrate0", "woodcrate1", "healcrate2", "healcrate0", "healcrate1", "crate" })
	local CommercialShipCargoType1 = Utils.Random({ "armorcrate0", "ammocrate0", "ammocrate1", "woodcrate0", "woodcrate1", "healcrate2", "healcrate0", "healcrate1", "crate" })
	local CommercialShipCargoType2 = Utils.Random({ "armorcrate0", "ammocrate0", "ammocrate1", "woodcrate0", "woodcrate1", "healcrate2", "healcrate0", "healcrate1", "crate" })
	local CommercialShipCargoType3 = Utils.Random({ "armorcrate0", "ammocrate0", "ammocrate1", "woodcrate0", "woodcrate1", "healcrate2", "healcrate0", "healcrate1", "crate" })
	local CommercialShipCargoType4 = Utils.Random({ "armorcrate0", "ammocrate0", "ammocrate1", "woodcrate0", "woodcrate1", "healcrate2", "healcrate0", "healcrate1", "crate" })
	local CommercialShipCargoType5 = Utils.Random({ "armorcrate0", "ammocrate0", "ammocrate1", "woodcrate0", "woodcrate1", "healcrate2", "healcrate0", "healcrate1", "crate" })
	local CommercialShipCargoType6 = Utils.Random({ "armorcrate0", "ammocrate0", "ammocrate1", "woodcrate0", "woodcrate1", "healcrate2", "healcrate0", "healcrate1", "crate" })
	local CommercialShipCargo0 = CommercialShipCargoType0
	local CommercialShipCargo1 = CommercialShipCargoType1
	local CommercialShipCargo2 = CommercialShipCargoType2
	local CommercialShipCargo3 = CommercialShipCargoType3
	local CommercialShipCargo4 = CommercialShipCargoType4
	local CommercialShipCargo5 = CommercialShipCargoType5
	local CommercialShipCargo6 = CommercialShipCargoType6
	LoadTransportCrate(CommercialShip, CommercialShipCargo0)
	LoadTransportCrate(CommercialShip, CommercialShipCargo1)
	LoadTransportCrate(CommercialShip, CommercialShipCargo2)
	LoadTransportCrate(CommercialShip, CommercialShipCargo3)
	LoadTransportCrate(CommercialShip, CommercialShipCargo4)
	LoadTransportCrate(CommercialShip, CommercialShipCargo5)
	LoadTransportCrate(CommercialShip, CommercialShipCargo6)
	Trigger.OnRemovedFromWorld(CommercialShip, function()
		Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(33, 99)), function()
			SendCommercialShipsTroughMapB()
		end)
	end)
end
SendCommercialShipsTroughMapB = function()
	local RandomCountry = Utils.Random({ allies, england, france, germany, ussr, russia, ukraine, china })
	local RandomUpgradeType = Utils.Random({ "dollar.prefix", "speed.prefix", "earth.prefix", "empulse.prefix", "fpower.prefix", "gps.prefix" })
	local CommercialShip = Actor.Create("ship.comp", true, { Owner = neutral, Location = Utils.Random({ RandomEdgeWaterWaypoint0, RandomEdgeWaterWaypoint1, RandomEdgeWaterWaypoint2, RandomEdgeWaterWaypoint3, RandomEdgeWaterWaypoint4 }).Location, Facing = Utils.RandomInteger(0, 255) })
	CommercialShip.Owner = neutral
	CommercialShip.GrantTimedUpgrade(RandomUpgradeType, Utils.RandomInteger(333, 666))
	CommercialShip.GrantUpgrade("nocontrol")
	Trigger.OnIdle(CommercialShip, function(CommercialShip) 
		CommercialShip.Move(Utils.Random({ CruiserPoint0, CruiserPoint1, CruiserPoint2, CruiserPoint3, CruiserPoint4 }).Location)
		CommercialShip.Wait(Utils.RandomInteger(66, 99))
		CommercialShip.Move(Utils.Random({ CruiserPoint5, CruiserPoint6, CruiserPoint7, CruiserPoint8, CruiserPoint9 }).Location)
		CommercialShip.Wait(Utils.RandomInteger(66, 99))
		CommercialShip.Move(Utils.Random({ RandomEdgeWaterWaypoint5, RandomEdgeWaterWaypoint6, RandomEdgeWaterWaypoint7, RandomEdgeWaterWaypoint8 }).Location)
		CommercialShip.Destroy()
	end)
	local CommercialShipCargoType00 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi", "einstein", "clarkkent", "hacke6", "mech", "medi" })
	local CommercialShipCargoType01 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi", "hacke6", "mech", "medi" })
	local CommercialShipCargoType02 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi", "hacke6", "mech", "medi" })
	local CommercialShipCargoType03 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi", "hacke6" })
	local CommercialShipCargoType04 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi", "hacke6" })
	local CommercialShipCargoType05 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi", "hacke6" })
	local CommercialShipCargoType06 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi", "hacke6" })
	local CommercialShipCargoType07 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi" })
	local CommercialShipCargoType08 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi" })
	local CommercialShipCargoType09 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan", "delphi" })
	local CommercialShipCargoType10 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan" })
	local CommercialShipCargoType11 = Utils.Random({ "c" .. Utils.RandomInteger(1, 10), "chan" })
	local CommercialShipCargoType12 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType13 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType14 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType15 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType16 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType17 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType18 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType19 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType20 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType21 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType22 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType23 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType24 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType25 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType26 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType27 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType28 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargoType29 = "c" .. Utils.RandomInteger(1, 10)
	local CommercialShipCargo00 = CommercialShipCargoType00
	local CommercialShipCargo01 = CommercialShipCargoType01
	local CommercialShipCargo02 = CommercialShipCargoType02
	local CommercialShipCargo03 = CommercialShipCargoType03
	local CommercialShipCargo04 = CommercialShipCargoType04
	local CommercialShipCargo05 = CommercialShipCargoType05
	local CommercialShipCargo06 = CommercialShipCargoType06
	local CommercialShipCargo07 = CommercialShipCargoType07
	local CommercialShipCargo08 = CommercialShipCargoType08
	local CommercialShipCargo09 = CommercialShipCargoType09
	local CommercialShipCargo10 = CommercialShipCargoType10
	local CommercialShipCargo11 = CommercialShipCargoType11
	local CommercialShipCargo12 = CommercialShipCargoType12
	local CommercialShipCargo13 = CommercialShipCargoType13
	local CommercialShipCargo14 = CommercialShipCargoType14
	local CommercialShipCargo15 = CommercialShipCargoType15
	local CommercialShipCargo16 = CommercialShipCargoType16
	local CommercialShipCargo17 = CommercialShipCargoType17
	local CommercialShipCargo18 = CommercialShipCargoType18
	local CommercialShipCargo19 = CommercialShipCargoType19
	local CommercialShipCargo20 = CommercialShipCargoType20
	local CommercialShipCargo21 = CommercialShipCargoType21
	local CommercialShipCargo22 = CommercialShipCargoType22
	local CommercialShipCargo23 = CommercialShipCargoType23
	local CommercialShipCargo24 = CommercialShipCargoType24
	local CommercialShipCargo25 = CommercialShipCargoType25
	local CommercialShipCargo26 = CommercialShipCargoType26
	local CommercialShipCargo27 = CommercialShipCargoType27
	local CommercialShipCargo28 = CommercialShipCargoType28
	local CommercialShipCargo29 = CommercialShipCargoType29
	LoadTransport(CommercialShip, CommercialShipCargo00)
	LoadTransport(CommercialShip, CommercialShipCargo01)
	LoadTransport(CommercialShip, CommercialShipCargo02)
	LoadTransport(CommercialShip, CommercialShipCargo03)
	LoadTransport(CommercialShip, CommercialShipCargo04)
	LoadTransport(CommercialShip, CommercialShipCargo05)
	LoadTransport(CommercialShip, CommercialShipCargo06)
	LoadTransport(CommercialShip, CommercialShipCargo07)
	LoadTransport(CommercialShip, CommercialShipCargo08)
	LoadTransport(CommercialShip, CommercialShipCargo09)
	LoadTransport(CommercialShip, CommercialShipCargo10)
	LoadTransport(CommercialShip, CommercialShipCargo11)
	LoadTransport(CommercialShip, CommercialShipCargo12)
	LoadTransport(CommercialShip, CommercialShipCargo13)
	LoadTransport(CommercialShip, CommercialShipCargo14)
	LoadTransport(CommercialShip, CommercialShipCargo15)
	LoadTransport(CommercialShip, CommercialShipCargo16)
	LoadTransport(CommercialShip, CommercialShipCargo17)
	LoadTransport(CommercialShip, CommercialShipCargo18)
	LoadTransport(CommercialShip, CommercialShipCargo19)
	LoadTransport(CommercialShip, CommercialShipCargo20)
	LoadTransport(CommercialShip, CommercialShipCargo21)
	LoadTransport(CommercialShip, CommercialShipCargo22)
	LoadTransport(CommercialShip, CommercialShipCargo23)
	LoadTransport(CommercialShip, CommercialShipCargo24)
	LoadTransport(CommercialShip, CommercialShipCargo25)
	LoadTransport(CommercialShip, CommercialShipCargo26)
	LoadTransport(CommercialShip, CommercialShipCargo27)
	LoadTransport(CommercialShip, CommercialShipCargo28)
	LoadTransport(CommercialShip, CommercialShipCargo29)
	Trigger.OnRemovedFromWorld(CommercialShip, function()
		Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(33, 99)), function()
			SendCommercialShipsTroughMapC()
		end)
	end)
end
SendCommercialShipsTroughMapC = function()
	local RandomCountry = Utils.Random({ allies, england, france, germany, ussr, russia, ukraine, china })
	local RandomUpgradeType = Utils.Random({ "dollar.prefix", "speed.prefix", "earth.prefix", "empulse.prefix", "fpower.prefix", "gps.prefix" })
	local CommercialShip = Actor.Create(Utils.Random({ "lst", "hovertran" }), true, { Owner = RandomCountry, Location = Utils.Random({ RandomEdgeWaterWaypoint0, RandomEdgeWaterWaypoint1, RandomEdgeWaterWaypoint2, RandomEdgeWaterWaypoint3, RandomEdgeWaterWaypoint4 }).Location, Facing = Utils.RandomInteger(0, 255) })
	CommercialShip.GrantTimedUpgrade(RandomUpgradeType, Utils.RandomInteger(333, 666))
	CommercialShip.GrantUpgrade("nocontrol")
	Trigger.OnIdle(CommercialShip, function(CommercialShip) 
		CommercialShip.Move(Utils.Random({ CruiserPoint0, CruiserPoint1, CruiserPoint2, CruiserPoint3, CruiserPoint4, CruiserPoint5, CruiserPoint6, CruiserPoint7, CruiserPoint8, CruiserPoint9 }).Location)
		CommercialShip.Wait(Utils.RandomInteger(22, 33))
		CommercialShip.Move(Utils.Random({ RandomBeachWaypoint0, RandomBeachWaypoint1, RandomBeachWaypoint2, RandomBeachWaypoint3, RandomBeachWaypoint4, RandomBeachWaypoint5, RandomBeachWaypoint6, RandomBeachWaypoint7, RandomBeachWaypoint8 }).Location + CVec.New(1, 0))
		CommercialShip.UnloadPassengers()
		CommercialShip.Wait(Utils.RandomInteger(99, 111))
		CommercialShip.Move(Utils.Random({ RandomEdgeWaterWaypoint5, RandomEdgeWaterWaypoint6, RandomEdgeWaterWaypoint7, RandomEdgeWaterWaypoint8 }).Location)
		CommercialShip.Destroy()
	end)
	local CommercialShipCargoType0 = Utils.Random({ "1tnk", "2tnk", "3tnk", "4tnk", "apc.tower", "ftrk", "aatrk", "jeep", "jeep.recon", "arty", "v2rl", "stnk", "ctnk", "ttnk", "raytnk", "latnk", "vettnk", "ftnk", "totnk", "ntnk", "mechw" })
	local CommercialShipCargoType1 = Utils.Random({ "1tnk", "2tnk", "3tnk", "4tnk", "apc.tower", "ftrk", "aatrk", "jeep", "jeep.recon", "arty", "v2rl", "stnk", "ctnk", "ttnk", "raytnk", "latnk", "vettnk", "ftnk", "totnk", "ntnk", "mechw" })
	local CommercialShipCargo0 = CommercialShipCargoType0
	local CommercialShipCargo1 = CommercialShipCargoType1
	LoadTransport(CommercialShip, CommercialShipCargo0)
	LoadTransport(CommercialShip, CommercialShipCargo1)
	Trigger.OnRemovedFromWorld(CommercialShip, function()
		Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(33, 99)), function() 
			SendCommercialShipsTroughMapD()
		end)
	end)
end
SendCommercialShipsTroughMapD = function()
	local RandomCountry = Utils.Random({ allies, england, france, germany, ussr, russia, ukraine, china })
	local RandomUpgradeType = Utils.Random({ "dollar.prefix", "speed.prefix", "earth.prefix", "empulse.prefix", "fpower.prefix", "gps.prefix" })
	local CommercialShip = Actor.Create(Utils.Random({ "hovertran", "hovertran" }), true, { Owner = RandomCountry, Location = Utils.Random({ RandomEdgeWaterWaypoint0, RandomEdgeWaterWaypoint1, RandomEdgeWaterWaypoint2, RandomEdgeWaterWaypoint3, RandomEdgeWaterWaypoint4 }).Location, Facing = Utils.RandomInteger(0, 255) })
	CommercialShip.GrantTimedUpgrade(RandomUpgradeType, Utils.RandomInteger(333, 666))
	CommercialShip.GrantUpgrade("nocontrol")
	Trigger.OnIdle(CommercialShip, function(CommercialShip) 
		CommercialShip.Move(Utils.Random({ CruiserPoint0, CruiserPoint1, CruiserPoint2, CruiserPoint3, CruiserPoint4, CruiserPoint5, CruiserPoint6, CruiserPoint7, CruiserPoint8, CruiserPoint9 }).Location)
		CommercialShip.Wait(Utils.RandomInteger(22, 33))
		CommercialShip.Move(Utils.Random({ RandomBeachWaypoint0, RandomBeachWaypoint1, RandomBeachWaypoint2, RandomBeachWaypoint3, RandomBeachWaypoint4, RandomBeachWaypoint5, RandomBeachWaypoint6, RandomBeachWaypoint7, RandomBeachWaypoint8 }).Location + CVec.New(1, 0))
		CommercialShip.UnloadPassengers()
		CommercialShip.Scatter()
		CommercialShip.Wait(Utils.RandomInteger(22, 33))
		CommercialShip.Move(Utils.Random({ RandomEdgeWaterWaypoint5, RandomEdgeWaterWaypoint6, RandomEdgeWaterWaypoint7, RandomEdgeWaterWaypoint8 }).Location)
		CommercialShip.Destroy()
	end)
	local CommercialShipCargoType0 = Utils.Random({ "1tnk", "2tnk", "3tnk", "4tnk", "apc.tower", "ftrk", "aatrk", "jeep", "jeep.recon", "arty", "v2rl", "stnk", "ctnk", "ttnk", "raytnk", "latnk", "vettnk", "ftnk", "totnk", "ntnk", "mechw" })
	local CommercialShipCargoType1 = Utils.Random({ "1tnk", "2tnk", "3tnk", "4tnk", "apc.tower", "ftrk", "aatrk", "jeep", "jeep.recon", "arty", "v2rl", "stnk", "ctnk", "ttnk", "raytnk", "latnk", "vettnk", "ftnk", "totnk", "ntnk", "mechw" })
	local CommercialShipCargo0 = CommercialShipCargoType0
	local CommercialShipCargo1 = CommercialShipCargoType1
	LoadTransport(CommercialShip, CommercialShipCargo0)
	LoadTransport(CommercialShip, CommercialShipCargo1)
	Trigger.OnRemovedFromWorld(CommercialShip, function()
		Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(33, 99)), function() 
			SendCommercialShipsTroughMapA()
		end)
	end)
end
SendConvoyShips = function()
	ConvoyShipOnSite = false
	ConvoyShipUnharmed = false
	ConvoyShipscount = 0
	ConvoyShipsMaxcount = 0
	local RandomCountry = Utils.Random({ allies, england, france, germany })
	local ExitWayPoint = Actor.Create("waypoint", true, { Owner = neutral, Location = Utils.Random({ RandomEdgeWaterWaypoint5, RandomEdgeWaterWaypoint6, RandomEdgeWaterWaypoint7, RandomEdgeWaterWaypoint8 }).Location })
	if not ConvoyShipOnSite then
		ConvoyShipOnSite = true
		ticked = 0
		Media.PlaySpeechNotification((allies or england or france or germany), "ConvoyApproaching")
		Trigger.AfterDelay(DateTime.Seconds(3), function()
			ConvoyShipUnharmed = true
			local ships = Reinforcements.Reinforce(RandomCountry, { Utils.Random({ "pt", "dd", "battleship", "ca" }), Utils.Random({ "pt", "dd", "battleship", "ca" }), Utils.Random({ "pt", "dd", "battleship", "ca" }), Utils.Random({ "pt", "dd", "battleship", "ca" }), Utils.Random({ "pt", "dd", "battleship", "ca" }) }, { Utils.Random({ RandomEdgeWaterWaypoint0, RandomEdgeWaterWaypoint1, RandomEdgeWaterWaypoint2, RandomEdgeWaterWaypoint3, RandomEdgeWaterWaypoint4 }).Location, Utils.Random({ CruiserPoint0, CruiserPoint1, CruiserPoint2, CruiserPoint3, CruiserPoint4 }).Location }, DateTime.Seconds(Utils.RandomInteger(4.4, 6.6)),
				function(ship)
					Trigger.OnIdle(ship, function()
						ship.Stance = "AttackAnything"
						ship.GrantUpgrade("nocontrol")
						ship.GrantUpgrade("autocontrol")
						ship.GrantUpgrade("wandering")
						ship.Scatter()
						ship.AttackMove(Utils.Random({ CruiserPoint5, CruiserPoint6, CruiserPoint7, CruiserPoint8, CruiserPoint9 }).Location, 0)
						ship.Scatter()
						ship.AttackMove(ExitWayPoint.Location, 0)
					end)
					Trigger.OnAddedToWorld(ship, function()
						ConvoyShipsMaxcount = ConvoyShipsMaxcount + 1
					end)
				end)
			Trigger.OnEnteredFootprint( { ExitWayPoint.Location }, function(a, id)
				if a.Owner == RandomCountry and (a.Type == "pt" or a.Type == "dd" or a.Type == "battleship" or a.Type == "ca") then
					ConvoyShipscount = ConvoyShipscount + 1
					a.Destroy()
					if ConvoyShipscount == ConvoyShipsMaxcount then
						Trigger.RemoveFootprintTrigger(id)
					end
				end
			end)
			Trigger.OnAnyKilled(ships, ConvoyShipCasualites)
			Trigger.OnAllRemovedFromWorld(ships, ConvoyShipDeleted)
		end)
	end
end
ConvoyShipCasualites = function()
	Media.PlaySpeechNotification((allies or england or france or germany), "ConvoyUnitLost")
	ConvoyShipsMaxcount = ConvoyShipsMaxcount - 1
end
ConvoyShipDeleted = function()
	if ConvoyShipUnharmed then
		ConvoyShipUnharmed = false
		Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(66, 99)), function() 
			ConvoyShipOnSite = false
			SendConvoyShips()
		end)
	end
end
SendCounterNavalArmy = function()
	CounterNavalArmyOnSite = false
	CounterNavalArmyUnharmed = false
	CounterNavalArmycount = 0
	CounterNavalMaxArmycount = 0
	local RandomCountry = Utils.Random({ ussr, russia, ukraine, china })
	local ExitWayPoint = Actor.Create("waypoint", true, { Owner = neutral, Location = Utils.Random({ RandomEdgeWaterWaypoint5, RandomEdgeWaterWaypoint6, RandomEdgeWaterWaypoint7, RandomEdgeWaterWaypoint8 }).Location })
	if not CounterNavalArmyOnSite then
		CounterNavalArmyOnSite = true
		ticked = 0
		Media.PlaySpeechNotification((ussr or russia or ukraine or china), "ConvoyApproaching")
		Trigger.AfterDelay(DateTime.Seconds(3), function()
			CounterNavalArmyUnharmed = true
			local submarines = Reinforcements.Reinforce(RandomCountry, { Utils.Random({ "ss", "msub", "ss" }), Utils.Random({ "ss", "msub", "ss" }), Utils.Random({ "ss", "msub", "ss" }), Utils.Random({ "ss", "msub", "ss" }), Utils.Random({ "ss", "msub", "ss" }), Utils.Random({ "ss", "msub", "ss" }) }, { Utils.Random({ RandomEdgeWaterWaypoint0, RandomEdgeWaterWaypoint1, RandomEdgeWaterWaypoint2, RandomEdgeWaterWaypoint3, RandomEdgeWaterWaypoint4 }).Location, Utils.Random({ CruiserPoint5, CruiserPoint6, CruiserPoint7, CruiserPoint8, CruiserPoint9 }).Location }, DateTime.Seconds(Utils.RandomInteger(4.6, 8.2)),
				function(submarine)
					Trigger.OnIdle(submarine, function()
						submarine.Stance = "AttackAnything"
						submarine.GrantUpgrade("nocontrol")
						submarine.GrantUpgrade("autocontrol")
						submarine.GrantUpgrade("wandering")
						submarine.Scatter()
						submarine.AttackMove(Utils.Random({ CruiserPoint0, CruiserPoint1, CruiserPoint2, CruiserPoint3, CruiserPoint4 }).Location, 0)
						submarine.Scatter()
						submarine.AttackMove(ExitWayPoint.Location, 0)
					end)
					Trigger.OnAddedToWorld(submarine, function()
						CounterNavalMaxArmycount = CounterNavalMaxArmycount + 1
					end)
				end)
			Trigger.OnEnteredFootprint( { ExitWayPoint.Location }, function(a, id)
				if a.Owner == RandomCountry and (a.Type == "ss" or a.Type == "msub") then
					CounterNavalArmycount = CounterNavalArmycount + 1
					a.Destroy()
					if CounterNavalArmycount == CounterNavalMaxArmycount then
						Trigger.RemoveFootprintTrigger(id)
					end
				end
			end)
			Trigger.OnAnyKilled(submarines, CounterNavalArmyCasualites)
			Trigger.OnAllRemovedFromWorld(submarines, CounterNavalArmyDeleted)
		end)
	end
end
CounterNavalArmyCasualites = function()
	Media.PlaySpeechNotification((ussr or russia or ukraine or china), "ConvoyUnitLost")
	CounterNavalArmycount = CounterNavalArmycount - 1
end
CounterNavalArmyDeleted = function()
	if CounterNavalArmyUnharmed then
		CounterNavalArmyUnharmed = false
		Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(66, 99)), function()
			SendCounterNavalArmy()
			CounterNavalArmyOnSite = false
		end)
	end
end

