-----------------------------------------------------------------------------
-- Site 10
-----------------------------------------------------------------------------
-- GLOBALS
  
function Walk2(name)    
    local animal1;
	animal1 = Entity.FindName(entRoot, name);
	if (animal1) then
    	Animal.SetState(animal1, ST_WPT_WALK);
    	Animal.EnableFear(animal1, false);	
    	end;
    end;  
    
function Graze2(name)    
    local animal3;
	animal3 = Entity.FindName(entRoot, name);
	if (animal3) then
    	Animal.SetState(animal3, ST_GRAZING);
    	Animal.EnableFear(animal3, false);	
    	end;
    end;  
  
-----------------------------------------------------------------------------
-- PostStage

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

    Sound.Release(smpShoreline);
    EntGame.DestroyAllAnimals(); 
    end;    
    
-----------------------------------------------------------------------------    
-- Setup

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

    -- load world
    SetupWorld("Maps\\Site10\\Site10.ini", "","","");
    EntGame.CreatePlayerEntities();
    
	-- do any setup that is specifically for testing.
	if (EntGame.TestingLevels()) then
		Testing();
		end;    
		
    EntGame.SetGlobalDustColorInitial(1.0, 0.61, .58, .45);
    EntGame.SetGlobalDustColorFinal  (0.0, 0.61, .58, .45);

    EntGame.SetStageTimer(190);
    
    -- load sounds
    smpShoreline	= Sound.Load("Sound\\Environment\\Shoreline.wav");
    
	EntGame.LoadAnimal(AID_ARCTIC_HARE);
    EntGame.LoadAnimal(AID_GROUSE);
	EntGame.LoadAnimal(AID_COYOTE);
	EntGame.LoadAnimal(AID_HARLEQUINN);
	EntGame.LoadAnimal(AID_BLACK_BEAR);	
	EntGame.LoadAnimal(AID_CARIBOU_M);
	EntGame.LoadAnimal(AID_CARIBOU_F);
	EntGame.LoadAnimal(AID_MOOSE);
	
   -- 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\\KickinTrash.ogg");
	
         
    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_3);
	EntGame.SetPlayerWeapon(0, WS_SINGLE_RIFLE, WID_SINGLE_RIFLE_3);
    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()

	EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "Path6", 0, ST_WPT_RUN, 0, 0, 0, 1.3);
	a1=EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongPath1", 0, ST_WPT_WALK, 0, 0, 0, 1.0);
	Entity.SetName(a1, "CARIBOU1");
	b1=EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongPath1", 1, ST_WPT_WALK, 0, 0, 0, .5);
	Entity.SetName(b1, "CARIBOU2");
	c1=EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongPath2", 0, ST_WPT_WALK, 0, 8, 0, .4);
	Entity.SetName(c1, "CARIBOU3");
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "Path2", 0, ST_WPT_WALK, 3, 0, 0, .5);
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "Path1", 0, ST_WPT_WALK, 2, 0, 0, .5);
     
    Camera.StopAtWaypoint(entCamera, "CamWptDD");
    Camera.SetSpeed(entCamera, 5.0, .1);
	
    Script.WaitSec(3.0);
    			
    Camera.SetPanOffset(entCamera, -65.0, 1.0); --LOOK LEFT

    Script.WaitSec(4.0);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "Path6", 0, ST_WPT_RUN, 0, 0, 0, .8);
    Camera.SetPanOffset(entCamera, 0, 3); --LOOK RIGHT
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "Path6", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    Script.WaitSec(1.0);
	
	--POWERUP
    Caribou = EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "Path6", 0, ST_WPT_RUN, 0, 0, 0, 1.0);	
	EntGame.CreateAnimalPowerUp(Caribou, PID_3X_RELOAD_RATE);
	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path6", 0, ST_WPT_RUN, 0, -.5, 0, 1.0);	
    Script.WaitSec(1.5);
    --End of Travel Time
    							
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path6", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
        	
	Camera.SetSpeed(entCamera, 4.0, 0.1); --Boat Decelleration	 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 2.0, 0.1);
	Script.WaitSec(.25);
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "Path6", 0, ST_WPT_RUN, 0, 1, 1.5, 1.2);		
	Camera.SetSpeed(entCamera, 1.0, 0.1); 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 0.0, 0.1); --Boat Stops
	Script.WaitSec(1.0);
	
	Gone("CARIBOU1");
	Gone("CARIBOU2");
	Gone("CARIBOU3");
	
    Script.WaitSec(1.0);
             		
    Camera.SetSpeed(entCamera, 1.0, 0.1);	 
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 2.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);
	Camera.SetHeightOffset(entCamera, 0, 1.0);	
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath1", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath2", 0, ST_WPT_RUN, 0, 0, 0, .6);
	
    Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_COYOTE, "Path7", 0, ST_WPT_RUN, 0, 0, 0, 1.2);	
    Script.WaitSec(3);
	
	--POWERUP
    Hare = EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath1", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	EntGame.CreateAnimalPowerUp(Hare, PID_WILEY_VISION_50);
	
    Script.WaitSec(.5);
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
	Script.WaitSec(.5);
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath3", 0, ST_WPT_RUN, 0, 0, 0, .8);
    EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath2", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	
    Script.WaitSec(3); 
    
    Camera.SetSpeed(entCamera, 1.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptEE");
    
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath6", 0, ST_WPT_RUN, 0, 0, 0, 1);	

    Script.WaitSec(4);
	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath8", 0, ST_WPT_RUN, 0, 0, 0, 1);		
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath7", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(3);
	
	--POWERUP
	Coyote = EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 0, .7);
	EntGame.CreateAnimalPowerUp(Coyote, PID_2X_SCORE);
		
    animalc=EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path3", 0, ST_POPUP, 2, 0, 0, 1.2);
    Animal.SetElvOffset(animalc, -.1); 
    Animal.FaceEntity(animalc, entCamera); 
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath6", 0, ST_WPT_RUN, 0, 0, 0, .8); 
	EntGame.SpawnAnimalOnPath(AID_COYOTE, "Path7", 0, ST_WPT_RUN, 0, 0, 0, .8);
	Script.WaitSec(2); 
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath8", 0, ST_WPT_RUN, 0, 0, 0, 1);
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath7", 0, ST_WPT_RUN, 0, 0, 0, .8);
	Script.WaitSec(2);	
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath9", 0, ST_WPT_RUN, 0, 0, 0, .6);
	EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath5", 0, ST_WPT_RUN, 0, 0, 0, .8);		 	    
    Script.WaitSec(4);	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath7", 0, ST_WPT_RUN, 0, 0, 0, .7);
    EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath6", 0, ST_WPT_RUN, 0, 0, 0, .8);	
    animald=EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path5", 0, ST_POPUP, 1, 0, 0, .9);
    
    Animal.SetElvOffset(animald, -.1); 
    Animal.FaceEntity(animald, entCamera);	    
    
    Script.WaitSec(2);	
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath9", 0, ST_WPT_RUN, 0, 0, 0, .7);	
	
	--POWERUP
    Hare = EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath5", 0, ST_WPT_RUN, 0, 0, 0, .9);
	EntGame.CreateAnimalPowerUp(Hare, PID_4X_MAGAZINE);
		
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath10", 0, ST_WPT_RUN, 0, 0, 0, .7);
    Script.WaitSec(3);
    EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath8", 0, ST_WPT_RUN, 0, 0, 0, 1);	
    EntGame.SpawnAnimalOnPath(AID_MOOSE, "LongPath3", 0, ST_WPT_RUN, 0, 0, 0, .4);
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath11", 0, ST_WPT_RUN, 0, 0, 0, 1.3);
    Script.WaitSec(1); 
    EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath11", 0, ST_WPT_RUN, 0, 1.5, 1.5, 1.0);
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath11", 0, ST_WPT_RUN, 0, -1.5, -1.5, 1.0); 
    	
    end;    

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

