Subversion-Projekte sthq.gbs

Revision

Revision 804 | Revision 846 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

//-----------------------------------------------------------------
//  EF2 Level Script File
//
//  Level:              map4
//  Script By:          Nemo22, Argyle, TickNSwisted, LTiefland
//  Geometry By:        Argyle, TickNSwisted
//  Created on:         01/04/2004
//  Last Edited on:     30/12/2004
//  Last Edited By:     LTiefland
//-----------------------------------------------------------------



float cadet1_pos, crew1_pos, lift_a_height, lift_b_height, lift_a_pos, lift_b_pos, player_pos;

void main();

void lock_lab_entry();
void initArchetypes();
void init();
void trigger_shower_door();
void wall_exp();
void redalert();
void kraftfeld();
void poison_gas();
void before_lab();
void inside_lab();
void secret_button();
void koi_swim();
void move_lifta();
void move_liftb();
void beamout_puzzle();
void beamout();


#include "maps/global_scripts/global_archetype.scr"
#include "maps/global_scripts/global_common.scr"
#include "maps/global_scripts/global_math.scr"
#include "maps/attackplayer.scr"

void move_lifta()
{
        wait(3);
        $trigger_lift_a_low.nottriggerable();
        $trigger_lift_a_up.nottriggerable();
        if (crew1_pos==0)
        {
                $lift_a.moveup(lift_a_height);
                lift_a_pos=2;
                waitfor($lift_a);
                lift_a_pos=1;
                $crew1.walkto("$lift_a_nav2");
                waitfor($crew1);
                wait(3);
                $crew1.walkto("$lift_a_nav3");
                waitfor($crew1);
                $lift_a.movedown(lift_a_height);
                lift_a_pos=2;
                waitfor($lift_a);
                lift_a_pos=0;
                crew1_pos=1;
        }
        else
        {
                if (lift_a_pos==0)
                {
                        wait(3);
                        $lift_a.moveup(lift_a_height);
                        waitfor($lift_a);
                        lift_a_pos=1;
                }
                else
                {
                        wait(3);
                        $lift_a.movedown(lift_a_height);
                        waitfor($lift_a);
                        lift_a_pos=0;
                }
        }
        wait(10);
        $trigger_lift_a_low.triggerable();
        $trigger_lift_a_up.triggerable();
}

void move_liftb()
{
        $trigger_lift_b_low.nottriggerable();
        $trigger_lift_b_up.nottriggerable();
        if (cadet1_pos==1)
        {
                $lift_b.moveup(lift_b_height);
                lift_b_pos=2;
                wait(3);
                lift_b_pos=1;
                $cadet1.walkto("$lift_b_nav2");
                waitfor($cadet1);
                $lift_b.movedown(lift_b_height);
                lift_b_pos=2;
                waitfor($lift_b);
                lift_b_pos=0;
                $cadet1.walkto("$lift_b_nav3");
                waitfor($cadet1);
                $cadet1.walkto("$lift_b_nav4");
                waitfor($cadet1);
                cadet1_pos=0;
        }
        else
        {
                if (lift_b_pos==0)
                {
                        wait(3);
                        $lift_b.moveup(lift_b_height);
                        waitfor($lift_b);
                        lift_b_pos=1;
                }
                else
                {
                        wait(3);
                        $lift_b.movedown(lift_b_height);
                        waitfor($lift_b);
                        lift_b_pos=0;
                }
        }
        wait(10);
        $trigger_lift_b_low.triggerable();
        $trigger_lift_b_up.triggerable();
}

void main()
{
        thread initArchetypes();
        spawn("camera","targetname","cam1");
        $end_trigger.nottriggerable();
        $player.give( "models/weapons/worldmodel-tricorder-STX.tik" );
        $player.model( "char/hazardteam_jurot.tik" ); 

        thread init();
        thread redalert();
        koi_swim();

        lift_a_height=80;
        lift_b_height=192;
        lift_a_pos=0;
        lift_b_pos=0;
        crew1_pos=0;
        cadet1_pos=1;
}


void before_lab()
{
        $kraftfeld2.show();
        $kraftfeld_solid2.solid();
        triggerentity( $kraftfeld_sound2 );
        $kraftfeld2.playsound( "sound/ships/borg/borg_forcefield_on.wav", 1, 1, 11111 );
        $kraftfeld2.loopsound( "sound/ships/enterprise/ent_forcefield.wav", .7, 30 );
}

