Subversion-Projekte sthq.gbs

Revision

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

//--------------------------------------------------------------------------------------
//
//  EF2 Level Script File
//
//  Level:                      warbird1-->Karte7
//  Script By:          Patrick "Nemo" Weiser
//  Geometry By:        Patrick "Nemo" Weiser
//  Created on:         27.01.2004
//
//  Last Edited:        Patrick "Nemo" Weiser
//
//--------------------------------------------------------------------------------------

#include "maps/global_scripts/global_common.scr"
#include "maps/global_scripts/global_math.scr"
#include "maps/global_scripts/global_acceleratedMovement.scr"
#include "maps/global_scripts/global_cinematicFX.scr"

void main();
void init();
void shoot_disrupter(entity weapon_parm, entity origin_parm, entity target_parm);
void shoot_tal(entity weapon_parm, entity origin_parm, entity target_parm, string explosion_parm);
void moveWarbird();
void intro();
void firstShoot();
void romulancommander();
void attack_bridge();
void decloak_warbird();
void attack_outpost();
void bridge_endcinematic();
void loop_explosions_bridge();
void disrupter0();
void disrupter1();
void disrupter2();
void disrupter3();

void activate_trigger_count();
void collision_counter();
void stop_collisionCounter();

void main()
{
        cam_fadeout( .1, 0, 0, 0, 1, 0 );
//      $player.notsolid();
//      $player.hide();
        letterbox( .1 );
        freezeplayer();
        cinematic();
        soundtrack( "music/warbird1.mus" );
        musicvolume( 0.75, .1 );
        allowMusicDucking( 0 );
        
//--Kameras spawnen
        spawn( "Camera", "targetname", "cam1");
        spawn( "Camera", "targetname", "cam2");
        spawn( "Camera", "targetname", "cam3");
        spawn( "Camera", "targetname", "cam4");

//--Cams laden
        cam.load( "map7_cam1" );
        cam.load( "map7_rom1" );
        cam.load( "map7_rom2" );
        cam.load( "map7_cam2" );
        cam.load( "map7_cam3" );
        cam.load( "map7_p_illia1" );
        cam.load( "map7_illia_cam1" );
        cam.load( "map7_outpost_cam1" );
        
//--Erlaubt Kamera-Shakes
        $world.canShakeCamera( 1 );
        
        thread intro();
        thread init();
}

void init()
{
//--NPC's im Spiel
        $romulan.ai_off();
        $illia.ai_off();
        $illia.anim( "ent-library-seat-idle" );
        $illia.removeactorweapon ( "CompressionRifle" );
        $illia_prisoner3.ai_off();
        $illia_prisoner3.removeactorweapon ( "CompressionRifle" );
        $illia_prisoner3.anim( "cin-m8_situp" );
        $chang.ai_off();

//--Models laden
        spawn("script_object","targetname","fire1");wait(.1);   
        $fire1.model( "models/projectile/projectile-photonball-voyager.tik" );
        $fire1.scale( .2 );
        $fire1.hide();

        spawn("script_object","targetname","fire2");wait(.1);
        $fire2.model( "models/projectile/projectile-photonball-voyager.tik" );
        $fire2.hide();
        $fire2.scale( .2 );

        $warp.scale( 0.8 );
        $warp.modelname( "models/fx/fx-warpflash-federation.tik" );
        $warp.origin( $warbird1.getOrigin() );
        
//--Schiffe, Waffen, usw. binden
        $fire_origin1.bind($warbird1_origin);
        $fire_origin2.bind($warbird1_origin);
        $warbird1.bind($warbird1_origin); 
        $warbird1.hide();
        $warbird_talshiar.forcealpha( 1 );
        $warbird_talshiar.alpha( 0 );
        $warbird_talshiar.hide();

//--Romul.Außenposten + Torpedos
        globalCommon_SpawnScriptModel( "projectile/projectile-photonball-voyager.tik", "torp_0", '-872 1264 -8', 0 );
        globalCommon_SpawnScriptModel( "projectile/projectile-photonball-voyager.tik", "torp_1", '-872 1264 -8', 0 );
        globalCommon_SpawnScriptModel( "projectile/projectile-photonball-voyager.tik", "torp_2", '-872 1264 -8', 0 );
        globalCommon_SpawnScriptModel( "projectile/projectile-photonball-voyager.tik", "torp_3", '-872 1264 -8', 0 );

        $bigBang1.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang3.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang4.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang5.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );

        $bigBang2.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang6.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang7.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );

        $bigBang8.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang9.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang10.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );

        $bigBang11.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang12.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        $bigBang13.doexplosion( "fx/fx-explosion-crate-attrex-large.tik" );
        
//--Collision-counter
        $stopCounter.nottriggerable();
        $chang.updatebosshealth( 1, 1 );
        $chang.health( 200 );
        $chang.maxhealth( 201 );
        $chang.maxbosshealth( 200 );
        
//--Sonstiges
        $sparks.hide();
        $planet.hide();

        $cam1.follow($map7_cam1);
        $cam1.cut();
        wait( .1 );
        cuecamera($cam1);
} 

void shoot_disrupter(entity weapon_parm, entity origin_parm, entity target_parm)
{
        weapon_parm.origin(origin_parm.getorigin() );
        weapon_parm.show();
        weapon_parm.playsound("sound/weapons/radgun/rad_fire.wav");
        weapon_parm.time(3);
        weapon_parm.moveto(target_parm);  
        wait(1);
        weapon_parm.scale(0.000000001);
        wait(2.1);
        weapon_parm.hide();     
}

void shoot_tal(entity weapon_parm, entity origin_parm, entity target_parm, string explosion_parm)
{
        weapon_parm.origin(origin_parm.getorigin() );
        weapon_parm.show();
        weapon_parm.playsound("sound/weapons/radgun/rad_fire.wav");
        weapon_parm.time(1.5);
        weapon_parm.moveto(target_parm);  
        wait(.5);
        weapon_parm.scale(0.00001);
        wait(1);
        trigger( explosion_parm);
        wait(.1);
        weapon_parm.remove();   
}


void moveWarbird()
{   
        triggerEntity( $warp );
        $bird1_origin1.followpath($bird1_path1);
        $cam1_origin1.playsound( "sound/ent_getoutof_warp.wav", 0, 4, 20000 );
}

void intro()
{   
        cam_fadein( 4, 0, 0, 0, 1, 0 ); 
        wait(3);
        stuffcmd( "showmenu oberth_system\n" );
        wait(4);
        stuffcmd ( "popmenu 0\n" );
        wait( 2 );
        triggerEntity( $warp );
        $warbird1_origin.followpath($warbird_path1);
        $cam1.playsound( "sound/ent_getoutof_warp.wav" );
        $warbird1.show();
        wait( 4 );
        $cam2.follow($introcam_1);
        $cam2.cut();
        wait(.1);
        cuecamera($cam2);
        wait( 4 );
        thread romulancommander();
}       
    
void firstShoot()
{
        $cam4.follow($map7_cam2);
        $cam4.cut();
        wait( .1 );
        cuecamera($cam4);
    wait(.5);
    thread shoot_disrupter($fire1, $fire_origin1, $fire);
        wait(1);
        thread shoot_disrupter($fire2, $fire_origin2, $fire);
        wait( 2 );
        thread attack_outpost();
}

