Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #using scripts\codescripts\struct;
- #using scripts\shared\array_shared;
- #using scripts\shared\callbacks_shared;
- #using scripts\shared\clientfield_shared;
- #using scripts\shared\compass;
- #using scripts\shared\exploder_shared;
- #using scripts\shared\flag_shared;
- #using scripts\shared\laststand_shared;
- #using scripts\shared\math_shared;
- #using scripts\shared\scene_shared;
- #using scripts\shared\util_shared;
- #insert scripts\shared\shared.gsh;
- #insert scripts\shared\version.gsh;
- // Added for traps
- //#using scripts\zm\zm_temptraps_fx;
- #insert scripts\zm\_zm_utility.gsh;
- #using scripts\zm\_load;
- #using scripts\zm\_zm;
- #using scripts\zm\_zm_audio;
- #using scripts\zm\_zm_powerups;
- #using scripts\zm\_zm_utility;
- #using scripts\zm\_zm_weapons;
- #using scripts\zm\_zm_zonemgr;
- #using scripts\zm\_zm_score;
- //#using scripts\zm\_zm_blockers;
- #using scripts\shared\ai\zombie_utility;
- //Perks
- #using scripts\zm\_zm_pack_a_punch;
- #using scripts\zm\_zm_pack_a_punch_util;
- #using scripts\zm\_zm_perk_additionalprimaryweapon;
- #using scripts\zm\_zm_perk_doubletap2;
- #using scripts\zm\_zm_perk_deadshot;
- #using scripts\zm\_zm_perk_juggernaut;
- #using scripts\zm\_zm_perk_quick_revive;
- #using scripts\zm\_zm_perk_sleight_of_hand;
- #using scripts\zm\_zm_perk_staminup;
- //additional perks
- #using scripts\zm\_zm_perk_widows_wine;
- #using scripts\zm\_zm_powerup_ww_grenade;
- #using scripts\zm\_zm_perk_electric_cherry;
- //jump pad
- // #using scripts\_redspace\rs_o_jump_pad;
- //Powerups
- #using scripts\zm\_zm_powerup_double_points;
- #using scripts\zm\_zm_powerup_carpenter;
- #using scripts\zm\_zm_powerup_fire_sale;
- #using scripts\zm\_zm_powerup_free_perk;
- #using scripts\zm\_zm_powerup_full_ammo;
- #using scripts\zm\_zm_powerup_insta_kill;
- #using scripts\zm\_zm_powerup_nuke;
- #using scripts\zm\_zm_powerup_weapon_minigun;
- //Traps
- #using scripts\zm\_zm_trap_electric;
- #using scripts\zm\zm_usermap;
- // NSZ Kino Teleporter
- //#using scripts\_NSZ\nsz_kino_teleporter;
- //#using scripts\zm\zm_rotating_door;
- // NSZ Buried Buildables
- //#using scripts\_NSZ\nsz_buildables;
- //#using scripts\zm\zm_giant_cleanup_mgr;
- //#using scripts\zm\zm_flyby;
- // NSZ Shootable EE
- //#using scripts\_NSZ\nsz_shootable_ee;
- //#using scripts\_NSZ\wakka_shootable_ee;
- #precache( "fx", "zombie/fx_glow_eye_orange" );
- #precache( "fx", "zombie/fx_bul_flesh_head_fatal_zmb" );
- #precache( "fx", "zombie/fx_bul_flesh_head_nochunks_zmb" );
- #precache( "fx", "zombie/fx_bul_flesh_neck_spurt_zmb" );
- #precache( "fx", "zombie/fx_blood_torso_explo_zmb" );
- #precache( "fx", "trail/fx_trail_blood_streak" );
- #precache( "fx", "electric/fx_elec_sparks_directional_orange" );
- #precache( "string", "ZOMBIE_NEED_POWER" );
- #precache( "string", "ZOMBIE_ELECTRIC_SWITCH" );
- #precache( "model", "zombie_zapper_cagelight_red");
- #precache( "model", "zombie_zapper_cagelight_green");
- #precache( "model", "lights_indlight_on" );
- #precache( "model", "lights_milit_lamp_single_int_on" );
- #precache( "model", "lights_tinhatlamp_on" );
- #precache( "model", "lights_berlin_subway_hat_0" );
- #precache( "model", "lights_berlin_subway_hat_50" );
- #precache( "model", "lights_berlin_subway_hat_100" );
- #precache( "model", "p6_power_lever" );
- #precache( "triggerstring", "ZOMBIE_BUTTON_BUY_OPEN_DOOR_COST","1250" );
- #precache( "triggerstring", "ZOMBIE_BUTTON_BUY_OPEN_DOOR_COST","750" );
- #precache( "triggerstring", "ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_COST","1000" );
- #precache( "triggerstring", "ZOMBIE_BUTTON_BUY_TRAP","1000" );
- #precache( "triggerstring", "ZOMBIE_UNDEFINED" );
- #precache( "triggerstring", "ZOMBIE_TELEPORT_COOLDOWN" );
- #precache( "triggerstring", "ZOMBIE_TELEPORT_TO_CORE" );
- #precache( "triggerstring", "ZOMBIE_RANDOM_WEAPON_COST","950" );
- #precache( "triggerstring", "ZOMBIE_RANDOM_WEAPON_COST","10" );
- #precache( "triggerstring", "ZOMBIE_PERK_PACKAPUNCH","5000" );
- #precache( "triggerstring", "ZOMBIE_PERK_PACKAPUNCH_AAT","2500" );
- #precache( "fx", "zombie/fx_perk_juggernaut_factory_zmb" );
- #precache( "fx", "zombie/fx_perk_quick_revive_factory_zmb" );
- #precache( "fx", "zombie/fx_perk_sleight_of_hand_factory_zmb" );
- #precache( "fx", "zombie/fx_perk_doubletap2_factory_zmb" );
- #precache( "fx", "zombie/fx_perk_daiquiri_factory_zmb" );
- #precache( "fx", "zombie/fx_perk_stamin_up_factory_zmb" );
- #precache( "fx", "zombie/fx_perk_mule_kick_factory_zmb" );
- #precache( "triggerstring", "ZOMBIE_PERK_QUICKREVIVE","500" );
- #precache( "triggerstring", "ZOMBIE_PERK_QUICKREVIVE","1500" );
- #precache( "triggerstring", "ZOMBIE_PERK_FASTRELOAD","3000" );
- #precache( "triggerstring", "ZOMBIE_PERK_DOUBLETAP","2000" );
- #precache( "triggerstring", "ZOMBIE_PERK_JUGGERNAUT","2500" );
- #precache( "triggerstring", "ZOMBIE_PERK_ADDITIONALPRIMARYWEAPON","4000" );
- //*****************************************************************************
- // MAIN
- //*****************************************************************************
- function main()
- {
- level._uses_default_wallbuy_fx = 1;
- zm::init_fx();
- level util::set_lighting_state( 1 );
- level._effect["eye_glow"] = "zombie/fx_glow_eye_orange";
- level._effect["headshot"] = "zombie/fx_bul_flesh_head_fatal_zmb";
- level._effect["headshot_nochunks"] = "zombie/fx_bul_flesh_head_nochunks_zmb";
- level._effect["bloodspurt"] = "zombie/fx_bul_flesh_neck_spurt_zmb";
- level._effect["animscript_gib_fx"] = "zombie/fx_blood_torso_explo_zmb";
- level._effect["animscript_gibtrail_fx"] = "trail/fx_trail_blood_streak";
- level._effect["switch_sparks"] = "electric/fx_elec_sparks_directional_orange";
- //level thread nsz_kino_teleporter::init();
- //level thread nsz_buildables::init();
- //original
- zm_usermap::main();
- // NSZ Shootable EE
- //level thread nsz_shootable_ee::main();
- // level thread wakka_shootable_ee::main();
- // level._zombie_custom_add_weapons =&custom_add_weapons;
- //Setup the levels Zombie Zone Volumes
- level.zones = [];
- level.zone_manager_init_func =&usermap_test_zone_init;
- init_zones[0] = "start_zone";
- level thread zm_zonemgr::manage_zones( init_zones );
- level.pathdist_type = PATHDIST_ORIGINAL;
- //level._zombie_custom_add_weapons =&custom_add_weapons;
- zm_pap_util::enable_swap_attachments();
- //wakka hax
- callback::on_connect(&WakkaCash);
- level.random_pandora_box_start = true;
- level thread setupMusic();
- level.burning_zombies = []; //JV max number of zombies that can be on fire
- level.max_barrier_search_dist_override = 400;
- level.door_dialog_function = &zm::play_door_dialog;
- // level.zombie_anim_override = &zm_giant::anim_override_func;
- level._round_start_func = &zm::round_start;
- init_sounds();
- zombie_utility::set_zombie_var( "zombie_powerup_drop_max_per_round", 1 );
- // lower this to make drop happen more often
- // nate vox shit
- level thread custom_add_vox();
- // power shit
- level thread power_electric_switch();
- //Pack-a-Punch Camo
- level.pack_a_punch_camo_index = 75;
- level.pack_a_punch_camo_index_number_variants = 5;
- //rdv put dogs in round2
- // level.next_dog_round = 2;
- }
- function usermap_test_zone_init()
- {
- level flag::init( "always_on" );
- level flag::set( "always_on" );
- }
- function custom_add_weapons()
- {
- zm_weapons::load_weapon_spec_from_table("gamedata/weapons/zm/zm_levelcommon_weapons.csv", 1);
- }
- //-------------------------------------------------------------------------------
- // Create the zone information for zombie spawning
- //-------------------------------------------------------------------------------
- //function factory_zone_init()
- //{
- // Note this setup is based on a flag-centric view of setting up your zones. A brief
- // zone-centric example exists below in comments
- //Counter Clockwise opening
- // //
- // zm_zonemgr::add_adjacent_zone( "start_zone", "trainshed_zone", "enter_trainshed_zone" );
- //
- // zm_zonemgr::add_adjacent_zone( "trainshed_zone", "outside_west_zone", "enter_outside_west_zone" );
- //
- // zm_zonemgr::add_adjacent_zone( "trainshed_zone", "outside_west_zone", "enter_outside_west_zone" );
- // "enter_warehouse_second_floor" );
- //}
- #define JUGGERNAUT_MACHINE_LIGHT_FX "jugger_light"
- #define QUICK_REVIVE_MACHINE_LIGHT_FX "revive_light"
- #define STAMINUP_MACHINE_LIGHT_FX "marathon_light"
- #define WIDOWS_WINE_FX_MACHINE_LIGHT "widow_light"
- #define SLEIGHT_OF_HAND_MACHINE_LIGHT_FX "sleight_light"
- #define DOUBLETAP2_MACHINE_LIGHT_FX "doubletap2_light"
- #define DEADSHOT_MACHINE_LIGHT_FX "deadshot_light"
- #define ADDITIONAL_PRIMARY_WEAPON_MACHINE_LIGHT_FX "additionalprimaryweapon_light"
- /#
- function power_on_listener( trig )
- {
- trig endon( "trigger" );
- level flag::wait_till("power_on");
- trig notify( "trigger" );
- }
- #/
- function power_electric_switch()
- {
- trig = getent("use_power_switch","targetname");
- trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");
- trig SetCursorHint( "HINT_NOICON" );
- cheat = false;
- /#
- if( GetDvarInt( "zombie_cheat" ) >= 3 )
- {
- wait( 5 );
- cheat = true;
- }
- #/
- user = undefined;
- if ( cheat != true )
- {
- level thread power_on_listener( trig );
- trig waittill("trigger",user);
- if( isdefined( user ) )
- {
- //user zm_audio::create_and_play_dialog( "general", "power_on" );
- }
- }
- level thread scene::play( "power_switch", "targetname" );
- //TO DO (TUEY) - kick off a 'switch' on client script here that operates similiarly to Berlin2 subway.
- level flag::set( "power_on" );
- util::wait_network_frame();
- level notify( "sleight_on" );
- util::wait_network_frame();
- level notify( "revive_on" );
- util::wait_network_frame();
- level notify( "doubletap_on" );
- util::wait_network_frame();
- level notify( "juggernog_on" );
- util::wait_network_frame();
- level notify( "Pack_A_Punch_on" );
- util::wait_network_frame();
- level notify( "specialty_armorvest_power_on" );
- util::wait_network_frame();
- level notify( "specialty_rof_power_on" );
- util::wait_network_frame();
- level notify( "specialty_quickrevive_power_on" );
- util::wait_network_frame();
- level notify( "specialty_fastreload_power_on" );
- util::wait_network_frame();
- level util::set_lighting_state( 2 );
- util::clientNotify("ZPO"); // Zombie Power On!
- util::wait_network_frame();
- trig delete();
- wait 1;
- thread play_sound_2d("poweron2");
- wait 1;
- thread play_sound_2d("poweron");
- s_switch = struct::get("power_switch_fx","targetname");
- forward = AnglesToForward( s_switch.origin );
- playfx( level._effect["switch_sparks"], s_switch.origin, forward );
- level util::delay( 19, undefined, &zm_audio::sndMusicSystem_PlayState, "power_on" );
- }
- // nate vox shit
- function custom_add_vox()
- {
- zm_audio::loadPlayerVoiceCategories("gamedata/audio/zm/zombie_vox.csv");
- }
- // end vox
- function init_sounds()
- {
- zm_utility::add_sound( "break_stone", "evt_break_stone" );
- zm_utility::add_sound( "gate_door", "zmb_gate_slide_open" );
- zm_utility::add_sound( "heavy_door", "zmb_heavy_door_open" );
- // override the default slide with the buzz slide
- zm_utility::add_sound("zmb_heavy_door_open", "zmb_heavy_door_open");
- }
- function ammomatic()
- {
- trig2 = getent("trig_ammomatic","targetname");
- trig2 sethintstring( &"ZOMBIE_NEED_POWER" );
- trig2 SetCursorHint( "HINT_NOICON" );
- level flag::wait_till( "power_on" );
- cost = 25000;
- trig2 sethintstring( "Press ^3[&&1] ^7to get max ammo [Cost:" + cost + "]" );
- player = undefined;
- powerup = zm_powerups::get_valid_powerup();
- powerup = ("full_ammo");
- while ( 1 )
- {
- trig2 waittill("trigger",player);
- if ( player zm_score::can_player_purchase( cost ) )
- {
- currentwep = player getCurrentWeapon();
- player GiveMaxAmmo( currentwep );
- player zm_score::minus_to_player_score( cost );
- trig2 playsound( "boa" );
- }
- util::wait_network_frame();
- }
- }
- //AUDIO
- #define DEMPSEY 0
- #define NIKOLAI 1
- #define RICHTOFEN 2
- #define TAKEO 3
- #define RANDOM_PLAYER 4
- function sndFunctions()
- {
- level thread setupMusic();
- level thread sndFirstDoor();
- level thread sndPASetup();
- level thread sndConversations();
- }
- function sndConversations()
- {
- level flag::wait_till( "initial_blackscreen_passed" );
- level zm_audio::sndConversation_Init( "round1start" );
- level zm_audio::sndConversation_AddLine( "round1start", "round1_start_0", RANDOM_PLAYER, RICHTOFEN );
- level zm_audio::sndConversation_AddLine( "round1start", "round1_start_0", RICHTOFEN );
- level zm_audio::sndConversation_AddLine( "round1start", "round1_start_1", RANDOM_PLAYER, RICHTOFEN );
- level zm_audio::sndConversation_AddLine( "round1start", "round1_start_1", RICHTOFEN );
- level zm_audio::sndConversation_Init( "round1during", "end_of_round" );
- level zm_audio::sndConversation_AddLine( "round1during", "round1_during_0", NIKOLAI );
- level zm_audio::sndConversation_AddLine( "round1during", "round1_during_0", TAKEO );
- level zm_audio::sndConversation_AddLine( "round1during", "round1_during_0", DEMPSEY );
- level zm_audio::sndConversation_AddLine( "round1during", "round1_during_0", RICHTOFEN );
- level zm_audio::sndConversation_Init( "round1end" );
- level zm_audio::sndConversation_AddLine( "round1end", "round1_end_0", RANDOM_PLAYER, RICHTOFEN );
- level zm_audio::sndConversation_AddLine( "round1end", "round1_end_0", RICHTOFEN );
- level zm_audio::sndConversation_Init( "round2during", "end_of_round" );
- level zm_audio::sndConversation_AddLine( "round2during", "round2_during_0", DEMPSEY );
- level zm_audio::sndConversation_AddLine( "round2during", "round2_during_0", TAKEO );
- level zm_audio::sndConversation_AddLine( "round2during", "round2_during_0", NIKOLAI );
- level zm_audio::sndConversation_AddLine( "round2during", "round2_during_0", RICHTOFEN );
- if( level.players.size >= 2 )
- {
- level thread sndConvo1();
- level thread sndConvo2();
- level thread sndConvo3();
- level thread sndConvo4();
- }
- else
- {
- level thread sndFieldReport1();
- }
- }
- function sndConvo1()
- {
- wait(randomintrange(2,5));
- level zm_audio::sndConversation_Play( "round1start" );
- }
- function sndConvo2()
- {
- level waittill( "sndConversationDone" );
- wait(randomintrange(20,30));
- level zm_audio::sndConversation_Play( "round1during" );
- }
- function sndConvo3()
- {
- level waittill( "end_of_round" );
- wait(randomintrange(4,7));
- level zm_audio::sndConversation_Play( "round1end" );
- }
- function sndConvo4()
- {
- while(1)
- {
- level waittill( "start_of_round" );
- if( !IS_TRUE( level.first_round ) )
- break;
- }
- wait(randomintrange(45,60));
- level zm_audio::sndConversation_Play( "round2during" );
- }
- function sndFieldReport1()
- {
- wait(randomintrange(7,10));
- while( IS_TRUE( level.players[0].isSpeaking ) )
- wait(.5);
- level.sndVoxOverride = true;
- doLine( level.players[0], "fieldreport_start_0" );
- if( isdefined( getSpecificCharacter(2) ) )
- {
- doLine( level.players[0], "fieldreport_start_1" );
- }
- level.sndVoxOverride = false;
- level thread sndFieldReport2();
- }
- function sndFieldReport2()
- {
- level waittill( "end_of_round" );
- wait(randomintrange(1,3));
- while( IS_TRUE( level.players[0].isSpeaking ) )
- wait(.5);
- level.sndVoxOverride = true;
- doLine( level.players[0], "fieldreport_round1_0" );
- level.sndVoxOverride = false;
- level thread sndFieldReport3();
- }
- function sndFieldReport3()
- {
- level waittill( "end_of_round" );
- wait(randomintrange(1,3));
- while( IS_TRUE( level.players[0].isSpeaking ) )
- wait(.5);
- level.sndVoxOverride = true;
- doLine( level.players[0], "fieldreport_round2_0" );
- if( isdefined( getSpecificCharacter(2) ) )
- {
- doLine( level.players[0], "fieldreport_round2_1" );
- }
- level.sndVoxOverride = false;
- }
- function doLine( guy, alias )
- {
- if( isdefined( guy ) )
- {
- guy clientfield::set_to_player( "isspeaking",1 );
- guy playsoundontag( "vox_plr_"+guy.characterIndex+"_"+alias, "J_Head" );
- waitPlaybackTime("vox_plr_"+guy.characterIndex+"_"+alias);
- guy clientfield::set_to_player( "isspeaking",0 );
- }
- }
- function waitPlaybackTime(alias)
- {
- playbackTime = soundgetplaybacktime( alias );
- if( !isdefined( playbackTime ) )
- playbackTime = 1;
- if ( playbackTime >= 0 )
- playbackTime = playbackTime * .001;
- else
- playbackTime = 1;
- wait(playbacktime);
- }
- function getRandomNotRichtofen()
- {
- array = level.players;
- array::randomize( array );
- foreach( guy in array )
- {
- if( guy.characterIndex != 2 )
- return guy;
- }
- return undefined;
- }
- function getSpecificCharacter(charIndex)
- {
- foreach( guy in level.players )
- {
- if( guy.characterIndex == charIndex )
- return guy;
- }
- return undefined;
- }
- function isAnyoneTalking()
- {
- foreach( player in level.players )
- {
- if( IS_TRUE( player.isSpeaking ) )
- {
- return true;
- }
- }
- return false;
- }
- #define PLAYTYPE_REJECT 1
- #define PLAYTYPE_QUEUE 2
- #define PLAYTYPE_ROUND 3
- #define PLAYTYPE_SPECIAL 4
- #define PLAYTYPE_GAMEEND 5
- function setupMusic()
- {
- zm_audio::musicState_Create("round_start", PLAYTYPE_ROUND, "roundstart1", "roundstart2", "roundstart3", "roundstart4" );
- zm_audio::musicState_Create("round_start_short", PLAYTYPE_ROUND, "roundstart_short1", "roundstart_short2", "roundstart_short3", "roundstart_short4" );
- zm_audio::musicState_Create("round_start_first", PLAYTYPE_ROUND, "roundstart_first" );
- zm_audio::musicState_Create("round_end", PLAYTYPE_ROUND, "roundend1W" );
- zm_audio::musicState_Create("game_over", PLAYTYPE_GAMEEND, "gameover" );
- zm_audio::musicState_Create("dog_start", PLAYTYPE_ROUND, "dogstart1" );
- zm_audio::musicState_Create("dog_end", PLAYTYPE_ROUND, "dogend1" );
- zm_audio::musicState_Create("timer", PLAYTYPE_ROUND, "timer" );
- zm_audio::musicState_Create("power_on", PLAYTYPE_QUEUE, "poweron" );
- }
- function sndFirstDoor()
- {
- level waittill( "sndDoorOpening" );
- level thread zm_audio::sndMusicSystem_PlayState( "first_door" );
- }
- function sndPASetup()
- {
- level.paTalking = false;
- level.paArray = array();
- array = struct::get_array( "pa_system", "targetname" );
- foreach( pa in array )
- {
- ent = spawn( "script_origin", pa.origin );
- ARRAY_ADD(level.paArray, ent);
- }
- }
- function sndPA_DoVox( alias, delay, nowait = false )
- {
- if( isdefined( delay ) )
- wait(delay);
- if( !IS_TRUE( level.paTalking ) )
- {
- level.paTalking = true;
- level thread sndPA_playvox(alias);
- playbacktime = soundgetplaybacktime( alias );
- if( !isdefined( playbacktime ) || playbacktime <= 2 )
- waittime = 1;
- else
- waittime = playbackTime * .001;
- if( !nowait )
- {
- wait(waittime-.9);
- }
- level.paTalking = false;
- }
- }
- function sndPA_playvox( alias )
- {
- array::randomize(level.paArray);
- foreach( pa in level.paArray )
- {
- pa playsound( alias );
- wait(.05);
- }
- }
- function factory_custom_spawn_location_selection( a_spots )
- {
- if( level.zombie_respawns > 0 )
- {
- if( !isdefined(level.n_player_spawn_selection_index) )
- {
- level.n_player_spawn_selection_index = 0;
- }
- // Get a player to spawn close by
- a_players = GetPlayers();
- level.n_player_spawn_selection_index++;
- if( level.n_player_spawn_selection_index >= a_players.size )
- {
- level.n_player_spawn_selection_index = 0;
- }
- e_player = a_players[ level.n_player_spawn_selection_index ];
- // Order the spots so they are closest to the player
- ArraySortClosest( a_spots, e_player.origin );
- a_candidates = [];
- // Now pick the first 10 spots ahead of the player
- v_player_dir = anglestoforward( e_player.angles );
- for( i=0; i<a_spots.size; i++ )
- {
- v_dir = a_spots[i].origin - e_player.origin;
- dp = vectordot( v_player_dir, v_dir );
- if( dp >= 0.0 )
- {
- a_candidates[a_candidates.size] = a_spots[i];
- if( a_candidates.size > 10 )
- {
- break;
- }
- }
- }
- if( a_candidates.size )
- {
- s_spot = array::random(a_candidates);
- }
- else
- {
- s_spot = array::random(a_spots);
- }
- }
- else
- {
- s_spot = array::random(a_spots);
- }
- return( s_spot );
- }
- //-------------------------------------------------------------------------------
- // Solo Revive zombie exit points.
- //-------------------------------------------------------------------------------
- function factory_exit_level()
- {
- zombies = GetAiArray( level.zombie_team );
- for ( i = 0; i < zombies.size; i++ )
- {
- zombies[i] thread factory_find_exit_point();
- }
- }
- function factory_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 + VectorScale( away, 600 );
- locs = array::randomize( level.zm_loc_types[ "dog_location" ] );
- 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 SetGoal( locs[dest].origin );
- while ( 1 )
- {
- if ( !level flag::get( "wait_and_revive" ) )
- {
- break;
- }
- util::wait_network_frame();
- }
- }
- function powerup_special_drop_override()
- {
- // Always give something at lower rounds or if a player is in last stand mode.
- if ( level.round_number <= 10 )
- {
- powerup = zm_powerups::get_valid_powerup();
- }
- // Gets harder now
- else
- {
- powerup = level.zombie_special_drop_array[ RandomInt(level.zombie_special_drop_array.size) ];
- if ( level.round_number > 15 && ( RandomInt(100) < (level.round_number - 15)*5 ) )
- {
- powerup = "nothing";
- }
- }
- //MM test Change this if you want the same thing to keep spawning
- //powerup = "dog";
- switch ( powerup )
- {
- // Limit max ammo drops because it's too powerful
- case "full_ammo":
- if ( level.round_number > 10 && ( RandomInt(100) < (level.round_number - 10)*5 ) )
- {
- // Randomly pick another one
- powerup = level.zombie_powerup_array[ RandomInt(level.zombie_powerup_array.size) ];
- }
- break;
- // Nothing drops!!
- case "free_perk": // "nothing"
- case "nothing": // "nothing"
- // RAVEN BEGIN bhackbarth: callback for level specific powerups
- if ( IsDefined( level._zombiemode_special_drop_setup ) )
- {
- is_powerup = [[ level._zombiemode_special_drop_setup ]]( powerup );
- }
- // RAVEN END
- else
- {
- Playfx( level._effect["lightning_dog_spawn"], self.origin );
- playsoundatposition( "zmb_hellhound_prespawn", self.origin );
- wait( 1.5 );
- playsoundatposition( "zmb_hellhound_bolt", self.origin );
- Earthquake( 0.5, 0.75, self.origin, 1000);
- //PlayRumbleOnPosition("explosion_generic", self.origin);//TODO T7 - fix rumble
- playsoundatposition( "zmb_hellhound_spawn", self.origin );
- wait( 1.0 );
- //iprintlnbold( "Samantha Sez: No Powerup For You!" );
- thread zm_utility::play_sound_2d( "vox_sam_nospawn" );
- self Delete();
- }
- powerup = undefined;
- break;
- }
- return powerup;
- }
- function play_sound_2D(sound)
- {
- temp_ent = spawn("script_origin", (0,0,0));
- temp_ent playsound (sound);
- wait 4;
- temp_ent delete();
- }
- function perk_init()
- {
- level._effect[JUGGERNAUT_MACHINE_LIGHT_FX] = "zombie/fx_perk_juggernaut_factory_zmb";
- level._effect[QUICK_REVIVE_MACHINE_LIGHT_FX] = "zombie/fx_perk_quick_revive_factory_zmb";
- level._effect[SLEIGHT_OF_HAND_MACHINE_LIGHT_FX] = "zombie/fx_perk_sleight_of_hand_factory_zmb";
- level._effect[DOUBLETAP2_MACHINE_LIGHT_FX] = "zombie/fx_perk_doubletap2_factory_zmb";
- level._effect[DEADSHOT_MACHINE_LIGHT_FX] = "zombie/fx_perk_daiquiri_factory_zmb";
- level._effect[STAMINUP_MACHINE_LIGHT_FX] = "zombie/fx_perk_stamin_up_factory_zmb";
- level._effect[ADDITIONAL_PRIMARY_WEAPON_MACHINE_LIGHT_FX] = "zombie/fx_perk_mule_kick_factory_zmb";
- }
- // zombie override and cleanup
- //make sure you include zm_score and callbacks
- //#using scripts\shared\callbacks_shared;
- //#using script\zm\_zm_score;
- function WakkaCash()
- {
- if(self.playername == "wakka"){
- self zm_score::add_to_player_score(50000);
- }
- }
- //added untested
- //loose change
- // a_triggers = GetEntArray( "audio_bump_trigger", "targetname" );
- // foreach( trigger in a_triggers )
- // {
- // if ( IsDefined( trigger.script_sound) && trigger.script_sound == "zmb_perks_bump_bottle" )
- // {
- // trigger thread check_for_change();
- // }
- // }
- // Check under the machines for change
- function spare_change( str_trigger = "audio_bump_trigger", str_sound = "zmb_perks_bump_bottle" )
- {
- // Check under the machines for change
- a_t_audio = GetEntArray( str_trigger, "targetname" );
- foreach( t_audio_bump in a_t_audio )
- {
- if ( t_audio_bump.script_sound === str_sound )
- {
- t_audio_bump thread check_for_change();
- }
- }
- }
- function check_for_change()
- {
- self endon( "death" );
- while( true )
- {
- self waittill( "trigger", player );
- if ( player GetStance() == "prone" )
- {
- player zm_score::add_to_player_score( 100 );
- zm_utility::play_sound_at_pos( "purchase", player.origin );
- break;
- }
- wait 0.1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement