-----------------------------------------------------------------------------
-- Site 8
-----------------------------------------------------------------------------
-- GLOBALS
    
function Graze2(name)    
    local a;
    a = Entity.FindName(entRoot, name);
    if (a) then
        Animal.SetAiTimer(a, 0);
        Animal.SetState(a, ST_GRAZING);	
        end;
    end;
    
function Walk2(name)    
    local a1;
    a1 = Entity.FindName(entRoot, name);
    if (a1) then
        Animal.SetAiTimer(a1, 0);
        Animal.SetState(a1, ST_WPT_WALK);	
        end;
    end; 
    
function ChargeWhenShot(name)    
    local a;
    a = Entity.FindName(entRoot, name);
    if (a) then
        Animal.SetChargeWhenShot(a, true);	
        end;
    end;                   
    
-----------------------------------------------------------------------------    
-- PostStage

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

	-- Do any setup that is specifically for testing.
	if(EntGame.TestingLevels()) then
		Testing();
		end;
		
    EntGame.SetGlobalDustColorInitial(.8, 0.65, .55, .45);
    EntGame.SetGlobalDustColorFinal  (0.0, 0.65, .55, .45);
    
    EntGame.SetStageTimer(180);
    
	EntGame.LoadAnimal(AID_BLACK_TAIL_DEER_M);
    EntGame.LoadAnimal(AID_MUSK_OX_M);
    EntGame.LoadAnimal(AID_MUSK_OX_F);
    EntGame.LoadAnimal(AID_WOLF);
    EntGame.LoadAnimal(AID_MOOSE);
    EntGame.LoadAnimal(AID_ARCTIC_HARE);	
    EntGame.LoadAnimal(AID_GOOSE);
    
 	-- setup tournament logic    
    EntGame.StagePrepare();           

    -- show the scene from the intro camera
    EntGame.BindCameraToEntity("IntroCamera");
    
    -- tell the game the world has loaded
    Entity.GameEventPre(Game.GetRootEntity(), GE_WORLDLOADED, 0);	

    -- wait until the intro dialog is dispatched
    while (EntGame.GetFlag(GF_READYTOSTART) == false) do
        Script.WaitFrame(1);
        end;

    -- do a fade out        
    FadeOut();
    Script.WaitSec(0.5);       

	end;
	
-----------------------------------------------------------------------------
function Intro()

	EntGame.PlaySong("Music\\SilverSurfer.ogg");
	
    -- while the scene is black, change the view
    -- grab the camera
    entCamera = Entity.FindName(entRoot, "MainCamera");
    -- show the scene from the camera view
    EntGame.BindCameraToEntity(entCamera);    
    
    -- set up initial player position and animals
	Camera.JumpToWaypoint(entCamera, "CamWptAA");
    Camera.SetSpeed(entCamera, 0.0, 0.1);      
    
    a = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath1", 0, ST_GRAZING, 7+5, 0, 0, .8);
	Entity.SetName(a, "DeerA");
    b = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath2", 0, ST_GRAZING, 4+5, 0, 0, .6);
	Entity.SetName(b, "DeerB");
    c = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath3", 0, ST_WPT_WALK, 0, 0, 0, .6);
    Entity.SetName(c, "DeerC");
    
    --PREDATOR #1 
    d = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath4", 0, ST_WPT_WALK, 0, 0, 0, .7);
    Animal.FaceEntity(d, entCamera);
    Animal.SetChargeWhenShot(d, true);
    Animal.SetAttackType(d, ATK_STATIC);
	Animal.SetStaticAttackDist(d, 4.5);
	Animal.SetStaticAttackDelay(d, 1.0);		
	Animal.SetPostAttackRand(d, false);
	Animal.SetPostAttackDir(d, -90);	
    Entity.SetName(d, "MooseD");
    
    --PREDATOR #2
    h = EntGame.SpawnAnimalOnPath(AID_MOOSE, "LongerPath1", 0, ST_WPT_WALK, 0, 0, 0, .8);
    Animal.FaceEntity(h, entCamera);
    Animal.SetAutoChargeDist(h, 15);	
    Animal.SetAttackType(h, ATK_STATIC);
	Animal.SetStaticAttackDist(h, 4.5);
	Animal.SetStaticAttackDelay(h, 1.0);		
	Animal.SetPostAttackRand(h, false);
	Animal.SetPostAttackDir(h, -90);	
    Entity.SetName(h, "MooseH");
    
    i = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath3", 2, ST_GRAZING, 6.5+5, 0, 0, .4);
	Entity.SetName(i, "DeerI");
    j = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath4", 1, ST_GRAZING, 3+5, 0, 0, .5);    
	Entity.SetName(j, "MooseJ");
	
    -- set the camera to a cool spot, then fade in
    EntGame.BindCameraToEntity("CountdownCamera3");
    FadeIn();    
    Script.WaitSec(1.0); 
    
    -- "3"
    Entity.GameEventPre(Game.GetRootEntity(), SSK1_COUNTDOWN_3, 0);   
    Script.WaitSec(1.0);
    
    -- "2"
    Entity.GameEventPre(Game.GetRootEntity(), SSK1_COUNTDOWN_2, 0);   
    EntGame.BindCameraToEntity("CountdownCamera2");
    Script.WaitSec(1.0);
    
    -- "1"
    Entity.GameEventPre(Game.GetRootEntity(), SSK1_COUNTDOWN_1, 0);   
    EntGame.BindCameraToEntity("CountdownCamera1");
    Script.WaitSec(1.0);
    
    -- "HUNT!"  
    entCamera = Entity.FindName(entRoot, "MainCamera");
    EntGame.BindCameraToEntity(entCamera);    
    Camera.JumpToWaypoint(entCamera, "CamWptAA");
    Camera.SetSpeed(entCamera, 0.0, 0.01);    
    EntGame.BindInputToEntity("Player1");  
    Entity.GameEventPre(Game.GetRootEntity(), SSK1_COUNTDOWN_HUNT, 0);     
    Entity.GameEventPre(Game.GetRootEntity(), SSK1_START, 0);
    
    end;

