-----------------------------------------------------------------------------
-- Stage 2-3
-----------------------------------------------------------------------------

function PostStage()
 
    EntGame.EnablePlayerControl(false);
    EntGame.ClearFlag(GF_READYTOSTART);
    EntGame.BindCameraToEntity("IntroCamera");
    
    Sound.Release(smpWaterFall);
    Sound.Release(smpFallInWater);
	Sound.Release(smpHeadAboveWater);
	Sound.Release(smpPlayerHit);
	Sound.Release(smpSsa1ScreamF);    
	Sound.Release(smpJungleAmbiant1);
	Sound.Release(smpJungleCall1);
    
    EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path11", 0, ST_GRAZING, 20000, 0, 0, .9);
	EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path12", 0, ST_GRAZING, 20000, 0, 0, .5);
	EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongPath5", 1, ST_GRAZING, 20000, 0, 0, .7);
	EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongPath5", 0, ST_GRAZING, 20000, 0, 0, .9);
	EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path13", 0, ST_GRAZING, 20000, 0, 0, .9);

    end;    
    
-----------------------------------------------------------------------------    
function Setup()

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

    -- load world
    SetupWorld("Maps\\WorldWaterlands\\WaterlandsCommon.ini", "Maps\\Stage2-3\\Stage2-3.ini","","");
    EntGame.CreatePlayerEntities();

    EntGame.SetGlobalDustColorInitial(.3, 0.51, .61, .45);
    EntGame.SetGlobalDustColorFinal  (0.0, 0.61, .58, .45);

    EntGame.SetStageTimer(240);

    -- load sounds
    smpWaterFall  		= Sound.Load("Sound\\Environment\\Waterfall.wav");
    smpFallInWater  	= Sound.Load("Sound\\Environment\\FallInWater.wav");
    smpHeadAboveWater   = Sound.Load("Sound\\Environment\\HeadAboveWater.wav");       
	smpPlayerHit 		= Sound.Load("Sound\\Environment\\PlayerHit.wav");     
	smpSsa1ScreamF		= Sound.Load("Sound\\Voice\\Ssa1ScreamF.wav");   
	smpJungleAmbiant1	= Sound.Load("Sound\\Environment\\JungleAmbiant1.wav"); 
	smpJungleCall1		= Sound.Load("Sound\\Environment\\JungleCall1.wav");
    
    EntGame.LoadAnimal(AID_HIPPO_M);
	EntGame.LoadAnimal(AID_IMPALA_F);	
	EntGame.LoadAnimal(AID_IMPALA_M);
	EntGame.LoadAnimal(AID_SPURWINGGOOSE_M);
	
    animala=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path11", 0, ST_GRAZING, 20000, 0, 0, .9);
	animalb=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path12", 0, ST_GRAZING, 20000, 0, 0, .5);
	animalc=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongPath5", 1, ST_GRAZING, 20000, 0, 0, .7);
	animald=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongPath5", 0, ST_GRAZING, 20000, 0, 0, .9);
	animale=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path13", 0, ST_GRAZING, 20000, 0, 0, .9);
    	
 	StartupSequence("Music\\Call The.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);
    Animal.SetState(animale, ST_GONE);
S ]]--
    end;

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

	Camera.JumpToWaypoint(entCamera, "CamWptAA");
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptCC");
    
    --Script.WaitSec(6); --Travel Time
    
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, .8);
    	Script.WaitSec(2.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path1", 0, ST_WPT_RUN, 0, 0, 0, .8);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path17", 0, ST_WPT_RUN, 0, 0, 0, .6);
    	Script.WaitSec(2.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path17", 0, ST_WPT_RUN, 0, 1.5, 0, .4);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path2", 0, ST_WPT_RUN, 0, 0, 0, .5);
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path17", 0, ST_WPT_RUN, 0, -1.0, 0, .8);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath1", 0, ST_WPT_RUN, 0, 0, 0, .8);
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path3", 0, ST_WPT_RUN, 0, 0, 0, .5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath1", 0, ST_WPT_RUN, 0, 0, 0, .7);
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path17", 0, ST_WPT_RUN, 0, 0, 0, .6);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, 0, 0, .2);
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path1", 0, ST_WPT_RUN, 0, 1.5, 0, .8);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath1", 0, ST_WPT_RUN, 0, 0, 0, .5);
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_WPT_RUN, 0, -1, 0, .8);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path17", 0, ST_WPT_RUN, 0, 2, 0, .6);
    	Script.WaitSec(2.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path17", 0, ST_WPT_RUN, 0, 0, 0, .4);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path2", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    	Script.WaitSec(3.0);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path17", 0, ST_WPT_RUN, 0, -1.5, 0, .7);
    	Script.WaitSec(2); 
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, 0, 0, .5); 
    	Script.WaitSec(3);
    Camera.SetTiltOffset(entCamera, 60, 1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, 4, 0, -4, 1.2);
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -1, 0, -1, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -5, 0, 5, .8);
    	Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, 3, 0, -3, .9);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, 0, 0, 0, 1.7);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -3.5, 0, 3.5, .7);
        Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -6, 0, -6, 1.3);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -2, 0, -2, 1.0);
    	Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -1, 0, -1, .6);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -5, 0, -5, 1.2);
        Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -10, 0, -10, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -6, 0, -6, 1.2);
    	Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -5, 0, -3, .9);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, 3, 0, -3, 1.0);
    	Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -2, 0, -2, .8);
    	Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -7.5, 0, 7.5, .6);
        Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -10, 0, -10, 1.0);
    	Script.WaitSec(5.5);
    Camera.SetTiltOffset(entCamera, 0, 1.5);
    
                 	    		  
    end;    

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

