-----------------------------------------------------------------------------
-- Stage 3-6
-----------------------------------------------------------------------------
-- GLOBALS
    
	--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");

	Sound.Release(smpRumble);

    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\\Stage3-6\\Stage3-6.ini","","");
    EntGame.CreatePlayerEntities();

    EntGame.SetGlobalDustColorInitial(0.2, 0.4, 0.3, 0.0);
	EntGame.SetGlobalDustColorFinal  (0, 0.4, 0.2, 0.0);
		
	EntGame.SetStageTimer(205);
	
    -- load sounds
    smpRumble= Sound.Load("Sound\\Environment\\EarthRumble-E.wav");    

	EntGame.LoadAnimal(AID_RHINO_M);
	EntGame.LoadAnimal(AID_VULTURE_M);
	EntGame.LoadAnimal(AID_BUFFALO_M);
	EntGame.LoadAnimal(AID_LEOPARD_M);

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

	--Spawn intro animals
	FaceObj = Entity.FindName(entRoot, "DeadTree03");	
    A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath02", 0, ST_PERCH, 200,0,0,1);
	Animal.FaceEntity(A, FaceObj);	
	Animal.EnableFear(A,false);
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath00", 0, ST_PERCH, 200,0,0,1);
	Animal.FaceEntity(A, entCamera);	
	Animal.EnableFear(A,false);
	
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloStartPath01", 0, ST_WPT_WALK, 200,0,0,1);
	
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloStartPath03", 0, ST_GRAZING, 8,0,0,1);
	Animal.SetElvOffset(A,0.5);
	Animal.SetCoinMode(A, CM_SPAWNREL);

	StartupSequence("Music\\Dreamscape.ogg");		
	
	EntGame.DestroyAllAnimals();
	
    end;

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

