-----------------------------------------------------------------------------
-- Stage 4-6
-----------------------------------------------------------------------------
-- GLOBALS
    
function Graze2(name)    
    local y;
    y = Entity.FindName(entRoot, name);
    if (y) then
        Animal.SetAiTimer(y, 0);
        Animal.EnableFear(y, false);
        Animal.SetState(y, ST_GRAZING);	
        end;
    end;
    
function Walk2(name)    
    local x;
    x = Entity.FindName(entRoot, name);
    if (x) then
        Animal.SetAiTimer(x, 0);
        Animal.EnableFear(x, false);
        Animal.SetState(x, ST_WPT_WALK);	
        end;
    end; 
    
function ChargeWhenShot(name)    
    local v;
    v = Entity.FindName(entRoot, name);
    if (v) then
        Animal.SetChargeWhenShot(v, true);	
        end;
    end;                   
    
-----------------------------------------------------------------------------    

function PostStage()

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

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

    -- load world
    SetupWorld("Maps\\WorldSavannahForest\\SavannahForestCommon.ini", "Maps\\Stage4-6\\Stage4-6.ini","","");
    EntGame.CreatePlayerEntities();

    EntGame.SetGlobalDustColorInitial(.8, 0.65, .55, .45);
    EntGame.SetGlobalDustColorFinal  (0.0, 0.65, .55, .45);
    
    EntGame.SetStageTimer(180);
    
    EntGame.LoadAnimal(AID_ELEPHANT_M);
    EntGame.LoadAnimal(AID_BUFFALO_M);
    EntGame.LoadAnimal(AID_BUFFALO_F);
    EntGame.LoadAnimal(AID_LEOPARD_M);
    EntGame.LoadAnimal(AID_RHINO_M);
    EntGame.LoadAnimal(AID_HARE_M);	
    EntGame.LoadAnimal(AID_SPURWINGGOOSE_M);
    
 	StartupSequence("Music\\Dim Horizon.ogg");
         
    end;

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

    Camera.JumpToWaypoint(entCamera, "CamWptAA");
    Camera.SetSpeed(entCamera, 0.0, 0.01); 

    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath1", 0, ST_GRAZING, 7, 0, 0, .8);
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath2", 0, ST_GRAZING, 4, 0, 0, .6);
    Elephant5=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath3", 0, ST_WPT_WALK, 0, 0, 0, .6);
    Animal.EnableFear(Elephant5, false);
    Entity.SetName(Elephant5, "ELEPHANT5");
    
    --1st Elephant attack if shot
    Elephant1 = EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath4", 0, ST_WPT_WALK, 0, 0, 0, .7);
    Animal.FaceEntity(Elephant1, entCamera);
    Animal.SetChargeWhenShot(Elephant1, true);
    Animal.EnableFear(Elephant1, false);
    Animal.SetAttackType(Elephant1, ATK_STATIC);
    Animal.SetStaticAttackDist(Elephant1, 5);
	Animal.SetAttackRepeat(Elephant1, 1);
	Animal.SetPostAttackRand(Elephant1, false);
	Animal.SetPostAttackDir(Elephant1, -90);	
	Animal.SetPostAttackTimer(Elephant1, 2.0);	
    Entity.SetName(Elephant1, "ELEPHANT1");
    
    Elephant2=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath5", 0, ST_WPT_WALK, 0, 0, 0, .9);
    Entity.SetName(Elephant2, "ELEPHANT2");
    Elephant3=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath6", 0, ST_WPT_WALK, 0, 0, 0, .5);
    Entity.SetName(Elephant3, "ELEPHANT3");
    Elephant4=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath7", 0, ST_WPT_WALK, 0, 0, 0, .8);
    Entity.SetName(Elephant4, "ELEPHANT4");
    
    --2nd Elephant attack.
    Elephant6 = EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "LongerPath1", 0, ST_WPT_WALK, 0, 0, 0, .8);
    Animal.EnableFear(Elephant6, false);
    Animal.FaceEntity(Elephant6, entCamera);
    Animal.SetAutoChargeDist(Elephant6, 15);	
    Animal.SetAttackType(Elephant6, ATK_STATIC);
    Animal.SetStaticAttackDist(Elephant6, 5.0);
	Animal.SetAttackRepeat(Elephant6, 2);
	Animal.SetPostAttackRand(Elephant6, false);
	Animal.SetPostAttackDir(Elephant6, 90);	
    Entity.SetName(Elephant6, "ELEPHANT6");
    
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath3", 2, ST_GRAZING, 4.5, 0, 0, .4);
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath4", 1, ST_GRAZING, 3, 0, 0, .5);    
               
    Script.WaitSec(5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath8", 0, ST_WPT_RUN, 0, 0, 0, 1.0);	
    Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath9", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath11", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Run ("ELEPHANT1");	
    Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath10", 0, ST_WPT_RUN, 0, .5, .5, 1.0);    
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath10", 0, ST_WPT_RUN, 0, .5, .5, 1.0);
    Run ("ELEPHANT6");
    Script.WaitSec(3);
    Run ("ELEPHANT2");
    Run ("ELEPHANT5");
    	
    Script.WaitSec(.5);
    Run ("ELEPHANT3");
    Script.WaitSec(.5);
    Run ("ELEPHANT4");
    Script.WaitSec(4);
        
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath11", 0, ST_WPT_RUN, 0, .5, .5, 1.0);	
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath11", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath11", 0, ST_WPT_RUN, 0, -.5, -.5, 1.0);
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath8", 0, ST_WPT_RUN, 0, .5, .5, 1.0);	
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath10", 0, ST_WPT_RUN, 0, 1, 1, 1.2);	
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath10", 0, ST_WPT_RUN, 0, -1, -1, 1.2);   	
    Script.WaitSec(3);    	
         
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptDD");
    
    Script.WaitSec(1);

    BuffaloA1=EntGame.SpawnAnimalOnPath(AID_BUFFALO_F, "BunnyPath14", 0, ST_WPT_RUN, 0, 0, 0, .8);
    Animal.EnableFear(BuffaloA1, false);
    Entity.SetName(BuffaloA1, "BUFFALOA1");
    Script.WaitSec(1.0);
    BuffaloB1=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath14", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Animal.EnableFear(BuffaloB1, false);
    Entity.SetName(BuffaloB1, "BUFFALOB1");
    Script.WaitSec(1.0);
    BuffaloC1=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath14", 0, ST_WPT_RUN, 0, 1.5, 1.5, .6);
    Animal.EnableFear(BuffaloC1, false);
    Entity.SetName(BuffaloC1, "BUFFALOC1"); 
    Buffalo2=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath13", 0, ST_WPT_RUN, 30, 0, 0, .6);
    Animal.EnableFear(Buffalo2, false);
    Entity.SetName(Buffalo2, "BUFFALO2"); 
    
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, 1.2);  
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath16", 0, ST_WPT_RUN, 0, -1.5, 0, 1.2);
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 1.5, -.5, 1.2);           
    Script.WaitSec(1);    	     	        	
    BuffaloA3=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath12", 0, ST_WPT_RUN, 0, 0, 0, .6);
    Animal.EnableFear(BuffaloA3, false);
    Entity.SetName(BuffaloA3, "BUFFALOA3"); 
    Script.WaitSec(1);   
    BuffaloB3=EntGame.SpawnAnimalOnPath(AID_BUFFALO_F, "BunnyPath12", 0, ST_WPT_RUN, 0, 1.5, -1.5, .6);
    Animal.EnableFear(BuffaloB3, false);
    Entity.SetName(BuffaloB3, "BUFFALOB3");
    Script.WaitSec(1); 
    
    --SPAWN BIRDS	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path1", 0, 0, -2, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, 0, -1.5, 0, 1.2);	
        
    BuffaloC3=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath12", 0, ST_WPT_RUN, 0, -1.0, 0, .6);
    Animal.EnableFear(BuffaloC3, false);
    Entity.SetName(BuffaloC3, "BUFFALOC3"); 
    Buffalo4=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath15", 0, ST_WPT_RUN, 0, 0, 0, .6);
    Animal.EnableFear(Buffalo4, false);
    Entity.SetName(Buffalo4, "BUFFALO4");   
    EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, .6);  	
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path1", 0, -.5, 0, -.5, 1.2);		
    BuffaloD3=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath12", 0, ST_WPT_RUN, 0, -2, 2, .4);
    Animal.EnableFear(BuffaloD3, false);
    Entity.SetName(BuffaloD3, "BUFFALOD3"); 
    Script.WaitSec(1); 
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, 1, .5, 1, 1.2);	  
    BuffaloE3=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath12", 0, ST_WPT_RUN, 0, 2.5, -2.5, .2);
    Animal.EnableFear(BuffaloE3, false);
    Entity.SetName(BuffaloE3, "BUFFALOE3");
    EntGame.SpawnAnimalOnPath(AID_BUFFALO_F, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, .6);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path1", 0, 0, 1, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, -1.5, -.1, 0, 1.2);	 
    BuffaloF3=EntGame.SpawnAnimalOnPath(AID_BUFFALO_F, "BunnyPath12", 0, ST_WPT_RUN, 0, -5.0, 0, .3);
    Animal.EnableFear(BuffaloF3, false);
    Entity.SetName(BuffaloF3, "BUFFALOF3");
    Elephant1a=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath17", 0, ST_WPT_WALK, 0, 0, 0, .6);
    Animal.EnableFear(Elephant1a, false);
    Entity.SetName(Elephant1a, "ELEPHANTA1");
            
    Gone("BUFFALOA1");	
    Gone("BUFFALOB1");	
    Gone("BUFFALOC1");	
    
    EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, .6);

    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path1", 0, 0, 0, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path2", 0, 0, -.5, 0, 1.2);	    		
    Walk2("BUFFALO2");	
    Script.WaitSec(3.0);
    Walk2("BUFFALOD3");
    Script.WaitSec(.5);
    Walk2("BUFFALOC3");	
    Script.WaitSec(.5);
    Walk2("BUFFALOE3");	
    Walk2("BUFFALOB3");
    
    Script.WaitSec(1.0);
    Graze2("BUFFALOC3");	
    Walk2("BUFFALOA3");				
    Script.WaitSec(1.0);
    Walk2("BUFFALO4");	
    Graze2("BUFFALO2");	
    Script.WaitSec(1.0);
    Walk2("BUFFALOF3");	
    Script.WaitSec(2.0);
    Walk2("BUFFALOC3");	
    Graze2("BUFFALOA3");	
    Gone("BUFFALO2");
    Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, .6);    	
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_BUFFALO_F, "BunnyPath16", 0, ST_WPT_RUN, 0, 1.5, -1.5, .6);	
    Walk2("BUFFALOA3");
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, .6);
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_BUFFALO_F, "BunnyPath16", 0, ST_WPT_RUN, 0, -2, 0, .6);	
    Run("ELEPHANTA1");        
    
    --ANIMALS LEAVE
	Script.WaitSec(.5);	
    Run("BUFFALOD3");	
    Script.WaitSec(.25);	
    Run("BUFFALOC3");
    Script.WaitSec(.25);
    Run("BUFFALOE3");
    Script.WaitSec(.25);				
    Run("BUFFALOB3");	
    Script.WaitSec(.5);
    Run("BUFFALOA3");	
    Script.WaitSec(.25);
    Run("BUFFALO4");
    Script.WaitSec(.25);	
    Run("BUFFALOF3");		
    --ATTACKING ANIMALS    
 
    a = EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath18", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Animal.FaceEntity(a, entCamera);
    Animal.SetAutoChargeDist(a, 15);	
    Animal.SetAttackType(a, ATK_STATIC);
    Animal.SetAttackRepeat(a, 1);
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, 90);	
    
    Script.WaitSec(1.5);
        
    --RIGHT ELEPHANT
    a2=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath18", 0, ST_WPT_RUN, 0, 3, -3, .5);
    Animal.FaceEntity(a2, entCamera);
    Animal.SetAttackType(a2, ATK_STATIC);
    Animal.SetAttackRepeat(a2, 1);
    Animal.SetStrafeAttackDist(a2, 6.5);
	Animal.SetPostAttackRand(a2, false);
	Animal.SetPostAttackDir(a2, -90);	
	Animal.SetPostAttackTimer(a2, 2.0);
	Entity.SetName(a2, "FIGHTME1");	
	
    Script.WaitSec(1.5);	
        
    --LEFT ELEPHANT    
    a3=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath18", 0, ST_WPT_RUN, 0, -2.5, 2.5, .3);
    Animal.FaceEntity(a3, entCamera);  
    Animal.SetAttackType(a3, ATK_STATIC);
    Animal.SetAttackRepeat(a3, 1);
    Animal.SetStrafeAttackDist(a3, 6.5);
	Animal.SetPostAttackRand(a3, false);
	Animal.SetPostAttackDir(a3, 90);	
	Animal.SetPostAttackTimer(a3, 2.0);
    Entity.SetName(a3, "FIGHTME2");
    Script.WaitSec(2.0);  
        
    --TURN LEFT   		
    Camera.SetPanOffset(entCamera, -55, 0.5);
    
    Script.WaitSec(2.0);
        
    --SPAWN BIRDS	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, 0, 0, 0, 1.2);
    
    Gone("BUFFALO2");
    Gone("BUFFALOD3");		
    Gone("BUFFALOC3");
    Gone("BUFFALOE3");				
    Gone("BUFFALOB3");	
    Gone("BUFFALOA3");	
    Gone("BUFFALO4");
    Gone("BUFFALOF3");	
    Gone("ELEPHANTA1");
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, 0, -.3, 0, 1.2);	
    Script.WaitSec(1);
    ChargeWhenShot("FIGHTME1"); 
    ChargeWhenShot("FIGHTME2");    
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, 0, -.5, 0, 1.2);	
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, 0, -.2, 0, 1.2);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, .5, -1.0, .5, 1.2);
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, 0, -.6, 0, 1.2); 
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path3", 0, 0, .2, 0, 1.2);	
    
    Script.WaitSec(5.5);
   
    Camera.SetPanOffset(entCamera, 0, 1.0);
                                  
    end;    

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

