{
	debug_spam [1]

	saved_f1dead [0]
	saved_f2dead [0]
	saved_f3dead [0]
	saved_f4dead [0]
	saved_f5dead [0]
	saved_curFlakObj [0]
	saved_yourFlaksDestroyed [0]
	saved_FirstTime [0]
	saved_LoadLevel [0]
	saved_AtAttack_1 [0]
	saved_AtTheLine [0]
	saved_AtAmbush [0]
	saved_InsideOut [0]
	saved_RadioSwitch [0]
	saved_AlertMe [0]
	saved_Alerted [0]
	saved_RadioPlay [0]
	saved_Won [0]
	saved_AmbientSwitch[0]
	saved_NumObjectives [12]
	saved_CurObjective [0]

	AdvanceObjectives[ (hideLast)
	{
		if( saved_CurObjective < saved_NumObjectives )
		{
			NextObj = (saved_CurObjective+1);
			DropObj = (saved_CurObjective-2);

			ObjectiveComplete( saved_CurObjective );

			if( NextObj < saved_NumObjectives )
			{
				if( hideLast = 1 )
				{
					SetObjectiveActive( saved_CurObjective, false );
				}

				SetObjectiveActive( NextObj, true );

			if( saved_CurObjective > 1 )
				{
					SetObjectiveActive( NextObj, true );
					if( hideLast = 0 )
					{
						SetObjectiveActive( DropObj, false );
					}
				}
			}

			saved_CurObjective = NextObj;
		}
	}]

	Init[ ()
	{
		if(saved_FirstTime = 0)
		{

			saved_FirstTime = 1;
			SetCellBlocking( 100, 99 , 1);

			// Destroy AA Guns 1/5
			AddObjective( 170, 29568, 5376 );
			SetObjectiveActive ( 0, true );

			// Destroy AA Guns 2/5
			AddObjective( 171, 32874, 10432 );
			SetObjectiveActive ( 1, false );

			// Destroy AA Guns 3/5
			AddObjective( 172, 33920, 16256 );
			SetObjectiveActive ( 2, false );

			// Destroy AA Guns 4/5
			AddObjective( 173, 30592, 22144 );
			SetObjectiveActive ( 3, false );

			// Destroy AA Guns 5/5
			AddObjective( 174, 24426,28565 );
			SetObjectiveActive ( 4, false );

			// Destroy AA Guns
			AddObjective( 175, 0, 0 );
			SetObjectiveActive ( 5, false );

			// Plant Explosives 1/4
			AddObjective( 176, 12160, 19925 );
			SetObjectiveActive ( 6, true );

			// Plant Explosives 2/4
			AddObjective( 177, 12160, 21120 );
			SetObjectiveActive ( 7, false );

			// Plant Explosives 3/4
			AddObjective( 178, 13952, 21141 );
			SetObjectiveActive ( 8, false );

			// Plant Explosives 4/4
			AddObjective( 179, 13930, 20117 );
			SetObjectiveActive ( 9, false );

			// Plant Explosives
			AddObjective( 180, 0, 0 );
			SetObjectiveActive ( 10, false );

			// Find Capt. Price
			AddObjective( 181, 27733, 25984 );
			SetObjectiveActive ( 11, true );

			// Find Capt. Price
			AddObjective( 181, 0, 0 );
			SetObjectiveActive ( 12, false );

			GetEntity("Flak_1").SetUsable(0);
			GetEntity("Flak_2").SetUsable(0);
			GetEntity("Flak_3").SetUsable(0);
			GetEntity("Flak_4").SetUsable(0);
			GetEntity("Flak_5").SetUsable(0);
			
			me = GetPlayer();
			me.GiveWeapon(47, 5);
			me.GiveWeapon(53, 1);
			me.GiveWeapon(40, 3);
			me.GiveWeapon(46, 3);
			me.SetNationality(2);
			me.SetInvulnerable(0);

			hp1=GetEntity("health1");
			hp1.SetUsable(0);
			hp1.ShowEntity(0);
			
			hp2=GetEntity("health2");
			hp2.SetUsable(0);
			hp2.ShowEntity(0);
			
			hp3=GetEntity("health3");
			hp3.SetUsable(0);
			hp3.ShowEntity(0);
			
			hp4=GetEntity("health4");
			hp4.SetUsable(0);
			hp4.ShowEntity(0);
			
			AutoSave();
		}
	}]

	OnLevelLoad[ ()
	{	
		PlayAmbient(63);

		if(IsObjectiveComplete(10))
		{
			if(saved_Alerted=2)
			{
				if(saved_AlertMe=1)
				{
					alarmsound=GetPlayer();
					alarmsound.PlaySound(70,100,0,255);
				}	
			}	
		}
					
		if(saved_LoadLevel = 0)
		{
			saved_LoadLevel = 1;
			SetMessage("Eder Dam, Germany",75,35);
			SetMessage2(539,75,50);
			SetMessage3(512,75,65);
		}
	}]

	EnterZone[ (zone)
	{
		if(zone = "TheLine")
		{
			if( saved_AtTheLine = 0 )
			{
				saved_AtTheLine = 1;
				mg42er = GetEntity("harry");
				mg42er.GoForGun();
			}
		}
		if(zone = "Ambush")
		{
			if (saved_AtAmbush = 0)
			{
				saved_AtAmbush = 1;
				dieter = GetEntity("high1");
				fritz = GetEntity("high2");
				dieter.LockAndLoad();
				fritz.LockAndLoad2();
			}
		}
		if(zone = "victory_zone")
		{
			Log("### VICTORY ZONE ###");
			Log("### CurObj:  " # saved_CurObjective);

			if(IsObjectiveComplete(10) )
			{
				if(saved_Won = 0)
				{
					saved_Won = 1;
					vic = GetEntity("truck");
					vic.Delay(6,1);
					vic.PlaySound(67,90,1);
				}
			}
		}
		if(zone = "alert")
		{
			if(saved_CurObjective=11)
			{
				if(saved_Alerted=1)
				{
					saved_Alerted=2;
					alarmsound=GetPlayer();
					alarmsound.PlaySound(70,100,0,255);
				}
			}
		}
		if(zone = "pa_1")
		{
			if(saved_CurObjective = 11)
			{
				if(saved_AlertMe=0)
				{
					saved_Alerted=1;
					saved_AlertMe=1;
					speaker = GetEntity("hydro1");
					speaker.PlaySound(68,100,0);
				}
			}
		}
		if( zone="SB_On" )
		{
			ToggleSkybox(1);
		}
		if( zone="SB_Off" )
		{
			ToggleSkybox(0);
		}
	}]

	LivingDead[ ()
	{
		dude = GetEntity("bob");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob2");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob3");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob4");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob5");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob6");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob7");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob8");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob9");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob10");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob11");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob12");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob13");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob14");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob15");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob16");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob17");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob18");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob19");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob20");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob21");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob22");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob23");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob25");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob26");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("bob27");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("harry");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguard");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguard2");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguar2b");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguard3");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguar3b");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguard4");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguar4b");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguard5");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguar5b");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguard6");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("hguar6b");	if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("high1");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }
		dude = GetEntity("high2");		if (dude != null) { if (not dude.IsDead()) { dude.DropWeaponOnDeath(false); dude.Kill(); } }


		RGuard01 = GetEntity( "rgrd01" );
		RGuard01.SetPosition( 12672,12672,-195 );
		RGuard01.GoBrave();

		RGuard02 = GetEntity( "rgrd02" );
		RGuard02.SetPosition( 17536,8064,-1667 );
		RGuard02.GoBrave();

		RGuard03 = GetEntity( "rgrd03" );
		RGuard03.SetPosition( 8832,8576,-2595 );
		RGuard03.GoBrave();

		RGuard04 = GetEntity( "rgrd04" );
		RGuard04.SetPosition( 5504,17536,-707 );
		RGuard04.GoBrave();

		RGuard05 = GetEntity( "rgrd05" );
		RGuard05.SetPosition( 3968,17536,-707 );
		RGuard05.GoBrave();

		RGuard06 = GetEntity( "rgrd06" );
		RGuard06.SetPosition( 1152,21120,-2051 );
		RGuard06.GoBrave();

		RGuard07 = GetEntity( "rgrd07" );
		RGuard07.SetPosition( 4736,26496,-1475 );
		RGuard07.GoBrave();

		RGuard08 = GetEntity( "rgrd08" );
		RGuard08.SetPosition( 4736,36736,-2435 );
		RGuard08.GoBrave();

		RGuard09 = GetEntity( "rgrd09" );
		RGuard09.SetPosition( 3712,39040,-1475 );
		RGuard09.GoBrave();

		RGuard10 = GetEntity( "rgrd10" );
		RGuard10.SetPosition( 6528,43136,-1155 );
		RGuard10.GoBrave();

		RGuard11 = GetEntity( "rgrd11" );
		RGuard11.SetPosition( 12416,36992,-2435 );
		RGuard11.GoBrave();

		RGuard12 = GetEntity( "rgrd12" );
		RGuard12.SetPosition( 12416,34944,-1507 );
		RGuard12.GoBrave();

		RGuard13 = GetEntity( "rgrd13" );
		RGuard13.SetPosition( 16768,39552,-1475 );
		RGuard13.GoBrave();

		RGuard14 = GetEntity( "rgrd14" );
		RGuard14.SetPosition( 17024,46464,-3 );
		RGuard14.GoBrave();

		RGuard15 = GetEntity( "rgrd15" );
		RGuard15.SetPosition( 23168,45952,-387 );
		RGuard15.GoBrave();

		RGuard16 = GetEntity( "rgrd16" );
		RGuard16.SetPosition( 26752,42368,-387 );
		RGuard16.GoBrave();

		RGuard17 = GetEntity( "rgrd17" );
		RGuard17.SetPosition( 29056,41344,-387 );
		RGuard17.GoBrave();

		RGuard18 = GetEntity( "rgrd18" );
		RGuard18.SetPosition( 29824,36736,-131 );
		RGuard18.GoBrave();

		RGuard19 = GetEntity( "rgrd19" );
		RGuard19.SetPosition( 25216,32896,125);
		RGuard19.GoBrave();

		RGuard20 = GetEntity( "rgrd20" );
		RGuard20.SetPosition( 18304,31104,125 );
		RGuard20.GoBrave();

		RGuard21 = GetEntity( "rgrd21" );
		RGuard21.SetPosition( 21120,26496,253 );
		RGuard21.GoBrave();
		
		hp1=GetEntity("health1");
		hp1.SetUsable(1);
		hp1.ShowEntity(1);
		
		hp2=GetEntity("health2");
		hp2.SetUsable(1);
		hp2.ShowEntity(1);
		
		hp3=GetEntity("health3");
		hp3.SetUsable(1);
		hp3.ShowEntity(1);
		
		hp4=GetEntity("health4");
		hp4.SetUsable(1);
		hp4.ShowEntity(1);
	}]

	Spew[ (message)
	{
		if( debug_spam = 1 )
		{
			Log(message);
		}
	}]

}