Subversion-Projekte sthq.gbs

Revision

Revision 880 | Revision 889 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

// EF2 Level Script File 
// 
// Level:               map09.bsp
// Script By:           DrBob & Argyle & TickNSwisted & Sam "Bicko" Bickley & LTiefland & Chrissstrahl
// Geometry By:         TickNSwisted & Argyle & Sam "Bicko" Bickley 
// Created on:          02/04/04 
// Last Edited on:              03.02.2006
// Last Edited By:              ltiefland
//************************************************************************** 
//   MAP 9SCRIPT 
//************************************************************************** 
//INCLUDES 
#include "maps/global_scripts/global_common.scr"
#include "maps/global_scripts/global_archetype.scr"
#include "maps/global_scripts/global_playerLoadout.scr" 

//NOTES
/*
sound/doors/door_locked.wav
sound/ships/romulan/rom_beep_yes.wav
sound/ships/romulan/rom_beep_no.wav
sound/ships/romulan/rom_beep_activate.wav
sound/ships/romulan/rom_redalert.wav
*/


//VARS
//************************************************************************** 
float romulan1_active;
float elevator1_pos = 1; 
float door_01_pos = 1; 
float lift_02_pos = 0; 


//STAGE 0
void main();
void setupWorld();

//STAGE 1
void granade_romulan1();
void fire_lift_01() ;
void lift_01_romulaner();
//
void fire_lift_01(); 
void fire_lift_02(); 
void fire_lift_03(); 
void fire_ff_01();
void fire_steam_01();
void fire_steam_02();
//
void cin_cells(); 
void cin_cells_skip();
//
void shuttle_entrance();
void shuttle_entrance_skip();
//
void cin_shuttle();
void cin_shuttle_skip();
void stammheimEnteringShuttle();
void illiaEnteringShuttle();




void fire_lift_02 ()
{
        if ( lift_02_pos == 0 )  
        {
                $lift_02.playsound ( "sound/environment/machine/lift3.wav" );  
                $lift_02.time ( 4 ); 
                $lift_02.movedown ( 280 ); 
                wait ( 4 ); 
                $lift_02.playsound ( "sound/environment/machine/lift3stop.wav" ); 
                wait ( 3 ); 
                lift_02_pos = 1; 
        }
        else 
        {
                if ( lift_02_pos == 1 )  
                {  
                        $lift_02.playsound ( "sound/environment/machine/lift3.wav" );  
                        $lift_02.time ( 4 );  
                        $lift_02.moveup ( 280 ); 
                        wait ( 4 ); 
                        $lift_02.playsound ( "sound/environment/machine/lift3stop.wav" );  
                        wait ( 3 );  
                        lift_02_pos = 0;  
                }
        }
}

void fire_lift_03 () 
{ 
        $lift_03.playsound ( "sound/environment/machine/lift3.wav" ); 
        $lift_03.time ( 3 ); 
        $lift_03.moveup ( 262 );
        wait ( 3 ); 
        $lift_03.playsound ( "sound/environment/machine/lift3stop.wav" ); 
        wait ( 4 ); 
        $lift_03.playsound ( "sound/environment/machine/lift3.wav" ); 
        $lift_03.time ( 3 ); 
        $lift_03.movedown ( 262 ); 
        wait ( 3 ); 
        $lift_03.playsound ( "sound/environment/machine/lift3stop.wav" );
        wait ( 3 ); 
}

void fire_baydoors ()
{
        $bay_door_01.playsound ( "sound/environment/machine/lift4.wav");
        $bay_door_01.time ( 5 );
        $bay_door_01.movenorth ( 500 );
        $bay_door_02.time ( 5 );
        $bay_door_02.movesouth ( 500 );
        wait ( 5 );
        $bay_door_01.playsound ( "sound/environment/machine/lift4stop.wav" );
}

void fire_ff_01 () 
//Removes the ff to the controll center.
{
        $trigger_ff.playsound( "sound/ships/romulan/rom_beep_activate.wav" );
        wait( 2 );
        
        $sparks_ff.selfdetonate();
        wait( 0.1 );
        $device_ff_origin.angles( '90 -90 0' );
        $ff_01.remove ();
        $sparks_ff.show();
        $cable_ff.show();
        wait( 3 );
}


void fire_steam_01()
{
        $knob_steam_01.rotateZ(50);
        //  $knob_steam_01.movenorth(1);
        $knob_steam_01.playsound( "sound/environment/metal/crank_switch.wav" );
        wait(1);
        $knob_steam_01.rotateZ(0);
        $trig_steam_01.nottriggerable();
        $enty_steam_01.remove ();
}

