#..\CommonDefines

Name #M08.Name
Objectives #M08.Objectives
Briefing #M08.Briefing
TimeOfDay 1

SpawnPos		#Bases.Base07.Pos
DefSpawnA		400 500
DefSpawnB		-800 -500
DefSpawnC		800 600
AttSpawnA		-20000 0
AttSpawnB		-21000 0
AttSpawnC		-15000 0
HelpSpawn		0 -20000

Map
{
	# "" { Name #Map.Player Pos #SpawnPos Texture "Map\Plane.dds" Color #Colors.Player DrawLine "1" CanBeFocused "1" }
}

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

	_Init
	{
		Actions
		{
			# "SpawnPlayer" { SetupType "Airbase" AirbaseId #Bases.Base07.Name RunwayName "R0" }
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F16" ObjectId "AttA" Count "6" Ordnance "AirToGround_NoAA"
				Formation "" { ObjectsSpan "100" Type "LineAbreast" } 
				Pos #AttSpawnA { ObjectId #Bases.Base07.Name } Hdg "270" Alt "3000" InitSpeed "300" Allegiance "Enemy" Level "0.5"
			}
			# "SpawnCars" 
			{ 
				ObjectId "DefA" Hdg "90" Count "2" Gun "1" Launcher "1" 
				Pos #DefSpawnA { ObjectId #Bases.Base07.Name }
				Model "Sa-9.info" Allegiance "Friendly" Type "Warcar"
				Formation "" { ObjectsSpan "100" Type "Random" } 
			}
			# "SpawnCars" 
			{ 
				ObjectId "DefB" Hdg "225" Count "6" Gun "1" Launcher "0" 
				Pos #DefSpawnB { ObjectId #Bases.Base07.Name }
				Model "T-72.info" Allegiance "Friendly" Type "Warcar"
				Formation "" { ObjectsSpan "500" Type "Random" } 
			}
			# "SpawnCars" 
			{ 
				ObjectId "DefC" Hdg "135" Count "6" Gun "1" Launcher "0" 
				Pos #DefSpawnB { ObjectId #Bases.Base07.Name }
				Model "T-72.info" Allegiance "Friendly" Type "Warcar"
				Formation "" { ObjectsSpan "500" Type "Random" } 
			}
		}
	}	

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	; Main
	
	FirstMessage
	{
		Actions
		{
			# "VoiceMessage" { Text #M08.1 Sender "Tower"}
		}
		Condition "TimeFromStart" { Op "Greater" Value "5" }
	}
	
	SecondWave
	{
		Actions
		{
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F16" ObjectId "AttB" Count "2" Ordnance "AirToGround"
				Formation "" { ObjectsSpan "100" Type "LineAbreast" } 
				Pos #AttSpawnB { ObjectId #Bases.Base07.Name } Hdg "270" Alt "5000" InitSpeed "300" Allegiance "Enemy" Level "0.5"
			}
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F14" ObjectId "AttC" Count "2" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "100" Type "LineAbreast" } 
				Pos #AttSpawnC { ObjectId #Bases.Base07.Name } Hdg "270" Alt "4000" InitSpeed "300" Allegiance "Enemy" Level "0.5"
			}
			# "VoiceMessage" { Text #M08.5 Sender "Tower"}
		}
		Condition "TimeFromStart" { Op "Greater" Value "90" }
	}
	
	Help
	{
		Actions
		{			
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\Mig29" ObjectId "Help" Count "4" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "50" Type "LineAbreast" } 
				Pos #AttSpawnC { ObjectId #Bases.Base07.Name } Hdg "0" Alt "6000" InitSpeed "400" Allegiance "Friendly" Level "0.8"
			}
			# "VoiceMessage" { Text #M08.4 Sender "Tower"}
		}
		Condition "TimeFromEvent" { EventName "SecondWave" Op "Greater" Value "45" }
	}

	BaseDestroyed
	{
		Actions
		{
			# "VoiceMessage" { Text #M08.2 Sender "Tower"}
			# "Fail"
		}
		Condition Count	
		{
			ClassName "class Obj::WarCar" Op "Less" Value "8"
		}
	}

	EnemyDestroyed
	{
		Actions
		{
			# "VoiceMessage" { Text #M08.3 Sender "Tower"}
			# "Succeed"
		}
		Condition And
		{
			# "Count" { ClassName "class Obj::Airplane" Allegiance "Enemy" Op "Equal" Value "2" }
			# "Event" { EventName "SecondWave" }
		}
	}

}
