-----------------------------------------------------------------------------
-- Stage 2-6
-----------------------------------------------------------------------------
-- GLOBALS
    
function Run2(name)    
    local animal1;
	animal1 = Entity.FindName(entRoot, name);
	if (animal1) then
    	Animal.SetState(animal1, ST_WPT_RUN);
    	Animal.EnableFear(animal1, true);	
    	end;
    end;        
       
	--Create a flock of birds. For now, this works best for a Flying V formation, following a path along the -x axis.
function CreateFlock(birdType, numBirds, path, yOffsetMin, yOffsetMax, flockType, speedFactor)
	local alt = 1;
	local offset = 0;
	if flockType == "V" then
		s = 2;
	else
		end   -- end if statement
	
	for i=0, numBirds-1, 1 do
		entGoose01=EntGame.SpawnBirdOnPath(birdType, path, 0, (s*offset), math.random(yOffsetMin, yOffsetMax), alt*(s*offset), speedFactor);
		Animal.FaceEntity(entGoose01, entCamera);
		alt = alt * (-1);
		if (i - math.floor(i/offset) * offset) == 0 then
			offset = offset + s;
		elseif  i == 0 then
			offset = offset + s;
		else
			end --end if statement
		end -- end for loop
		
	end;
	    
-----------------------------------------------------------------------------    

function PostStage()

    EntGame.EnablePlayerControl(false);
    EntGame.ClearFlag(GF_READYTOSTART);
    EntGame.BindCameraToEntity("IntroCamera");

    end;    

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

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

    -- load world
    SetupWorld("Maps\\WorldJungle\\DenseJungle.ini", "Maps\\Stage2-6\\Stage2-6.ini","","");
    EntGame.CreatePlayerEntities();

    EntGame.SetGlobalDustColorInitial(0.2, 0.2, 0.2, 0.0);
	EntGame.SetGlobalDustColorFinal  (0.2, 0.2, 0.2, 0.0);
		   
    EntGame.SetStageTimer(150);
    
    EntGame.LoadAnimal(AID_HIPPO_M);
	EntGame.LoadAnimal(AID_LEOPARD_M);	
	EntGame.LoadAnimal(AID_HARE_M);
	EntGame.LoadAnimal(AID_RHINO_M);
	EntGame.LoadAnimal(AID_MEERKAT_M);
	EntGame.LoadAnimal(AID_SPURWINGGOOSE_M);

	entCamera = Entity.FindName(entRoot, "IntroCamera");
	Camera.JumpToWaypoint(entCamera, "CamWptAA");   
	Camera.SetSpeed(entCamera, .4, .01); 
	

    EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "PondPath01", 0, ST_GRAZING, 200,0,0,1);	   
	StartupSequence("Music\\Verdure.ogg");
        
	EntGame.DestroyAllAnimals();

    end;


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