void inside_lab()
{
        //AIShowGroup    ( 666, "Federation" );

        $kraftfeld3.show();
        $kraftfeld_solid3.solid();
        triggerentity( $kraftfeld_sound3 );
        $kraftfeld3.playsound( "sound/ships/borg/borg_forcefield_on.wav", 1, 1, 11111 );
        $kraftfeld3.loopsound( "sound/ships/enterprise/ent_forcefield.wav", .7, 30 );

        
        $lab_exit2.time( 1.5 );
        wait( .1 );
        
        $lab_exit2.moveUp( 120 );
        triggerentity( $lab_exit2_sound );

        $lab_security1.ai_off();
        $lab_security2.ai_off();
        $lab_security4.ai_off();
        $lab_security5.ai_off();

        wait( 0.5 ); 


        $lab_security1.walkto( "$lab_security1_nav1", "run" );
        wait( 0.2 );
        $lab_security2.walkto( "$lab_security2_nav1", "run" );
        wait( 3 );
        $lab_exit2.movedown( 120 );
        triggerentity( $lab_exit2_sound );

        CommandToGroup ( 666 , "groupactortype" , "enemy" , "");
        CommandToGroup ( 666 , "visiondistance" , "4000" , "" );
        CommandToGroup ( 666 , "fov" , "360" , "" );
        CommandToGroup ( 666 , "attack" , "$player" , "" );

        $lab_security1.ai_on();
        $lab_security2.ai_on();

        
        wait(3);

        $lab_exit1.time( 1.5 );
        wait( .1 );
        $lab_exit1.moveUp( 120 );

        wait( 0.5 ); 

        $lab_security4.walkto( "$lab_security4_nav1", "run" );
        wait( 0.2 );
        $lab_security5.walkto( "$lab_security5_nav1", "run" );
        wait( 3 );
        $lab_exit1.movedown( 120 );

        $lab_security4.ai_on();
        $lab_security5.ai_on();
}

void secret_button()
{
        $obj_button01.time (1);
        $obj_button01.movenorth (2);
}

void koi_swim()
{
        wait(1);
        $koi1.anim( "idle" );
        $koi1.followpath( $koi1_path , "loop" , "normalangles" );

        $koi2.anim( "idle" );
        $koi2.followpath( $koi2_path , "loop" , "normalangles" );
}

void init()
{
        //--hide forcefield
        $kraftfeld.hide();
        $kraftfeld2.hide();
        $kraftfeld3.hide();
        $kraftfeld_solid.notsolid();
        $kraftfeld_solid2.notsolid();
        $kraftfeld_solid3.notsolid();
        $kraft_feld_poison.hide();
        $kraft_feld_poison.notsolid();

        //--Showergirl SetUp
        $showergirl1.ai_off();
        $showergirl1.anim("conv-gesture1");

        //--Explosion trigger
        $trigger1.nottriggerable();

        //--Door to bathroom
        $shower_door_left.time( .1 );
        $shower_door_right.time( .1 );
        wait( .1 );
        $shower_door_left.moveWest( 40 );
        $shower_door_right.moveEast( 40 );

        //--Gas im Korridor
        $gas.hide();


        // Security Team

        $lab_security1.setgroupid ( 666 );
        $lab_security2.setgroupid ( 666 );

        $lab_security4.setgroupid ( 666 );
        $lab_security5.setgroupid ( 666 );


        AIHideGroup    ( 666 );

        // Beamout sequence
        $illia_beamout.hide();
        $illia_beamout.notsolid();
        $illia_beamout.ai_off();
        $illia_beamout.pushable(0);
        spawn ( "Camera" , "targetname" , "cam1" );
        //Take away weapons from illia!
        $illia_beamout.removeactorweapon ( "CompressionRifle" );
        $illia_beamout.removeactorweapon ( "AssaultRifle" );
        $illia_beamout.removeactorweapon ( "CompressionRifleEnhanced" );

        //Take away weapons from player!
        //Only tricorder remains in place!
        $player.take ( "models/weapons/worldmodel-compressionrifle.tik" );
        $player.take ( "models/weapons/worldmodel-fieldassaultrifle.tik" );
        $player.take ( "models/weapons/worldmodel-burstrifle.tik" );
        $player.take ( "models/weapons/worldmodel-attrex-rifle.tik" );
        $player.take ( "models/weapons/worldmodel-compressionrifle.tik" );
        $player.take ( "models/weapons/worldmodel-phaser-STX.tik" );

}

void trigger_shower_door()
{
        $shower_door_left.time( .35 );
        $shower_door_right.time( .35 );
        wait( .1 );
        $shower_door_left.playsound( "sound/doors/forever_door1.wav" );
        $shower_door_left.moveEast( 40 );
        $shower_door_right.moveWest( 40 );
        wait( 35 );
}

///////////////////////////
//Wand fliegt in die Luft//
///////////////////////////
void wall_exp()
{
        //$wall_puzzle.nottriggerable();
        triggerentity( $blabla_tut );
        triggerentity( $blabla_tut_overload );
        wait( 3.8 );
        $trigger1.triggerable();
        triggerentity( $trigger );
        $console.playsound( "sound/impact/explosion/expl_inside4.wav" );
        triggerentity( $console_exp );
        $player.earthquake( .75, 1.4 );
        $wall_hide.hide();
        wait( .2 );
        $console.playsound( "sound/impact/explosion/expl_inside3.wav" );
        triggerentity( $console_exp1 );
        $console.hide();
        $console.notsolid();
}