void fire_steam_02()
{
        $knob_steam_02.rotateX(64);
        //  $knob_steam_02.movenorth(1);
        $knob_steam_02.playsound( "sound/environment/metal/crank_switch.wav" );
        wait(1);
        $knob_steam_02.rotateX(0);
        $trig_steam_02.nottriggerable();
        $enty_steam_02.remove ();
}

//************************************************************************** 
//MAIN
//**************************************************************************
void main() 
{ 
        soundtrack( "music/map9.mus" ); 
        $sky.rendereffects( "+skyorigin" );
        thread setupWorld(); 
        
        //Wait for the Player to be Ready
        waitForPlayer();
        
        //Equip developers with something special, like tricorder to chek all the model archetypes
/*      if( getCvar( "developer" ) == "1" )
        {
                $player.give ( "models/weapons/worldmodel-tricorder-STX.tik" );
                stuffcmd( "sv_showInfo", "1" );
                stuffcmd( "sv_showInfodist", "512" );
        }*/ //Removed by Chrissstrahl for beta3 relase
        
        
        //Euip player with weapons
        $player.turn(45,.1);//BUGFIX, spawnpoint sux
        $player.give( "models/weapons/worldmodel-compressionrifle.tik" );
        $player.give( "models/weapons/worldmodel-rom-disruptor.tik" );

        //Give some Ammo
        $player.ammo( "Plasma", 200 );
        $player.armor( "BasicArmor", 100 );
        
        //Make the player use this weapon now
        $player.use( "romulanDisruptor" );
        
        //Show the mission objective 
        $player.setobjectiveshow( "findstammheim", 1 );
        wait( 1.5 );
} 

void setupWorld()
{
        //Setup The Archetypes
        thread globalArchetype_Setup( $console_0, "RomulanGenericUsableConsole");
        thread globalArchetype_Setup( $console_1, "RomulanSecurityUsableConsole");
        thread globalArchetype_Setup( $console_2, "RomulanGenericUsableConsole");
        thread globalArchetype_Setup( $console_3, "RomulanSecurityUsableConsole");
        
        //Setup The OnUse Threads
        thread globalCommon_OnUse( $trigger_fire_lift_01, "lift_01_romulaner" ); 
        
        //Loop Sounds
        $stammheim_forcefield.loopsound( "sound/ships/enterprise/ent_forcefield.wav" , 1, 125 );
        
        //Force Field Generator Device (Not the ventilator system)
        $device_ff.bind( $device_ff_origin );
        $sparks_ff.hide();
        $cable_ff.hide();
        $device_ff_origin.angles( '0 -90 0' );
        
        //Granade Romulaner
        $romulan1.ai_off();//Sleep till we need you
        
        //TEMORARY -> Lock Cell Door and disable cinematics
        //Till player finds the console to unlock the cell
        $cell_door.lock();
        $trigger_cin_cells.nottriggerable();
        //Lock door for the shuttlebay
        $baydoor.lock();
        
        //Cells, outside gards
        $romulan2.ai_off();
        $romulan3.ai_off();
        $romulan4.ai_off();
        $romulan2.hide();
        $romulan3.hide();
        $romulan4.hide();
        $romulan2.notsolid();
        $romulan3.notsolid();
        $romulan4.notsolid();

        //Video Screen
        $screen_on.hide();
    $screen_pattern.show();
        
        //Shuttle, Romulan Patrols
        $shuttle_attacker1.ai_off();
        $shuttle_attacker2.ai_off();
        $shuttle_attacker3.ai_off();
        $shuttle_attacker4.ai_off();
        $shuttle_attacker1.hide();
        $shuttle_attacker2.hide();
        $shuttle_attacker3.hide();
        $shuttle_attacker4.hide();
        $shuttle_attacker1.notsolid();
        $shuttle_attacker2.notsolid();
        $shuttle_attacker3.notsolid();
        $shuttle_attacker4.notsolid();

        //Shuttle, Bind Models
        $drull_shuttle.bind($shuttle_bind);
        $shuttle_main.bind($shuttle_bind);

        //Change the player's model 
        $player.model( "char/hazardteam_jurot.tik" ); 

        //Load the mission objectives 
        $player.loadobjectives( "GBS10" ); 
        
        //Make Stammheim so that he isn't allowed to be killed by you 
        $stammheim.not_allowed_to_kill(); 

        //Remove Stammheim's toy 
        $stammheim.removeactorweapon( "CompressionRifle" ); 

        $illia_cockpit.removeactorweapon( "CompressionRifleEnhanced" );
        $stammheim_cockpit.removeactorweapon( "CompressionRifle" );


        //Spawn cameras 
        spawn( "Camera", "targetname", "cam1" );
        spawn( "Camera", "targetname", "cam2" ); 
        spawn( "Camera", "targetname", "cam3" );
        spawn( "Camera", "targetname", "cam4" );
        spawn( "Camera", "targetname", "cam5" );
        spawn( "Camera", "targetname", "cam6" );
        spawn( "Camera", "targetname", "cam7" );
        spawn( "Camera", "targetname", "cam8" );

        //Remove NPCs AI 
        $stammheim.ai_off();
        $stammheim_cockpit2.ai_off();
        $stammheim_cockpit2.hide();
        $stammheim_cockpit.ai_off();
        $illia_cockpit.ai_off();
        $imdead.ai_off();
        $arrest1.ai_off();
        $arrest2.ai_off();
        $arrest3.ai_off();
        $arrest4.ai_off();

        //Set NPCs sides 
        $stammheim.actortype( "teammate" ); 
        $player.addrosterteammate1( $stammheim ); 

        //Make it so that Romulans wont attack Stammheim, only you 
        $stammheim.flags( "+notarget" ); 

        //Make Stammheim a mission target 
        $stammheim.missionobjective( 1 ); 

        //Setup NPC animations
        $stammheim.anim( "idle_breathing" ); 
        $imdead.anim("dead_in_captain_chair");

        //Setup NPC facial animation 
        $stammheim.morph( "exp_eyes_heavy" ); 
        $stammheim.morph( "exp_Nervous" ); 
        $stammheim.morph( "exp_Fear" ); 
        $stammheim.morph( "exp_Sad" ); 

        $entrance_trigger.nottriggerable();
        $trigger_final.nottriggerable();

        //Make NPCs non-pushable 
        
        //Loop redalert Sound
        //$player.loopsound("sound/ships/romulan/rom_redalert.wav", 1 );
}


