-----------------------------------------------------------------------------
-- Stage 2-5
-----------------------------------------------------------------------------

function PostStage()

    -- do this stuff first, tells the game that the round is over
    EntGame.EnablePlayerControl(false);
    EntGame.ClearFlag(GF_READYTOSTART);
    EntGame.BindCameraToEntity("IntroCamera");
  
    Sound.Release(smpLeopardRoar);
    
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path19", 0, ST_GRAZING, 20000, 0, 0, .8);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path20", 0, ST_GRAZING, 20000, 0, 0, .8);
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path21", 0, ST_GRAZING, 20000, 0, 0, .8);
    Animal.SetElvOffset(a1, .9);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path22", 0, ST_WPT_WALK, 20000, 2, 0, .8);
               
    end;    
    
-----------------------------------------------------------------------------    
-- Setup

function Setup()

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

    -- load world
    SetupWorld("Maps\\WorldRockyDesert\\RockyDesertCommon.ini", "Maps\\Stage2-5\\Stage2-5.ini","","");
    EntGame.CreatePlayerEntities();

    EntGame.SetGlobalDustColorInitial(1.0, 0.61, .58, .45);
    EntGame.SetGlobalDustColorFinal  (0.0, 0.61, .58, .45);
    
    EntGame.SetStageTimer(210);
   
    -- load sounds
    smpLeopardRoar = Sound.Load("Sound\\Animals\\LeopardRoar.wav");
     
	EntGame.LoadAnimal(AID_MEERKAT_M);
	EntGame.LoadAnimal(AID_IMPALA_F);	
	EntGame.LoadAnimal(AID_IMPALA_M);
	EntGame.LoadAnimal(AID_LEOPARD_M);
	EntGame.LoadAnimal(AID_SPURWINGGOOSE_M);
	EntGame.LoadAnimal(AID_WILDEBEEST_M);
	EntGame.LoadAnimal(AID_WILDEBEEST_F);	
	    
    animala=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path19", 0, ST_GRAZING, 200000, 0, 0, .8);
    animalb=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path20", 0, ST_GRAZING, 200000, 0, 0, .8);
    animalc=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path21", 0, ST_GRAZING, 200000, 0, 0, .8);
    Animal.SetElvOffset(animalc, .9);
    animald=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path22", 0, ST_WPT_WALK, 200000, 2, 0, .8);
        
	StartupSequence("Music\\Dim Horizon.ogg");
	
	EntGame.DestroyAllAnimals();

--S
--[[ S
    Animal.SetState(animala, ST_GONE);
    Animal.SetState(animalb, ST_GONE);
    Animal.SetState(animalc, ST_GONE);
    Animal.SetState(animald, ST_GONE);
S ]]--
    end;

    
