Subversion-Projekte sthq.gbs

Revision

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

//--------------------------------------------------------------------------------------
//
//  A Gate Two Birds And The Beautiful Sky Level Script File
//      
//  Level:              map1
//  Script By:          Argyle
//  Geometry By:        Flix
//  Created on:         ???
//  Last Edited on:    $Date: 2007-05-09 21:55:47 +0200 (Mi, 09 Mai 2007) $
//  Last Edited by:     $Author: lars $
//
//-------------------------------------------------------------------------------------

#include "maps/global_scripts/global_common.scr"
#include "maps/global_scripts/global_debugUtils.scr"
#include "maps/global_scripts/global_math.scr"
#include "maps/global_scripts/global_archetype.scr"
#include "maps/m11/m11l1a_dialog.scr"
#include "maps/m11/m11_groupSpawn.scr"
#include "maps/global_scripts/global_playerLoadout.scr"
#include "maps/m11/m11_beamInAmmo.scr"
#include "maps/global_scripts/global_tricorderbase.scr"
#include "maps/global_scripts/global_tricordermod.scr"

void main();
void spawn_disrupter_klingon( entity entity_to_spawn);
void spawn_melee_klingon( entity entity_to_spawn);
void inc_death_toll();
void change_map();
void finish_holocin();
void start_holocin();
void finish_introcin();
void start_introcin();
void show_camera(entity camera_to_use, entity camera_path, float duration_to_wait);
void switch_off_ai();

float killed_klingons = 0;

void switch_off_ai()
{

   $illia_prisoner.ai_off();

   $illia_prisoner.removeactorweapon ( "CompressionRifle" );
   $illia_prisoner.anim("cin-m8_situp");
   $illia.ai_off();
   $illia2.ai_off();
   $moya.ai_off();
   $moya.nodamage ();
   $moya.notsolid ();
   $moya2.ai_off();
   $death_klingon.ai_off();
   $klingon1.ai_off();
   $klingon3.ai_off();
   $klingon4.ai_off();
   $klingon5.ai_off();
   $klingon6.ai_off();

   $klingon1.killthread("inc_death_toll");
   $klingon3.killthread("inc_death_toll");
   $klingon4.killthread("inc_death_toll");
   $klingon5.killthread("inc_death_toll");
   $klingon6.killthread("inc_death_toll");
}

void show_camera(entity camera_to_use, entity camera_path, float duration_to_wait)
{
   camera_to_use.follow( camera_path );
   cuecamera( camera_to_use );
   wait(.2);
   cam_fadein( 1, 0, 0, 0, 1, 0 );
   wait(duration_to_wait);
   cam_fadeout( 1, 0, 0, 0, 1, 0 );
   wait(1);

}


void start_introcin()
{
   cinematic();
   letterbox(.1);
   cam_fadeout( .1, 0, 0, 0, 1, 0 );
   
   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" );

   wait ( .05 );
   /*cam.load("holo2_gate_cam");
   cam.load("holo2_illia_cam");
   cam.load("holo2_illia_cam2");
   cam.load("holo2_klingon_cam");
   cam.load("holo2_illia_close_cam");
   cam.load("holo2_klingon_close_cam");*/

   wait ( .5);
   skipthread ( "finish_introcin" );
   freezeplayer();

   switch_off_ai();


   wait(2);


   $cam7.follow($cell_cam);
   cuecamera($cam7);

   wait(0.5);

   cam_fadein( 3, 0, 0, 0, 1, 0 );
   wait(3);
   $illia_prisoner.headwatch( $illia_look_here);
   wait(1.5);
   //$illia_prisoner.resethead();

   $illia_prisoner.playdialog("localization/sound/dialog/map01/Illia/everythingbegan.mp3", 1, 10000, 0);
   waitfordialog( $illia_prisoner );
   wait( 1 );
   $illia_prisoner.playdialog("localization/sound/dialog/map01/Illia/itwasabout.mp3", 1, 10000, 0);
   waitfordialog( $illia_prisoner );
   cam_fadeout( 3, 0, 0, 0, 1, 0 );

   wait(4);



   //   stuffcmd("showmenu we_proudly_present\n");

   // wait(2);

   //  stuffcmd ( "popmenu 0\n" );
   // wait(3);
   stuffcmd("showmenu gbs\n");
   wait(4);
   stuffcmd ( "popmenu 0\n" );

   


   show_camera($cam1, $holo2_gate_cam, 3);
   wait(.5);
   $world.light_lightstyle( "lightning", "azaz", 1 );
   $player.playsound( "sound/environment/nature/thunder2.wav", 0, 1.5, 10000 );
   show_camera($cam2, $holo2_illia_cam, 3);
   wait(.5);

   
   show_camera($cam3, $holo2_klingon_cam, 3);
   wait(.5);
   show_camera($cam6, $holo2_illia_cam2, 3);
   wait(.5);
   thread show_camera($cam5, $holo2_klingon_close_cam, 3);
   wait(.5);

   //Klingon talk
   $klingon4.playdialog( "localization/sound/dialog/map01/Klingon/death.mp3", 1, 10000, 0);
   
   wait(3);
   thread show_camera($cam4, $holo2_illia_close_cam, 3);
   wait(.5);
   $illia.playdialog("localization/sound/dialog/map01/Illia/youwillnotice.mp3", 1, 10000, 0);
   waitfordialog( $illia );
   
   wait(.5);
   //wait(5);
   thread finish_introcin();
}