function Part2()

    --DEBUG JUMP-POINT
    --Camera.JumpToWaypoint(entCamera, "CamWptFF");
    --Camera.SetSpeed(entCamera, 0.0, 0.01); 
    --Camera.SetPanOffset(entCamera, -55, .01);
    --Script.WaitSec(.5);
  
    a=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath19", 0, ST_WPT_WALK, 0, 0, 0, .5);
    Animal.EnableFear(a, false);
    b=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath20", 0, ST_WPT_WALK, 0, 0, 0, .7);
    Animal.EnableFear(b, false);   
    c=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath21", 0, ST_WPT_WALK, 0, 0, 0, .3);
    Animal.EnableFear(c, false);
        
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath22", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    
    --ATTACKING LEOPARD
    Leo1 = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath23", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Animal.SetAutoChargeDist(Leo1, 12);	
	Animal.SetAttackType(Leo1, ATK_STRAFE);
	
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath22", 0, ST_WPT_RUN, 0, 2.5, -2.5, 2.0);
    
    --ATTACKING LEOPARD
    Leopard01=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path4", 0, ST_WPT_WALK, 0, 0, 0, 1.0);
    Animal.SetAutoChargeDist(Leopard01, 12);	
	Animal.SetAttackType(Leopard01, ATK_STRAFE);
    Entity.SetName(Leopard01, "LEOPARD01");
        
    --TURN TO CENTER	
    Camera.SetPanOffset(entCamera, 0, 1.0);
    
    Script.WaitSec(1.0);
    Run("LEOPARD01");    	
    
    --ATTACKING LEOPARD
    Leo2 = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath24", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	
    Animal.SetAutoChargeDist(Leo2, 15);	
	Animal.SetAttackType(Leo2, ATK_STRAFE);
    Script.WaitSec(1.5);
    
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptFF");

    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath28", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath28", 0, ST_WPT_RUN, 0, .5, -.5, 1.0);    
    Script.WaitSec(.5);	
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath28", 0, ST_WPT_RUN, 0, -.5, .5, 1.0);
    Script.WaitSec(1.0);
    
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath25", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Script.WaitSec(1.0);
    
    --ATTACKING LEOPARD
    a = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath25", 0, ST_WPT_RUN, 0, -2.5, 2.5, 2.0);
    Animal.SetAutoChargeDist(a, 12);	
	Animal.SetAttackType(a, ATK_STRAFE);
	
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath26", 0, ST_WPT_RUN, 0, 0, 0, 1.8);				
    Script.WaitSec(1.0);
    
    --ATTACKING LEOPARD
    a = EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath26", 0, ST_WPT_RUN, 0, 1.5, -1.5, 1.8);
    Animal.SetAutoChargeDist(a, 12);	
	Animal.SetAttackType(a, ATK_STRAFE);  
	  
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath29", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "BunnyPath29", 0, ST_WPT_RUN, 0, -.5, .5, 1.0);
    Script.WaitSec(3.0);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path5", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(.75);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath27", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path5", 0, ST_WPT_RUN, 0, .5, -.5, 1.0);    
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path5", 0, ST_WPT_RUN, 0, -.5, .5, 1.0);
    Script.WaitSec(.5);
    
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath27", 0, ST_WPT_RUN, 0, 2.5, -2.5, 2.0);	
    Script.WaitSec(2.0);
    
    --ATTACKING RHINO
    a = EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath30", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
    Animal.SetChargeWhenShot(a, true);
    Animal.SetAttackType(a, ATK_STATIC);
	Animal.SetAttackRepeat(a, 1);
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, 60);	
    
    Script.WaitSec(2.0);
    
    EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath30", 0, ST_WPT_RUN, 0, -1.5, 1.5, 1.3);	
    Script.WaitSec(2.0);
    EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath30", 0, ST_WPT_RUN, 0, 1.5, -1.5, 1.2);		
 
    Script.WaitSec(5); --Shoot Time
    
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptHH");
    
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 2);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath36", 0, ST_WPT_RUN, 0, 0, 0, 2);
    
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(3.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 2);	
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath31", 0, ST_WPT_RUN, 0, 0, 0, 2);
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath31", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    
    --ATTACKING ELEPHANT	
    a = EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath38", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Animal.SetAutoChargeDist(a, 15);	
    Animal.SetAttackType(a, ATK_STATIC);
    Animal.SetStaticAttackDist(a, 4.8);
	Animal.SetAttackRepeat(a, 2);
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, 90);	
    
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath36", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(3.0);
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath32", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath37", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath31", 0, ST_WPT_RUN, 0, 0, 0, 2);	
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath35", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath31", 0, ST_WPT_RUN, 0, 0, 0, 2);	 
    Script.WaitSec(3.0);
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath34", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(4.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 2); 
    Script.WaitSec(1.0);  
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 2);
    Script.WaitSec(8.0);  
                  
    end;    

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

