#..\CommonDefines

Name #M07.Name
Objectives #M07.Objectives
Briefing #M07.Briefing
TimeOfDay 1

SpawnPos		-705000 -300000
BasePos			-576000 -308000
AAPos1			-605000 -308000
AAPos2			-595000 -308000
AAPos3			-585000 -308000
EnemySpawn1		-17000 22000
EnemySpawn2		-29000 0
EnemySpawn3		-17000 -28000
EnemySpawn4		30000 3000
EnemySpawn5		25000 7000
EnemySpawn6		25000 -7000

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

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

	_Init
	{
		Actions
		{
			# "SpawnPlayer" { SetupType "AirGround" Pos #SpawnPos Hdg "180" Alt "6000" Speed "250" }
			# "SpawnCars" 
			{ 
				ObjectId "AA1" Pos #AAPos1 Hdg "90" Count "15" Gun "1" Launcher "1" 
				Model "Sa-9.info" Allegiance "Friendly" Type "Warcar"
				Formation "" { ObjectsSpan "1000" Type "LineAbreast" } 
			}
			# "SpawnCars" 
			{ 
				ObjectId "AA2" Pos #AAPos2 Hdg "90" Count "15" Gun "1" Launcher "1" 
				Model "Sa-9.info" Allegiance "Friendly" Type "Warcar"
				Formation "" { ObjectsSpan "750" Type "LineAbreast" } 
			}
			# "SpawnCars" 
			{ 
				ObjectId "AA3" Pos #AAPos3 Hdg "90" Count "15" Gun "1" Launcher "1" 
				Model "Sa-9.info" Allegiance "Friendly" Type "Warcar"
				Formation "" { ObjectsSpan "500" Type "LineAbreast" } 
			}
		}
	}	

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	; Main
	
	SpawnEnemy
	{
		Actions
		{
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F16" ObjectId "A" Count "4" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "2000" Type "LineAbreast" } 
				Pos #EnemySpawn1 { ObjectId "PlayerAirplane" }	Hdg "225" Alt "8000" InitSpeed "450" Allegiance "Enemy" Level "0.8"
			}
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F14" ObjectId "B" Count "4" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "2000" Type "LineAbreast" } 
				Pos #EnemySpawn2 { ObjectId "PlayerAirplane" }	Hdg "270" Alt "6000" InitSpeed "450" Allegiance "Enemy" Level "0.9"
			}
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F16" ObjectId "C" Count "4" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "2000" Type "LineAbreast" } 
				Pos #EnemySpawn3 { ObjectId "PlayerAirplane" }	Hdg "315" Alt "9000" InitSpeed "450" Allegiance "Enemy" Level "0.7"
			}
		}
		Condition "TimeFromStart" { Op "Greater" Value "8" }
	}	
	
	WhatsThat
	{
		Actions
		{
			# "VoiceMessage" { Text #M07.1 Sender "Player"}
			# "VoiceMessage" { Text #M07.2 Sender "Player"}
			# "VoiceMessage" { Text #M07.3 Sender "Player"}
			# "VoiceMessage" { Text #M07.4 Sender "Player"}
		}
		Condition "TimeFromEvent" { EventName "SpawnEnemy" Op "Greater" Value "3" }
	}
	
	Withdraw
	{
		Actions
		{
			# "VoiceMessage" { Text #M07.5 Sender "Tower"}
			# "VoiceMessage" { Text #M07.6 Sender "Tower"}
			# "AddNavpoint" { Index "0" Name #Map.Nav1 Pos #BasePos }
			# "ActivateNavpoint" { Index "0" }
		}
		Condition And
		{
			# "AnnouncerEmpty"
			# "Event" { EventName "WhatsThat" }
		}
	}
	
	SpawnMoreEnemy1
	{
		Actions
		{
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F16" ObjectId "D" Count "3" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "4000" Type "LineAhead" } 
				Pos #EnemySpawn4 { ObjectId "PlayerAirplane" }	Hdg "90" Alt "8000" InitSpeed "300" Allegiance "Enemy" Level "0.8"
			}
			# "VoiceMessage" { Text #M07.7 Sender "Player"}
			# "VoiceMessage" { Text #M07.8 Sender "Tower"}
			# "VoiceMessage" { Text #M07.9 Sender "Tower"}
		}
		Condition "TimeFromEvent" { EventName "Withdraw" Op "Greater" Value "35" }
	}
	
	SpawnMoreEnemy2
	{
		Actions
		{
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F16" ObjectId "E" Count "2" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "5000" Type "LineAhead" } 
				Pos #EnemySpawn5 { ObjectId "PlayerAirplane" }	Hdg "90" Alt "7000" InitSpeed "300" Allegiance "Enemy" Level "0.9"
			}
		}
		Condition "TimeFromEvent" { EventName "SpawnMoreEnemy1" Op "Greater" Value "30" }
	}

	SpawnMoreEnemy3
	{
		Actions
		{
			# "SpawnAirplanes" 
			{ 
				Model "Airplanes\F16" ObjectId "F" Count "2" Ordnance "AirToAir"
				Formation "" { ObjectsSpan "6000" Type "LineAhead" } 
				Pos #EnemySpawn5 { ObjectId "PlayerAirplane" }	Hdg "90" Alt "5000" InitSpeed "300" Allegiance "Enemy" Level "0.9"
			}
		}
		Condition "TimeFromEvent" { EventName "SpawnMoreEnemy2" Op "Greater" Value "30" }
	}
	
	ReachingSafety
	{
		Actions
		{
			# "VoiceMessage" { Text #M07.10 Sender "Tower"}
		}
		Condition And
		{
			# "Range" { ObjectId "PlayerAirplane" Pos #BasePos Op "Less" Value "50000" }
		}
	}

	Safe
	{
		Actions
		{
			# "VoiceMessage" { Text #M07.11 Sender "Tower"}
			# "VoiceMessage" { Text #M07.12 Sender "Tower"}
			# Succeed
		}
		Condition And
		{
			# "Range" { ObjectId "PlayerAirplane" Pos #BasePos Op "Less" Value "5000" }
		}
	}

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	; Errors checks

}