//STAGE 1
//************************************************************************** 
// Reach the lift
//************************************************************************** 

void granade_romulan1()
//Romulan Grenadier
{
        //Chek if he is still alive, then make him think
        if( doesEntityExist( $romulan1 ) )
        {
                $romulan1.ai_on();
        }
}

void fire_lift_01() 
{
        //Check if the grenadier is still allive, if make him sleep
        //ELSE he will make noise all the time
        if( doesEntityExist( $romulan1 ) )
        {
                $romulan1.sleep();
        }
        
        //Check if the Lift was active
        if( romulan1_active != 1 )
        {
                thread lift_01_romulaner();
                romulan1_active = 1;
        }
        //Move the lift down, lock the trigger, wait and move the lift up again
        $trigger_fire_lift_01.nottriggerable();
        $lift_01.playsound ( "sound/environment/machine/lift3.wav" ); 
        $lift_01.time ( 6 ); 
        $lift_01.movedown ( 432 ); 
        wait ( 6 ); 
        $lift_01.playsound ( "sound/environment/machine/lift3stop.wav" ); 
        
        wait ( 5 ); 
        
        $lift_01.playsound ( "sound/environment/machine/lift3.wav" ); 
        $lift_01.time ( 6 ); 
        $lift_01.moveup ( 432 ); 
        wait ( 6 ); 
        $lift_01.playsound ( "sound/environment/machine/lift3stop.wav" ); 
        $trigger_fire_lift_01.triggerable();    
} 


void lift_01_romulaner()
{
        //Spawn a Romulan Solider at the lift01
        $romulan2.ai_on();
        $romulan2.displayeffect( "TransportIn", "Romulan" );
        $romulan2.show();
        wait( 2 ); //Wait a moment to simulate the transporter effect
        $romulan2.solid();
}



//STAGE 2
//************************************************************************** 
// Manage to open the hall door
//************************************************************************** 

void secret_dancer1()
//Secret dancer, if player enters the room she starts dancing
{
        //Let her dance
        while( doesEntityExist( $dancer1 ) )
        {
                $dancer1.anim( "dance1" );
                wait( 10 );
        }
}

void grp_hall_door()
//Unlock and open the hall door for stage 3
{
        cam_fadeout( 0.1, 0, 0, 0, 1, 0 );       
        $cam2.follow( $entrance );       
        $cam2.cut();     
        cinematic();     
        freezeplayer();  
        letterbox( 0.5 );        
        wait( 0.5 );     
        
        cam_fadein( 1, 0, 0, 0, 1, 0 );  
        wait( 0.1 );     
        cuecamera($cam2);
        $trigger_grp_hall_door.nottriggerable();
        $grp_hall_door.unlock();
        $grp_hall_door.open( $trigger_grp_hall_door );
        triggerentity($door_sound);      
        wait(3);         
        noncinematic();  
        clearletterbox( 0.1 );   
        
        releaseplayer();         
        cueplayer();     
         
        wait( 0.1 );     
        
        cam_fadein( 0.1, 0, 0, 0, 1, 0 );
}