function Part3()

    --DEBUG JUMP-POINT
    --Camera.JumpToWaypoint(entCamera, "CamWptHH");
    --Camera.SetSpeed(entCamera, 0.0, 0.01); 
    
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptMM");
    
    Elephant1=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath40", 0, ST_GRAZING, 25, 0, 0, .7);
    Animal.EnableFear(Elephant1, false);
    Entity.SetName(Elephant1, "ELEPHANT1");
    Elephant2=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath41", 0, ST_WPT_WALK, 0, 0, 0, .5);
    Animal.EnableFear(Elephant2, false);
    Entity.SetName(Elephant2, "ELEPHANT2");
    Elephant3=EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath42", 0, ST_WPT_WALK, 0, 0, 0, .3);
    Animal.EnableFear(Elephant3, false);
    Entity.SetName(Elephant3, "ELEPHANT3");
    Buffalo1=EntGame.SpawnAnimalOnPath(AID_BUFFALO_M, "BunnyPath43", 0, ST_WPT_WALK, 0, 0, 0, .8);
    Animal.EnableFear(Buffalo1, false);
    Entity.SetName(Buffalo1, "BUFFALO1");   	
    
    Script.WaitSec(2.0);
        
    --Attacking Rhino    
    a1=EntGame.SpawnAnimalOnPath(AID_RHINO_M, "BunnyPath39", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
    Animal.FaceEntity(a1, entCamera);  
    Animal.SetAutoChargeDist(a1, 15);	
    Animal.SetAttackType(a1, ATK_STRAFE);
    Animal.SetStrafeAttackDist(a1, 6);
	Animal.SetPostAttackRand(a1, false);
	Animal.SetPostAttackDir(a1, -90);	
    Script.WaitSec(3.0);

    --DECELLERATE	
    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);
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 1.5, 0.1);
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 1.0, 0.1);
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 0.5, 0.1);				
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 0, 0.1);
    --STOPPED
    
    Script.WaitSec(3);
        
    --TURN LEFT	
    Camera.SetPanOffset(entCamera, -90, 2.5);

    --ACCELLERATE	
    Camera.SetSpeed(entCamera, .5, 0.1);
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 1.0, 0.1);
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 1.5, 0.1);
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 2.0, 0.1);		
    --MAX SPEED

    Script.WaitSec(2);
    Leopard1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path7", 0, ST_WPT_WALK, 0, -2.0, 0, 1.5);
    Animal.FaceEntity(Leopard1, entCamera);
    Entity.SetName(Leopard1, "LEOPARD1");	
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path13", 0, ST_WPT_RUN, 0, 0, 0, 1.2);	
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path9", 0, 0, 0, 0, 1.2);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path10", 0, 0, -2, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path12", 0, 0, 0, 0, 1.2);	
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path13", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(1);
    Leopard2=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path6", 0, ST_WPT_WALK, 0, 0, 0, 1.2);
    Animal.FaceEntity(Leopard2, entCamera);
    Entity.SetName(Leopard2, "LEOPARD2");
    Leopard3=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path7", 0, ST_WPT_WALK, 0, 1.5, 0, 1.5);
    Animal.FaceEntity(Leopard3, entCamera);
    Entity.SetName(Leopard3, "LEOPARD3");
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path9", 0, 0, 0, 0, 1.2);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path12", 0, 0, 0, 0, 1.2);		
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path14", 0, ST_WPT_RUN, 0, 0, 0, 1.2);	
    Script.WaitSec(1);
    l1=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path8", 0, ST_GRAZING, 20, 0, 0, .5);	
    Animal.EnableFear(l1, false);
    Animal.SetElvOffset(l1, -.1);
    Entity.SetName(l1, "LEOPARD5");		
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path14", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path10", 0, 1, -1.5, -2, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path12", 0, 2, -.5, -.5, 1.2);			
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path14", 0, ST_WPT_RUN, 0, .5, -.5, 1.2);
    Leopard4=EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path7", 0, ST_WPT_WALK, 0, 0, 0, 1.2);
    Animal.FaceEntity(Leopard4, entCamera);
    Entity.SetName(Leopard4, "LEOPARD4");	
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path9", 0, 1, 1, -1, 1.2);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path12", 0, -2, .5, .5, 1.2);	
    Run("LEOPARD2");		
    Script.WaitSec(3);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path9", 0, 0, 0, 0, 1.2);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path12", 0, 0, 0, 0, 1.2);		
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path10", 0, -1, -.5, 2, 1.2);	
    Script.WaitSec(2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path9", 0, 0, 0, 0, 1.2);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path10", 0, 0, 0, 0, 1.2);	
    Script.WaitSec(1.0);	
    Run("LEOPARD1");
    Script.WaitSec(.5);	
    Run("LEOPARD4");
    Script.WaitSec(.5);	
    Run("LEOPARD3");
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path15", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path9", 0, -1, 1.5, 1, 1.2);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path10", 0, 1, -1.5, -2, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path12", 0, 2, -.5, -.5, 1.2);	
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path16", 0, ST_WPT_RUN, 0, 0, 0, 1.2);

    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path9", 0, 0, 0, 0, 1.2);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path10", 0, 0, 0, 0, 1.2);		
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path15", 0, ST_WPT_RUN, 0, -.5, .5, 1.2);
    Script.WaitSec(1);
        
    --Attacking Rhino    
    rh1=EntGame.SpawnAnimalOnPath(AID_RHINO_M, "Path19", 0, ST_WPT_RUN, 0, .5, -.5, 1.2);
    Animal.FaceEntity(rh1, entCamera);
    Animal.SetAutoChargeDist(rh1, 10);	
    Animal.SetAttackType(rh1, ATK_STRAFE);
    Animal.SetStrafeAttackDist(rh1, 6);
	Animal.SetPostAttackRand(rh1, false);
	Animal.SetPostAttackDir(rh1, -90);
				
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path16", 0, ST_WPT_RUN, 0, .5, -.5, 1.2);
    Script.WaitSec(1.5);	
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path15", 0, ST_WPT_RUN, 0, .75, -.75, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, -1, 1.5, 1, 1.2);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 2, 3, -.5, 1.2);	
    Script.WaitSec(.5);		
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path15", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(1.3);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path16", 0, ST_WPT_RUN, 0, -.75, .75, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 0, .5, 0, 1.2);			
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_HARE_M, "Path16", 0, ST_WPT_RUN, 0, .5, -.5, 1.2);
    Script.WaitSec(1);
            
 	EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath44", 0, ST_WPT_RUN, 0, 0, 0, 1.2);	  
    
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, -1, 1.5, 1, 1.0);	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 2, 2.5, -.5, 1.2);
    Script.WaitSec(.5);		
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path17", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, -1, .5, 1, 1.0);		
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path18", 0, ST_WPT_RUN, 0, .5, 0, 2.0);
    Script.WaitSec(1);
        	
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 1, 1, 0, 1.2);			
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path17", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 2, 1.5, -1, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, -1, 2.2, 2, 1.0);	
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path18", 0, ST_WPT_RUN, 0, .5, 0, 2.0);	
    Script.WaitSec(1);
         
    EntGame.SpawnAnimalOnPath(AID_ELEPHANT_M, "BunnyPath44", 0, ST_WPT_RUN, 0, 0, 0, 1.2);	
 
    --TURN LEFT	
    Camera.SetPanOffset(entCamera, -130, 2.0);		
        
    --DECELLERATE	
    Camera.SetSpeed(entCamera, 1.5, 0.1);
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 1.0, 0.1);
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 0.5, 0.1);				
    Script.WaitSec(.25);
    Camera.SetSpeed(entCamera, 0, 0.1);
    --STOPPED
    
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 2, 1.5, -1, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, -1, 2.2, 2, 1.0);	
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 0, 2.5, 0, 1.2);			
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 0, 1.5, 0, 1.2);	
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);			
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 2, 1.5, -1, 1.2);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, -1, 2.2, 2, 1.0);	
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, -1, 2.2, 2, 1.0);		
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_SPURWINGGOOSE_M, "Path11", 0, 0, 2.5, 0, 1.2);			
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);			
    Script.WaitSec(.5);
    EntGame.SpawnAnimalOnPath(AID_LEOPARD_M, "Path21", 0, ST_WPT_RUN, 0, -1, 1, 2.0);

    end;    

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