-----------------------------------------------------------------------------
function Part1()

	Camera.JumpToWaypoint(entCamera, "CamWptAA");
    Camera.SetSpeed(entCamera, 0.0, 0.1); 
    
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Animal.FaceEntity(a1, entCamera);
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, -1.8, 0, 1.5);
    Animal.FaceEntity(a1, entCamera);
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, 2.1, 2, 1.0);
    Animal.FaceEntity(a1, entCamera);
            
    	--Script.WaitSec(15); --SHOOT TIME
    	
    	Script.WaitSec(2);	
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, 2.5)
    Animal.FaceEntity(a1, entCamera);	
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path2", 0, ST_WPT_WALK, 4, 0, 0, .5);
    Animal.EnableFear(a, false); 
    Entity.SetName(a, "Impala1");   
    	Script.WaitSec(2);
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, 1.3, 0, 1.5);
    Animal.FaceEntity(a1, entCamera);
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, -1.2, 0, 1.8);  
    Animal.FaceEntity(a1, entCamera);  
	b=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path2", 0, ST_WPT_WALK, 5, 1.2, -.5, 1);
	Animal.EnableFear(b, false);
	Entity.SetName(b, "Impala2");
	c=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path2", 0, ST_WPT_WALK, 4.5, -2, 1,.7); 
	Animal.EnableFear(c, false);
	Entity.SetName(c, "Impala3");
    
    		Script.WaitSec(3); --Change to Run
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, 1.8, 0, 2.0);
    Animal.FaceEntity(a1, entCamera);		
    a = Entity.FindName(entRoot, "Impala1");
	if (a) then
    	Animal.SetState(a, ST_WPT_RUN);
    	Animal.EnableFear(a, false);
    	end;
    		Script.WaitSec(1.5); --Change to Run
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, 1.5);  
    Animal.FaceEntity(a1, entCamera);  		
    b = Entity.FindName(entRoot, "Impala2");
	if (b) then
    	Animal.SetState(b, ST_WPT_RUN);
    	Animal.EnableFear(b, false);
    	end;    
    		Script.WaitSec(.5); --Change to Run
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, -1.7, 0, 2.2);   
    Animal.FaceEntity(a1, entCamera); 		
    c = Entity.FindName(entRoot, "Impala3");
	if (c) then
    	Animal.SetState(c, ST_WPT_RUN);
    	Animal.EnableFear(c, false);
    	end;        
    
    Script.WaitSec(3);

    Camera.SetSpeed(entCamera, 3.0, 0.1);
    Camera.SetPanOffset(entCamera, 10.0, 2); --SLIGHT TURN TO RIGHT 
    Camera.StopAtWaypoint(entCamera, "CamWptCC");
        		    
    	--Script.WaitSec(9); --Travel Time to CC	
    	
    EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
    EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, -1.0, -1.0, 1.5);
    	Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, .6, -1, 1.0);    	
    	Script.WaitSec(3);  
    
    EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, 2.5)
    	Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, .8, 0, 1.5);
    EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "Path1", 0, ST_WPT_RUN, 0, -1.2, 0, 1.8); 
	    Script.WaitSec(2.5);
	    
    a=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath1", 0, ST_WPT_RUN, 4, 2, 0, 1.5);
    Animal.EnableFear(a, false);
	Animal.SetAutoChargeDist(a, 10);
	Animal.SetAttackType(a, ATK_STRAFE);		     
    Entity.SetName(a, "Leopard1"); 
    	Script.WaitSec(.5); 
    c=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath1", 0, ST_WPT_RUN, 4, 2.5, 0, 1.3);
    Animal.EnableFear(c, false); 
    
    Entity.SetName(c, "Leopard3");
    	Script.WaitSec(.5);    	 
    b=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath1", 0, ST_WPT_RUN, 4, 3, 0, 1.0);
    Animal.EnableFear(b, false);
	Animal.SetAutoChargeDist(b, 10);
	Animal.SetAttackType(b, ATK_STRAFE);	     
    Entity.SetName(b, "Leopard2"); 	    
 	      
		Script.WaitSec(1.0);
    d=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath1", 0, ST_WPT_RUN, 4, 1.5, 0, 1.0);
    Animal.EnableFear(d, false);
	Animal.SetAutoChargeDist(d, 10);
	Animal.SetAttackType(d, ATK_STATIC);
	Animal.SetPostAttackRand(d, false);
	Animal.SetPostAttackDir(d, 90);	
	Animal.SetAttackRepeat(d, 1);		     
    Entity.SetName(d, "Leopard4"); 	 
	
    a = Entity.FindName(entRoot, "Leopard1");
	if (a) then
    	Animal.SetState(a, ST_WPT_WALK);
    	Animal.EnableFear(a, false);
    	end;   
    		Script.WaitSec(.5);
    c = Entity.FindName(entRoot, "Leopard3");
	if (c) then
    	Animal.SetState(c, ST_WPT_WALK);
    	Animal.EnableFear(c, false);
    	end;       	
    		Script.WaitSec(.5);
    b = Entity.FindName(entRoot, "Leopard2");
	if (a) then
    	Animal.SetState(b, ST_WPT_WALK);
    	Animal.EnableFear(b, false);
    	end;      	
    	    Script.WaitSec(1);
    d = Entity.FindName(entRoot, "Leopard4");
	if (d) then
    	Animal.SetState(d, ST_WPT_WALK);
    	Animal.EnableFear(d, false);
    	end;   
    	
    --Leopard Roar    
	Sound.Play(smpLeopardRoar, 1, DS2_VOLMAX, DS2_RIGHT);
		
    a = Entity.FindName(entRoot, "Leopard1");
	if (a) then
    	Animal.SetState(a, ST_WPT_RUN);
    	Animal.EnableFear(a, false);
    	end;  
    		Script.WaitSec(.5); 	
    c = Entity.FindName(entRoot, "Leopard3");
	if (c) then
    	Animal.SetState(c, ST_WPT_RUN);
    	Animal.EnableFear(c, false);
    	end;   			    	
    		Script.WaitSec(1.0);
    b = Entity.FindName(entRoot, "Leopard2");
	if (b) then
    	Animal.SetState(b, ST_WPT_RUN);
    	Animal.EnableFear(b, false);
    	end;   	
    		Script.WaitSec(.5);
    d = Entity.FindName(entRoot, "Leopard4");
	if (d) then
    	Animal.SetState(d, ST_WPT_RUN);
    	Animal.EnableFear(d, false);
    	end;       			
            Script.WaitSec(1); 
EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, 0, 1.0, 0, .7);
            Script.WaitSec(1.5); 
EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, 1, 0, 1, .3);
            Script.WaitSec(.5); 
EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, -1, 2, -1, .1);    
    		Script.WaitSec(3);
    	               		  
    end;    

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

function Part2()
	
	Camera.SetSpeed(entCamera, 3.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptGG");
    
    	--Script.WaitSec(17); --Travel Time to GG
    Camera.SetTiltOffset(entCamera, -20, 3);        	
    	Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath1", 0, ST_WPT_RUN, 0, 1.5, 0, 1.5);  
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath1", 0, ST_WPT_RUN, 0, -1.2, 0, 2.0);    
    	Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath1", 0, ST_WPT_RUN, 0, 1.5, 0, 1.5);  
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 0, ST_WPT_RUN, 0, -1.2, 0, 2.0);  
    	Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 0, ST_WPT_RUN, 0, 1.5, 0, 1.2); 
    	Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
    	Script.WaitSec(4);
    Camera.SetTiltOffset(entCamera, 0, 2);    
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, .5, 1.0, 1.2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath2", 0, ST_WPT_RUN, 0, 0, -2, .8);
    	Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath2", 0, ST_WPT_RUN, 0, .5, 1.0, 1.2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, 0, -2, .8);
    	Script.WaitSec(1); 
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath2", 0, ST_WPT_RUN, 0, 0, -3, 1.0);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, -1.2, 0, 2.0);  
    	Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, 1.5, -1, 1.2); 
    	Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, .5, 1.0, 1.2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath2", 0, ST_WPT_RUN, 0, 0, 0, .8);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, 1.5, -3.5, 1.0);    
    	Script.WaitSec(4);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath2", 0, ST_WPT_RUN, 0, .5, 1.0, 1.6);
		Script.WaitSec(1.0);    
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath2", 0, ST_WPT_RUN, 0, 0, -1.5, 1.8);  
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath2", 0, ST_WPT_RUN, 0, 0, 0, 1.2);   
		Script.WaitSec(2.0);    
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath2", 0, ST_WPT_RUN, 0, 0, -1.5, 1.5);  
    	Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath2", 0, ST_WPT_RUN, 0, .5, 1.0, 1.2);             
                     	
    	Script.WaitSec(4);    	

    Camera.SetSpeed(entCamera, 2.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptHH");
    
    		Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 0, 1.5, .5, 1.2);
            Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 1, 0.1, 1.3, .8);
            Script.WaitSec(.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, -1, -1.0, -1.7, .5);  
			Script.WaitSec(1.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, .5, 1.3, .8, 1.1);
            Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 1, -0.3, 1.1, .8);
            Script.WaitSec(.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, -1, 1.8, -1, .7);   
    		Script.WaitSec(2.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 0, 1.5, 0, 1.2);
            Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 1, -0.1, .9, 1.9);	
    		Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 0, 1.5, .5, 1.2);
            Script.WaitSec(2.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 1, 2.1, 1.3, .8);
            Script.WaitSec(.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, -1, -0.0, -1.7, .5);  
			Script.WaitSec(1.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, .5, 1.3, .8, 1.1);
			Script.WaitSec(1.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, .5, 2.5, .8, 1.1);	
    		    
    	Script.WaitSec(5); --TIME TO BLAST WHATEVER LIVES.
                 	    		  
    end;    

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