function Part2()

	--Camera.JumpToWaypoint(entCamera, "CamWptEE");
    --Camera.SetSpeed(entCamera, 0.0, 0.007); 
	
	Camera.SetSpeed(entCamera, 3.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptHH");
	
 	EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongerPath2", 2, ST_WPT_RUN, 0, 0, 0, 1);
 	Script.WaitSec(2);
 	EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongerPath2", 2, ST_WPT_RUN, 0, -2.5, 2.5, .9);
    a=EntGame.SpawnAnimalOnPath(AID_GROUSE, "BunnyPath11", 0, ST_POPUP, 1, 1.8, .2, 1);	
    Animal.SetElvOffset(a, 0.5);	
 	Script.WaitSec(1);
 	EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongerPath2", 2, ST_WPT_RUN, 0, 3, 0, 1.2);
 	EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongerPath2", 2, ST_WPT_RUN, 0, 0, -3, 1.1);
  		
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongerPath2", 2, ST_WPT_RUN, 0, 0, 1, 1);	

    Animal.SetCoinMode(a, CM_SPAWNREL);
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongerPath2", 2, ST_WPT_RUN, 0, -2.5, 2.5, .9);
    EntGame.SpawnAnimalOnPath(AID_GROUSE, "LongPath2", 0, ST_WPT_RUN, 0, 0, 0, 2.2);	
    Script.WaitSec(2);	
    EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path10", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
    Script.WaitSec(1);
	
	--POWERUP
    Grouse = EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path8", 0, ST_WPT_WALK, 0, 0, 0, 2.0);
	EntGame.CreateAnimalPowerUp(Grouse, PID_WILEY_VISION_50);
	
    Script.WaitSec(2);		
    Camera.SetPanOffset(entCamera, -90.0, 1.0);	--LOOK LEFT
    Script.WaitSec(1);
    a=EntGame.SpawnAnimalOnPath(AID_GROUSE, "BunnyPath14", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Animal.FaceEntity(a, entCamera);
    Script.WaitSec(1);
    b=EntGame.SpawnAnimalOnPath(AID_GROUSE, "BunnyPath13", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
    Animal.FaceEntity(b, entCamera);
    Script.WaitSec(1.5);
    c=EntGame.SpawnAnimalOnPath(AID_GROUSE, "BunnyPath12", 0, ST_WPT_RUN, 0, 0, 0, 2.0);
    Animal.FaceEntity(c, entCamera);
    Script.WaitSec(1.0);
    d=EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path9", 0, ST_POPUP, 1, 1, 1.8, 1.0);
    Animal.FaceEntity(d, entCamera);
    Animal.SetElvOffset(d, 2.7);
    Animal.SetCoinMode(d, CM_SPAWNREL);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongPath4", 0, ST_WPT_RUN, 0, 2.5, 0, 1.0);
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongPath4", 0, ST_WPT_RUN, 0, 3, 0, 1.2);		
	Camera.SetPanOffset(entCamera, 0, 1.5);	--LOOK RIGHT
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path11", 0, 0, 1.5, 0, 1.2);	
    Script.WaitSec(1.5);
	
	--POWERUP
    Duck = EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path11", 0, 0, 0, 0, 1.0);	
	EntGame.CreateAnimalPowerUp(Duck, PID_BODY_ARMOR_50);
	
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.3);
    Script.WaitSec(1.5);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path11", 0, 0, 1.0, 0, 1.1);		
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongPath4", 0, ST_WPT_RUN, 0, 2.5, 0, 1.2);	  
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongPath4", 0, ST_WPT_RUN, 0, .5, 0, 1.5);	
    Script.WaitSec(2.0);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongPath4", 0, ST_WPT_RUN, 0, 4, 0, 1.7);
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongPath4", 0, ST_WPT_RUN, 0, -1.5, 0, 1.2);	
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path11", 0, 0, 1.5, 0, 1.1);		
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongPath4", 0, ST_WPT_RUN, 0, 0, 0, 1.6);	 
    Script.WaitSec(1.0);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path11", 0, 0, 0, 0, 1.1);		
    EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongPath4", 0, ST_WPT_RUN, 0, 2.5, 0, 1.5);	  	 
    Script.WaitSec(3);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path11", 0, 0, 2, 0, 1.5);
 	
	--PREDATOR #1
    Rhino1 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "LongPath4", 0, ST_WPT_RUN, 0, -1, 0, 1.8);
    Animal.SetChargeWhenShot(Rhino1, true);
	Animal.SetAttackType(Rhino1, ATK_STRAFE);
	Animal.SetStrafeAttackDist(Rhino1, 9);
	Animal.SetStrafeAttackDelay(Rhino1, .5);
	Animal.SetPostAttackRand(Rhino1, false);
	Animal.SetPostAttackDir(Rhino1, -90);
	Entity.SetName(Rhino1, "Predator1");
	
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_MOOSE, "LongPath4", 0, ST_WPT_RUN, 0, 2.5, 0, 1.6);
    Script.WaitSec(1.5);
	
	--PREDATOR #2
    Rhino3 = EntGame.SpawnAnimalOnPath(AID_MOOSE, "LongerPath2", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Animal.SetAutoChargeDist(Rhino3, 12);
	Animal.SetAttackType(Rhino3, ATK_STRAFE);
	Animal.SetStrafeAttackDist(Rhino3, 8.5);
	Animal.SetStrafeAttackDelay(Rhino3, .5);
	Animal.SetPostAttackRand(Rhino3, false);
	Animal.SetPostAttackDir(Rhino3, -90);	
	Entity.SetName(Rhino3, "Predator2");
		       	
    Script.WaitSec(3.5);
    
	--PREDATOR #3
    Rhino4 = EntGame.SpawnAnimalOnPath(AID_BLACK_BEAR, "LongPath4", 0, ST_WPT_RUN, 0, 2, 0, 1.6);
    Animal.SetChargeWhenShot(Rhino4, true);
	Animal.SetAttackType(Rhino4, ATK_STRAFE);
	Animal.SetStrafeAttackDist(Rhino4, 7.5);
	Animal.SetStrafeAttackDelay(Rhino4, .75);	
	Animal.SetPostAttackRand(Rhino4, false);
	Animal.SetPostAttackDir(Rhino4, 90);	
	Entity.SetName(Rhino4, "Predator3");	
	  		
    Script.WaitSec(5);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 0, 0, 0, 1.2);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 0, 1.5, 0, 1.6);
    Script.WaitSec(1);
    
    Camera.SetSpeed(entCamera, 2.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptII");
    
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 0, -2, 0, 1.0);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 1, .5, 8, 1.3);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 1, 0, 0, 0, 1.6);
	
	--POWERUP
    Duck = EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 1, 3, 1, 3, 1.3);
	EntGame.CreateAnimalPowerUp(Duck, PID_3X_FIRE_RATE);
		
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 1, -4, -2, 5, 1.0);
    Script.WaitSec(2);
    
    Camera.SetPanOffset(entCamera, 60.0, 2); --LOOK RIGHT  
      	
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 1, 1, .5, 8, 1.2);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 0, 0, 0, 1.2);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 3, 1, 5, 1.6);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, -4, -2, 8, 1.0);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 1, .5, 13, 1.3);
    Script.WaitSec(4);
	
	--BEAR FEEDING
	EntGame.SpawnAnimalOnPath(AID_BLACK_BEAR, "Path3", 0, ST_BEAR_FEED, 20, 0, 0, 1.6);
		
	Script.WaitSec(1);
	
    Camera.SetPanOffset(entCamera, -1.0, 1.0); --LOOK LEFT
    Camera.SetTiltOffset(entCamera, -2, .5);	
     	
    Script.WaitSec(2);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 0, -2, 0, 1.0);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 0, 1, .5, 8, 1.3);
    Script.WaitSec(1);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 1, 0, 0, 0, 1.6);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 1, 3, 1, 3, 1.3);
    EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "LongPath5", 1, -4, -2, 5, 1.0);
    Script.WaitSec(5);
    
    Camera.SetTiltOffset(entCamera, 0, 1.0);
                 	    		  
    end;    

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