function Part1()	
 	
	Camera.JumpToWaypoint(entCamera, "CamWptAA");   
	Camera.SetSpeed(entCamera, 0.5, .5);  
		
	FaceObj = Entity.FindName(entRoot, "DeadTree03");	
    A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath02", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);	
	Animal.EnableFear(A,false);
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath00", 0, ST_PERCH, 40,0,0,1);
	Animal.FaceEntity(A, entCamera);	
	Animal.EnableFear(A,false);
	a = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloStartPath01", 0, ST_WPT_WALK, 200,0,0,1.5);
	Animal.EnableFear(a,false);
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloStartPath03", 0, ST_GRAZING, 8,0,0,1);
	Animal.SetElvOffset(A,0.5);
	Animal.SetCoinMode(A, CM_SPAWNREL);		
	Script.WaitSec(2);
	Camera.SetSpeed(entCamera, 0.001, .5);  
	
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloEarlyChargePath00", 0, ST_WPT_RUN, 200,0,0,0.5);
	Animal.FaceEntity(A, entCamera);	
	Animal.SetAutoChargeDist(A, 15.0);
	Animal.SetElvOffset(A,0.5);
	Animal.SetCoinMode(A, CM_SPAWNREL);
	Animal.SetAttackRepeat(A, 1);
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, -90);
	
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloEarlyChargePath01", 0, ST_WPT_RUN, 200,0,0,0.8);
	Animal.FaceEntity(A, entCamera);	
	Animal.SetAutoChargeDist(A,15.0);
	Animal.SetElvOffset(A,0.5);
	Animal.SetCoinMode(A, CM_SPAWNREL);
	Animal.SetAttackRepeat(A, 1);
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, 90);
		
	Script.WaitSec(10);
	Camera.SetSpeed(entCamera, 3.0, .8);  
	Script.WaitSec(2);

	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloAbovePath01", 0, ST_WPT_RUN, 200,0,0,0.5);
	Animal.FaceEntity(A, entCamera);	
	Script.WaitSec(2)
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloAbovePath01", 0, ST_WPT_RUN, 200,0,0,0.5);
	Animal.FaceEntity(A, entCamera);	

	Script.WaitSec(3);
	FaceObj = Entity.FindName(entRoot, "DeadTree03");	
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath04", 0, ST_PERCH, 40,0,0,1);
	Animal.FaceEntity(A, FaceObj);
	Animal.SetCoinMode(A, CM_TERRAINREL);
	Animal.SetCoinOffset(A, 1.3);
	Animal.EnableFear(A,false);
	FaceObj = Entity.FindName(entRoot, "VultureTree04");	
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath03", 0, ST_PERCH, 40,0,0,1);
	Animal.FaceEntity(A, FaceObj);
	Animal.EnableFear(A,false);

	Script.WaitSec(1);	
	
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "BunnyPath1", 0, ST_WPT_FLY, 20,0,0,.5);
			
	FaceObj = Entity.FindName(entRoot, "DeadTree17");	
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath05", 0, ST_PERCH, 40,0,0,1);
	Animal.FaceEntity(A, FaceObj);
	Animal.EnableFear(A,false);
			
	Camera.StopAtWaypoint(entCamera, "CamWptGG");
		
	Script.WaitSec(3);

	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "BunnyPath1", 0, ST_WPT_FLY, 20,0,0,.5);
	
	Camera.SetSpeed(entCamera, 2.0, 1.0); 
	
	Script.WaitSec(3);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "BunnyPath1", 0, ST_WPT_FLY, 20,0,0,.5);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "BunnyPath1", 0, ST_WPT_FLY, 20,0,0,.5);	
	Script.WaitSec(10);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "BunnyPath2", 0, ST_WPT_FLY, 20,0,0,.5);
	Script.WaitSec(3);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "BunnyPath2", 0, ST_WPT_FLY, 20,0,0,.5);
	Script.WaitSec(2);
	
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VultureFlyPath01", 0, ST_WPT_FLY, 200,0,0,1.0);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VultureFlyPath01", 0, ST_WPT_FLY, 200,2,2,1.0);
	Script.WaitSec(4);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VultureFlyPath01", 0, ST_WPT_FLY, 200,6,2,1.0);
	Script.WaitSec(1);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VultureFlyPath01", 0, ST_WPT_FLY, 200,0,0,1.0);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VultureFlyPath01", 0, ST_WPT_FLY, 200,6,6,1.0);
	Script.WaitSec(5);
				
	Camera.SetPanOffset(entCamera, 100, 3)
	Camera.SetTiltOffset(entCamera, -30, 3)

	--Spawn pair of rhinos charging up behind you
	Sound.Play(smpRumble, 35, 10, DS2_CENTER);
	EntGame.ShowCaption(STR_LVL_3_6_A, 0, 4.0);
	Script.WaitSec(5);

	BridgeRhino1 = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "StampedePath01", 0, ST_WPT_RUN, 200,0,0,1);
	Entity.SetName(BridgeRhino1, "BridgeRhino1");
	Animal.SetElvOffset(BridgeRhino1,0.3);
	Animal.SetCoinMode(BridgeRhino1, CM_SPAWNREL);
	Animal.FaceEntity(BridgeRhino1, entCamera);
	Script.WaitSec(1);
	BridgeRhino2 = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "StampedePath01", 0, ST_WPT_RUN, 200,0,0,.9);
	Entity.SetName(BridgeRhino2, "BridgeRhino2");
	Animal.SetElvOffset(BridgeRhino2,0.5);
	Animal.SetCoinMode(BridgeRhino2, CM_SPAWNREL);
	Animal.FaceEntity(BridgeRhino2, entCamera);
	Script.WaitSec(1);
	BridgeRhino3 = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "StampedePath01", 0, ST_WPT_RUN, 200,0,0,.8);
	Entity.SetName(BridgeRhino3, "BridgeRhino3");
	Animal.SetElvOffset(BridgeRhino3,0.5);
	Animal.SetCoinMode(BridgeRhino3, CM_SPAWNREL);
	Animal.FaceEntity(BridgeRhino3, entCamera);
	
	Script.WaitSec(4);	
	Camera.SetTiltOffset(entCamera, -50, 3.0)
	Camera.SetPanOffset(entCamera, -50, 3.0)
	
	FaceObj = Entity.FindName(entRoot, "DeadTree03");
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath00", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);	
	Animal.EnableFear(A,false);
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath03", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);	
	Animal.EnableFear(A,false);
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath04", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);
	Animal.SetCoinMode(A, CM_TERRAINREL);
	Animal.SetCoinOffset(A, 1.3);
	Animal.EnableFear(A,false);
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath05", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);
	Animal.EnableFear(A,false);
		
	Script.WaitSec(3);
	
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "BunnyPath3", 0, ST_WPT_FLY, 20,0,0,.5);
	
	Camera.SetTiltOffset(entCamera, 0, 3.0)
	Camera.SetPanOffset(entCamera, -100, 3.0)
		
	Script.WaitSec(2);
	Camera.SetPanOffset(entCamera, -180, 3.0)
	Script.WaitSec(2);
		
	--Lock the height of the rhinos so they can cross the bridge (if they're still alive.)
	
	Script.WaitSec(3);
	
	animal1 = Entity.FindName(entRoot, "BridgeRhino1");
	if (animal1) then
		Animal.SetSnapToTerrain(BridgeRhino1,False);
		Animal.SetCoinMode (BridgeRhino1, CM_SPAWNREL);
		Animal.SetAttackType(BridgeRhino1, ATK_STRAFE);
		Animal.SetAutoChargeDist(BridgeRhino1, 15.0);
		Animal.SetStrafeAttackDist(BridgeRhino1, 6);
		Animal.SetPostAttackRand(BridgeRhino1, false);
		Animal.SetPostAttackDir(BridgeRhino1, 50);	
		else
	end;
		
	Script.WaitSec(1);
	Camera.SetSpeed(entCamera, 1.5, 1); 
	Script.WaitSec(1);
	
	animal1 = Entity.FindName(entRoot, "BridgeRhino2");
	if (animal1) then
		Animal.SetSnapToTerrain(BridgeRhino2,False);
		Animal.SetCoinMode (BridgeRhino2, CM_SPAWNREL);
		Animal.SetAttackType(BridgeRhino2, ATK_STRAFE);
		Animal.SetAutoChargeDist(BridgeRhino2, 20.0);
		Animal.SetStrafeAttackDist(BridgeRhino2, 5.5);
		Animal.SetPostAttackRand(BridgeRhino2, false);
		Animal.SetPostAttackDir(BridgeRhino2, -50);
		else
	end;
	
	Script.WaitSec(1);
	
	animal1 = Entity.FindName(entRoot, "BridgeRhino3");
	if (animal1) then
		Animal.SetSnapToTerrain(BridgeRhino3,False);
		Animal.SetCoinMode (BridgeRhino3, CM_SPAWNREL);
		Animal.SetAttackType(BridgeRhino3, ATK_STRAFE);
		Animal.SetAutoChargeDist(BridgeRhino3, 20.0);
		Animal.SetStrafeAttackDist(BridgeRhino3, 5.5);
		Animal.SetPostAttackRand(BridgeRhino3, false);
		Animal.SetPostAttackDir(BridgeRhino3, 50);
		else
	end;
	
	Script.WaitSec(2);
	
	Camera.SetPanOffset(entCamera, 0, 3.0)
	Script.WaitSec(3);
	FaceObj = Entity.FindName(entRoot, "DeadTree19");	
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath06", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);
			
	FaceObj = Entity.FindName(entRoot, "DeadTree11");	
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath07", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);
	EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VultureFlyPath02", 0, ST_WPT_FLY, 200,0,0,1.0);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "RoadPath01", 0, ST_WPT_RUN, 20,0,0,1);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "RoadPath01", 0, ST_WPT_RUN, 20,2,0,1);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "RoadPath01", 0, ST_WPT_RUN, 20,0,0,1);
	Script.WaitSec(6);
	Camera.StopAtWaypoint(entCamera, "CamWptII");
	Script.WaitSec(1);	

    end;    

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

function Part2()	

	--Camera.JumpToWaypoint(entCamera, "CamWptII");   
	--Camera.SetSpeed(entCamera, .01, .5); 
	
	Camera.SetFov(entCamera, 50, 3);
	Camera.SetPanOffset(entCamera, 10, 3.0)		

	Script.WaitSec(3);	
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath00", 0, ST_WPT_RUN, 20,0,0,0.70);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath01", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath04", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath03", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath02", 0, ST_WPT_RUN, 20,0,0,1.2);
	Script.WaitSec(5);	
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath00", 0, ST_WPT_RUN, 20,0,0,0.70);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath04", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath01", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath02", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath03", 0, ST_WPT_RUN, 20,0,0,1.2);
	Script.WaitSec(5);	
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath01", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_RHINO_M, "LedgePath03", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath02", 0, ST_WPT_RUN, 20,0,0,1.2);	
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LedgePath01", 0, ST_WPT_RUN, 20,0,0,1.2);
	Script.WaitSec(5);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LedgePath01", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath02", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "LedgePath04", 0, ST_WPT_RUN, 20,0,0,1.2);
	Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_RHINO_M, "LedgePath00", 0, ST_WPT_RUN, 20,0,0,1.0);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LedgePath02", 0, ST_WPT_RUN, 20,0,0,1.2);
	EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "LedgePath04", 0, ST_WPT_RUN, 20,0,0,1.2);			
	Script.WaitSec(7);

	Camera.StopAtWaypoint(entCamera, "CamWptLL");
	Camera.SetFov(entCamera, 60, 3.0);
	Camera.SetPanOffset(entCamera, -40, 2.0)
	Camera.SetSpeed(entCamera, .5, 1.0); 
	
	Script.WaitSec(2);
	Camera.SetSpeed(entCamera, 2.0, 1.0);
	Script.WaitSec(2);	
		
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "CaveEmerge02", 0, ST_WPT_RUN, 20,0,0,1.0);
	Animal.FaceEntity(A, entCamera);
	Animal.SetAttackType(A, ATK_STRAFE);
	Animal.SetStrafeAttackDist(A, 5.5);
	Animal.SetAutoChargeDist(A, 8.0);
	Animal.SetElvOffset(A,0.2);
	Animal.SetCoinMode(A, CM_SPAWNREL);
			
	Script.WaitSec(4);
	Camera.SetPanOffset(entCamera, 0, 3.0);
	Script.WaitSec(6);

	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BuffaloGrazePath01", 0, ST_GRAZING, 3.50,0,0,1.0);
	Animal.EnableFear(A,false);
	Animal.FaceEntity(A, entCamera);
	Script.WaitSec(7);
		
	end;    

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

