-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathscript_174ebb9642933bf7.gsc
565 lines (538 loc) · 11.9 KB
/
script_174ebb9642933bf7.gsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
// Decompiled by Serious. Credits to Scoba for his original tool, Cerberus, which I heavily upgraded to support remaining features, other games, and other platforms.
#using scripts\zm_common\zm_round_logic.gsc;
#using scripts\zm_common\zm_customgame.gsc;
#using scripts\zm_common\zm_spawner.gsc;
#using scripts\zm_common\zm_zonemgr.gsc;
#using scripts\zm_common\zm_round_spawning.gsc;
#using scripts\zm_common\zm_score.gsc;
#using scripts\zm_common\zm_utility.gsc;
#using scripts\zm_common\zm_audio.gsc;
#using scripts\core_common\ai\zombie_utility.gsc;
#using scripts\core_common\flagsys_shared.gsc;
#using scripts\core_common\flag_shared.gsc;
#using scripts\core_common\system_shared.gsc;
#using scripts\core_common\spawner_shared.gsc;
#using scripts\core_common\array_shared.gsc;
#using scripts\core_common\struct.gsc;
#namespace namespace_df88241c;
/*
Name: __init__system__
Namespace: namespace_df88241c
Checksum: 0xC140230F
Offset: 0x170
Size: 0x3C
Parameters: 0
Flags: AutoExec
*/
function autoexec __init__system__()
{
system::register(#"hash_18c69cd2b0bf61b9", &__init__, undefined, undefined);
}
/*
Name: __init__
Namespace: namespace_df88241c
Checksum: 0x192D3BC1
Offset: 0x1B8
Size: 0x104
Parameters: 0
Flags: Linked
*/
function __init__()
{
level.var_f4f794bf = array(5, 7, 9, 12);
level.nova_crawler_spawner = getent("nova_crawler_spawner", "script_noteworthy");
spawner::add_archetype_spawn_function(#"nova_crawler", &nova_crawler_init);
zm_round_spawning::register_archetype(#"nova_crawler", &function_c73902fd, &crawler_round_spawn, &spawn_nova_crawler, 10);
zm_score::function_e5d6e6dd(#"nova_crawler", 60);
}
/*
Name: nova_crawler_init
Namespace: namespace_df88241c
Checksum: 0x14495D82
Offset: 0x2C8
Size: 0x1C
Parameters: 0
Flags: Linked
*/
function nova_crawler_init()
{
level thread zm_spawner::zombie_death_event(self);
}
/*
Name: function_c73902fd
Namespace: namespace_df88241c
Checksum: 0x69B99B21
Offset: 0x2F0
Size: 0x6A
Parameters: 1
Flags: Linked
*/
function function_c73902fd(var_dbce0c44)
{
if(isdefined(level.var_5e45f817) && level.var_5e45f817)
{
return 0;
}
var_8cf00d40 = int(floor(var_dbce0c44 / 10));
return var_8cf00d40;
}
/*
Name: crawler_round_spawn
Namespace: namespace_df88241c
Checksum: 0x9C070C82
Offset: 0x368
Size: 0x3C
Parameters: 0
Flags: Linked
*/
function crawler_round_spawn()
{
ai = spawn_nova_crawler();
if(isdefined(ai))
{
level.zombie_total--;
return true;
}
return false;
}
/*
Name: spawn_nova_crawler
Namespace: namespace_df88241c
Checksum: 0x90061B17
Offset: 0x3B0
Size: 0x18E
Parameters: 1
Flags: Linked
*/
function spawn_nova_crawler(override_spawn_location = undefined)
{
var_d8d8ce1b = undefined;
if(function_4748fb49() < function_59257d57() && (!(isdefined(level.var_5e45f817) && level.var_5e45f817)) && (isdefined(level.zm_loc_types[#"hash_506aba309cfe3f56"]) && level.zm_loc_types[#"hash_506aba309cfe3f56"].size > 0))
{
var_d8d8ce1b = zombie_utility::spawn_zombie(level.nova_crawler_spawner);
if(isdefined(var_d8d8ce1b))
{
var_d8d8ce1b.check_point_in_enabled_zone = &zm_utility::check_point_in_playable_area;
var_d8d8ce1b thread zombie_utility::round_spawn_failsafe();
if(isdefined(override_spawn_location))
{
var_d8d8ce1b function_e2bab5ec(override_spawn_location);
override_spawn_location.var_d51f4e2d = gettime();
}
else
{
spawn_location = var_d8d8ce1b function_9216fd1f();
if(isdefined(spawn_location))
{
var_d8d8ce1b function_e2bab5ec(spawn_location);
spawn_location.var_d51f4e2d = gettime();
}
}
}
}
return var_d8d8ce1b;
}
/*
Name: function_59257d57
Namespace: namespace_df88241c
Checksum: 0x792D0323
Offset: 0x548
Size: 0xAC
Parameters: 0
Flags: Linked
*/
function function_59257d57()
{
if(level flag::exists("nova_crawlers_round") && level flag::get("nova_crawlers_round"))
{
return level.zombie_ai_limit;
}
if(zm_utility::is_trials())
{
return (level.var_f4f794bf[level.players.size - 1]) * 2;
}
return level.var_f4f794bf[level.players.size - 1];
}
/*
Name: function_4748fb49
Namespace: namespace_df88241c
Checksum: 0xA1DFFF98
Offset: 0x600
Size: 0xBC
Parameters: 0
Flags: Linked
*/
function function_4748fb49()
{
a_ai_crawler = getaiarchetypearray(#"nova_crawler");
var_cc9e7e12 = a_ai_crawler.size;
foreach(ai_crawler in a_ai_crawler)
{
if(!isalive(ai_crawler))
{
var_cc9e7e12--;
}
}
return var_cc9e7e12;
}
/*
Name: setup_crawler_round
Namespace: namespace_df88241c
Checksum: 0xDE49FF09
Offset: 0x6C8
Size: 0x6C
Parameters: 1
Flags: None
*/
function setup_crawler_round(n_round)
{
zm_round_spawning::function_b4a8f95a(#"nova_crawler", n_round, &crawler_round_start, &water_drop_triggerreactidgunterminate, &function_f6e748b, &function_f726e44, 0);
}
/*
Name: crawler_round_start
Namespace: namespace_df88241c
Checksum: 0x6D16F449
Offset: 0x740
Size: 0x44
Parameters: 0
Flags: Linked
*/
function crawler_round_start()
{
level flag::set(#"hash_2a1fc2e349c48462");
level flag::set("crawler_round");
}
/*
Name: water_drop_triggerreactidgunterminate
Namespace: namespace_df88241c
Checksum: 0xD0A3A13B
Offset: 0x790
Size: 0x4C
Parameters: 1
Flags: Linked
*/
function water_drop_triggerreactidgunterminate(var_d25bbdd5)
{
level flag::clear(#"hash_2a1fc2e349c48462");
level flag::clear("crawler_round");
}
/*
Name: function_f6e748b
Namespace: namespace_df88241c
Checksum: 0xCE3EDB28
Offset: 0x7E8
Size: 0x2C
Parameters: 0
Flags: Linked
*/
function function_f6e748b()
{
return 40 * (isdefined(level.var_71bc2e8f) ? level.var_71bc2e8f : 1);
}
/*
Name: function_f726e44
Namespace: namespace_df88241c
Checksum: 0x622B9503
Offset: 0x820
Size: 0x34
Parameters: 2
Flags: Linked
*/
function function_f726e44(count, max)
{
wait(randomfloatrange(0.25, 0.5));
}
/*
Name: function_a5abd591
Namespace: namespace_df88241c
Checksum: 0x1C77ACD8
Offset: 0x860
Size: 0xBA
Parameters: 0
Flags: Linked
*/
function function_a5abd591()
{
var_5935bd0e = array::randomize(level.activeplayers);
e_target = undefined;
foreach(e_player in var_5935bd0e)
{
if(zm_utility::is_player_valid(e_player))
{
e_target = e_player;
break;
}
}
return e_target;
}
/*
Name: function_9a898f07
Namespace: namespace_df88241c
Checksum: 0xFC0C4E29
Offset: 0x928
Size: 0x2CA
Parameters: 1
Flags: Linked, Private
*/
function private function_9a898f07(e_target)
{
if(isdefined(level.zm_loc_types[#"hash_506aba309cfe3f56"]) && level.zm_loc_types[#"hash_506aba309cfe3f56"].size > 0)
{
var_a6c95035 = [];
var_5f3b05e8 = e_target zm_zonemgr::get_player_zone();
if(!isdefined(var_5f3b05e8))
{
return undefined;
}
target_zone = level.zones[var_5f3b05e8];
var_24f5d9f8 = array(target_zone.name);
a_str_adj_zones = getarraykeys(target_zone.adjacent_zones);
foreach(str_zone in a_str_adj_zones)
{
if(target_zone.adjacent_zones[str_zone].is_connected)
{
if(!isdefined(var_24f5d9f8))
{
var_24f5d9f8 = [];
}
else if(!isarray(var_24f5d9f8))
{
var_24f5d9f8 = array(var_24f5d9f8);
}
var_24f5d9f8[var_24f5d9f8.size] = str_zone;
}
}
foreach(loc in level.zm_loc_types[#"hash_506aba309cfe3f56"])
{
if(array::contains(var_24f5d9f8, loc.zone_name))
{
if(!isdefined(var_a6c95035))
{
var_a6c95035 = [];
}
else if(!isarray(var_a6c95035))
{
var_a6c95035 = array(var_a6c95035);
}
var_a6c95035[var_a6c95035.size] = loc;
}
}
s_spawn_loc = array::random(var_a6c95035);
}
return s_spawn_loc;
}
/*
Name: function_87348a88
Namespace: namespace_df88241c
Checksum: 0xBDD88F8A
Offset: 0xC00
Size: 0x42
Parameters: 1
Flags: None
*/
function function_87348a88(e_target)
{
override_spawn_location = function_9a898f07(e_target);
return spawn_nova_crawler(override_spawn_location);
}
/*
Name: function_9216fd1f
Namespace: namespace_df88241c
Checksum: 0x91B9470B
Offset: 0xC50
Size: 0xE2
Parameters: 0
Flags: Linked, Private
*/
function private function_9216fd1f()
{
spawn_locations = [];
spawn_location = undefined;
if(isdefined(level.zm_loc_types[#"hash_506aba309cfe3f56"]))
{
spawn_locations = level.zm_loc_types[#"hash_506aba309cfe3f56"];
}
if(spawn_locations.size > 0)
{
if(!isdefined(spawn_location))
{
spawn_info = zm_spawner::function_dce9f1a6(spawn_locations);
spawn_location = spawn_info.spot;
}
if(!isdefined(spawn_location))
{
spawn_location = zm_spawner::function_65439499(spawn_locations);
}
if(!isdefined(spawn_location))
{
spawn_location = array::random(spawn_locations);
}
}
return spawn_location;
}
/*
Name: function_e2bab5ec
Namespace: namespace_df88241c
Checksum: 0x634E9FD9
Offset: 0xD40
Size: 0x2F6
Parameters: 1
Flags: Linked, Private
*/
function private function_e2bab5ec(spot)
{
if(isdefined(self.anchor))
{
return;
}
if(isdefined(spot.script_int) && spot.script_int == 1)
{
self.custom_riseanim = "ai_t8_zm_quad_traverse_ground_crawlfast";
self thread zm_spawner::do_zombie_rise(spot);
self thread rise_anim_watcher();
}
else
{
self.anchor = spawn("script_origin", self.origin);
self.anchor.angles = self.angles;
self linkto(self.anchor);
self.anchor thread zm_utility::anchor_delete_failsafe(self);
if(!isdefined(spot.angles))
{
spot.angles = (0, 0, 0);
}
self ghost();
self.anchor moveto(spot.origin, 0.05);
self.anchor waittill(#"movedone");
target_org = zombie_utility::get_desired_origin();
if(isdefined(target_org))
{
anim_ang = vectortoangles(target_org - self.origin);
self.anchor rotateto((0, anim_ang[1], 0), 0.05);
self.anchor waittill(#"rotatedone");
}
if(isdefined(level.zombie_spawn_fx))
{
playfx(level.zombie_spawn_fx, spot.origin);
}
self unlink();
if(isdefined(self.anchor))
{
self.anchor delete();
}
if(!(isdefined(self.dontshow) && self.dontshow))
{
self show();
}
self notify(#"spawn_complete");
self notify(#"risen", {#find_flesh_struct_string:spot.script_string});
}
}
/*
Name: rise_anim_watcher
Namespace: namespace_df88241c
Checksum: 0x699620B3
Offset: 0x1040
Size: 0x3E
Parameters: 0
Flags: Linked
*/
function rise_anim_watcher()
{
self endon(#"death");
self waittill(#"rise_anim_finished");
self notify(#"spawn_complete");
}
/*
Name: function_c44636f2
Namespace: namespace_df88241c
Checksum: 0xFD0C9171
Offset: 0x1088
Size: 0xB8
Parameters: 1
Flags: None
*/
function function_c44636f2(b_ignore_cleanup = 1)
{
if(!zm_custom::function_901b751c(#"hash_4deb3ae7a73c87f3") || (isdefined(level.var_5e45f817) && level.var_5e45f817))
{
return;
}
level.var_1ba6a97c = 1;
level.var_8167b1e = b_ignore_cleanup;
/#
assert(isdefined(level.var_807ffa2e));
#/
level thread [[level.var_807ffa2e]]();
}
/*
Name: function_5b0522fa
Namespace: namespace_df88241c
Checksum: 0xFAB593EC
Offset: 0x1148
Size: 0xBC
Parameters: 0
Flags: None
*/
function function_5b0522fa()
{
level.var_f5419c22 = 20;
zm_round_spawning::function_b4a8f95a(#"nova_crawler", level.var_f5419c22, &function_9e97e0f7, &function_de265920, &function_70a8e26c, &function_d7e9e2ff, level.var_8167b1e);
zm_utility::function_fdb0368(11);
level flagsys::set(#"hash_2a1fc2e349c48462");
}
/*
Name: function_9e97e0f7
Namespace: namespace_df88241c
Checksum: 0x257FC13E
Offset: 0x1210
Size: 0x24
Parameters: 0
Flags: Linked
*/
function function_9e97e0f7()
{
level flag::set(#"hash_2a1fc2e349c48462");
}
/*
Name: function_de265920
Namespace: namespace_df88241c
Checksum: 0x25289A31
Offset: 0x1240
Size: 0x32
Parameters: 1
Flags: Linked
*/
function function_de265920(var_d25bbdd5)
{
level flag::clear(#"hash_2a1fc2e349c48462");
wait(5);
}
/*
Name: function_70a8e26c
Namespace: namespace_df88241c
Checksum: 0xE93EA84C
Offset: 0x1280
Size: 0x62
Parameters: 0
Flags: Linked
*/
function function_70a8e26c()
{
a_e_players = getplayers();
n_max = zm_round_logic::get_zombie_count_for_round(level.var_f5419c22, a_e_players.size);
return int(n_max * 0.6);
}
/*
Name: function_d7e9e2ff
Namespace: namespace_df88241c
Checksum: 0x6B94D3C7
Offset: 0x12F0
Size: 0xC
Parameters: 0
Flags: Linked
*/
function function_d7e9e2ff()
{
wait(0.1);
}