void romulancommander()
{
        $cam3.follow( $map7_rom1 );
        $cam3.cut();
        wait(.1);
        cuecamera($cam3);
        $romulan.playdialog("localization/sound/dialog/map07/Tebok/approaching.mp3",1,10000,0);
        waitfordialog($romulan);
        $romulan.playdialog("localization/sound/dialog/map07/Tebok/military.mp3",1,10000,0);
        waitfordialog($romulan);
        $romulan.playdialog("localization/sound/dialog/map07/Tebok/turnyourship.mp3",1,10000,0);
        waitfordialog($romulan);
        $screen.hide();
        wait( 1.5 );
        $cam2.follow( $map7_illia_cam1 );
        $cam2.cut();
        wait(.1);
        cuecamera($cam2);
        wait( .4 );
        $illia.playdialog("localization/sound/dialog/map07/illia/heisangry.mp3", 1, 10000, 0);
        wait(1);
        $illia.anim( "ent-frontchair-gesture1" );
        wait( 1.5 );
        thread firstShoot();
}

void attack_bridge()
{
        $cam4.follow( $map7_rom2 );
        $cam4.cut();
        wait(.1);
        cuecamera($cam4);
        wait( .5 );
        $player.earthquake( 2, 2 );
        triggerentity( $exp_center );
        $exp_center.playsound( "sound/impact/explosion/expl_distnode1.wav", 0, 4, 20000 );
        $sparks.show();
        triggerentity( $exp_behind );
        wait( 1.5 );
        triggerentity( $exp_screen1 );
        triggerentity( $exp_behind );
        wait( .2 );
        triggerentity( $exp_screen2 );
        $player.earthquake( 1, 3.5 );
        wait( .7 );
        $cam4.earthquake( 1, 1 );
        wait( .5 );
        triggerentity( $exp_screen2 );
        triggerentity( $exp_behind );
        wait( .5 );
        triggerentity( $exp_screen2 );
        triggerentity( $exp_screen1 );
        wait( 1 );
        cam_fadeout( 2, 0, 0, 0, 1, 0 );
        wait( 1 );
        triggerentity( $exp_2 );
        wait( 1 );
        cam_fadein( 2, 0, 0, 0, 1, 0 );
        cuecamera($cam2);
        $illia_prisoner3.playdialog("localization/sound/dialog/map07/illia/warbirdof.mp3", 1, 10000, 0);
        waitfordialog( $illia_prisoner3 );
        $illia_prisoner3.playdialog("localization/sound/dialog/map07/illia/collision.mp3", 1, 1000, 0);
        waitfordialog( $illia_prisoner3 );
        
        cam_fadeout( 2, 0, 0, 0, 1, 0 );
        wait( 2 );
        cam_fadein( 2, 0, 0, 0, 1, 0 );
        thread bridge_endcinematic();
}

void decloak_warbird()
{
        cam_fadein( 2, 0, 0, 0, 1, 0 );
        $cam2.fov( 85 );
        $cam2.follow( $map7_p_illia1 );
        $cam2.cut();
        wait(.1);
        cuecamera($cam2);
        wait( 2.1 );
        $illia_prisoner3.playdialog("localization/sound/dialog/map07/illia/itwascleartome.mp3", 1, 10000, 0);
        waitfordialog( $illia_prisoner3 );
        $illia_prisoner3.playdialog("localization/sound/dialog/map07/illia/minutesof.mp3", 1, 10000, 0);
        waitfordialog( $illia_prisoner3 );
        wait( 1.3 );
        $illia_prisoner3.playdialog("localization/sound/dialog/map07/illia/notgoingtoget.mp3", 1, 10000, 0);
        waitfordialog( $illia_prisoner3 );
        $torp_1.hide();
        $torp_2.hide();
        wait( .2 );
        cam_fadeout( 2, 0, 0, 0, 1, 0 );
        wait( 2 );
        $cam3.follow( $introcam_2 );
        $cam3.cut();
        wait( .1 );
        cuecamera($cam3);
        cam_fadein( 2, 0, 0, 0, 1, 0 );
        wait( 1.7 );
        
        $warbird_talshiar.fadein( 2, 1 );
        $warbird_talshiar.show();
        wait(2.5);
        $cam1.follow( $map7_cam3 );
        $cam1.cut();
        wait( .1 );
        cuecamera( $cam1 );

        wait( .5 );
    thread shoot_tal($torp_1, $weapon_tal_origin, $weapon_tal_origin1, "$explosion" );
        wait( 1 );
    thread shoot_tal($torp_2, $weapon_tal_origin, $weapon_tal_origin1, "$explosion");
        wait( 3 );
        
        cam_fadeout( 2, 0, 0, 0, 1, 0 );
        wait( 2 );
        cam_fadein( 2, 0, 0, 0, 1, 0 );
        
    cuecamera($cam2);
        $illia_prisoner3.playdialog("localization/sound/dialog/map07/illia/shouldnot.mp3", 1, 10000, 0);
        waitfordialog( $illia_prisoner3 );
        cam_fadeout( 1.5, 0, 0, 0, 1, 0 );
        wait( 1.5 );
        cam_fadein( 1.5, 0, 0, 0, 1, 0 );
        thread attack_bridge();
}