function Part3()

	--Camera.JumpToWaypoint(entCamera, "CamWptII");
    --Camera.SetSpeed(entCamera, 0.0, 0.007); 
	
	Camera.SetSpeed(entCamera, 3.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptKK");
	
	b1=EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "Path25", 0, ST_GRAZING, 15, 0, 0, 1.0);
    Entity.SetName(b1, "Bunny1");
    b2=EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "Path24", 0, ST_WPT_WALK, 15, 0, 0, 1.0);
    Entity.SetName(b2, "Bunny2");
    
	a1=EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongPath6", 0, ST_WPT_WALK, 10, 0, 0, 1.0);
	Animal.FaceEntity(a1, entCamera);
	Entity.SetName(a1, "TargetCARIBOU1");
	a2=EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "BunnyPath15", 0, ST_WPT_WALK, 10, 0, 0, 1.1);
	Animal.FaceEntity(a2, entCamera);
	Entity.SetName(a2, "TargetCARIBOU2");
	a3=EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "BunnyPath16", 0, ST_WPT_WALK, 10, 0, 0, 1.2);
	Animal.FaceEntity(a3, entCamera);
	Entity.SetName(a3, "TargetCARIBOU3");	
	
	--PREDATOR #4
	a4=EntGame.SpawnAnimalOnPath(AID_BLACK_BEAR, "BunnyPath18", 0, ST_WPT_WALK, 10, 0, 0, 1.2);
	Animal.FaceEntity(a4, entCamera);
	Animal.EnableFear(a4, false);
	Animal.SetAttackType(a4, ATK_STATIC);
	Animal.SetAutoChargeDist(a4, 10);	
	Animal.SetStaticAttackDist(a4, 4.5);
	Animal.SetStaticAttackDelay(a4, 1.75);	 
	Animal.SetPostAttackRand(a4, false);
	Animal.SetPostAttackDir(a4, -90);	
	Entity.SetName(a4, "AttackingRhino");	
	
	Script.WaitSec(3.5);

	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path17", 0, 4, -3, 5, 1.0);
	Script.WaitSec(2);
	Walk2("Bunny1");
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path17", 0, 0, 0, 0, 1.0);
	Script.WaitSec(2.5);
	Run("AttackingRhino");
	Run("Bunny1")
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path17", 0, 0, 0, 0, 1.0);
	Run("TargetCARIBOU3");	
	Script.WaitSec(1);
	Run("Bunny2")	
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path17", 0, 0, .5, 0, 1.0);
	Script.WaitSec(2);
	Run("TargetCARIBOU2");
	Script.WaitSec(.25);
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path16", 0, -2, -1.5, 3, 1.0);
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path17", 0, 4, -3, 5, 1.0);	 
    Run("TargetCARIBOU1");        
    Script.WaitSec(1.25);
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path16", 0, 0, -1, 0, 1.0);
	
	--POWERUP
	Duck = EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path17", 0, 0, 0, 0, 1.0);
	EntGame.CreateAnimalPowerUp(Duck, PID_3X_RELOAD_RATE);
	
	Script.WaitSec(1.5);
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path16", 0, 0, 0, 0, 1.0);
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path16", 0, 4, 1.5, 6, 1.0);
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path16", 0, -2, -1.5, 3, 1.0);
	Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath18", 0, ST_WPT_RUN, 0, -2, -1.5, 1);
	Script.WaitSec(1);
   
    Camera.SetSpeed(entCamera, 3.0, 0.1); 
    Camera.StopAtWaypoint(entCamera, "CamWptOO");
    
    Script.WaitSec(1);
    EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath18", 0, ST_WPT_RUN, 0, 0, 0, 1);
    Script.WaitSec(1.5);
    EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath18", 0, ST_WPT_RUN, 0, -1, -1, 1);
	Script.WaitSec(5.5);
	
    a4=EntGame.SpawnAnimalOnPath(AID_GROUSE, "BunnyPath18", 0, ST_WPT_RUN, 10, 0, -1, 1.5);
	Animal.FaceEntity(a4, entCamera);
	a6=EntGame.SpawnAnimalOnPath(AID_GROUSE, "BunnyPath18", 0, ST_WPT_RUN, 10, 0, .5, 1.2);
	Animal.FaceEntity(a6, entCamera);
		
    Camera.SetPanOffset(entCamera, -50.0, 1.0); --LOOK LEFT

    Script.WaitSec(1.0);
	
	--POWERUP
    c1=EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path18", 0, ST_POPUP, 1, 0, 0, 1.2);
	EntGame.CreateAnimalPowerUp(c1, PID_WILEY_VISION_50);
    Animal.SetElvOffset(c1, 0); 
    Animal.FaceEntity(c1, entCamera);
    Animal.SetCoinMode(c1, CM_SPAWNREL);
    Script.WaitSec(1.5);
	
	--POWERUP
    c2=EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path19", 0, ST_POPUP, 1.5, 0, 0, 1.2);
	EntGame.CreateAnimalPowerUp(c2, PID_WILEY_VISION_50);
    Animal.SetElvOffset(c2, 1.4); 
    Animal.FaceEntity(c2, entCamera);
    Animal.SetCoinMode(c2, CM_SPAWNREL);
    
    Camera.SetSpeed(entCamera, 2.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 1.0, 0.1);
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 1.0, 0.1);
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 0.0, 0.1);
		
    Script.WaitSec(3);
    
    Camera.SetPanOffset(entCamera, 56.0, 1.0); --LOOK RIGHT

    c3=EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path20", 0, ST_POPUP, 1, 0, 0, 1.2);
    Animal.SetElvOffset(c3, 0); 
    Animal.FaceEntity(c3, entCamera);
    Animal.SetCoinMode(c3, CM_SPAWNREL);
    Script.WaitSec(.75);
	
    c4=EntGame.SpawnAnimalOnPath(AID_GROUSE, "Path21", 0, ST_POPUP, 1, 0, 0, 1.2);
    Animal.SetElvOffset(c4, .6); 
    Animal.FaceEntity(c4, entCamera);
    Animal.SetCoinMode(c4, CM_SPAWNREL);	
	
    Script.WaitSec(2);
	EntGame.SpawnAnimalOnPath(AID_COYOTE, "Path15", 0, ST_WPT_RUN, 0, 0, 1, 1.2); 
	Script.WaitSec(.5);
	EntGame.SpawnAnimalOnPath(AID_COYOTE, "Path15", 0, ST_WPT_RUN, 0, 1, 0, 1.2);
	Script.WaitSec(.5);
  
  	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path22", 0, 0, 0, 0, 1.0);
	
	Camera.SetPanOffset(entCamera, 0.0, 1.5); --LOOK CENTER

    Camera.SetSpeed(entCamera, 1.0, 0.1);	   
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 2.0, 0.1);
	Script.WaitSec(.25);
	Camera.SetSpeed(entCamera, 3.0, 0.1);
	
	EntGame.SpawnAnimalOnPath(AID_COYOTE, "Path15", 0, ST_WPT_RUN, 0, 0, 1, 1.2); 
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path22", 0, 0, 2.5, 0, 1.0);

	Script.WaitSec(.5);

	a1=EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "Path23", 0, ST_WPT_WALK, 6, 0, 0, 1.2);
	Entity.SetName(a1, "CARIBOU1");	
	Script.WaitSec(.5);
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path22", 0, 0, 0, 0, 1.0);
	EntGame.SpawnBirdOnPath(AID_HARLEQUINN, "Path22", 0, 0, 1.5, 0, 1.0);
	Script.WaitSec(1.5);
	a2=EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "Path23", 0, ST_WPT_WALK, 8, -2.5, 0, 1.2);
	Entity.SetName(a2, "CARIBOU2");
    Script.WaitSec(4);  	
 	a3=EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "Path23", 0, ST_WPT_WALK, 6, 0, 0, 1.2);
 	Entity.SetName(a3, "CARIBOU3");
    	
    Camera.SetPanOffset(entCamera, 90.0, 1.5); --LOOK RIGHT
    
    a4=EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "Path23", 0, ST_WPT_WALK, 6, 0, 0, 1.2);
    Entity.SetName(a4, "CARIBOU4");		
   	Script.WaitSec(.5); --SHOOT TIME.
   		
   	--WALKING ACROSS BRIDGE

	Script.WaitSec(2.0);
   	Run("CARIBOU1")
   	Script.WaitSec(1.0);
   	Run("CARIBOU2")
   	Script.WaitSec(1.5);
   	Run("CARIBOU3")
   	Script.WaitSec(.5);
   	Run("CARIBOU4")	
   	Script.WaitSec(2);
	
	--POWERUP
	Moose = EntGame.SpawnAnimalOnPath(AID_MOOSE, "Path12", 0, ST_GRAZING, 3, 0, 0, 1.2);
	Animal.FaceEntity(Moose, entCamera); 
	EntGame.CreateAnimalPowerUp(Moose, PID_INFINITE_MAGAZINE);
	
    Camera.SetPanOffset(entCamera, 0.0, 1.5); --LOOK CENTER 
   		 
    end;    

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