function Part1()	
 
	Camera.SetSpeed(entCamera, .1, .01); 
	Camera.JumpToWaypoint(entCamera, "CamWptAA");   

	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepTreePath03", 0, ST_GRAZING, 20,0,0,1);	 
 	Animal.SetElvOffset(A,3.15);
	Animal.FaceEntity(A, entCamera );
	Animal.EnableFear(A,false);
	Animal.SetCoinMode (A, CM_SPAWNREL);

	--Spawn Tree LEOPARDs
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepStartPath01", 0, ST_GRAZING, 10,0,0,1);	 
 	Animal.SetElvOffset(A,4.85);
	Animal.FaceEntity(A, entCamera );
	Animal.EnableFear(A,false);
	Animal.SetCoinMode (A, CM_SPAWNREL);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepStartPath02", 0, ST_WPT_WALK, 10,0,0,.5);	 
	Animal.SetElvOffset(A,6.1);
	Animal.FaceEntity(A, entCamera );
	Animal.EnableFear(A,true);
	Animal.SetCoinMode (A, CM_SPAWNREL);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepHighPath01", 0, ST_GRAZING, 20,0,0,1);	 
 	Animal.SetElvOffset(A,4.85);
	Animal.FaceEntity(A, entCamera );
	Animal.EnableFear(A,false);
	Animal.SetCoinMode (A, CM_SPAWNREL);
	Script.WaitSec(1);
	Camera.SetSpeed(entCamera, .5, 1); 
	Script.WaitSec(2);
	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "LepRunPath01", 0, ST_WPT_RUN, 35,0,0,1);	 
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepRunPath01", 0, ST_WPT_RUN, 35,0,0,1);	 
	Animal.FaceEntity(A, entCamera );
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepRunPath02", 0, ST_WPT_RUN, 35,0,0,1);	 
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepRunPath02", 0, ST_WPT_RUN, 35,0,0,1);	 
	Camera.SetSpeed(entCamera, 1.4, 1); 

	Script.WaitSec(4);
	--Spawn Charging Group
	a = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepRunPath03a", 0, ST_WPT_RUN, 35,0,0,.8);	
	Animal.FaceEntity(a, entCamera );
	Animal.SetChargeWhenShot(a, true);
	Animal.SetAttackType(a, ATK_STRAFE);
	a = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepRunPath03b", 0, ST_WPT_RUN, 35,0,0,.9);	 	
	Animal.FaceEntity(a, entCamera );		
	Animal.SetAttackType(a, ATK_STRAFE);
	Animal.SetAutoChargeDist(a, 15.0);
	a = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepRunPath03c", 0, ST_WPT_RUN, 35,0,0,.8);	
	Animal.FaceEntity(a, entCamera );		
	Animal.SetChargeWhenShot(a, true);
	Animal.SetAttackType(a, ATK_STRAFE);
		
	Camera.StopAtWaypoint(entCamera, "CamWptBB");  
	Script.WaitSec(3);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepHighPath02", 0, ST_GRAZING, 35,0,0,1);	 
	Animal.SetElvOffset(A,5.65);
	Animal.FaceEntity(A, entCamera );
	Animal.EnableFear(A,false);
	Animal.SetCoinMode (A, CM_SPAWNREL);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepHighPath03", 0, ST_GRAZING, 35,0,0,1);	 
	Animal.SetElvOffset(A,3.35);
	Animal.FaceEntity(A, entCamera );
	Animal.EnableFear(A,false);
	Animal.SetCoinMode (A, CM_SPAWNREL);
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, entCamera);
	Script.WaitSec(4);
	Camera.SetPanOffset(entCamera, 110, 1.5);
	FaceObj =  Entity.FindName(entRoot, "BananaTree01");
			
	--Spawn stuff while looking into the jungle
	a = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "RhinoChargePath01", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.SetAutoChargeDist(a, 15);	
	Animal.SetAttackType(a, ATK_STATIC);
	Animal.SetStaticAttackDist(a, 5);
	Animal.SetAttackRepeat(a, 1);
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, -90);  
	Script.WaitSec(6);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitHousePath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitHousePath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(.5);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitHousePath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	
	Script.WaitSec(1.5);
	Camera.StopAtWaypoint(entCamera, "CamWptDD");  
	Camera.SetSpeed(entCamera, 1.5, 1); 
	Camera.SetPanOffset(entCamera, 0, 2.0);
		
	Script.WaitSec(1);
	A=EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatPopupPath01", 0, ST_POPUP, 10, 0, 0, 1);     
	Animal.SetElvOffset(A, 1.6); 
	Animal.FaceEntity(A, entCamera);
	Animal.SetCoinMode (A, CM_SPAWNREL);
	A=EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "WaterFallPath01", 0, ST_GRAZING, 12,0,0,1);
	Animal.EnableFear(A,false);
	Animal.SetAutoChargeDist(A, 10);	
	Animal.SetAttackType(A, ATK_STRAFE);   
	Script.WaitSec(3);
	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_MEERKAT_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(2);

	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(2);
		
	--Spawn Emerging Hippo
	
	entHippo = EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "PondPath01", 0, ST_GRAZING, 200,0,0,1);	
	Animal.EnableFear(entHippo,false);
	Animal.FaceEntity(entHippo, entCamera );
	Animal.SetElvOffset(entHippo, -2);
	Animal.SetCoinMode(entHippo, CM_SPAWNREL);
	Animal.SetAutoChargeDist(entHippo, 15);	
	Animal.SetAttackType(entHippo, ATK_STATIC);
	Animal.SetStaticAttackDist(entHippo, 3.5);
	Animal.SetAttackRepeat(entHippo, 1);
	Animal.SetPostAttackRand(entHippo, false);
	Animal.SetPostAttackDir(entHippo, -90);	   
	Entity.SetName(entHippo, "Hippo");
		
	for i=-200, 20, 1 do	
	    animalX1 = Entity.FindName(entRoot, "Hippo");
	    if (animalX1) then	        
            Animal.SetElvOffset(animalX1, i*.01+.01);
		    end;
        Script.WaitTime(0.1);			
        end;  
	
    Run2("Hippo");
    Script.WaitSec(1);
    A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);			
	Script.WaitSec(1);	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);		
		
	--Spawn Waterfall Hippos	
	Camera.StopAtWaypoint(entCamera, "CamWptEE");  
	A = EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "WaterFallPath01", 0, ST_WPT_RUN, 10,0,0,.5);
	Animal.SetAutoChargeDist(A, 15);	
	Animal.SetAttackType(A, ATK_STATIC);
	Animal.SetStaticAttackDist(A, 3.5);
	Animal.SetAttackRepeat(A, 1); 
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, 90);	 
	   		
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);
		
	Hippo = EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "WaterFallPath02", 0, ST_WPT_WALK, 10,0,0,1);	
	Animal.SetAutoChargeDist(Hippo, 15);
	Animal.SetAttackType(Hippo, ATK_STRAFE);
	Animal.SetStrafeAttackDist(Hippo, 6.0);
	Animal.SetAttackRepeat(Hippo, 1);
	Animal.EnableFear(Hippo,false);
	Animal.SetPostAttackTimer(Hippo, 0);	
	Entity.SetName(Hippo, "Hippo");
	
	Script.WaitSec(7);	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);	
	Run2("Hippo");
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "MeerkatLogPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);  
	Animal.FaceEntity(A, FaceObj);	
				
	Script.WaitSec(1);
	
    Camera.SetSpeed(entCamera, 1.5, 1); 

    end; 
       
