-----------------------------------------------------------------------------
-- Stage 4-1
-----------------------------------------------------------------------------

function PostStage()

    EntGame.EnablePlayerControl(false);
    EntGame.ClearFlag(GF_READYTOSTART);
    EntGame.BindCameraToEntity("IntroCamera");
   
    Sound.Release(smpLeopardRoar);
    
    EntGame.DestroyAllAnimals();
        
    end;    
    
-----------------------------------------------------------------------------    
-- Setup

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

    -- load world
    SetupWorld("Maps\\WorldBaobabForest\\BaobabForestCommon.ini", "Maps\\Stage4-1\\Stage4-1.ini","","");
    EntGame.CreatePlayerEntities();
    
    EntGame.SetGlobalDustColorInitial(1.0, 0.61, .58, .45);
    EntGame.SetGlobalDustColorFinal  (0.0, 0.61, .58, .45);

    EntGame.SetStageTimer(240);
    
    -- load sounds
    smpLeopardRoar = Sound.Load("Sound\\Animals\\LeopardRoar.wav");
    
	EntGame.LoadAnimal(AID_RHINO_M);
	EntGame.LoadAnimal(AID_HARE_M);
	EntGame.LoadAnimal(AID_GEMSBOK_M);
	EntGame.LoadAnimal(AID_GEMSBOK_F);
	EntGame.LoadAnimal(AID_SPURWINGGOOSE_M);
	EntGame.LoadAnimal(AID_LEOPARD_M);
	
  	StartupSequence("Music\\Verdure.ogg");
  	
    end;
    
