{
	saved_FirstTime [0]
	saved_levelloaded [0]

	saved_In_trigger_1 [0]
	saved_In_trigger_2 [0]
	saved_In_trigger_3 [0]
	saved_stopkillzone [0]
	saved_EnableKillzone [0]
	saved_EnableWarpzone [0]
	saved_Enablewavezone [0]
	saved_Enableinstructzone [0]
	saved_Enable_BombsAway [0]
	saved_Enable_Tankzone [1]
	saved_Enable_battlestart [0]
	saved_Enable_PakInstruct [0]
	saved_instruct_done [0]

	saved_NumObjectives [6]
	saved_CurObjective [0]

	saved_Wave1Toll [0]
	saved_Wave1Max [3]

	saved_PakWaveToll [0]
	saved_PakWavMax [3]

	saved_FinalWaveToll [1]
	saved_FinalWaveMax [3]

	saved_TankToll [0]


	AdvanceObjectives[ (hideLast)
	{
		Log ("--> AdvanceObjectives() ");
		if( saved_CurObjective < saved_NumObjectives )
		{
			Log ("Break	1");
			NextObj = (saved_CurObjective+1);
			Log ("	 CurrentObjective: " # saved_CurObjective);
			Log ("	 NextObjective: " # NextObj);
			DropObj = (saved_CurObjective-2);

			ObjectiveComplete( saved_CurObjective );

			if( NextObj < saved_NumObjectives )
			{
				Log ("Break	2");
				if( hideLast = 1 )
				{
					Log ("Break	3");
					SetObjectiveActive( saved_CurObjective, false );
				}

				SetObjectiveActive( NextObj, true );

				if( Level.saved_CurObjective > 1 )
				{
					Log ("Break	4");
					Level.SetObjectiveActive( NextObj, true );
					if( hideLast = 0 )
					{
						Log ("Break	4");
						Level.SetObjectiveActive( DropObj, false );
					}
				}
			}
			saved_CurObjective = NextObj;
		}
	}]

	CheckDead[ ()
	{
		Log ("-->CheckDead - Sgt is Telling you he Cant.");
		saved_Wave1Toll = toInt(saved_Wave1Toll);
		saved_Wave1Max = toInt(saved_Wave1Max);

		if (saved_Wave1Toll > (saved_Wave1Max-1))
		{
			saved_stopkillzone = 1;
			Bucky = GetEntity("Sgt");
			Bucky.GiveInstructions(2);
		}
		else
		{
			return;
		}
	}]

	CheckDead2[ ()
	{
		Log ("--> CheckDead2 - Am I am being called, Why!?");
		saved_PakWaveToll = toInt(saved_PakWaveToll);
		saved_PakWavMax = toInt(saved_PakWavMax);

		if (saved_PakWaveToll > (saved_PakWavMax-1))
		{
			bob = GetEntity ("Sgt");
			bob.DoSummon();
			AdvanceObjectives(0);
			saved_EnableWarpzone = 1;
		}
		else
		{
			return;
		}
	}]

	CheckDead3[ ()
	{
		Log ("--> CheckDead3 ");
		saved_Wave1Toll = toInt(saved_Wave1Toll);
		saved_Wave1Max = toInt(saved_Wave1Max);

		if (saved_Wave1Toll > (saved_Wave1Max-1))
		{
			cleetus = GetEntity("shooter");
			cleetus.DoIdle();
		}
		else
		{
			Log ("saved_Wave1Toll:  " # saved_Wave1Toll);
			Log ("saved_Wave1Max:  " # saved_Wave1Max);
			return;
		}
	}]

	CheckDead4[ ()
	{
		Log ("--> CheckDead4()");
		if (saved_TankToll <2)
		{
			Log ("###  saved_TankToll is still less than 2. i am not doing shit.");
			return;
		}
		if (saved_TankToll >1)
		{
			Log("## saved_TankToll is greater than 1. Getting last wave now.");


			AdvanceObjectives(0);
			oin = GetEntity("oin");
			gloin = GetEntity("gloin");
			nori = GetEntity("nori");
			dori = GetEntity("dori");
			Log ("### Got Everyone, everyone good.");
			oin.GoPatrol();
			oin.ShowMe();
			gloin.GoPatrol();
			gloin.ShowMe();
			nori.GoPatrol();
			nori.ShowMe();
			dori.GoPatrol();
			dori.ShowMe();

		}
		Log ("I am finished checking Dead4 dave.");
	}]

	CheckDead5[ ()
	{
		Log ("--> CheckDead2 - Am I am being called, Why!?");
		saved_FinalWaveToll = toInt(saved_FinalWaveToll);
		saved_FinalWaveMax = toInt(saved_FinalWaveMax);


		if (saved_FinalWaveToll > (saved_FinalWaveMax-1))
		{
			bob = GetEntity("Sgt");
			bob.DoVictory();
			AdvanceObjectives(0);
			//JEFF ADDED, NEXT LEVEL DELAY
		}
		else
		{
			return;
		}
	}]

	Init[ ()
	{
		PANZFST = GetEntity("PANZFST");
		PANZFST.MakeInfinitePickup();

		me = GetPlayer();
		me.SetInvulnerable(false);

		if (saved_FirstTime = 0)
		{
			saved_FirstTime = 1;

			AddObjective( 127, 26909, 16686 );
			SetObjectiveActive(0, true);

			AddObjective( 128, 6832, 10384 );
			SetObjectiveActive(1, false);

			AddObjective( 129, 15964, 30054 );
			SetObjectiveActive(2, false);

			AddObjective( 130, 22003, 21469 );
			SetObjectiveActive(3, false);

			AddObjective( 131, 22003, 21469 );
			SetObjectiveActive(4, false);

			AddObjective( 132, 23566, 22229 );
			SetObjectiveActive(5, false);

			me.SetNationality(0);
			me.GiveWeapon(41, 5); // M1 Garand
			me.GiveWeapon(43, 7); // Thompson
			me.GiveWeapon(40, 5); // Colt45
			me.GiveWeapon(42, 5); // M2 Frag Grenade
			me.SetRunning();
			me.SetFrozen (1);

			AutoSave();
		}


	}]

	OnLevelLoad[()
	{
		Level.Log("--> Onlevelload");
		PlayAmbient (23);

		if(saved_levelloaded = 0)
		{
			Level.Log("level loaded = 0");
			saved_levelloaded = 1;

			honky = GetEntity("Sgt");
			cleetus = GetEntity("shooter");
			honky.GiveInstructions(1);
			cleetus.Wait();

			SetMessage(126,75,35);
			SetMessage2(534,75,50);
			SetMessage3(504,75,65);
		}
	}]

	EnterZone[  (zone)
	{
		germ1 = GetEntity("gerry1");
		germ2 = GetEntity("gerry2");
		germ3 = GetEntity("gerry3");
		ameri1 = GetEntity("ameri1");
		ameri2 = GetEntity("ameri2");
		Tank1 = GetEntity ("Tank1");
		Tank2 = GetEntity ("Tank2");

		if (zone = "trigger_1")
		{
			if (saved_In_trigger_1 = 0)
			{
				saved_In_trigger_1 = 1;

				Boba = GetEntity ("wave1a");
				Bobb = GetEntity ("wave1b");
				Bobc = GetEntity ("wave1c");
				Boba.GoPatrol ();
				Bobb.GoPatrol ();
				Bobc.GoPatrol ();
				saved_EnableKillzone = 1;
			}
		}
		if (zone = "trigger_3")
		{
			if (saved_In_trigger_3 = 0)
			{
				saved_In_trigger_3 = 1;

				Boba = GetEntity ("PakA");
				Bobb = GetEntity ("PakB");
				Bobc = GetEntity ("PakC");
				Boba.GoPath (0);
				Bobb.GoFiddle ();
				Bobc.GoFiddle ();
			}
		}
		if (zone = "Warpzone")
		{
			if (saved_EnableWarpzone = 0)
			{
				return;
			}
			else
			{
				honky = GetEntity ("Sgt");
				cleetus = GetEntity ("shooter");
				cleetus.DoTanks1 ();
				honky.DoTanks ();
				saved_Enablewavezone = 1;
				saved_EnableWarpzone = 0;
			}
		}
		if (zone = "wavezone")
		{
			if (saved_Enablewavezone = 0)
			{
				return;
			}
			else
			{
				honky = GetEntity ("Sgt");
				honky.DoWave();
				saved_Enablewavezone = 0;
				saved_Enableinstructzone = 1;
			}
		}
		if (zone = "instructzone")
		{
			if (saved_Enableinstructzone = 0)
			{
				return;
			}
			else
			{
				GetPlayer ().SetFrozen (1);
				honky = GetEntity ("Sgt");
				honky.DoFaust();
				saved_Enableinstructzone = 0;
				if (saved_Enable_Tankzone = 1)
				{
					Log ("#### Tankzone is 1");
					Tank1.ShowMe();
					Tank2.ShowMe();
					Tank1.WalkTo(24448, 25164, 10, 1);
					Tank2.Delay(8, 10);

				}
			}
		}
		if (zone = "BombsAway")
		{
			if (saved_Enable_BombsAway = 1)
			{
				sgt = GetEntity("Sgt");
				sgt.Delay(0, 40);
			}
		}
		if (zone = "NoBomb")
		{
			saved_Enable_BombsAway = 0;
		}
		if (zone = "Killzone")
		{
			Log("Killzone");
			saved_EnableKillzone = 1;

			if(saved_stopkillzone = 0)
			{
				Log("Nothing stopping the player from being killed");
				GetEntity("Sgt").Delay(0, 150);
				GetEntity("PakA").Delay(1 ,20);
				Log("Fuck Life");
			}
			else
			{
				return;
			}
		}
		if (zone = "NoKillzone")
		{
			saved_EnableKillzone = 0;
			GetEntity("PakA").saved_deathcount = 0;
		}
		if (zone = "battlestart")
		{
			if(saved_Enable_battlestart = 0)
			{
				saved_Enable_battlestart = 1;

				ameri1.SetInvulnerable(true);
				ameri2.SetInvulnerable(true);
				germ1.SetInvulnerable(true);
				germ2.SetInvulnerable(true);
				germ3.SetInvulnerable(true);
				ameri1.BattleStart();
				ameri2.BattleStart();
				germ1.BattleStart();
				germ2.BattleStart();
				germ3.BattleStart();
			}
		}
		if (zone = "battlelethal")
		{
			ameri2.SetInvulnerable(false);
			germ1.SetInvulnerable(false);
			germ2.SetInvulnerable(false);
			germ3.SetInvulnerable(false);
		}
		if (zone = "pakinstructon")
		{
			if(saved_instruct_done = 0)
			{
				saved_Enable_PakInstruct = 1;
			}
		}
		if (zone = "pakinstructoff")
		{
			if(saved_instruct_done = 0)
			{
				saved_Enable_PakInstruct = 0;
			}
		}
		if (zone = "standup")
		{
			Level.GetEntity("croucha").StandUp();
			Level.GetEntity("crouchb").StandUp();
			Level.GetEntity("crouchc").StandUp();
			Level.GetEntity("crouchd").StandUp();
			Level.GetEntity("crouche").StandUp();
			Level.GetEntity("crouchf").StandUp();
			// Level.GetEntity("crouchg").StandUp();
			Level.GetEntity("crouchh").StandUp();
			Level.GetEntity("crouchi").StandUp();
		}
	}]

	ActorKilled[ (who)
	{
		germ1 = GetEntity("gerry1");
		germ2 = GetEntity("gerry2");
		germ3 = GetEntity("gerry3");
		germ4 = GetEntity("gerry4");
		germ5 = GetEntity("gerry5");

		if (who = "Tank1")
		{
			saved_TankToll = (saved_TankToll+1);
			CheckDead4();
			GetEntity("Tank1").Delay(4, 100);
		}
		if (who = "Tank2")
		{
			saved_TankToll = (saved_TankToll+1);
			CheckDead4();
			GetEntity("Tank2").Delay(4, 100);
		}
		if (who = "gerry1")
		{
			germ4.BattleStart();
		}
		if (who = "gerry2")
		{
			germ5.BattleStart();
		}
		if (who = "gerry5")
		{
			if ((saved_Enable_PakInstruct = 1) and (germ1.IsDead()) and (germ2.IsDead()) and (germ3.IsDead()) and (germ4.IsDead()) and (germ5.IsDead()))
			{
				GetEntity("ameri1").Delay(3, 150);
			}
			else
			{
				GetEntity("ameri1").CheckDelay();
			}
		}
	}]
}