-----------------------------------------------------------------------------
-- Stage 2-1
----------------------------------------------------------------    

function PostStage()

    EntGame.EnablePlayerControl(false);
    EntGame.ClearFlag(GF_READYTOSTART);
    EntGame.BindCameraToEntity("IntroCamera");
    
    Sound.Release(smpJeepAcceleration);
--	Sound.Release(smpJeepIdle);
	Sound.Release(smpJeepOff);
	Sound.Release(smpJeepHorn);
	Sound.Release(smpPlaneFlyBy);
	Sound.Release(smpPlaneDistant);
	
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 0, ST_GRAZING, 20000,5,1.5,.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 1, ST_GRAZING, 20000,6,3,.2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 2, ST_GRAZING, 20000,0,0,.4);	
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 3, ST_GRAZING, 20000,0,0,.4);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 4, ST_GRAZING, 20000,0,0,.4);	
		
	Camera.SetSpeed(entCamera, 0.0, 0.1); --Vehicle stops	
    
    end;    
    
-----------------------------------------------------------------------------    
-- Setup

function Setup()
    -- turn on the "Game running" menu - may not be needed for this game
    EntGame.PushMenu("MenuGameRunning");

	-- load world
	SetupWorld("Maps\\WorldDryForest\\DryForestCommon.ini", "Maps\\Stage2-1\\Stage2-1.ini","","");
	EntGame.CreatePlayerEntities();

    EntGame.SetGlobalDustColorInitial(1.0, 0.65, .58, .45);
    EntGame.SetGlobalDustColorFinal  (0.0, 0.65, .58, .45);
    
    EntGame.SetStageTimer(210);

    -- load sounds
    smpJeepAcceleration  = Sound.Load("Sound\\Environment\\JeepAcceleration.wav");
--    smpJeepIdle    		 = Sound.Load("Sound\\Environment\\JeepIdle1.wav");       
	smpJeepOff 			 = Sound.Load("Sound\\Environment\\JeepOff.wav");     
	smpJeepHorn			 = Sound.Load("Sound\\Environment\\JeepHorn.wav");
	smpPlaneFlyBy		 = Sound.Load("Sound\\Environment\\PlaneFlyBy.wav");
	smpPlaneDistant		 = Sound.Load("Sound\\Environment\\PlaneDistant.wav");
	
    EntGame.LoadAnimal(AID_IMPALA_M);
	EntGame.LoadAnimal(AID_IMPALA_F);	
	EntGame.LoadAnimal(AID_MEERKAT_M);
	
    animala=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 0, ST_GRAZING, 20000,5,1.5,.1);
	animalb=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 1, ST_GRAZING, 20000,6,3,.2);
	animalc=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 2, ST_GRAZING, 20000,0,0,.4);
	animald=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 3, ST_GRAZING, 20000,0,0,.4);
	animale=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath5", 4, ST_GRAZING, 20000,0,0,.4);
		      	
	StartupSequence("Music\\Visibly Shaken Underscore.ogg");
	
	-- Get pointer to camera that plane is following.
	entPlaneCamera = Entity.FindName(entRoot, "PlaneCamera");
	if (entPlaneCamera) then
	    Camera.JumpToWaypoint(entPlaneCamera, "PlaneWptAA");
	    end;
	    
	EntGame.DestroyAllAnimals();
	   
    end;

-----------------------------------------------------------------------------