-----------------------------------------------------------------------------
function Part1()

	Camera.JumpToWaypoint(entCamera, "CamWptAA");
    Camera.SetSpeed(entCamera, 0.0, 0.1); 
    
    a1=EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath1", 0, ST_WPT_WALK, 20, 0, 0, 2.0);
    Animal.EnableFear(a1, false);
    a2=EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath4", 0, ST_WPT_WALK, 20, 0, 0, 2.0);
    Animal.EnableFear(a2, false);
    Entity.SetName(a2, "Rhino2");
    Animal.SetElvOffset(a2, -.2);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath1", 1, ST_WPT_RUN, 0, 0, 0, .5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath2", 1, ST_WPT_RUN, 0, 0, 0, .4);
    Script.WaitSec(2.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, .5);
    a = EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "Path23", 0, ST_WPT_RUN, 0, 1, 1, .4);
    Animal.FaceEntity(a, entCamera);
    Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, -1.5, 0, -1.5, 1.0);		
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "LongerPath2", 0, ST_WPT_RUN, 0, 0, 0, .7);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(2.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, 0, 0, 1, 1.0);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, .7);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "BunnyPath2", 0, ST_WPT_RUN, 0, -1, -1, .4);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, 1, 1, 0, 1.0);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, 0, 0, 1, 1.0);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, -1, -1.5, 0, 1.0);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath2", 1, ST_WPT_RUN, 0, 0, 0, .4);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, 0, 2, -2, 1.0);
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, -2, -2, 0, 1.0);	
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, .7);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, 0, -2.5, 0, 1.1);		
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, .5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath2", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(2.5);
    a = EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "Path23", 0, ST_WPT_RUN, 0, 1, 1, .4);
    Animal.FaceEntity(a, entCamera);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, 0, 2, -2, 1.0);
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, -2, -2, 0, 1.0);	
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, -2, -2, 0, 1.0);	
    Script.WaitSec(.5);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, -1.5, 0, -1.5, 1.0);	
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath2", 0, ST_WPT_RUN, 0, 0, 0, .7);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, -1, -1, 0, 1.0);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, 1, 0, 0, 1.0);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, 0, -2, -1, 1.0);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, .5, 0, -1.5, 1.0);
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongerPath11", 0, 0, -2, -1, 1.0);
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, .5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath2", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(2);	
    a = EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "Path23", 0, ST_WPT_RUN, 0, 1, 1, .7);
    Animal.FaceEntity(a, entCamera);
    Script.WaitSec(4);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath1", 1, ST_WPT_RUN, 0, 0, 0, .5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath2", 1, ST_WPT_RUN, 0, 0, 0, .4);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath2", 0, ST_WPT_RUN, 0, 0, 0, .7);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(4.0); 		
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, .4);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath2", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(2.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath2", 1, ST_WPT_RUN, 0, 0, 0, .4);
    Script.WaitSec(2.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath2", 0, ST_WPT_RUN, 0, 0, 0, .7);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(5);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath2", 0, ST_WPT_RUN, 0, 0, 0, 2.0);

    Run("Rhino2"); 
    Script.WaitSec(2);
        
    a=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath2", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Animal.FaceEntity(a, entCamera);
    Animal.SetAutoChargeDist(a, 25);	
	Animal.SetAttackType(a, ATK_STRAFE);
	Animal.SetStrafeAttackDist(a, 6.0);  
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
 
    Script.WaitSec(2);
    Sound.Play(smpLeopardRoar, 1, DS2_VOLMAX, DS2_CENTER);
    Script.WaitSec(1);
        
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath1", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath2", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath2", 0, ST_WPT_RUN, 0, 0, 0, 2.0);

    Script.WaitSec(4.0);
    	
    Camera.SetSpeed(entCamera, 4.5, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptGG");
    
    Script.WaitSec(7.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "Path4", 0, ST_WPT_RUN, 0, 0, 0, 1.0);	
    EntGame.SpawnAnimalOnPath(AID_RHINO_M, "Path3", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path5", 0, 0, 0, 0, 1.0);	
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path5", 0, 0, 1.5, 2, 1.0);	
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path5", 0, -2, 0, -1.5, 1.0);
    Script.WaitSec(0.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path5", 0, 0, .5, 0, 1.0);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path4", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	   
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path5", 0, 1.5, .5, 2, 1.0);	
    Script.WaitSec(1.0); 
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path4", 0, ST_WPT_RUN, 0, 0, 1.5, 2.0);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path5", 0, 0, -.5, 1.5, 1.0);
    Script.WaitSec(1.5);	
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path4", 0, ST_WPT_RUN, 0, 0, -2.0, 2.0);
    Script.WaitSec(1.5); --AT WPT DD, Travel Time to GG (15 secs)	
    
    a = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath5", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
    Animal.FaceEntity(a, entCamera);
    Animal.SetAutoChargeDist(a, 15);	
	Animal.SetAttackType(a, ATK_STRAFE);
	Animal.SetStrafeAttackDist(a, 10.5); 
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, 50);	
    
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path3", 0, ST_WPT_RUN, 0, 0, 1.5, 2.0);
    	  
    a = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath5", 0, ST_WPT_RUN, 0, 0, 3.5, 1.3);
    Animal.FaceEntity(a, entCamera);
    Animal.SetChargeWhenShot(a, true);
    Animal.SetAttackType(a, ATK_STRAFE);
	Animal.SetStrafeAttackDist(a, 10.5); 
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, 50);	
  
    Script.WaitSec(2);
    a1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path6", 0, ST_GRAZING, 60, 0, 0, 2.0);	
    Animal.EnableFear(a1, false);
    Animal.SetElvOffset(a1, 9.7);
    Animal.SetCoinMode(a1, CM_SPAWNREL); 
    Animal.FaceEntity(a1, entCamera);
    Entity.SetName(a1, "Leopard1");	
    
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path3", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	
    	
    a = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath5", 0, ST_WPT_RUN, 0, 1, -2, 1.2);
    Animal.FaceEntity(a, entCamera);
    Animal.SetChargeWhenShot(a, true);
    Animal.SetAttackType(a, ATK_STRAFE);
    Animal.SetStrafeAttackDist(a, 10.5); 
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, -50);	
	
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path3", 0, ST_WPT_RUN, 0, 0, -1.5, 2.0);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path3", 0, ST_WPT_RUN, 0, 0, -1.5, 2.0);
    Script.WaitSec(10.5);			
                 	    		  
    end;    

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