void finish_introcin()
{
   cam_fadeout( .5, 0, 0, 0, 1, 0 );
   killthread ( "start_introcin" );
   wait ( .5 );
   noncinematic();
   releaseplayer();
   cueplayer ();
   clearletterbox(.1);
   cam_fadein( 1, 0, 0, 0, 1, 0 );

   $illia.hide();
   $illia.notsolid();
   $klingon1.ai_on();
   $klingon3.ai_on();
   $klingon4.ai_on();
   $klingon5.ai_on();
   $klingon6.ai_on();
   $klingon1.attack($player);
   $klingon3.attack($player);
   $klingon4.attack($player);
   $klingon5.attack($player);
   $klingon6.attack($player);



}

void start_holocin()
{
   $illi2.useactorweapon( "CompressionRifle" );

   cinematic();
   cam_fadeout( 1, 0, 0, 0, 1, 0 );
   spawn ( "Camera" , "targetname" , "holo_cam1" );
   spawn ( "Camera" , "targetname" , "holo_cam2" );
   spawn ( "Camera" , "targetname" , "holo_cam3" );
   spawn ( "Camera" , "targetname" , "holo_cam4" );
   wait ( .05 );

   /*
   cam.load("holo2_moya_cam2");
   cam.load("holo2_illia2_cam");
   cam.load("holo2_illia2_cam3");
   cam.load("holo2_moya_cam");
    */

   //Move holodeck door into holodeck

   wait ( 1);
   letterbox(.1);
   $holodeck_terminal.origin($terminal_new_origin.getOrigin());

   skipthread ( "finish_holocin" );
   freezeplayer();
   
   $moya.origin($moya_new_origin.getOrigin());

   //switch_off_ai();

   cam_fadeout( 1, 0, 0, 0, 1, 0 );
   wait(2);
   
   $holo_cam2.follow($holo2_illia2_cam);
   $death_klingon.show();
   $illia2.show();
   //$illia2.maxheadyaw(180);
   $illia2.headwatch( $death_klingon );
   $death_klingon.animateonce("long_death");
   wait(.1);
   cuecamera( $holo_cam2 );
   cam_fadein( 1, 0, 0, 0, 1, 0 );
   //$illi2.anim("compressionrifle_putaway");
   wait(5.5);
   //$illi2.anim("compressionrifle_putaway");
   //$holodeckdoor.open($holodeckdoor);
   $illia2.playsound("sound/ships/enterprise/holo_door_open.wav",1,1,500);
   wait(1);
   $illia2.headwatch( $moya );

   wait(2.5);
 
   $holo_cam1.follow($holo2_moya_cam2);
   wait(.1);
   cuecamera( $holo_cam1 );
   wait(1);
   $death_klingon.remove();
   
   //$moya2.walkto("$holodeck_nav1", "walk",0,-1);
   $moya2.walkto("$holodeck_nav1", "walk");
   //waitfor($moya);
   //$moya2.lookat($player);
   wait(3);
   //$holo_cam3.follow($holo2_illia2_cam);
   //cuecamera( $holo_cam3 );
   cuecamera( $holo_cam2 );
   $illia2.playsound("sound/ships/enterprise/holo_door_open.wav",1,1,500);
   $illia2.lookat( $moya);
   //$illia2.walkto("$battle_nav1", "walk",0,-1);
   //$illia2.resethead();
   //$illi2.useactorweapon( "none" );
   wait(3);

   thread finish_holocin();


}



void finish_holocin()
{
   cam_fadeout( .5, 0, 0, 0, 1, 0 );
   killthread ( "start_holocin" );
   wait ( .5 );
   noncinematic();
   releaseplayer();
   cueplayer ();
   clearletterbox(.1);
   $player.origin($new_player_pos.getOrigin());
   $player.playerviewangles('0 180 0');
   $illia2.hide();
   $illia2.notsolid();
   globalCommon_Autosave();
   cam_fadein( 1, 0, 0, 0, 1, 0 );

}

void change_map()
{
        $illia2.playdialog("localization/sound/dialog/map01/illia/endprogram.mp3",1,10000,0);
        waitfordialog($illia2);
        cam_fadeout( 1, 0, 0, 0, 1, 0 );
        wait( 1 );
        stuffcmd("map map2 \n");
}
void inc_death_toll()
{
   killed_klingons++;
}