function Part3()	

	--Camera.JumpToWaypoint(entCamera, "CamWptLL");  
	--Camera.SetSpeed(entCamera, .01, .1);
							
	Camera.SetPanOffset(entCamera, 115, 1.50)
		
	FaceObj = Entity.FindName(entRoot, "DeadTree12");	
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath08", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);
		
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "RhinoChargePath01", 0, ST_WPT_RUN, 6.0,0,0,1.0);
	Animal.EnableFear(A,false);
	Animal.FaceEntity(A, entCamera);
	Animal.SetAttackType(A, ATK_STRAFE);
	Animal.SetStrafeAttackDist(A, 6.5);
	Animal.SetAutoChargeDist(A, 12.0);
	Animal.SetElvOffset(A,0.5);	
	Animal.SetCoinMode(A, CM_SPAWNREL);
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, -90);
		
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "RhinoChargePath02", 0, ST_WPT_RUN, 6.0,0,0,1.0);
	Animal.FaceEntity(A, entCamera);
	
	Script.WaitSec(8);
	
	FaceObj = Entity.FindName(entRoot, "DeadTree12");	
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath09", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);
	Camera.SetPanOffset(entCamera, 10, 1.5)
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "RhinoChargePath03", 0, ST_WPT_RUN, 6.0,0,0,1.0);
	Animal.EnableFear(A,false);
		
	Script.WaitSec(7);
	FaceObj = Entity.FindName(entRoot, "DeadTree22");	
	A = EntGame.SpawnAnimalOnPath(AID_VULTURE_M, "VulturePerchPath10", 0, ST_PERCH, 20,0,0,1);
	Animal.FaceEntity(A, FaceObj);
	Camera.SetPanOffset(entCamera, -40, 1.50)
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "SlopePath01", 0, ST_WPT_RUN, 6.0,0,0,1.0);
	Animal.EnableFear(A,false);

	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "SlopePath01", 0, ST_WPT_RUN, 6.0,0,0,1.0);	
	Script.WaitSec(4);
	Camera.SetPanOffset(entCamera, 0, 2.50)
		
	A = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "CavePath03", 0, ST_WPT_RUN, 6.0,0,0,.40);
	Animal.SetSnapToTerrain(A, false);
	Animal.FaceEntity(A, entCamera);	
	Animal.SetAttackType(A, ATK_STRAFE);
	Animal.SetStrafeAttackDist(A, 5.5);
	Animal.SetAutoChargeDist(A, 10.0);				
			
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "RhinoChargePath03", 0, ST_WPT_RUN, 6.0,.9,0,1.0);
	Animal.FaceEntity(A, entCamera);
	Animal.EnableFear(A,false);
	Script.WaitSec(2);
				
	cnOffset = 1.0;
				
	elevationOffset = 0.2;
	
	--THROUGH THE PASS
	Camera.SetSpeed(entCamera, 1.51, .1);

	Script.WaitSec(7);
	Camera.SetSpeed(entCamera, 1.91, .1);
	Sound.Play(smpRumble, 35, 10, DS2_CENTER);
	EntGame.ShowCaption(STR_LVL_3_6_B, 0, 4.0);
		
	Script.WaitSec(1);
	Camera.SetSpeed(entCamera, 2.51, .1);
	Camera.SetPanOffset(entCamera, 180, 2.20);
	
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BigStampedePath01", 0, ST_WPT_RUN, 0,-.5,0,1.0);
	Animal.FaceEntity(A, entCamera);
	Animal.SetElvOffset(A,elevationOffset);
	Animal.SetCoinMode(A, CM_SPAWNREL);
	Script.WaitSec(2);
		
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BigStampedePath02", 0, ST_WPT_RUN, 0,.5,0,1.0);
	Animal.FaceEntity(A, entCamera);
	Animal.SetElvOffset(A,elevationOffset);
	Animal.SetCoinMode(A, CM_SPAWNREL);
	Animal.SetAttackType(A, ATK_STRAFE);
	Animal.SetAutoChargeDist(A, 10.0);
	Animal.SetPostAttackRand(A, false);
	Animal.SetPostAttackDir(A, 50);	
				
	---Vultures swoop down from sky
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BigStampedePath01", 0, ST_WPT_RUN, 0,0,0,1.0);
	Animal.SetElvOffset(A,elevationOffset);
	Animal.SetCoinOffset(A, cnOffset);
	Animal.FaceEntity(A, entCamera);
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BigStampedePath02", 0, ST_WPT_RUN, 0,.5,0,1.0);
	Animal.SetElvOffset(A,elevationOffset);
	Animal.SetCoinOffset(A, cnOffset);
	Animal.FaceEntity(A, entCamera);		
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BigStampedePath01", 0, ST_WPT_RUN, 10.0,0,0,1.0);
	Animal.SetElvOffset(A,elevationOffset);
	Animal.FaceEntity(A, entCamera);
	Animal.SetCoinOffset(A, cnOffset);
	Script.WaitSec(1);
	A = EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BigStampedePath02", 0, ST_WPT_RUN, 10.0,0,0,1.0);
	Animal.SetElvOffset(A,elevationOffset);
	Animal.SetCoinOffset(A, cnOffset);
	Animal.FaceEntity(A, entCamera);
	Script.WaitSec(1);
	A = EntGame.SpawnBirdOnPath(AID_VULTURE_M, "VultureSwoopPath01", 0, 0, 5, 0, 1.0);
	Animal.FaceEntity(A, entCamera);
	Animal.SetCoinOffset(A, cnOffset);
	Script.WaitSec(2);
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BigStampedePath01", 0, ST_WPT_RUN, 0,1,0,1.0);
	Animal.SetElvOffset(A,elevationOffset);
	Animal.SetCoinOffset(A, cnOffset);
	Animal.FaceEntity(A, entCamera);
	A = EntGame.SpawnBirdOnPath(AID_VULTURE_M, "VultureSwoopPath01", 0, 1, 5, 0, 1.0);
	Animal.FaceEntity(A, entCamera);
	Animal.SetCoinOffset(A, cnOffset);
	Script.WaitSec(1.5);
	A = EntGame.SpawnBirdOnPath(AID_VULTURE_M, "VultureSwoopPath02", 0, 0, 6, 0, 1.0);
	Animal.FaceEntity(A, entCamera);
	Animal.SetCoinOffset(A, cnOffset);
	Script.WaitSec(1.5);
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BigStampedePath02", 0, ST_WPT_RUN, 0,1,0,.9);
	Animal.SetCoinOffset(A, cnOffset);
	Animal.FaceEntity(A, entCamera);		
	A = EntGame.SpawnBirdOnPath(AID_VULTURE_M, "VultureSwoopPath02", 0, -1, 7, 0, 1.0);
	Animal.FaceEntity(A, entCamera);
	Animal.SetCoinOffset(A, cnOffset);
	A = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BigStampedePath01", 0, ST_WPT_RUN, 0,-1,0,.9);
	Animal.SetElvOffset(A,elevationOffset);
	Animal.SetCoinOffset(A, cnOffset);
	Animal.FaceEntity(A, entCamera);
	

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

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