/////////////////////////////////////////////////////
/////////////////////Roter Alarm/////////////////////
//Wenn möglich nur target_speaker in den Korridoren//
/////////////////////////////////////////////////////
void redalert()
{
        $world.light_fade( "redalert", .85, .4 );
        $player.playsound( "sound/redalert.mp3" );
        wait( .7 );
        $world.light_fade( "redalert", .2, .6 );
        wait( 1.8 );
        thread redalert();
}

////////////////////////////////////////
//Kraffelder + Sound schalten sich ein//
////////////////////////////////////////
void kraftfeld()
{
        $gas.show();
        $kraftfeld.show();
        $kraftfeld_solid.solid();
        triggerentity( $kraftfeld_sound );
        $kraftfeld.playsound( "sound/ships/borg/borg_forcefield_on.wav", 1, 1, 11111 );
        $kraftfeld.loopsound( "sound/ships/enterprise/ent_forcefield.wav", .7, 30 );
        wait( 1 );
        $player.simpleplaydialog( "localization/sound/dialog/map04/computer/intruder.mp3", 1, 20000 ); //Lieutenant Munro, you have a visitor waiting for you in the main entrance.
        waitDialogLength( "localization/sound/dialog/map04/computer/intruder.mp3" );
        thread poison_gas();
        $player.simpleplaydialog( "localization/sound/dialog/map04/computer/gas.mp3", 1, 20000 ); //Lieutenant Munro, you have a visitor waiting for you in the main entrance.
        waitDialogLength( "localization/sound/dialog/map04/computer/gas.mp3" );
}

void poison_gas()
{
        //////////////////////////////30 SEKUNDEN/////////////////////////////////////////
        /////////////////////////bis der Spieler stirbt///////////////////////////////////
        //Wenn er oder sie 100 Health hat.
        //"lebendesspielers", mir fiel nichts besseres ein!
        //Note:  Um den Timer zu verändern, kann man zwei Werte verändern.
        //               Der erste Wert ist dazu da, um festzulegen, wie wiel Schaden
        //               verursacht wird. Der zweite Wert ist dazu da, um festzulegen
        //               wann der Spieler wieder verletzt wird.
        //HINWEIS: Wenn du nicht durch das Loch kommst, dann duck dich!

        //First Get Initial Value of Chang's life
        float lebendesspielers;
        lebendesspielers = $player.gethealth();

        //Now, continue looping until chang is dead.  If chang is saved
        //before he dies, then killthread MUST be called on this thread
        //to stop this counter
        while( lebendesspielers > 1.0 )
        {       
                //Every iteration damage the player
                $player.hurt( 5 );
                lebendesspielers = $player.gethealth();
                //print ("end of cinematic thread life counter\n");
                //Check if chang is 'dead".  If he is, then fail the mission
                if ( lebendesspielers <= 1.0 )
                {
                        wait( 1 );
                        stuffcmd ( "kill\n" );
                }
                //Wait a specified interval before damaging again
                wait( 1.5 );            
        }
}

void stop_poison_gas()
{
        killthread( "poison_gas" );
        triggerentity( $kraft_feld_poison_sound );
        $kraft_feld_poison.show();
        $kraft_feld_poison.solid();
}

void beamout_puzzle()
{
        $player.simpleplaydialog("localization/sound/dialog/map04/Computer/energy_restored.mp3",1,10000);
        waitdialoglength("localization/sound/dialog/map04/Computer/energy_restored.mp3");
        $end_trigger.triggerable();
}
void beamout()
{
        freezeplayer();
        cinematic();
        fakeplayer(); 
        $fakeplayer.warpto( "$beamout_nav" ); 
        letterbox(.1);
        cam_fadeout( 2, 0, 0, 0, 1, 0 );
        $cam1.follow($beamout_cam);
        cuecamera($cam1);
        wait(.5);
        cam_fadein( 0.5, 0, 0, 0, 1, 0 );
        //Bring up a fake player model 
        //Make the fakeplayer use the same weapon as you 
        globalCommon_AiActorUseWeapon( $fakeplayer, "current" ); 
        $fakeplayer.displayEffect( "TransportOut", "Federation" );
        wait(3);
        cam_fadeout( 2, 0, 0, 0, 1, 0 );
        clearletterbox(.1);
        noncinematic();
        removefakeplayer(); 
        releaseplayer();
        cueplayer();
        stuffcmd("map map5");
        cam_fadein( 0.5, 0, 0, 0, 1, 0 );
}

void initArchetypes()
{

      thread globalArchetype_Setup( $exp_console, "exp");
      thread globalArchetype_Setup( $beam_console, "beama");

      $bails.archetype ( "bails" );
      $jones.archetype ( "jones" );
      $shaun.archetype ( "shaun" );
      $jenks.archetype ( "jenks" );
      $eddie.archetype ( "eddie" );
      $catrin.archetype ( "catrin" );
}


void lock_lab_entry()
{
   AIShowGroup    ( 666, "Federation" );
   $lab_entry.lock();
}