-----------------------------------------------------------------------------
-- Use this function for overriding various game parameters (i.e. weapon availability, etc.)
function Testing()    
    EntGame.SetPlayerWeapon(0, WS_PISTOL, 	    WID_PISTOL_2);
	EntGame.SetPlayerWeapon(0, WS_SINGLE_RIFLE, WID_SINGLE_RIFLE_2);
    EntGame.SetPlayerWeapon(0, WS_SHOTGUN,	    WID_SHOTGUN_2);	
	EntGame.SetPlayerWeapon(0, WS_AUTO_RIFLE, 	WID_AUTO_RIFLE_2);	
	EntGame.SetPlayerWeapon(0, WS_BOW, 		    WID_BOW_1);
	EntGame.ResetWeaponIcons();
	end; 
    
-----------------------------------------------------------------------------
function Part1()
               
    Script.WaitSec(5);
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath8", 0, ST_WPT_RUN, 0, 0, -1.5, 1.0);	
    Script.WaitSec(3);
	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath11", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	
    Run ("MooseD");	
    Script.WaitSec(1);
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath9", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(1);  
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath10", 0, ST_WPT_RUN, 0, .5, .5, 1.0);
    Run ("MooseH");
    Script.WaitSec(3);
    Run ("DeerC");
    	
    Script.WaitSec(.5);
    Run ("DeerF");
    Script.WaitSec(.5);
    Run ("DeerG");
    Script.WaitSec(3);
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath10", 0, ST_WPT_RUN, 0, 1, 1, 1.2);	
	Script.WaitSec(1);
	
	--POWERUP!!!
    Bunny = EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 0, 1.2);  
	EntGame.CreateAnimalPowerUp(Bunny, PID_WILEY_VISION_50);	
	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath11", 0, ST_WPT_RUN, 0, .5, .5, 1.0);	
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath11", 0, ST_WPT_RUN, 0, -.5, -.5, 1.0);
	
    Script.WaitSec(1.5);

    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath8", 0, ST_WPT_RUN, 0, .5, -1.5, 1.0);	

    Script.WaitSec(3.5);

    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptDD");
    
    Script.WaitSec(1);

    OxA=EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "BunnyPath14", 0, ST_WPT_RUN, 0, 0, 0, 1.1);
    Entity.SetName(OxA, "OxA");
    Script.WaitSec(1.0);
    OxB=EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "BunnyPath14", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Entity.SetName(OxB, "OxB");
    Script.WaitSec(1.0);
    
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, 1.2);  
    Script.WaitSec(2);
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath16", 0, ST_WPT_RUN, 0, 1.5, -.5, 1.2);           
    Script.WaitSec(1);    	
	
    OxC=EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "BunnyPath12", 0, ST_WPT_RUN, 0, 0, 0, .6);
    Entity.SetName(OxC, "OxC");   
    Script.WaitSec(2);  
    
    --SPAWN BIRDS	
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path1", 0, 0, -2, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path2", 0, 0, -1.5, 0, 1.2);	
        
    OxD=EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "BunnyPath12", 0, ST_WPT_RUN, 0, -1.0, 0, .6);
    Entity.SetName(OxD, "OxD"); 
	
    OxE=EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "BunnyPath15", 0, ST_WPT_RUN, 0, 0, 0, 1.1);
    Entity.SetName(OxE, "OxE");   
		
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path1", 0, -.5, 0, -.5, 1.2);	
	
    Script.WaitSec(1); 
	
	--POWERUP
    Goose = EntGame.SpawnBirdOnPath(AID_GOOSE, "Path2", 0, 1, .5, 1, 1.2);	 
	EntGame.CreateAnimalPowerUp(Goose, PID_3X_RELOAD_RATE);	

    OxH = EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "BunnyPath12", 0, ST_WPT_RUN, 0, 2.5, -2.5, .2);
    Entity.SetName(OxH, "OxH");
	
    OxI = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, .4);
	Entity.SetName(OxI, "OxI");
	
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path1", 0, 0, 1, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path2", 0, -1.5, -.1, 0, 1.2);	 
	
    OxJ=EntGame.SpawnAnimalOnPath(AID_MUSK_OX_F, "BunnyPath12", 0, ST_WPT_RUN, 0, -5.0, 0, .3);
    Entity.SetName(OxJ, "OxJ");
            
    Gone("OxA");	
    Gone("OxB");	
    
    OxK = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath16", 0, ST_WPT_RUN, 0, -1, 0, .4);
	Entity.SetName(OxK, "OxK");
	
    Script.WaitSec(1);
	
	OxF = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 2, 0, .4);  
	Entity.SetName(OxF, "OxF"); 
	
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path1", 0, 0, 0, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path2", 0, 0, -.5, 0, 1.2);	    		
    Script.WaitSec(1.5);
	EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 2, 0, .4);  
	Script.WaitSec(1.5);
    Walk2("OxG");
    Script.WaitSec(.5);
	EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 2, 0, .4);  
	
    Walk2("OxD");	
    Script.WaitSec(.5);
    Walk2("OxH");	   
    Script.WaitSec(2.0);				
    Walk2("OxE");	
    Script.WaitSec(1.0);
    Walk2("OxJ");	
	Walk2("OxC");
    Script.WaitSec(5); 
    Graze2("OxC");
	Script.WaitSec(1); 	
    EntGame.SpawnAnimalOnPath(AID_MUSK_OX_F, "BunnyPath16", 0, ST_WPT_RUN, 0, 1.5, -1.5, .6);	
    Walk2("OxC");
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "BunnyPath16", 0, ST_WPT_RUN, 0, 0, 0, .6);
    Script.WaitSec(1.5);	      
    
    --ANIMALS LEAVE
	Script.WaitSec(.5);	
    Run("OxG");	
    Script.WaitSec(.25);	
    Run("OxD");
    Script.WaitSec(.25);
    Run("OxH");
    Script.WaitSec(.25);				
    Run("BUFFALOB3");	
    Script.WaitSec(.5);
    Run("OxC");	
    Script.WaitSec(.25);
    Run("OxE");
    Script.WaitSec(.25);	
    Run("OxJ");		   
 
	--PREDATOR #3
    a = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath18", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Animal.FaceEntity(a, entCamera);
    Animal.SetAutoChargeDist(a, 15);	
    Animal.SetAttackType(a, ATK_STATIC);
	Animal.SetStaticAttackDist(a, 4.5);
	Animal.SetStaticAttackDelay(a, 1.0);
	Animal.SetPostAttackRand(a, false);
	Animal.SetPostAttackDir(a, 90);	
    
    Script.WaitSec(1.5);
        
    --PREDATOR #4
    a2=EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath18", 0, ST_WPT_RUN, 0, 3, -3, .5);
	Animal.SetChargeWhenShot(a2, true);
    Animal.FaceEntity(a2, entCamera);
    Animal.SetAttackType(a2, ATK_STRAFE);
	Animal.SetStrafeAttackDist(a2, 8);
	Animal.SetStrafeAttackDelay(a2, .75);	
	Animal.SetPostAttackRand(a2, false);
	Animal.SetPostAttackDir(a2, -90);	
	Entity.SetName(a2, "FightMe1");	
	
    Script.WaitSec(1.5);	
        
    --PREDATOR #5   
    a3=EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath18", 0, ST_WPT_RUN, 0, -2.5, 2.5, .3);
	Animal.SetChargeWhenShot(a3, true);
    Animal.FaceEntity(a3, entCamera);  
    Animal.SetAttackType(a3, ATK_STRAFE);
	Animal.SetStrafeAttackDist(a3, 8);
	Animal.SetStrafeAttackDelay(a3, .75);		
	Animal.SetPostAttackRand(a3, false);
	Animal.SetPostAttackDir(a3, 90);	
    Entity.SetName(a3, "FightMe2");
	
    Script.WaitSec(2.0);  
        
    --TURN LEFT   		
    Camera.SetPanOffset(entCamera, -55, 0.5);
    
    Script.WaitSec(2.0);
        
    --POWERUP	
    Goose = EntGame.SpawnBirdOnPath(AID_GOOSE, "Path3", 0, 0, 0, 0, 1.2);
	EntGame.CreateAnimalPowerUp(Goose, PID_BODY_ARMOR_100);
    
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path3", 0, 0, -.3, 0, 1.2);	
    Script.WaitSec(1);
    ChargeWhenShot("FightMe1"); 
    ChargeWhenShot("FightMe2");    
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path3", 0, 0, -.5, 0, 1.2);	
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path3", 0, 0, -.2, 0, 1.2);
    Script.WaitSec(.5);
	
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path3", 0, .5, -1.0, .5, 1.2);

    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path3", 0, 0, -.6, 0, 1.2); 
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path3", 0, 0, .2, 0, 1.2);	
    
	Gone("OxG");		
    Gone("OxD");
    Gone("OxH");				
    Gone("OxC");	
    Gone("OxE");
    Gone("OxJ");	
	
    Script.WaitSec(5.5);
   
    Camera.SetPanOffset(entCamera, 0, 1.0);
             			 
    end;    

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