function Part3()
	
	Camera.SetSpeed(entCamera, 2.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptII");
    
    --Script.WaitSec(10); --Travel Time to II
   		Script.WaitSec(4.0);
    a1=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.9);
    Animal.FaceEntity(a1, entCamera);
    	Script.WaitSec(1.5);
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath3", 0, ST_WPT_RUN, 0, 1, -.8, 1.3);
    Animal.FaceEntity(a1, entCamera);   
    	Script.WaitSec(1.5);
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath3", 0, ST_WPT_RUN, 0, -2, 2.0, .8);
    Animal.FaceEntity(a1, entCamera);     
      	Script.WaitSec(2.5);
      	
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
    Animal.FaceEntity(a1, entCamera);
	Animal.SetAutoChargeDist(a1, 10);
	Animal.SetAttackType(a1, ATK_STRAFE);
	Animal.SetAttackRepeat(a1, 1);   
	  
    	Script.WaitSec(2.0);
    	
    --Leopard Roar    
	Sound.Play(smpLeopardRoar, 1, DS2_VOLMAX, DS2_RIGHT);	
	
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath3", 0, ST_WPT_RUN, 0, 1, -.8, 1.3);
    Animal.FaceEntity(a1, entCamera);
	Animal.SetAutoChargeDist(a1, 10);
	Animal.SetAttackType(a1, ATK_STATIC);
	Animal.SetPostAttackRand(a1, false);
	Animal.SetPostAttackDir(a1, 90);	
	Animal.SetAttackRepeat(a1, 1);  
	   
    	Script.WaitSec(1.5);	
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongPath3", 0, ST_WPT_RUN, 0, -2, 2.0, .8);
    Animal.FaceEntity(a1, entCamera);    
    	Script.WaitSec(2); 
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath3", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
    Animal.FaceEntity(a1, entCamera);
    	Script.WaitSec(1.0);
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath3", 0, ST_WPT_RUN, 0, 1, -.8, 2.3);
    Animal.FaceEntity(a1, entCamera);
    	Script.WaitSec(1.2);
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath3", 0, ST_WPT_RUN, 0, -2, 1.5, 2.8);
    Animal.FaceEntity(a1, entCamera);     
      	Script.WaitSec(1.8);
    a1=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath3", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
    Animal.FaceEntity(a1, entCamera);          
    	Script.WaitSec(5);    	
    
    Camera.SetSpeed(entCamera, 2.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptMM");
          
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path7", 0, ST_GRAZING, 40, 0, 0, 2.5);
    Animal.SetElvOffset(a1, .4);
    Animal.SetCoinMode(a1, CM_SPAWNREL); 
    Animal.EnableFear(a1, false);
    b1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path5", 0, ST_WPT_WALK, 40, 0, 0, .8); 
    Animal.EnableFear(b1, false); 
	Entity.SetName(b1, "Leopard6");

    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 0, 0, .5, 1.2);
            Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 1, 0.5, 1.3, .8);
            Script.WaitSec(.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, 0, 1.0, 0, .9);  
			Script.WaitSec(1.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path6", 0, .5, -.5, .8, 1.6);
     	           
        Script.WaitSec(9);
    b1 = Entity.FindName(entRoot, "Leopard6");
	if (b1) then
    	Animal.SetState(b1, ST_GRAZING);
    	Animal.EnableFear(b1, false);
    	Animal.FaceEntity(b1, entCamera)   	
    	end;
    	Script.WaitSec(7);
    	
 	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath4", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
 	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath4", 0, ST_WPT_RUN, 0, 2, -3, 1.8);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath4", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath4", 0, 1.5, 1.5, 0, 1.8);
	    Script.WaitSec(1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath4", 0, ST_WPT_RUN, 0, -2.5, 0, 2.0);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath4", 0, ST_WPT_RUN, 0, -2, 0, 1.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath4", 0, 2, 0, 0, 1.8);
	    Script.WaitSec(1.5);
      
    end;    

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

function Part4()
 
	--DEBUG (2 LINES)
	--Camera.JumpToWaypoint(entCamera, "CamWptMM");
    --Camera.SetSpeed(entCamera, 0.0, 0.1); 
       
	Camera.SetPanOffset(entCamera, 90, .5);
	Camera.SetTiltOffset(entCamera, 20, .5); 

	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath4", 0, ST_WPT_RUN, 0, 1.5, 2.5, 2.1);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath4", 0, ST_WPT_RUN, 0, .6, -1.5, 1.5);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath4", 0, ST_WPT_RUN, 0, 1.6, 0, 1.8);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath4", 0, ST_WPT_RUN, 0, 0, 2, 1.8);		
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath4", 0, 4.5, 0, 0, 1.8);
	    Script.WaitSec(3.0);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath4", 0, ST_WPT_RUN, 0, .6, -4, 2.5);	    
	EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath4", 0, ST_WPT_RUN, 0, -.4, 2, 1.8);
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath4", 0, ST_WPT_RUN, 0, 3.5, 0, 2.1);
	EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "LongPath4", 0, ST_WPT_RUN, 0, -1.2, 0, 1.9);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath4", 0, 2, -.5, 0, 1.8);
	    Script.WaitSec(3.5);        

	Camera.SetTiltOffset(entCamera, -10, 1.5);	
    
    	Script.WaitSec(9);
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path9", 0, ST_WPT_WALK, 30, 0, -2, 2.1);
    Animal.EnableFear(a1, false); 	   
    	Script.WaitSec(3);

	Camera.SetSpeed(entCamera, 2.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptNN");
 	Camera.SetTiltOffset(entCamera, 0, 1.5);
	
    	--Script.WaitSec(13); --Travel Time to NN
    	
    	Script.WaitSec(5);
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path10", 0, ST_WPT_WALK, 0, 0, 0, 1.0);
    Animal.EnableFear(a1, false);
	Entity.SetName(a1, "Leopard7");
    Camera.SetPanOffset(entCamera, 0, 1.5);	
    	Script.WaitSec(2.5);
    Camera.SetPanOffset(entCamera, -45, 1.0);
    Camera.SetTiltOffset(entCamera, -10, 1.0);   
       	Script.WaitSec(1.5);
    Camera.SetPanOffset(entCamera, 35, .8);
    Camera.SetTiltOffset(entCamera, 0, .8); 
        Script.WaitSec(1.0);
    Camera.SetPanOffset(entCamera, -10, 1.5);  
        Script.WaitSec(1.0);
        
    --Leopard Roar    
	Sound.Play(smpLeopardRoar, 1, DS2_VOLMAX, DS2_RIGHT);	
	    
    b1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path10", 0, ST_WPT_RUN, 0, 3.5, 3, 1.0);
    Animal.FaceEntity(b1, entCamera)
	Animal.SetAttackType(b1, ATK_STATIC);
	Animal.SetAutoChargeDist(b1, 10);
	Animal.SetAttackRepeat(b1, 1);
	Animal.SetPostAttackRand(b1, false);
	Animal.SetPostAttackDir(b1, -90);
	Animal.SetPostAttackTimer(b1, .5);				       
    Entity.SetName(b1, "Leopard8");
        Script.WaitSec(1.0);    
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path14", 0, ST_GRAZING, 30, 0, 0, 2.1);
    Animal.SetElvOffset(a1, .6);
    Animal.SetCoinMode(a1, CM_SPAWNREL); 
    Animal.EnableFear(a1, false);   
    
    --LOOK RIGHT AND UPWARD         
    Camera.SetPanOffset(entCamera, 95, .5);
    Camera.SetTiltOffset(entCamera, 10, .5); 
    	Script.WaitSec(2.0);
    	
    a1 = Entity.FindName(entRoot, "Leopard7");
	if (a1) then
    	Animal.SetState(a1, ST_WPT_RUN);
    	Animal.EnableFear(a1, false);
    	end;
    	
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path11", 0, ST_WPT_RUN, 0, 0, 0, 1.8);     	      
    	Script.WaitSec(2.0);
    	
    --LOOK LEFT 
    Camera.SetPanOffset(entCamera, -45, .5);
    Camera.SetTiltOffset(entCamera, -20, .5); 
        	
    	Script.WaitSec(.5);
    	
    a1 = Entity.FindName(entRoot, "Leopard7");
	if (a1) then
    	Animal.SetState(a1, ST_GONE);
    	end;
    b1 = Entity.FindName(entRoot, "Leopard8");
	if (b1) then
    	Animal.SetState(b1, ST_GONE);
    	end;    

    	Script.WaitSec(.5);
    	    		
    Attack1 = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path16", 0, ST_WPT_RUN, 0, 0, 0, 1.6);
    Animal.SetAttackType(Attack1, ATK_STATIC);
	Animal.SetAutoChargeDist(Attack1, 10);
	Animal.SetAttackRepeat(Attack1, 1);
	Animal.SetPostAttackRand(Attack1, false);
	Animal.SetPostAttackDir(Attack1, -90);
	Animal.SetPostAttackTimer(Attack1, .5);
       	Script.WaitSec(1.5);
       	
    --LOOK RIGHT	
    Camera.SetPanOffset(entCamera, 5, .5);
    Camera.SetTiltOffset(entCamera, -5, .5); 
        Script.WaitSec(1.5);
        
    Attack2 = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path15", 0, ST_WPT_RUN, 0, 0, 2.5, 1.4);
    Animal.SetAttackType(Attack2, ATK_STRAFE);
    Animal.SetPostAttackRand(Attack2, false);
	Animal.SetPostAttackDir(Attack2, 90);	
	Animal.SetAutoChargeDist(Attack2, 10);
	Animal.SetPostAttackTimer(Attack2, .5);

       	Script.WaitSec(1.0);
       	
    --LOOK LEFT	
    Camera.SetPanOffset(entCamera, -100, .5);
    Camera.SetTiltOffset(entCamera, -25, .5);
    
    
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path12", 0, ST_WPT_WALK, 8, 0, 0, 1.4);
	Animal.EnableFear(a1, false);  	
    	Script.WaitSec(2.5);
    	    	    	    	
    Camera.SetPanOffset(entCamera, 80, 4.5);
    Camera.SetTiltOffset(entCamera, 10, 4.5); 
    Camera.SetSpeed(entCamera, 2.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptSS");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, 0, 4.5, .5, 1.2);
            Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, 1, 4.1, 1.3, .8);
            Script.WaitSec(.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, -1, 6.0, -1.7, .5);  
			Script.WaitSec(1.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, .5, 4.3, .8, 1.1);
            Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, 1, 4.3, 1.1, .8);
            Script.WaitSec(.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, -1, 4.8, -1, .7);   
    		Script.WaitSec(2.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, 0, 4.5, 0, 1.2);
            Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, 1, 5.1, .9, 1.9);	
    		Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath3", 2, 0, 4.5, .5, 1.2);
            
    	Script.WaitSec(6); 
    	
    EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_F, "Path17", 0, ST_WPT_RUN, 0, 0, 0, 1.4);
    	Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_M, "Path17", 0, ST_WPT_RUN, 0, -2, -3, 1.8);
    	Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_M, "Path17", 0, ST_WPT_RUN, 0, 1.5, -4, 1.4);
        	
    Camera.SetPanOffset(entCamera, 0, 3.5);
    Camera.SetTiltOffset(entCamera, 0, 3.5); 
                 	    		  
    end;    

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