function Part2()

	--Camera.JumpToWaypoint(entCamera, "CamWptGG");
	
    a3=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path8", 0, ST_GRAZING, 60, 0, 0, 2.0);	
    Animal.EnableFear(a3, false);
    Animal.SetElvOffset(a3, 1.0);
    Animal.SetCoinMode(a3, CM_SPAWNREL); 
    Animal.FaceEntity(a3, entCamera);	
    Entity.SetName(a3, "Leopard2");
    
	Camera.SetPanOffset(entCamera, -70.0, 1.0);
    Camera.SetSpeed(entCamera, .5, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptHH");
    
    b1=EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath7", 0, ST_WPT_WALK, 15, 0, 0, 1.2);	
    Animal.EnableFear(b1, false);
    Entity.SetName(b1, "Rhino1");
    
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "Path7", 0, ST_WPT_RUN, 0, 1.5, 0, .2);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "Path7", 0, ST_WPT_RUN, 0, 0, -1.5, .2);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "Path7", 0, ST_WPT_RUN, 0, 2, -4, .3);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "Path7", 0, ST_WPT_RUN, 0, 0, -1.5, .2);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "Path7", 0, ST_WPT_RUN, 0, -1, -4, .4);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "Path7", 0, ST_WPT_RUN, 0, 3, -4, .3);
    Script.WaitSec(2);
    
    a = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath11", 0, ST_WPT_RUN, 0, 0, 1.5, 1.5);
    Animal.FaceEntity(a, entCamera);
    Animal.SetAutoChargeDist(a, 35);
    Animal.SetAttackType(a, ATK_STRAFE);
    Animal.SetStrafeAttackDist(a, 5.5);
    
    Script.WaitSec(1.5);
        
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath11", 0, ST_WPT_RUN, 0, 0, -2.5, 1.5);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath11", 0, ST_WPT_RUN, 0, 0, 0, 1.3);
    Script.WaitSec(1.5);
    Run("Rhino1"); 		

    Script.WaitSec(3.5);
    
    Sound.Play(smpLeopardRoar, 1, DS2_VOLMAX, DS2_CENTER);
    
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath9", 0, ST_WPT_RUN, 0, 1.5, 0, 1.3);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath8", 0, ST_WPT_RUN, 0, 0, -1.5, 1.1);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "BunnyPath9", 0, ST_WPT_RUN, 0, 2, -3, .9);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "BunnyPath8", 0, ST_WPT_RUN, 0, 0, -1.5, 1.1);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath9", 0, ST_WPT_RUN, 0, -1, -3, .9);
    Script.WaitSec(6.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 1.5, 1.5);
    Script.WaitSec(1.5);
    
    a = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, -2.5, 1.5);
    Animal.FaceEntity(a, entCamera);
    Animal.SetAutoChargeDist(a, 30);
    Animal.SetAttackType(a, ATK_STRAFE);
    Animal.SetStrafeAttackDist(a, 5.5);
    Script.WaitSec(.5);
 
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 0, 1.6);
    Script.WaitSec(2.0);
   
    a = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 0, 1.4);
    Animal.FaceEntity(a, entCamera);
    Animal.SetAutoChargeDist(a, 20);
    Animal.SetAttackType(a, ATK_STATIC);
	Animal.SetAttackRepeat(a, 1);	
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, 90);
	Entity.SetName(a, "AttackingRhino");
	
   	Script.WaitSec(3.0);
   	
   	Sound.Play(smpLeopardRoar, 1, DS2_VOLMAX, DS2_CENTER);
   	Script.WaitSec(3.0);  
   	   	
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath9", 0, ST_WPT_RUN, 0, 1.5, 0, 1.3);
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "BunnyPath9", 0, ST_WPT_RUN, 0, 2, -4, .9);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath8", 0, ST_WPT_RUN, 0, 0, -1.5, 1.1);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "BunnyPath9", 0, ST_WPT_RUN, 0, -1, -4, .9);    	
    Script.WaitSec(2);
    
    PlaySound = Entity.FindName(entRoot, "AttackingRhino");  
    if (PlaySound) then  
 		--Voice.PlayVox(VOX_RHINO_CHARGING, 4); 
        end;
    
    Script.WaitSec(5);	
    		
    end;    

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