function Part2()

	Camera.SetSpeed(entCamera, 3.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptDD");
    
    --Script.WaitSec(7); --Travel Time
    
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path6", 0, ST_WPT_RUN, 0, 0, 0, .8);
    	Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path6", 0, ST_WPT_RUN, 0, 0, 0, .6);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path5", 0, ST_WPT_RUN, 0, 0, 0, .7);
    	Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path5", 0, ST_WPT_RUN, 0, 0, 0, .7);
    	Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path5", 0, ST_WPT_RUN, 0, 0, 0, .8);
       Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path6", 0, ST_WPT_RUN, 0, 0, 0, .9);
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path3", 0, ST_WPT_RUN, 0, 0, 0, .9);	
    	Script.WaitSec(2);
        
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptEE");
    
    --Script.WaitSec(4); --Travel Time
     
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path8", 0, ST_WPT_RUN, 0, 0, 0, .9);
    Animal.FaceEntity(a, entCamera);
    	Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path17", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    	Script.WaitSec(2);
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path8", 0, ST_WPT_RUN, 0, 0, 0, .9);
    Animal.FaceEntity(a, entCamera);
        Script.WaitSec(2.5);
        
    --Jungle Bird Call 
	Sound.Play(smpJungleCall1, 1, 1, DS2_CENTER);    
        
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath2", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path8", 0, ST_WPT_RUN, 0, 0, 0, .9);
    Animal.FaceEntity(a, entCamera);
    	Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    	Script.WaitSec(2.0);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath2", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
        Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    	Script.WaitSec(2);
    
    --Jungle Bird Call 
	Sound.Play(smpJungleCall1, 1, 1, DS2_CENTER);
			
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.4);
        Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path17", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
        Script.WaitSec(2.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path1", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    	Script.WaitSec(3.0);
                         	    		  
    end;    

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

function Part3()

	Camera.SetSpeed(entCamera, 1.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptGG");
   
    --Script.WaitSec(25); --Travel Time
    
	EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path2", 0, ST_WPT_RUN, 0, 0, 0, .9);
	a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path10", 0, ST_GRAZING, 20, 0, 0, .9);
	Animal.EnableFear(a, false);
	Animal.FaceEntity(a, entCamera);
	a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path9", 0, ST_WPT_WALK, 10, 0, 0, .7);
	Animal.EnableFear(a, false);
	
	a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path11", 0, ST_WPT_WALK, 17, 0, 0, .9);
	Animal.EnableFear(a, false);
	Animal.FaceEntity(a, entCamera);
	Animal.SetAttackType(a, ATK_STRAFE);
	Animal.SetStrafeAttackDist(a, 6.2);
	Animal.SetPostAttackTimer(a, 0);
	Animal.SetAutoChargeDist(a, 12);
	Animal.SetChargeWhenShot(a, true);	
	Animal.SetAttackRepeat(a, 1);	
	Entity.SetName(a, "HIPPO1");  
	
	Script.WaitSec(1);
	
	--Jungle Bird Call 
	Sound.Play(smpJungleCall1, 1, 1, DS2_CENTER);
	
	a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path12", 0, ST_GRAZING, 21, 0, 0, .5);
	Animal.EnableFear(a, false);
	Animal.FaceEntity(a, entCamera);
	Animal.SetAttackType(a, ATK_STRAFE);
	Animal.SetStrafeAttackDist(a, 6.5);
	Animal.SetPostAttackTimer(a, 0);
	Animal.SetAutoChargeDist(a, 11);
	Animal.SetChargeWhenShot(a, true);	
	Animal.SetAttackRepeat(a, 1);		
	Script.WaitSec(1);
	
	a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongPath5", 1, ST_GRAZING, 24, 0, 0, .7);
	Animal.EnableFear(a, false);
	Animal.FaceEntity(a, entCamera);
	Animal.SetAttackType(a, ATK_STATIC);
	Animal.SetStaticAttackDist(a, 3.5);
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, 90);
	Animal.SetAutoChargeDist(a, 11);
	Animal.SetChargeWhenShot(a, true);	
	Animal.SetAttackRepeat(a, 1);			
	Entity.SetName(a, "HIPPO2");
	
	a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongPath5", 0, ST_GRAZING, 25, 0, 0, .9);
	Animal.EnableFear(a, false);
	Animal.FaceEntity(a, entCamera);			
		Script.WaitSec(10);
	Graze("HIPPO1");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path7", 0, 4, 0, -4, 1.2);
    	Script.WaitSec(1.5);
	Walk("HIPPO2");
	a9=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path14", 0, ST_WPT_WALK, 10, 0, 0, .7);
    Animal.EnableFear(a9, false);
    Animal.SetElvOffset(a9, .2);
    Entity.SetName(a9, "IMPALA4");        
	   	Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path7", 0, 3, 0, -3, .9);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path7", 0, 0, -1, 0, 1.7);
    	Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path7", 0, -3.5, -5.5, 3.5, .7);
        Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path7", 0, -6, 0, -6, 1.3);
    a10=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path14", 0, ST_WPT_WALK, 10, 0, 0, .7);
    Animal.EnableFear(a10, false);
    Animal.SetElvOffset(a10, .2);
    Entity.SetName(a10, "IMPALA1");        
		Script.WaitSec(2);
	EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path7", 0, -1, 0, -1, 1.0);
	Run("HIPPO2");
		Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path7", 0, -5, -3, 5, .8);  
    	Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, 4, 0, -4, 1.2);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -1, 0, -1, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path4", 0, -5, 0, 5, .8);
    a5=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path14", 0, ST_WPT_WALK, 8, 0, 0, .9);
    Animal.EnableFear(a5, false);
    Animal.SetElvOffset(a5, .2);
    Entity.SetName(a5, "IMPALA2");      
    	Script.WaitSec(2.5);
    
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptHH");

    a6=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path14", 0, ST_WPT_WALK, 5, 0, 0, .7);
    Animal.EnableFear(a6, false);
    Animal.SetElvOffset(a6, .2);
    Entity.SetName(a6, "IMPALA3");

    	Script.WaitSec(3);
    Run("IMPALA1");
    	Script.WaitSec(1.5);
    Run("IMPALA2");
    	Script.WaitSec(1);
    Run("IMPALA3");
    	Script.WaitSec(.5);
    Run("IMPALA4");
    a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path15", 0, ST_WPT_WALK, 30, 0, 0, .9);
    Animal.EnableFear(a, false);      
    Entity.SetName(a, "HIPPO4");	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, 0, -1, 0, 1.7);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -2, 0, -2, 1.0);
    	Script.WaitSec(2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, -1, 0, -1, .6);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -5, 0, -5, 1.2);
        Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -6, 0, -6, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, 2, -1, -2, 1.2);
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -1, 0, -1, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, -2, 1.5, 5, .8);
    	Script.WaitSec(2.5);
    Run("HIPPO4");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, 3, 0, 0, .9);
    	Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, 0, -1, 0, 1.7);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -3.5, 0, 3.5, .7);
        Script.WaitSec(3);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, -1, 0, -1, 1.3);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, 0, -1, 0, 1.7);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -2, 0, -2, 1.0);
    	Script.WaitSec(2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, -1, 0, -1, .6);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -5, 0, -5, 1.2);
        Script.WaitSec(3.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, -2, 0, -0, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -1, 0, -2, 1.2);
    	Script.WaitSec(2.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, -1.5, 0, -1.5, .9);
    	Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, 0, -1, 0, 1.7);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, 3, 0, -3, 1.0);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, -2, 0, -2, .8);
    	Script.WaitSec(2.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -1.5, 0, 2, .6);
        Script.WaitSec(2.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "LongPath6", 0, -2, 0, -0, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "MediumPath1", 0, -5, 0, -5, 1.2);    	
        Script.WaitSec(4);         	    		  
    end;    

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

