#..\CommonDefines

Name #M17.Name
Objectives #M17.Objectives
Briefing #M17.Briefing
TimeOfDay 2

SpawnPos		-435000 -361000
TanksPos		-435000 -389000

Map
{
	# "" { Name #Map.Player Pos #SpawnPos Texture "Map\Plane.dds" Color #Colors.Player DrawLine "1" CanBeFocused "1" }
	# "" { Name #Map.EnemyTanks Pos #TanksPos Texture "Map\Tank.dds" Color #Colors.Enemy DrawLine "1" CanBeFocused "0" }
}

Events
{
	
	#..\CommonEvents
	
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	; Initialization

	_Init
	{
		Actions
		{
			# "SpawnPlayer" { SetupType "AirGround" Pos #SpawnPos Hdg "180" Alt "2500" Speed "300" }
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\Mig29" ObjectId "B" Count "5" Ordnance "AirToGround"
				Formation "" { ObjectsSpan "50" Type "LineAbreast" } 
				Pos "0 -100" { ObjectId "PlayerAirplane" } Hdg "0" Alt "2500" InitSpeed "300" Allegiance "Friendly" Level "1.0"
			}
			# "SetTarget" { ObjectId "B1" WingLeader "PlayerAirplane" }
			# "SetTarget" { ObjectId "B2" WingLeader "PlayerAirplane" }
			# "SetTarget" { ObjectId "B3" WingLeader "PlayerAirplane" }
			# "SetTarget" { ObjectId "B4" WingLeader "PlayerAirplane" }
			# "SetTarget" { ObjectId "B5" WingLeader "PlayerAirplane" }
			# "SpawnCars" 
			{ 
				ObjectId "TA" Pos #TanksPos Hdg "135" Count "8" Gun "1" Launcher "0" 
				Model "Abrams.info" Allegiance "Enemy" Type "Warcar"
				Formation "" { ObjectsSpan "500" Type "Random" } 
			}
			# "SpawnCars" 
			{ 
				ObjectId "TB" Pos #TanksPos Hdg "135" Count "1" Gun "1" Launcher "1" 
				Model "Humvee.info" Allegiance "Enemy" Type "Warcar"
				Formation "" { ObjectsSpan "500" Type "Random" } 
			}
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F16" ObjectId "A" Count "6" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "250" Type "LineAbreast" } 
				Pos #TanksPos Hdg "180" Alt "2000" InitSpeed "200" Allegiance "Enemy" Level "0.8"
			}
			# "SetTarget" { ObjectId "A1" Defend "TA1" }
			# "SetTarget" { ObjectId "A2" Defend "TA2" }
			# "SetTarget" { ObjectId "A3" Defend "TA3" }
			# "SetTarget" { ObjectId "A4" Defend "TA4" }
			# "SetTarget" { ObjectId "A5" Defend "TA5" }
			# "SetTarget" { ObjectId "A6" Defend "TA6" }
		}
	}	

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	; Main
	
	FirstMessage
	{
		Actions
		{
			# "VoiceMessage" { Text #M17.1 Sender "Tower"}
		}
		Condition "TimeFromStart" { Op "Greater" Value "5" }
	}

	EnemyDestroyed
	{
		Actions
		{
			# "VoiceMessage" { Text #M17.2 Sender "Tower"}
			# Succeed
		}
		Condition And
		{
			# "Succeed" { Negation "1" }
			# "Fail" { Negation "1" }
			# "CountEx" { NameRegEx "A(.*)|TA(.*)|TB(.*)" Op "Equal" Value "0" }
		}
	}

}
