1 #using scripts\codescripts\struct;
3 #using scripts\shared\array_shared;
4 #using scripts\shared\callbacks_shared;
5 #using scripts\shared\clientfield_shared;
6 #using scripts\shared\compass;
7 #using scripts\shared\exploder_shared;
8 #using scripts\shared\flag_shared;
9 #using scripts\shared\laststand_shared;
10 #using scripts\shared\math_shared;
11 #using scripts\shared\scene_shared;
12 #using scripts\shared\util_shared;
14 #insert scripts\shared\shared.gsh;
15 #insert scripts\shared\version.gsh;
17 #insert scripts\zm\_zm_utility.gsh;
19 #using scripts\zm\_load;
20 #using scripts\zm\_zm;
21 #using scripts\zm\_zm_audio;
22 #using scripts\zm\_zm_powerups;
23 #using scripts\zm\_zm_utility;
24 #using scripts\zm\_zm_weapons;
25 #using scripts\zm\_zm_zonemgr;
27 #using scripts\shared\ai\zombie_utility;
30 #using scripts\zm\_zm_pack_a_punch;
31 #using scripts\zm\_zm_pack_a_punch_util;
32 #using scripts\zm\_zm_perk_additionalprimaryweapon;
33 #using scripts\zm\_zm_perk_doubletap2;
34 #using scripts\zm\_zm_perk_deadshot;
35 #using scripts\zm\_zm_perk_juggernaut;
36 #using scripts\zm\_zm_perk_quick_revive;
37 #using scripts\zm\_zm_perk_sleight_of_hand;
38 #using scripts\zm\_zm_perk_staminup;
41 #using scripts\zm\_zm_powerup_double_points;
42 #using scripts\zm\_zm_powerup_carpenter;
43 #using scripts\zm\_zm_powerup_fire_sale;
44 #using scripts\zm\_zm_powerup_free_perk;
45 #using scripts\zm\_zm_powerup_full_ammo;
46 #using scripts\zm\_zm_powerup_insta_kill;
47 #using scripts\zm\_zm_powerup_nuke;
48 #using scripts\zm\_zm_powerup_weapon_minigun;
51 #using scripts\zm\_zm_trap_electric;
54 #using scripts\zm\zm_giant_cleanup_mgr;
55 #using scripts\zm\zm_giant_fx;
56 #using scripts\zm\zm_giant_teleporter;
59 #using scripts\zm\zm_usermap;
62 #precache( "fx", "zombie/fx_glow_eye_orange" );
63 #precache( "fx", "zombie/fx_bul_flesh_head_fatal_zmb" );
64 #precache( "fx", "zombie/fx_bul_flesh_head_nochunks_zmb" );
65 #precache( "fx", "zombie/fx_bul_flesh_neck_spurt_zmb" );
66 #precache( "fx", "zombie/fx_blood_torso_explo_zmb" );
67 #precache( "fx", "trail/fx_trail_blood_streak" );
68 #precache( "fx", "electric/fx_elec_sparks_directional_orange" );
70 #precache( "string", "ZOMBIE_NEED_POWER" );
71 #precache( "string", "ZOMBIE_ELECTRIC_SWITCH" );
73 #precache( "model", "zombie_zapper_cagelight_red");
74 #precache( "model", "zombie_zapper_cagelight_green");
75 #precache( "model", "lights_indlight_on" );
76 #precache( "model", "lights_milit_lamp_single_int_on" );
77 #precache( "model", "lights_tinhatlamp_on" );
78 #precache( "model", "lights_berlin_subway_hat_0" );
79 #precache( "model", "lights_berlin_subway_hat_50" );
80 #precache( "model", "lights_berlin_subway_hat_100" );
82 #precache( "model", "p6_power_lever" );
84 #precache( "triggerstring", "ZOMBIE_BUTTON_BUY_OPEN_DOOR_COST","1250" );
85 #precache( "triggerstring", "ZOMBIE_BUTTON_BUY_OPEN_DOOR_COST","750" );
86 #precache( "triggerstring", "ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_COST","1000" );
87 #precache( "triggerstring", "ZOMBIE_BUTTON_BUY_TRAP","1000" );
88 #precache( "triggerstring", "ZOMBIE_UNDEFINED" );
89 #precache( "triggerstring", "ZOMBIE_TELEPORT_COOLDOWN" );
90 #precache( "triggerstring", "ZOMBIE_TELEPORT_TO_CORE" );
91 #precache( "triggerstring", "ZOMBIE_RANDOM_WEAPON_COST","950" );
92 #precache( "triggerstring", "ZOMBIE_RANDOM_WEAPON_COST","10" );
93 #precache( "triggerstring", "ZOMBIE_PERK_PACKAPUNCH","5000" );
94 #precache( "triggerstring", "ZOMBIE_PERK_PACKAPUNCH_AAT","2500" );
97 #precache( "fx", "zombie/fx_perk_juggernaut_factory_zmb" );
98 #precache( "fx", "zombie/fx_perk_quick_revive_factory_zmb" );
99 #precache( "fx", "zombie/fx_perk_sleight_of_hand_factory_zmb" );
100 #precache( "fx", "zombie/fx_perk_doubletap2_factory_zmb" );
101 #precache( "fx", "zombie/fx_perk_daiquiri_factory_zmb" );
102 #precache( "fx", "zombie/fx_perk_stamin_up_factory_zmb" );
103 #precache( "fx", "zombie/fx_perk_mule_kick_factory_zmb" );
104 #precache( "triggerstring", "ZOMBIE_PERK_QUICKREVIVE","500" );
105 #precache( "triggerstring", "ZOMBIE_PERK_QUICKREVIVE","1500" );
106 #precache( "triggerstring", "ZOMBIE_PERK_FASTRELOAD","3000" );
107 #precache( "triggerstring", "ZOMBIE_PERK_DOUBLETAP","2000" );
108 #precache( "triggerstring", "ZOMBIE_PERK_JUGGERNAUT","2500" );
109 #precache( "triggerstring", "ZOMBIE_PERK_ADDITIONALPRIMARYWEAPON","4000" );
118 SetClearanceCeiling( 17 );
129 level.randomize_perk_machine_location =
true;
130 level.dog_rounds_allowed=1;
134 level._uses_default_wallbuy_fx = 1;
139 level.default_start_location =
"start_room";
140 level.default_game_mode =
"zclassic";
144 level.random_pandora_box_start =
true;
146 clock = GetEnt(
"factory_clock",
"targetname" );
147 clock thread
scene::play(
"p7_fxanim_zm_factory_clock_bundle" );
149 level.has_richtofen =
false;
163 level.debug_keyline_zombies =
false;
165 level.burning_zombies = [];
166 level.max_barrier_search_dist_override = 400;
183 init_zones[0] =
"receiver_zone";
186 level.zombie_ai_limit = 24;
195 level.monk_scream_trig = getent(
"monk_scream_trig",
"targetname" );
200 level.use_powerup_volumes =
true;
214 clock = GetEnt(
"factory_clock",
"targetname" );
215 clock thread
scene::play(
"p7_fxanim_zm_factory_clock_igc_bundle" );
225 self endon(
"disconnect" );
230 n_random_wait = RandomIntRange( 12, 18 );
232 if( isdefined(
self ) && IsPlayer(
self ) )
234 self notify(
"lightning_strike" );
299 AIProfile_BeginEntry(
"factory-enemy_location_override" );
301 if (
IS_TRUE( zombie.is_trapped ) )
303 AIProfile_EndEntry();
304 return zombie.origin;
307 AIProfile_EndEntry();
316 if( IsDefined( position ) )
318 goal_point = GetClosestPointOnNavMesh( position.origin, 100 );
319 if( IsDefined( goal_point ) )
321 self SetGoal( goal_point );
322 self.has_exit_point = 1;
332 if( isdefined( zombie.has_exit_point ) )
337 players = level.players;
343 if ( isdefined( level.zm_loc_types[
"dog_location" ] ) )
345 locs = array::randomize( level.zm_loc_types[
"dog_location" ] );
347 for ( i = 0; i < locs.size; i++ )
350 foreach( player
in players )
357 away = VectorNormalize(
self.origin - player.origin );
358 endPos =
self.origin + VectorScale( away, 600 );
359 dist_zombie = DistanceSquared( locs[i].origin, endPos );
360 dist_player = DistanceSquared( locs[i].origin, player.origin );
362 if ( dist_zombie < dist_player )
397 zombie.has_exit_point = 1;
399 zombie SetGoal( zombie.origin );
411 for( i = 0; i < spawn_points.size; i++ )
413 spawn_points[i].locked =
true;
424 bridge_audio =
struct::get(
"bridge_audio",
"targetname" );
428 level util::clientnotify (
"pl1");
430 level thread
scene::play(
"p7_fxanim_zm_factory_bridge_lft_bundle" );
431 level
scene::play(
"p7_fxanim_zm_factory_bridge_rt_bundle" );
436 wnuen_bridge_clip = getent(
"wnuen_bridge_clip",
"targetname" );
437 wnuen_bridge_clip connectpaths();
438 wnuen_bridge_clip
delete();
440 warehouse_bridge_clip = getent(
"warehouse_bridge_clip",
"targetname" );
441 warehouse_bridge_clip connectpaths();
442 warehouse_bridge_clip
delete();
444 wnuen_bridge = getent(
"wnuen_bridge",
"targetname" );
445 wnuen_bridge connectpaths();
457 foreach( part
in a_parts )
459 part DisconnectPaths();
465 foreach( part
in a_parts )
473 trig = GetEnt(
"trig_outside_south_zone",
"targetname" );
474 trig waittill(
"trigger" );
498 level.open_chest_location = [];
499 level.open_chest_location[0] =
"chest1";
500 level.open_chest_location[1] =
"chest2";
501 level.open_chest_location[2] =
"chest3";
502 level.open_chest_location[3] =
"chest4";
503 level.open_chest_location[4] =
"chest5";
504 level.open_chest_location[5] =
"start_chest";
508 #define JUGGERNAUT_MACHINE_LIGHT_FX "jugger_light"
509 #define QUICK_REVIVE_MACHINE_LIGHT_FX "revive_light"
510 #define STAMINUP_MACHINE_LIGHT_FX "marathon_light"
511 #define WIDOWS_WINE_FX_MACHINE_LIGHT "widow_light"
512 #define SLEIGHT_OF_HAND_MACHINE_LIGHT_FX "sleight_light"
513 #define DOUBLETAP2_MACHINE_LIGHT_FX "doubletap2_light"
514 #define DEADSHOT_MACHINE_LIGHT_FX "deadshot_light"
515 #define ADDITIONAL_PRIMARY_WEAPON_MACHINE_LIGHT_FX "additionalprimaryweapon_light"
526 trig = getent(
"use_power_switch",
"targetname");
527 trig sethintstring(&
"ZOMBIE_ELECTRIC_SWITCH");
528 trig SetCursorHint(
"HINT_NOICON" );
540 trig waittill(
"trigger",user);
541 if( isdefined( user ) )
547 level thread
scene::play(
"power_switch",
"targetname" );
552 level notify(
"sleight_on" );
554 level notify(
"revive_on" );
556 level notify(
"doubletap_on" );
558 level notify(
"juggernog_on" );
560 level notify(
"Pack_A_Punch_on" );
562 level notify(
"specialty_armorvest_power_on" );
564 level notify(
"specialty_rof_power_on" );
566 level notify(
"specialty_quickrevive_power_on" );
568 level notify(
"specialty_fastreload_power_on" );
580 s_switch =
struct::get(
"power_switch_fx",
"targetname");
581 forward = AnglesToForward( s_switch.origin );
582 playfx( level._effect[
"switch_sparks"], s_switch.origin, forward );
599 zombies = GetAiArray( level.zombie_team );
600 for ( i = 0; i < zombies.size; i++ )
608 self endon(
"death" );
610 player = GetPlayers()[0];
616 away = VectorNormalize(
self.origin - player.origin );
617 endPos =
self.origin + VectorScale( away, 600 );
619 locs = array::randomize( level.zm_loc_types[
"dog_location" ] );
621 for ( i = 0; i < locs.size; i++ )
623 dist_zombie = DistanceSquared( locs[i].origin, endPos );
624 dist_player = DistanceSquared( locs[i].origin, player.origin );
626 if ( dist_zombie < dist_player )
633 self notify(
"stop_find_flesh" );
634 self notify(
"zombie_acquire_enemy" );
636 self SetGoal( locs[dest].origin );
652 if ( level.round_number <= 10 )
659 powerup = level.zombie_special_drop_array[ RandomInt(level.zombie_special_drop_array.size) ];
660 if ( level.round_number > 15 && ( RandomInt(100) < (level.round_number - 15)*5 ) )
672 if ( level.round_number > 10 && ( RandomInt(100) < (level.round_number - 10)*5 ) )
675 powerup = level.zombie_powerup_array[ RandomInt(level.zombie_powerup_array.size) ];
683 if ( IsDefined( level._zombiemode_special_drop_setup ) )
685 is_powerup = [[ level._zombiemode_special_drop_setup ]]( powerup );
690 Playfx( level._effect[
"lightning_dog_spawn"],
self.origin );
691 playsoundatposition(
"zmb_hellhound_prespawn",
self.origin );
693 playsoundatposition(
"zmb_hellhound_bolt",
self.origin );
695 Earthquake( 0.5, 0.75,
self.origin, 1000);
697 playsoundatposition(
"zmb_hellhound_spawn",
self.origin );
701 thread zm_utility::play_sound_2d(
"vox_sam_nospawn" );
715 #define RANDOM_PLAYER 4
750 if( level.players.size >= 2 )
765 wait(randomintrange(2,5));
771 level waittill(
"sndConversationDone" );
772 wait(randomintrange(20,30));
778 level waittill(
"end_of_round" );
779 wait(randomintrange(4,7));
787 level waittill(
"start_of_round" );
789 if( !
IS_TRUE( level.first_round ) )
793 wait(randomintrange(45,60));
799 wait(randomintrange(7,10));
801 while(
IS_TRUE( level.players[0].isSpeaking ) )
804 level.sndVoxOverride =
true;
805 doLine( level.players[0],
"fieldreport_start_0" );
808 doLine( level.players[0],
"fieldreport_start_1" );
810 level.sndVoxOverride =
false;
817 level waittill(
"end_of_round" );
818 wait(randomintrange(1,3));
820 while(
IS_TRUE( level.players[0].isSpeaking ) )
823 level.sndVoxOverride =
true;
824 doLine( level.players[0],
"fieldreport_round1_0" );
825 level.sndVoxOverride =
false;
832 level waittill(
"end_of_round" );
833 wait(randomintrange(1,3));
835 while(
IS_TRUE( level.players[0].isSpeaking ) )
838 level.sndVoxOverride =
true;
839 doLine( level.players[0],
"fieldreport_round2_0" );
842 doLine( level.players[0],
"fieldreport_round2_1" );
844 level.sndVoxOverride =
false;
849 if( isdefined( guy ) )
852 guy playsoundontag(
"vox_plr_"+guy.characterIndex+
"_"+alias,
"J_Head" );
860 playbackTime = soundgetplaybacktime( alias );
862 if( !isdefined( playbackTime ) )
865 if ( playbackTime >= 0 )
866 playbackTime = playbackTime * .001;
875 array::randomize(
array );
879 if( guy.characterIndex != 2 )
886 foreach( guy
in level.players )
888 if( guy.characterIndex == charIndex )
895 foreach( player
in level.players )
906 #define PLAYTYPE_REJECT 1
907 #define PLAYTYPE_QUEUE 2
908 #define PLAYTYPE_ROUND 3
909 #define PLAYTYPE_SPECIAL 4
910 #define PLAYTYPE_GAMEEND 5
926 level waittill(
"sndDoorOpening" );
932 level.paTalking =
false;
938 ent =
spawn(
"script_origin", pa.origin );
949 level.paTalking =
true;
953 playbacktime = soundgetplaybacktime( alias );
954 if( !isdefined( playbacktime ) || playbacktime <= 2 )
957 waittime = playbackTime * .001;
964 level.paTalking =
false;
969 array::randomize(level.paArray);
971 foreach( pa
in level.paArray )
973 pa playsound( alias );
979 if( isdefined( trap ) )
983 switch( trap.target )
998 switch( trap.target )
1016 if( level.zombie_respawns > 0 )
1018 if( !isdefined(level.n_player_spawn_selection_index) )
1020 level.n_player_spawn_selection_index = 0;
1024 a_players = GetPlayers();
1025 level.n_player_spawn_selection_index++;
1026 if( level.n_player_spawn_selection_index >= a_players.size )
1028 level.n_player_spawn_selection_index = 0;
1030 e_player = a_players[ level.n_player_spawn_selection_index ];
1033 ArraySortClosest( a_spots, e_player.origin );
1038 v_player_dir = anglestoforward( e_player.angles );
1039 for( i=0; i<a_spots.size; i++ )
1041 v_dir = a_spots[i].origin - e_player.origin;
1042 dp = vectordot( v_player_dir, v_dir );
1045 a_candidates[a_candidates.size] = a_spots[i];
1046 if( a_candidates.size > 10 )
1053 if( a_candidates.size )
1055 s_spot = array::random(a_candidates);
1059 s_spot = array::random(a_spots);
1065 s_spot = array::random(a_spots);