function Part4()

	--DEBUG
	--Camera.JumpToWaypoint(entCamera, "CamWptHH");
	
	Camera.SetSpeed(entCamera, 3.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptII");
 
	a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path13", 0, ST_GRAZING, 10, 0, 0, .9);
	Animal.EnableFear(a, false);
	Animal.FaceEntity(a, entCamera);
    Entity.SetName(a, "HIPPO5");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path19", 0, 0, 0, 0, 1.2);
    	Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path19", 0, 0, -.5, 0, 1.0);	      
    	Script.WaitSec(1.5); --Travel (5 seconds)  
    Run("HIPPO5");
    a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path18", 0, ST_WPT_RUN, 0, 0, 0, .9);
	Animal.EnableFear(a, false);
	Animal.FaceEntity(a, entCamera);
    Entity.SetName(a, "HIPPO6");
    	Script.WaitSec(.7);
    Camera.SetPanOffset(entCamera, -65, .5);      
    	Script.WaitSec(1.0);
    Graze("HIPPO5");
    	Script.WaitSec(.1); 
    Graze("HIPPO6");
    
    --Player Hit (3 seconds)
	Sound.Play(smpPlayerHit, 1, DS2_VOLMAX, DS2_CENTER);
	
    Camera.SetPanOffset(entCamera, 0, .5);
    Camera.SetSpeed(entCamera, 8.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptMM");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path30", 0, 0, 0, 0, .4);
    
    Script.WaitSec(1.5); --FALLING INTO WATER
  
    --Player Fall
	Sound.Play(smpSsa1ScreamF, 1, DS2_VOLMAX, DS2_CENTER);
	
	Script.WaitSec(.8);
		  	
    --Hit Water 
	Sound.Play(smpFallInWater, 1, 1.5, DS2_CENTER);    	
    EntGame.EnablePlayerControl(FALSE); --DEACTIVATE PLAYER
    	
	Script.WaitSec(.7);
		 
    Camera.SetPanOffset(entCamera, 15, 0.5);	
    Camera.SetTiltOffset(entCamera, -10, .5);	
    Camera.SetSpeed(entCamera, 2.0, 0.1);
    Camera.StopAtWaypoint(entCamera, "CamWptVV");
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 0, ST_GRAZING, 21, 0, 0, .9);
    Animal.EnableFear(a, false);
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath1", 2, ST_GRAZING, 20, 0, 0, .9);
    Animal.EnableFear(a, false);
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "LongerPath1", 3, ST_GRAZING, 19, 0, 0, .9);
    Animal.EnableFear(a, false); 
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "LongerPath1", 4, ST_GRAZING, 18, 0, 0, .9);
    Animal.EnableFear(a, false);
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path21", 0, ST_GRAZING, 30, 13, 0, 2.0); --IN THE WATER
 	Animal.EnableFear(a, false);
	Animal.SetElvOffset(a, 1.4);
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path20", 0, ST_GRAZING, 25, 10, 0, .9); --IN THE WATER
 	Animal.EnableFear(a, false);
	Animal.SetElvOffset(a, 1.4);	
	
    Script.WaitSec(1.5); 
    	
    Camera.SetPanOffset(entCamera, 0, 0.5);	
    Camera.SetTiltOffset(entCamera, 0, .5);	
    	
    Script.WaitSec(3.8);
    	
    --Rise from water 
	Sound.Play(smpHeadAboveWater, 1, 1.5, DS2_CENTER); 	
    EntGame.EnablePlayerControl(TRUE); --DEACTIVATE PLAYER
	
	Script.WaitSec(2.2);
			
    Camera.SetPanOffset(entCamera, -90, 1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, -6, 0, -6, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, 2, -1, -2, 1.2);
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, -1, 2, -1, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, -2, 1.5, 5, .8);
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, 3, 0, 0, .9);
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, 0, -1, .5, 1.7);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, -3.5, 2.5, 3.5, .7);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, -1, 0, -1, 1.3);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, 0, -1, 0, 1.7);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path22", 0, -2, 3, -2, 1.0);
    Script.WaitSec(4); 
    Camera.SetPanOffset(entCamera, 15, 1.5);
    
    a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path23", 0, ST_WPT_WALK, 22, 0, 0, .9);
    Animal.SetElvOffset(a, 1.2);
	Animal.SetChargeWhenShot(a, true);
	Animal.SetAttackType(a, ATK_STRAFE);
	Animal.SetAutoChargeDist(a, 18);	
	Animal.SetAttackRepeat(a, 1);        
	
    a1=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "Path25", 0, ST_WPT_WALK, 22, 0, 0, .9);
    Animal.SetElvOffset(a1, 1.0);
	Animal.SetChargeWhenShot(a1, true);
	Animal.SetAttackType(a1, ATK_STRAFE);
	Animal.SetAutoChargeDist(a1, 25);	
	Animal.SetAttackRepeat(a1, 1);     
	       
    	Script.WaitSec(8);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "MediumPath2", 0, ST_WPT_RUN, 22, 0, 0, .9);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, -6, 0, -6, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, 2, -1, -2, 1.2);
    	Script.WaitSec(1.0);
    Camera.SetTiltOffset(entCamera, 15, 1.5);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, -1, 0, -1, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, -2, 1.5, 5, .8);
    	Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "MediumPath2", 0, ST_WPT_RUN, 22, 0, 0, .9);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, 3, 0, 0, .9);
    
	a2=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "MediumPath2", 0, ST_WPT_WALK, 22, 0, 0, .5);
	Animal.EnableFear(a2, false);
	Animal.FaceEntity(a2, entCamera);
	Animal.SetAttackType(a2, ATK_STRAFE);
	Animal.SetAutoChargeDist(a2, 10);	
	Animal.SetAttackRepeat(a2, 1);    	
    Entity.SetName(a2, "HIPPO7"); 
    
    --Jungle Bird Call 
	Sound.Play(smpJungleCall1, 1, 1, DS2_CENTER);
	   
    	Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, 0, -1, 0, 1.7);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, -3.5, 0, 3.5, .7);
        Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "MediumPath2", 0, ST_WPT_RUN, 22, 0, 0, .9);    
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, -1, 0, -1, 1.3);
    	Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, 0, -1, 0, 1.7);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, -2, 0, -2, 1.0);

    	Script.WaitSec(3); 
    	
    --Jungle Bird Call 
	Sound.Play(smpJungleCall1, 1, 1, DS2_CENTER);
		   	
    ab=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path27", 0, ST_GRAZING, 40, 0, 0, .9);
    Animal.EnableFear(ab, false);
	Animal.SetElvOffset(ab, 1.4);
    ac=EntGame.SpawnAnimalOnPath(AID_IMPALA_M, "Path25", 0, ST_GRAZING, 40, 0, 0, .9);
    Animal.EnableFear(ac, false);
	Animal.SetElvOffset(ac, 1.4);	
   	ad=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path24", 0, ST_GRAZING, 40, 0, 0, .9);
    Animal.EnableFear(ad, false);
	Animal.SetElvOffset(ad, 1.5);
    	Script.WaitSec(1);
    Camera.SetTiltOffset(entCamera, 0, 1.5);
    Camera.SetPanOffset(entCamera, -20, 1.5);
    	Script.WaitSec(3); 
    	
    --Jungle Bird Call 
	Sound.Play(smpJungleCall1, 1, 1, DS2_CENTER);
		   		
    Camera.SetPanOffset(entCamera, 10, 1.5);	
    	Script.WaitSec(5);
    
    --Jungle Bird Call 
	Sound.Play(smpJungleCall1, 1, 1, DS2_CENTER);
		
    Run("HIPPO7");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path29", 0, 0, 0, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path29", 0, 2, -1, -2, 1.2);
    	Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path29", 0, -1.5, 1, -1, 1.0);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path29", 0, 0, 0, 0, .8);
    a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongerPath1", 0, ST_GRAZING, 40, 0, 0, .2);
	Animal.EnableFear(a, false);
    Entity.SetName(a, "HIPPO8"); 
       
    a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongerPath1", 2, ST_GRAZING, 40, 0, 0, .1);
	Animal.EnableFear(a, false);
	Animal.SetChargeWhenShot(a, true);
	Animal.SetAttackType(a, ATK_STRAFE);
	Animal.SetStrafeAttackDist(a, 6);
	Animal.SetPostAttackTimer(a, 0);
	Animal.SetAutoChargeDist(a, 12);	
    Entity.SetName(a, "HIPPO9");  	
    
    a=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "LongerPath1", 1, ST_GRAZING, 40, 0, 0, .1);
	Animal.EnableFear(a, false);
    Entity.SetName(a, "HIPP10");  	
    a=EntGame.SpawnAnimalOnPath(AID_IMPALA_F, "Path28", 0, ST_WPT_RUN, 40, 0, 0, .9);
    Animal.EnableFear(a, false);
    Entity.SetName(a, "IMPALA5");    
    	Script.WaitSec(2.0);
    Gone("HIPPO7");
    	Script.WaitSec(1.5);	  	
    Camera.SetPanOffset(entCamera, 0, 1.5);		
    Run("HIPPO9");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, 0, 0, 0, 1.8);    
    	Script.WaitSec(.5);
    Run("HIPPO8");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, 2, -1, -2, 1.8);        
		Script.WaitSec(.5);   		
	Run("HIPP10");
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, -1.5, 1, -1, 1.6);	
	    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path29", 0, -1.5, 1, -1, 1.6);	    
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path26", 0, 0, 0, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path29", 0, 0, 0, 0, 1.8); 
 
    end;    

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