function Part3()

	--Camera.JumpToWaypoint(entCamera, "CamWptHH");
	
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath12", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	
	Camera.SetSpeed(entCamera, 5.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptPP");
    
	Camera.SetPanOffset(entCamera, 0.0, 1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path15", 0, -1, -1.5, 0, 1.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path16", 0, 0, 0, 2, 1.5);
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path15", 0, -1.5, .5, 0, 1.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path16", 0, 0, -2, 2, 1.5);		
	Script.WaitSec(1);
	
	Gone("Leopard1");
	Gone("Leopard2");

	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path15", 0, 0, -.5, .5, 1.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path16", 0, -.5, -2.5, .5, 1.5);	
	Script.WaitSec(2.0);		
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path10", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
	b1=EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Animal.FaceEntity(b1, entCamera);
	Script.WaitSec(1.0);
	
	a2=EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath5", 0, ST_WPT_RUN, 0, 0, -1.0, 1.4);
	Animal.FaceEntity(a2, entCamera);
	b2=EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "LongerPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Animal.FaceEntity(b2, entCamera);	
	Script.WaitSec(1.0);
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path11", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	

	b3=EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Animal.FaceEntity(b3, entCamera);		
	Script.WaitSec(1.0);
	
	d1=EntGame.SpawnAnimalOnPath(AID_RHINO_M, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.0);	
    Animal.SetAutoChargeDist(d1, 20);
    Animal.SetAttackType(d1, ATK_STRAFE);
    Animal.SetStrafeAttackDist(d1, 9.5);
	Animal.SetPostAttackRand(d1, false);
	Animal.SetPostAttackDir(d1, 90);	
	Entity.SetName(d1, "AttackingRhino2");
	
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path11", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
	a4=EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath5", 0, ST_WPT_RUN, 0, 0, 0, 1.4);
	Animal.FaceEntity(a4, entCamera);
	b4=EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Animal.FaceEntity(b4, entCamera);		
	Script.WaitSec(2);
	c2=EntGame.SpawnAnimalOnPath(AID_GEMSBOK_F, "Path9", 0, ST_WPT_WALK, 0, 0, 0, 1.0);
	Animal.EnableFear(c2, false);
    Entity.SetName(c2, "Gemsbok1");	
    
	Script.WaitSec(4.0);
	    
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path12", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path24", 0, 0, -2, 0, 1.2);
	Script.WaitSec(.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path24", 0, 0, -2.5, -1, 1.2);
	Script.WaitSec(.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path24", 0, 1, -.5, 0, 1.2);
	Script.WaitSec(1.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path24", 0, 0, -1.5, 0, 1.2);	
	Run("Gemsbok1");
	Script.WaitSec(1.0);
	
	PlaySound = Entity.FindName(entRoot, "AttackingRhino2");  
    if (PlaySound) then  
 		--Voice.PlayVox(VOX_RHINO_CHARGING, 4); 
        end;
	
	Script.WaitSec(3.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "BunnyPath13", 0, -1, -1.5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "BunnyPath13", 0, 0, 0, 2, 1.5);
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "BunnyPath13", 0, -1.5, .5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "BunnyPath13", 0, 0, -2, 2, 1.5);		
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "BunnyPath13", 0, 0, -.5, .5, 1.5);		
	    
    Bunny1=EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path13", 0, ST_GRAZING, 15, 0, 0, 1.0);	
    Animal.EnableFear(Bunny1, false);
    Animal.SetElvOffset(Bunny1, 1.2);
    Animal.SetCoinMode(Bunny1, CM_SPAWNREL); 
    Entity.SetName(Bunny1, "Bunny1");
    Bunny2=EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path14", 0, ST_GRAZING, 14, 0, 0, 1.0);	
    Animal.EnableFear(Bunny2, false);
    Animal.SetElvOffset(Bunny2, 1.2);
    Animal.SetCoinMode(Bunny2, CM_SPAWNREL); 
    Entity.SetName(Bunny2, "Bunny2");               		
	Script.WaitSec(1.0);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "BunnyPath13", 0, 0, -2.5, 0, 1.5);	
	Script.WaitSec(13.0);
	a = EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, 4, 0, 0, 1);
	Animal.FaceEntity(a, entCamera);
	Script.WaitSec(1.0);	
	a = EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, 4, .3, 0, 1);
	Animal.FaceEntity(a, entCamera);
    Script.WaitSec(1.0);
    a = EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, 4, -.2, 0, 1);
    Animal.FaceEntity(a, entCamera);

    Script.WaitSec(2);
    
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path20", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
        
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptVV");
    
    Script.WaitSec(2); 
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path20", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(3);
    
    EntGame.ShowCaption(STR_LVL_4_1_A, 0, 6.0);
    
    Script.WaitSec(6);
 		  
    end;    

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

