‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
zm_giant.gsc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
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;
13 
14 #insert scripts\shared\shared.gsh;
15 #insert scripts\shared\version.gsh;
16 
17 #insert scripts\zm\_zm_utility.gsh;
18 
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;
26 
27 #using scripts\shared\ai\zombie_utility;
28 
29 //Perks
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;
39 
40 //Powerups
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;
49 
50 //Traps
51 #using scripts\zm\_zm_trap_electric;
52 
53 // Misc
54 #using scripts\zm\zm_giant_cleanup_mgr;
55 #using scripts\zm\zm_giant_fx;
56 #using scripts\zm\zm_giant_teleporter;
57 
58 
59 #using scripts\zm\zm_usermap;
60 
61 
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" );
69 
70 #precache( "string", "ZOMBIE_NEED_POWER" );
71 #precache( "string", "ZOMBIE_ELECTRIC_SWITCH" );
72 
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" );
81 
82 #precache( "model", "p6_power_lever" );
83 
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" );
95 
96 
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" );
110 
111 
112 //*****************************************************************************
113 // MAIN
114 //*****************************************************************************
115 
116 function ‪main()
117 {
118  SetClearanceCeiling( 17 ); // only zombies and dogs in this level
119 
122 
123  //Setup callbacks for bridge fxanim
124  ‪scene::add_scene_func("p7_fxanim_zm_factory_bridge_lft_bundle", &‪bridge_disconnect , "init" );
125  ‪scene::add_scene_func("p7_fxanim_zm_factory_bridge_lft_bundle", &‪bridge_connect , "done" );
126  ‪scene::add_scene_func("p7_fxanim_zm_factory_bridge_rt_bundle", &‪bridge_disconnect , "init" );
127  ‪scene::add_scene_func("p7_fxanim_zm_factory_bridge_rt_bundle", &‪bridge_connect , "done" );
128 
129  level.randomize_perk_machine_location = true; // set before zm_usermap::main
130  level.dog_rounds_allowed=1; // set before zm_usermap::main
131 
133 
134  level._uses_default_wallbuy_fx = 1;
135 
137 
138  //Setup game mode defaults
139  level.default_start_location = "start_room";
140  level.default_game_mode = "zclassic";
141 
142  ‪zm::spawn_life_brush( (700, -986, 280), 128, 128 );
143 
144  level.random_pandora_box_start = true;
145 
146  clock = GetEnt( "factory_clock", "targetname" );
147  clock thread ‪scene::play( "p7_fxanim_zm_factory_clock_bundle" );
148 
149  level.has_richtofen = false;
150 
151  level.powerup_special_drop_override = &‪powerup_special_drop_override;
152 
153  level thread ‪custom_add_vox();
154  level.enemy_location_override_func = &‪enemy_location_override;
155  level.no_target_override = &‪no_target_override;
156 
158 
159  //Level specific stuff
160  level.zm_custom_spawn_location_selection = &‪factory_custom_spawn_location_selection;
161 
162  //If enabled then the zombies will get a keyline round them so we can see them through walls
163  level.debug_keyline_zombies = false;
164 
165  level.burning_zombies = []; //JV max number of zombies that can be on fire
166  level.max_barrier_search_dist_override = 400;
167 
168  level.door_dialog_function = &‪zm::play_door_dialog;
169 
170  level.zombie_anim_override = &‪zm_giant::anim_override_func;
171 
172  level._round_start_func = &‪zm::round_start;
173 
174  ‪init_sounds();
176  level thread ‪power_electric_switch();
177 
178  level thread ‪magic_box_init();
179 
180  //Setup the levels Zombie Zone Volumes
181  level.zones = [];
182  level.zone_manager_init_func =&‪factory_zone_init;
183  init_zones[0] = "receiver_zone";
184  level thread ‪zm_zonemgr::manage_zones( init_zones );
185 
186  level.zombie_ai_limit = 24;
187 
188  level thread ‪jump_from_bridge();
190 
191  level thread ‪bridge_init();
192 
193  level thread ‪sndFunctions();
194  level.sndTrapFunc = &‪sndPA_Traps;
195  level.monk_scream_trig = getent( "monk_scream_trig", "targetname" );
196 
197  // Special level specific settings
198  ‪zombie_utility::set_zombie_var( "zombie_powerup_drop_max_per_round", 4 ); // lower this to make drop happen more often
199 
200  level.use_powerup_volumes = true;
201 }
202 
204 {
205  ‪clientfield::register( "world", "console_blue", ‪VERSION_SHIP, 1, "int" );
206  ‪clientfield::register( "world", "console_green", ‪VERSION_SHIP, 1, "int" );
207  ‪clientfield::register( "world", "console_red", ‪VERSION_SHIP, 1, "int" );
208  ‪clientfield::register( "world", "console_start", ‪VERSION_SHIP, 1, "int" );
209  ‪clientfield::register( "toplayer", "lightning_strike", ‪VERSION_SHIP, 1, "counter" );
210 }
211 
213 {
214  clock = GetEnt( "factory_clock", "targetname" );
215  clock thread ‪scene::play( "p7_fxanim_zm_factory_clock_igc_bundle" );
216 }
217 
219 {
220  self thread ‪periodic_lightning_strikes();
221 }
222 
224 {
225  self endon( "disconnect" );
226  ‪util::wait_network_frame(); // Hotjoin fix: Wait one network frame to make sure the clientfield has completed registration.
227 
228  while( true )
229  {
230  n_random_wait = RandomIntRange( 12, 18 );
231 
232  if( isdefined( self ) && IsPlayer( self ) )
233  {
234  self notify( "lightning_strike" );
235  self ‪clientfield::increment_to_player( "lightning_strike", 1 );
236  }
237  wait n_random_wait;
238  }
239 }
240 
241 
243 {
244  ‪zm_audio::loadPlayerVoiceCategories("gamedata/audio/zm/zm_factory_vox.csv");
245 }
246 
247 
249 {
250 }
251 
252 
253 //-------------------------------------------------------------------------------
254 // Create the zone information for zombie spawning
255 //-------------------------------------------------------------------------------
257 {
258  // Note this setup is based on a flag-centric view of setting up your zones. A brief
259  // zone-centric example exists below in comments
260 
261  // Outside East Door
262  ‪zm_zonemgr::add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );
263 
264  // Outside West Door
265  ‪zm_zonemgr::add_adjacent_zone( "receiver_zone", "outside_west_zone", "enter_outside_west" );
266 
267  // Wnuen building ground floor
268  ‪zm_zonemgr::add_adjacent_zone( "wnuen_zone", "outside_east_zone", "enter_wnuen_building" );
269 
270  // Wnuen stairway
271  ‪zm_zonemgr::add_adjacent_zone( "wnuen_zone", "wnuen_bridge_zone", "enter_wnuen_loading_dock" );
272 
273  // Warehouse bottom
274  ‪zm_zonemgr::add_adjacent_zone( "warehouse_bottom_zone", "outside_west_zone", "enter_warehouse_building" );
275 
276  // Warehosue top
277  ‪zm_zonemgr::add_adjacent_zone( "warehouse_bottom_zone", "warehouse_top_zone", "enter_warehouse_second_floor" );
278  ‪zm_zonemgr::add_adjacent_zone( "warehouse_top_zone", "bridge_zone", "enter_warehouse_second_floor" );
279 
280  // TP East
281  ‪zm_zonemgr::add_adjacent_zone( "tp_east_zone", "wnuen_zone", "enter_tp_east" );
282 
283  ‪zm_zonemgr::add_adjacent_zone( "tp_east_zone", "outside_east_zone", "enter_tp_east", true );
284  ‪zm_zonemgr::add_zone_flags( "enter_tp_east", "enter_wnuen_building" );
285 
286  // TP South
287  ‪zm_zonemgr::add_adjacent_zone( "tp_south_zone", "outside_south_zone", "enter_tp_south" );
288 
289  // TP West
290  ‪zm_zonemgr::add_adjacent_zone( "tp_west_zone", "warehouse_top_zone", "enter_tp_west" );
291 
292  //_zm_zonemgr::add_adjacent_zone( "tp_west_zone", "warehouse_bottom_zone", "enter_tp_west", true );
293  //_zm_zonemgr::add_zone_flags( "enter_tp_west", "enter_warehouse_second_floor" );
294 }
295 
296 
297 function ‪enemy_location_override( zombie, enemy )
298 {
299  AIProfile_BeginEntry( "factory-enemy_location_override" );
300 
301  if ( ‪IS_TRUE( zombie.is_trapped ) )
302  {
303  AIProfile_EndEntry();
304  return zombie.origin;
305  }
306 
307  AIProfile_EndEntry();
308  return undefined;
309 }
310 
311 // --------------------------------
312 // NO TARGET OVERRIDE
313 // --------------------------------
315 {
316  if( IsDefined( position ) )
317  {
318  goal_point = GetClosestPointOnNavMesh( position.origin, 100 );
319  if( IsDefined( goal_point ) )
320  {
321  self SetGoal( goal_point );
322  self.has_exit_point = 1;
323  return true;
324  }
325  }
326 
327  return false;
328 }
329 
330 function ‪no_target_override( zombie )
331 {
332  if( isdefined( zombie.has_exit_point ) )
333  {
334  return;
335  }
336 
337  players = level.players;
338 
339  dist_zombie = 0;
340  dist_player = 0;
341  dest = 0;
342 
343  if ( isdefined( level.zm_loc_types[ "dog_location" ] ) )
344  {
345  locs = array::randomize( level.zm_loc_types[ "dog_location" ] );
346 
347  for ( i = 0; i < locs.size; i++ )
348  {
349  found_point = false;
350  foreach( player in players )
351  {
353  {
354  continue;
355  }
356 
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 );
361 
362  if ( dist_zombie < dist_player )
363  {
364  dest = i;
365  found_point= true;
366  }
367  else
368  {
369  found_point = false;
370  }
371  }
372  if( found_point )
373  {
374  if( zombie ‪validate_and_set_no_target_position( locs[i] ) )
375  {
376  return;
377  }
378  }
379  }
380  }
381 
382 
384 
385  if( zombie ‪validate_and_set_no_target_position( escape_position ) )
386  {
387  return;
388  }
389 
390  escape_position = zombie ‪giant_cleanup::get_escape_position();
391 
392  if( zombie ‪validate_and_set_no_target_position( escape_position ) )
393  {
394  return;
395  }
396 
397  zombie.has_exit_point = 1;
398 
399  zombie SetGoal( zombie.origin );
400 }
401 
402 // --------------------------------
403 
405 {
406 }
407 
409 {
410  spawn_points = ‪struct::get_array("player_respawn_point", "targetname");
411  for( i = 0; i < spawn_points.size; i++ )
412  {
413  spawn_points[i].locked = true;
414  }
415 }
416 
417 //-------------------------------------------------------------------------------
418 // handles lowering the bridge when power is turned on
419 //-------------------------------------------------------------------------------
420 function ‪bridge_init()
421 {
422  level ‪flag::init( "bridge_down" );
423 
424  bridge_audio = ‪struct::get( "bridge_audio", "targetname" );
425 
426  // wait for power
427  level ‪flag::wait_till( "power_on" );
428  level util::clientnotify ("pl1");
429 
430  level thread ‪scene::play( "p7_fxanim_zm_factory_bridge_lft_bundle" );
431  level ‪scene::play( "p7_fxanim_zm_factory_bridge_rt_bundle" );
432  // wait until the bridges are down.
433 
434  level ‪flag::set( "bridge_down" );
435 
436  wnuen_bridge_clip = getent( "wnuen_bridge_clip", "targetname" );
437  wnuen_bridge_clip connectpaths();
438  wnuen_bridge_clip delete();
439 
440  warehouse_bridge_clip = getent( "warehouse_bridge_clip", "targetname" );
441  warehouse_bridge_clip connectpaths();
442  warehouse_bridge_clip delete();
443 
444  wnuen_bridge = getent( "wnuen_bridge", "targetname" );
445  wnuen_bridge connectpaths();
446 
447  ‪zm_zonemgr::connect_zones( "wnuen_bridge_zone", "bridge_zone" );
448  ‪zm_zonemgr::connect_zones( "warehouse_top_zone", "bridge_zone" );
449 
450  wait(14);
451 
452  level thread ‪zm_giant::sndPA_DoVox( "vox_maxis_teleporter_lost_0" );
453 }
454 
455 function ‪bridge_disconnect( a_parts )
456 {
457  foreach( part in a_parts )
458  {
459  part DisconnectPaths();
460  }
461 }
462 
463 function ‪bridge_connect( a_parts )
464 {
465  foreach( part in a_parts )
466  {
467  part ConnectPaths();
468  }
469 }
470 
472 {
473  trig = GetEnt( "trig_outside_south_zone", "targetname" );
474  trig waittill( "trigger" );
475 
476  ‪zm_zonemgr::connect_zones( "outside_south_zone", "bridge_zone", true );
477  ‪zm_zonemgr::connect_zones( "outside_south_zone", "wnuen_bridge_zone", true );
478 }
479 
480 
481 function ‪init_sounds()
482 {
483  ‪zm_utility::add_sound( "break_stone", "evt_break_stone" );
484  ‪zm_utility::add_sound( "gate_door", "zmb_gate_slide_open" );
485  ‪zm_utility::add_sound( "heavy_door", "zmb_heavy_door_open" );
486 
487  // override the default slide with the buzz slide
488  ‪zm_utility::add_sound("zmb_heavy_door_open", "zmb_heavy_door_open");
489 }
490 
491 //
492 // This initialitze the box spawn locations
493 // You can disable boxes from appearing by not adding their script_noteworthy ID to the list
494 //
496 {
497  //MM - all locations are valid. If it goes somewhere you haven't opened, you need to open it.
498  level.open_chest_location = [];
499  level.open_chest_location[0] = "chest1"; // TP East
500  level.open_chest_location[1] = "chest2"; // TP West
501  level.open_chest_location[2] = "chest3"; // TP South
502  level.open_chest_location[3] = "chest4"; // WNUEN
503  level.open_chest_location[4] = "chest5"; // Warehouse bottom
504  level.open_chest_location[5] = "start_chest";
505 }
506 
507 
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"
516 
517 
518 
519 /*------------------------------------
520 the electric switch under the bridge
521 once this is used, it activates other objects in the map
522 and makes them available to use
523 ------------------------------------*/
525 {
526  trig = getent("use_power_switch","targetname");
527  trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");
528  trig SetCursorHint( "HINT_NOICON" );
529 
530  //turn off the buyable door triggers for electric doors
531 // door_trigs = getentarray("electric_door","script_noteworthy");
532 // array::thread_all(door_trigs,::set_door_unusable);
533 // array::thread_all(door_trigs,::play_door_dialog);
534 
535  cheat = false;
536 
537  user = undefined;
538  if ( cheat != true )
539  {
540  trig waittill("trigger",user);
541  if( isdefined( user ) )
542  {
543  //user zm_audio::create_and_play_dialog( "general", "power_on" );
544  }
545  }
546 
547  level thread ‪scene::play( "power_switch", "targetname" );
548 
549  //TO DO (TUEY) - kick off a 'switch' on client script here that operates similiarly to Berlin2 subway.
550  level ‪flag::set( "power_on" );
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" );
570 
571  level ‪util::set_lighting_state( 0 );
572 
573  ‪util::clientNotify("ZPO"); // Zombie Power On!
575 
576  trig delete();
577 
578  wait 1;
579 
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 );
583 
584  // Don't want east or west to spawn when in south zone, but vice versa is okay
585  ‪zm_zonemgr::connect_zones( "outside_east_zone", "outside_south_zone" );
586  ‪zm_zonemgr::connect_zones( "outside_west_zone", "outside_south_zone", true );
587 
588  level ‪util::delay( 19, undefined, &‪zm_audio::sndMusicSystem_PlayState, "power_on" );
589 }
590 
591 //*** AUDIO SECTION ***
592 
593 
594 //-------------------------------------------------------------------------------
595 // Solo Revive zombie exit points.
596 //-------------------------------------------------------------------------------
598 {
599  zombies = GetAiArray( level.zombie_team );
600  for ( i = 0; i < zombies.size; i++ )
601  {
602  zombies[i] thread ‪factory_find_exit_point();
603  }
604 }
605 
607 {
608  self endon( "death" );
609 
610  player = GetPlayers()[0];
611 
612  dist_zombie = 0;
613  dist_player = 0;
614  dest = 0;
615 
616  away = VectorNormalize( self.origin - player.origin );
617  endPos = self.origin + VectorScale( away, 600 );
618 
619  locs = array::randomize( level.zm_loc_types[ "dog_location" ] );
620 
621  for ( i = 0; i < locs.size; i++ )
622  {
623  dist_zombie = DistanceSquared( locs[i].origin, endPos );
624  dist_player = DistanceSquared( locs[i].origin, player.origin );
625 
626  if ( dist_zombie < dist_player )
627  {
628  dest = i;
629  break;
630  }
631  }
632 
633  self notify( "stop_find_flesh" );
634  self notify( "zombie_acquire_enemy" );
635 
636  self SetGoal( locs[dest].origin );
637 
638  while ( 1 )
639  {
640  if ( !level ‪flag::get( "wait_and_revive" ) )
641  {
642  break;
643  }
645  }
646 
647 }
648 
650 {
651  // Always give something at lower rounds or if a player is in last stand mode.
652  if ( level.round_number <= 10 )
653  {
655  }
656  // Gets harder now
657  else
658  {
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 ) )
661  {
662  powerup = "nothing";
663  }
664  }
665 
666  //MM test Change this if you want the same thing to keep spawning
667  //powerup = "dog";
668  switch ( powerup )
669  {
670  // Limit max ammo drops because it's too powerful
671  case "full_ammo":
672  if ( level.round_number > 10 && ( RandomInt(100) < (level.round_number - 10)*5 ) )
673  {
674  // Randomly pick another one
675  powerup = level.zombie_powerup_array[ RandomInt(level.zombie_powerup_array.size) ];
676  }
677  break;
678 
679  // Nothing drops!!
680  case "free_perk": // "nothing"
681  case "nothing": // "nothing"
682  // RAVEN BEGIN bhackbarth: callback for level specific powerups
683  if ( IsDefined( level._zombiemode_special_drop_setup ) )
684  {
685  is_powerup = [[ level._zombiemode_special_drop_setup ]]( powerup );
686  }
687  // RAVEN END
688  else
689  {
690  Playfx( level._effect["lightning_dog_spawn"], self.origin );
691  playsoundatposition( "zmb_hellhound_prespawn", self.origin );
692  wait( 1.5 );
693  playsoundatposition( "zmb_hellhound_bolt", self.origin );
694 
695  Earthquake( 0.5, 0.75, self.origin, 1000);
696  //PlayRumbleOnPosition("explosion_generic", self.origin);//TODO T7 - fix rumble
697  playsoundatposition( "zmb_hellhound_spawn", self.origin );
698 
699  wait( 1.0 );
700  //iprintlnbold( "Samantha Sez: No Powerup For You!" );
701  thread zm_utility::play_sound_2d( "vox_sam_nospawn" );
702  self Delete();
703  }
704  powerup = undefined;
705  break;
706  }
707  return powerup;
708 }
709 
710 //AUDIO
711 #define DEMPSEY 0
712 #define NIKOLAI 1
713 #define RICHTOFEN 2
714 #define TAKEO 3
715 #define RANDOM_PLAYER 4
716 function ‪sndFunctions()
717 {
718  level thread ‪setupMusic();
719  level thread ‪sndFirstDoor();
720  level thread ‪sndPASetup();
721  level thread ‪sndConversations();
722 }
723 
725 {
726  level ‪flag::wait_till( "initial_blackscreen_passed" );
727 
728  level ‪zm_audio::sndConversation_Init( "round1start" );
729  level ‪zm_audio::sndConversation_AddLine( "round1start", "round1_start_0", ‪RANDOM_PLAYER, ‪RICHTOFEN );
730  level ‪zm_audio::sndConversation_AddLine( "round1start", "round1_start_0", ‪RICHTOFEN );
731  level ‪zm_audio::sndConversation_AddLine( "round1start", "round1_start_1", ‪RANDOM_PLAYER, ‪RICHTOFEN );
732  level ‪zm_audio::sndConversation_AddLine( "round1start", "round1_start_1", ‪RICHTOFEN );
733 
734  level ‪zm_audio::sndConversation_Init( "round1during", "end_of_round" );
735  level ‪zm_audio::sndConversation_AddLine( "round1during", "round1_during_0", ‪NIKOLAI );
736  level ‪zm_audio::sndConversation_AddLine( "round1during", "round1_during_0", ‪TAKEO );
737  level ‪zm_audio::sndConversation_AddLine( "round1during", "round1_during_0", ‪DEMPSEY );
738  level ‪zm_audio::sndConversation_AddLine( "round1during", "round1_during_0", ‪RICHTOFEN );
739 
740  level ‪zm_audio::sndConversation_Init( "round1end" );
741  level ‪zm_audio::sndConversation_AddLine( "round1end", "round1_end_0", ‪RANDOM_PLAYER, ‪RICHTOFEN );
742  level ‪zm_audio::sndConversation_AddLine( "round1end", "round1_end_0", ‪RICHTOFEN );
743 
744  level ‪zm_audio::sndConversation_Init( "round2during", "end_of_round" );
745  level ‪zm_audio::sndConversation_AddLine( "round2during", "round2_during_0", ‪DEMPSEY );
746  level ‪zm_audio::sndConversation_AddLine( "round2during", "round2_during_0", ‪TAKEO );
747  level ‪zm_audio::sndConversation_AddLine( "round2during", "round2_during_0", ‪NIKOLAI );
748  level ‪zm_audio::sndConversation_AddLine( "round2during", "round2_during_0", ‪RICHTOFEN );
749 
750  if( level.players.size >= 2 )
751  {
752  level thread ‪sndConvo1();
753  level thread ‪sndConvo2();
754  level thread ‪sndConvo3();
755  level thread ‪sndConvo4();
756  }
757  else
758  {
759  level thread ‪sndFieldReport1();
760  }
761 }
762 
763 function ‪sndConvo1()
764 {
765  wait(randomintrange(2,5));
766  level ‪zm_audio::sndConversation_Play( "round1start" );
767 }
768 
769 function ‪sndConvo2()
770 {
771  level waittill( "sndConversationDone" );
772  wait(randomintrange(20,30));
773  level ‪zm_audio::sndConversation_Play( "round1during" );
774 }
775 
776 function ‪sndConvo3()
777 {
778  level waittill( "end_of_round" );
779  wait(randomintrange(4,7));
780  level ‪zm_audio::sndConversation_Play( "round1end" );
781 }
782 
783 function ‪sndConvo4()
784 {
785  while(1)
786  {
787  level waittill( "start_of_round" );
788 
789  if( !‪IS_TRUE( level.first_round ) )
790  break;
791  }
792 
793  wait(randomintrange(45,60));
794  level ‪zm_audio::sndConversation_Play( "round2during" );
795 }
796 
798 {
799  wait(randomintrange(7,10));
800 
801  while( ‪IS_TRUE( level.players[0].isSpeaking ) )
802  wait(.5);
803 
804  level.sndVoxOverride = true;
805  ‪doLine( level.players[0], "fieldreport_start_0" );
806  if( isdefined( ‪getSpecificCharacter(2) ) )
807  {
808  ‪doLine( level.players[0], "fieldreport_start_1" );
809  }
810  level.sndVoxOverride = false;
811 
812  level thread ‪sndFieldReport2();
813 }
814 
816 {
817  level waittill( "end_of_round" );
818  wait(randomintrange(1,3));
819 
820  while( ‪IS_TRUE( level.players[0].isSpeaking ) )
821  wait(.5);
822 
823  level.sndVoxOverride = true;
824  ‪doLine( level.players[0], "fieldreport_round1_0" );
825  level.sndVoxOverride = false;
826 
827  level thread ‪sndFieldReport3();
828 }
829 
831 {
832  level waittill( "end_of_round" );
833  wait(randomintrange(1,3));
834 
835  while( ‪IS_TRUE( level.players[0].isSpeaking ) )
836  wait(.5);
837 
838  level.sndVoxOverride = true;
839  ‪doLine( level.players[0], "fieldreport_round2_0" );
840  if( isdefined( ‪getSpecificCharacter(2) ) )
841  {
842  ‪doLine( level.players[0], "fieldreport_round2_1" );
843  }
844  level.sndVoxOverride = false;
845 }
846 
847 function ‪doLine( guy, alias )
848 {
849  if( isdefined( guy ) )
850  {
851  guy ‪clientfield::set_to_player( "isspeaking",1 );
852  guy playsoundontag( "vox_plr_"+guy.characterIndex+"_"+alias, "J_Head" );
853  ‪waitPlaybackTime("vox_plr_"+guy.characterIndex+"_"+alias);
854  guy ‪clientfield::set_to_player( "isspeaking",0 );
855  }
856 }
857 
858 function ‪waitPlaybackTime(alias)
859 {
860  playbackTime = soundgetplaybacktime( alias );
861 
862  if( !isdefined( playbackTime ) )
863  playbackTime = 1;
864 
865  if ( playbackTime >= 0 )
866  playbackTime = playbackTime * .001;
867  else
868  playbackTime = 1;
869 
870  wait(playbacktime);
871 }
873 {
874  ‪array = level.players;
875  array::randomize( ‪array );
876 
877  foreach( guy in ‪array )
878  {
879  if( guy.characterIndex != 2 )
880  return guy;
881  }
882  return undefined;
883 }
884 function ‪getSpecificCharacter(charIndex)
885 {
886  foreach( guy in level.players )
887  {
888  if( guy.characterIndex == charIndex )
889  return guy;
890  }
891  return undefined;
892 }
894 {
895  foreach( player in level.players )
896  {
897  if( ‪IS_TRUE( player.isSpeaking ) )
898  {
899  return true;
900  }
901  }
902 
903  return false;
904 }
905 
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
911 function ‪setupMusic()
912 {
913  ‪zm_audio::musicState_Create("round_start", ‪PLAYTYPE_ROUND, "roundstart1", "roundstart2", "roundstart3", "roundstart4" );
914  ‪zm_audio::musicState_Create("round_start_short", ‪PLAYTYPE_ROUND, "roundstart_short1", "roundstart_short2", "roundstart_short3", "roundstart_short4" );
915  ‪zm_audio::musicState_Create("round_start_first", ‪PLAYTYPE_ROUND, "roundstart_first" );
916  ‪zm_audio::musicState_Create("round_end", ‪PLAYTYPE_ROUND, "roundend1" );
917  ‪zm_audio::musicState_Create("game_over", ‪PLAYTYPE_GAMEEND, "gameover" );
918  ‪zm_audio::musicState_Create("dog_start", ‪PLAYTYPE_ROUND, "dogstart1" );
919  ‪zm_audio::musicState_Create("dog_end", ‪PLAYTYPE_ROUND, "dogend1" );
921  ‪zm_audio::musicState_Create("power_on", ‪PLAYTYPE_QUEUE, "poweron" );
922 }
923 
924 function ‪sndFirstDoor()
925 {
926  level waittill( "sndDoorOpening" );
927  level thread ‪zm_audio::sndMusicSystem_PlayState( "first_door" );
928 }
929 
930 function ‪sndPASetup()
931 {
932  level.paTalking = false;
933  level.paArray = ‪array();
934 
935  ‪array = ‪struct::get_array( "pa_system", "targetname" );
936  foreach( pa in ‪array )
937  {
938  ent = ‪spawn( "script_origin", pa.origin );
939  ‪ARRAY_ADD(level.paArray, ent);
940  }
941 }
942 function ‪sndPA_DoVox( alias, ‪delay, nowait = false )
943 {
944  if( isdefined( ‪delay ) )
945  wait(‪delay);
946 
947  if( !‪IS_TRUE( level.paTalking ) )
948  {
949  level.paTalking = true;
950 
951  level thread ‪sndPA_playvox(alias);
952 
953  playbacktime = soundgetplaybacktime( alias );
954  if( !isdefined( playbacktime ) || playbacktime <= 2 )
955  waittime = 1;
956  else
957  waittime = playbackTime * .001;
958 
959  if( !nowait )
960  {
961  wait(waittime-.9);
962  }
963 
964  level.paTalking = false;
965  }
966 }
967 function ‪sndPA_playvox( alias )
968 {
969  array::randomize(level.paArray);
970 
971  foreach( pa in level.paArray )
972  {
973  pa playsound( alias );
974  wait(.05);
975  }
976 }
977 function ‪sndPA_Traps(trap,stage)
978 {
979  if( isdefined( trap ) )
980  {
981  if( stage == 1 )
982  {
983  switch( trap.target )
984  {
985  case "trap_b":
986  level thread ‪zm_giant::sndPA_DoVox( "vox_maxis_trap_warehouse_inuse_0", 2 );
987  break;
988  case "trap_a":
989  level thread ‪zm_giant::sndPA_DoVox( "vox_maxis_trap_lab_inuse_0", 2 );
990  break;
991  case "trap_c":
992  level thread ‪zm_giant::sndPA_DoVox( "vox_maxis_trap_bridge_inuse_0", 2 );
993  break;
994  }
995  }
996  else
997  {
998  switch( trap.target )
999  {
1000  case "trap_b":
1001  level thread ‪zm_giant::sndPA_DoVox( "vox_maxis_trap_warehouse_active_0", 4 );
1002  break;
1003  case "trap_a":
1004  level thread ‪zm_giant::sndPA_DoVox( "vox_maxis_trap_lab_active_0", 4 );
1005  break;
1006  case "trap_c":
1007  level thread ‪zm_giant::sndPA_DoVox( "vox_maxis_trap_bridge_active_0", 4 );
1008  break;
1009  }
1010  }
1011  }
1012 }
1013 
1015 {
1016  if( level.zombie_respawns > 0 )
1017  {
1018  if( !isdefined(level.n_player_spawn_selection_index) )
1019  {
1020  level.n_player_spawn_selection_index = 0;
1021  }
1022 
1023  // Get a player to spawn close by
1024  a_players = GetPlayers();
1025  level.n_player_spawn_selection_index++;
1026  if( level.n_player_spawn_selection_index >= a_players.size )
1027  {
1028  level.n_player_spawn_selection_index = 0;
1029  }
1030  e_player = a_players[ level.n_player_spawn_selection_index ];
1031 
1032  // Order the spots so they are closest to the player
1033  ArraySortClosest( a_spots, e_player.origin );
1034 
1035  a_candidates = [];
1036 
1037  // Now pick the first 10 spots ahead of the player
1038  v_player_dir = anglestoforward( e_player.angles );
1039  for( i=0; i<a_spots.size; i++ )
1040  {
1041  v_dir = a_spots[i].origin - e_player.origin;
1042  dp = vectordot( v_player_dir, v_dir );
1043  if( dp >= 0.0 )
1044  {
1045  a_candidates[a_candidates.size] = a_spots[i];
1046  if( a_candidates.size > 10 )
1047  {
1048  break;
1049  }
1050  }
1051  }
1052 
1053  if( a_candidates.size )
1054  {
1055  s_spot = array::random(a_candidates);
1056  }
1057  else
1058  {
1059  s_spot = array::random(a_spots);
1060  }
1061  }
1062 
1063  else
1064  {
1065  s_spot = array::random(a_spots);
1066  }
1067 
1068  return( s_spot );
1069 }
1070 
1071 
1073 {
1074 }
1075 
‪factory_custom_spawn_location_selection
‪function factory_custom_spawn_location_selection(a_spots)
Definition: zm_giant.gsc:1014
‪RICHTOFEN
‪#define RICHTOFEN
Definition: zm_giant.gsc:713
‪lock_additional_player_spawner
‪function lock_additional_player_spawner()
Definition: zm_giant.gsc:408
‪DEMPSEY
‪#define DEMPSEY
Definition: zm_giant.gsc:711
‪PLAYTYPE_GAMEEND
‪#define PLAYTYPE_GAMEEND
Definition: zm_giant.gsc:910
‪bridge_connect
‪function bridge_connect(a_parts)
Definition: zm_giant.gsc:463
‪sndConversation_Play
‪function sndConversation_Play(name)
Definition: _zm_audio.gsc:1691
‪RANDOM_PLAYER
‪#define RANDOM_PLAYER
Definition: zm_giant.gsc:715
‪no_target_override
‪function no_target_override(zombie)
Definition: zm_giant.gsc:330
‪play_door_dialog
‪function play_door_dialog()
Definition: _zm.gsc:4146
‪jump_from_bridge
‪function jump_from_bridge()
Definition: zm_giant.gsc:471
‪sndFieldReport3
‪function sndFieldReport3()
Definition: zm_giant.gsc:830
‪set_to_player
‪function set_to_player(str_field_name, n_value)
Definition: clientfield_shared.gsc:58
‪sndFunctions
‪function sndFunctions()
Definition: zm_giant.gsc:716
‪isAnyoneTalking
‪function isAnyoneTalking()
Definition: zm_giant.gsc:893
‪manage_zones
‪function manage_zones(initial_zone)
Definition: _zm_zonemgr.gsc:810
‪enemy_location_override
‪function enemy_location_override(zombie, enemy)
Definition: zm_giant.gsc:297
‪connect_zones
‪function connect_zones(zone_name_a, zone_name_b, one_way)
Definition: _zm_zonemgr.gsc:772
‪play
‪function play(animation, v_origin_or_ent, v_angles_or_tag, n_rate=1, n_blend_in=.2, n_blend_out=.2, n_lerp, b_link=false)
Definition: animation_shared.csc:44
‪fx_overrides
‪function fx_overrides()
Definition: zm_giant.gsc:1072
‪VERSION_SHIP
‪#define VERSION_SHIP
Definition: version.gsh:36
‪NIKOLAI
‪#define NIKOLAI
Definition: zm_giant.gsc:712
‪init_clientfields
‪function init_clientfields()
Definition: zm_giant.gsc:203
‪get_array
‪function get_array(kvp_value, kvp_key="targetname")
Definition: struct.csc:34
‪set_zombie_var
‪function set_zombie_var(zvar, value, is_float=false, column=1, is_team_based=false)
Definition: zombie_utility.gsc:1434
‪sndFieldReport2
‪function sndFieldReport2()
Definition: zm_giant.gsc:815
‪magic_box_init
‪function magic_box_init()
Definition: zm_giant.gsc:495
‪add_scene_func
‪function add_scene_func(str_scenedef, func, str_state="play",...)
Definition: scene_shared.csc:1628
‪spawn
‪function spawn(v_origin=(0, 0, 0), v_angles=(0, 0, 0))
Definition: struct.csc:23
‪sndConversation_AddLine
‪function sndConversation_AddLine(name, line, player_or_random, ignorePlayer=5)
Definition: _zm_audio.gsc:1668
‪IS_TRUE
‪#define IS_TRUE(__a)
Definition: shared.gsh:251
‪sndConvo3
‪function sndConvo3()
Definition: zm_giant.gsc:776
‪get
‪function get(kvp_value, kvp_key="targetname")
Definition: struct.csc:13
‪add_sound
‪function add_sound(ref, alias)
Definition: _zm_utility.gsc:3030
‪delay
‪function delay(time_or_notify, str_endon, func, arg1, arg2, arg3, arg4, arg5, arg6)
Definition: util_shared.csc:784
‪sndFirstDoor
‪function sndFirstDoor()
Definition: zm_giant.gsc:924
‪getSpecificCharacter
‪function getSpecificCharacter(charIndex)
Definition: zm_giant.gsc:884
‪set_lighting_state
‪function set_lighting_state(n_state)
Definition: util_shared.gsc:3037
‪get_valid_powerup
‪function get_valid_powerup()
Definition: _zm_powerups.gsc:359
‪init_achievement
‪function init_achievement()
Definition: zm_giant.gsc:248
‪powerup_special_drop_override
‪function powerup_special_drop_override()
Definition: zm_giant.gsc:649
‪doLine
‪function doLine(guy, alias)
Definition: zm_giant.gsc:847
‪main
‪function main()
Definition: zm_giant.gsc:116
‪on_spawned
‪function on_spawned(func, obj)
Definition: callbacks_shared.csc:245
‪enable_swap_attachments
‪function enable_swap_attachments()
Definition: _zm_pack_a_punch_util.gsc:88
‪anim_override_func
‪function anim_override_func()
Definition: zm_giant.gsc:404
‪wait_network_frame
‪function wait_network_frame(n_count=1)
Definition: util_shared.gsc:64
‪sndMusicSystem_PlayState
‪function sndMusicSystem_PlayState(state)
Definition: _zm_audio.gsc:1042
‪sndConvo1
‪function sndConvo1()
Definition: zm_giant.gsc:763
‪round_start
‪function round_start()
Definition: _zm.gsc:4071
‪factory_find_exit_point
‪function factory_find_exit_point()
Definition: zm_giant.gsc:606
‪get_escape_position
‪function get_escape_position()
Definition: zm_giant_cleanup_mgr.gsc:295
‪sndConvo4
‪function sndConvo4()
Definition: zm_giant.gsc:783
‪bridge_init
‪function bridge_init()
Definition: zm_giant.gsc:420
‪factory_exit_level
‪function factory_exit_level()
Definition: zm_giant.gsc:597
‪sndPASetup
‪function sndPASetup()
Definition: zm_giant.gsc:930
‪factory_zone_init
‪function factory_zone_init()
Definition: zm_giant.gsc:256
‪increment_to_player
‪function increment_to_player(str_field_name, n_increment_count=1)
Definition: clientfield_shared.gsc:169
‪clock_shot
‪function clock_shot(a_ents)
Definition: zm_giant.gsc:212
‪ARRAY_ADD
‪#define ARRAY_ADD(__array, __item)
Definition: shared.gsh:304
‪power_electric_switch
‪function power_electric_switch()
Definition: zm_giant.gsc:524
‪get_escape_position_in_current_zone
‪function get_escape_position_in_current_zone()
Definition: zm_giant_cleanup_mgr.gsc:395
‪sndFieldReport1
‪function sndFieldReport1()
Definition: zm_giant.gsc:797
‪TAKEO
‪#define TAKEO
Definition: zm_giant.gsc:714
‪wait_till
‪function wait_till(str_flag)
Definition: flag_shared.csc:189
‪sndConversations
‪function sndConversations()
Definition: zm_giant.gsc:724
‪custom_add_vox
‪function custom_add_vox()
Definition: zm_giant.gsc:242
‪array
‪function filter array
Definition: array_shared.csc:16
‪loadPlayerVoiceCategories
‪function loadPlayerVoiceCategories(table)
Definition: _zm_audio.gsc:515
‪sndPA_DoVox
‪function sndPA_DoVox(alias, delay, nowait=false)
Definition: zm_giant.gsc:942
‪PLAYTYPE_QUEUE
‪#define PLAYTYPE_QUEUE
Definition: zm_giant.gsc:907
‪spawn_life_brush
‪function spawn_life_brush(origin, radius, height)
Definition: _zm.gsc:1934
‪sndConversation_Init
‪function sndConversation_Init(name, specialEndon=undefined)
Definition: _zm_audio.gsc:1658
‪init
‪function init()
Definition: struct.csc:1
‪validate_and_set_no_target_position
‪function validate_and_set_no_target_position(position)
Definition: zm_giant.gsc:314
‪clientNotify
‪function clientNotify(event)
Definition: util_shared.gsc:1416
‪bridge_disconnect
‪function bridge_disconnect(a_parts)
Definition: zm_giant.gsc:455
‪a_ents
‪function _query_ents_by_substring_helper a_ents
Definition: util_shared.gsc:3334
‪set
‪function set(str_field_name, n_value)
Definition: clientfield_shared.gsc:34
‪player_is_in_laststand
‪function player_is_in_laststand()
Definition: laststand_shared.gsc:18
‪on_player_spawned
‪function on_player_spawned()
Definition: zm_giant.gsc:218
‪sndPA_Traps
‪function sndPA_Traps(trap, stage)
Definition: zm_giant.gsc:977
‪periodic_lightning_strikes
‪function periodic_lightning_strikes()
Definition: zm_giant.gsc:223
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪add_zone_flags
‪function add_zone_flags(wait_flag, add_flags)
Definition: _zm_zonemgr.gsc:570
‪musicState_Create
‪function musicState_Create(stateName, playType=PLAYTYPE_REJECT, musName1, musName2, musName3, musName4, musName5, musName6)
Definition: _zm_audio.gsc:991
‪PLAYTYPE_ROUND
‪#define PLAYTYPE_ROUND
Definition: zm_giant.gsc:908
‪getRandomNotRichtofen
‪function getRandomNotRichtofen()
Definition: zm_giant.gsc:872
‪init_sounds
‪function init_sounds()
Definition: zm_giant.gsc:481
‪sndPA_playvox
‪function sndPA_playvox(alias)
Definition: zm_giant.gsc:967
‪sndConvo2
‪function sndConvo2()
Definition: zm_giant.gsc:769
‪setupMusic
‪function setupMusic()
Definition: zm_giant.gsc:911
‪waitPlaybackTime
‪function waitPlaybackTime(alias)
Definition: zm_giant.gsc:858
‪add_adjacent_zone
‪function add_adjacent_zone(zone_name_a, zone_name_b, flag_name, one_way, zone_tag_a, zone_tag_b)
Definition: _zm_zonemgr.gsc:595