void spawn_melee_klingon( entity entity_to_spawn)
{
        entity e;
        string tiki_to_use;
        float random_number;
        random_number = randomint(5);


        if (random_number == 0) tiki_to_use = "char/klingon-m9-merc-batleth-m2.tik";
        if (random_number == 1) tiki_to_use = "char/klingon-m9-merc-knife-m2.tik";
        if (random_number == 2) tiki_to_use = "char/klingon-m9-merc-knife-m1.tik";
        if (random_number == 3) tiki_to_use = "char/klingon-m9-merc-knife-f3.tik";
        if (random_number == 4) tiki_to_use = "char/klingon-m9-merc-batleth-m1.tik";
        entity_to_spawn.modelname(tiki_to_use);
        entity_to_spawn.spawneffectname( "TransportIn", "Idryll" );
        
        
        entity_to_spawn.checkforspace();
        e = entity_to_spawn.spawnnow();
        wait( 0.05 );
        e.ai_off();

        if (!doesEntityExist( e)) { inc_death_toll(); }
        //e.attackplayer();
        e.killthread("inc_death_toll");

        wait(1);
        e.ai_on();
        e.attack( $player );
        //e.hurt(10);

}


void spawn_disrupter_klingon( entity entity_to_spawn)
{
        entity e;
        string tiki_to_use;
        float random_number;

        random_number = randomint(5);

        if (random_number == 0) tiki_to_use = "char/klingon-m9-merc-disruptor-m1.tik";
        if (random_number == 1) tiki_to_use = "char/klingon-m9-merc-disruptor-m2.tik";
        if (random_number == 1) tiki_to_use = "char/klingon-m9-merc-disruptor-m1.tik";
        if (random_number == 2) tiki_to_use = "char/klingon-m9-merc-disruptor-f1.tik";
        if (random_number == 3) tiki_to_use = "char/klingon-m9-merc-disruptor-f2.tik";
        if (random_number == 4) tiki_to_use = "char/klingon-m9-merc-disruptor-f3.tik";
        entity_to_spawn.modelname(tiki_to_use);


        entity_to_spawn.spawneffectname( "TransportIn", "Idryll" );
        
        
        entity_to_spawn.checkforspace();
        e = entity_to_spawn.spawnnow();
        wait( 0.05 );
        e.ai_off();
        e.killthread("inc_death_toll");
        if (!doesEntityExist( e)) { inc_death_toll(); }
        //e.attackplayer();
        wait(1);
        e.ai_on();
        e.attack( $player );
}


void main()
{
   //globalLoadout_AssignWeapons ( "m11l1a_drull_ruins3" );
   //globalLoadout_AssignWeapons ( "m3l1a_forever" );

   globalLoadout_GiveWeapon( WEAPON_PHASER_STX );
   globalLoadout_GiveWeapon( WEAPON_COMPRESSION_RIFLE );
   globalLoadout_GiveWeapon( WEAPON_ASSAULT_SHOTGUN );
   $player.give( "models/weapons/worldmodel-batleth.tik" );

   $player.use( "batleth" );
   
   soundtrack( "music/m9l1a-klingon_base.mus" );

   $world.light_intensity( "lightning", 0 );

   $illia2.notsolid();
   $illia2.hide();
   $death_klingon.notsolid();
   $death_klingon.hide();
   

   switch_off_ai();

   float thread_number;


   thread_number = thread start_introcin();
   waitforthread(thread_number);
   
   wait(2);
   //finish_introcin();

   wait(1);

   while ( killed_klingons < 5 ) { wait(.5); }


   killed_klingons = 0;
   thread spawn_melee_klingon($wave1klingon1);
   thread spawn_melee_klingon($wave1klingon3);
   thread spawn_disrupter_klingon($wave1klingon2);

   while ( killed_klingons < 2 ) { wait(.5); }

   thread spawn_melee_klingon($wave2klingon1);
   thread spawn_melee_klingon($wave2klingon3);
   thread spawn_disrupter_klingon($wave2klingon2);

   while ( killed_klingons < 6 ) { wait(.5); }

   killed_klingons = 0;
   thread spawn_disrupter_klingon($wave3klingon1);
   thread spawn_melee_klingon($wave3klingon3);
   thread spawn_disrupter_klingon($wave3klingon2);


   while ( killed_klingons < 2 ) { wait(.5); }
   thread spawn_disrupter_klingon($wave4klingon1);
   thread spawn_disrupter_klingon($wave4klingon2);

   while ( killed_klingons < 5 ) { wait(.5); }

   forcemusic( "success" );

   wait(2);

   thread_number = thread start_holocin();
   waitforthread(thread_number);

   killed_klingons = 0;
   thread spawn_melee_klingon($newKlingon1);
   thread spawn_melee_klingon($newKlingon3);
   thread spawn_disrupter_klingon($newKlingon2);
   thread spawn_disrupter_klingon($newKlingon4);

   while ( killed_klingons < 4 ) { wait(.5); }
   thread spawn_melee_klingon($wave5klingon1);
   thread spawn_melee_klingon($wave5klingon2);
   thread spawn_melee_klingon($wave5klingon3);
   while ( killed_klingons < 7 ) { wait(.5); }



   wait(2);

   change_map();


}