{
	saved_FirstTime[0]

	Init[ ()
	{
		if(saved_FirstTime=0)
		{
			saved_FirstTime=1;
			SetNationality(0);
			SetInvulnerable(1);

			GiveWeapon(43);
			PlayAnimation(7);

			SetAttackDistance(15,15);
			SetState_Patrol(0);
			SetLineOfSight(1);

			SetWalkToDist(10);
			SetWander(0);
		}

	}]

	DelayReached[(delay)
	{

		if (delay = 5)
		{
			Level.GetPlayer().PlaySound(142);
			Delay(5,10);
		}

		if (delay = 10)
		{
			GetPlayer().SetFrozen(false);
			NextPath(1);
		}

		if (delay = 20)
		{
			Level.GetPlayer().PlaySound(141);
			Delay(3,25);
		}

		if (delay = 25)
		{
//			Level.AdvanceObjectives(0);
			Level.ObjectiveComplete(4);
			Delay(3,35);
		}

		if (delay = 35)
		{
			Level.Victory();
			Delay(8,40);
		}

		if (delay = 40)
		{
			Level.LoadLevel("S_AMM4_Bunkers");
		}
	}]

	NextPath[(num)
	{
		if (num = 1)
		{
			FollowPath("moody1");
			FollowPathCallback(4,"SetState_Idle");
			FollowPathCallback(127,"EndNode",5,8025,10252);

		}

		if (num = 2)
		{
			PlayAnimation(7);
			SetRunning();
			FollowPath("moody2");
			FollowPathCallback(1,"SetState_Idle");
			FollowPathCallback(127,"EndNode",10);
		}

		if (num = 3)
		{
			PlayAnimation(7);
			SetRunning();
			FollowPath("moody3");
			FollowPathCallback(0,"SetState_Idle");
			FollowPathCallback(4,"GoPatrol");
			FollowPathCallback(127,"EndNode",10);
		}

		if (num = 4)
		{
			PlayAnimation(7);
			SetRunning();
			FollowPath("moody4");
			FollowPathCallback(0,"SetState_Idle");
			FollowPathCallback(6,"GoPatrol");
			FollowPathCallback(127,"EndNode",5,7756,26483);
		}

		if (num = 5)
		{
			PlayAnimation(7);
			SetRunning();
			FollowPath("moody5");
			FollowPathCallback(0,"GoPatrol");
			FollowPathCallback(4,"SetState_Idle");
			FollowPathCallback(127,"EndNode",5,12889,32115);
		}

		if (num = 6)
		{
			PlayAnimation(7);
			SetRunning();
			FollowPath("moody6");
//			FollowPathCallback(0,"SetState_Idle");
			FollowPathCallback(0,"GoPatrol");
			FollowPathCallback(127,"EndNode",5,23680,24563);
		}
		
		if (num = 7)
		{
			PlayAnimation(7);
			SetRunning();
			FollowPath("final5");
			FollowPathCallback(0,"SetState_Idle");
			FollowPathCallback(127,"EndNode",5,26660,21595);
		}
	}]

	EndNode[(type,xpos,ypos)
	{
		if (type = 5)
		{
			PlayAnimation(11);
			SetCrouching();
			GoPatrol();
			TurnToLocation(xpos,ypos);
		}

		if (type = 10)
		{
			PlayAnimation(7);
			SetRunning();
			GoPatrol();
		}

	}]

	GoPatrol[()
	{
		SetAttackDistance(15,15);
		SetState_Patrol(0);
		SetLineOfSight(1);

		SetWalkToDist(10);
		SetWander(0);
	}]

}