-----------------------------------------------------------------------------


function Part2()	
	
	--Camera.SetSpeed(entCamera, .01, .01); 
	--Camera.JumpToWaypoint(entCamera, "CamWptEE");
	
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "RhinoDistancePath01", 0, ST_WPT_WALK, 5, 0, 0, 1); 
	Animal.EnableFear(A,false);	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitFamilyPath01", 0, ST_GRAZING, 4, 1.5, -1.5, .8);  
	Animal.EnableFear(A,false);		
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitFamilyPath01", 0, ST_GRAZING, 4, 0, 0, .8);  
	Animal.EnableFear(A,false);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitFamilyPath02", 0, ST_GRAZING,3, 0, 0, .8);  
	Animal.EnableFear(A,false);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitFamilyPath03", 0, ST_GRAZING, 4, 0, 0, .7);
	Animal.EnableFear(A,false);				
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitFamilyPath03", 0, ST_WPT_WALK, 8,1, .4, .7);  
	Animal.EnableFear(A,false);				
				
--Camera.SetFov(entCamera, 50, 1.5);
	Script.WaitSec(4);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitRunPath01", 0, ST_WPT_RUN, 10, 0, 0, 1);	
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(3);
		
	--Spawn rabbits off camera to run in
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitRunPath01", 0, ST_WPT_RUN, 10, 0, 0, .7);	
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitRunPath02", 0, ST_WPT_WALK, 10, 0, 0, 1.2); 
	Animal.EnableFear(A,false);
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitRunPath01", 0, ST_WPT_RUN, 10, 0, 0, 1.2); 
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitRunPath02", 0, ST_WPT_RUN, 10, 0, 0, .8); 
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(3);
		
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LepTreePath03", 0, ST_GRAZING, 20,0,0,1);	 
 	Animal.SetElvOffset(A,3.15);
	Animal.FaceEntity(A, entCamera );
	Animal.EnableFear(A,false);
	Animal.SetCoinMode (A, CM_SPAWNREL);
		
	Camera.SetFov(entCamera, 60, 2);
	Camera.SetSpeed(entCamera, 1.5, 1); 
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, 1); 
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(.5);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, .9); 
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(.5);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, .8); 
	Animal.FaceEntity(A, entCamera );		
	Script.WaitSec(2);
	CreateFlock(AID_SPURWINGGOOSE_M, 4, "RhinoChargePath02", -2.0, 2.0, "V", .5 );
	Camera.StopAtWaypoint(entCamera, "CamWptII");  
	Script.WaitSec(5);
	CreateFlock(AID_SPURWINGGOOSE_M, 4, "RhinoChargePath02", -2.0, 2.0, "V", .5 );	
	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "HollowTreePath", 0, ST_WPT_RUN, 10, 0, 0, .8); 
	Animal.FaceEntity(A, entCamera );
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, .8); 
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(1.0);	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "HollowTreePath", 0, ST_WPT_RUN, 10, 0, 0, .8); 
	Animal.FaceEntity(A, entCamera );	
	Script.WaitSec(.5);	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "HollowTreePath", 0, ST_WPT_RUN, 10, 0, 0, .8); 
	Animal.FaceEntity(A, entCamera );		
	Script.WaitSec(7.5);
	
	--ARRIVED AT NEW LOCATION
	FaceObj =  Entity.FindName(entRoot, "BananaTree01");
	
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "ForestPath01", 0, ST_WPT_RUN, 35,0,0,1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, 1); 
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(.5);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, .9); 
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(.5);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, .8); 
	Animal.FaceEntity(A, FaceObj);		
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "ForestPath02", 0, ST_WPT_RUN, 35,0,0,1);	
	Script.WaitSec(3);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "ForestPath03", 0, ST_WPT_RUN, 35,0,0,1);
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, 1); 
	Animal.FaceEntity(A, FaceObj);	
	EntGame.SpawnAnimalOnPath(AID_RHINO_M, "ForestPath01", 0, ST_WPT_RUN, 35,0,0,.8);
	Script.WaitSec(1);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "ForestPath02", 0, ST_WPT_RUN, 35,0,0,1);
	Script.WaitSec(4);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, 1); 
	Animal.FaceEntity(A, FaceObj);	
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "ForestPath01", 0, ST_WPT_RUN, 35,0,0,1);
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath03", 0, ST_WPT_RUN, 10, 0, 0, 1); 
	Animal.FaceEntity(A, FaceObj);	
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "ForestPath02", 0, ST_WPT_RUN, 35,0,0,1);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "ForestPath03", 0, ST_WPT_RUN, 35,0,0,1);
	Script.WaitSec(3);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, FaceObj);	
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath03", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, FaceObj);
	Script.WaitSec(1);
	FaceObj =  Entity.FindName(entRoot, "BananaTree01");
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "ForestPath01", 0, ST_WPT_RUN, 35,0,0,1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, FaceObj);	
	Script.WaitSec(.5);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath02", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, FaceObj);	
	Script.WaitSec(1.5);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath03", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, FaceObj);

	Script.WaitSec(2);
		
    end;    

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

