global Map =
{
	Ammo_Cabinet_supply = "AMMOCAB_supply",
	Health_Cabinet_health = "HEALTHCAB_health",
	Checkpoint_flag = "CHECKPOINT_flag",
	Flag_jeep_gold = "FLAG_jeep_gold",
	Cappoint_374 = "CAPPOINT_374",
	Build_Command_Post = "BUILD_Command_Post",
	Build_Jeep = "BUILD_Jeep",
	Build_Jeep_Barrier = "BUILD_Jeep_Barrier",
	Build_Market_Gate = "BUILD_Market_Gate",
	Build_Ramp = "BUILD_Ramp",
	Build_Ramp_1 = "BUILD_Ramp_1",
	Plant_Command_Post = "PLANT_Command_Post",
	Plant_Jeep = "PLANT_Jeep",
	Plant_Jeep_Barrier = "PLANT_Jeep_Barrier",
	Plant_Market_Gate = "PLANT_Market_Gate",
	Plant_Ramp = "PLANT_Ramp",
	Plant_Ramp_1 = "PLANT_Ramp_1",
	Mount_miscmg = "MOUNTMG42_miscmg",
	Repair_miscmg = "REPAIRMG42_miscmg",

	Movers =
	{
		"MOVER_jeep_mover",
	},

	EscortVehicle =
	{
		Jeep =
		{
			Enabled = true,
			EscortVehicleGoalName = "MOVER_jeep_mover",
			LimitTeam = (1<<TEAM.ALLIES),
			Offset =
			{
				Vector3(0,-140,20),
			}
		},
	},

	BUILD_Command_Post_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"AMMOCAB_supply",
			"HEALTHCAB_health",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"AMMOCAB_supply",
			"HEALTHCAB_health",
		});

		print( "BUILD_Command_Post_Built" );
	},

	BUILD_Jeep_Built = function( trigger )
	{
		print( "BUILD_Jeep_Built" );
	},

	BUILD_Jeep_Barrier_Built = function( trigger )
	{
		print( "BUILD_Jeep_Barrier_Built" );
	},

	BUILD_Market_Gate_Built = function( trigger )
	{
		print( "BUILD_Market_Gate_Built" );
	},

	BUILD_Ramp_Built = function( trigger )
	{
		print( "BUILD_Ramp_Built" );
	},

	BUILD_Ramp_1_Built = function( trigger )
	{
		print( "BUILD_Ramp_1_Built" );
	},

	PLANT_Command_Post_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"AMMOCAB_supply",
			"HEALTHCAB_health",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"AMMOCAB_supply",
			"HEALTHCAB_health",
		});

		print( "PLANT_Command_Post_Destroyed" );
	},

	PLANT_Jeep_Destroyed = function( trigger )
	{
		print( "PLANT_Jeep_Destroyed" );
	},

	PLANT_Jeep_Barrier_Destroyed = function( trigger )
	{
		print( "PLANT_Jeep_Barrier_Destroyed" );
	},

	PLANT_Market_Gate_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_flag" );
		print( "PLANT_Market_Gate_Destroyed" );
	},

	PLANT_Ramp_Destroyed = function( trigger )
	{
		print( "PLANT_Ramp_Destroyed" );
	},

	PLANT_Ramp_1_Destroyed = function( trigger )
	{
		print( "PLANT_Ramp_1_Destroyed" );
	},

	FLAG_jeep_gold_Taken = function( trigger )
	{
		print( "FLAG_jeep_gold_Taken" );
	},

	GoldAccessible = function( trigger )
	{
		SetGoalPriority( "CHECKPOINT_flag", 0.5 );
		SetAvailableMapGoals(TEAM.ALLIES, false, {
			"BUILD_Ramp",
			"BUILD_Ramp_1",
		});
		SetAvailableMapGoals(TEAM.AXIS, false, {
			"PLANT_Jeep_Barrier",
			"BUILD_Jeep_Barrier",
			"PLANT_Ramp",
			"PLANT_Ramp_1",
		});
		Map.EscortVehicle.Jeep.Enabled = false;
		print( "GoldAccessible" );
	},

	GoldSecured = function( trigger )
	{
		Map.EscortVehicle.Jeep.Enabled = true;
		print( "GoldSecured" );
	},

};

global OnMapLoad = function()
{
	OnTrigger( "MISSING_STRING", Map.BUILD_Jeep_Built );
	OnTrigger( "MISSING_STRING", Map.BUILD_Jeep_Barrier_Built );
	OnTrigger( "MISSING_STRING", Map.BUILD_Market_Gate_Built );
	OnTrigger( "MISSING_STRING", Map.BUILD_Ramp_Built );
	OnTrigger( "MISSING_STRING", Map.BUILD_Ramp_1_Built );
	OnTrigger( "Axis Command Post destroyed!", Map.PLANT_Command_Post_Destroyed );
	OnTrigger( "Allied Command Post destroyed!", Map.PLANT_Command_Post_Destroyed );
	OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.BUILD_Command_Post_Built );
	OnTrigger( "Axis Command Post constructed. Charge speed increased!", Map.BUILD_Command_Post_Built );
	OnTrigger( "Market Gate destroyed!", Map.PLANT_Market_Gate_Destroyed );
	OnTrigger( "MISSING_STRING", Map.PLANT_Jeep_Destroyed );
	OnTrigger( "MISSING_STRING", Map.PLANT_Jeep_Barrier_Destroyed );
	OnTrigger( "MISSING_STRING", Map.PLANT_Ramp_Destroyed );
	OnTrigger( "MISSING_STRING", Map.PLANT_Ramp_1_Destroyed );
	OnTrigger( "MISSING_STRING", Map.FLAG_jeep_gold_Taken );
	OnTrigger( "goldrush_allies_gold_get", Map.GoldAccessible );
	OnTrigger( "goldrush_allies_gold2_secured", Map.GoldSecured );


	SetAvailableMapGoals( TEAM.ALLIES, false, {
		"CHECKPOINT_flag",
		"AMMOCAB_supply",
		"HEALTHCAB_health",
	});
	SetAvailableMapGoals( TEAM.AXIS, false, {
		"AMMOCAB_supply",
		"HEALTHCAB_health",
		"BUILD_Market_Gate",
		"PLANT_Jeep",
	});

	SetGoalPriority( "CHECKPOINT_flag", 0.7 );
	SetGoalPriority( "PLANT_Market_Gate", 0.91 );

	print( "OnMapLoad" );
};

global OnBotJoin = function( bot )
{
};