function Part4()

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

	Camera.SetSpeed(entCamera, 3.0, 0.1); 
	Camera.StopAtWaypoint(entCamera, "CamWptQQ");
    
	Script.WaitSec(1);
		
	--WALKING ACROSS BRIDGE
	
	Script.WaitSec(5);  
	BunnyDash1=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath22", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Animal.FaceEntity(BunnyDash1, entCamera);
	Script.WaitSec(.5);
	BunnyDash4=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath25", 0, ST_WPT_RUN, 0, 0, 0, 1.1);
	Animal.FaceEntity(BunnyDash4, entCamera);	  
	Script.WaitSec(1);
	BunnyDash2=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath23", 0, ST_WPT_RUN, 0, 0, 0, 1.9);
	Animal.FaceEntity(BunnyDash2, entCamera);
	Script.WaitSec(.5);
	BunnyDash3=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath24", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
	Animal.FaceEntity(BunnyDash3, entCamera);
	Script.WaitSec(1.5);
	BunnyDash4=EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath25", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Animal.FaceEntity(BunnyDash4, entCamera); 
	BunnyDash1=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath24", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
	Animal.FaceEntity(BunnyDash1, entCamera);  
	Script.WaitSec(1);
	BunnyDash2=EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath23", 0, ST_WPT_RUN, 0, 0, 0, 1.6);
	Animal.FaceEntity(BunnyDash2, entCamera);
	Script.WaitSec(1.5);
	BunnyDash3=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath22", 0, ST_WPT_RUN, 0, 0, 0, 2.2);
	Animal.FaceEntity(BunnyDash3, entCamera);
	Script.WaitSec(1.0);
	BunnyDash4=EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath25", 0, ST_WPT_RUN, 0, 0, 0, 1.1);
	Animal.FaceEntity(BunnyDash4, entCamera);
	BunnyDash2=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath23", 0, ST_WPT_RUN, 0, 0, 0, 1.6);
	Animal.FaceEntity(BunnyDash2, entCamera); 
	Script.WaitSec(1.5);
	BunnyDash1=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath22", 0, ST_WPT_RUN, 0, 0, 0, 1.0);
	Animal.FaceEntity(BunnyDash1, entCamera);  	
	BunnyDash3=EntGame.SpawnAnimalOnPath(AID_COYOTE, "BunnyPath24", 0, ST_WPT_RUN, 0, 0, 0, 1.8);
	Script.WaitSec(.5);
	Animal.FaceEntity(BunnyDash3, entCamera);
	BunnyDash1=EntGame.SpawnAnimalOnPath(AID_ARCTIC_HARE, "BunnyPath23", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
	Animal.FaceEntity(BunnyDash1, entCamera);
	Script.WaitSec(2.0);
	BunnyDash4=EntGame.SpawnAnimalOnPath(AID_BLACK_BEAR, "BunnyPath25", 0, ST_WPT_RUN, 0, 0, 0, 1.1);
	Animal.FaceEntity(BunnyDash4, entCamera); 	  	
	Script.WaitSec(2);
	
	--PREDATOR 5
	BunnyDash4=EntGame.SpawnAnimalOnPath(AID_BLACK_BEAR, "BunnyPath22", 0, ST_WPT_RUN, 0, 0, 0, 1.3);
	Animal.FaceEntity(BunnyDash4, entCamera);	
	Animal.SetAutoChargeDist(BunnyDash4, 20);	
	Animal.SetAttackType(BunnyDash4, ATK_STATIC);
	Animal.SetStaticAttackDist(BunnyDash4, 4);
	Animal.SetStaticAttackDelay(BunnyDash4, 1.75);	 
	Animal.SetAttackRepeat(BunnyDash4, 2);    
	Animal.SetPostAttackRand(BunnyDash4, false);
	Animal.SetPostAttackDir(BunnyDash4, 90);
		
	Script.WaitSec(3.0);
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Script.WaitSec(1.0);
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
	Script.WaitSec(1.5);
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.7);
	Script.WaitSec(.5);
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Script.WaitSec(1.0);
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_F, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.6);
	Script.WaitSec(1.5);
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
	Script.WaitSec(1.0);
	EntGame.SpawnAnimalOnPath(AID_CARIBOU_M, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.2);
	Script.WaitSec(1.0);
	EntGame.SpawnAnimalOnPath(AID_MOOSE, "LongerPath3", 0, ST_WPT_RUN, 0, 0, 0, 1.5);
			
    end;
    	
-----------------------------------------------------------------------------
-- Main entry point
   
Setup();   
Intro();
Part1();
Part2();
Part3();
Part4();
 