void attack_outpost()
{
        $cam1.follow( $map7_outpost_cam1 );
        $cam1.cut();
        wait(.1);       
        
        cuecamera ($cam1);
        wait(.7);
        thread disrupter0();
        wait(1);        
        thread disrupter1();
        wait(1);
        thread disrupter2();
        wait(1);
        thread disrupter3();
        wait( 4 );
        thread decloak_warbird();
}

void bridge_endcinematic()
{
        $cam4.follow( $map7_rom2 );
        $cam4.cut();
        wait(.1);
        cuecamera($cam4);
        
        wait( .5 );
        $player.earthquake( 2, 2 );
        triggerentity( $exp_screen2 );
        wait( 1);
        $player.earthquake( 2.2, 1 );
        triggerentity( $exp_screen1 );
        wait( .4 );
        $player.earthquake( 1.5, 1 );
        triggerentity( $exp_behind );
        triggerentity( $exp_screen2 );
        wait( .6 );
        triggerentity( $exp_screen1 );
        wait( .4 );
        $player.earthquake( 1, .4 );
        wait( .1 );
        triggerentity( $exp_behind );
        clearletterbox( .1 );
        noncinematic();
        releaseplayer();
        cueplayer();
        $illia.remove();
        $player.give( "models/weapons/worldmodel-tricorder-STX.tik" );
        
        thread loop_explosions_bridge();
        thread collision_counter();
}

void loop_explosions_bridge()
{
        triggerentity( $exp_center );
        $exp_center.playsound( "sound/impact/explosion/expl_distnode1.wav", 0, 4, 20000 );
        $player.earthquake( .5, 1 );
        wait( 2 );
        triggerentity( $exp_screen1 );
        wait( 2.5 );
        triggerentity( $exp_Screen2 );
        triggerentity( $exp_behind );
        wait( 2 );
        $player.earthquake( .5, 1 );
        triggerentity( $exp_screen1 );
        wait( 2 );
        triggerentity( $exp_behind );
        wait( 1 );
        triggerentity( $exp_screen2 );
        triggerentity( $exp_center );
        $exp_center.playsound( "sound/impact/explosion/expl_distnode1.wav", 0, 4, 20000 );
        $player.earthquake( 1, 2 );
        wait( 2 );
        triggerentity( $exp_behind );
        wait( 1 );
        thread loop_explosions_bridge();
}

void disrupter0()
{
        $torp_0.followpath( $proj0_path);
        wait(2);

        trigger( "$bigBang11" );
        wait(.1);
        trigger( "$bigBang12" );
        wait(.1);
        trigger( "$bigBang13" );
        wait(.1);
}

void disrupter1()
{
        $torp_1.followpath( $proj1_path);
        wait(1.7);
        $player.earthquake( 1, 0.3 );
        trigger( "$bigBang1" );
        wait(.1);
        trigger( "$bigBang3" );
        wait(.1);
        trigger( "$bigBang4" );
        wait(.1);
        trigger( "$bigBang5" );
        $torp_1.trigger("debris");
        wait(2);
        $debris.hide();
}