function Part2()

    --Camera.JumpToWaypoint(entCamera, "CamWptDD");
    --Camera.SetSpeed(entCamera, 0.0, 0.007); 

    --PREDATOR #6
    Wolf1 = EntGame.SpawnAnimalOnPath(AID_WOLF, "BunnyPath23", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Animal.SetAutoChargeDist(Wolf1, 12);	
	Animal.SetAttackType(Wolf1, ATK_STRAFE);
	Animal.SetStrafeAttackDist(Wolf1, 5);
	Animal.SetStrafeAttackDelay(Wolf1, .5);	
	Entity.SetName(Wolf1, "Wolf1");
	
    Wolf2 = EntGame.SpawnAnimalOnPath(AID_WOLF, "BunnyPath22", 0, ST_WPT_RUN, 0, 2.5, -2.5, 2.0);
	Entity.SetName(Wolf2, "Wolf2");
    
    Script.WaitSec(1.0); 	
    
    Wolf3 = EntGame.SpawnAnimalOnPath(AID_WOLF, "BunnyPath24", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	
	Entity.SetName(Wolf3, "Wolf3");
	
    Script.WaitSec(1.5);
    
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptFF");

    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath28", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(1);   
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath28", 0, ST_WPT_RUN, 0, -.5, .5, 1.0);
    Script.WaitSec(1.0);
    
	--POWERUP!!!
    Wolf4 = EntGame.SpawnAnimalOnPath(AID_WOLF, "BunnyPath25", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
	Entity.SetName(Wolf4, "Wolf4");
	EntGame.CreateAnimalPowerUp(Wolf4, PID_WILEY_VISION_50);
	
    Script.WaitSec(1.0);
    
    --PREDATOR #7
    Wolf5 = EntGame.SpawnAnimalOnPath(AID_WOLF, "BunnyPath25", 0, ST_WPT_RUN, 0, -2.5, 2.5, 2.0);
    Animal.SetAutoChargeDist(Wolf5, 12);	
	Animal.SetAttackType(Wolf5, ATK_STRAFE);
	Animal.SetStrafeAttackDist(Wolf5, 5);
	Animal.SetStrafeAttackDelay(Wolf5, .5);		
	Entity.SetName(Wolf5, "Wolf5");
	
    Script.WaitSec(2.0);			
    
    Wolf6 = EntGame.SpawnAnimalOnPath(AID_WOLF, "BunnyPath26", 0, ST_WPT_RUN, 0, 1.5, -1.5, 1.8);
	Entity.SetName(Wolf6, "Wolf6");
	  
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath29", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(1.0);
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath29", 0, ST_WPT_RUN, 0, -.5, .5, 1.0);
    Script.WaitSec(3.0);
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path5", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Script.WaitSec(.75);
    Wolf7 = EntGame.SpawnAnimalOnPath(AID_WOLF, "BunnyPath27", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	 
	Entity.SetName(Wolf7, "Wolf7");	
    Script.WaitSec(.5);
	
	--POWERUP!!!
    Bunny = EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path5", 0, ST_WPT_RUN, 0, -.5, .5, 1.0);
	EntGame.CreateAnimalPowerUp(Bunny, PID_4X_MAGAZINE);
	
    Script.WaitSec(.5);
    
    Wolf8 = EntGame.SpawnAnimalOnPath(AID_WOLF, "BunnyPath27", 0, ST_WPT_RUN, 0, 2.5, -2.5, 2.0);
	Entity.SetName(Wolf8, "Wolf8");
	
    Script.WaitSec(2.0);
    
    --PREDATOR #8
    Moose1 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath30", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
    Animal.SetChargeWhenShot(Moose1, true);
    Animal.SetAttackType(Moose1, ATK_STATIC);
	Animal.SetStaticAttackDist(Moose1, 4.5);
	Animal.SetStaticAttackDelay(Moose1, 1.0);		
	Animal.SetPostAttackRand(Moose1, false);
	Animal.SetPostAttackDir(Moose1, -60);	
    Entity.SetName(Moose1, "Moose1");
	
    Script.WaitSec(2.0);
    
    Moose2 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath30", 0, ST_WPT_RUN, 0, -1.5, 1.5, 1.3);	
	Entity.SetName(Moose2, "Moose2");
	
    Script.WaitSec(2.0);
	
    Moose3 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath30", 0, ST_WPT_RUN, 0, 1.5, -1.5, 1.2);	
	Entity.SetName(Moose3, "Moose3");	
 
    Script.WaitSec(3.5);
	
	Deer1 = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 2);
	Entity.SetName(Deer1, "Deer1");
    Deer2 = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath36", 0, ST_WPT_RUN, 0, 0, 0, 2);
    Entity.SetName(Deer2, "Deer2");
	
	Script.WaitSec(1.5);
    
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptHH");
	
    Moose4 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	Entity.SetName(Moose4, "Moose4");
	
    Script.WaitSec(1.5);
	
	--POWERUP!!!
	Deer25 = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 2);
	Entity.SetName(Deer25, "Deer25");
	EntGame.CreateAnimalPowerUp(Deer25, PID_WILEY_VISION_50);
	
    Deer3 = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath31", 0, ST_WPT_RUN, 0, 0, 0, 2);
	Entity.SetName(Deer3, "Deer3");
	
	Script.WaitSec(1.5);
	
    Moose5 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath31", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Entity.SetName(Moose5, "Moose5");
	
    --PREDATOR #9	
    Moose6 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath38", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
    Animal.SetAutoChargeDist(Moose6, 15);	
    Animal.SetAttackType(Moose6, ATK_STATIC);
	Animal.SetStaticAttackDist(Moose6, 4.5);
	Animal.SetStaticAttackDelay(Moose6, 1.0);		
	Animal.SetPostAttackRand(Moose6, false);
	Animal.SetPostAttackDir(Moose6, 90);
	Entity.SetName(Moose6, "Moose6");	
    
    Script.WaitSec(1.0);
	
    Moose7 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath36", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
	Entity.SetName(Moose7, "Moose7");
	
    Script.WaitSec(1.5);
	Deer8 = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath31", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
	Entity.SetName(Deer8, "Deer8");	
	Script.WaitSec(1.5);
	
    Moose8 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath32", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	Entity.SetName(Moose8, "Moose8");
	
    Script.WaitSec(1.0);
	
    Moose9 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath37", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	Entity.SetName(Moose9, "Moose9");
		
	--POWERUP
	Deer4 = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath31", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
	Entity.SetName(Deer4, "Deer4");	
	EntGame.CreateAnimalPowerUp(Deer4, PID_2X_FIRE_RATE);
		
    Script.WaitSec(1.0);
	
    Moose10 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath35", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	Entity.SetName(Moose10, "Moose10");
		
    Script.WaitSec(4.0);
	
    Moose11 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "BunnyPath34", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	Entity.SetName(Moose11, "Moose11");
	
    Script.WaitSec(3.0);
	
    Deer5 = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 2); 
	Entity.SetName(Deer5, "Deer5");
	
    Script.WaitSec(1.0); 
	
    Deer6 = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "BunnyPath33", 0, ST_WPT_RUN, 0, 0, 0, 2);
	Entity.SetName(Deer6, "Deer6");
	
    Script.WaitSec(9.0);  
                  
    end;    

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

