Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Member FLow Trix's Avatar
    Join Date
    Jul 2011
    Location
    FL
    Posts
    70
    Points
    107
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    FL
    Posts
    70
    Points
    107
    Gamer IDs

    Gamertag: Flow Trix

    Default I found some interesting things for zombies

    SCRIPT FOR PENTAGON MAP ZOMBIES
    there is 4 filesd here I have more I didn't know if any body could use these

    go to page 2 an look at my other post

    #include clientscripts\_utility;
    #include clientscripts\_music;
    #include clientscripts\_zombiemode_weapons;

    main()
    {
    level._uses_crossbow = true;
    level._power_on = false;

    // ww: thundergun init happens in _zombiemode.csc so the weapons need to be setup before _zombiemode::main is
    include_weapons();

    // _load!
    clientscripts\_zombiemode::main();
    clientscripts\zombie_pentagon_fx::main();

    clientscripts\zombie_pentagon_teleporter::main();
    thread clientscripts\zombie_pentagon_amb::main();

    clientscripts\_zombiemode_deathcard::init();

    // Setup the magic box screens
    level init_pentagon_box_screens();

    // This needs to be called after all systems have been registered.
    thread waitforclient(0);

    register_zombie_types();
    pentagon_client_flags();

    // Waits for power before starting the screens
    level thread pentagon_ZPO_listener();
    level thread pentagon_TLO_listener();
    level thread set_visionset_office();
    level thread set_visionset_warroom();
    level thread set_visionset_lab();
    level thread set_visionset_tech();

    level thread pentagon_office_light_model_swap_init();
    }

    register_zombie_types()
    {
    character\clientscripts\c_usa_pent_zombie_officewo rker::register_gibs();
    character\clientscripts\c_usa_pent_zombie_military police::register_gibs();
    character\clientscripts\c_usa_pent_zombie_scientis t::register_gibs();

    character\clientscripts\c_zom_quad::register_gibs( );
    }

    include_weapons()
    {
    include_weapon( "frag_grenade_zm", false );
    include_weapon( "claymore_zm", false );

    // Weapons - Pistols
    include_weapon( "m1911_zm", false ); // colt
    include_weapon( "m1911_upgraded_zm", false );
    include_weapon( "python_zm" ); // 357
    include_weapon( "python_upgraded_zm", false );
    include_weapon( "cz75_zm" );
    include_weapon( "cz75_upgraded_zm", false );

    // Weapons - Semi-Auto Rifles
    include_weapon( "m14_zm", false ); // gewehr43
    include_weapon( "m14_upgraded_zm", false );

    // Weapons - Burst Rifles
    include_weapon( "m16_zm", false );
    include_weapon( "m16_gl_upgraded_zm", false );
    include_weapon( "g11_lps_zm" );
    include_weapon( "g11_lps_upgraded_zm", false );
    include_weapon( "famas_zm" );
    include_weapon( "famas_upgraded_zm", false );

    // Weapons - SMGs
    include_weapon( "ak74u_zm", false ); // thompson, mp40, bar
    include_weapon( "ak74u_upgraded_zm", false );
    include_weapon( "mp5k_zm", false );
    include_weapon( "mp5k_upgraded_zm", false );
    include_weapon( "mp40_zm", false );
    include_weapon( "mp40_upgraded_zm", false );
    include_weapon( "mpl_zm", false );
    include_weapon( "mpl_upgraded_zm", false );
    include_weapon( "pm63_zm", false );
    include_weapon( "pm63_upgraded_zm", false );
    include_weapon( "spectre_zm" );
    include_weapon( "spectre_upgraded_zm", false );

    // Weapons - Dual Wield
    include_weapon( "cz75dw_zm" );
    include_weapon( "cz75dw_upgraded_zm", false );

    // Weapons - Shotguns
    include_weapon( "ithaca_zm", false ); // shotgun
    include_weapon( "ithaca_upgraded_zm", false );
    include_weapon( "rottweil72_zm", false );
    include_weapon( "rottweil72_upgraded_zm", false );
    include_weapon( "spas_zm" ); //
    include_weapon( "spas_upgraded_zm", false );
    include_weapon( "hs10_zm" );
    include_weapon( "hs10_upgraded_zm", false );

    // Weapons - Assault Rifles
    include_weapon( "aug_acog_zm" );
    include_weapon( "aug_acog_mk_upgraded_zm", false );
    include_weapon( "galil_zm" );
    include_weapon( "galil_upgraded_zm", false );
    include_weapon( "commando_zm" );
    include_weapon( "commando_upgraded_zm", false );
    include_weapon( "fnfal_zm" );
    include_weapon( "fnfal_upgraded_zm", false );

    // Weapons - Sniper Rifles
    include_weapon( "dragunov_zm" ); // ptrs41
    include_weapon( "dragunov_upgraded_zm", false );
    include_weapon( "l96a1_zm" );
    include_weapon( "l96a1_upgraded_zm", false );

    // Weapons - Machineguns
    include_weapon( "rpk_zm" ); // mg42, 30 cal, ppsh
    include_weapon( "rpk_upgraded_zm", false );
    include_weapon( "hk21_zm" );
    include_weapon( "hk21_upgraded_zm", false );

    // Weapons - Misc
    include_weapon( "m72_law_zm" );
    include_weapon( "m72_law_upgraded_zm", false );
    include_weapon( "china_lake_zm" );
    include_weapon( "china_lake_upgraded_zm", false );

    // Weapons - Special
    include_weapon( "zombie_cymbal_monkey" );
    include_weapon( "ray_gun_zm" );
    include_weapon( "ray_gun_upgraded_zm", false );
    include_weapon( "freezegun_zm" );
    include_weapon( "freezegun_upgraded_zm", false );
    include_weapon( "crossbow_explosive_zm" );
    include_weapon( "crossbow_explosive_upgraded_zm", false );

    include_weapon( "knife_ballistic_zm", true );
    include_weapon( "knife_ballistic_upgraded_zm", false );
    include_weapon( "knife_ballistic_bowie_zm", false );
    include_weapon( "knife_ballistic_bowie_upgraded_zm", false );

    }
    //------------------------------------------------------------------------------
    // DCS 090210: clientsided vision set changes
    //------------------------------------------------------------------------------
    set_visionset_office()
    {
    while(true)
    {
    level waittill( "vis1", ClientNum );
    if(level._power_on == true)
    {
    VisionSetNaked(ClientNum, "zombie_pentagon_offices_poweroff", 0.0);
    }
    else
    {
    VisionSetNaked(ClientNum, "zombie_pentagon", 0.0);
    }
    }
    }
    set_visionset_warroom()
    {
    while(true)
    {
    level waittill( "vis2", ClientNum );
    VisionSetNaked(ClientNum, "zombie_pentagon_warroom", 2.0);
    }
    }

    set_visionset_lab()
    {
    while(true)
    {
    level waittill( "vis3", ClientNum );
    VisionSetNaked(ClientNum, "zombie_pentagon_lab", 2.0);
    }
    }
    set_visionset_tech()
    {
    while(true)
    {
    level waittill( "vis4", ClientNum );
    VisionSetNaked(ClientNum, "zombie_pentagon_electrician", 1.0);
    }
    }


    //------------------------------------------------------------------------------
    // Pentagon video tracking for the magic box
    //------------------------------------------------------------------------------
    init_pentagon_box_screens()
    {
    // logic is written to deal with arrays!
    level._pentagon_fire_sale = array( "p_zom_monitor_screen_fsale1", "p_zom_monitor_screen_fsale2" );
    level.magic_box_tv_off = array( "p_zom_monitor_screen_off" );
    level.magic_box_tv_on = array( "p_zom_monitor_screen_on" );

    level.magic_box_tv_lobby_1 = array( "p_zom_monitor_screen_lobby0", "p_zom_monitor_screen_lobby1" );
    level.magic_box_tv_lobby_2 = array( "p_zom_monitor_screen_lobby0", "p_zom_monitor_screen_lobby2" );

    level.magic_box_tv_warroom_1 = array( "p_zom_monitor_screen_warroom0", "p_zom_monitor_screen_warroom1" );

    level.magic_box_tv_labs_1 = array( "p_zom_monitor_screen_labs0", "p_zom_monitor_screen_labs1" );
    level.magic_box_tv_labs_2 = array( "p_zom_monitor_screen_labs0", "p_zom_monitor_screen_labs2" );
    level.magic_box_tv_labs_3 = array( "p_zom_monitor_screen_labs0", "p_zom_monitor_screen_labs3" );

    level.magic_box_tv_random = array( "p_zom_monitor_screen_logo" );

    // the array of models match up with the box script_noteworthy. noteworthy values found in comments
    level._box_locations = array( level.magic_box_tv_lobby_1, //"level1_chest"
    level.magic_box_tv_lobby_2, //"level1_chest2"
    level.magic_box_tv_warroom_1, //"level2_chest"
    level.magic_box_tv_labs_1, //"start_chest"
    level.magic_box_tv_labs_2, //"start_chest2"
    level.magic_box_tv_labs_3 ); //"start_chest3"

    level._custom_box_monitor = ::pentagon_screen_switch;
    }


    pentagon_ZPO_listener()
    {
    //

    while(1)
    {
    level waittill("ZPO"); // Zombie power on.
    level._power_on = true;

    // level notify( "threeprimaries_on" );

    // power lights
    level notify( "TLO" );
    }
    }


    pentagon_TLO_listener()
    {
    while ( 1 )
    {
    level waittill( "TLO" );

    level notify( "por0" );
    level notify( "por1" );
    level notify( "por2" );
    level notify( "por3" );
    level notify( "por4" );

    level waittill( "TLF" );

    level notify( "por0" );
    level notify( "por1" );
    level notify( "por2" );
    level notify( "por3" );
    level notify( "por4" );
    }
    }


    pentagon_tv_init( client_num )
    {
    if ( !isdefined( level.pentagon_tvs ) )
    {
    level.pentagon_tvs = [];
    }

    if ( isdefined( level.pentagon_tvs[client_num] ) )
    {
    return;
    }

    level.pentagon_tvs[client_num] = GetEntArray( client_num, "model_pentagon_box_screens", "targetname" );

    // set up tag origin models to play the fx off of
    for( i = 0; i < level.pentagon_tvs[client_num].size; i++ )
    {
    tele = level.pentagon_tvs[client_num][i];

    tele SetModel( level.magic_box_tv_off[0] );

    wait( 0.1 );
    }
    }

    // this is what it runs after changing state in the zombie_pentagon_magic_box.gsc
    //
    pentagon_screen_switch( client_num, state, oldState )
    {
    pentagon_tv_init( client_num );

    if( state == "n" ) // "n" can mean no power or undefined spot
    {
    if( level._power_on == false )
    {
    screen_to_display = level.magic_box_tv_off;
    }
    else
    {
    screen_to_display = level.magic_box_tv_on;
    }
    }
    else if( state == "f" ) // a state of "f" means "fire_sale"
    {
    screen_to_display = level._pentagon_fire_sale;
    }
    else // the state was a number that matches a spot in level._box_locations
    {
    // client info is sent as a string, this is a number i need
    array_number = Int( state );

    // which spot in the array is the box? this string matches the fx to play
    screen_to_display = level._box_locations[ array_number ];
    }

    stop_notify = "stop_tv_swap";


    // play the correct fx on each screen
    for( i = 0; i < level.pentagon_tvs[client_num].size; i++ )
    {
    tele = level.pentagon_tvs[client_num][i];
    tele notify( stop_notify );
    wait( 0.2 );
    tele thread magic_box_screen_swap( screen_to_display, "stop_tv_swap" );
    tele thread play_magic_box_tv_audio( state );
    }

    }

    // changes the model (self) through the array of models passed in
    // this will also check to see if level.magic_box_tv_random is defined and throw in a surprise
    magic_box_screen_swap( model_array, endon_notify )
    {
    self endon( endon_notify );

    while( true )
    {
    for( i = 0; i < model_array.size; i++ )
    {
    self SetModel( model_array[i] );
    wait( 3.0 );
    }

    if( 6 > RandomInt( 100 ) && IsDefined( level.magic_box_tv_random ) )
    {
    self SetModel( level.magic_box_tv_random[ RandomInt( level.magic_box_tv_random.size ) ] );
    wait( 2.0 );
    }

    wait( 1.0 );
    }

    }

    // ww: init the lights that swap when the power is turned on
    pentagon_office_light_model_swap_init()
    {
    // lights
    players = getlocalplayers();

    for( i = 0; i < players.size; i++ )
    {
    office_light_models = GetEntArray( i, "model_interior_office_lights", "targetname" );

    if( IsDefined( office_light_models ) && office_light_models.size > 0 )
    {
    array_thread( office_light_models, ::pentagon_office_light_model_swap );
    }
    }


    }

    // ww: swap a model light with the off version when the power is switched
    pentagon_office_light_model_swap()
    {
    level waittill( "ZPO" );

    if( self.model == "p_pent_light_ceiling_on" )
    {
    self SetModel( "p_pent_light_ceiling" );
    }
    else if( self.model == "p_pent_light_tinhat_on" )
    {
    self SetModel( "p_pent_light_tinhat_off" );
    }
    }

    play_magic_box_tv_audio( state )
    {
    alias = "amb_tv_static";

    if( state == "n" )
    {
    if( level._power_on == false )
    {
    alias = undefined;
    }
    else
    {
    alias = "amb_tv_static";
    }
    }
    else if( state == "f" )
    {
    alias = "mus_fire_sale";
    }
    else
    {
    alias = "amb_tv_static";
    }

    if( !IsDefined(alias) )
    {
    self stoploopsound( .5 );
    }
    else
    {
    self PlayLoopSound( alias, .5 );
    }
    }

    //-------------------------------------------------------------------------------
    // DCS 091510: setting up client flags for vision sets and efx.
    //-------------------------------------------------------------------------------
    pentagon_client_flags()
    {
    // Client flags for the player
    level.ZOMBIE_PENTAGON_PLAYER_PORTALFX = 5;
    level.ZOMBIE_PENTAGON_PLAYER_PORTALFX_COOL = 6;
    level.ZOMBIE_PENTAGON_PLAYER_CF_UPDATEPROFILE = 0;

    // Callbacks for players

    register_clientflag_callback("player", level.ZOMBIE_PENTAGON_PLAYER_PORTALFX, clientscripts\zombie_pentagon_teleporter::teleport er_fx_init);
    register_clientflag_callback("player", level.ZOMBIE_PENTAGON_PLAYER_CF_UPDATEPROFILE, ::update_player_profile);
    }

    // ww: handles the unlocking of doa from the batphones
    update_player_profile(localClientNum, set, newEnt)
    {
    UpdateGamerProfile(localClientNum);
    }



    //
    // file: zombie_pentagon_amb.csc
    // description: clientside ambient script for zombie_pentagon: setup ambient sounds, etc.
    // scripter: (initial clientside work - laufer)
    //

    #include clientscripts\_utility;
    #include clientscripts\_ambientpackage;
    #include clientscripts\_music;

    main()
    {
    //**** AMBIENT PACKAGES/ROOMS ****\\


    //DEFAULT: Top floor, mainly pentagon offices, woody, all medium-sized
    declareAmbientRoom( "pentagon_default" );
    declareAmbientPackage( "pentagon_default" );
    setAmbientRoomTone( "pentagon_default", "amb_office_bg" );
    setAmbientRoomReverb ("pentagon_default","zmb_theater_main_room", 1, 1);
    //addAmbientElement( "pentagon_default", "amb_wood_groan", 15, 60, 50, 150 );
    setAmbientRoomContext( "pentagon_default", "ringoff_plr", "indoor" );

    //First elevator, smallish, regular type elevator same as in Pentagon SP level
    declareAmbientRoom( "pentagon_elevator" );
    declareAmbientPackage( "pentagon_elevator" );
    setAmbientRoomTone( "pentagon_elevator", "amb_office_bg" );
    setAmbientRoomReverb ("pentagon_elevator","zmb_theater_main_room", 1, 1);
    //addAmbientElement( "pentagon_elevator", "amb_wood_groan", 15, 60, 50, 150 );
    setAmbientRoomContext( "pentagon_elevator", "ringoff_plr", "indoor" );

    //Big ass warroom, same as in Pentagon SP
    declareAmbientRoom( "pentagon_warroom" );
    declareAmbientPackage( "pentagon_warroom" );
    setAmbientRoomTone( "pentagon_warroom", "amb_warroom_bg" );
    setAmbientRoomReverb ("pentagon_warroom","zmb_theater_main_room", 1, 1);
    //addAmbientElement( "pentagon_warroom", "amb_wood_groan", 15, 60, 50, 150 );
    setAmbientRoomContext( "pentagon_warroom", "ringoff_plr", "indoor" );

    //Presidential offshoot from the War Room, mostly woody and carpeted, medium
    declareAmbientRoom( "pentagon_warroom_suite" );
    declareAmbientPackage( "pentagon_warroom_suite" );
    setAmbientRoomTone( "pentagon_warroom_suite", "amb_office_bg" );
    setAmbientRoomReverb ("pentagon_warroom_suite","zmb_theater_main_roo m", 1, 1);
    //addAmbientElement( "pentagon_warroom_suite", "amb_wood_groan", 15, 60, 50, 150 );
    setAmbientRoomContext( "pentagon_warroom_suite", "ringoff_plr", "indoor" );

    //Lab Elevator off of the war room, larger freight type elevator, metal-ish
    declareAmbientRoom( "lab_elevator" );
    declareAmbientPackage( "lab_elevator" );
    setAmbientRoomTone( "lab_elevator", "amb_lab_bg" );
    setAmbientRoomReverb ("lab_elevator","zmb_theater_main_room", 1, 1);
    //addAmbientElement( "lab_elevator", "amb_wood_groan", 15, 60, 50, 150 );
    setAmbientRoomContext( "lab_elevator", "ringoff_plr", "indoor" );

    //Lab, same as Rebirth labs in SP, hallways and medium sized rooms, all one trigger
    declareAmbientRoom( "lab" );
    declareAmbientPackage( "lab" );
    setAmbientRoomTone( "lab", "amb_lab_bg" );
    setAmbientRoomReverb ("lab","zmb_theater_main_room", 1, 1);
    //addAmbientElement( "lab", "amb_wood_groan", 15, 60, 50, 150 );
    setAmbientRoomContext( "lab", "ringoff_plr", "indoor" );


    //Default Ambient Package
    activateAmbientPackage( 0, "pentagon_default", 0 );
    activateAmbientRoom( 0, "pentagon_default", 0 );


    //MUSIC STATES

    declareMusicState("WAVE");
    musicAliasloop("mus_pentagon_underscore", 4, 2);

    declareMusicState("EGG");
    musicAlias("mus_egg_mature", 1);

    declareMusicState("EGG_SAFE");
    musicAlias("mus_egg_safe", 1);

    declareMusicState( "SILENCE" );
    musicAlias("null", 1 );

    //FUNCTIONS

    level thread play_elevator1_audio();
    level thread play_elevator2_audio();
    level thread play_minigun_loop();
    }

    play_elevator1_audio()
    {
    while(1)
    {
    level waittill( "ele1" );
    ent = spawn( 0, (0,0,0), "script_origin" );
    PlaySound( 0, "evt_elevator_office_start", ent.origin );
    ent PlayLoopSound( "evt_elevator_office_run", 1 );
    level waittill( "ele1e" );
    ent stoploopsound( 1 );
    PlaySound( 0, "evt_elevator_office_stop", ent.origin );
    wait(1);
    ent Delete();
    }
    }

    play_elevator2_audio()
    {
    while(1)
    {
    level waittill( "ele2" );
    ent = spawn( 0, (0,0,0), "script_origin" );
    PlaySound( 0, "evt_elevator_freight_start", ent.origin );
    ent PlayLoopSound( "evt_elevator_freight_run", 1 );
    level waittill( "ele2e" );
    ent stoploopsound( 1 );
    PlaySound( 0, "evt_elevator_freight_stop", ent.origin );
    wait(1);
    ent Delete();
    }
    }

    play_minigun_loop()
    {
    while(1)
    {
    level waittill( "minis" );
    ent = spawn( 0, (0,0,0), "script_origin" );
    ent PlayLoopSound( "zmb_insta_kill_loop" );
    level waittill( "minie" );
    PlaySound( 0, "zmb_insta_kill", (0,0,0) );
    ent stoploopsound( .5 );
    wait(.5);
    ent Delete();
    }
    }



    //
    // file: zombie_pentagon_fx.gsc
    // description: clientside fx script for zombie_pentagon: setup, special fx functions, etc.
    // scripter: (initial clientside work - laufer)
    //

    #include clientscripts\_utility;
    #include clientscripts\_fx;
    #include clientscripts\_music;


    main()
    {
    clientscripts\createfx\zombie_pentagon_fx::main();
    clientscripts\_fx::reportNumEffects();
    precache_util_fx();
    precache_createfx_fx();
    disableFX = GetDvarInt( #"disable_fx" );
    if( !IsDefined( disableFX ) || disableFX <= 0 )
    {
    precache_scripted_fx();
    }

    level thread clientscripts\_zombiemode::init_perk_machines_fx() ;

    //PI ESM - added for electric trap fx
    //level thread trap_fx_monitor( "elec_trap1", "e1", "electric" );
    //level thread trap_fx_monitor( "fire_trap1", "f1", "fire" );
    level thread trap_fx_monitor( "trap_quickrevive", "nhe", "electric" );
    level thread trap_fx_monitor( "trap_elevator", "she", "electric" );

    // lighting
    level thread light_model_swap( "smodel_light_electric", "lights_indlight_on" );
    }


    precache_util_fx()
    {
    }

    precache_scripted_fx()
    {
    level._effect["eye_glow"] = LoadFx( "misc/fx_zombie_eye_single" );

    level._effect["headshot"] = LoadFX( "impacts/fx_flesh_hit" );
    level._effect["headshot_nochunks"] = LoadFX( "misc/fx_zombie_bloodsplat" );
    level._effect["bloodspurt"] = LoadFX( "misc/fx_zombie_bloodspurt" );
    level._effect["animscript_gib_fx"] = LoadFx( "weapon/bullet/fx_flesh_gib_fatal_01" );
    level._effect["animscript_gibtrail_fx"] = LoadFx( "trail/fx_trail_blood_streak" );

    level._effect[ "no_power" ] = LoadFX( "misc/fx_zombie_eye_single" );
    level._effect[ "fire_sale" ] = LoadFX( "misc/fx_zombie_eye_single" );
    level._effect[ "level1_chest" ] = LoadFX( "misc/fx_zombie_eye_single" );
    level._effect[ "level1_chest2" ] = LoadFX( "misc/fx_zombie_eye_single" );
    level._effect[ "level2_chest" ] = LoadFX( "misc/fx_zombie_eye_single" );
    level._effect[ "start_chest" ] = LoadFX( "misc/fx_zombie_eye_single" );
    level._effect[ "start_chest2" ] = LoadFX( "misc/fx_zombie_eye_single" );
    level._effect[ "start_chest3" ] = LoadFX( "misc/fx_zombie_eye_single" );
    level._effect["test_spin_fx"] = LoadFX( "env/light/fx_light_warning");


    }

    precache_createfx_fx()
    {
    level._effect["zapper"] = loadfx("misc/fx_zombie_electric_trap");
    level._effect["switch_sparks"] = loadfx("env/electrical/fx_elec_wire_spark_burst");
    level._effect["fire_trap_med"] = loadfx("maps/zombie/fx_zombie_fire_trap_med");

    level._effect["zombie_pentagon_teleporter"] = loadfx("maps/zombie/fx_zombie_portal_nix_num");
    level._effect["zombie_pent_portal_pack"] = loadfx("maps/zombie/fx_zombie_portal_nix_num_pp");
    level._effect["zombie_pent_portal_cool"] = loadfx("maps/zombie/fx_zombie_portal_nix_num_pp_fd");
    level._effect["transporter_beam"] = loadfx("maps/zombie/fx_transporter_beam");
    level._effect["transporter_start"] = loadfx("maps/zombie/fx_transporter_start");
    level._effect["fx_zombie_portal_corona_lg"] = loadfx("maps/zombie/fx_zombie_portal_corona_lg");
    level._effect["fx_zombie_portal_corona_sm"] = loadfx("maps/zombie/fx_zombie_portal_corona_sm");

    // Pentagon effects
    level._effect["fx_pent_cigar_smoke"] = LoadFX("maps/zombie/fx_zombie_cigar_tip_smoke");
    level._effect["fx_pent_cigarette_tip_smoke"] = LoadFX("maps/zombie/fx_zombie_cigarette_tip_smoke");
    level._effect["fx_glo_studio_light"] = LoadFX("maps/pentagon/fx_glo_studio_light");
    level._effect["fx_pent_tinhat_light"] = LoadFX("maps/pentagon/fx_pent_tinhat_light");
    level._effect["fx_pent_lamp_desk_light"] = LoadFX("maps/pentagon/fx_pent_lamp_desk_light");
    level._effect["fx_pent_security_camera"] = LoadFX("maps/pentagon/fx_pent_security_camera");
    level._effect["fx_pent_globe_projector"] = LoadFX("maps/zombie/fx_zombie_globe_projector");
    level._effect["fx_pent_globe_projector_blue"] = LoadFX("maps/zombie/fx_zombie_globe_projector_blue");
    level._effect["fx_pent_movie_projector"] = LoadFX("maps/pentagon/fx_pent_movie_projector");
    level._effect["fx_pent_tv_glow"] = LoadFX("maps/zombie/fx_zombie_tv_glow");
    level._effect["fx_pent_tv_glow_sm"] = LoadFX("maps/zombie/fx_zombie_tv_glow_sm");
    level._effect["fx_pent_smk_ambient_room"] = LoadFX("maps/pentagon/fx_pent_smk_ambient_room");
    level._effect["fx_pent_smk_ambient_room_lg"] = LoadFX("maps/zombie/fx_zombie_pent_smk_ambient_room_lg");
    level._effect["fx_pent_smk_ambient_room_sm"] = LoadFX("maps/pentagon/fx_pent_smk_ambient_room_sm");

    // FX from Rebirth
    level._effect["fx_light_overhead_int_amber"] = loadfx("maps/zombie/fx_zombie_light_overhead_amber");
    level._effect["fx_light_overhead_int_amber_short"] = loadfx("maps/zombie/fx_zombie_light_overhead_amber_short");
    level._effect["fx_light_overhead_cool"] = loadfx("maps/zombie/fx_zombie_light_overhead_cool");
    level._effect["fx_light_floodlight_bright"] = loadfx("maps/zombie/fx_zombie_light_floodlight_bright");

    //Quad Vent Exploders - bottom floor -1001,1002,1003,1004
    level._effect["fx_quad_vent_break"] = LoadFX("maps/zombie/fx_zombie_crawler_vent_break");

    // Additional FX
    level._effect["fx_smk_linger_lit"] = loadfx("maps/mp_maps/fx_mp_smk_linger");

    level._effect["fx_water_drip_light_long"] = loadfx("env/water/fx_water_drip_light_long");
    level._effect["fx_water_drip_light_short"] = loadfx("env/water/fx_water_drip_light_short");
    level._effect["fx_mp_blood_drip_short"] = loadfx("maps/mp_maps/fx_mp_blood_drip_short");

    level._effect["fx_pipe_steam_md"] = loadfx("env/smoke/fx_pipe_steam_md");
    level._effect["fx_mp_fumes_vent_sm_int"] = loadfx("maps/mp_maps/fx_mp_fumes_vent_sm_int");
    level._effect["fx_mp_fumes_vent_xsm_int"] = loadfx("maps/mp_maps/fx_mp_fumes_vent_xsm_int");

    level._effect["fx_zombie_light_glow_telephone"] = loadfx("maps/zombie/fx_zombie_light_glow_telephone");
    level._effect["fx_light_pent_ceiling_light"] = loadfx("env/light/fx_light_pent_ceiling_light");
    level._effect["fx_light_pent_ceiling_light_flkr"] = loadfx("env/light/fx_light_pent_ceiling_light_flkr");
    level._effect["fx_light_office_light_03"] = loadfx("env/light/fx_light_office_light_03");
    level._effect["fx_mp_light_dust_motes_md"] = loadfx("maps/zombie/fx_zombie_light_dust_motes_md");

    level._effect["fx_insects_swarm_md_light"] = loadfx("bio/insects/fx_insects_swarm_md_light");
    level._effect["fx_insects_maggots"] = loadfx("bio/insects/fx_insects_maggots_sm");

    level._effect["fx_mp_elec_spark_burst_xsm_thin_runner"] = loadfx("maps/mp_maps/fx_mp_elec_spark_burst_xsm_thin_runner");
    level._effect["fx_mp_elec_spark_burst_sm_runner"] = loadfx("maps/mp_maps/fx_mp_elec_spark_burst_sm_runner");

    level._effect["fx_interrog_morgue_mist"] = loadfx("maps/zombie/fx_zombie_morgue_mist");
    level._effect["fx_interrog_morgue_mist_falling"] = loadfx("maps/zombie/fx_zombie_morgue_mist_falling");

    }

    //************************************************** ***************************
    // TRAPS:
    // name = targetname of the fx structs
    // loc = abbreviated notify (try to keep to 2 characters max)
    //************************************************** ***************************

    trap_fx_monitor( name, loc, trap_type )
    {
    // Get the list of points.
    // Don't include structs used for script_models
    structs = getstructarray( name, "targetname" );
    points = [];
    for ( i=0; i<structs.size; i++ )
    {
    if ( !IsDefined(structs[i].model ) )
    {
    points[ points.size ] = structs[i];
    }
    }

    while(1)
    {
    // Wait for the notify
    level waittill( loc+"1" ); // "one" means on

    // Spawn an FX for each struct
    for( i=0; i<points.size; i++ )
    {
    points[i] thread trap_play_fx( loc, trap_type );
    }
    }
    }

    //************************************************** ***************************
    // TRAP FX
    //************************************************** ***************************

    trap_play_fx( loc, trap_type )
    {
    // Get the structs orientation
    ang = self.angles;
    forward = anglestoforward( ang );
    up = anglestoup( ang );

    // If the effects already exist, delete them
    if ( isdefined( self.loopFX ) )
    {
    for( i=0; i<self.loopFX.size; i++ )
    {
    self.loopFX[i] delete();
    }

    self.loopFX = [];
    }
    if(!isdefined(self.loopFX))
    {
    self.loopFX = [];
    }

    // Effect override
    fx_name = ""; // scope declaration
    if ( IsDefined( self.script_string ) )
    {
    fx_name = self.script_string;
    }
    else
    {
    switch( trap_type )
    {
    case "electric":
    fx_name = "zapper";
    break;
    default:
    case "fire":
    fx_name = "fire_trap_med";
    break;
    }
    }

    // Create the Effect for each player
    players = getlocalplayers();
    for( i=0; i<players.size; i++ )
    {
    self.loopFX[i] = SpawnFx( i, level._effect[ fx_name ], self.origin, 0, forward, up );
    triggerfx( self.loopFX[i] );
    }

    // Wait for the server notify to stop the effect
    level waittill( loc + "0" ); // "zero" means off

    // Delete the effects
    for(i=0; i<self.loopFX.size; i++ )
    {
    self.loopFX[i] delete();
    }
    self.loopFX = [];

    }


    // Replace the light models when the lights turn on and off
    light_model_swap( name, model )
    {
    level waittill( "pl1" ); // Power lights on

    players = getlocalplayers();
    for ( p=0; p<players.size; p++ )
    {
    lamps = GetEntArray( p, name, "targetname" );
    for ( i=0; i<lamps.size; i++ )
    {
    lamps[i] SetModel( model );
    }
    }
    }


    //
    // file: zombie_pentagon_teleporter.csc
    // description: clientside post-teleport effects
    //
    #include clientscripts\_fx;
    #include clientscripts\_utility;
    #include clientscripts\_music;

    main()
    {
    level thread wait_for_teleport_aftereffect();


    waitforallclients();

    level.portal_effect = level._effect["zombie_pentagon_teleporter"];
    level.pack_effect = level._effect["zombie_pent_portal_pack"];

    players = getlocalplayers();
    for ( i = 0; i < players.size; i++ )
    {
    players[i] thread teleporter_fx_setup(i);
    players[i] thread teleporter_fx_cool_down(i);
    }
    }

    //-------------------------------------------------------------------------------
    // DCS 091510: setting up portal fx with client flags.
    //-------------------------------------------------------------------------------
    teleporter_fx_setup(ClientNum)
    {
    teleporters = GetEntArray(ClientNum, "pentagon_teleport_fx", "targetname");
    level.fxents[ClientNum] = [];
    level.packtime[ClientNum] = true;

    //pack room portal never changes. Will be on from start.
    teleporter_pack = GetEnt(ClientNum, "pentagon_teleport_fx_pack", "targetname");
    teleporter_pack.fx_ent = Spawn(ClientNum,teleporter_pack.origin,"script_mod el");
    teleporter_pack.fx_ent SetModel("tag_origin");
    teleporter_pack.fx_ent.angles = teleporter_pack.angles;
    teleporter_pack.portalfx = PlayFXOnTag(ClientNum,level.portal_effect, teleporter_pack.fx_ent,"tag_origin" );
    teleporter_pack PlayLoopSound( "evt_teleporter_loop", 1.75 );

    for ( i = 0; i < teleporters.size; i++ )
    {
    fx_ent = Spawn(ClientNum,teleporters[i].origin,"script_model");
    fx_ent SetModel("tag_origin");
    fx_ent.angles = teleporters[i].angles;

    level.fxents[ClientNum] = array_add(level.fxents[ClientNum], fx_ent);
    }
    }

    teleporter_fx_init(ClientNum, set, newEnt)
    {
    fx_array = level.fxents[ClientNum];

    if ( set && level.packtime[ClientNum] == true)
    {
    println("*** Client : regular portal fx on. ", ClientNum);
    level.packtime[ClientNum] = false;

    for ( i = 0; i < fx_array.size; i++ )
    {
    if(IsDefined(fx_array[i].portalfx))
    {
    deletefx(ClientNum, fx_array[i].portalfx);
    }

    wait(0.01);
    fx_array[i].portalfx = PlayFXOnTag(ClientNum,level.portal_effect, fx_array[i],"tag_origin" );
    PlaySound( ClientNum, "evt_teleporter_start", fx_array[i].origin );
    fx_array[i] PlayLoopSound( "evt_teleporter_loop", 1.75 );
    }
    }
    else if( !set && level.packtime[ClientNum] == false)
    {
    level notify("end_cool_downs");
    println("*** Client : pack portal fx on. ", ClientNum);
    level.packtime[ClientNum] = true;

    for ( i = 0; i < fx_array.size; i++ )
    {
    if(IsDefined(fx_array[i].portalfx))
    {
    deletefx(ClientNum, fx_array[i].portalfx);
    }

    wait(0.01);
    fx_array[i].portalfx = PlayFXOnTag(ClientNum,level.pack_effect, fx_array[i],"tag_origin" );
    fx_array[i] thread play_packa_special_looper(ClientNum);
    }
    }
    }

    //-------------------------------------------------------------------------------
    teleporter_fx_cool_down(ClientNum)
    {

    while(true)
    {

    level waittill("cool_fx", ClientNum);

    players = GetLocalPlayers();

    if(level.packtime[ClientNum] == false)
    {
    // find closest possible current fx point.
    fx_pos = undefined;
    closest = 512;

    for ( i = 0; i < level.fxents[ClientNum].size; i++ )
    {
    if(IsDefined(level.fxents[ClientNum][i]))
    {
    if(closest > Distance(level.fxents[ClientNum][i].origin, players[ClientNum].origin))
    {
    closest = Distance(level.fxents[ClientNum][i].origin, players[ClientNum].origin);
    fx_pos = level.fxents[ClientNum][i];
    }
    }
    }

    if(IsDefined(fx_pos)&& IsDefined(fx_pos.portalfx))
    {
    deletefx(ClientNum, fx_pos.portalfx);
    fx_pos.portalfx = PlayFXOnTag(ClientNum,level._effect["zombie_pent_portal_cool"], fx_pos,"tag_origin" );

    self thread turn_off_cool_down_fx(fx_pos, ClientNum);

    }
    }
    wait(0.1);
    }
    }

    turn_off_cool_down_fx(fx_pos, ClientNum)
    {
    fx_pos thread cool_down_timer();
    fx_pos waittill("cool_down_over");

    if(IsDefined(fx_pos) && IsDefined(fx_pos.portalfx))
    {
    deletefx(ClientNum, fx_pos.portalfx);
    if(level.packtime[ClientNum] == false)
    {
    fx_pos.portalfx = PlayFXOnTag(ClientNum,level.portal_effect, fx_pos,"tag_origin" );
    }
    else
    {
    fx_pos.portalfx = PlayFXOnTag(ClientNum,level.pack_effect, fx_pos,"tag_origin" );
    }
    }
    }

    cool_down_timer()
    {
    time = 0;
    self.defcon_active = false;
    self thread pack_cooldown_listener();
    while(!self.defcon_active && time < 20 )
    {
    wait(1);
    time++;
    }
    self notify("cool_down_over");
    }

    pack_cooldown_listener()
    {
    self endon ("cool_down_over");

    level waittill("end_cool_downs");
    self.defcon_active = true;
    }
    //-------------------------------------------------------------------------------
    wait_for_teleport_aftereffect()
    {
    while( true )
    {
    level waittill( "ae1", ClientNum );

    VisionSetNaked( ClientNum, "flare", 0.4 );
    }
    }

    play_packa_special_looper(ClientNum)
    {
    self PlayLoopSound( "mus_packapunch_special", 1 );
    level waittill( "pack_portal_fx_off", ClientNum );
    self stoploopsound( 1 );
    }

    0 Not allowed! Not allowed!
    Last edited by FLow Trix; 07-27-2011 at 04:36 PM.

  2. #2
    Member FLow Trix's Avatar
    Join Date
    Jul 2011
    Location
    FL
    Posts
    70
    Points
    107
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    FL
    Posts
    70
    Points
    107
    Gamer IDs

    Gamertag: Flow Trix

    Default

    this is the script for pentagon map on zombies

    0 Not allowed! Not allowed!
    Last edited by FLow Trix; 07-26-2011 at 05:11 PM.

  3. #3
    Member
    Join Date
    Apr 2011
    Posts
    173
    Points
    272
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Posts
    173
    Points
    272

    Default

    How would this be put into black ops exactly. cause it's a map correct?

    0 Not allowed! Not allowed!

  4. #4
    Member FLow Trix's Avatar
    Join Date
    Jul 2011
    Location
    FL
    Posts
    70
    Points
    107
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    FL
    Posts
    70
    Points
    107
    Gamer IDs

    Gamertag: Flow Trix

    Default

    I have no ideal I came across it and I just thought maybe somebody could use the files but you cant find these files on the iso I found this online and inside the black ops iso there seems to be images for the map pentagon just no script I would do it but I cant find out how to add files into the ff file

    0 Not allowed! Not allowed!

  5. #5
    I <3 Lax Badboy's Avatar
    Join Date
    Jun 2011
    Location
    Nu Yawk
    Posts
    868
    Points
    3,481
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Location
    Nu Yawk
    Posts
    868
    Points
    3,481
    Gamer IDs

    Steam ID: xXArchdukeXx

    Default

    swap out kino and try to play :P (doubt it will work)..how do you view the iso?

    0 Not allowed! Not allowed!

  6. #6
    Member
    Join Date
    Apr 2011
    Posts
    173
    Points
    272
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Posts
    173
    Points
    272

    Default

    But what about the .pak file on the iso has anyone gotten into it yet?

    0 Not allowed! Not allowed!

  7. #7
    Diehard cheatss's Avatar
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766
         User Info     Contact     Gamer ID
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766

    Default

    there are vids of pentagon and other maps to in the iso

    0 Not allowed! Not allowed!

    ^^ awesome signature made by Demo ^^

  8. #8
    Member Melloman420's Avatar
    Join Date
    Apr 2011
    Location
    Las Vegas
    Posts
    174
    Points
    284
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Las Vegas
    Posts
    174
    Points
    284

    Default

    So exciting!

    0 Not allowed! Not allowed!
    :banana::dbanana:

  9. #9
    I <3 Lax Badboy's Avatar
    Join Date
    Jun 2011
    Location
    Nu Yawk
    Posts
    868
    Points
    3,481
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Location
    Nu Yawk
    Posts
    868
    Points
    3,481
    Gamer IDs

    Steam ID: xXArchdukeXx

    Default

    the .pak files are encrypted right?

    0 Not allowed! Not allowed!

  10. #10
    Member FLow Trix's Avatar
    Join Date
    Jul 2011
    Location
    FL
    Posts
    70
    Points
    107
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    FL
    Posts
    70
    Points
    107
    Gamer IDs

    Gamertag: Flow Trix

    Default

    yeah I am try to get it right now once I get it I will post it up so far this is all I have found for pentagon also I have the csc files just ask and I will post them

    zombie_pentagon.gsc

    Code:
    #include common_scripts\utility;
    #include maps\_utility;
    #include maps\_zombiemode_utility;
    #include maps\_zombiemode_zone_manager;
    #include maps\zombie_pentagon_teleporter; 
     
    //#include maps\_zombiemode_protips;
    
    main()
    {
    	maps\zombie_pentagon_fx::main();
    	maps\zombie_pentagon_amb::main();
    	maps\zombie_pentagon_anim::main();
    
    	// ww: this was getting big, made a preacache function
    	level pentagon_precache();
    	
    	PrecacheShader( "zom_icon_trap_switch_handle" ); // ww: hud icon for battery
    	
    	level.dogs_enabled = false;	
    	level.random_pandora_box_start = false;
    	
    	level thread maps\_callbacksetup::SetupCallbacks();
    
    	level.quad_move_speed = 35;
    	//level.quad_traverse_death_fx = ::quad_traverse_death_fx;
    	level.quad_explode = true;
    	
    	level.dog_spawn_func = maps\_zombiemode_ai_dogs::dog_spawn_factory_logic;
    	level.exit_level_func = ::pentagon_exit_level;
    
    	// Special zombie types.
    	level.custom_ai_type = [];
    	level.custom_ai_type = array_add( level.custom_ai_type, maps\_zombiemode_ai_dogs::init );
    	level.custom_ai_type = array_add( level.custom_ai_type, maps\_zombiemode_ai_quad::init );
    	level.custom_ai_type = array_add( level.custom_ai_type, maps\_zombiemode_ai_thief::init );
    
    	level.door_dialog_function = maps\_zombiemode::play_door_dialog;
    
    	include_weapons();
    	include_powerups();
    
    	level.use_zombie_heroes = true;
    	level.disable_protips = 1;
    
    	level.delete_when_in_createfx = ::delete_in_createfx;
    
    	// DO ACTUAL ZOMBIEMODE INIT
    	maps\_zombiemode::main();
    	
    	// Init tv screens
    	level maps\zombie_pentagon_magic_box::magic_box_init();
    
    	// Turn off generic battlechatter - Steve G
    	battlechatter_off("allies");
    	battlechatter_off("axis");
    
    	// Setup the levels Zombie Zone Volumes
    	maps\_compass::setupMiniMap("menu_map_zombie_pentagon"); 
    	level.zone_manager_init_func = ::pentagon_zone_init;
    	init_zones[0] = "conference_level1";
    	level thread maps\_zombiemode_zone_manager::manage_zones( init_zones );
    
    	// DCS: check to setup random spawing per zone.
    	level.random_spawners = true;
    
    	// Init traps
    	level maps\zombie_pentagon_traps::init_traps();
    	level thread maps\_zombiemode_auto_turret::init();
    	level thread maps\zombie_pentagon_elevators::init();
    	level thread electric_switch();
    	level thread enable_zone_elevators_init();
    	level thread maps\zombie_pentagon_teleporter::pentagon_packapunch_init();
    	level thread maps\zombie_pentagon_teleporter::pack_door_init();
    	level thread maps\zombie_pentagon_teleporter::teleporter_power_cable();
    	//level thread zombie_pathing_init();
    	level thread vision_set_init();
    	level thread laststand_bleedout_init();
    	level thread lab_shutters_init();
    	level thread pentagon_brush_lights_init();
    	
    	//bonfire_init
    	level.bonfire_init_func = ::pentagon_bonfire_init;
    
    	init_sounds();
    	init_pentagon_client_flags();
    
    	level thread play_starting_vox();
    }
    //-------------------------------------------------------------------------------
    // DCS 091510: init pentagon client flags.
    //-------------------------------------------------------------------------------
    init_pentagon_client_flags()
    {
    	level.ZOMBIE_PENTAGON_PLAYER_PORTALFX = 5;
    	level.ZOMBIE_PENTAGON_PLAYER_PORTALFX_COOL = 6;
    }
    //-------------------------------------------------------------------------------
    
    delete_in_createfx()
    {
    	if ( GetDvar( #"createfx" ) != "" )
    	{
    		exterior_goals = getstructarray( "exterior_goal", "targetname" );
    		for( i = 0; i < exterior_goals.size; i++ )
    		{
    			if( !IsDefined( exterior_goals[i].target ) ) // If the exterior_goal entity has no targets defined then return
    			{
    				continue;
    			}
    			targets = GetEntArray( exterior_goals[i].target, "targetname" ); // Grab all the pieces that are targeted by the exterior_goal
    
    			for( j = 0; j < targets.size; j++ ) // count total targets of exterior_goal
    			{
    				if( IsDefined( targets[j].script_parameters ) && targets[j].script_parameters == "repair_board" )
    				{
    					unbroken_section = GetEnt( targets[j].target,"targetname" );
    					if ( IsDefined( unbroken_section ) )
    					{
    						unbroken_section self_delete();
    					}	
    				}
    				
    				targets[j] self_delete();	
    			}
    		}
    		return;
    	}
    }
    
    // *****************************************************************************
    // Zone management
    // *****************************************************************************
    pentagon_zone_init()
    {
    	flag_init( "always_on" );
    	flag_set( "always_on" );
    	
    
    	//Level 1
    	add_adjacent_zone( "conference_level1", "hallway_level1", "conf1_hall1" );	
    	add_adjacent_zone( "hallway3_level1", "hallway_level1", "conf1_hall1" );	
    
    	// Only used between pack room and war room (special one way) 
    	add_adjacent_zone( "conference_level2", "war_room_zone_south", "war_room_entry", true );
    	add_adjacent_zone( "conference_level2", "war_room_zone_north", "war_room_special", true );
    
    	
    	// Level 2
    	add_adjacent_zone( "war_room_zone_top", "war_room_zone_south", "war_room_stair" );	
    	add_adjacent_zone( "war_room_zone_top", "war_room_zone_north", "war_room_stair" );
    	add_adjacent_zone( "war_room_zone_south", "war_room_zone_north", "war_room_stair" );	
    	add_adjacent_zone( "war_room_zone_south", "war_room_zone_north", "war_room_west" );	
    
    	//special elevator spawns
    	add_adjacent_zone( "war_room_zone_north", "war_room_zone_elevator", "war_room_elevator" );	
    	
    	//level 3
    	add_adjacent_zone( "labs_elevator", "labs_hallway1", "labs_enabled" );	
    	add_adjacent_zone( "labs_hallway1", "labs_hallway2", "labs_enabled" );	
    	
    	add_adjacent_zone( "labs_hallway2", "labs_zone1", "lab1_level3" );	
    	add_adjacent_zone( "labs_hallway1", "labs_zone2", "lab2_level3" );
    	add_adjacent_zone( "labs_hallway2", "labs_zone2", "lab2_level3" );	
    	add_adjacent_zone( "labs_hallway1", "labs_zone3", "lab3_level3" );	
    	
    	// DCS: if random spawner set to true, reduce randomly to this number of active spawners.
    	level.zones["conference_level1"].num_spawners = 4;
    	level.zones["hallway_level1"].num_spawners = 4;
    	//level.zones["hallway2_level1"].num_spawners = 2;	
    }
    
    //-------------------------------------------------------------------------------
    // zone enable through elevators
    //-------------------------------------------------------------------------------
    enable_zone_elevators_init()
    {
    	elev_zone_trig = GetEnt( "elevator1_down_riders", "targetname" );
    	elev_zone_trig thread maps\zombie_pentagon_teleporter::enable_zone_portals();
    
    	elev_zone_trig2 = GetEnt( "elevator2_down_riders", "targetname" );
    	elev_zone_trig2 thread maps\zombie_pentagon_teleporter::enable_zone_portals();	
    }
    
    //*****************************************************************************
    // WEAPON FUNCTIONS
    //
    // Include the weapons that are only in your level so that the cost/hints are accurate
    // Also adds these weapons to the random treasure chest.
    // Copy all include_weapon lines over to the level.csc file too - removing the weighting funcs...
    //*****************************************************************************
    
    include_weapons()
    {
    	include_weapon( "frag_grenade_zm", false, true );
    	include_weapon( "claymore_zm", false, true );
    
    	//	Weapons - Pistols
    	include_weapon( "m1911_zm", false );						// colt
    	include_weapon( "m1911_upgraded_zm", false );
    	include_weapon( "python_zm" );						// 357
    	include_weapon( "python_upgraded_zm", false );
      	include_weapon( "cz75_zm" );
      	include_weapon( "cz75_upgraded_zm", false );
    
    	//	Weapons - Semi-Auto Rifles
    	include_weapon( "m14_zm", false, true );							// gewehr43
    	include_weapon( "m14_upgraded_zm", false );
    
    	//	Weapons - Burst Rifles
    	include_weapon( "m16_zm", false, true );						
    	include_weapon( "m16_gl_upgraded_zm", false );
    	include_weapon( "g11_lps_zm" );
    	include_weapon( "g11_lps_upgraded_zm", false );
    	include_weapon( "famas_zm" );
    	include_weapon( "famas_upgraded_zm", false );
    
    	//	Weapons - SMGs
    	include_weapon( "ak74u_zm", false, true );						// thompson, mp40, bar
    	include_weapon( "ak74u_upgraded_zm", false );
    	include_weapon( "mp5k_zm", false, true );
    	include_weapon( "mp5k_upgraded_zm", false );
    	include_weapon( "mpl_zm", false, true );
    	include_weapon( "mpl_upgraded_zm", false );
    	include_weapon( "pm63_zm", false, true );
    	include_weapon( "pm63_upgraded_zm", false );
    	include_weapon( "spectre_zm" );
    	include_weapon( "spectre_upgraded_zm", false );
    
    	//	Weapons - Dual Wield
      	include_weapon( "cz75dw_zm" );
      	include_weapon( "cz75dw_upgraded_zm", false );
    
    	//	Weapons - Shotguns
    	include_weapon( "ithaca_zm", false, true );						// shotgun
    	include_weapon( "ithaca_upgraded_zm", false );
    	include_weapon( "rottweil72_zm", false, true );
    	include_weapon( "rottweil72_upgraded_zm", false );
    	include_weapon( "spas_zm" );						// 
    	include_weapon( "spas_upgraded_zm", false );
    	include_weapon( "hs10_zm" );
    	include_weapon( "hs10_upgraded_zm", false );
    
    	//	Weapons - Assault Rifles
    	include_weapon( "aug_acog_zm" );
    	include_weapon( "aug_acog_mk_upgraded_zm", false );
    	include_weapon( "galil_zm" );
    	include_weapon( "galil_upgraded_zm", false );
    	include_weapon( "commando_zm" );
    	include_weapon( "commando_upgraded_zm", false );
    	include_weapon( "fnfal_zm" );
    	include_weapon( "fnfal_upgraded_zm", false );
    
    	//	Weapons - Sniper Rifles
    	include_weapon( "dragunov_zm" );					// ptrs41
    	include_weapon( "dragunov_upgraded_zm", false );
    	include_weapon( "l96a1_zm" );
    	include_weapon( "l96a1_upgraded_zm", false );
    
    	//	Weapons - Machineguns
    	include_weapon( "rpk_zm" );							// mg42, 30 cal, ppsh
    	include_weapon( "rpk_upgraded_zm", false );
    	include_weapon( "hk21_zm" );
    	include_weapon( "hk21_upgraded_zm", false );
    
    	//	Weapons - Misc
    	include_weapon( "m72_law_zm" );
    	include_weapon( "m72_law_upgraded_zm", false );
    	include_weapon( "china_lake_zm" );
    	include_weapon( "china_lake_upgraded_zm", false );
    
    	//	Weapons - Special
    	include_weapon( "zombie_cymbal_monkey" );
    	include_weapon( "ray_gun_zm" );
    	include_weapon( "ray_gun_upgraded_zm", false );
    	include_weapon( "freezegun_zm" );
    	include_weapon( "freezegun_upgraded_zm", false );
    	include_weapon( "crossbow_explosive_zm" );
    	include_weapon( "crossbow_explosive_upgraded_zm", false );
    
    	include_weapon( "knife_ballistic_zm", true );
    	include_weapon( "knife_ballistic_upgraded_zm", false );
    	include_weapon( "knife_ballistic_bowie_zm", false );
    	include_weapon( "knife_ballistic_bowie_upgraded_zm", false );
    	level._uses_retrievable_ballisitic_knives = true;
    
    	// limited weapons
    	maps\_zombiemode_weapons::add_limited_weapon( "m1911_zm", 0 );
    	maps\_zombiemode_weapons::add_limited_weapon( "freezegun_zm", 1 );
    	maps\_zombiemode_weapons::add_limited_weapon( "crossbow_explosive_zm", 1 );
    	maps\_zombiemode_weapons::add_limited_weapon( "knife_ballistic_zm", 1 );
    
    	precacheItem( "explosive_bolt_zm" );
    	precacheItem( "explosive_bolt_upgraded_zm" );
    	
    	// get the bowie into the collector achievement list
    	level.collector_achievement_weapons = array_add( level.collector_achievement_weapons, "bowie_knife_zm" );
    }
    
    
    //*****************************************************************************
    // POWERUP FUNCTIONS
    //*****************************************************************************
    
    include_powerups()
    {
    	include_powerup( "nuke" );
    	include_powerup( "insta_kill" );
    	include_powerup( "double_points" );
    	include_powerup( "full_ammo" );
    	include_powerup( "carpenter" );
    	include_powerup( "fire_sale" );
    	include_powerup( "bonfire_sale" );
    	
    	// minigun
    	PreCacheItem( "minigun_zm" );
    	
    	include_powerup( "minigun" );
    }
    
    //*****************************************************************************
    // ELECTRIC SWITCH
    // once this is used, it activates other objects in the map
    // and makes them available to use
    //*****************************************************************************
    electric_switch()
    {
    	trig = getent("use_elec_switch","targetname");
    	trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");
    	trig setcursorhint( "HINT_NOICON" );
    
    	level thread wait_for_power();
    
    	trig waittill("trigger",user);
    
    	trig delete();	
    	flag_set( "power_on" );
    	Objective_State(8,"done");
    }
    
    
    //
    //	Wait for the power_on flag to be set.  This is needed to work in conjunction with
    //		the devgui cheat.
    //
    wait_for_power()
    {
    	master_switch = getent("elec_switch","targetname");	
    	master_switch notsolid();
    
    	flag_wait( "power_on" );
    
    	exploder(3500);
    
    	//light_exploders.
    	stop_exploder(2000);
    	exploder(2001);
    
    	level thread regular_portal_fx_on();
    	level thread maps\zombie_pentagon::change_pentagon_vision();
    
    	master_switch rotateroll(-90,.3);
    	master_switch playsound("zmb_switch_flip");
    
    	// Set Perk Machine Notifys
    	level notify("revive_on");
    	level notify("juggernog_on");
    	level notify("sleight_on");
    	level notify("doubletap_on");
    	level notify("Pack_A_Punch_on" );
    	
    	// DSL - putting these together into 1 single client notify - redispatching them all as level notifies on the client.
    	
    /*	clientnotify( "power_on" );	
    
    	clientnotify("revive_on");
    	clientnotify("middle_door_open");
    	clientnotify("fast_reload_on");
    	clientnotify("doubletap_on");
    	clientnotify("jugger_on");	*/
    	
    	clientnotify("ZPO");	 // Zombie Power On.
    	
    	//get the teleporter ready
    	maps\zombie_pentagon_teleporter::teleporter_init();		
    	
    	master_switch waittill("rotatedone");
    	playfx(level._effect["switch_sparks"] ,getstruct("elec_switch_fx","targetname").origin);
    	
    	//Sound - Shawn J  - adding temp sound to looping sparks & turning on power sources
    	master_switch playsound("zmb_turn_on");
    	
    	level thread maps\zombie_pentagon_amb::play_pentagon_announcer_vox( "zmb_vox_pentann_poweron" );
    }
    
    //*****************************************************************************
    //AUDIO
    //*****************************************************************************
    
    init_sounds()
    {
    	maps\_zombiemode_utility::add_sound( "wood_door_fall", "zmb_wooden_door_fall" );
    	maps\_zombiemode_utility::add_sound( "window_grate", "zmb_window_grate_slide" );
    	maps\_zombiemode_utility::add_sound( "lab_door", "zmb_lab_door_slide" );
    	maps\_zombiemode_utility::add_sound( "lab_door_swing", "zmb_door_wood_open" );
    }
    
    //*****************************************************************************
    // Quad death copied from theater
    //*****************************************************************************
    
    quad_traverse_death_fx()
    {
    	self endon("quad_end_traverse_anim");
    	self waittill( "death" );
    
    	playfx(level._effect["quad_grnd_dust_spwnr"], self.origin);
    }
    //-------------------------------------------------------------------------------
    // DCS 082410: cleanup path zombies from floor to floor.
    //-------------------------------------------------------------------------------
    zombie_pathing_init()
    {
    	cleanup_trig = GetEntArray( "zombie_movement_cleanup", "targetname" );
    	for ( i = 0; i < cleanup_trig.size; i++ )
    	{
    		cleanup_trig[i] thread zombie_pathing_cleanup();
    	}
    }	
    zombie_pathing_cleanup()
    {
    	
    	while(true)
    	{
    		self waittill("trigger", who);
    		
    		if(IsDefined(who.animname) && who.animname == "thief_zombie")
    		{
    			continue;
    		}
    		else if(who.team == "axis")
    		{
    			//IPrintLnBold("zombie triggered death!");
    		
    			level.zombie_total++;
    			who DoDamage(who.health + 100, who.origin);
    		}	
    	}
    }	
    //-------------------------------------------------------------------------------
    // DCS: Vision set init and setup
    //-------------------------------------------------------------------------------
    vision_set_init()
    {
    	level waittill( "start_of_round" );
    	
    	exploder(2000);
    	
    	players = getplayers();
    	for ( i = 0; i < players.size; i++ )
    	{
    		players[i] VisionSetNaked("zombie_pentagon", 0.5);
    	}	
    }
    
    change_pentagon_vision()
    {
    	// don't change during thief round. thief script will handle change afterwards.
    	if(flag("thief_round"))
    	{
    		return;
    	}
    	
    	players = get_players();	
    	for ( i = 0; i < players.size; i++ )
    	{
    		players[i].floor = maps\_zombiemode_ai_thief::thief_check_floor( players[i] );
    		setClientSysState( "levelNotify", "vis" + players[i].floor, players[i] );
    		wait_network_frame();			
    	}	
    }	
    
    //-------------------------------------------------------------------------------
    // DCS 090310: wait for last stand, check floors for zombie movement.
    //-------------------------------------------------------------------------------
    laststand_bleedout_init()
    {
    	flag_wait( "all_players_connected" ); 
    	players = get_players();
    	if(players.size > 1)
    	{
    		for ( i = 0; i < players.size; i++ )
    		{
    			players[i] thread wait_for_laststand_notify();
    			players[i] thread bleedout_listener();
    		}
    	}	
    }	
    	
    wait_for_laststand_notify()
    {
    	self endon("disconnect");
    
    	while(true)
    	{
    		num_on_floor = 0;		
    		num_floor_laststand = 0;
    		
    		self waittill( "player_downed" );
    		
    		while(self maps\_laststand::player_is_in_laststand())
    		{
    			self.floor = maps\_zombiemode_ai_thief::thief_check_floor( self );
    			current_floor = self.floor;		
    	
    			players = get_players();
    			for ( i = 0; i < players.size; i++ )
    			{
    				players[i].floor = maps\_zombiemode_ai_thief::thief_check_floor( players[i] );
    				if(players[i].floor == current_floor)
    				{
    					num_on_floor++;
    					if(players[i] maps\_laststand::player_is_in_laststand())
    					{
    						num_floor_laststand++;
    					}	
    				}
    			}
    			
    			wait_network_frame();
    			if(players.size > 1 && num_on_floor == num_floor_laststand)
    			{
    				self thread maps\zombie_pentagon_elevators::laststand_elev_zombies_away();
    			}
    			wait(5);
    		}		
    	}
    }
    //-------------------------------------------------------------------------------
    // DCS 092510: Bleedout listener, to cleanup floors when a player bleeds out.
    //-------------------------------------------------------------------------------
    bleedout_listener()
    {
    	while(true)
    	{	
    		self waittill( "spawned_spectator" );
    
    		wait(2);
    
    		level thread check_if_empty_floors();
    		
    		wait(1);
    	}
    }
    
    //-------------------------------------------------------------------------------
    // DCS 091310:	Bonfire powerup init
    //-------------------------------------------------------------------------------		
    pentagon_bonfire_init()
    {
    	// portals already available, and no one entered pack room yet.
    	if(flag("defcon_active") && level.defcon_activated == false)
    	{
    		return;		
    	}
    	else if(flag("defcon_active") && level.defcon_activated == true) // if someone in room reset countdown
    	{
    		level.defcon_countdown_time = 30;
    		level.defcon_level = 5;
    		return;
    	}		
    
    	current_defcon_level = level.defcon_level;
    	punch_switches = GetEntArray("punch_switch","targetname");
    	signs = GetEntArray("defcon_sign", "targetname");
    	pack_door_slam = GetEnt("slam_pack_door","targetname");
    
    	flag_set("bonfire_reset");
    
    	//----------------------
    	//force reset.
    	level.defcon_level = 1;
    	level notify("pack_room_reset");
    	
    	wait(0.1);
    
    	if(IsDefined(punch_switches))
    	{
    		for ( i = 0; i < punch_switches.size; i++ )
    		{
    			punch_switches[i] notify( "trigger" );
    			wait( 0.5 );
    		}
    	}
    	//----------------------
    
    	if(level.zones["conference_level2"].is_occupied)
    	{
    		//level notify("defcon_reset");
    
    		wait(1);
    		level thread start_defcon_countdown();
    	}
    
    	level waittill( "bonfire_sale_off" );
    	
    	//someone entered pack room or is currently in the pack room.
    	if(	level.defcon_activated == true || level.zones["conference_level2"].is_occupied)
    	{
    		return;
    	}
    	else // otherwise reset pack room and portals, times up!
    	{
    		flag_clear("defcon_active");
    		
    		level thread regular_portal_fx_on();
    
    		level.defcon_level = 1;
    		level notify("pack_room_reset");
    
    		level thread defcon_sign_lights();
    	}	
    	flag_clear("bonfire_reset");
    }
    	
    //-------------------------------------------------------------------------------
    // DCS 090710:	setup shutter to work independent of doors.	
    //							close shutters for tech round.
    //-------------------------------------------------------------------------------
    lab_shutters_init()
    {
    	shutters = GetEntArray("lab_shutter","script_noteworthy");
    	if(IsDefined(shutters))
    	{
    		for ( i = 0; i < shutters.size; i++ )
    		{
    			shutters[i] thread lab_shutters_think();
    		}	
    	}	
    }	
    lab_shutters_think()
    {
    	door_pos = self.origin;
    	time = 1;	
    	scale = 1;
    			
    	if(IsDefined(self.script_flag) && !flag(self.script_flag))
    	{
    		flag_wait(self.script_flag);
    		if(flag("thief_round"))
    		{
    				while(flag("thief_round"))
    				{
    					wait(0.5);
    				}	
    		}
    		
    		if(isDefined(self.script_vector))
    		{
    			vector = vector_scale( self.script_vector, scale );
    			thief_vector = vector_scale( self.script_vector, .2 );
    			while(true)
    			{
    				self MoveTo( door_pos + vector, time, time * 0.25, time * 0.25 ); 
    				self thread maps\_zombiemode_blockers::door_solid_thread();
    			
    				flag_wait("thief_round");
    				//IPrintLnBold("start_thief_round");
    				self MoveTo( door_pos + thief_vector, time, time * 0.25, time * 0.25 ); 
    				self thread maps\_zombiemode_blockers::door_solid_thread(); 
    	
    				while(flag("thief_round"))
    				{
    					wait(0.5);
    				}	
    	
    				//level waittill( "between_round_over" );
    				//IPrintLnBold("end_thief_round");
    			}
    		}
    	}		
    }	
    
    play_starting_vox()
    {
        flag_wait( "all_players_connected" );
        level thread maps\zombie_pentagon_amb::play_pentagon_announcer_vox( "zmb_vox_pentann_levelstart" );
    }
    
    // WW: script brush model lights for the office floor
    pentagon_brush_lights_init()
    {
    	// sbrush lights
    	sbrush_office_ceiling_lights_off = GetEntArray( "sbrushmodel_interior_office_lights", "targetname" );
    	
    	if( IsDefined( sbrush_office_ceiling_lights_off ) && sbrush_office_ceiling_lights_off.size > 0 )
    	{
    		array_thread( sbrush_office_ceiling_lights_off, ::pentagon_brush_lights );	
    	}
    }
    
    // WW: switches the on version for the off version when power hits
    pentagon_brush_lights()
    {
    	if( !IsDefined( self.target ) )
    	{
    		return;
    	}
    	
    	self.off_version = GetEnt( self.target, "targetname" );
    	
    	self.off_version Hide();
    	
    	flag_wait( "power_on" );
    	
    	self Hide();
    	self.off_version Show();
    	
    }
    
    //******************************************************************************
    // PRECACHE FUNCTION
    //******************************************************************************
    pentagon_precache()
    {
    	// models for the old school electric trap
    	PreCacheModel("zombie_zapper_cagelight_red");
    	precachemodel("zombie_zapper_cagelight_green");
    	
    	// shell shock when walking through an active electric trap
    	PreCacheShellShock( "electrocution" );
    	
    	// ww: temp viewmodel arms for pentagon until we get the right ones
    	PreCacheModel( "viewmodel_usa_pow_arms" ); // TEMP
    	// TODO: PUT THE REAL VIEWMODEL ARMS IN FOR PENTAGON
    	// ww: these pieces are used for the death-con switches
    	PreCacheModel( "zombie_trap_switch" );
    	PreCacheModel( "zombie_trap_switch_light" );
    	PreCacheModel( "zombie_trap_switch_light_on_green" );
    	PreCacheModel( "zombie_trap_switch_light_on_red" );
    	PreCacheModel( "zombie_trap_switch_handle" );
    	
    	// ww: therse pieces are used for the magic box televisions. the models are changed in csc
    	PreCacheModel( "p_zom_monitor_screen_fsale1" );
    	PreCacheModel( "p_zom_monitor_screen_fsale2" );
    	PreCacheModel( "p_zom_monitor_screen_labs0" );
    	PreCacheModel( "p_zom_monitor_screen_labs1" );
    	PreCacheModel( "p_zom_monitor_screen_labs2" );
    	PreCacheModel( "p_zom_monitor_screen_labs3" );
    	PreCacheModel( "p_zom_monitor_screen_lobby0" );
    	PreCacheModel( "p_zom_monitor_screen_lobby1" );
    	PreCacheModel( "p_zom_monitor_screen_lobby2" );
    	PreCacheModel( "p_zom_monitor_screen_logo" );
    	PreCacheModel( "p_zom_monitor_screen_off" );
    	PreCacheModel( "p_zom_monitor_screen_on" );
    	PreCacheModel( "p_zom_monitor_screen_warroom0" );
    	PreCacheModel( "p_zom_monitor_screen_warroom1" );
    	
    	// WW: light models for the "power_on" swap. actual swap is in .csc
    	PreCacheModel( "p_pent_light_ceiling" );
    	PreCacheModel( "p_pent_light_tinhat_off" );
    	// DSM: spinning lights in the labs
    	PreCacheModel( "p_rus_rb_lab_warning_light_01" );
    	PreCacheModel( "p_rus_rb_lab_warning_light_01_off" );
    	PreCacheModel( "p_rus_rb_lab_light_core_on" );
    	PreCacheModel( "p_rus_rb_lab_light_core_off" );
    	
    	
    	//defcon sign models
    	PreCacheModel( "p_zom_pent_defcon_sign_02" );
    	PreCacheModel( "p_zom_pent_defcon_sign_03" );
    	PreCacheModel( "p_zom_pent_defcon_sign_04" );
    	PreCacheModel( "p_zom_pent_defcon_sign_05" );
    
    }
    
    pentagon_exit_level()
    {
    	zombies = GetAiArray( "axis" );
    	for ( i = 0; i < zombies.size; i++ )
    	{
    		// thief goes after player in last stand
    		if ( zombies[i].animname == "thief_zombie" )
    		{
    			continue;
    		}
    		else
    		{
    			zombies[i] thread pentagon_find_exit_point();
    		}
    	}
    }
    
    pentagon_find_exit_point()
    {
    	self endon( "death" );
    
    	player = getplayers()[0];
    
    	dist_zombie = 0;
    	dist_player = 0;
    	dest = 0;
    
    	away = VectorNormalize( self.origin - player.origin );
    	endPos = self.origin + vector_scale( away, 600 );
    
    	locs = array_randomize( level.enemy_dog_locations );
    
    	for ( i = 0; i < locs.size; i++ )
    	{
    		dist_zombie = DistanceSquared( locs[i].origin, endPos );
    		dist_player = DistanceSquared( locs[i].origin, player.origin );
    
    		if ( dist_zombie < dist_player )
    		{
    			dest = i;
    			break;
    		}
    	}
    
    	self notify( "stop_find_flesh" );
    	self notify( "zombie_acquire_enemy" );
    
    	self setgoalpos( locs[dest].origin );
    
    	while ( 1 )
    	{
    		if ( !flag( "wait_and_revive" ) )
    		{
    			break;
    		}
    		wait_network_frame();
    	}
    	
    	self thread maps\_zombiemode_spawner::find_flesh();
    }
    zombie_pentagon_amb.gsc

    Code:
    //
    // file: zombie_pentagon_amb.gsc
    // description: level ambience script for zombie_pentagon
    // scripter: 
    //
    
    #include maps\_utility;
    #include common_scripts\utility;
    #include maps\_zombiemode_utility;
    #include animscripts\zombie_Utility;
    #include maps\_ambientpackage;
    
    
    main()
    {
    	level thread setup_phone_audio();
    }
    //-------------------------------------------------------------------------------
    // base function for easter egg phones in zombie pentagon.
    //-------------------------------------------------------------------------------
    setup_phone_audio()
    {
        wait(1);
        level.phone_counter = 0;
        array_thread( GetEntArray( "secret_phone_trig", "targetname" ), ::phone_egg );
    }
    phone_egg()
    {
    	if( !isdefined( self ) )
    	{
    		return;
    	}	
    	phone = GetEnt(self.target, "targetname");
    	if(IsDefined(phone))
    	{
    		blinky = PlayFXOnTag( level._effect["fx_zombie_light_glow_telephone"], phone, "tag_light" );
    	}	
    	self UseTriggerRequireLookAt();
    	self SetCursorHint( "HINT_NOICON" ); 
    	self PlayLoopSound( "zmb_egg_phone_loop" );
    		
    	self waittill( "trigger", player );
    	
    	self StopLoopSound( 1 );
    	player PlaySound( "zmb_egg_phone_activate" );
    		
    	level.phone_counter = level.phone_counter + 1;
    	
    	if( level.phone_counter == 3 )
    	{ 
    			level pentagon_unlock_doa();
    	    playsoundatposition( "evt_doa_unlock", (0,0,0) );
    	    wait(5);
    	    level thread play_music_easter_egg();
    	}
    }
    play_music_easter_egg()
    {
    	level.music_override = true;
    	
    	if( is_mature() )
    	{
    	    level thread maps\_zombiemode_audio::change_zombie_music( "egg" );
    	}
    	else
    	{
    	    //UNTIL WE GET THE SAFE VERSION OF THE SONG, THIS EASTER EGG WILL DO NOTHING FOR PEOPLE IN SAFE MODE
    	    level.music_override = false;
    	    return;
    	    //level thread maps\_zombiemode_audio::change_zombie_music( "egg_safe" );
    	}
    	
    	wait(265);	
    	level.music_override = false;
    	level thread maps\_zombiemode_audio::change_zombie_music( "wave_loop" );
    }
    //-------------------------------------------------------------------------------
    
    play_pentagon_announcer_vox( alias, defcon_level )
    {
    	if( !IsDefined( alias ) )
    		return;
    	
    	if( !IsDefined( level.pentann_is_speaking ) )
    	{
    		level.pentann_is_speaking = 0;
    	}
    	
    	if( IsDefined( defcon_level ) )
    	    alias = alias + "_" + defcon_level;
    	
    	if( level.pentann_is_speaking == 0 )
    	{
    		level.pentann_is_speaking = 1;
    		level play_initial_alarm();
    		level play_sound_2D( alias );
    		level.pentann_is_speaking =0;
    	}
    }
    
    play_initial_alarm()
    {
        structs = getstructarray( "defcon_alarms", "targetname" );
        
        for(i=0;i<structs.size;i++)
        {
            playsoundatposition( "evt_thief_alarm_single", structs[i].origin );
        }
        
        wait(.5);
    }
    
    // ww: unlocks doa for all players upon finding the easter egg
    pentagon_unlock_doa()
    {
    	level.ZOMBIE_PENTAGON_PLAYER_CF_UPDATEPROFILE = 0;
    	
    	players = get_players();
    	
    	array_thread( players, ::pentagon_delay_update );
    }
    
    // ww: updates gamer profile
    pentagon_delay_update()
    {
    	self endon( "death" );
    	self endon( "disconnect" );
    	
    	self SetClientDvars( "zombietron_discovered", 1 );
    	
    	wait( 0.2 );
    	
    	self SetClientFlag( level.ZOMBIE_PENTAGON_PLAYER_CF_UPDATEPROFILE );
    }
    zombies_pentagon_anim.gsc
    Code:
    #include maps\_utility;
    #include maps\_anim;
    #include common_scripts\utility;
    
    #using_animtree( "critter" );
    main()
    {
    	level.scr_anim[ "pig" ][ "pig_hoist_squirm" ][0]	= %a_rebirth_pig_hoist_squirm;
    	level.scr_anim[ "pig" ][ "pig_hoist_death" ]	= %a_rebirth_pig_hoist_death;
    	level.scr_anim[ "pig" ][ "pig_hoist_deathpose" ][0]	= %a_rebirth_pig_hoist_deathpose;
    	
    	level thread lab_pigs();	
    }
    
    // Animate the pig in the hoist
    #using_animtree( "critter" );
    lab_pigs()
    {
    	level waittill( "start_of_round" );
    
    	hoist_piggy = getent("hoist_pig","targetname");
    
    	hoist_pig_struct_model = Spawn("script_model", hoist_piggy.origin + (0, 0, 22));
    	hoist_pig_struct_model.angles = hoist_piggy.angles + (0, -90, 0);
    	hoist_pig_struct_model SetModel( "tag_origin" );
    
    	hoist_piggy LinkTo(hoist_pig_struct_model);
    	hoist_piggy.animname = "pig";
    	hoist_piggy UseAnimTree( #animtree );
    	
    	hoist_pig_struct_model thread anim_loop( hoist_piggy, "pig_hoist_squirm", "stop_squirming" );
    	
    	hoist_piggy SetCanDamage( true );
    	hoist_piggy.health = 99999;
    	
    	hoist_piggy thread pig_audio();
    	
    	hoist_piggy waittill ( "damage", damage, attacker, direction_vec, point);
    	
    	hoist_piggy StopSounds();
    	hoist_piggy PlaySound( "amb_pig_death" );
    	
    	hoist_piggy notify( "stop_squirming" );
    	hoist_pig_struct_model anim_single( hoist_piggy, "pig_hoist_death" );
    	hoist_pig_struct_model anim_loop( hoist_piggy, "pig_hoist_deathpose" );
    }
    
    pig_audio()
    {
        self endon( "stop_squirming" );
        
        while(1)
        {
            self PlaySound( "amb_pig", "sounddone" );
            self waittill( "sounddone" );
            wait(RandomFloatRange( .75, 1.75 ) );
        }
    }
    zombie_pentagon_elevators.gsc

    Code:
    #include animscripts\zombie_utility;
    #include common_scripts\utility;
    #include maps\_utility;
    #include maps\_zombiemode_utility;
    #include maps\zombie_pentagon_teleporter;
    
    init()
    {
    	//flag intitializations.
    	flag_init("defcon_active");
    	flag_init("no_pack_room_spawning");	
    	flag_init("open_pack_hideaway");
    	flag_init( "labs_enabled" );
    	flag_init("bonfire_reset");
    	flag_init("elevator_grounded");
    	flag_init( "war_room_start" ); // ww: flag for war room achievement
    	flag_init("no_warroom_elevator_spawning");
    	flag_init("no_labs_elevator_spawning");
    
    	elevator1 = getent( "elevator1", "targetname" );
    	elevator2 = getent( "elevator2", "targetname" );
    
    	elevator1.cost = 250;	// rsh071510 - can have independent cost
    	elevator1.station = "elevator1_up";
    	elevator1.called = false;
    	elevator1.active = false;
    	elevator1.travel_up = elevator1.origin; // DCS 082210: hard coding the positions
    	elevator1.travel_down = elevator1.origin - (0, 0, 201);
    
    	elevator2.cost = 250;	// rsh071510 - can have independent cost
    	elevator2.station = "elevator2_up";
    	elevator2.called = false;
    	elevator2.active = false;
    	elevator2.travel_up = elevator2.origin; // DCS 082210: hard coding the positions
    	elevator2.travel_down = elevator2.origin - (0, 0, 320);
    
    	elevator1 link_pieces();
    	elevator1 init_elevator1_doors();
    	elevator1 init_buy();
    	elevator1 init_call_boxes();
    
    	elevator2 link_pieces();
    	elevator2 init_elevator2_doors();
    	elevator2 init_buy();
    	elevator2 init_call_boxes();
    
    	wait_network_frame();
    	elevator1 enable_callboxes();
    	elevator1 block_elev_doors( false );
    	elevator1 open_elev_doors();
    
    	elevator2 enable_callboxes();
    	elevator2 block_elev_doors( false );
    	elevator2 open_elev_doors();
    
    	//Playing Muzak in the elevator at all times
    	elevator2 PlayLoopSound( "mus_elevator_muzak" );
    	elevator1 thread elevator1_3d_audio();
    	elevator2 thread elevator2_3d_audio();
    }
    
    
    //---------------------------------------------------------------------------
    // attach all the elevator pieces, this includes spots for the players
    //---------------------------------------------------------------------------
    link_pieces()
    {
    	pieces = GetEntArray( self.target, "targetname" );
    
    	for ( i = 0; i < pieces.size; i++ )
    	{
    		if(IsDefined(pieces[i].classname) && pieces[i].classname == "trigger_use" || pieces[i].classname == "trigger_multiple")
    		{
    			pieces[i] EnableLinkTo();
    		}	
    		pieces[i] LinkTo( self );
    	}
    }
    
    //---------------------------------------------------------------------------
    // sets up the areas where an elevator can be called for pick up
    //---------------------------------------------------------------------------
    init_call_boxes()
    {
    	trigger = GetEntArray( self.targetname + "_call_box", "targetname" );
    
    	for ( i = 0; i < trigger.size; i++ )
    	{
    		trigger[i] thread call_box_think(self);
    	}
    }
    
    //---------------------------------------------------------------------------
    // handles bringing the zipline back to the call box if it's not there
    //---------------------------------------------------------------------------
    call_box_think(elevator)
    {
    	self setcursorhint( "HINT_NOICON" );
    	self SetHintString( &"ZOMBIE_PENTAGON_CALL_ELEVATOR" );
    	PreCacheString(&"ZOMBIE_PENTAGON_ELEV_BLOCKED");
    
    	while ( 1 )
    	{
    		who = undefined;
    		self waittill( "trigger", who );
    		
    		CleanupSpawnedDynEnts();
    
    		elev_clear = is_elevator_clear(elevator);
    		
    		if(!elev_clear)
    		{
    			play_sound_at_pos( "no_purchase", self.origin );
    			self SetHintString( &"ZOMBIE_PENTAGON_ELEV_BLOCKED" );
    			wait(1.0);
    			self SetHintString( &"ZOMBIE_PENTAGON_CALL_ELEVATOR" );
    
    			//who thread elevator_hint_text(&"ZOMBIE_PENTAGON_ELEV_BLOCKED");
    		}
    		else if(flag("thief_round"))
    		{
    			play_sound_at_pos( "no_purchase", self.origin );
    			self SetHintString( &"ZOMBIE_PENTAGON_PACK_ROOM_DOOR" );
    			wait(1.0);
    			self SetHintString( &"ZOMBIE_PENTAGON_CALL_ELEVATOR" );
    		}
    		else if(elevator.active == true || !who can_buy_elevator())
    		{
    			//Don't allow call while elevator is active.
    			play_sound_at_pos( "no_purchase", self.origin );
    		}
    		else
    		{
    			//if elevator not at this floor, calls elevator to this floor.
    			if(	elevator.station != self.script_noteworthy)
    			{		
    				call_destination = self.script_noteworthy;
    				elevator.called = true;
    				elevator.active = true;				
    	
    				elevator disable_callboxes();
    				elevator disable_elevator_buys();				
    				self thread elevator_move_to(elevator);
    			}
    		}	
    		wait( .05 );
    	}
    
    }
    is_elevator_clear(elevator)
    {
    	elevator_door_safety = GetEntArray(elevator.targetname + "_safety","script_noteworthy");
    	players = get_players();
    	
    	if(IsDefined(elevator_door_safety))
    	{
    		for ( i = 0; i < elevator_door_safety.size; i++ )
    		{
    			for ( j = 0; j < players.size; j++ )
    			{
    				if(players[j] IsTouching(elevator_door_safety[i]))
    				return false;
    			}
    		}		
    	}
    	return true;
    }
    block_elev_doors_internal( block, suffix )
    {
    	elevator_door_safety_clip = GetEntArray( self.targetname + suffix, "script_noteworthy" );
    	
    	if ( IsDefined( elevator_door_safety_clip ) )
    	{
    		for ( i = 0; i < elevator_door_safety_clip.size; i++ )
    		{
    			if ( block )
    			{
    				elevator_door_safety_clip[i] Solid();
    			}
    			else
    			{
    				elevator_door_safety_clip[i] NotSolid();
    			}
    		}		
    	}
    }
    block_elev_doors( block )
    {
    	block_elev_doors_internal( block, "_safety_top" );
    	block_elev_doors_internal( block, "_safety_bottom" );
    }
    elevator_hint_text(msg)
    {
    	self endon( "death" ); 
    	self endon( "disconnect" ); 
    
    	text = NewClientHudElem( self ); 
    	text.alignX = "center"; 
    	text.alignY = "middle"; 
    	text.horzAlign = "user_center"; 
    	text.vertAlign = "user_bottom"; 
    	text.foreground = true; 
    	text.font = "default"; 
    	text.fontScale = 1.8; 
    	text.alpha = 0; 
    	text.color = ( 1.0, 1.0, 1.0 ); 
    	text SetText( msg ); 
    
    	text.y = -113; 	
    	if( IsSplitScreen() )
    	{
    		text.y = -137; 
    	}
    
    	text FadeOverTime( 0.1 ); 
    	text.alpha = 1;
    
    	wait(2.0);
    
    	text FadeOverTime( 0.1 ); 
    	text.alpha = 0; 
    }	
    //---------------------------------------------------------------------------
    // setup buy thinks
    //---------------------------------------------------------------------------
    init_buy()
    {
    	trigger = GetEnt( self.targetname + "_buy", "script_noteworthy" );
    	trigger thread elevator_buy_think(self);
    }
    //---------------------------------------------------------------------------
    // handles player purchasing and using the elevator
    //---------------------------------------------------------------------------
    elevator_buy_think(elevator)
    {
    	self setcursorhint( "HINT_NOICON" );
    	self UseTriggerRequireLookAt();
    	self SetHintString( &"ZOMBIE_PENTAGON_USE_ELEVATOR", elevator.cost );
    
    	while ( 1 )
    	{
    		who = undefined;
    		self waittill( "trigger", who );
    		
    		CleanupSpawnedDynEnts();
    
    		elev_clear = is_elevator_clear(elevator);
    		
    		if(!elev_clear)
    		{
    			play_sound_at_pos( "no_purchase", self.origin );
    			self SetHintString( &"ZOMBIE_PENTAGON_ELEV_BLOCKED" );
    			wait(1.0);
    			self SetHintString( &"ZOMBIE_PENTAGON_USE_ELEVATOR", elevator.cost );
    
    			//who thread elevator_hint_text(&"ZOMBIE_PENTAGON_ELEV_BLOCKED");
    		}
    		else if(flag("thief_round"))
    		{
    			play_sound_at_pos( "no_purchase", self.origin );
    			self SetHintString( &"ZOMBIE_PENTAGON_PACK_ROOM_DOOR" );
    			wait(1.0);
    			self SetHintString( &"ZOMBIE_PENTAGON_USE_ELEVATOR", elevator.cost );
    		}		
    		else if ( is_player_valid( who ) && who.score >= elevator.cost && who can_buy_elevator())
    		{
    			elevator.active = true;				
    			who maps\_zombiemode_score::minus_to_player_score( elevator.cost );
    			play_sound_at_pos( "purchase", self.origin );
    
    			elevator disable_callboxes();
    			elevator disable_elevator_buys();
    			
    			// DCS 082010: Now call doors on both sides of elevator 1.
    			call_box_array = GetEntArray( elevator.station, "script_noteworthy" );
    			call_box = call_box_array[0];
    			if(call_box.script_noteworthy == elevator.targetname + "_up")
    			{
    				call_box.destination = elevator.targetname + "_down";
    			}
    			else
    			{
    				call_box.destination = elevator.targetname + "_up";
    			}		
    	
    			//elevator thread redirect_zombies(call_box.destination);
    			self elevator_move_to(elevator);
    		}
    		else // Not enough money
    		{
    			play_sound_at_pos( "no_purchase", self.origin );
    			who maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 1 );
    		}			
    		wait( .05 );
    	}
    }
    //---------------------------------------------------------------------------
    // DCS: version of maps\_zombiemode_weapons::can_buy_weapon()
    //			that allows player to activate with claymores out.
    //---------------------------------------------------------------------------
    can_buy_elevator()
    {
    	if( self in_revive_trigger() )
    	{
    		return false;
    	}
    	
    	return true;
    }
    //---------------------------------------------------------------------------
    // disables the zip buy triggers until the cooldown period is over
    // the callbox at the current station will also stay hidden after cooldown
    //---------------------------------------------------------------------------
    disable_callboxes()
    {
    	call_boxes = GetEntArray( self.targetname + "_call_box", "targetname" );
    	for ( j = 0; j < call_boxes.size; j++ )
    	{
    		call_boxes[j] trigger_off();
    		
    		players = get_players();
    		for ( i = 0; i < players.size; i++ )
    		{
    			call_boxes[j] SetInvisibleToPlayer(players[i]);
    		}	
    	}
    }
    disable_elevator_buys()
    {
    	elevator_buy = GetEnt( self.targetname + "_buy", "script_noteworthy" );
    
    	elevator_buy setcursorhint( "HINT_NOICON" );
    	elevator_buy SetHintString( "" );
    	elevator_buy trigger_off();
    	
    	players = get_players();
    	for ( i = 0; i < players.size; i++ )
    	{
    		elevator_buy SetInvisibleToPlayer(players[i]);
    	}		
    }
    //---------------------------------------------------------------------------
    // enables the zip buys except the call box at the current station
    //---------------------------------------------------------------------------
    enable_elevator_buys()
    {
    	elevator_buy = GetEnt( self.targetname + "_buy", "script_noteworthy" );
    
    	elevator_buy setcursorhint( "HINT_NOICON" );
    	elevator_buy SetHintString( &"ZOMBIE_PENTAGON_USE_ELEVATOR", self.cost );
    	elevator_buy trigger_on();
    	
    	elevator_buy SetVisibleToAll();
    }
    
    enable_callboxes()
    {
    	call_boxes = getentarray( self.targetname + "_call_box", "targetname" );
    
    	for ( j = 0; j < call_boxes.size; j++ )
    	{
    		if ( call_boxes[j].script_noteworthy != self.station )
    		{
    			call_boxes[j] trigger_on();
    			call_boxes[j] sethintstring( &"ZOMBIE_PENTAGON_CALL_ELEVATOR" );
    
    			call_boxes[j] SetVisibleToAll();
    		}
    		else
    		{
    			//call_boxes[j] trigger_on();
    			call_boxes[j] sethintstring( "" );			
    		}	
    	}
    }
    //---------------------------------------------------------------------------
    // Actual elevator movement, doors opening, etc.
    //---------------------------------------------------------------------------
    elevator_move_to(elevator)
    {
    	players = getplayers();
    	elevator close_elev_doors();
    
    	flag_clear("spawn_zombies");
    
    	level waittill("doors_finished_moving");
    
    	elevator block_elev_doors( false );
    
        elevator notify( "start_3d_audio" );
    
    	elevator thread elev_clean_up_corpses();
    
    	if(elevator.station == elevator.targetname + "_up")
    	{
    		elevator thread move_zombies_elevator(false);
    		if(elevator.targetname == "elevator1")
    		{
    			elevator thread zombie_elevator_closets(false);
    		}
    		
    		elevator MoveTo( elevator.travel_down, 5.0);
    		elevator waittill( "movedone" );
    		elevator.station = elevator.targetname + "_down";
    		
    		level thread maps\zombie_pentagon::change_pentagon_vision();
    
    		if(elevator.targetname == "elevator1" && !flag("labs_enabled"))
    		{
    			flag_set( "labs_enabled" );
    		}	
    		else if( elevator.targetname == "elevator2" && !flag( "war_room_start" ) )
    		{
    			flag_set( "war_room_start" );
    		}
    	}
    	else
    	{
    		elevator thread move_zombies_elevator(true);
    		if(elevator.targetname == "elevator1")
    		{
    			elevator thread zombie_elevator_closets(true);
    		}
    
    		elevator MoveTo( elevator.travel_up, 5.0);
    		elevator waittill( "movedone" );
    		elevator.station = elevator.targetname + "_up";
    
    		level thread maps\zombie_pentagon::change_pentagon_vision();
    	}
    	
    	if( elevator.targetname == "elevator2" )
        {
    		clientnotify( "ele1e" );
    		if(elevator.station == elevator.targetname + "_up")
    		{
    		    elevator PlaySound( "zmb_vox_pentann_level_1" );
    		}
    		else if(elevator.station == elevator.targetname + "_down")
    		{
    		    elevator PlaySound( "zmb_vox_pentann_level_2" );
    		}
    	}
    	else if( elevator.targetname == "elevator1" )
    	{
    		clientnotify( "ele2e" );
    		if(elevator.station == elevator.targetname + "_up")
    		{
    		    elevator PlaySound( "zmb_vox_pentann_level_2" );
    		}
    		else if(elevator.station == elevator.targetname + "_down")
    		{
    		    elevator PlaySound( "zmb_vox_pentann_level_3" );
    		}
    	}
    
    	flag_set("elevator_grounded");
    	flag_set("spawn_zombies");
    	
    	elevator open_elev_doors();
    
    	//unlock_players();
    	
    	wait(0.1);
    	elevator.called = false;
    	elevator.active = false;				
    	elevator enable_elevator_buys();
    	elevator enable_callboxes();
    
    	wait(2.0);
    	//DCS 091610: Clean up any zombies that spawned while elevator moved.
    	level thread check_if_empty_floors();
    }
    //---------------------------------------------------------------------------
    // DCS 082710:	check for zombies within special closets.
    //							kill them and readd to spawn array
    //							only needed for elevator 1.		
    //---------------------------------------------------------------------------
    zombie_elevator_closets(going_up)
    {
    	if(!IsDefined(going_up))
    	{
    		return;
    	}
    	
    	if(going_up == true)
    	{
    		special_spawn = GetEntArray("elevator1_down_spawncloset", "targetname");
    
    		flag_set("no_labs_elevator_spawning");
    		flag_clear("no_warroom_elevator_spawning");
    		maps\_zombiemode_zone_manager::reinit_zone_spawners();
    	}
    	else
    	{
    		special_spawn = GetEntArray("elevator1_up_spawncloset", "targetname");
    		
    		flag_set("no_warroom_elevator_spawning");
    		flag_clear("no_labs_elevator_spawning");
    		maps\_zombiemode_zone_manager::reinit_zone_spawners();
    	}
    
    	if(IsDefined(special_spawn))
    	{
    		for (i = 0; i < special_spawn.size; i++)
    		{
    			special_spawn[i] thread elevator_closet_cleanup();
    		}	
    	}	
    }
    elevator_closet_cleanup()
    {	
    	zombies = GetAIArray("axis");
    	if(!IsDefined(zombies))
    	{
    		return;
    	}	
    	for (i = 0; i < zombies.size; i++)
    	{
    		if(zombies[i] IsTouching(self))
    		{
    			level.zombie_total++;
    			zombies[i] DoDamage(zombies[i].health + 100, zombies[i].origin);
    		}	
    	}
    }	
    //---------------------------------------------------------------------------
    // DCS 082610:	teleport some zombies to be waiting at next floor.
    //							if all players in elevator.
    //---------------------------------------------------------------------------
    move_zombies_elevator(going_up)
    {
    	if(!IsDefined(going_up))
    	{
    		return;
    	}
    	check_trig = undefined;
    	downed_player = undefined;
    	current_floor = 1;
    	next_floor = 2;
    	num_in_elev = 0;
    	num_current_floor = 0;
    	num_next_floor = 0;
    	num_floor_laststand = 0;	
    	pos_num = 0;
    	pos_num_hidden = 0;
    	floor_height = 0;
    	
    	players = getplayers();
    	in_elevator = GetEnt(self.targetname + "_zombie_cleanup", "targetname");
    	
    	if(going_up == true)
    	{
    		check_trig = GetEnt(self.targetname + "_down_riders", "targetname");	
    	}
    	else
    	{
    		check_trig = GetEnt(self.targetname + "_up_riders", "targetname");	
    	}
    		
    	// check number of players in elevator and current floor
    	for ( i = 0; i < players.size; i++ )
    	{
    		players[i].floor = maps\_zombiemode_ai_thief::thief_check_floor( players[i] );
    		if(players[i] IsTouching(check_trig))
    		{
    			current_floor = players[i].floor;		
    			num_in_elev++;
    			players[i].end_portal = undefined;
    			
    			if( self.targetname == "elevator2" )
    			{
    			    setClientSysState( "levelNotify", "ele1", players[i] );
    			}
    			else if ( self.targetname == "elevator1" )
    			{
    			    setClientSysState( "levelNotify", "ele2", players[i] );
    			}
    		}
    	}
    	
    	// Check next floor.
    	if(IsDefined(current_floor) && going_up == false)
    	{
    		next_floor = current_floor + 1;
    	}
    	else if(IsDefined(current_floor) && going_up == true)
    	{
    		next_floor = current_floor - 1;
    	}
    	
    	// now check current floor number after all checked in elevator and current floor established.
    	// also check next floor for players.
    	for ( i = 0; i < players.size; i++ )
    	{	
    		if(IsDefined(current_floor) && players[i].floor == current_floor)
    		{
    			num_current_floor++;		
    		}
    		if(IsDefined(next_floor) && players[i].floor == next_floor)
    		{
    			num_next_floor++;		
    		}
    		if(IsDefined(current_floor) && players[i].floor == current_floor && (players[i] maps\_laststand::player_is_in_laststand()
    		|| players[i].sessionstate == "spectator") && !players[i] IsTouching(check_trig))
    		{
    			if(!IsDefined(downed_player))
    			{
    				downed_player = players[i];
    			}	 
    			num_floor_laststand++;		
    		}
    
    	}
    
    	wait_network_frame();
    	// DCS 092110: everyone left on floor in last stand.
    	if(players.size > 1 && num_floor_laststand > 0 
    	&& num_in_elev == (num_current_floor - num_floor_laststand))
    	{
    		downed_player thread laststand_elev_zombies_away(current_floor, next_floor);
    		return; 
    	}		
    
    	if(num_in_elev != num_current_floor)
    	{
    		return;
    	}
    	
    	if(num_next_floor > 0 )
    	{
    		// will force them not to teleport into playable area.
    		pos_num = 6;
    	}		
    
    	// special case for single players.
    	if(players.size == 1)
    	{
    		// fill position number, no zombies in play area ahead.
    		if(level.round_number <= 5)
    		{
    			pos_num = 6;
    		}
    		else if(level.round_number > 5 && level.round_number < 10)
    		{
    			pos_num = 5;
    		}
    		else if(level.round_number >= 10)
    		{
    			pos_num = 3;
    		}	
    	}
    
    	zombies = GetAIArray("axis");
    	if(!IsDefined(zombies))
    	{
    		return;
    	}	
    	for (i = 0; i < zombies.size; i++)
    	{
    		zombies[i].floor = maps\_zombiemode_ai_thief::thief_check_floor( zombies[i] );
    		
    		// leave alone if not on same floor
    		if(IsDefined(current_floor) && zombies[i].floor != current_floor)
    		{
    			continue;
    		}		
    		// ignore if technician 
    		else if(IsDefined(zombies[i].animname) && zombies[i].animname == "thief_zombie") 
    		{
    			continue;
    		}
    		//or in elevator.
    		else if(zombies[i] IsTouching(in_elevator))
    		{
    			continue;
    		}
    		else if(IsDefined(zombies[i].teleporting) && zombies[i].teleporting == true)
    		{
    			continue;
    		}	
    		//or go ahead and delete if still behind tear.
    		else if(zombies[i].ignoreall == true) 
    		{
    			if(zombies[i].health == level.zombie_health || zombies[i].animname == "quad_zombie")
    			{
    				level.zombie_total++;
    				if(IsDefined(zombies[i].fx_quad_trail))
    				{
    					zombies[i].fx_quad_trail Delete();
    				}
    				zombies[i] maps\_zombiemode_spawner::reset_attack_spot();
    
    				zombies[i] notify("zombie_delete");
    				zombies[i] Delete();
    			}	
    			else
    			{
    				zombies[i] thread zombies_elev_teleport_hidden(self, RandomIntRange(0,6), going_up);
    			}	
    		}
    		else
    		{	
    			//Teleport first 6 to next floor into playable area...
    			if(pos_num <= 5 )
    			{
    					
    				zombies[i] thread zombies_elev_teleport(self, pos_num, going_up);
    				pos_num++;
    			}
    			// teleport 6 into next floor spawn closets (excluding quads).
    			else if(pos_num_hidden <=5 && zombies[i].animname != "quad_zombie")
    			{
    				if(zombies[i].health == level.zombie_health)
    				{
    					level.zombie_total++;
    					zombies[i] maps\_zombiemode_spawner::reset_attack_spot();
    
    					zombies[i] notify("zombie_delete");
    					zombies[i] Delete();
    				}	
    				else
    				{				
    					zombies[i] thread zombies_elev_teleport_hidden(self, pos_num_hidden, going_up);
    					pos_num_hidden++;
    				}	
    			}	
    			//then send them through portal if power on.
    			else
    			{
    				if(IsDefined(current_floor) && current_floor == 1 && flag("power_on"))
    				{				
    					zombies[i] thread send_zombies_out(level.portal_top);
    				}
    				else if(IsDefined(current_floor) && current_floor == 2 && flag("power_on"))
    				{
    					zombies[i] thread send_zombies_out(level.portal_mid);
    				}
    				else if(IsDefined(current_floor) && current_floor == 3 && flag("power_on"))
    				{
    					zombies[i] thread send_zombies_out(level.portal_power);
    				}
    				else 
    				{
    					move_speed = undefined;
    					if(IsDefined(self.zombie_move_speed))
    					{
    						move_speed = self.zombie_move_speed;
    					}
    										
    					PlayFX(level._effect["transporter_start"], zombies[i].origin);
    					if(zombies[i].health == level.zombie_health)
    					{
    						level.zombie_total++;
    						if(IsDefined(zombies[i].fx_quad_trail))
    						{
    							zombies[i].fx_quad_trail Delete();
    						}
    						zombies[i] maps\_zombiemode_spawner::reset_attack_spot();
    						
    						zombies[i] notify("zombie_delete");
    						zombies[i] Delete();
    					}	
    					else
    					{	
    						zombies[i] thread cleanup_unoccupied_floor(move_speed,current_floor,next_floor);
    					}	
    				}
    			}	
    		}		
    	}	
    }
    //---------------------------------------------------------------------------
    laststand_elev_zombies_away(current_floor,next_floor)
    {
    	// now see if need to delete zombies.
    	zombies = GetAIArray("axis");
    	if(!IsDefined(zombies))
    	{
    		return;
    	}
    
    	for (i = 0; i < zombies.size; i++)
    	{
    		// leave thief zombie alone.
    		if(IsDefined(zombies[i].animname) && zombies[i].animname == "thief_zombie") 
    		{
    			continue;
    		}
    
    		move_speed = undefined;
    		if(IsDefined(zombies[i].zombie_move_speed))
    		{
    			move_speed = zombies[i].zombie_move_speed;
    		}
    				
    		zombies[i].floor = maps\_zombiemode_ai_thief::thief_check_floor( zombies[i] );
    		
    		if(IsDefined(zombies[i].floor) && zombies[i].floor == self.floor)
    		{
    			if(zombies[i].floor == 1 && flag("power_on"))
    			{
    				zombies[i] thread send_zombies_out(level.portal_top);
    			}
    			else if(zombies[i].floor == 2 && flag("power_on"))
    			{
    				zombies[i] thread send_zombies_out(level.portal_mid);
    			}
    			else if(zombies[i].floor == 3 && flag("power_on"))
    			{
    				zombies[i] thread send_zombies_out(level.portal_power);
    			}
    			else 
    			{
    				PlayFX(level._effect["transporter_start"], zombies[i].origin);
    				if(zombies[i].health == level.zombie_health)
    				{
    					level.zombie_total++;
    					if(IsDefined(zombies[i].fx_quad_trail))
    					{
    						zombies[i].fx_quad_trail Delete();
    					}
    					zombies[i] maps\_zombiemode_spawner::reset_attack_spot();
    					
    					zombies[i] notify("zombie_delete");
    					zombies[i] Delete();
    				}	
    				else
    				{	
    					zombies[i] thread cleanup_unoccupied_floor(move_speed, current_floor, next_floor);
    				}	
    			}	
    		}
    	}		
    }
    //---------------------------------------------------------------------------
    // DCS: 	teleport zombies into playable area when using elevator
    //				if next floor is clear of players.
    //---------------------------------------------------------------------------
    zombies_elev_teleport(elevator, pos_num, going_up)
    {
    	self endon( "death" );
    	
    	teleport_pos = [];
    	
    	if(going_up == true)
    	{
    		teleport_pos = getstructarray(elevator.targetname + "_up_zombie", "targetname");	
    	}
    	else
    	{
    		teleport_pos = getstructarray(elevator.targetname + "_down_zombie", "targetname");	
    	}
    	
    	if(IsDefined(teleport_pos[pos_num]))
    	{
    		//IPrintLnBold("moving zombie to position ", pos_num);
    		self forceteleport(teleport_pos[pos_num].origin,teleport_pos[pos_num].angles);
    	}
    }
    //---------------------------------------------------------------------------
    // DCS 091010:	teleport zombies into available spawn closets
    //							on next floor when using elevators. Only called 
    //							if floor is occuppied already and/or power is off.
    //---------------------------------------------------------------------------
    zombies_elev_teleport_hidden(elevator, pos_num, going_up)
    {
    	self endon( "death" );
    	
    	teleport_pos = [];
    	
    	if(going_up == true)
    	{
    		teleport_pos = getstructarray(elevator.targetname + "_up_hidden", "targetname");	
    	}
    	else
    	{
    		teleport_pos = getstructarray(elevator.targetname + "_down_hidden", "targetname");	
    	}
    	
    	if(IsDefined(teleport_pos[pos_num]))
    	{
    		self forceteleport(teleport_pos[pos_num].origin + (RandomFloatRange(0,22), RandomFloatRange(0,22), 0),teleport_pos[pos_num].angles);
    		
    		// now reset zombie to tear through barricade.
    		wait(1);
    		if(IsDefined(self))
    		{
    			self.ignoreall = true;
    			self notify( "stop_find_flesh" );
    			self notify( "zombie_acquire_enemy" );
    		
    			if(IsDefined(self.target))
    			{
    				self.target = undefined;
    			}
    			wait_network_frame();			
    			self thread maps\_zombiemode_spawner::zombie_think();
    		}	
    	}
    }
    //---------------------------------------------------------------------------
    // clean up dead zombie corpses
    //---------------------------------------------------------------------------
    elev_clean_up_corpses()
    {
    	corpse_trig = GetEnt(self.targetname + "_zombie_cleanup", "targetname");
    	
    	corpses = GetCorpseArray();
    	if(IsDefined(corpses))
    	{
    		for ( i = 0; i < corpses.size; i++ )
    		{
    			if(corpses[i] istouching(corpse_trig))
    			{
    				corpses[i] thread elev_remove_corpses();
    
    			}
    		}		
    	}		
    }
    elev_remove_corpses()
    {
    	PlayFX(level._effect["dog_gib"], self.origin);
    	self Delete();
    }		
    
    //---------------------------------------------------------------------------
    // int_doors()
    //---------------------------------------------------------------------------
    init_elevator1_doors()
    {
    	self.doors_up = GetEntArray("elevator1_doors_up", "script_noteworthy" );
    	for ( i = 0; i < self.doors_up.size; i++ )
    	{
    		self.doors_up[i].startpos = self.doors_up[i].origin;
    	}
    	self.doors_down = GetEntArray( "elevator1_doors_down", "script_noteworthy" );
    	for ( j = 0; j < self.doors_down.size; j++ )
    	{
    		self.doors_down[j].startpos = self.doors_down[j].origin;
    	}		
    	self.doors_outer_down = GetEntArray("elevator1_outerdoors_down", "script_noteworthy");
    	for ( k = 0; k < self.doors_outer_down.size; k++ )
    	{
    		self.doors_outer_down[k].startpos = self.doors_outer_down[k].origin;
    	}		
    	self.doors_outer_up = GetEntArray("elevator1_outerdoors_up", "script_noteworthy");
    	for ( l = 0; l < self.doors_outer_up.size; l++ )
    	{
    		self.doors_outer_up[l].startpos = self.doors_outer_up[l].origin;
    	}
    }
    init_elevator2_doors()
    {
    	self.doors = GetEntArray("elevator2_doors", "script_noteworthy" );
    	for ( i = 0; i < self.doors.size; i++ )
    	{
    		self.doors[i].startpos = self.doors[i].origin;
    	}
    	self.doors_outer_down = GetEntArray("elevator2_outerdoors_down", "script_noteworthy");
    	for ( k = 0; k < self.doors_outer_down.size; k++ )
    	{
    		self.doors_outer_down[k].startpos = self.doors_outer_down[k].origin;
    	}		
    	self.doors_outer_up = GetEntArray("elevator2_outerdoors_up", "script_noteworthy");
    	for ( l = 0; l < self.doors_outer_up.size; l++ )
    	{
    		self.doors_outer_up[l].startpos = self.doors_outer_up[l].origin;
    	}			
    }
    //---------------------------------------------------------------------------
    // closes all elevator doors
    //---------------------------------------------------------------------------
    close_elev_doors()
    {
    	self block_elev_doors( true );
    
    	for(i = 0; i < self.doors_outer_down.size; i++)
    	{ 
    		self.doors_outer_down[i] thread relink_elev_doors(self.doors_outer_down[i].startpos, self, false);			
    	}
    	for(j = 0; j < self.doors_outer_up.size; j++)
    	{
    		self.doors_outer_up[j] thread relink_elev_doors(self.doors_outer_up[j].startpos, self, false);			
    	}
    	if(IsDefined(self.doors_down)) // only elevator 1 (exit opposite sides up or down)
    	{
    		for ( k = 0; k < self.doors_down.size; k++ )
    		{
    			newpos3 = (self.doors_down[k].startpos[0], self.doors_down[k].startpos[1], self.doors_down[k].origin[2]);
    			self.doors_down[k]	thread relink_elev_doors(newpos3, self, true);
    			playsoundatposition( "evt_elevator_freight_door_close", newpos3 );
    		}
    	}
    	if(IsDefined(self.doors_up)) // only elevator 1 (exit opposite sides up or down)
    	{			
    		for ( l = 0; l < self.doors_up.size; l++ )
    		{
    			newpos4 = (self.doors_up[l].startpos[0], self.doors_up[l].startpos[1], self.doors_up[l].origin[2]);
    			self.doors_up[l]	thread relink_elev_doors(newpos4, self, true);
    			playsoundatposition( "evt_elevator_freight_door_close", newpos4 );
    		}
    	}
    	//added for elevator 2.
    	if(IsDefined(self.doors)) // only elevator 2 (single set of elevator doors.)
    	{		
    		for ( m = 0; m < self.doors.size; m++ )
    		{
    			if(self.station == self.targetname + "_up")
    			{
    				newpos5 = (self.doors[m].startpos);
    			}
    			else
    			{
    				newpos5 = (self.doors[m].startpos[0], self.doors[m].startpos[1], self.doors[m].origin[2]);
    			}	
    			self.doors[m]	thread relink_elev_doors(newpos5, self, true);
    			playsoundatposition( "evt_elevator_office_door_close", newpos5 );
    		}
    	}	
    }
    //---------------------------------------------------------------------------
    // Open doors on floor elevator is at.
    //---------------------------------------------------------------------------
    open_elev_doors()
    {
    
    	if(self.station == self.targetname + "_down")
    	{
    		for(j = 0; j < self.doors_outer_down.size; j++)
    		{
    			newpos1 = self.doors_outer_down[j].startpos + self.doors_outer_down[j].script_vector;
    			self.doors_outer_down[j] thread relink_elev_doors(newpos1, self, false);			
    		}
    		if(IsDefined(self.doors_up)) // rsh071510 - when down, both sides of elevator 1 need to open for spawning
    		{
    			for ( i = 0; i < self.doors_up.size; i++ )
    			{
    				pos2 = self.doors_up[i].startpos + self.doors_up[i].script_vector;
    				newpos2 = (pos2[0], pos2[1], self.doors_up[i].origin[2]);
    				self.doors_up[i]	thread relink_elev_doors(newpos2, self, true);
    				playsoundatposition( "evt_elevator_freight_door_open", newpos2 );
    			}
    		}
    		if(IsDefined(self.doors_down)) // elevator 1
    		{
    			for ( i = 0; i < self.doors_down.size; i++ )
    			{
    				pos1 = self.doors_down[i].startpos + self.doors_down[i].script_vector;
    				newpos = (pos1[0], pos1[1], self.doors_down[i].origin[2]);
    				self.doors_down[i]	thread relink_elev_doors(newpos, self, true);
    				playsoundatposition( "evt_elevator_freight_door_open", newpos );
    			}
    		}
    		//added for elevator 2.
    		if(IsDefined(self.doors)) // only elevator 2 (single set of elevator doors.)
    		{		
    			for ( m = 0; m < self.doors.size; m++ )
    			{
    				pos2 = self.doors[m].startpos + self.doors[m].script_vector;
    				
    				if(self.station == self.targetname + "_up")
    				{
    					newpos2 = (pos2[0], pos2[1], self.doors[m].startpos[2]);
    				}
    				else
    				{
    					newpos2 = (pos2[0], pos2[1], self.doors[m].origin[2]);
    				}					
    				self.doors[m]	thread relink_elev_doors(newpos2, self, true);
    				playsoundatposition( "evt_elevator_office_door_open_1", newpos2 );
    			}
    		}			
    	}
    	else
    	{
    		for(j = 0; j < self.doors_outer_up.size; j++)
    		{ 
    			newpos1 = self.doors_outer_up[j].startpos + self.doors_outer_up[j].script_vector;
    			self.doors_outer_up[j] thread relink_elev_doors(newpos1, self, false);
    		}
    		if(IsDefined(self.doors_up)) //elevator 1
    		{
    			for ( i = 0; i < self.doors_up.size; i++ )
    			{
    				pos2 = self.doors_up[i].startpos + self.doors_up[i].script_vector;
    				newpos2 = (pos2[0], pos2[1], self.doors_up[i].origin[2]);
    				self.doors_up[i]	thread relink_elev_doors(newpos2, self, true);
    				playsoundatposition( "evt_elevator_freight_door_open", newpos2 );
    			}
    		}
    		if(IsDefined(self.doors_down)) //DCS 082010: new spawn closet at war room level.
    		{
    			for ( k = 0; k < self.doors_down.size; k++ )
    			{
    				pos4 = self.doors_down[k].startpos + self.doors_down[k].script_vector;
    				newpos4 = (pos4[0], pos4[1], self.doors_down[k].origin[2]);
    				self.doors_down[k]	thread relink_elev_doors(newpos4, self, true);
    				playsoundatposition( "evt_elevator_freight_door_open", newpos4 );
    			}
    		}		
    		//added for elevator 2.
    		if(IsDefined(self.doors)) // only elevator 2 (single set of elevator doors.)
    		{		
    			for ( m = 0; m < self.doors.size; m++ )
    			{
    				pos3 = self.doors[m].startpos + self.doors[m].script_vector;
    				newpos3 = (pos3[0], pos3[1], self.doors[m].origin[2]);
    				self.doors[m]	thread relink_elev_doors(newpos3, self, true);
    				playsoundatposition( "evt_elevator_office_door_open_1", newpos3 );
    			}
    		}		
    	}	
    }
    
    relink_elev_doors(pos, elev, linked)
    {
    	self Unlink();
    	self moveto(pos, 1.0);
    	
    	self waittill("movedone");
    	if(linked)
    	{
    		self LinkTo(elev);
    	}
    	
    	level notify("doors_finished_moving");
    	// startpos is closed for all doors, disconnect paths.
    	if(self.classname == "script_model")
    	{
    		return;
    	}	
    	if(self.origin[0] == self.startpos[0])
    	{
    		self DisconnectPaths();	
    	}
    	else
    	{	
    		self ConnectPaths();	
    	}
    	
    }	
    //---------------------------------------------------------------------------
    //	Make the zombies head to the elevator destination
    //---------------------------------------------------------------------------
    redirect_zombies( destination )
    {
    
    	// If not all players on elevator leave zombies alone.
    	players = get_players();
    	num_players = 0;
    	for ( i = 0; i < players.size; i++ )
    	{
    		if(players[i] IsTouching(self))
    		num_players++;
    	}	
    	if(!num_players == players.size)
    	{
    		return;
    	}	
    
    	wait( 2.0 );
    	location = GetNode( destination, "targetname" );
    	if ( IsDefined( location ) )
    	{
    		poi = Spawn( "script_origin", location.origin );
    		poi create_zombie_point_of_interest( undefined, 25, 0, true );
    		flag_wait("elevator_grounded");
    
    		poi deactivate_zombie_point_of_interest();
    		poi delete();
    	}
    }
    
    //---------------------------------------------------------------------------
    // unlinks players from the spots
    //---------------------------------------------------------------------------
    unlock_players()
    {
    	players = getplayers();
    
    	for ( i = 0; i < players.size; i++ )
    	{
    		players[i] unlink();
    		players[i] allowcrouch( true );
    		players[i] allowprone( true );
    		players[i] disableinvulnerability();
    		
    /#
    		//Make sure cheat is still working
    		if ( GetDvarInt( #"zombie_cheat" ) >= 1 && GetDvarInt( #"zombie_cheat" ) <= 3 ) 
    		{
    			players[i] EnableInvulnerability();
    		}
    #/
    	
    		players[i] thread maps\_zombiemode::store_crumb( players[i].origin );
    	}
    }
    
    elevator1_3d_audio()
    {
        while(1)
        {
            self waittill( "start_3d_audio" );
            ent = Spawn( "script_origin", self.origin + (0,0,30) );
            ent LinkTo( self );
            ent PlayLoopSound( "evt_elevator_freight_run_3d" );
            self waittill( "movedone" );
            ent Delete();
        }
    }
    
    elevator2_3d_audio()
    {
        while(1)
        {
            self waittill( "start_3d_audio" );
            ent = Spawn( "script_origin", self.origin + (0,0,30) );
            ent LinkTo( self );
            ent PlayLoopSound( "evt_elevator_office_run_3d" );
            self waittill( "movedone" );
            ent Delete();
        }
    }
    zombie_pentagon_fx.gsc

    Code:
    #include maps\_utility;
    #include common_scripts\utility;
    
    main()
    {
    	scriptedFX();
    	footsteps(); 
    	maps\createart\zombie_pentagon_art::main();
    	maps\createfx\zombie_pentagon_fx::main();
    	precacheFX();
    }
    
    footsteps()
    {
    }
    
    scriptedFX()
    {
    	level._effect["large_ceiling_dust"]			= loadfx( "maps/zombie/fx_dust_ceiling_impact_lg_mdbrown" );
    	level._effect["poltergeist"]						= loadfx( "misc/fx_zombie_couch_effect" );
    	
    	// electric switch fx
    	level._effect["switch_sparks"]					= loadfx("env/electrical/fx_elec_wire_spark_burst");
    	
    	// dogs
    	level._effect["dog_breath"] 						= loadfx("maps/zombie/fx_zombie_dog_breath");	
    	
    	// rise fx 
    	level._effect["rise_burst"]							= loadfx("maps/mp_maps/fx_mp_zombie_hand_dirt_burst");
    	level._effect["rise_billow"]						= loadfx("maps/mp_maps/fx_mp_zombie_body_dirt_billowing");
    	level._effect["rise_dust"]							= loadfx("maps/mp_maps/fx_mp_zombie_body_dust_falling");	
    	
    	level._effect["lght_marker"] 								= Loadfx("maps/zombie/fx_zombie_coast_marker");
    	level._effect["lght_marker_flare"] 					= Loadfx("maps/zombie/fx_zombie_coast_marker_fl");	
    	
    	//electrical trap
    	level._effect["electric_current"] 					= loadfx("misc/fx_zombie_elec_trail");
    	level._effect["zapper_fx"] 									= loadfx("misc/fx_zombie_zapper_powerbox_on");	
    	level._effect["zapper"]											= loadfx("misc/fx_zombie_electric_trap");
    	level._effect["zapper_wall"] 								= loadfx("misc/fx_zombie_zapper_wall_control_on");
    	level._effect["zapper_light_ready"] 				= loadfx("misc/fx_zombie_zapper_light_green");
    	level._effect["zapper_light_notready"] 			= loadfx("misc/fx_zombie_zapper_light_red");	
    
    	level._effect["elec_md"] 		= loadfx("maps/zombie/fx_elec_player_md");
    	level._effect["elec_sm"] 		= loadfx("maps/zombie/fx_elec_player_sm");	
    	level._effect["elec_torso"] = loadfx("maps/zombie/fx_elec_player_torso");
    
    	// fire trap
    	level._effect["fire_trap_med"] = loadfx("maps/zombie/fx_zombie_fire_trap_med");	
    	
    	// quad fx
    	level._effect["quad_grnd_dust_spwnr"]	= loadfx("maps/zombie/fx_zombie_crawler_grnd_dust_spwnr");
    	
    	// minigun, WW: the minigun is only on the pentagon but the minigun should have its own file
    	level._effect[ "minigun_pickup" ] = LoadFX( "misc/fx_zombie_powerup_solo_grab" );
    	level._effect["animscript_gib_fx"] 		 = LoadFx( "weapon/bullet/fx_flesh_gib_fatal_01" );
    	level._effect["animscript_gibtrail_fx"] 	 = LoadFx( "trail/fx_trail_blood_streak" ); 
            
            // DSM:Spining lights
    	level._effect["test_spin_fx"] = LoadFX( "env/light/fx_light_warning");	
    }
    	
    precachefx()
    {
    	// Pack A Punch
    	level._effect["zombie_packapunch"]										= loadfx("maps/zombie/fx_zombie_packapunch");
    	
    	// added for magic box lights
    	level._effect["boxlight_light_ready"] 								= loadfx("maps/zombie/fx_zombie_theater_lightboard_green");
    	level._effect["boxlight_light_notready"] 							= loadfx("maps/zombie/fx_zombie_theater_lightboard_red");
    
    	//teleporter fx
    	level._effect["zombie_pentagon_teleporter"]						= loadfx("maps/zombie/fx_zombie_portal_nix_num");
    	level._effect["zombie_pent_portal_pack"]							= loadfx("maps/zombie/fx_zombie_portal_nix_num_pp");
    	level._effect["zombie_pent_portal_cool"]							= loadfx("maps/zombie/fx_zombie_portal_nix_num_pp_fd");
    	level._effect["fx_zombie_portal_corona_lg"]						= loadfx("maps/zombie/fx_zombie_portal_corona_lg");
    	level._effect["fx_zombie_portal_corona_sm"]						= loadfx("maps/zombie/fx_zombie_portal_corona_sm");
    
    	level._effect["transporter_beam"]											= loadfx("maps/zombie/fx_transporter_beam");
    	level._effect["transporter_start"]										= loadfx("maps/zombie/fx_transporter_start");		
    	
    	// breaking windows
    //  level._effect["glass_break"]                    			= loadfx("destructibles/fx_break_glass_car_med" );
      level._effect["glass_break"]                    			= loadfx("maps/zombie/fx_zombie_window_break" );
    
    
    	// breaking wall
      level._effect["wall_break"]                    				= loadfx("destructibles/fx_dest_wooden_crate" );
      
      // Pentagon effects
    	level._effect["fx_pent_cigar_smoke"]                  = LoadFX("maps/zombie/fx_zombie_cigar_tip_smoke");
    	level._effect["fx_pent_cigarette_tip_smoke"]          = LoadFX("maps/zombie/fx_zombie_cigarette_tip_smoke");
    	level._effect["fx_glo_studio_light"]                  = LoadFX("maps/pentagon/fx_glo_studio_light");
    	level._effect["fx_pent_tinhat_light"]                 = LoadFX("maps/pentagon/fx_pent_tinhat_light");				
    	level._effect["fx_pent_lamp_desk_light"]              = LoadFX("maps/pentagon/fx_pent_lamp_desk_light");
    	level._effect["fx_pent_security_camera"]              = LoadFX("maps/pentagon/fx_pent_security_camera");				
    	level._effect["fx_pent_globe_projector"]              = LoadFX("maps/zombie/fx_zombie_globe_projector");
    	level._effect["fx_pent_globe_projector_blue"]         = LoadFX("maps/zombie/fx_zombie_globe_projector_blue");	
    	level._effect["fx_pent_movie_projector"]              = LoadFX("maps/pentagon/fx_pent_movie_projector");	
    	level._effect["fx_pent_tv_glow"]                      = LoadFX("maps/zombie/fx_zombie_tv_glow");	
    	level._effect["fx_pent_tv_glow_sm"]                   = LoadFX("maps/zombie/fx_zombie_tv_glow_sm");			
    	level._effect["fx_pent_smk_ambient_room"]             = LoadFX("maps/pentagon/fx_pent_smk_ambient_room");	
    	level._effect["fx_pent_smk_ambient_room_lg"]          = LoadFX("maps/zombie/fx_zombie_pent_smk_ambient_room_lg");
    	level._effect["fx_pent_smk_ambient_room_sm"]          = LoadFX("maps/pentagon/fx_pent_smk_ambient_room_sm");
    
    	// FX from Rebirth
    	level._effect["fx_light_overhead_int_amber"]					= loadfx("maps/zombie/fx_zombie_light_overhead_amber");	
    	level._effect["fx_light_overhead_int_amber_short"]		= loadfx("maps/zombie/fx_zombie_light_overhead_amber_short");	
    	level._effect["fx_light_overhead_cool"]								= loadfx ("maps/zombie/fx_zombie_light_overhead_cool");	
    	level._effect["fx_light_floodlight_bright"]						= loadfx("maps/zombie/fx_zombie_light_floodlight_bright");
    
    
    	//Quad Vent Exploders	- bottom floor -1001,1002,1003,1004
    	level._effect["fx_quad_vent_break"]          					= LoadFX("maps/zombie/fx_zombie_crawler_vent_break");		
    	
    	// Additional FX
    	level._effect["fx_smk_linger_lit"]										= loadfx("maps/mp_maps/fx_mp_smk_linger");
    	
    	level._effect["fx_water_drip_light_long"]							= loadfx("env/water/fx_water_drip_light_long");	
    	level._effect["fx_water_drip_light_short"]						= loadfx("env/water/fx_water_drip_light_short");
    	level._effect["fx_mp_blood_drip_short"]								= loadfx("maps/mp_maps/fx_mp_blood_drip_short");
    	
    	level._effect["fx_pipe_steam_md"]											= loadfx("env/smoke/fx_pipe_steam_md");
    	level._effect["fx_mp_fumes_vent_sm_int"]							= loadfx("maps/mp_maps/fx_mp_fumes_vent_sm_int");
    	level._effect["fx_mp_fumes_vent_xsm_int"]							= loadfx("maps/mp_maps/fx_mp_fumes_vent_xsm_int");
    
    	level._effect["fx_zombie_light_glow_telephone"]				= loadfx("maps/zombie/fx_zombie_light_glow_telephone");
    	level._effect["fx_light_pent_ceiling_light"]					= loadfx("env/light/fx_light_pent_ceiling_light");	
    	level._effect["fx_light_pent_ceiling_light_flkr"]			= loadfx("env/light/fx_light_pent_ceiling_light_flkr");	
    	level._effect["fx_light_office_light_03"]							= loadfx("env/light/fx_light_office_light_03");
    	level._effect["fx_mp_light_dust_motes_md"]						= loadfx("maps/zombie/fx_zombie_light_dust_motes_md");
    	
    	level._effect["fx_insects_swarm_md_light"]						= loadfx("bio/insects/fx_insects_swarm_md_light");
    	level._effect["fx_insects_maggots"]										= loadfx("bio/insects/fx_insects_maggots_sm");
    	
    	level._effect["fx_mp_elec_spark_burst_xsm_thin_runner"]	= loadfx("maps/mp_maps/fx_mp_elec_spark_burst_xsm_thin_runner");
    	level._effect["fx_mp_elec_spark_burst_sm_runner"]			= loadfx("maps/mp_maps/fx_mp_elec_spark_burst_sm_runner");
    	
    	level._effect["fx_interrog_morgue_mist"]							= loadfx("maps/zombie/fx_zombie_morgue_mist");	
    	level._effect["fx_interrog_morgue_mist_falling"]			= loadfx("maps/zombie/fx_zombie_morgue_mist_falling");	
    
    }
    zombie_pentagon_magic_box.gsc

    Code:
    #include common_scripts\utility; 
    #include maps\_utility;
    #include maps\_zombiemode_utility;
    
    //************************************************************************************
    //
    //	Changes lights of Map for location
    //
    //************************************************************************************
    
    magic_box_init()
    {
    	// Array must match array in zombie_pentagon.csc
    	// Start at the first floor, war room then the labs
    
    	level._pentagon_no_power = "n";
    	level._pentagon_fire_sale = "f";
    
    	level._box_locations = array(	"level1_chest", //0 
    																"level1_chest2", // 1
    																"level2_chest", // 2
    																"start_chest", // 3
    																"start_chest2", // 4
    																"start_chest3" ); // 5
    
    																
    	level thread magic_box_update();
    }
    
    get_location_from_chest_index( chest_index )
    {
    	if( IsDefined( level.chests[ chest_index ] ) )
    	{
    		chest_loc = level.chests[ chest_index ].script_noteworthy;
    		
    		for(i = 0; i < level._box_locations.size; i ++)
    		{
    			if( level._box_locations[i] == chest_loc )
    			{
    				return i;
    			}
    		}
    	}
    	
    	
    	/#
    	AssertMsg("Unknown chest location - " + chest_index );
    	#/
    }
    
    magic_box_update()
    {
    	// Let the level startup
    	wait(2);
    	
    	setclientsysstate( "box_indicator", level._pentagon_no_power ); // "no_power"
    
    	// flag_wait( "power_on" );
    
    	// Setup
    	//box_mode = "Box Available";
    	box_mode = "no_power";
    	
    	//"no_power";
    	//"fire_sale";
    	//"box_available";
    	
    	// Tell client 
    	
    	// setclientsysstate( "box_indicator", get_location_from_chest_index( level.chest_index ) );
    	
    	while( 1 )
    	{		
    		// check where the box is
    		if( ( !flag( "power_on" ) || flag( "moving_chest_now" ) )
    				&& level.zombie_vars[ "zombie_powerup_fire_sale_on" ] == 0 ) //
    		{
    			box_mode = "no_power";
    		}
    		else if( IsDefined( level.zombie_vars["zombie_powerup_fire_sale_on"] ) 
    						&& level.zombie_vars["zombie_powerup_fire_sale_on"] == 1 )
    		{
    			box_mode = "fire_sale";
    		}
    		else
    		{
    			box_mode = "box_available";
    		}
    		
    		
    		switch( box_mode )
    		{
    			case "no_power":
    				setclientsysstate( "box_indicator", level._pentagon_no_power );	// "no_power"
    				while( !flag( "power_on" )
    								&& level.zombie_vars[ "zombie_powerup_fire_sale_on" ] == 0 )
    				{
    					wait( 0.1 );
    				}
    				break;
    				
    			case "fire_sale":
    				setclientsysstate( "box_indicator", level._pentagon_fire_sale );	// "fire sale"
    				while ( level.zombie_vars[ "zombie_powerup_fire_sale_on" ] == 1 )
    				{
    					wait( 0.1 );
    				}
    				
    				break;
    				
    			case "box_available":
    				setclientsysstate( "box_indicator", get_location_from_chest_index( level.chest_index ) );
    				while( !flag( "moving_chest_now" ) 
    								&& level.zombie_vars[ "zombie_powerup_fire_sale_on" ] == 0 )
    				{
    					wait( 0.1 );
    				}
    				break;
    				
    			default:
    				setclientsysstate( "box_indicator", level._pentagon_no_power );	// "no_power"
    				break;
    				
    				
    		}
    
    		wait( 1.0 );
    	}
    }
    zombie_pentagon_teleporter.gsc

    Code:
    #include common_scripts\utility;
    #include maps\_utility;
    #include maps\_zombiemode_utility;
    #include maps\_zombiemode_zone_manager; 
    
    
    //-------------------------------------------------------------------------------
    // setup and kick off think functions
    //-------------------------------------------------------------------------------
    teleporter_init()
    {
    	
    	level.teleport_ae_funcs = [];
    	SetDvar( "pentagonAftereffectOverride", "-1" );
    
    	thread teleport_pad_init();
    	thread enable_zone_portals_init();
    	thread open_portal_rooms();
    	thread pack_hideaway_init();
    	
    	poi1 = GetEnt("pack_room_poi1", "targetname");
    	poi2 = GetEnt("pack_room_poi2", "targetname");
    
    	// attract_dist, num_attractors, added_poi_value, start_turned_on
    	poi1 create_zombie_point_of_interest( undefined, 30, 0, false );
    	poi1 thread create_zombie_point_of_interest_attractor_positions( 4, 45 );
    	
    	poi2 create_zombie_point_of_interest( undefined, 30, 0, false );
    	poi2 thread create_zombie_point_of_interest_attractor_positions( 4, 45 );
    
    }
    
    //-------------------------------------------------------------------------------
    // handles turning on the pad.
    //-------------------------------------------------------------------------------
    teleport_pad_init()
    {
    	level.portal_trig = GetEntArray( "portal_trigs", "targetname" );
    	for ( i = 0; i < level.portal_trig.size; i++ )
    	{
    		level.portal_trig[i].active = true;
    		level.portal_trig[i].portal_used =[];
    		level.portal_trig[i] thread player_teleporting();
    	}
    }
    //-------------------------------------------------------------------------------
    // DCS: hideaway closet for pack a punch.
    //-------------------------------------------------------------------------------
    pack_hideaway_init()
    {
    	hideaway = GetEnt("pack_hideaway","targetname");
    	parts = GetEntArray(hideaway.target, "targetname");
    
    	level.punch_trigger = GetEnt( "zombie_vending_upgrade", "targetname" );
    	level.punch_machine = GetEnt( level.punch_trigger.target, "targetname" );
    	level.punch_sign = GetEnt( level.punch_machine.target, "targetname" );
    	level.punch_sign LinkTo( level.punch_machine );
    
    	if(IsDefined(level.punch_trigger))
    	{
    		level.punch_trigger EnableLinkTo();
    		level.punch_trigger LinkTo(hideaway);
    	}
    	if(IsDefined(level.punch_machine))
    	{
    		level.punch_machine LinkTo(hideaway);
    	}
    	
    	pack_audio_trig = GetEnt( "pack_audio_trig", "script_noteworthy" );
    	pack_audio_trig EnableLinkTo();
    	pack_audio_trig LinkTo(hideaway);
    
    	if(IsDefined(parts))
    	{
    		for ( i = 0; i < parts.size; i++ )
    		{
    			parts[i] LinkTo(hideaway);
    		}	
    	}
    	while(true)
    	{	
    		flag_wait("open_pack_hideaway");
    	
    		hideaway NotSolid();
    		hideaway RotateYaw(180, 2.5);
    		hideaway PlaySound( "evt_packapunch_revolve_start" );
    		hideaway PlayLoopSound( "evt_packapunch_revolve_loop" );
    		hideaway waittill("rotatedone");
    		level.punch_trigger SetVisibleToAll();
    		level.punch_trigger trigger_on();
    		
    		hideaway StopLoopSound( 1 );
    	    hideaway PlaySound( "evt_packapunch_revolve_end" );
    		
    		level.punch_sign Unlink();
    		
    		// time given for everyone to pack if they want.
    		//level waittill("defcon_reset");
    		wait(40); // additional time after countdown
    	
    		if(flag("pack_machine_in_use"))
    		{
    			while(flag("pack_machine_in_use"))
    			{
    				wait(0.1);
    			}	
    		}	
    		level.punch_sign LinkTo( level.punch_machine );
    		level.punch_trigger trigger_off();
    		
    		players = get_players();
    		for ( i = 0; i < players.size; i++ )
    		{
    			level.punch_trigger SetInvisibleToPlayer(players[i]);
    		}
    		
    		hideaway RotateYaw(180, 2.5);
    		hideaway PlaySound( "evt_packapunch_revolve_start" );
    		hideaway PlayLoopSound( "evt_packapunch_revolve_loop" );
    		flag_clear("open_pack_hideaway");
    		wait_network_frame();
    		hideaway waittill("rotatedone");
    		hideaway StopLoopSound( 1 );
    	    hideaway PlaySound( "evt_packapunch_revolve_end" );
    	}	
    }	
    //-------------------------------------------------------------------------------
    // DCS: Pack room door init
    //-------------------------------------------------------------------------------
    pack_door_init()
    {
    	trigger = GetEnt("pack_room_door","targetname");
    	doors = GetEntArray(trigger.target, "targetname");
    	pack_door_slam = GetEnt("slam_pack_door","targetname");
    	pack_door_open = false;
    	
    	while(true)
    	{
    		trigger sethintstring( &"ZOMBIE_PENTAGON_PACK_ROOM_DOOR" );
    		trigger setcursorhint( "HINT_NOICON" );
    		level waittill("defcon_reset");				
    
    		players = get_players();
    	
    		if(level.zones["conference_level2"].is_occupied)
    		{
    			
    			if(level.zones["war_room_zone_south"].is_enabled  && !flag("bonfire_reset"))
    			{
    				// Open doors, if war room south has been enabled, otherwise they have to go through the portal.
    				trigger sethintstring( "" );
    				for ( i = 0; i < doors.size; i++ )
    				{
    					doors[i].start_angles = doors[i].angles;
    					
    					if(isDefined(doors[i].script_angles))
    					{
    						doors[i] NotSolid();
    						doors[i] RotateTo( doors[i].script_angles, 1.0 );
    						play_sound_at_pos( "door_rotate_open", doors[i].origin );
    						doors[i] thread pack_door_solid_thread(); 
    					}
    				}
    				pack_door_open = true;	
    			}
    			
    			// wait for players to leave zone.
    			while(!is_packroom_clear())
    			{
    				if(flag("bonfire_reset")) // leave loop if bonfire sale picked up.
    				{
    					break;
    				}	
    				wait(0.1);
    			}
    			
    			if(	pack_door_open == true)
    			{
    				// close doors
    				for ( i = 0; i < doors.size; i++ )
    				{
    					if(isDefined(doors[i].script_angles))
    					{
    						doors[i] NotSolid();
    						doors[i] RotateTo( doors[i].start_angles, 0.25 );
    						play_sound_at_pos( "door_rotate_open", doors[i].origin );
    						doors[i] thread pack_door_solid_thread();
    					}
    				}
    			}
    		}
    		if(flag("bonfire_reset"))
    		{
    			flag_clear("bonfire_reset");
    			//IPrintLnBold("bonfire reset cleared");	
    		}
    		else
    		{
    			level notify("pack_room_reset");
    		}			
    		wait_network_frame();
    	}
    }
    
    //-------------------------------------------------------------------------------
    is_packroom_clear()
    {
    	pack_door_slam = GetEnt("slam_pack_door","targetname");
    	pack_room_trig = GetEnt("pack_room_trigger", "targetname");
    
    	players = get_players();
    	for ( i = 0; i < players.size; i++ )
    	{
    		if(players[i] IsTouching(pack_door_slam))
    		{
    			return false;
    		}
    	}		
    	if(level.zones["conference_level2"].is_occupied)
    	{
    		return false;
    	}
    	else if(flag("thief_round"))
    	{
    		zombies = GetAIArray("axis");
    		for (i = 0; i < zombies.size; i++)
    		{
    			if(IsDefined(zombies[i].animname) && zombies[i].animname == "thief_zombie" 
    			&& zombies[i] IsTouching(pack_room_trig))
    			{
    				return false;
    			}
    			if(IsDefined(zombies[i].animname) && zombies[i].animname == "thief_zombie" 
    			&& zombies[i] IsTouching(pack_door_slam))
    			{
    				return false;
    			}	
    		}
    	}
    	return true;
    }	
    
    //-------------------------------------------------------------------------------
    pack_door_solid_thread()
    {
    	self waittill( "rotatedone" );
    	
    	self.door_moving = undefined;
    	while( 1 )
    	{
    		players = get_players(); 
    		player_touching = false; 
    		for( i = 0; i < players.size; i++ )
    		{
    			if( players[i] IsTouching( self ) )
    			{
    				player_touching = true; 
    				break; 
    			}
    		}
    
    		if( !player_touching )
    		{
    			self Solid();
    			
    			// Now connect paths after door is cleared.
    			if(self.angles != self.start_angles) 
    			{
    				self ConnectPaths();
    			}
    			else
    			{
    				self DisconnectPaths();
    			}			
    			return; 
    		}
    		wait( 1 ); 
    	}
    
    }
    clear_zombies_in_packroom()
    {
    	pack_room_trig = GetEnt("pack_room_trigger", "targetname");
    
    	if(flag("thief_round"))
    	{
    		return;
    	}	
    
    	zombies = GetAIArray("axis");
    	if(!IsDefined(zombies))
    	{
    		return;
    	}	
    	for (i = 0; i < zombies.size; i++)
    	{
    		if ( zombies[i] IsTouching(pack_room_trig) )
    		{
    			if(zombies[i].ignoreall == true ) // not through barricade
    			{
    				level.zombie_total++;
    				if(IsDefined(zombies[i].fx_quad_trail))
    				{
    					zombies[i].fx_quad_trail Delete();
    				}
    				zombies[i] maps\_zombiemode_spawner::reset_attack_spot();
    				
    				zombies[i] notify("zombie_delete");
    				zombies[i] Delete();
    			}
    			else
    			{
    				zombies[i] thread send_zombies_out(level.portal_pack);
    			}	
    		}	
    	}
    }
    
    //-------------------------------------------------------------------------------
    // handles moving the players and fx, etc...moved out so it can be threaded
    //-------------------------------------------------------------------------------
    player_teleporting()
    {
    	user = undefined;
    	while(true)
    	{
    		self waittill( "trigger", user );
    		
    		player_used = false;
    
    		if(IsDefined(self.portal_used))
    		{
    			for (i = 0; i < self.portal_used.size; i++)
    			{
    				if(self.portal_used[i] == user)
    				{
    					player_used = true;
    				}	
    			}	
    		}
    				
    		wait_network_frame();
    		
    		if(player_used == true)
    		{
    			continue;
    		}	
    		// DCS 081810: also allow when in last stand
    		else if ( is_player_valid( user ) || user maps\_laststand::player_is_in_laststand())
    		{	
    			self thread Teleport_Player(user);
    		}
    
    	}
    }
    cooldown_portal_timer(player)
    {
    	//self.active = false;
    	self.portal_used = array_add(self.portal_used, player);
    	
    	time = 0;
    	while(!flag("defcon_active") && time < 20 )
    	{
    		wait(1);
    		time++;
    	}	
    	//self.active = true;
    	self.portal_used = array_remove(self.portal_used, player);
    }	
    //-------------------------------------------------------------------------------
    //-------------------------------------------------------------------------------
    teleport_player(user)
    {
    	prone_offset = (0, 0, 49);
    	crouch_offset = (0, 0, 20);
    	stand_offset = (0, 0, 0);
    	destination = undefined;
    	dest_trig = 0;		
    
    	if(IsDefined(user.teleporting) && user.teleporting == true)
    	{
    		return;
    	}
    	
    	user.teleporting = true;
    	user FreezeControls( true );
    	user disableOffhandWeapons();
    	user disableweapons();
    	
    	// random portal to exit check, or at defcon 5 go to pack room, pack room still goes random.
    	if(flag("defcon_active") && self.script_noteworthy != "conference_level2")
    	{
    		for ( i = 0; i < level.portal_trig.size; i++ )
    		{
    			if(IsDefined(level.portal_trig[i].script_noteworthy) && level.portal_trig[i].script_noteworthy == "conference_level2")
    			{
    				dest_trig = i;
    				user thread start_defcon_countdown();
    				self thread defcon_pack_poi();
    			}
    		}		
    	}
    	else
    	{	
    		dest_trig = find_portal_destination(self);
    		
    		// rediculous failsafe.
    		if(!IsDefined(dest_trig))
    		{
    			while(!IsDefined(dest_trig))
    			{
    				dest_trig = find_portal_destination(self);
    				break;
    				wait_network_frame();
    			}	
    		}
    		
    		// setup zombies to follow. 
    		self thread no_zombie_left_behind(level.portal_trig[dest_trig], user);		
    	}
    
    	// script origin trigger destination targets for player placement.
    	player_destination = getstructarray(level.portal_trig[dest_trig].target, "targetname");
    	if(IsDefined(player_destination))
    	{
    		for ( i = 0; i < player_destination.size; i++ )
    		{
    			if(IsDefined(player_destination[i].script_noteworthy) && player_destination[i].script_noteworthy == "player_pos")
    			{
    				destination = player_destination[i];
    			}
    		}
    	}
    	
    	if(!IsDefined(destination))
    	{
    		destination = groundpos(level.portal_trig[dest_trig].origin);
    	}
    		
    	// add cool down for exiting portal.
    	level.portal_trig[dest_trig] thread cooldown_portal_timer(user);
    				
    	if( user getstance() == "prone" )
    	{
    		desired_origin = destination.origin + prone_offset;
    	}
    	else if( user getstance() == "crouch" )
    	{
    		desired_origin = destination.origin + crouch_offset;
    	}
    	else
    	{
    		desired_origin = destination.origin + stand_offset;
    	}			
    			
    
    
    	wait_network_frame();
    	PlayFX(level._effect["transporter_start"], user.origin);
    	playsoundatposition( "evt_teleporter_out", user.origin );
    
    	//user.teleport_origin = spawn( "script_origin", user.origin );
    	//user.teleport_origin.angles = user.angles;
    	//user linkto( user.teleport_origin );
    	//user.teleport_origin.origin = desired_origin;
    	//user.teleport_origin.angles = destination.angles;
    
    	// trying to force angles on player.
    	user SetOrigin( desired_origin );
    	user SetPlayerAngles( destination.angles );
    	
    	PlayFX(level._effect["transporter_beam"], user.origin);
    	playsoundatposition( "evt_teleporter_go", user.origin );
    	wait(0.5);
    	user enableweapons();
    	user enableoffhandweapons();
    	user FreezeControls( false );
    	user.teleporting = false;
    
    
    	//user Unlink();
    //	if(IsDefined(user.teleport_origin))
    //	{
    //		user.teleport_origin Delete();
    //	}
    	
    	//now check if and empty floors to clean up.
    	level thread check_if_empty_floors();
    
    	setClientSysState( "levelNotify", "cool_fx", user );			
    
    	//teleporter after effects.
    	setClientSysState( "levelNotify", "ae1", user );
    	wait( 1.25 );
    	
    	//check if a thief round. 
    	if(flag("thief_round"))
    	{
    		setClientSysState( "levelNotify", "vis4", user );			
    		return;
    	}
    	else
    	{
    		user.floor = maps\_zombiemode_ai_thief::thief_check_floor( user );
    		setClientSysState( "levelNotify", "vis" + user.floor, user );
    	}
    	
    
    	
    }
    //-------------------------------------------------------------------------------
    // checks for portal destinations and is valid.
    //-------------------------------------------------------------------------------
    find_portal_destination(orig_trig)
    {
    	// rsh091310 - thief can override destination
    	if(IsDefined(orig_trig.thief_override))
    	{
    		return orig_trig.thief_override;
    	}
    
    	// DCS 091210: power room portal go to another floor.
    	if(IsDefined(orig_trig.script_string) && orig_trig.script_string == "power_room_portal")
    	{
    		loc = [];
    		
    		for (i = 0; i < level.portal_trig.size; i++)
    		{
    			if(level.portal_trig[i].script_noteworthy == "war_room_zone_north")
    			{
    				loc[0] = i;
    			}
    			else if(level.portal_trig[i].script_noteworthy == "conference_level1")
    			{
    				loc[1] = i;
    			}
    		}
    		
    		dest_trig = loc[RandomIntRange(0,2)];
    		return dest_trig;
    	}	
    	else
    	{
    		dest_trig = RandomIntRange(0,level.portal_trig.size);
    	
    		assertex(IsDefined(level.portal_trig[dest_trig].script_noteworthy),"portals need a script_noteworthy");
    	
    		// make sure didn't pick same portal or to inactive zone.
    		if(level.portal_trig[dest_trig] == orig_trig || level.portal_trig[dest_trig].script_noteworthy == "conference_level2" 
    		|| !level.zones[level.portal_trig[dest_trig].script_noteworthy].is_enabled)
    		{
    			
    			portals = level.portal_trig;
    				
    			for( i = 0; i < level.portal_trig.size; i ++)
    			{
    				level.portal_trig[i].index = i;
    				
    				if(level.portal_trig[i] == orig_trig || level.portal_trig[i].script_noteworthy == "conference_level2" 
    				|| !level.zones[level.portal_trig[i].script_noteworthy].is_enabled)
    				{
    					portals = array_remove( portals, level.portal_trig[i] );
    				}
    			}
    
    			rand = RandomIntRange(0, portals.size);
    			dest_trig = portals[rand].index;
    			//IPrintLnBold("destination ", level.portal_trig[dest_trig].script_noteworthy);
    		}
    		return dest_trig;
    	}
    }
    //-------------------------------------------------------------------------------
    //	DCS 090410: now only used for pack room cleanup.
    //	if can't be seen kill and so replacement can spawn closer to player.
    //-------------------------------------------------------------------------------
    
    delete_zombie_noone_looking(how_close, verticle_only, need_to_see)
    {
    	self endon( "death" );
    
    	if(!IsDefined(how_close))
    	{
    		how_close = 500;
    	}
    	if(!IsDefined(verticle_only))
    	{
    		verticle_only = true;
    	}		
    	if(!IsDefined(need_to_see))
    	{
    		need_to_see = true;
    	}
    	
    	self.inview = 0;
    	self.player_close = 0;
    	
    	players = getplayers();
    	for ( i = 0; i < players.size; i++ )
    	{
    		can_be_seen = self player_can_see_me(players[i]);
    		
    		if(can_be_seen)
    		{
    			self.inview++;
    		}
    		else
    		{
    			if(verticle_only)
    			{						
    				//checking to see if 500 units above or below, likely 2 floors
    				closest = abs(self.origin[2] - players[i].origin[2]);
    				if(closest < how_close)
    				{
    					self.player_close++;
    				}					
    			}
    			else
    			{
    				// DCS 081910: changing to any distance not just up and down.
    				closest = Distance(self.origin, players[i].origin);
    				if(closest < how_close)
    				{
    					self.player_close++;
    				}					
    			}		
    		}		
    	}	
    
    	// if can't be seen and likely 2 floors below or above (500 units)...
    	// raise total for round by one and kill zombie so another can spawn closer to players.
    	// none close, none in view.	
    	wait_network_frame();
    	if(self.inview == 0 && self.player_close == 0 || need_to_see == false && self.player_close == 0)
    	{
    		if(IsDefined(self.teleporting) && self.teleporting == true)
    		{
    			return;
    		}
    		else //kill zombie so another can spawn closer.
    		{
    			//IPrintLnBold("Killing zombie so another can spawn closer");
    			if(IsDefined(self.animname) && self.animname == "thief_zombie")
    			{
    				return;
    			}
    			else
    			{
    				// deleting quads leaves their effect, must delete fx.
    				if(IsDefined(self.animname) &&  self.animname == "quad_zombie")
    				{
    					level.zombie_total++;
    					if(IsDefined(self.fx_quad_trail))
    					{
    						self.fx_quad_trail Delete();
    					}
    					self notify("zombie_delete");
    					self Delete();
    				}
    				else
    				{	 
    					level.zombie_total++;
    					self maps\_zombiemode_spawner::reset_attack_spot();
    					self notify("zombie_delete");
    					self Delete();
    				}	
    			}	
    		}
    	}
    }
    //-------------------------------------------------------------------------------
    // Utility for checking if the player can see the zombie (ai).
    // Can the player see me?
    //-------------------------------------------------------------------------------
    player_can_see_me( player )
    {
    	playerAngles = player getplayerangles();
    	playerForwardVec = AnglesToForward( playerAngles );
    	playerUnitForwardVec = VectorNormalize( playerForwardVec );
    
    	banzaiPos = self.origin;
    	playerPos = player GetOrigin();
    	playerToBanzaiVec = banzaiPos - playerPos;
    	playerToBanzaiUnitVec = VectorNormalize( playerToBanzaiVec );
    
    	forwardDotBanzai = VectorDot( playerUnitForwardVec, playerToBanzaiUnitVec );
    	angleFromCenter = ACos( forwardDotBanzai ); 
    
    	playerFOV = GetDvarFloat( #"cg_fov" );
    	banzaiVsPlayerFOVBuffer = GetDvarFloat( #"g_banzai_player_fov_buffer" );	
    	if ( banzaiVsPlayerFOVBuffer <= 0 )
    	{
    		banzaiVsPlayerFOVBuffer = 0.2;
    	}
    
    	playerCanSeeMe = ( angleFromCenter <= ( playerFOV * 0.5 * ( 1 - banzaiVsPlayerFOVBuffer ) ) );
    
    	return playerCanSeeMe;
    }
    //-------------------------------------------------------------------------------
    // Hidden teleporters revealed when power turned on.
    //-------------------------------------------------------------------------------
    open_portal_rooms()
    {
    	yellow_conf_screen = GetEnt("yellow_conf_screen", "targetname");
    	power_room_screen = GetEnt("power_room_screen", "targetname");
    	jfk_room_screen = GetEnt("jfk_room_screen", "targetname");
    	war_room_screen_north = GetEnt("war_room_screen_north", "targetname");
    	war_room_screen_ramp = GetEnt("war_room_screen_ramp", "targetname");
    
    	flag_wait( "power_on" );
    	yellow_conf_screen PlaySound( "evt_teleporter_door_short" );
    	yellow_conf_screen MoveZ(116, 1.5);
    	yellow_conf_screen ConnectPaths();
    	
    	power_room_screen PlaySound( "evt_teleporter_door_short" );
    	power_room_screen MoveZ(116, 1.5);
    	power_room_screen ConnectPaths();	
        
      jfk_room_screen PlaySound( "evt_teleporter_door_long" );
    	jfk_room_screen MoveZ(150, 2.0);
    	jfk_room_screen ConnectPaths();
        
      war_room_screen_north PlaySound( "evt_teleporter_door_short" );
    	level thread war_room_portal_door();
    
    	war_room_screen_north MoveZ(-122, 1.5);
    	war_room_screen_ramp MoveY(46, 1.5);
    	war_room_screen_ramp waittill("movedone");
    	war_room_screen_north ConnectPaths();
    	
    }
    war_room_portal_door()
    {
    	war_room_screen_south = GetEnt("war_room_screen_south", "targetname");
    
    	war_room_screen_south PlaySound( "evt_teleporter_door_short" );
    	war_room_screen_south MoveZ(-120, 1.5);
    	war_room_screen_south waittill("movedone");
    	war_room_screen_south ConnectPaths();
    }	
    //-------------------------------------------------------------------------------
    // zone enable through portals
    // script_noteworthy  = name of zone to enable upon entry.
    //-------------------------------------------------------------------------------
    enable_zone_portals_init()
    {
    	portal_zone_trig = GetEntArray( "portal_zone_trigs", "targetname" );
    	for ( i = 0; i < portal_zone_trig.size; i++ )
    	{
    		portal_zone_trig[i] thread enable_zone_portals();
    	}
    }
    enable_zone_portals()
    {
    		self waittill( "trigger", user );
    		if ( (  user maps\_laststand::player_is_in_laststand() || is_player_valid( user ) ) && 
    		IsDefined(self.script_noteworthy) )
    		{	
    			level thread maps\_zombiemode_zone_manager::enable_zone(self.script_noteworthy);
    		}	
    }	
    	
    	
    //-------------------------------------------------------------------------------
    // Check for lost Zombies.
    // If close to portal player went through have the zombie follow.
    // self = portal trigger entered by player, portal_trig = destination portal.
    //-------------------------------------------------------------------------------
    no_zombie_left_behind(portal_trig, targeted_player)
    {
    	portal_enter = undefined;
    	teleporting_zombies = 0;
    	
    	portal_entered = getstructarray(self.target, "targetname");
    	for ( i = 0; i < portal_entered.size; i++ )
    	{
    		if(IsDefined(portal_entered[i].script_noteworthy) && portal_entered[i].script_noteworthy == "zombie_pos")
    		{
    			portal_enter = portal_entered[i];		
    		}
    	}	
    	if(!IsDefined(portal_enter))
    	{
    		return;
    	}		
    	// check distance to portal entered by player	
    	zombies = GetAIArray("axis");
    		if(IsDefined(zombies))
    	{
    		for( i = 0; i < zombies.size; i++ )
    		{
    			if(IsDefined(zombies[i].animname) && zombies[i].animname == "thief_zombie")
    			{
    				continue;
    			}
    			
    			// DCS: all zombies from conference room follow last player out.
    			else if(IsDefined(self.script_noteworthy) && self.script_noteworthy == "conference_level2" && !level.zones[ "conference_level2" ].is_occupied 
    			&& IsDefined(zombies[i].favoriteenemy) && zombies[i].favoriteenemy == targeted_player)
    			{
    				zombies[i].teleporting = true;
    				zombies[i] thread zombie_through_portal(portal_enter, portal_trig, targeted_player);
    			}	
    			else if(Distance(zombies[i].origin, portal_enter.origin) < 500 && IsDefined(zombies[i].favoriteenemy) && zombies[i].favoriteenemy == targeted_player)
    			{
    				//IPrintLnBold("Found zombie to send through portal");
    				zombies[i].teleporting = true;
    				zombies[i] thread zombie_through_portal(portal_enter, portal_trig, targeted_player);
    				teleporting_zombies++;
    			}	
    		}
    	}
    	
    	//IPrintLnBold("Here come ", teleporting_zombies, " zombies!");		
    }
    
    zombie_through_portal(portal_enter, portal_exit, targeted_player)
    {
    	self endon( "death" );
    	self endon( "damage" );
    
    	//returned close to other portal, probably in labs.
    	wait_network_frame();
    	if(Distance(self.origin, targeted_player.origin) < 500)
    	{
    		self.teleporting = false;		
    		return;
    	}
    
    	move_speed = undefined;
    	if(IsDefined(self.zombie_move_speed))
    	{
    		move_speed = self.zombie_move_speed;
    	}
    
    	self.ignoreall = true;
    	self notify( "stop_find_flesh" );
    	self notify( "zombie_acquire_enemy" );
    	self SetGoalPos(portal_enter.origin);
    
    	//IPrintLnBold("zombie heading to portal");
    
    	self.timed_out = false;
    	self thread teleportation_timed_out();
    	while(Distance(self.origin, portal_enter.origin) > self.goalradius && self.timed_out == false)
    	{
    		wait(0.1);
    	}		
    
    //	self waittill("goal");
    //	wait(RandomFloatRange(1.5,4.0));
    
    	//IPrintLnBold("zombie followed through portal");
    
    	if ( isDefined( self.pre_teleport_func ) )
    	{
    		self [[ self.pre_teleport_func ]]();
    	}
    	
    	PlayFX(level._effect["transporter_start"], self.origin);
    	playsoundatposition( "evt_teleporter_out", portal_enter.origin );
    
    	final_destination = getstructarray(portal_exit.target, "targetname");
    	for ( i = 0; i < final_destination.size; i++ )
    	{
    		if(IsDefined(final_destination[i].script_noteworthy) && final_destination[i].script_noteworthy == "zombie_pos")
    		{
    			portal_exit = final_destination[i];		
    		}
    	}
    	self forceteleport(portal_exit.origin + (AnglesToForward(portal_exit.angles) * RandomFloatRange(0,64)),portal_exit.angles);
    	PlayFX(level._effect["transporter_beam"], portal_exit.origin);
    	playsoundatposition( "evt_teleporter_go", portal_exit.origin );
    
    	self.teleporting = false;
    	self.ignoreall = false;
    	self thread maps\_zombiemode_spawner::find_flesh();
    	
    	if(IsDefined(move_speed))
    	{
    		self.zombie_move_speed = move_speed;
    	}
    
    	if ( isDefined( self.post_teleport_func ) )
    	{
    		self [[ self.post_teleport_func ]]();
    	}
    }		
    
    //-------------------------------------------------------------------------------
    //	DCS: Zombie Pentagon Pack-A-Punch System
    //	Rises from level 1 to 5 then links all portals to pack-a-punch room.
    //-------------------------------------------------------------------------------
    pentagon_packapunch_init()
    {
    	level.defcon_level = 1;
    	level.defcon_activated = false;
    	level.ignore_spawner_func = ::pentagon_ignore_spawner;
    
    	level thread defcon_sign_lights();
    
    	punch_switches = GetEntArray("punch_switch","targetname");
    	if(IsDefined(punch_switches))
    	{
    		for ( i = 0; i < punch_switches.size; i++ )
    		{
    			punch_switches[i] thread defcon_sign_setup();
    		}
    	}			
    }
    defcon_sign_setup()
    {
    	self SetHintString( &"ZOMBIE_NEED_POWER" );
    	self setcursorhint( "HINT_NOICON" );
    		
    	flag_wait("power_on");
    
    	//change sign level, turn light or representation of used switch
    	self.lights = GetEntArray(self.target, "targetname");
    	if(IsDefined(self.lights))
    	{
    		for ( j = 0; j < self.lights.size; j++ )
    		{
    			if(IsDefined(self.lights[j].script_noteworthy) && self.lights[j].script_noteworthy == "defcon_bulb")
    			{
    				self.lights[j] SetModel("zombie_trap_switch_light_on_green");
    			}
    		}
    	}
    
    	while(true)
    	{
    		self SetHintString( &"ZOMBIE_PENTAGON_DEFCON_SWITCH" );
    		self waittill( "trigger", user );
    		self SetHintString( "" );
    		
    		if(IsDefined(self.lights))
    		{
    			for ( j = 0; j < self.lights.size; j++ )
    			{
    				if(IsDefined(self.lights[j].script_noteworthy) && self.lights[j].script_noteworthy == "defcon_bulb")
    				{
    					self.lights[j] SetModel("zombie_trap_switch_light_on_red");
    				}
    				if(IsDefined(self.lights[j].script_noteworthy) && self.lights[j].script_noteworthy == "defcon_handle")
    				{
    					self.lights[j] rotatepitch( -180, .5 );
    					self.lights[j] playsound( "zmb_defcon_switch" );
    				}					
    			}
    		}		
    			
    		if(level.defcon_level != 4)
    		{
    			level.defcon_level++;
    			
    			if( level.zombie_vars["zombie_powerup_bonfire_sale_on"] == false )
    			{
    			    level thread maps\zombie_pentagon_amb::play_pentagon_announcer_vox( "zmb_vox_pentann_defcon", level.defcon_level );
          }
                
    			level thread defcon_sign_lights();
    
    		}
    		else
    		{
    			//link all portals to pack-a-punch room.
    			level.defcon_level = 5;
    			
    			if( level.zombie_vars["zombie_powerup_bonfire_sale_on"] == false || !flag("bonfire_reset"))
    			{
    			    level thread maps\zombie_pentagon_amb::play_pentagon_announcer_vox( "zmb_vox_pentann_defcon", level.defcon_level );
    			}
    			
    			level thread defcon_sign_lights();
    		
    			
    			//IPrintLnBold("all portals to pack room");
    			flag_set("defcon_active");
    			
    			if( level.zombie_vars["zombie_powerup_bonfire_sale_on"] == false || !flag("bonfire_reset"))
    			{
    			    level thread play_defcon5_alarms();
    			}
    			
    			level thread pack_portal_fx_on();
    		}		
    		level waittill("pack_room_reset");
    		
    		if(!flag("bonfire_reset")) //DCS: don't want vo every time bonfire goes into effect.
    		{
    			level thread maps\zombie_pentagon_amb::play_pentagon_announcer_vox( "zmb_vox_pentann_defcon_reset" );
    		}
    		
    		if(IsDefined(self.lights))
    		{
    			for ( j = 0; j < self.lights.size; j++ )
    			{
    				if(IsDefined(self.lights[j].script_noteworthy) && self.lights[j].script_noteworthy == "defcon_bulb")
    				{
    					self.lights[j] SetModel("zombie_trap_switch_light_on_green");
    				}
    				if(IsDefined(self.lights[j].script_noteworthy) && self.lights[j].script_noteworthy == "defcon_handle")
    				{
    					self.lights[j] rotatepitch( 180, .5 );
    					self.lights[j] playsound( "zmb_defcon_switch" );
    				}					
    			}
    		}			
    					
    	}
    }
    //-------------------------------------------------------------------------------
    // DCS 091410: moving client notifies out so can have frame waits for splitscreen.
    //-------------------------------------------------------------------------------
    pack_portal_fx_on()
    {
    	players = get_players();
    	for ( i = 0; i < players.size; i++ )
    	{	
    		players[i] ClearClientFlag(level.ZOMBIE_PENTAGON_PLAYER_PORTALFX);			
    	}	
    }
    regular_portal_fx_on()
    {
    	players = get_players();
    	for ( i = 0; i < players.size; i++ )
    	{	
    		players[i] SetClientFlag(level.ZOMBIE_PENTAGON_PLAYER_PORTALFX);			
    	}
    }	
    //-------------------------------------------------------------------------------
    	
    defcon_sign_lights()
    {
    	//change sign level, turn light or representation of used switch
    	defcon_signs = GetEntArray("defcon_sign", "targetname");
    
    	defcon[1] = "p_zom_pent_defcon_sign_01";
    	defcon[2] = "p_zom_pent_defcon_sign_02";
    	defcon[3] = "p_zom_pent_defcon_sign_03";
    	defcon[4] = "p_zom_pent_defcon_sign_04";
    	defcon[5] = "p_zom_pent_defcon_sign_05";
    
    		
    	if(IsDefined(defcon_signs))
    	{
    		for ( i = 0; i < defcon_signs.size; i++ )
    		{
    			if(IsDefined(level.defcon_level))
    			{
    				defcon_signs[i] SetModel(defcon[level.defcon_level]);
    			}
    			else
    			{
    				defcon_signs[i] SetModel(defcon[1]);
    			}	
    		}
    	}
    }
    
    //-------------------------------------------------------------------------------
    start_defcon_countdown()
    {
    	if(level.defcon_activated)
    	{
    		return;
    	}
    	
    	//set adjacency for one way war room to cenference room.
    	if(level.zones["war_room_zone_south"].is_enabled)
    	{	
    		if(!flag("war_room_entry"))
    		{
    			flag_set("war_room_entry");
    		}
    	}
    	else
    	{
    		if(!flag("war_room_special"))
    		{		
    			flag_set("war_room_special");
    		}	
    	}	
    
    	// special spawning and cleanup for pack room.
    	level thread special_pack_time_spawning();
    	level thread special_pack_cleanup();
    
    	//open pack-a-punch hideaway.
    	flag_set("open_pack_hideaway");
    			
    	level.defcon_activated = true;
    	level.defcon_countdown_time = 30;
    	
    	while(level.defcon_level > 1)
    	{
    		wait(level.defcon_countdown_time /4);
    		level.defcon_level--;
    
    		level thread defcon_sign_lights();
    	}
    	
    	level.defcon_level = 1;
    	flag_clear("defcon_active");
    	level.defcon_activated = false;
    
    	level thread regular_portal_fx_on();
    	
    	flag_clear("bonfire_reset");
    	level notify("defcon_reset");
    }
    
    //-------------------------------------------------------------------------------
    special_pack_time_spawning()
    {
    	// no pack room spawning until level2
    	flag_set("no_pack_room_spawning");
    	maps\_zombiemode_zone_manager::reinit_zone_spawners();
    
    	while(level.defcon_level >= 3)
    	{
    		wait(0.1);
    	}
    	flag_clear("no_pack_room_spawning");
    	maps\_zombiemode_zone_manager::reinit_zone_spawners();
    }
    special_pack_cleanup()
    {
    	
    	while(flag("defcon_active"))
    	{
    		wait(1);
    	}
    	// Now clear the room of left over zombies.
    	if( level.zones["conference_level2"].is_occupied)
    	{
    		while( level.zones["conference_level2"].is_occupied)
    		{
    			wait(1);
    		}
    	}		
    	level thread clear_zombies_in_packroom();
    }	
    	
    //-------------------------------------------------------------------------------
    defcon_pack_poi()
    {
    	zone_name = "conference_level2";
    	players = get_players();
    	poi1 = GetEnt("pack_room_poi1", "targetname");
    	poi2 = GetEnt("pack_room_poi2", "targetname");
    
    	wait(0.5);
    	num_players = maps\_zombiemode_zone_manager::get_players_in_zone( zone_name );
    
    	if(num_players == players.size)
    	{
    		if(level.zones["war_room_zone_south"].is_enabled)
    		{		
    			poi1 activate_zombie_point_of_interest();
    		}
    		else
    		{
    			poi2 activate_zombie_point_of_interest();
    		}		
    	}
    	else
    	{
    		return;
    	}	
    
    	while(num_players >= players.size && flag("defcon_active"))
    	{
    		num_players = maps\_zombiemode_zone_manager::get_players_in_zone( zone_name );
    		wait (0.1);
    	}
    	
    	poi1 deactivate_zombie_point_of_interest();
    	poi2 deactivate_zombie_point_of_interest();
    	
    }	
    //-------------------------------------------------------------------------------
    // DCS 090110: check floors for no player when teleporting.
    //-------------------------------------------------------------------------------
    check_if_empty_floors()
    {
    	num_floor1 = 0;
    	num_floor2 = 0;
    	num_floor3 = 0;
    	
    	num_floor1_laststand = 0;
    	num_floor2_laststand = 0;
    	num_floor3_laststand = 0;
    
    	players = getplayers();
    	for ( i = 0; i < players.size; i++ )
    	{
    		players[i].floor = maps\_zombiemode_ai_thief::thief_check_floor( players[i] );
    		if(players[i].floor == 1)
    		{
    			num_floor1++;
    			if(players[i] maps\_laststand::player_is_in_laststand() || players[i].sessionstate == "spectator")
    			{
    				num_floor1_laststand++;
    			}	
    		}
    		else if(players[i].floor == 2 )
    		{
    			num_floor2++;
    			if(players[i] maps\_laststand::player_is_in_laststand() || players[i].sessionstate == "spectator")
    			{
    				num_floor2_laststand++;
    			}				
    		}
    		else if(players[i].floor == 3)
    		{
    			num_floor3++;
    			if(players[i] maps\_laststand::player_is_in_laststand() || players[i].sessionstate == "spectator")
    			{
    				num_floor3_laststand++;
    			}				
    		}	
    	}
    
    	// now see if need to delete zombies.
    	zombies = GetAIArray("axis");
    	if(!IsDefined(zombies))
    	{
    		return;
    	}
    
    	for (i = 0; i < zombies.size; i++)
    	{
    		zombies[i].floor = maps\_zombiemode_ai_thief::thief_check_floor( zombies[i] );
    
    		// leave thief zombie alone.
    		if(IsDefined(zombies[i].animname) && zombies[i].animname == "thief_zombie") 
    		{
    			continue;
    		}
    		else if(IsDefined(zombies[i].teleporting) && zombies[i].teleporting == true)
    		{
    			continue;
    		}
    		else if(IsDefined(zombies[i].floor) && zombies[i].floor == 1)
    		{
    			if(num_floor1 == num_floor1_laststand && players.size > 1 && flag("power_on"))
    			{
    				zombies[i] thread send_zombies_out(level.portal_top);
    			}
    			else if(num_floor1 == num_floor1_laststand && players.size > 1 && !flag("power_on"))
    			{
    				PlayFX(level._effect["transporter_start"], zombies[i].origin);
    				zombies[i] thread cleanup_unoccupied_floor();
    			}
    			else if(num_floor1 == 0)
    			{
    				if(flag("power_on"))
    				{
    					zombies[i] thread send_zombies_out(level.portal_top);
    				}
    				else
    				{
    					zombies[i] thread cleanup_unoccupied_floor();
    				}		
    			}
    			else
    			{
    				continue;
    			}		
    		}
    		else if(IsDefined(zombies[i].floor) && zombies[i].floor == 2)
    		{
    			if(num_floor2 == num_floor2_laststand && players.size > 1 && flag("power_on"))
    			{
    				zombies[i] thread send_zombies_out(level.portal_mid);
    			}
    			else if(num_floor2 == num_floor2_laststand && players.size > 1 && !flag("power_on"))
    			{
    				PlayFX(level._effect["transporter_start"], zombies[i].origin);
    				zombies[i] thread cleanup_unoccupied_floor();
    			}			
    			else if(num_floor2 == 0)
    			{
    				if(flag("power_on"))
    				{
    					zombies[i] thread send_zombies_out(level.portal_mid);
    				}
    				else
    				{
    					zombies[i] thread cleanup_unoccupied_floor();
    				}			
    			}
    			else
    			{
    				continue;
    			}								
    		}
    		else if(IsDefined(zombies[i].floor) && zombies[i].floor == 3)
    		{
    			if(num_floor3 == num_floor3_laststand && players.size > 1 && flag("power_on"))
    			{
    				zombies[i] thread send_zombies_out(level.portal_power);
    			}
    			else if(num_floor3 == num_floor3_laststand && players.size > 1 && !flag("power_on"))
    			{
    				PlayFX(level._effect["transporter_start"], zombies[i].origin);
    				zombies[i] thread cleanup_unoccupied_floor();
    			}			
    			else if(num_floor3 == 0)
    			{
    				if(flag("power_on"))
    				{				
    					zombies[i] thread send_zombies_out(level.portal_power);
    				}
    				else
    				{
    					zombies[i] thread cleanup_unoccupied_floor();
    				}					
    			}
    			else
    			{
    				continue;
    			}					
    		}
    		else // zombie not on known floor kill
    		{
    			level.zombie_total++;
    			zombies[i] DoDamage(zombies[i].health + 100, zombies[i].origin);			
    		}	
    	}
    }
    //-------------------------------------------------------------------------------
    // DCS 090310: last stand only person on floor.
    // if zombies on floor where only player is in last stand
    // we need to get zombies out of sight  and teleport or delete them.
    //-------------------------------------------------------------------------------
    send_zombies_out(portal)
    {
    	self endon("death");
    
    	move_speed = undefined;
    	if(IsDefined(self.zombie_move_speed))
    	{
    		move_speed = self.zombie_move_speed;
    	}
    	
    	self.ignoreall = true;
    	self.teleporting = true;
    	
    	self notify( "stop_find_flesh" );
    	self notify( "zombie_acquire_enemy" );
    	self SetGoalPos(portal.origin);
    
    	self.timed_out = false;
    	self thread teleportation_timed_out();
    	while(Distance(self.origin, portal.origin) > self.goalradius && self.timed_out == false)
    	{
    		wait(0.1);
    	}		
    	
    	PlayFX(level._effect["transporter_start"], self.origin);
    	playsoundatposition( "evt_teleporter_out", self.origin );
    	if(portal == level.portal_pack)
    	{
    		// send to warroom mid first, then check floors.
    		self forceteleport(level.portal_mid.origin + (AnglesToForward(level.portal_mid.angles) * RandomFloatRange(0,32)),level.portal_mid.angles);
    		PlayFX(level._effect["transporter_beam"], level.portal_top.origin);
    		playsoundatposition( "evt_teleporter_go", level.portal_top.origin);
    		
    		self thread cleanup_unoccupied_floor(move_speed);
    	}
    	else
    	{	
    		self thread cleanup_unoccupied_floor(move_speed);
    	}	
    }
    teleportation_timed_out()
    {
    	time = 0;
    	while(IsDefined(self) && !self.timed_out && time < 20 )
    	{
    		wait(1);
    		time++;
    	}
    	if(IsDefined(self))
    	{	
    		self.timed_out = true;
    	}	
    }
    //-------------------------------------------------------------------------------
    // DCS 090410:	send zombie on unoccupied floor to occupied floor
    //							or back into array.
    //-------------------------------------------------------------------------------
    
    cleanup_unoccupied_floor(move_speed,current_floor,next_floor)
    {	
    	self endon( "death" );
    	self notify("teleporting");
    
    	// even if defined could have changed.
    	self.floor = maps\_zombiemode_ai_thief::thief_check_floor( self );
    	self maps\_zombiemode_spawner::reset_attack_spot();
    
    	// should have been covered before, just making sure.
    	if(IsDefined(self.animname) && self.animname == "thief_zombie") 
    	{
    		return;
    	}
    
    	num_floor1 = 0;
    	num_floor2 = 0;
    	num_floor3 = 0;
    	num_floor1_laststand = 0;
    	num_floor2_laststand = 0;
    	num_floor3_laststand = 0;
    	pos_num = 0;
    	teleport_pos = [];
    
    	players = get_players();
    	for ( i = 0; i < players.size; i++ )
    	{
    		players[i].floor = maps\_zombiemode_ai_thief::thief_check_floor( players[i] );
    		
    		//now check number in each floor
    		if(players[i].floor == 1)
    		{
    			num_floor1++;
    			if(players[i] maps\_laststand::player_is_in_laststand() || players[i].sessionstate == "spectator")
    			{
    				num_floor1_laststand++;
    			}	
    		}
    		else if(players[i].floor == 2)
    		{
    			num_floor2++;
    			if(players[i] maps\_laststand::player_is_in_laststand() || players[i].sessionstate == "spectator")
    			{
    				num_floor2_laststand++;
    			}				
    		}
    		else if(players[i].floor == 3)
    		{
    			num_floor3++;
    			if(players[i] maps\_laststand::player_is_in_laststand() || players[i].sessionstate == "spectator")
    			{
    				num_floor3_laststand++;
    			}				
    		}
    	}		
    		
    	if(flag("power_on")) //teleport them through portals.
    	{
    		if(num_floor3 > 0 && num_floor3 != num_floor3_laststand && self.floor != 3)
    		{
    			num = RandomIntRange(0, level.portal_bottom.size);
    
    			self forceteleport(level.portal_bottom[num].origin + (AnglesToForward(level.portal_bottom[num].angles) * RandomFloatRange(0,32)),level.portal_bottom[num].angles);
    			PlayFX(level._effect["transporter_beam"], level.portal_bottom[num].origin);
    			playsoundatposition( "evt_teleporter_go", level.portal_bottom[num].origin);
    		}
    		else if(num_floor2 > 0  && num_floor2 != num_floor2_laststand && self.floor != 2)
    		{
    			self forceteleport(level.portal_mid.origin + (AnglesToForward(level.portal_mid.angles) * RandomFloatRange(0,32)),level.portal_mid.angles);
    			PlayFX(level._effect["transporter_beam"], level.portal_mid.origin);
    			playsoundatposition( "evt_teleporter_go", level.portal_mid.origin);
    		}			
    		else if(num_floor1 > 0  && num_floor1 != num_floor1_laststand && self.floor != 1)
    		{	
    			self forceteleport(level.portal_top.origin + (AnglesToForward(level.portal_top.angles) * RandomFloatRange(0,32)),level.portal_top.angles);
    			PlayFX(level._effect["transporter_beam"], level.portal_top.origin);
    			playsoundatposition( "evt_teleporter_go", level.portal_top.origin);
    		}
    		
    		self.teleporting = false;
    		self.ignoreall = false;
    		self thread maps\_zombiemode_spawner::find_flesh();
    	
    		if(IsDefined(move_speed))
    		{
    			self.zombie_move_speed = move_speed;
    		}
    
    	}
    	else // will pop all but quads into spawn closets.
    	{
    		self.teleporting = false;
    		
    		if(!IsDefined(self.animname) || self.animname != "quad_zombie")
    		{
    			if(self.health == level.zombie_health) // can cause problems teleporting everyone into spawn closets.
    			{
    				level.zombie_total++;
    				if(IsDefined(self.fx_quad_trail))
    				{
    					self.fx_quad_trail Delete();
    				}
    				self maps\_zombiemode_spawner::reset_attack_spot();
    
    				self notify("zombie_delete");
    				self Delete();
    			}	
    			else if(IsDefined(next_floor) && IsDefined(current_floor)) // if using elevator send to next floor
    			{
    				if(next_floor == 3 && current_floor == 2)
    				{
    					teleport_pos = getstructarray("elevator1_down_hidden", "targetname");	
    				}
    				else if(next_floor == 2 && current_floor == 3)
    				{
    					teleport_pos = getstructarray("elevator1_up_hidden", "targetname");	
    				}						
    				else if(next_floor == 2 && current_floor == 1)
    				{
    					teleport_pos = getstructarray("elevator2_down_hidden", "targetname");	
    				}			
    				else if(next_floor == 1 && current_floor == 2)
    				{	
    					teleport_pos = getstructarray("elevator2_up_hidden", "targetname");	
    				}				
    			}
    			else // send to other occupied floors.
    			{	
    				if(num_floor3 > 0  && num_floor3 != num_floor3_laststand && self.floor != 3)
    				{
    					teleport_pos = getstructarray("elevator1_down_hidden", "targetname");	
    				}
    				else if(num_floor2 > 0  && num_floor2 != num_floor2_laststand && self.floor != 2)
    				{
    					teleport_pos = getstructarray("elevator2_down_hidden", "targetname");
    					//IPrintLnBold("teleport to war room");
    				}			
    				else if(num_floor1 > 0  && num_floor1 != num_floor1_laststand && self.floor != 1)
    				{	
    					teleport_pos = getstructarray("elevator2_up_hidden", "targetname");
    					//IPrintLnBold("teleport to offices");
    				}
    				else
    				{
    					return;
    				}	
    			}
    			
    			if(IsDefined(teleport_pos))
    			{
    				pos_num = RandomIntRange(0,teleport_pos.size);
    				self forceteleport(teleport_pos[pos_num].origin + (RandomFloatRange(0,22), RandomFloatRange(0,22), 0),teleport_pos[pos_num].angles);
    			}
    					
    			// now reset zombie to tear through barricade.
    			wait(1);
    			if(IsDefined(self))
    			{
    				self.ignoreall = true;
    				self notify( "stop_find_flesh" );
    				self notify( "zombie_acquire_enemy" );
    	
    				wait_network_frame();			
    				if(IsDefined(self.target))
    				{
    					self.target = undefined;
    				}
    				self thread maps\_zombiemode_spawner::zombie_think();
    			}	
    		}		
    		// deleting quads leaves their effect, must delete fx.
    		else if(IsDefined(self.animname) &&  self.animname == "quad_zombie")
    		{
    			level.zombie_total++;
    			if(IsDefined(self.fx_quad_trail))
    			{
    				self.fx_quad_trail Delete();
    			}
    			self notify("zombie_delete");
    			self Delete();
    		}
    		else
    		{	 
    			level.zombie_total++;
    			self maps\_zombiemode_spawner::reset_attack_spot();
    
    			self notify("zombie_delete");
    			self Delete();
    		}
    	}		
    }
    
    //-------------------------------------------------------------------------------
    // DCS 090210: turn on/off portal wires.
    //-------------------------------------------------------------------------------
    teleporter_power_cable()
    {
    	cable_on = GetEnt("teleporter_link_cable_on","targetname");
    	cable_off = GetEnt("teleporter_link_cable_off","targetname");
    	
    	cable_on Hide();
    	
    	flag_wait( "power_on" );
    	
    	cable_off Hide();
    	cable_on Show();
    }
    
    //-------------------------------------------------------------------------------		
    // DCS: copy of ignore spawner functio.
    //-------------------------------------------------------------------------------		
    pentagon_ignore_spawner( spawner )
    {
    	if ( flag( "no_pack_room_spawning" ) )
    	{
    		if (spawner.targetname == "conference_level2_spawners" )
    		{
    			return true;
    		}
    	}
    	if ( flag( "no_warroom_elevator_spawning" ) )
    	{
    		if (spawner.targetname == "war_room_zone_elevator_spawners" )
    		{
    			return true;
    		}
    	}
    	if ( flag( "no_labs_elevator_spawning" ) )
    	{
    		if (spawner.targetname == "labs_elevator_spawners" )
    		{
    			return true;
    		}
    	}	
    	return false;
    }
    
    play_defcon5_alarms()
    {
        structs = getstructarray( "defcon_alarms", "targetname" );
        sound_ent = [];
        
        for(i=0;i<structs.size;i++)
        {
            sound_ent[i] = Spawn( "script_origin", structs[i].origin );
            sound_ent[i] PlayLoopSound( "zmb_defcon_alarm", .25 );
        }
        
        level waittill( "defcon_reset" );
        
        for(i=0;i<sound_ent.size;i++)
        {
            sound_ent[i] StopLoopSound( .5 );
        }
        
        wait(1);
        
        array_delete( sound_ent );
    }
    zombie_pentagon_traps.gsc

    Code:
    #include common_scripts\utility;
    #include maps\_utility;
    #include maps\_zombiemode_traps;
    #include maps\_zombiemode_utility;
    
    
    init_traps()
    {
    	level init_flags();
    	
    	level electric_trap_battery_init();
    	level pentagon_fix_electric_trap_init();
    	
    	// ww: getting teh quad intro fx in with the changes to the trap system
    	level quad_first_drop_fx_init();
    }
    
    init_flags()
    {
    	flag_init( "trap_elevator" );
    	flag_init( "trap_quickrevive" );
    	
    	
    }
    //-------------------------------------------------------------------------------
    // DCS 082410: standarding and making into prefabs batteries for traps.
    //-------------------------------------------------------------------------------
    electric_trap_battery_init()
    {
    	trap_batteries = GetEntArray( "trigger_trap_piece", "targetname" );
    	players = get_players();
    	for ( i = 0; i < players.size; i++ )
    	{
    		players[i]._trap_piece = 0;
    	}
    	
    	array_thread( trap_batteries, ::pickup_trap_piece );
    }
    
    pickup_trap_piece()
    {
    	self endon( "_piece_placed" );
    	
    	if( !IsDefined( self.target ) )
    	{
    		// where the model goes isn't hooked up, leave
    		return;
    	}
    	
    	trap_piece = self spawn_trap_piece();
    	
    	self SetHintString( &"ZOMBIE_PENTAGON_GRAB_MISSING_PIECE" );
    	self SetCursorHint( "HINT_NOICON" );
    	
    	// battery = getstruct( self.target, "targetname" );
    	self.picked_up = 0;
    	
    	// require look at
    	self UseTriggerRequireLookAt();
    
    	while( self.picked_up == 0 )
    	{
    		self waittill( "trigger", user );
    	
    		if( is_player_valid( user ) )
    		{
    			if( IsDefined( user._trap_piece ) && user._trap_piece > 0 ) // you have a piece, go away
    			{
    				play_sound_at_pos( "no_purchase", self.origin );
    				continue;
    			}
    			else
    			{	
    				self trigger_off();
    				
    				if( IsDefined( trap_piece ) )
    				{
    					PlayFXOnTag( level._effect["switch_sparks"], trap_piece, "tag_origin" );
    
    					// TODO: NEED A BETTER SOUND HERE, COULD WE GET AN EVIL BARB?
    					// SOMETHING LIKE "SO YOU THINK YOU'RE SLICK?!"
    					trap_piece thread play_sound_on_entity( "zmb_battery_pickup" );
    
    					user thread pentagon_have_battery_hud();
    					user thread trap_piece_deliver_clean_up( self );
    				}	
    				user._trap_piece = 1;
    				self.picked_up = 1;
    				
    				user thread pentagon_hide_piece_triggers();
    				
    				// wait( 1.0 );
    				trap_piece Delete();
    			}		
    		}	
    	}
    }
    
    // ww: trigger spawns the script model that will be picked up, script model is returned
    spawn_trap_piece()
    {
    	spawn_struct = getstruct( self.target, "targetname" );
    	
    	trap_model = Spawn( "script_model", spawn_struct.origin );
    	trap_model SetModel( "zombie_sumpf_power_switch" );
    	trap_model.angles = spawn_struct.angles;
    	
    	return trap_model;
    }
    
    
    // WW: make all other trap piece triggers invisible to players who have a trap piece
    pentagon_hide_piece_triggers()
    {	
    	trap_piece_triggers = GetEntArray( "trigger_trap_piece", "targetname" );
    	
    	for( i = 0; i < trap_piece_triggers.size; i++ )
    	{
    		if( trap_piece_triggers[i].picked_up == 0 )
    		{
    			trap_piece_triggers[i] SetInvisibleToPlayer( self ); 
    		}
    	}
    }
    
    // WW: Init all the triggers needed for fixing the electric traps. there should be one of these per electric trap
    pentagon_fix_electric_trap_init()
    {
    	fix_trigger_array = GetEntArray( "trigger_battery_trap_fix", "targetname" );
    	
    	if( IsDefined( fix_trigger_array ) )
    	{
    		array_thread( fix_trigger_array, ::pentagon_fix_electric_trap );
    	}
    }
    
    // WW: Traps wait for a battery to be delivered before becoming active
    pentagon_fix_electric_trap()
    {
    	if( !IsDefined( self.script_flag_wait ) ) // make sure the proper kvp is on the object
    	{
    		PrintLn( "trap at " + self.origin + " missing script flag" );
    		return;
    	}
    	
    	if( !IsDefined( self.script_string ) )
    	{
    		PrintLn( "trap at " + self.origin + " missing script string" );
    	}
    	
    	self SetHintString( &"ZOMBIE_PENTAGON_MISSING_PIECE" );
    	self SetCursorHint( "HINT_NOICON" );
    	self UseTriggerRequireLookAt();
    	
    	trap_trigger = GetEntArray( self.script_flag_wait, "targetname" ); // the script string has the trap trigger targetname
    	array_thread( trap_trigger, ::electric_hallway_trap_piece_hide, self.script_flag_wait );
    	
    	trap_cover = GetEnt( self.script_string, "targetname" ); // script brush model covering the trap pieces
    	level thread pentagon_trap_cover_remove( trap_cover, self.script_flag_wait );
    	
    	while( !flag( self.script_flag_wait ) ) // this flag will be set internally when the battery is delivered
    	{
    		self waittill( "trigger", who );
    		
    		if( is_player_valid( who ) )
    		{
    			if( !IsDefined( who._trap_piece ) || who._trap_piece == 0 ) // you don't have it, go away
    			{
    				play_sound_at_pos( "no_purchase", self.origin );
    				// continue;
    			}
    			else if( IsDefined( who._trap_piece ) && who._trap_piece == 1 ) // you have the battery
    			{
    				who._trap_piece = 0;
    				
    				self PlaySound( "zmb_battery_insert" );
    				
    				who thread pentagon_show_piece_triggers();
    	
    				flag_set( self.script_flag_wait ); // flag is set on the trigger in the trap
    				
    				who notify( "trap_piece_returned" );
    				
    				who thread pentagon_remove_battery_hud();
    			}
    		}	
    	}
    	
    	// hide the trigger
    	self SetHintString( "" );
    	self trigger_off();
    }
    
    // WW: make all other trap piece triggers visbile to players who have placed a trap piece
    pentagon_show_piece_triggers()
    {	
    	trap_piece_triggers = GetEntArray( "trigger_trap_piece", "targetname" );
    	
    	for( i = 0; i < trap_piece_triggers.size; i++ )
    	{
    		if( trap_piece_triggers[i].picked_up == 0 )
    		{
    			trap_piece_triggers[i] SetVisibleToAll(); 
    		}
    	}
    }
    
    // ww: removes trigger on successfuly piece placement
    trap_piece_deliver_clean_up( ent_trig )
    {
    	self endon( "death" );
    	self endon( "disconnect" );
    	
    	self waittill( "trap_piece_returned" );
    	
    	ent_trig notify( "_piece_placed" );
    	
    	ent_trig Delete();
    }
    
    // ww: hides the zctivation trigger for the trap, but goes through multiple script ents
    // SELF == SCRIPT MODEL/TRIGGER
    electric_hallway_trap_piece_hide( str_flag )
    {
    	if( !IsDefined( str_flag ) )
    	{
    		return;
    	}
    	
    	if( self.classname == "trigger_use" )
    	{
    		self SetHintString( &"ZOMBIE_NEED_POWER" );
    		self thread electric_hallway_trap_piece_show( str_flag );
    		self trigger_off();
    	}
    } 
    
    // ww: returns the trigger once the piece has been placed
    // SELF == SCRIPT MODEL/TRIGGER
    electric_hallway_trap_piece_show( str_flag )
    {
    	if( !IsDefined( str_flag ) )
    	{
    		return;
    	}
    	
    	flag_wait( str_flag );
    	
    	self trigger_on();
    }
    
    // ww: removes the script brushmodel covers when teh trap has been created
    pentagon_trap_cover_remove( ent_cover, str_flag )
    {
    	flag_wait( str_flag );
    	
    	// TODO: COOL FX TO PLAY WHILE MOVING IT?
    	ent_cover NotSolid();
    	ent_cover.fx = Spawn( "script_model", ent_cover.origin );
    	ent_cover.fx SetModel( "tag_origin" );
    	
    	ent_cover MoveZ( 48, 1.0, 0.4, 0 );
    	ent_cover waittill( "movedone" );
    	
    	ent_cover RotateRoll( ( 360 * RandomIntRange( 4, 10 ) ), 1.2, 0.6, 0 );
    	PlayFXOnTag( level._effect["poltergeist"], ent_cover.fx, "tag_origin" );
    	// TODO: COOL ANGRY VOICE HERE? AS IF THE ETHER IS ANGRY YOU PUT THE TRAP TOGETHER
    	ent_cover waittill( "rotatedone" );
    	
    	ent_cover Hide();
    	ent_cover.fx Hide();
    	ent_cover.fx Delete();
    	ent_cover Delete();
    	
    	// ent_cover Hide();
    	// ent_cover Delete();
    }
    
    // WW:add the hud element for the battery so a player knows they have the battery
    pentagon_have_battery_hud()
    {
    	self.powercellHud = create_simple_hud( self );
    
    	self.powercellHud.foreground = true;
    	self.powercellHud.sort = 2;
    	self.powercellHud.hidewheninmenu = false;
    	self.powercellHud.alignX = "center";
    	self.powercellHud.alignY = "bottom";
    	self.powercellHud.horzAlign = "user_right";
    	self.powercellHud.vertAlign = "user_bottom";
    	self.powercellHud.x = -200; // ww: started at 256
    	self.powercellHud.y = 0;
    
    	self.powercellHud.alpha = 1;
    	self.powercellHud setshader( "zom_icon_trap_switch_handle", 32, 32 );
    	
    	self thread pentagon_remove_hud_on_death();
    }
    
    // WW: remove the battery hud element
    pentagon_remove_battery_hud()
    {
    	if( IsDefined( self.powercellHud ) )
    	{
    		self.powercellHud Destroy();
    	}
    }
    
    // WW: remove the trap piece hud on player death
    pentagon_remove_hud_on_death()
    {
    	self endon( "trap_piece_returned" );
    	
    	self waittill_either( "death", "_zombie_game_over" );
    	
    	self thread pentagon_remove_battery_hud()	;
    }
    
    //-------------------------------------------------------------------------------
    // ww: setups the fx exploder for certain vents the first time a quad comes out
    quad_first_drop_fx_init()
    {
    	vent_drop_triggers = GetEntArray( "trigger_quad_intro", "targetname" );
    	
    	// these triggers are one timers, don't thread them or the function dies
    	for( i = 0; i < vent_drop_triggers.size; i++ )
    	{
    		level thread quad_first_drop_fx( vent_drop_triggers[i] );
    	}
    }
    
    quad_first_drop_fx( ent_trigger )
    {
    	if( !IsDefined( ent_trigger.script_int ) )
    	{
    		return;
    	}
    	
    	exploder_id = ent_trigger.script_int;
    	
    	ent_trigger waittill( "trigger" );
    	
    	ent_trigger PlaySound( "evt_pentagon_quad_spawn" );
    	
    	exploder( exploder_id );
    }

    map_zombiemode_zone_manager.gsc

    Code:
    #include common_scripts\utility; 
    #include maps\_utility; 
    
    //
    //	This manages which spawners are valid for the game.  The round_spawn function
    //	will use the arrays generated to figure out where to spawn a zombie from.
    //	
    //	Your level will need to set the level.zone_manager_init_func.  This function
    //	should specify all of the connections you need to generate for each zone.
    //		Ex.:	level.zone_manager_init_func = ::cosmodrome_zone_init;
    //	
    //	You will also need to call the zone_manager startup function, manage_zones.
    //	Pass in an array of starting zone names.
    //		Ex.:	init_zones[0] = "start_zone";
    //				init_zones[1] = "start_building1_zone";
    //				init_zones[2] = "start_building1b_zone";
    //				level thread maps\_zombiemode_zone_manager::manage_zones( init_zones );
    //
    //	The zone_manager_init_func should contain lines such as the following:
    //
    //		add_adjacent_zone( "start_zone", "start_zone_roof", "start_exit_power" );
    //		add_adjacent_zone( "start_zone", "start_zone_roof", "start_exit_power2" );
    //		add_adjacent_zone( "start_zone_roof", "north_catwalk_zone", "start_exit_power" );
    
    
    //
    //	Zone Manager initializations
    //
    init()
    {
    	flag_init( "zones_initialized" );
    
    	level.zones = [];
    	level.zone_flags = [];
    
    	if ( !IsDefined( level.create_spawner_list_func ) )
    	{
    		level.create_spawner_list_func = ::create_spawner_list;
    	}
    }
    
    
    //
    //	Check to see if a zone is enabled
    //
    zone_is_enabled( zone_name )
    {
    	if ( !IsDefined(level.zones) ||
    		!IsDefined(level.zones[ zone_name ]) ||
    		!level.zones[ zone_name ].is_enabled )
    	{
    		return false;
    	}
    
    	return true;
    }
    
    //--------------------------------------------------------------
    //  Checks to see how many players are in a zone_name volume
    //--------------------------------------------------------------
    get_players_in_zone( zone_name )
    {
    	// If the zone hasn't been enabled, don't even bother checking
    	if ( !zone_is_enabled( zone_name ) )
    	{
    		return false;
    	}
    	zone = level.zones[ zone_name ];
    
    	// Okay check to see if a player is in one of the zone volumes
    	num_in_zone = 0;
    	players = get_players();
    	for (i = 0; i < zone.volumes.size; i++)
    	{
    		for (j = 0; j < players.size; j++)
    		{
    			if ( players[j] IsTouching(zone.volumes[i]) )
    				num_in_zone++;
    		}
    	}
    	return num_in_zone;
    }
    
    
    //--------------------------------------------------------------
    //  Checks to see if a player is in a zone_name volume
    //--------------------------------------------------------------
    player_in_zone( zone_name )
    {
    	// If the zone hasn't been enabled, don't even bother checking
    	if ( !zone_is_enabled( zone_name ) )
    	{
    		return false;
    	}
    	zone = level.zones[ zone_name ];
    
    	// Okay check to see if a player is in one of the zone volumes
    	players = get_players();
    	for (i = 0; i < zone.volumes.size; i++)
    	{
    		for (j = 0; j < players.size; j++)
    		{
    			if ( players[j] IsTouching(zone.volumes[i]) && !(players[j].sessionstate == "spectator"))
    			return true;
    		}
    	}
    	return false;
    }
    
    
    //
    //	Disable exterior_goals that have a script_noteworthy.  This can prevent zombies from
    //		pathing to a3 goal that the zombie can't path towards the player after entering.
    //	They will be activated later, when the zone gets enabled.
    deactivate_initial_barrier_goals()
    {
    	special_goals = GetStructArray("exterior_goal", "targetname");
    	for (i = 0; i < special_goals.size; i++)
    	{
    		if (IsDefined(special_goals[i].script_noteworthy))
    		{
    			special_goals[i].is_active = false;
    			special_goals[i] trigger_off();
    		}
    	}
    }
    
    
    //--------------------------------------------------------------
    //	Call this when you want to allow zombies to spawn from a zone
    //	-	Must have at least one info_volume with targetname = (name of the zone)
    //	-	Have the info_volumes target the zone's spawners
    //--------------------------------------------------------------
    zone_init( zone_name )
    {
    	if ( IsDefined( level.zones[ zone_name ] ) )
    	{
    		// It's already been activated
    		return;
    	}
    
    	// Add this to the list of active zones
    	level.zones[ zone_name ] = SpawnStruct();
    	zone = level.zones[ zone_name ];
    
    	zone.is_enabled = false;	// The zone is not enabled.  You can stop looking at it
    								//		until it is.
    	zone.is_occupied = false;	// The zone is not occupied by a player.  This is what we 
    								//		use to determine when to activate adjacent zones
    	zone.is_active = false;		// The spawners will not be added to the spawning list
    								//		until this true.
    	zone.adjacent_zones = [];	// NOTE: These must be defined in a separate level-specific initialization via add_adjacent_zone
    	
    	// 
    	zone.volumes = [];
    	volumes = GetEntArray( zone_name, "targetname" );
    	for ( i=0; i<volumes.size; i++ )
    	{
    		if ( volumes[i].classname == "info_volume" )
    		{
    			zone.volumes[ zone.volumes.size ] = volumes[i];
    		}
    	}
    	
    	AssertEx( IsDefined( zone.volumes[0] ), "zone_init: No volumes found for zone: "+zone_name );	
    
    	if ( IsDefined( zone.volumes[0].target ) )
    	{
    		// Grab all of the zombie and dog spawners and sort them into two arrays
    		zone.spawners = [];
    		zone.dog_spawners = [];
    
    		spawners = GetEntArray( zone.volumes[0].target, "targetname" );
    		for (i = 0; i < spawners.size; i++)
    		{
    			spawner = spawners[i];
    
    			// The zonename will be used later for risers
    			spawner.zone_name = zone_name;
    			spawner.is_enabled = true;
    
    			if ( spawner.classname == "actor_zombie_dog" )
    			{
    				zone.dog_spawners[ zone.dog_spawners.size ] = spawner;
    			}
    			else if ( IsDefined( level.ignore_spawner_func ) )
    			{
    				ignore = [[ level.ignore_spawner_func ]]( spawner );
    				if ( !ignore )
    				{
    					zone.spawners[ zone.spawners.size ] = spawner;
    				}
    			}
    			else
    			{
    				zone.spawners[ zone.spawners.size ] = spawner;
    			}
    		}
    
    		// Grab all of the zombie dog spawn structs
    		zone.dog_locations = GetStructArray(zone.volumes[0].target + "_dog", "targetname");
    		for ( i=0; i<zone.dog_locations.size; i++ )
    		{
    			zone.dog_locations[i].is_enabled = true;
    		}
    
    		// grab all zombie rise locations for the zone
    		zone.rise_locations = GetStructArray(zone.volumes[0].target + "_rise", "targetname");
    		for ( i=0; i<zone.rise_locations.size; i++ )
    		{
    			zone.rise_locations[i].is_enabled = true;
    		}
    	}
    }
    
    //
    // Update the spawners
    reinit_zone_spawners()
    {
    	zkeys = GetArrayKeys( level.zones );
    	for ( i = 0; i < level.zones.size; i++ )
    	{
    		zone = level.zones[ zkeys[i] ];
    
    		if ( IsDefined( zone.volumes[0].target ) )
    		{
    			zone.spawners = [];
    			spawners = GetEntArray( zone.volumes[0].target, "targetname" );
    			for ( j = 0; j < spawners.size; j++ )
    			{
    				spawner = spawners[j];
    				if ( IsDefined( level.ignore_spawner_func ) )
    				{
    					ignore = [[ level.ignore_spawner_func ]]( spawner );
    					if ( !ignore )
    					{
    						zone.spawners[ zone.spawners.size ] = spawner;
    					}
    				}
    				else if ( spawner.classname != "actor_zombie_dog" )
    				{
    					zone.spawners[ zone.spawners.size ] = spawner;
    				}
    			}
    		}
    	}
    }
    
    
    //
    //	Turn on the zone
    enable_zone( zone_name )
    {
    	AssertEx( IsDefined(level.zones) && IsDefined(level.zones[zone_name]), "enable_zone: zone has not been initialized" );
    
    	if ( level.zones[ zone_name ].is_enabled )
    	{
    		return;
    	}
    	
    	level.zones[ zone_name ].is_enabled = true;
    	level notify( zone_name );
    
    	// activate any player spawn points
    	spawn_points = GetStructArray("player_respawn_point", "targetname");
    	for( i = 0; i < spawn_points.size; i++ )
    	{
    		if ( spawn_points[i].script_noteworthy == zone_name )
    		{
    			spawn_points[i].locked = false;
    		}
    	}
    
    	//	Allow zombies to path to the barriers in the zone.
    	//	All barriers with a script_noteworthy should initially be triggered off by
    	//		deactivate_barrier_goals
    	entry_points = GetStructArray(zone_name+"_barriers", "script_noteworthy");
    	for(i=0;i<entry_points.size;i++)
    	{
    		entry_points[i].is_active = true;
    		entry_points[i] trigger_on();
    	}		
    }
    
    
    //
    //	Add zone B to zone A's adjacency list
    //
    //	main_zone_name - zone to be connected to
    //	adj_zone_name - zone to connect
    //	flag_name - flag that will cause the connection to happen
    make_zone_adjacent( main_zone_name, adj_zone_name, flag_name )
    {
    	main_zone = level.zones[ main_zone_name ];
    
    	// Create the adjacent zone entry if it doesn't exist
    	if ( !IsDefined( main_zone.adjacent_zones[ adj_zone_name ] ) )
    	{
    		main_zone.adjacent_zones[ adj_zone_name ] = SpawnStruct();
    		adj_zone = main_zone.adjacent_zones[ adj_zone_name ];
    		adj_zone.is_connected = false;
    		adj_zone.flags_do_or_check = false;
    		// Create the link condition, the flag that needs to be set to be considered connected
    		if ( IsArray( flag_name ) )
    		{
    			adj_zone.flags = flag_name;
    		}
    		else
    		{
    			adj_zone.flags[0] = flag_name;
    		}
    	}
    	else
    	{
    		// we've already defined a link condition, but we need to add another one and treat 
    		//	it as an "OR" condition
    		AssertEx( !IsArray( flag_name ), "make_zone_adjacent: can't mix single and arrays of flags" );
    		adj_zone = main_zone.adjacent_zones[ adj_zone_name ];
    		size = adj_zone.flags.size;
    		adj_zone.flags_do_or_check = true;
    		adj_zone.flags[ size ] = flag_name;
    	}
    }
    
    
    //	When the wait_flag gets set (like when a door opens), the add_flags will also get set.
    //	This provides a slightly less clunky way to connect multiple contiguous zones within an area
    //
    //	wait_flag = flag to wait for
    //	adj_flags = array of flag strings to set when flag is set
    add_zone_flags( wait_flag, add_flags )
    {
    	if (!IsArray(add_flags) )
    	{
    		temp = add_flags;
    		add_flags = [];
    		add_flags[0] = temp;
    	}
    
    	keys = GetArrayKeys( level.zone_flags );
    	for ( i=0; i<keys.size; i++ )
    	{
    		if ( keys[i] == wait_flag )
    		{
    			level.zone_flags[ keys[i] ] = array_combine( level.zone_flags[ keys[i] ], add_flags );
    			return;
    		}
    	}
    	level.zone_flags[ wait_flag ] = add_flags;
    }
    
    //
    // Makes zone_b adjacent to zone_a.  If one_way is false, zone_a is also made "adjacent" to zone_b
    //	Note that you may not always want zombies coming from zone B while you are in Zone A, but you 
    //	might want them to come from B while in A.  It's a rare case though, such as a one-way traversal.
    add_adjacent_zone( zone_name_a, zone_name_b, flag_name, one_way )
    {
    	if ( !IsDefined( one_way ) )
    	{
    		one_way = false;
    	}
    
    	// rsh030110 - added to make sure all our flags are inited before setup_zone_flag_waits()
    	if ( !IsDefined( level.flag[ flag_name ] ) )
    	{
    		flag_init( flag_name );
    	}
    
    	// If it's not already activated, this zone_init will activate the zone
    	//	If it's already activated, it won't do anything.
    	zone_init( zone_name_a );
    	zone_init( zone_name_b );
    
    	// B becomes an adjacent zone of A
    	make_zone_adjacent( zone_name_a, zone_name_b, flag_name );
    
    	if ( !one_way )
    	{
    		// A becomes an adjacent zone of B
    		make_zone_adjacent( zone_name_b, zone_name_a, flag_name );
    	}
    }
    
    
    //--------------------------------------------------------------
    //	Gathers all flags that need to be evaluated and sets up waits for them
    //--------------------------------------------------------------
    setup_zone_flag_waits()
    {
    	flags = [];
    	zkeys = GetArrayKeys( level.zones );
    	for( z=0; z<level.zones.size; z++ )
    	{
    		zone = level.zones[ zkeys[z] ];
    		azkeys = GetArrayKeys( zone.adjacent_zones );
    		for ( az = 0; az<zone.adjacent_zones.size; az++ )
    		{
    			azone = zone.adjacent_zones[ azkeys[az] ];
    			for ( f = 0; f< azone.flags.size; f++ )
    			{
    				flags = add_to_array(flags, azone.flags[f], false );
    			}
    		}
    	}
    
    	for( i=0; i<flags.size; i++ )
    	{
    		level thread zone_flag_wait( flags[i] );
    	}
    }
    
    
    //
    //	Wait for a zone flag to be set and then update zones
    //
    zone_flag_wait( flag_name )
    {
    	if ( !IsDefined( level.flag[ flag_name ] ) )
    	{
    		flag_init( flag_name );
    	}
    	flag_wait( flag_name );
    
    	flags_set = false;	//	scope declaration
    	// Enable adjacent zones if all flags are set for a connection
    	for( z=0; z<level.zones.size; z++ )
    	{
    		zkeys = GetArrayKeys( level.zones );
    		zone = level.zones[ zkeys[z] ];
    		for ( az = 0; az<zone.adjacent_zones.size; az++ )
    		{
    			azkeys = GetArrayKeys( zone.adjacent_zones );
    			azone = zone.adjacent_zones[ azkeys[az] ];
    			if ( !azone.is_connected )
    			{
    				if ( azone.flags_do_or_check )
    				{
    					// If ANY flag is set, then connect zones
    					flags_set = false;
    					for ( f = 0; f< azone.flags.size; f++ )
    					{
    						if ( flag( azone.flags[f] ) )
    						{
    							flags_set = true;
    							break;
    						}
    					}
    				}
    				else
    				{
    					// See if ALL the flags have been set, otherwise, move on
    					flags_set = true;
    					for ( f = 0; f< azone.flags.size; f++ )
    					{
    						if ( !flag( azone.flags[f] ) )
    						{
    							flags_set = false;
    						}
    					}
    				}
    
    				if ( flags_set )
    				{
    					enable_zone( zkeys[z] );
    					azone.is_connected = true;
    					if ( !level.zones[ azkeys[az] ].is_enabled )
    					{
    						enable_zone( azkeys[az] );
    					}
    				}
    			}
    		}
    	}
    
    	// Also set any zone flags
    	keys = GetArrayKeys( level.zone_flags );
    	for ( i=0; i<keys.size; i++ )
    	{
    		if ( keys[i] == flag_name )
    		{
    			check_flag = level.zone_flags[ keys[i] ];
    			for ( k=0; k<check_flag.size; k++ )
    			{
    				flag_set( check_flag[k] );
    			}
    			break;
    		}
    	}
    }
    
    
    //--------------------------------------------------------------
    //	This needs to be called when new zones open up via doors
    //--------------------------------------------------------------
    connect_zones( zone_name_a, zone_name_b, one_way )
    {
    	if ( !IsDefined( one_way ) )
    	{
    		one_way = false;
    	}
    
    	// If it's not already activated, it will activate the zone
    	//	If it's already activated, it won't do anything.
    	zone_init( zone_name_a );
    	zone_init( zone_name_b );
    
    	enable_zone( zone_name_a );
    	enable_zone( zone_name_b );
    
    	// B becomes an adjacent zone of A
    	if ( !IsDefined( level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ] ) )
    	{
    		level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ] = SpawnStruct();
    		level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].is_connected = true;
    	}
    
    	if ( !one_way )
    	{
    		// A becomes an adjacent zone of B
    		if ( !IsDefined( level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ] ) )
    		{
    			level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ] = SpawnStruct();
    			level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].is_connected = true;
    		}
    	}
    }
    
    
    //--------------------------------------------------------------
    //	This one function will handle managing all zones in your map
    //	to turn them on/off - probably the best way to handle this
    //--------------------------------------------------------------
    manage_zones( initial_zone )
    {
    	AssertEx( IsDefined( initial_zone ), "You must specify an initial zone to manage" );	
    
    	deactivate_initial_barrier_goals();	// Must be called before zone_init
    
    	// Lock player respawn points
    	spawn_points = GetStructArray("player_respawn_point", "targetname");
    	for( i = 0; i < spawn_points.size; i++ )
    	{
    		AssertEx( IsDefined( spawn_points[i].script_noteworthy ), "player_respawn_point: You must specify a script noteworthy with the zone name" );
    		spawn_points[i].locked = true;
    	}
    
    	// Setup zone connections
    	if ( IsDefined( level.zone_manager_init_func ) )
    	{
    		[[ level.zone_manager_init_func ]]();
    	}
    
    	if ( IsArray( initial_zone ) )
    	{
    		for ( i = 0; i < initial_zone.size; i++ )
    		{
    			zone_init( initial_zone[i] );
    			enable_zone( initial_zone[i] );
    		}
    	}
    	else
    	{
    		zone_init( initial_zone );
    		enable_zone( initial_zone );
    	}
    
    	setup_zone_flag_waits();
    
    	flag_set( "zones_initialized" );
    
    	flag_wait( "begin_spawning" );
    
    	// Now iterate through the active zones and see if we need to activate spawners
    	zkeys = GetArrayKeys( level.zones );
    	while(GetDvarInt( #"noclip") == 0 ||GetDvarInt( #"notarget") != 0	)
    	{
    		// clear out active zone flags
    		for( z=0; z<zkeys.size; z++ )
    		{
    			level.zones[ zkeys[z] ].is_active   = false;
    			level.zones[ zkeys[z] ].is_occupied = false;
    		}
    
    		// Figure out which zones are active
    		//	If a player occupies a zone, then that zone and any of its enabled adjacent zones will activate
    		a_zone_is_active = false;	// let's us know if an active zone is found
    		for( z=0; z<zkeys.size; z++ )
    		{
    			zone = level.zones[ zkeys[z] ];
    			if ( !zone.is_enabled )
    			{
    				continue;
    			}
    
    			zone.is_occupied = player_in_zone( zkeys[z] );
    			if ( zone.is_occupied )
    			{
    				zone.is_active = true;
    				a_zone_is_active = true;
    				azkeys = GetArrayKeys( zone.adjacent_zones );
    				for ( az=0; az<zone.adjacent_zones.size; az++ )
    				{
    					if ( zone.adjacent_zones[ azkeys[az] ].is_connected &&
    					     level.zones[ azkeys[az] ].is_enabled )
    					{
    						level.zones[ azkeys[ az ] ].is_active = true;
    					}
    				}
    			}
    		}
    
    		// MM - Special logic for empty spawner list, this is just a failsafe
    		if ( !a_zone_is_active )
    		{
    			if ( IsArray( initial_zone ) )
    			{
    				level.zones[ initial_zone[0] ].is_active = true;
    				level.zones[ initial_zone[0] ].is_occupied = true;
    			}
    			else
    			{
    				level.zones[ initial_zone ].is_active = true;
    				level.zones[ initial_zone ].is_occupied = true;
    			}
    		}
    		
    
    		// Okay now we can re-create the spawner list
    		[[ level.create_spawner_list_func ]]( zkeys );
    
    		//wait a second before another check
    		wait(1);			
    	}
    }
    
    
    //
    //	Create the list of enemies to be used for spawning
    create_spawner_list( zkeys )
    {
    	level.enemy_spawns = [];
    //	level.enemy_dog_spawns = [];
    	level.enemy_dog_locations = [];
    	level.zombie_rise_spawners = [];
    
    	for( z=0; z<zkeys.size; z++ )
    	{
    		zone = level.zones[ zkeys[z] ];
    
    		if ( zone.is_enabled && zone.is_active )
    		{
    			//DCS: check to see if zone is setup for random spawning.
    			if(IsDefined(	level.random_spawners) && level.random_spawners == true)
    			{
    				if(IsDefined(zone.num_spawners) && zone.spawners.size > zone.num_spawners )
    				{
    					while(zone.spawners.size > zone.num_spawners)
    					{
    						i = RandomIntRange(0, zone.spawners.size);
    						zone.spawners = array_remove(zone.spawners, zone.spawners[i]);
    					}	
    				}
    			}				
    
    			// Add spawners
    			for(x=0;x<zone.spawners.size;x++)
    			{
    				if ( zone.spawners[x].is_enabled )
    				{
    					level.enemy_spawns[ level.enemy_spawns.size ] = zone.spawners[x];
    				}
    			}
    
    			// add dog_spawn locations
    			for(x=0; x<zone.dog_locations.size; x++)
    			{
    				if ( zone.dog_locations[x].is_enabled )
    				{
    					level.enemy_dog_locations[ level.enemy_dog_locations.size ] = zone.dog_locations[x];
    				}
    			}
    
    			// add zombie_rise locations
    			for(x=0; x<zone.rise_locations.size; x++)
    			{
    				if ( zone.rise_locations[x].is_enabled )
    				{
    					level.zombie_rise_spawners[ level.zombie_rise_spawners.size ] = zone.rise_locations[x];
    				}
    			}
    		}
    	}
    }

    0 Not allowed! Not allowed!
    Last edited by FLow Trix; 07-27-2011 at 05:05 PM.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 09:32 AM.
Powered by vBulletin®
Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.