void disrupter2()
{
        $torp_2.followpath( $proj2_path);

        wait(2);
        $player.earthquake( 1, 0.5 );
        trigger( "$bigBang2" );
        wait(.1);
        trigger( "$bigBang6" );
        wait(.1);
        trigger( "$bigBang7" );
        //$proj1_origin.trigger("debris2");
        trigger( "$debris2");
}

void disrupter3()
{
        $torp_3.followpath( $proj3_path);
        wait(2);
        $player.earthquake( 1, 1 );
        
        trigger( "$bigBang8" );
        cam_fadeout( 1.5, 1, 1, 1, 1, 0 );
        wait(.1);
        trigger( "$bigBang9" );
        wait(.1);
        trigger( "$bigBang10" );
        wait(.1);
        trigger( "$bigBang8" );
        wait(.1);
        trigger( "$bigBang9" );
        wait(.1);
        trigger( "$bigBang10" );
}

void activate_trigger_count()
{
        $stopCounter.triggerable();
}

void collision_counter()
{
///////////////////////////COLLSISION-COUNTER/////////////////////////////////////
//////////////////////////ZEIT BIS KOLLSISION:////////////////////////////////////
//////////////////////////////40 SEKUNDEN/////////////////////////////////////////
        //
        //Note:  To balance the timer, you can adjust 2 values.
        //               The first is the amount of damage done.  The second
        //               is the wait time until chang is damaged again.
        //      
        //               To determine the overall amount of time available for 
        //               the player to save Chang, increase the total amount of 
        //               health chang has. -- This will likely be done in the same place
        //               that you call the updatebosshealth().  Keep in mind that health
        //               and maxboss health must be equal for the "lifebar" to be correct
        //
        
        //First Get Initial Value of Chang's life
        float collision;
        collision = $chang.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( collision > 1.0 )
        {       
                //Every iteration damage Chang
                $chang.addhealth( -5 );
                collision = $chang.gethealth();
                //print ("end of cinematic thread life counter\n");
                //Check if chang is 'dead".  If he is, then fail the mission
                if ( collision <= 1.0 )
                        {
                                cam_fadeout( 3, 1, 1, 1, 1, 0 );
                                $player.earthquake( 2, 2 );
                                wait( 2 );
                                $player.earthquake( 5, 2 );
                                wait( 2 );
                                stuffcmd ( "kill\n" );
                        }
                //Wait a specified interval before damaging again
                wait( 1 );              
        }
}

void stop_collisionCounter()
{
        musicvolume( 1.2, .1 );
        $player.notsolid();
        $player.hide();
        letterbox( .1 );
        cinematic();
        freezeplayer();

        $planet.show();
        
        killthread( "collision_counter" );
        killthread( "loop_explosions_bridge" );
        $chang.updatebosshealth( 0 );
        music( "action" );

        $cam1.follow($collision_cam1, $warbird_collision_illia);
        $cam1.cut();
        wait( .1 );
        cuecamera($cam1);
        
        $warbird_collision_illia.time(12.2);
        $warbird_collision_illia.moveto($collision_point);  
        wait( 4 );
        
        $cam2.follow($collision_cam2);
        $cam2.cut();
        wait( .1 );
        cuecamera($cam2);
        wait( 4 );
        
        $cam3.follow($collision_cam3);
        $cam3.cut();
        wait( .1 );
        cuecamera($cam3);
        
        wait( 3.2 );
        triggerentity($exp_col1);
        wait( .5 );
        triggerentity($exp_col2);
        wait( .1 );
        triggerentity($exp_col3);
        wait( .1 );
        triggerentity($bigboom);
        $warbird_collision_illia.hide();
        $warbird_collision_tal.hide();
        
        wait( 3 );
        $player.show();
        $player.solid();
        clearletterbox( .1 );
        noncinematic();
        releaseplayer();
        cueplayer();
}