function Part3()

    --Camera.JumpToWaypoint(entCamera, "CamWptHH");
    --Camera.SetSpeed(entCamera, 0.0, 0.01); 
    
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptMM");
    
    Script.WaitSec(2.0);
        
    --PREDATOR #10    
    a1=EntGame.SpawnAnimalOnPath(AID_MOOSE, "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, 8.5);
	Animal.SetStrafeAttackDelay(a1, .75);	
	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_WOLF, "Path7", 0, ST_WPT_WALK, 0, -2.0, 0, 1);
    Animal.FaceEntity(Leopard1, entCamera);
    Entity.SetName(Leopard1, "LEOPARD1");	
	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path13", 0, ST_WPT_RUN, 0, 0, 0, 1.2);	
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path9", 0, 0, 0, 0, 1.2);	
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path12", 0, 0, 0, 0, 1.2);	
	
	--POWERUP!!!
    a = EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path13", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
	EntGame.CreateAnimalPowerUp(a, PID_2X_SCORE);
	
    Script.WaitSec(1);
    Leopard2=EntGame.SpawnAnimalOnPath(AID_WOLF, "Path6", 0, ST_WPT_WALK, 0, 0, 0, 1);
    Animal.FaceEntity(Leopard2, entCamera);
    Entity.SetName(Leopard2, "LEOPARD2");
    Leopard3=EntGame.SpawnAnimalOnPath(AID_WOLF, "Path7", 0, ST_WPT_WALK, 0, 1.5, 0, 1);
    Animal.FaceEntity(Leopard3, entCamera);
    Entity.SetName(Leopard3, "LEOPARD3");
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path9", 0, 0, 0, 0, 1.2);	
	
	--POWERUP!!!
    Goose = EntGame.SpawnBirdOnPath(AID_GOOSE, "Path12", 0, 0, 0, 0, 1.2);	
	EntGame.CreateAnimalPowerUp(Goose, PID_WILEY_VISION_50);
	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path14", 0, ST_WPT_RUN, 0, 0, 0, 1.2);	
    Script.WaitSec(1);
    l1=EntGame.SpawnAnimalOnPath(AID_WOLF, "Path8", 0, ST_GRAZING, 20, 0, 0, .5);	
    Animal.SetElvOffset(l1, -.1);
    Entity.SetName(l1, "LEOPARD5");		
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path14", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path10", 0, 1, -1.5, -2, 1.2);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path12", 0, 2, -.5, -.5, 1.2);			
    Leopard4=EntGame.SpawnAnimalOnPath(AID_WOLF, "Path7", 0, ST_WPT_WALK, 0, 0, 0, 1);
    Animal.FaceEntity(Leopard4, entCamera);
    Entity.SetName(Leopard4, "LEOPARD4");	
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path9", 0, 1, 1, -1, 1.2);	
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path12", 0, -2, .5, .5, 1.2);	
    Run("LEOPARD2");		
    Script.WaitSec(3);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path9", 0, 0, 0, 0, 1.2);			
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path10", 0, -1, -.5, 2, 1.2);	
    Script.WaitSec(2);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path9", 0, 0, 0, 0, 1.2);	
    EntGame.SpawnBirdOnPath(AID_GOOSE, "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_ARCTIC_HARE, "Path15", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(1);	
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path10", 0, 1, -1.5, -2, 1.2);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path12", 0, 2, -.5, -.5, 1.2);	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path16", 0, ST_WPT_RUN, 0, 0, 0, 1.2);

    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path9", 0, 0, 0, 0, 1.2);	

    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path15", 0, ST_WPT_RUN, 0, -.5, .5, 1.2);
	
    Script.WaitSec(1);
          
    Ox = EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "Path19", 0, ST_WPT_RUN, 0, .5, -.5, 1.2);
	Animal.FaceEntity(Ox, entCamera);
			
	--POWERUP!!!		
    Bunny = EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path16", 0, ST_WPT_RUN, 0, .5, -.5, 1.2);
	EntGame.CreateAnimalPowerUp(Bunny, PID_WILEY_VISION_100);
	
    Script.WaitSec(1.5);	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path15", 0, ST_WPT_RUN, 0, .75, -.75, 1.2);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, -1, 1.5, 1, 1.2);	
    Script.WaitSec(.5);		
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path15", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(1.3);
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path16", 0, ST_WPT_RUN, 0, -.75, .75, 1.2);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, 0, .5, 0, 1.2);			
    Script.WaitSec(2);
            
 	Ox = EntGame.SpawnAnimalOnPath(AID_MUSK_OX_F, "BunnyPath44", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
	Animal.FaceEntity(Ox, entCamera);
    
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, -1, 1.5, 1, 1.0);	
    Script.WaitSec(.5);		

    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, -1, .5, 1, 1.0);	

    --POWERUP!!!	
    Wolf = EntGame.SpawnAnimalOnPath(AID_WOLF, "Path18", 0, ST_WPT_RUN, 0, .5, 0, 2.0);
	EntGame.CreateAnimalPowerUp(Wolf, PID_2X_RELOAD_RATE);
    Script.WaitSec(1);
        	
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, 1, 1, 0, 1.2);		
	
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, -1, 2.2, 2, 1.0);	
    EntGame.SpawnAnimalOnPath(AID_WOLF, "Path18", 0, ST_WPT_RUN, 0, .5, 0, 2.0);	
    Script.WaitSec(1);
         
    Ox = EntGame.SpawnAnimalOnPath(AID_MUSK_OX_M, "BunnyPath44", 0, ST_WPT_RUN, 0, 0, 0, 1.5);	
	Animal.FaceEntity(Ox, entCamera);
 
    --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_GOOSE, "Path11", 0, 2, 1.5, -1, 1.2);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, 0, 2.5, 0, 1.2);	
	
    Deer = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
	Animal.FaceEntity(Deer, entCamera);
		
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, 0, 1.5, 0, 1.2);	
	
    EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);	

	
	Animal.FaceEntity(Deer, entCamera);
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, 2, 1.5, -1, 1.2);
	Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, -1, 2.2, 2, 1.0);	
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, -1, 2.2, 2, 1.0);		
    Deer = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
	Animal.FaceEntity(Deer, entCamera);
    Script.WaitSec(.5);
    EntGame.SpawnBirdOnPath(AID_GOOSE, "Path11", 0, 0, 2.5, 0, 1.2);			
    Deer = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
	Animal.FaceEntity(Deer, entCamera);
    Script.WaitSec(1.0);
    Deer = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "Path21", 0, ST_WPT_RUN, 0, 0, 0, 2.0);		
	Animal.FaceEntity(Deer, entCamera);	
    Script.WaitSec(.5);
    Deer = EntGame.SpawnAnimalOnPath(AID_BLACK_TAIL_DEER_M, "Path21", 0, ST_WPT_RUN, 0, -1, 1, 2.0);
	Animal.FaceEntity(Deer, entCamera);

    end;    

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