//STAGE 3
//************************************************************************** 
// -
//************************************************************************** 
void grp_hall_door_lock()
//lock and open the hall door
{
        $grp_hall_door.close();
        $grp_hall_door.lock();
}

void unlock_cells()
{
        $trigger_unlock_cells.playsound("sound/ships/romulan/rom_beep_yes.wav", 1, 1, 10 );
        $trigger_cin_cells.triggerable();
        $cell_door.unlock();
        $romulan3.show();
        $romulan3.solid();
        $romulan3.ai_on();
}
//CINEMATIC FUNCTIONS 
void cin_cells() 
{
        //Unlock Bay Door, 
        $baydoor.unlock();
        
        //Activate a nother soldier (he will patrol until player comes in viewrange)
        $romulan4.show();
        $romulan4.solid();
        $romulan4.ai_on();
        
        
        skipthread( "cin_cells_skip" ); 
        cam_fadeout( 0.1, 0, 0, 0, 1, 0 ); 

        //Make Illia holster any weapon she might have acquired 
        $player.holster();
        $player.immobilize(1);
        $player.droptofloor();
        wait(.1);
        //Bring up a fake player model 
        fakeplayer(); 

        //Make the fakeplayer use the same weapon as you 
        globalCommon_AiActorUseWeapon( $fakeplayer, "current" ); 

        //Initialize the fake player 
        $fakeplayer.strictlyfollowpath( 1 ); 
        $stammheim.strictlyfollowpath( 1 ); 

        $cam1.follow( $cin_cells_cam1_pos1, $fakeplayer ); 
        $cam1.cut(); 

        //Make it a cinematic 
        cinematic(); 
        letterbox( 0.5 ); 

        wait( 0.5 ); 

        cam_fadein( 1, 0, 0, 0, 1, 0 );
        wait( 0.1 ); 
        cuecamera($cam1);

        //Make Illia walk up to the doors
        $fakeplayer.walkto( "$cin_cells_illia_pos_enter" ); 
        waitFor( $fakeplayer ); 

        //Open the door 
        //thread fire_door_01(); 

        //Make the camera pan down to look through the door 
        $cam1.follow( $cin_cells_cam1_pos2 ); 

        //Make Illia hesitate slightly 
        wait( 0.3 ); 
        cuecamera($cam1);

        //Make Illia walk to inside the cell room 
        //$fakeplayer.walkto( "$cin_cells_illia_pos_inside", "run", 0, -1 ); 
        $fakeplayer.walkto( "$cin_cells_illia_pos_inside" ); 
        waitFor( $fakeplayer ); 
        $fakeplayer.headwatch( $stammheim ); 
        $fakeplayer.walkto( "$cin_cells_illia_pos_nearcell" ); 
        wait( 1 ); 

        //Close the door again, just to be tidy 
        //fire_door_01(); 

        //Fade the camera out 
        cam_fadeout( 1, 0, 0, 0, 1, 0 ); 
        wait( 2 ); 

        //Setup the camera inside the cell room 
                
        $cam1.follow( $cin_cells_cam1_pos3 ); 
        $cam1.cut();

        wait( 1 ); 
        cuecamera($cam1);

        cam_fadein( 0.1, 0, 0, 0, 1, 0 ); 

        //POSSIBLE ANIMATIONS FOR STAMMHEIM: 
        //   cheer              :   Arms above head 
        //   conv-embarrassment :   Head in hands 
        //   conv-gesture1      :   Looking around, scared 
        //   conv-laugh1        :   Pain 
        //   conv-look          :   Looking around, scared 
        //   conv-shakehead     :   Pain in head, voices
        //   idle_breathing     :   Hard to breathe

        //Illia: Stammheim. 
        $fakeplayer.morph( "exp_Relief" ); 
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/stammheim.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer ); 
        $fakeplayer.unmorph( "exp_Relief" ); 

        wait( 0.5 ); 

        //Turn Stammheim towards the player 
        $stammheim.turntowardsplayer(); 
        $stammheim.headwatch( $fakeplayer ); 

        wait( 0.5 ); 

        //Stammheim: Who...who are you? 
        $stammheim.playdialog( "localization/sound/dialog/map09/Stammheim/whoareyou.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim ); 

        //Start the camera panning up on Illia 
        $cam1.follow( $cin_cells_cam1_pos4 ); 
        $cam1.cut(); 

        //Illia: You know me Stammheim.
        $fakeplayer.anim( "conv-gesture1" ); 
        $fakeplayer.morph( "exp_Skeptical" ); 
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/youknowme.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer ); 
        $fakeplayer.anim( "idle" ); 

        //Illia: The mission on Cardassia Prime? 
        $fakeplayer.anim( "conv_shrug" ); 
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/cardassiaprime.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer ); 
        $fakeplayer.anim( "idle" ); 

        wait( 0.5 ); 

        //Illia: Doesn't that ring a bell? 
        $fakeplayer.unmorph( "exp_Skeptical" ); 
        $fakeplayer.morph( "exp_Confused" ); 
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/ringabell.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer ); 

        wait( 0.5 ); 

        //Pointing at Stammheim through the forcefield 
        $cam1.follow( $cin_cells_cam1_pos5 ); 
        $cam1.cut(); 

        //Stammheim: No more questions...please...please... 
        $stammheim.anim( "conv-shakehead" );
        $stammheim.playdialog( "localization/sound/dialog/map09/Stammheim/noquestions.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim ); 

        wait( 1.5 ); 

        //Stammheim: My head... 
        $stammheim.anim( "cheer" ); 
        $stammheim.morph( "exp_Pain" ); 
        $stammheim.playdialog( "localization/sound/dialog/map09/Stammheim/myhead.mp3", 2, 10000, 0 );
        waitForAnimation( $stammheim, "cheer" ); 
        $stammheim.anim( "idle" ); 
        waitForDialog( $stammheim ); 

        //Stammheim: The Romulan said the pain would stop...but it hasn't. 
        $stammheim.anim( "conv-shakehead" ); 
        $stammheim.playdialog( "localization/sound/dialog/map09/Stammheim/painstop.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim ); 

        wait( 0.5 ); 

        //Looking at Illia 
        $cam1.follow( $cin_cells_cam1_pos6, $fakeplayer ); 
        $cam1.cut(); 

        //Illia: The Romulans didn't exactly handle him with kid gloves, it seems. 
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/romulans.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer );
        $fakeplayer.unmorph( "exp_Confused" ); 
        $fakeplayer.morph( "exp_Serious" ); 

        wait( 0.5 ); 

        //Make Illia walk over to the console & deactivate the forcefield 
        $fakeplayer.walkto( "$cin_cells_illia_pos_console" ); 
        waitFor( $fakeplayer ); 

        wait( 0.1 ); 

        //Make Illia use the console and play a sound 
        //$fakeplayer.turntowardsentity( $console ); 
        $fakeplayer.headwatch( $console ); 
        $fakeplayer.turntoangle( 0 ); 
        waitFor( $fakeplayer ); 
        $fakeplayer.anim( "ent-transporter-rear-gesture" ); 
        $console.playsound( "sound/ships/romulan/rom_beep_yes.wav", 0, 1 ); 

        $cam1.lookat( $fakeplayer ); 

        waitForAnimation( $fakeplayer, "ent-transporter-rear-gesture" ); 
        $fakeplayer.anim( "idle" ); 

        $cam1.follow( $cin_cells_cam1_pos7, $stammheim ); 
        $cam1.cut(); 

        //Stop the forcefield sound, and play the forcefield_down sound 
        $stammheim_forcefield.stoploopsound(); 
        $stammheim_forcefield.playsound( "sound/ships/enterprise/ent_forcefield_down.wav", 0, 1 ); 
        $stammheim_forcefield.remove(); 

        wait( 0.1 ); 

        //Illia: Come on Alexander. I'll get you out of here.
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/comeonalexander.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer ); 

        //Illia: Try to follow me, ok? 
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/follow.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer ); 

        wait( 1 ); 

        //Illia: Do you understand? 
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/understood.mp3", 1, 10000, 0 );
        $stammheim.anim( "idle_breathing" ); 
        waitForDialog( $fakeplayer ); 

        wait( 1.5 ); 

        //Stammheim: Follow...Yes... 
        $stammheim.anim( "conv-yes" ); 
        $cam1.follow( $cin_cells_cam1_posstammheim, $stammheim ); 
        //$cam1.cut(); 
        $stammheim.playdialog( "localization/sound/dialog/map09/Stammheim/follow.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim ); 
        $stammheim.anim( "idle_breathing" ); 

        wait( 0.5 );

        //Stammheim: Follow... 
        $stammheim.playdialog( "localization/sound/dialog/map09/Stammheim/follow2.mp3", 2, 10000, 0 );
        wait( 1 ); 

        cin_cells_skip(); 
} 
 