function Part5()

	--Script.WaitSec(3);
	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, 0, .5, .5, .7);
	EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_F, "LongPath5", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    	Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_M, "LongPath6", 0, ST_WPT_RUN, 0, -2, -3, 1.5);         
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, 1, 1.1, 1.3, .7);
        Script.WaitSec(.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, -1, 2, -1.7, .5);  
		Script.WaitSec(1.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, .5, 1.3, .8, .6);
        Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, 1, 2.3, 1.1, .7);
	EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_F, "LongPath5", 0, ST_WPT_RUN, 0, 1, 2.5, 1.2);	
        Script.WaitSec(.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, -1, 1.8, -1, .7);   
    	Script.WaitSec(2.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, 0, .5, 0, .6);
        Script.WaitSec(1.5); 
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, 1, 2.1, .9, .7);	
    	Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, 0, 1.5, .5, .4);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, 1, 1.1, 1.3, .7);
	EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_M, "LongPath6", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_M, "LongPath5", 0, ST_WPT_RUN, 0, 1, 2.5, 1.2);
        Script.WaitSec(1.0); 
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, -1, 2, -1.7, .5);           
    EntGame.SpawnAnimalOnPath(AID_WILDEBEEST_F, "LongPath6", 0, ST_WPT_RUN, 0, -2, -3, 1.0); 
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath5", 0, .5, 1.3, .8, .6);
    	Script.WaitSec(1.0);		 
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath4", 0, ST_WPT_RUN, 0, 0, 1, 2.0);
    	Script.WaitSec(.5);	 
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.8);

    end;    

-----------------------------------------------------------------------------
-- Main entry point
   
Setup();   
Part1();
Part2();
Part3();
Part4();
Part5();   