function Part4()

	--Camera.JumpToWaypoint(entCamera, "CamWptRR");
	--Camera.SetSpeed(entCamera, 3.0, 0.1);
	
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 2.5, 0.1); 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 2.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptVV");
    
    Script.WaitSec(9); --Travel Time to NN
         
    EntGame.ShowCaption(STR_LVL_4_1_B, 0, 2.0);
         
    Script.WaitSec(1);
    
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 1.4);		
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, -1, -1.5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 0, 0, 2, 1.5);
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, -1.5, .5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, -2, 2, 1.5);		
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, -.5, .5, 1.5);			
   	Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, -1, -1.5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath4", 0, ST_WPT_RUN, 0, 0, 0, 2.5);		
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 0, 0, 0, 1.5);
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, -1.5, .5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 0, 0, 2, 1.5);
	Script.WaitSec(1);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath5", 0, ST_WPT_RUN, 0, 0, 0, 2.4);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, -1.5, .5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath4", 0, ST_WPT_RUN, 0, 0, 0, 2.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, 0, 0, 1.5);		
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, -.5, .5, 1.5);			
   	Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 0, -1.5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath5", 0, ST_WPT_RUN, 0, 0, 0, 2.4);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 0, 0, 0, 1.5);
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, -1.5, .5, 0, 1.5);
	EntGame.SpawnAnimalOnPath(AID_RHINO_M, "LongerPath10", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
	Script.WaitSec(4);
	EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 1.4);
	Script.WaitSec(1.7);
	EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 1.2);    
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 1.4);		
    Script.WaitSec(1.0);
	EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 1.1);
	EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 1.4);
	Script.WaitSec(2.5);
	EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 1.2);    
    EntGame.SpawnAnimalOnPath(AID_GEMSBOK_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 1.4);
    Script.WaitSec(2.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, -2, 2, 1.5);		
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, -.5, .5, 1.5);		
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, -1, -1.5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, 0, 2, 1.5);
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, -1.5, .5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 0, -2, 2, 1.5);
	EntGame.SpawnAnimalOnPath(AID_RHINO_M, "LongerPath8", 0, ST_WPT_RUN, 0, 0, 0, 2.2);		
	Script.WaitSec(1);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, -.5, .5, 1.5);			
   	Script.WaitSec(.5);
   	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 2.5);	
   	EntGame.SpawnAnimalOnPath(AID_RHINO_M, "LongerPath8", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, -1, -1.5, 0, 1.5);
	Script.WaitSec(.5);	
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 3.0);
	Script.WaitSec(1.5);	
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
	Script.WaitSec(1.5);	
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
	Script.WaitSec(1.5);	
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath8", 0, ST_WPT_RUN, 0, 0, 0, 3.0);
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 2.5);	
	Script.WaitSec(1.0);
   	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 2.5);	
	Script.WaitSec(.5);	
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 3.0);
	Script.WaitSec(1.5);	
	EntGame.SpawnAnimalOnPath(AID_HARE_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 3.0);
	Script.WaitSec(1.5);
   	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 2.5);	
	Script.WaitSec(.5);	
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 0, 0, 0, 1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 1.5, 0, -.5, 1.5);	
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 3.0);
	Script.WaitSec(1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 2, 1.5, 1, 1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 1.5, -1, -2, 1.5);		
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath6", 0, ST_WPT_RUN, 0, 0, 0, 3.0);
	Script.WaitSec(1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 1, .5, 1, 1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, -1, 0, -1, 1.5);		
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
	Script.WaitSec(1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 0, 0, 0, 1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 1.5, 0, -.5, 1.5);		
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath7", 0, ST_WPT_RUN, 0, 0, 0, 2.5);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LongerPath8", 0, ST_WPT_RUN, 0, 0, 0, 3.5);
	Script.WaitSec(1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path17", 0, 1.5, 0, -.5, 1.5);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path18", 0, 0, .5, 0, 1.5);	  	
					    	    		  			    	    		  
    end;    

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