function Part1()

	--Start Engine (3 seconds)
	Sound.Play(smpJeepAcceleration, 1, DS2_VOLMAX, DS2_CENTER);
	
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path10", 0, ST_WPT_RUN, 0,0,0,.4);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path10", 0, ST_WPT_RUN, 0,5,5,.4);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path10", 0, ST_WPT_RUN, 0,-5,-5,.4);
	
	--Above are intro animals. Below are waiting for passing Jeep.
	
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path1", 0, ST_WPT_RUN, 0,0,0,.01);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path2", 0, ST_WPT_RUN, 0,0,-3,.01);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path3", 0, ST_WPT_RUN, 0,0,0,.01);
	a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_GRAZING, 7,0,2,.05);
	Animal.EnableFear(a, false);
	b=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path2", 0, ST_GRAZING, 6,0,2,.02);
	Animal.EnableFear(b, false);
	c=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path3", 0, ST_GRAZING, 8,0,0,.01);
	Animal.EnableFear(c, false);

	EntGame.EnablePlayerControl(FALSE); --DEACTIVATE PLAYER
	Camera.JumpToWaypoint(entCamera, "CamWptAA");
    Camera.SetSpeed(entCamera, 6.0, 0.1);
	Camera.StopAtWaypoint(entCamera, "CamWptGG");
	
	Script.WaitSec(2.0);
	
    Camera.SetPanOffset(entCamera, -80, 1); -- pan left (See Hunter Dan)
   
    Script.WaitSec(2.5);
	
    Camera.SetPanOffset(entCamera, 85, 2); --Pan Right to shoot
    EntGame.EnablePlayerControl(TRUE); --ACTIVATE PLAYER   
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_WPT_RUN, 0,0,1,.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path2", 0, ST_WPT_RUN, 0,0,-3,.4);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path3", 0, ST_WPT_RUN, 0,0,0,.3);   
	
    Script.WaitSec(1.65);    

    --Plane Passing
	Sound.Play(smpPlaneFlyBy, 1, 1, DS2_CENTER);
		
	Script.WaitSec(3); 
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_WPT_RUN, 0,0,5,1.95);
	Script.WaitSec(.35);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path1", 0, ST_WPT_RUN, 0,0,1,1.95);
    Script.WaitSec(.2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_WPT_RUN, 0,0,-2,2);
    Script.WaitSec(.8);
    	
    Camera.SetPanOffset(entCamera, 60, 1.5); --Glance Left
 	
    Script.WaitSec(3);
    	
    Camera.SetPanOffset(entCamera, 80, 2); --Pan Right to shoot
   
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path4", 0, ST_WPT_WALK, 1,4.5,2,.4);
    Animal.EnableFear(a, false);
    Entity.SetName(a, "Walk1");
	b=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path5", 0, ST_WPT_WALK, 1,2,7,.5);
	Animal.EnableFear(b, false);
	Entity.SetName(b, "Walk2");
	c=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path6", 0, ST_WPT_WALK, 1,6,6,.1); 
	Animal.EnableFear(c, false);
	Entity.SetName(c, "Walk3");
	Script.WaitSec(4); 	
	d=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path5", 0, ST_WPT_WALK, 1,3,0,.3);
	Animal.EnableFear(d, false); 
	Entity.SetName(d, "Walk4");
	Script.WaitSec(4); 	
    Camera.SetPanOffset(entCamera, 0, 1.5); --Look forward again.
	Script.WaitSec(3);
    Camera.SetPanOffset(entCamera, -80, 1.5); --Look Left
    
    Camera.SetHeightOffset(entCamera, .5, 1.5); --PLAYER STANDS UP
    
    Script.WaitSec(3.0);
    
    --Plane Passing
	Sound.Play(smpPlaneFlyBy, 1, .6, DS2_CENTER);
	
    Script.WaitSec(3);
    	
    --Jeep Ignition off	
    Sound.Play(smpJeepOff, 1, DS2_VOLMAX, DS2_CENTER);
    	
    a = Entity.FindName(entRoot, "Walk1");
	if (a) then
    	Animal.SetState(a, ST_WPT_RUN);
    	Animal.EnableFear(a, false);
    	end;
    c = Entity.FindName(entRoot, "Walk3");
	if (c) then
    	Animal.SetState(c, ST_WPT_RUN);
    	Animal.EnableFear(c, false);
    	end;
    d = Entity.FindName(entRoot, "Walk4");
	if (d) then
    	Animal.SetState(d, ST_WPT_RUN);
    	Animal.EnableFear(d, false);
    	end;    	
    		
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path4", 0, ST_WPT_RUN, 0,5,0,.3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path5", 0, ST_WPT_RUN, 0,3,0,.7);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path6", 0, ST_WPT_RUN, 5,3,0,.5);  
	Script.WaitSec(2);
    b = Entity.FindName(entRoot, "Walk2");
	if (b) then
    	Animal.SetState(b, ST_WPT_RUN);
    	Animal.EnableFear(b, false);
    	end;	   			
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path4", 0, ST_WPT_RUN, 0,7,0,.3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path5", 0, ST_WPT_RUN, 0,4.5,0,.2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path6", 0, ST_WPT_RUN, 0,3,0,.1);  
	Script.WaitSec(5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path8", 0, ST_WPT_RUN, 0,0,-2.5,.4);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path9", 0, ST_WPT_RUN, 0,0,1.5,.5);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path8", 0, ST_WPT_RUN, 0,0,-3,.6);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path9", 0, ST_WPT_RUN, 0,0,1,.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path8", 0, ST_WPT_RUN, 0,0,0,.3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path9", 0, ST_WPT_RUN, 0,0,1,.1);
	Script.WaitSec(3);
    Camera.SetPanOffset(entCamera, 80, 5); --Pan Right to shoot
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path7", 0, ST_WPT_RUN, 0,-1.5,0,.5);
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path7", 0, ST_WPT_RUN, 0,0,-3,.7);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path7", 0, ST_WPT_RUN, 0,-2.3,-6,.3);
 	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path8", 0, ST_WPT_RUN, 0,0,-1.5,.6);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path9", 0, ST_WPT_RUN, 0,0,3,.2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path9", 0, ST_WPT_RUN, 0,-5,0,.2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path9", 0, ST_WPT_RUN, 0,-1,5,.1);

	Script.WaitSec(10);
	
	--Plane Passing
	Sound.Play(smpPlaneFlyBy, 1, .4, DS2_CENTER);
		
    Script.WaitSec(6); 
    	
    Camera.SetHeightOffset(entCamera, 0, 2.0); --PLAYER SITS BACK DOWN	
        
    --Start Engine (3 seconds)
	Sound.Play(smpJeepAcceleration, 1, DS2_VOLMAX, DS2_CENTER);
	 	
	Camera.SetSpeed(entCamera, 1.0, 0.1); --Vehicle start accelerating
	Camera.StopAtWaypoint(entCamera, "CamWptLL");
    Camera.SetPanOffset(entCamera, 0, 2.5); --Look forward again.
	Script.WaitSec(.25); 
	Camera.SetSpeed(entCamera, 2.0, 0.1); --Vehicle continuing to accelerate	       
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);	 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 4.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 5.0, 0.1);
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 6.0, 0.1); --Vehicle reached max speed
	

	a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath1", 0, ST_WPT_RUN, 0,0,0,.4);
	Entity.SetName(a, "Animal6");
	Script.WaitSec(2);
	a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 0, ST_WPT_RUN, 0,0,0,.1);
	Entity.SetName(a, "Animal7");
	Script.WaitSec(2);
    Camera.SetPanOffset(entCamera, 80, 2); --Look Right   
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 0, ST_WPT_RUN, 0,0,0,.1);
    Entity.SetName(a, "Animal8");
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 1, ST_WPT_RUN, 0,0,0,.1);
    Entity.SetName(a, "Animal9");  
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 1, ST_WPT_RUN, 0,-1,0,.5);
	Entity.SetName(a, "Animal1");
    Script.WaitSec(2);
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath1", 1, ST_WPT_RUN, 0,-.5,-1,.1);
	Entity.SetName(a, "Animal2"); 
    Script.WaitSec(2);
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 1, ST_WPT_RUN, 0,0,-1,.1);
    Entity.SetName(a, "Animal3");
    a=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongerPath1", 2, ST_WPT_RUN, 0,-3,5,.5);
    Entity.SetName(a, "Animal4");
    a=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongerPath1", 2, ST_WPT_RUN, 0,.2,-.7,.4); 
    Entity.SetName(a, "Animal5");

    Script.WaitSec(11);
    
   	Camera.SetPanOffset(entCamera, 0, 1.5); --Look Center
  	Camera.SetHeightOffset(entCamera, .5, 2.0); --PLAYER STANDS UP 
  				
   	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path11", 0, ST_GRAZING, 8,0,0,.1);  	
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path12", 0, ST_GRAZING, 6,0,0,.1);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path13", 0, ST_WPT_WALK, 0,0,0,.5); 
   	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path14", 0, ST_WPT_WALK, 0,0,0,.1);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path15", 0, ST_WPT_RUN, 0,0,0,.1);
	Script.WaitSec(4);	 		
   	Camera.SetPanOffset(entCamera, -80, 1.5); --Look Left
	
   	Script.WaitSec(4);
	    
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path15", 0, ST_WPT_RUN, 0,0,0,.7);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path15", 0, ST_WPT_RUN, 0,0,-3,.4);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path15", 0, ST_WPT_RUN, 0,.5,2,.1);
    Script.WaitSec(2);	 
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path15", 0, ST_WPT_RUN, 0,0,0,1);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path15", 0, ST_WPT_RUN, 0,.25,-3,.1);
    Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path15", 0, ST_WPT_RUN, 0,.5,2,.7);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path15", 0, ST_WPT_RUN, 0,0,0,.3);    
	        	  		
    a = Entity.FindName(entRoot, "Animal1");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;
    a = Entity.FindName(entRoot, "Animal2");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;
    a = Entity.FindName(entRoot, "Animal3");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;
    a = Entity.FindName(entRoot, "Animal4");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;
    a = Entity.FindName(entRoot, "Animal5");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;
    a = Entity.FindName(entRoot, "Animal6");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;
    a = Entity.FindName(entRoot, "Animal7");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;
    a = Entity.FindName(entRoot, "Animal8");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;
    a = Entity.FindName(entRoot, "Animal9");
	if (a) then
    	Animal.SetState(a, ST_GONE);
    	Animal.EnableFear(a, false);
    	end;    	
    	
	Script.WaitSec(6);	--INTO THE FOREST
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path18", 0, ST_WPT_RUN, 0,0,0,.5);
	Script.WaitSec(1);				
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path17", 0, ST_WPT_RUN, 0,0,0,.3);					
	Camera.SetSpeed(entCamera, 1.0, 0.1); --Vehicle start accelerating
	
   	Camera.SetHeightOffset(entCamera, 0, 2.0); --PLAYER SITS BACK DOWN	
   			
	Camera.StopAtWaypoint(entCamera, "CamWptK1");
    Camera.SetPanOffset(entCamera, 0, 2.5); --Look forward again.
    
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath12", 2, ST_WPT_RUN, 0,0,0,.5);
	Script.WaitSec(.25); 
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path18", 0, ST_WPT_RUN, 0,3,-3,.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath12", 1, ST_WPT_RUN, 0,0,0,.5);	
	--Start Engine (3 seconds)
	Sound.Play(smpJeepAcceleration, 1, DS2_VOLMAX, DS2_CENTER);
		
	Camera.SetSpeed(entCamera, 2.0, 0.1); --Vehicle continuing to accelerate	       
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);	 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 4.0, 0.1);	   
	Script.WaitSec(.25);
	
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath12", 0, ST_WPT_RUN, 0,0,0,.5);
	
	Camera.SetSpeed(entCamera, 5.0, 0.1);
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 6.0, 0.1); --Vehicle reached max speed				
	Script.WaitSec(8);
    Camera.SetPanOffset(entCamera, 50, 2); --Look Right
    Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath1", 0, ST_WPT_RUN, 0,-6,0,.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath1", 0, ST_WPT_RUN, 0,0,6,.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath1", 0, ST_WPT_RUN, 0,0,0,.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path17", 0, ST_WPT_RUN, 0,0,0,.5);	
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path17", 0, ST_WPT_RUN, 0,-4.5,5,.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path17", 0, ST_WPT_RUN, 0,0,0,.5);	
    Script.WaitSec(1);
   	Camera.SetPanOffset(entCamera, -25, 1.0); --Look Left
   	
   	Camera.SetHeightOffset(entCamera, .5, 1.5);	--PLAYER STANDS UP
    	   			    
	Script.WaitSec(5);					    				  
    Camera.SetPanOffset(entCamera, 180, 2); --Look Behind
    
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath3", 0, ST_WPT_RUN, 0,0,0,.5);
    Script.WaitSec(2);		
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath2", 0, ST_WPT_RUN, 0,0,3,1.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath2", 1, ST_WPT_RUN, 0,0,3,1.3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath2", 0, ST_WPT_RUN, 0,2,-2,1.2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath2", 1, ST_WPT_RUN, 0,-1.5,.5,1.4);
	Script.WaitSec(5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath2", 0, ST_WPT_RUN, 0,-1,-1,1.2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath2", 0, ST_WPT_RUN, 0,2.5,3,1.0);
	Script.WaitSec(2);	 
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path20", 0, ST_WPT_RUN, 0,0,0,.5);
	Script.WaitSec(3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path20", 0, ST_WPT_RUN, 0,0,0,.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path21", 0, ST_WPT_RUN, 0,0,0,.5);
	Script.WaitSec(3);			   	
    Camera.SetSpeed(entCamera, 5.0, 0.1); --Vehicle deccelerate	       
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 4.0, 0.1);	 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 2.0, 0.1);
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 1.0, 0.1); 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 0.0, 0.1); --Vehicle stops
	
	Script.WaitSec(7); --Shoot from behind

	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path22", 0, ST_WPT_RUN, 0,0,8,.1);
	Script.WaitSec(1.0);
		
    --Start Engine (3 seconds)
	Sound.Play(smpJeepAcceleration, 1, DS2_VOLMAX, DS2_CENTER);		
			
    Camera.SetSpeed(entCamera, 1.0, 0.1); --Vehicle accelerates	       
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 2.0, 0.1);	 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 4.0, 0.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path22", 0, ST_WPT_RUN, 0,-5,8,.2);	
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 5.0, 0.1); 
	Script.WaitSec(.25);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path22", 0, ST_WPT_RUN, 0,0,8,.1);	
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path22", 0, ST_WPT_RUN, 0,5,8,.3);
	Camera.SetSpeed(entCamera, 6.0, 0.1);			
	Camera.SetPanOffset(entCamera, 370, 4); --Look Forward			
	Camera.SetTiltOffset(entCamera, 0, 1.0); --Look back up again.
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path19", 0, ST_GRAZING, 8.5,-12,4,.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path19", 0, ST_GRAZING, 7.5,-9,0,.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path19", 0, ST_GRAZING, 8,-7,-4,.5);
	Script.WaitSec(9);
	Camera.SetHeightOffset(entCamera, 0, 1.5);	--PLAYER SITS DOWN
		
	a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path23", 0, ST_GRAZING, 14.5,0,0,.2);
	Animal.EnableFear(a, false);	
	b=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path24", 0, ST_GRAZING, 12.5,0,0,.1);
	Animal.EnableFear(b, false);	
	c=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path25", 0, ST_GRAZING, 13,0,0,.3);
	Animal.EnableFear(c, false);	
	d=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path26", 0, ST_GRAZING, 12,0,0,.2);
	Animal.EnableFear(d, false);	
	Script.WaitSec(9); --Vehicle comes to a stop in heard of Impala.
		
	Camera.SetSpeed(entCamera, 5.0, 0.1); --Vehicle deccelerate	       
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 4.0, 0.1);	 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 2.0, 0.1);
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 1.0, 0.1); 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 0.0, 0.1); --Vehicle stops		      
		
	Camera.SetHeightOffset(entCamera, .5, 1.0);	--PLAYER STANDS UP
	  		
	Script.WaitSec(1.5);
	  		
	--Sound Horn
	Sound.Play(smpJeepHorn, 1, DS2_VOLMAX, DS2_CENTER);  		
	  		
	Script.WaitSec(1.5);

    --Start Engine
	Sound.Play(smpJeepAcceleration, 1, DS2_VOLMAX, DS2_CENTER);
		  		  			
	Camera.SetSpeed(entCamera, 1.0, 0.1); --Vehicle starts accelerating
	Script.WaitSec(.25); 
	Camera.SetSpeed(entCamera, 2.0, 0.1); --Vehicle continuing to accelerate	       
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);	 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 4.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 5.0, 0.1);
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 6.0, 0.1); --Vehicle reached max speed	

	Camera.SetPanOffset(entCamera, 220, 2); --Look Forward
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath4", 0, ST_WPT_RUN, 0,0,0,1.8);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath4", 0, ST_WPT_RUN, 0,3,2,1.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath4", 0, ST_WPT_RUN, 0,2,0,.8);	
	Script.WaitSec(3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path27", 0, ST_WPT_RUN, 0,0,6,1.0);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path27", 0, ST_WPT_RUN, 0,3,-6,1.0);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path27", 0, ST_WPT_RUN, 0,-3,8,1.0);
	Script.WaitSec(4);
		
	Camera.SetPanOffset(entCamera, 90, 8); --Look Forward

	Script.WaitSec(1.5);
	
	--Plane Passing
	Sound.Play(smpPlaneFlyBy, 1, 1, DS2_CENTER);
	
	Script.WaitSec(3.5);
	
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath3", 3, ST_WPT_RUN, 0,-8,0,1.0);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath3", 3, ST_WPT_RUN, 0,3,1,.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath3", 3, ST_WPT_RUN, 0,0,-3,.5);		
	Script.WaitSec(5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath3", 2, ST_WPT_RUN, 0,-1,1,.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath3", 2, ST_WPT_RUN, 0,3,2,.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath3", 1, ST_WPT_RUN, 0,-5,2,.3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath3", 1, ST_WPT_RUN, 0,5,2,.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath3", 1, ST_WPT_RUN, 0,2,0,1.0);	
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath3", 0, ST_WPT_RUN, 0,3,2,.4);					
	Script.WaitSec(1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath3", 0, ST_WPT_RUN, 0,-5,2,.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath3", 0, ST_WPT_RUN, 0,3,2,.4);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath4", 4, ST_WPT_RUN, 0,0,0,.1);
	Script.WaitSec(1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath4", 4, ST_WPT_RUN, 0,3,2,.4);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath4", 1, ST_WPT_RUN, 0,0,0,.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath4", 1, ST_WPT_RUN, 0,3,2,.4);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path29", 0, ST_WPT_RUN, 0,0,2.5,.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path28", 0, ST_WPT_RUN, 0,3,-2.5,.4);
	Script.WaitSec(2);					
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path28", 0, ST_WPT_RUN, 0,0,-1.2,.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path29", 0, ST_WPT_RUN, 0,0,3,.4);				
	Camera.SetPanOffset(entCamera, 0, 2);
	Script.WaitSec(3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path30", 0, ST_WPT_RUN, 0,0,0,.3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path28", 0, ST_WPT_RUN, 0,3,-2.5,.4);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path30", 0, ST_WPT_RUN, 0,0,3,.1);		
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path29", 0, ST_WPT_RUN, 0,0,1.5,.3);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path28", 0, ST_WPT_RUN, 0,0,-2.5,.4);	
	Script.WaitSec(1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path29", 0, ST_WPT_RUN, 0,0,2.5,.3);
	Script.WaitSec(.5);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path30", 0, ST_WPT_RUN, 0,0,0,.4);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path28", 0, ST_WPT_RUN, 0,3,-2.5,.4);
	Script.WaitSec(1.5);	
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path30", 0, ST_WPT_RUN, 0,0,0,.4);	
	
	end;
    
-----------------------------------------------------------------------------
-- Main entry point
   
Setup();   
Part1(); 
   