void cin_cells_skip() 
{ 
        skipthread( "Null" ); 
        killthread( "cin_cells" ); 
        $player.immobilize(0);
        cam_fadeout( 1, 0, 0, 0, 1, 0 ); 
        wait( 2 ); 

        //Remove all evidence of before the cin 
        $stammheim_forcefield.remove(); 
        $fakeplayer.warpto( "$cin_cells_illia_pos_inside" ); 
        removefakeplayer(); 

        //End the cinematic 
        noncinematic(); 
        clearletterbox( 0.1 ); 
        cueplayer();
        wait( 0.1 ); 
        
        cam_fadein( 0.1, 0, 0, 0, 1, 0 ); 

        //Now that the cinematic is over, make Stammheim follow you 
        $stammheim.ai_on(); 

        //Unholster the crap
        $player.holster(); 

        //Make the objective complete 
        $player.setobjectivecomplete( "findstammheim", 1 ); 
        $stammheim.missionobjective( 0 ); 

        //Show the new objective 
        $player.setobjectiveshow( "escapewithshuttle", 1 ); 

        $entrance_trigger.triggerable();
}

void shuttle_entrance()
{
        skipthread( "shuttle_entrance_skip" ); 
        cam_fadeout( 0.1, 0, 0, 0, 1, 0 ); 

        //Make Illia holster any weapon she might have acquired 
        $player.holster();

        //Bring up a fake player model 
        fakeplayer(); 
        $stammheim.ai_off();

        $fakeplayer.warpto( "$shuttle_cin_illia" );
        $stammheim.warpto( "$shuttle_cin_stammheim" ); 

        //Make the fakeplayer use the same weapon as you 
        $fakeplayer.removeactorweapon ( "BurstRifle" );
        globalCommon_AiActorUseWeapon( $fakeplayer, "current" ); 

        $cam3.follow( $cin_enter_shuttle, $fakeplayer ); 
        $cam3.cut(); 

        //Make it a cinematic 
        cinematic(); 
        letterbox( 0.5 ); 

        wait( 0.5 ); 

        cam_fadein( 1, 0, 0, 0, 1, 0 );
        wait( 0.1 ); 
        cuecamera($cam3);


        //Make Illia walk to the shuttle
        //$fakeplayer.strictlyfollowpath(1);
        //################################          
        //Entering Shuttle
        thread illiaEnteringShuttle();
        stammheimEnteringShuttle();


        cam_fadeout( 0.1, 0, 0, 0, 1, 0 );
        $illia_cockpit.show();
        $illia_cockpit.solid();
        $stammheim_cockpit.show();
        $stammheim_cockpit.solid();
        $cam4.follow( $cam_cockpit ); 
        $cam4.cut();
        cam_fadein( 1, 0, 0, 0, 1, 0 );
        wait( 0.1 ); 
        cuecamera($cam4);
        //Cockpit
        $illia_cockpit.walkto( "$shuttle_illia01" );
        $stammheim_cockpit.walkto( "$shuttle_stammheim01" );
        waitfor($stammheim_cockpit);
        $stammheim.notsolid();
        $stammheim.hide();

        $illia_cockpit.playdialog( "localization/sound/dialog/map09/Illia/sitdownalexander.mp3", 2, 10000, 0 );
        waitForDialog( $illia_cockpit );
        $illia_cockpit.playdialog( "localization/sound/dialog/map09/Illia/doorsofshuttlebay.mp3", 2, 10000, 0 );
        waitForDialog( $illia_cockpit );
        wait(1.5);
        $stammheim_cockpit.playdialog( "localization/sound/dialog/map09/Stammheim/myhead2.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim_cockpit ); 
        cam_fadeout( 1, 0, 0, 0, 1, 0 );

        $fakeplayer.warpto("$shuttle_exit1");
        $cam5.follow( $shuttle_exit_cin, $fakeplayer ); 
        $cam5.cut();  
        wait(.5);
        cuecamera($cam5);
        cam_fadein( 1, 0, 0, 0, 1, 0 );
        $fakeplayer.walkto("$shuttle_exit2");
        waitfor( $fakeplayer );
        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/deja-vu.mp3", 2, 10000, 0 ); 
        waitfordialog( $fakeplayer );

        shuttle_entrance_skip();
}


void shuttle_entrance_skip()
{
        skipthread( "Null" );
        killthread( "shuttle_entrance" );
        $stammheim.remove();
        $illia_cockpit.remove();
        $stammheim_cockpit.remove();
        cam_fadeout( 1, 0, 0, 0, 1, 0 ); 

        wait( 2 );  

        //Lock door for the shuttlebay
        $baydoor.close();
        $baydoor.lock();
        $fakeplayer.warpto( "$shuttle_exit2" ); 
        removefakeplayer();
        $player.holster();

        //End the cinematic 
        noncinematic(); 
        clearletterbox( 0.1 ); 
        cueplayer();

        wait( 0.1 ); 

        cam_fadein( 0.1, 0, 0, 0, 1, 0 );

        $trigger_final.triggerable();

        $shuttle_attacker1.displayeffect( "TransportIn", "Romulan" );
        $shuttle_attacker2.displayeffect( "TransportIn", "Romulan" );
        $shuttle_attacker3.displayeffect( "TransportIn", "Romulan" );
        $shuttle_attacker4.displayeffect( "TransportIn", "Romulan" );
        wait(2);
        $shuttle_attacker1.show();
        $shuttle_attacker1.solid();
        $shuttle_attacker2.show();
        $shuttle_attacker2.solid();
        $shuttle_attacker3.show();
        $shuttle_attacker3.solid();
        $shuttle_attacker4.show();
        $shuttle_attacker4.solid();
        wait(.4);  
        $shuttle_attacker1.ai_on();
        $shuttle_attacker1.attack($player);
        $shuttle_attacker2.ai_on();
        $shuttle_attacker2.attack($player);
        $shuttle_attacker3.ai_on();
        $shuttle_attacker3.attack($player);
        $shuttle_attacker4.ai_on();
        $shuttle_attacker4.attack($player);
}

void cin_shuttle()
{
        skipthread( "cin_shuttle_skip" ); 

        $stammheim_cockpit2.ai_off();
        $stammheim_cockpit2.show();
        $stammheim_cockpit2.solid();
        $stammheim_cockpit2.anim( "bar_sitting_forward" );

        //Imo Player, stuck there
        $player.immobilize( 1 );

        //Close Shuttle Doors
        $drull_shuttle.anim( "closing" );
        $drull_shuttle.playsound( "sound/doors/enterprise_door1.wav", 1 ,800 ); 
        waitforanimation( $drull_shuttle, "closing" );
        $drull_shuttle.anim( "closed" );
        
        //Open Bay Sky Door
        $bay_door_01.playsound ( "sound/environment/machine/lift4.wav");
        $bay_door_01.time ( 5 );
        $bay_door_01.movenorth ( 500 );
        $bay_door_02.time ( 5 );
        $bay_door_02.movesouth ( 500 );
        wait ( 5 );
        $bay_door_01.playsound ( "sound/environment/machine/lift4stop.wav" );

        //Remove the Shuttle Clip,( no reason given why)
        $shuttle_clip.remove();
        wait(1);
        
        //Shuttle Takeoff
        $shuttle_bind.followpath($shuttle_path);
        $shuttle_bind.playsound( "sound/vehicles/shuttlecraft/shuttle_takeoff.wav", 0, 4 );

        
        waitfor($shuttle_bind);
        $shuttle_bind.hide();
        
        //Make the fakeplayer use the same weapon as you 
        globalCommon_AiActorUseWeapon( $fakeplayer, "current" ); 
        
        //Holster Player Weapon
        $player.holster();
        
        //Fade Out Cam 
        cam_fadeout( 0.1, 0, 0, 0, 1, 0 );
        
        //Bring up a fake player model 
        fakeplayer(); 

        //Make it a cinematic 
        cinematic(); 
        letterbox( 0.5 ); 
        wait( 0.5 ); 

        $cam6.follow( $cin_final_pos1, $fakeplayer ); 
        $cam6.cut();
        cam_fadein( 1, 0, 0, 0, 1, 0 );
        wait(.5);
        cuecamera($cam6);

        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/no.mp3", 2, 10000, 0 );
        waitfordialog($fakeplayer);

        wait(1);

        $screen_pattern.hide();
        $screen_on.show();
        $fakeplayer.lookat( $screen_pos ); 
        wait(1);

        //$cam7.follow( $cin_final_pos2 ); 
        //$cam7.cut();
        //wait(.5);
        //cuecamera($cam7);
        //wait(.2);
        $stammheim_cockpit2.playdialog( "localization/sound/dialog/map09/Stammheim/Sorry.mp3", 2, 10000, 0 );
        waitfordialog($stammheim_cockpit2);
        $stammheim_cockpit2.playdialog( "localization/sound/dialog/map09/Stammheim/really.mp3", 2, 10000, 0 );
        waitfordialog($stammheim_cockpit2);
        $stammheim_cockpit2.playdialog( "localization/sound/dialog/map09/Stammheim/danger.mp3", 2, 10000, 0 );
        waitfordialog($stammheim_cockpit2);
        $stammheim_cockpit2.playdialog( "localization/sound/dialog/map09/Stammheim/played.mp3", 2, 10000, 0 );
        waitfordialog($stammheim_cockpit2);
        $stammheim_cockpit2.playdialog( "localization/sound/dialog/map09/Stammheim/hetlek.mp3", 2, 10000, 0 );
        waitfordialog($stammheim_cockpit2);
        $stammheim_cockpit2.playdialog( "localization/sound/dialog/map09/Stammheim/greet.mp3", 2, 10000, 0 );
        waitfordialog($stammheim_cockpit2);
        $stammheim_cockpit2.playdialog( "localization/sound/dialog/map09/Stammheim/youwill.mp3", 2, 10000, 0 );
        waitfordialog($stammheim_cockpit2);
        $screen_on.hide();
        $screen_pattern.show();

        wait(.5);

        $fakeplayer.playdialog( "localization/sound/dialog/map09/Illia/youbastard.mp3", 2, 10000, 0 );
        waitfordialog($fakeplayer);

        $cam8.follow( $cin_final_pos3, $fakeplayer ); 
        $cam8.cut();
        wait(.5);
        cuecamera($cam8);
        $fakeplayer.walkto( "$illia_final" );
        waitfor($fakeplayer);

        $sec_door.moveup(192);
        $sec_dppr.playsound("sound/doors/klingon_jtube.wav");
        waitfor($sec_door);
        $arrest1.walkto( "$arrest_dest1", "run" );
        $arrest2.walkto( "$arrest_dest2", "run" );
        $arrest3.walkto( "$arrest_dest3", "run" );
        $arrest4.walkto( "$arrest_dest4", "run" );
        $arrest1.lookat($fakeplayer);
        $arrest2.lookat($fakeplayer);
        $arrest3.lookat($fakeplayer);
        $arrest4.lookat($fakeplayer);
        wait(8);



        //FAKE ILLIA TO "cin_shuttle_illia_01"
        //STANHEIM WALK TO "cin_shuttle_stan_01"
        //CAMERA FOLLOW "cin_shuttle_cam1_pos1"
        //MODEL "int_door" ANIMATION OPEN
        //STANHEIM RUN TO "cin_shuttle_stan_02"
        //NPC "cin_shuttle_guard_A" WALK TO "cin_shuttle_guard_01"
        //NPC "cin_shuttle_guard_B" WALK TO "cin_shuttle_guard_02"
        //NPC "cin_shuttle_guard_C" WALK TO "cin_shuttle_guard_03"
        //NPC "cin_shuttle_guard_D" WALK TO "cin_shuttle_guard_04"
        //CAMERA "cin_shuttle_cam2_pos1"
        //FAKE ILLIA ANIMATION HANDS UP
        //CAMERA FADE OUT

        thread cin_shuttle_skip();
}


void cin_shuttle_skip()
{
        cam_fadeout( 1, 0, 0, 0, 1, 0 );
        skipthread( "Null" ); 
        killthread( "cin_shuttle" );
        $player.immobilize(0);
        //End the cinematic 
        noncinematic(); 
        clearletterbox( 0.1 ); 
        cueplayer();
        stuffcmd("map map10"); 
        cam_fadein( 1, 0, 0, 0, 1, 0 );
}


void illiaEnteringShuttle()
{
        $fakeplayer.notsolid();
        $fakeplayer.walkto( "$enter_shuttle2" );
        waitfor( $fakeplayer );
        
        $fakeplayer.walkto( "$enter_waypoint1" );
        waitfor( $fakeplayer );

        $fakeplayer.walkto( "$enter_waypoint3" );
        waitfor( $fakeplayer );

        $fakeplayer.walkto( "$enter_waypoint5" );
        waitfor( $fakeplayer );

        $fakeplayer.walkto( "$enter_waypoint7" );
        waitfor( $fakeplayer );
}

void stammheimEnteringShuttle()
{
        $stammheim.notsolid();
 
        $stammheim.walkto( "$enter_shuttle1" );
        waitfor( $stammheim );
        
        $stammheim.walkto( "$enter_waypoint0" );
        waitfor( $stammheim );
        wait(2);

        $stammheim.walkto( "$enter_waypoint2" );
        waitfor( $stammheim );

        $stammheim.walkto( "$enter_waypoint4" );
        waitfor( $stammheim );

        $stammheim.walkto( "$enter_waypoint6" );
        waitfor( $stammheim );

        $stammheim.walkto( "$enter_waypoint7" );
        waitfor( $stammheim );
}