function Part3()
	
	--Camera.SetSpeed(entCamera, .01, .01); 
    --Camera.JumpToWaypoint(entCamera, "CamWptII");
    
	Camera.SetPanOffset(entCamera, 120, 1.5);
	FaceObj =  Entity.FindName(entRoot, "Tree114");
			
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "CavePath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.SetAutoChargeDist(A, 15);	
	Animal.SetAttackType(A, ATK_STATIC);
	Animal.SetAttackRepeat(A, 1);  
	Animal.SetStaticAttackDist(A, 3.5);
	Animal.FaceEntity(A, entCamera );
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, -90);	
	
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "LeftMountainPath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.SetAutoChargeDist(A, 15);	
	Animal.SetAttackType(A, ATK_STATIC);
	Animal.SetStaticAttackDist(A, 3.5);
	Animal.SetAttackRepeat(A, 1); 
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, 90);		
	Animal.FaceEntity(A, entCamera );
	
	CreateFlock(AID_SPURWINGGOOSE_M, 4, "BirdPath01", -2.0, 2.0, "V", .5 );
	
	Script.WaitSec(3);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "RightMountainPath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.FaceEntity(A, entCamera );
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath04", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, entCamera);
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath04", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, entCamera);
	Script.WaitSec(3);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "HollowTreePath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.FaceEntity(A, entCamera );
	
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "RightMountainPath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.FaceEntity(A, entCamera );
	Animal.SetAutoChargeDist(A, 15);
	Animal.SetAttackType(A, ATK_STATIC);
	Animal.SetStaticAttackDist(A, 3.5);
	Animal.SetAttackRepeat(A, 1); 
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, -90);		
	
	Script.WaitSec(2.5);
	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath04", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, entCamera);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LeftMountainPath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.FaceEntity(A, entCamera );
	
	CreateFlock(AID_SPURWINGGOOSE_M, 4, "BirdPath01", -2.0, 2.0, "V", .5 );
			
	Script.WaitSec(2);
	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath04", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, entCamera);
		
	Script.WaitSec(2);
	
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "HollowTreePath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.FaceEntity(A, entCamera );
	
	Script.WaitSec(2);
	
	CreateFlock(AID_SPURWINGGOOSE_M, 4, "BirdPath01", -2.0, 2.0, "V", .5 );
	
	A = EntGame.SpawnAnimalOnPath(AID_HIPPO_M, "CavePath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.SetAutoChargeDist(A, 15);	
	Animal.SetAttackType(A, ATK_STATIC);
	Animal.SetAttackRepeat(A, 1);  
	Animal.SetStaticAttackDist(A, 3.5);
	Animal.FaceEntity(A, entCamera );
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, -90);
		
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath04", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, entCamera);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "HollowTreePath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.FaceEntity(A, entCamera );
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "RightMountainPath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.FaceEntity(A, entCamera ); 
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LeftMountainPath", 0, ST_WPT_RUN, 35,0,0,1);
	Animal.FaceEntity(A, entCamera );
	
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_HARE_M, "RabbitLogPath04", 0, ST_WPT_RUN, 10, 0, 0, 1);   
	Animal.FaceEntity(A, entCamera);

    end;    
    
-----------------------------------------------------------------------------
-- Main entry point

Setup();   
Part1();   
Part2(); 
Part3();


