-
Notifications
You must be signed in to change notification settings - Fork 9
/
script_203cf11e5ee588f5.gsc
649 lines (623 loc) · 14.5 KB
/
script_203cf11e5ee588f5.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
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
// 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\zm_towers_util.gsc;
#using scripts\zm_common\zm_ui_inventory.gsc;
#using scripts\zm_common\zm_items.gsc;
#using scripts\zm_common\zm_utility.gsc;
#using scripts\zm_common\zm_unitrigger.gsc;
#using scripts\zm_common\zm_traps.gsc;
#using scripts\zm_common\zm_stats.gsc;
#using scripts\zm_common\zm_score.gsc;
#using scripts\zm_common\zm_round_logic.gsc;
#using scripts\zm_common\zm_lockdown_util.gsc;
#using scripts\zm_common\zm_crafting.gsc;
#using scripts\zm_common\zm_contracts.gsc;
#using scripts\zm_common\zm_audio.gsc;
#using scripts\core_common\ai\zombie_utility.gsc;
#using scripts\core_common\ai\zombie_death.gsc;
#using scripts\core_common\visionset_mgr_shared.gsc;
#using scripts\core_common\values_shared.gsc;
#using scripts\core_common\util_shared.gsc;
#using scripts\core_common\trigger_shared.gsc;
#using scripts\core_common\system_shared.gsc;
#using scripts\core_common\struct.gsc;
#using scripts\core_common\status_effects\status_effect_util.gsc;
#using scripts\core_common\scene_shared.gsc;
#using scripts\core_common\lui_shared.gsc;
#using scripts\core_common\laststand_shared.gsc;
#using scripts\core_common\flag_shared.gsc;
#using scripts\core_common\clientfield_shared.gsc;
#using scripts\core_common\callbacks_shared.gsc;
#using scripts\core_common\array_shared.gsc;
#namespace zm_traps_hellpools;
/*
Name: __init__system__
Namespace: zm_traps_hellpools
Checksum: 0x847931CA
Offset: 0x3D8
Size: 0x44
Parameters: 0
Flags: AutoExec
*/
function autoexec __init__system__()
{
system::register(#"zm_traps_hellpools", &__init__, &__main__, undefined);
}
/*
Name: __init__
Namespace: zm_traps_hellpools
Checksum: 0x473F962E
Offset: 0x428
Size: 0x3C
Parameters: 0
Flags: Linked
*/
function __init__()
{
level thread function_7cc8a854();
callback::on_finalize_initialization(&init);
}
/*
Name: __main__
Namespace: zm_traps_hellpools
Checksum: 0x80F724D1
Offset: 0x470
Size: 0x4
Parameters: 0
Flags: Linked
*/
function __main__()
{
}
/*
Name: init
Namespace: zm_traps_hellpools
Checksum: 0x54E79BE4
Offset: 0x480
Size: 0x54
Parameters: 0
Flags: Linked
*/
function init()
{
level flag::wait_till("all_players_spawned");
zm_crafting::function_d1f16587(#"zblueprint_trap_hellpools", &function_55d14d78);
}
/*
Name: function_7cc8a854
Namespace: zm_traps_hellpools
Checksum: 0xF427FA9C
Offset: 0x4E0
Size: 0x3D4
Parameters: 0
Flags: Linked
*/
function function_7cc8a854()
{
level.a_e_hellpools = getentarray("mdl_hellpool_lava_grate", "targetname");
foreach(e_hellpool in level.a_e_hellpools)
{
e_hellpool flag::init("activated");
e_hellpool notsolid();
}
level.a_s_hellpool_cauldron = struct::get_array("s_hellpool_cauldron", "targetname");
level.var_c07e6d20 = getentarray("zm_towers_hellpool_ghost", "script_label");
foreach(part in level.var_c07e6d20)
{
if(part trigger::is_trigger_of_type("trigger_use_new"))
{
part triggerenable(0);
continue;
}
part hide();
}
mdl_clip = getent("mdl_acid_trap_cauldron_piece_clip", "targetname");
mdl_clip notsolid();
var_d58ee8b5 = getweapon(#"hash_72cba96681a7af18");
zm_items::function_4d230236(var_d58ee8b5, &function_b54b9d5e);
a_zombie_traps = getentarray("zombie_trap", "targetname");
level.var_482bcfef = array::filter(a_zombie_traps, 0, &function_9cc4d7b9);
foreach(var_299f1fa2 in level.var_482bcfef)
{
var_299f1fa2 function_586dd237();
}
zm_traps::register_trap_basic_info("hellpool", &function_1d86d117, &function_722def57);
zm_traps::register_trap_damage("hellpool", &function_506285c3, &function_db9410fa);
level thread function_b589dae1();
level thread function_a3661fef();
}
/*
Name: function_b589dae1
Namespace: zm_traps_hellpools
Checksum: 0xF4BA534A
Offset: 0x8C0
Size: 0xE0
Parameters: 0
Flags: Linked
*/
function function_b589dae1()
{
level endon(#"end_game");
level notify(#"hash_4cb0ebfa7040a193");
level endon(#"hash_4cb0ebfa7040a193");
while(true)
{
level waittill(#"host_migration_end");
foreach(e_hellpool in level.a_e_hellpools)
{
e_hellpool notify(#"hash_5aa6001392300725");
}
}
}
/*
Name: function_a3661fef
Namespace: zm_traps_hellpools
Checksum: 0xDBBB001F
Offset: 0x9A8
Size: 0x122
Parameters: 0
Flags: Linked, Private
*/
function private function_a3661fef()
{
level waittill(#"start_zombie_round_logic");
s_blueprint = zm_crafting::function_b18074d0(#"zblueprint_trap_hellpools");
while(true)
{
level waittill(#"component_collected");
foreach(e_player in getplayers())
{
if(zm_crafting::function_6d1e4410(e_player, s_blueprint))
{
level scene::function_27f5972e(#"p8_fxanim_zm_towers_trap_acid_bundle");
level notify(#"hash_476cae376318f3d5");
return;
}
}
}
}
/*
Name: function_55d14d78
Namespace: zm_traps_hellpools
Checksum: 0xA83918EC
Offset: 0xAD8
Size: 0x89C
Parameters: 0
Flags: Linked
*/
function function_55d14d78()
{
var_f6e18b6c = self.script_noteworthy;
switch(var_f6e18b6c)
{
case "odin":
{
level.var_15783f81 = struct::get("zm_towers_hellpool_odin_scene", "script_noteworthy");
level.var_15783f81 scene::init();
var_c65eed8e = getentarray("zm_towers_hellpool_odin", "script_noteworthy");
foreach(part in var_c65eed8e)
{
if(part trigger::is_trigger_of_type("trigger_use_new"))
{
part triggerenable(1);
part.script_string = "its_a_trap";
zm_lockdown_util::function_d67bafb5(part, "lockdown_stub_type_crafting_tables");
continue;
}
part show();
}
foreach(s_trap_button in level.a_s_trap_buttons)
{
if(s_trap_button.script_int === 3)
{
s_trap_button.scene_ents[#"prop 1"] clientfield::set("trap_switch_green", 1);
}
}
break;
}
case "zeus":
{
level.var_15783f81 = struct::get("zm_towers_hellpool_zeus_scene", "script_noteworthy");
level.var_15783f81 scene::init();
var_c65eed8e = getentarray("zm_towers_hellpool_zeus", "script_noteworthy");
foreach(part in var_c65eed8e)
{
if(part trigger::is_trigger_of_type("trigger_use_new"))
{
part triggerenable(1);
part.script_string = "its_a_trap";
zm_lockdown_util::function_d67bafb5(part, "lockdown_stub_type_crafting_tables");
continue;
}
part show();
}
foreach(s_trap_button in level.a_s_trap_buttons)
{
if(s_trap_button.script_int === 4)
{
s_trap_button.scene_ents[#"prop 1"] clientfield::set("trap_switch_green", 1);
}
}
break;
}
case "danu":
{
level.var_15783f81 = struct::get("zm_towers_hellpool_danu_scene", "script_noteworthy");
level.var_15783f81 scene::init();
var_c65eed8e = getentarray("zm_towers_hellpool_danu", "script_noteworthy");
foreach(part in var_c65eed8e)
{
if(part trigger::is_trigger_of_type("trigger_use_new"))
{
part triggerenable(1);
part.script_string = "its_a_trap";
zm_lockdown_util::function_d67bafb5(part, "lockdown_stub_type_crafting_tables");
continue;
}
part show();
}
foreach(s_trap_button in level.a_s_trap_buttons)
{
if(s_trap_button.script_int === 1)
{
s_trap_button.scene_ents[#"prop 1"] clientfield::set("trap_switch_green", 1);
}
}
break;
}
case "ra":
{
level.var_15783f81 = struct::get("zm_towers_hellpool_ra_scene", "script_noteworthy");
level.var_15783f81 scene::init();
var_c65eed8e = getentarray("zm_towers_hellpool_ra", "script_noteworthy");
foreach(part in var_c65eed8e)
{
if(part trigger::is_trigger_of_type("trigger_use_new"))
{
part triggerenable(1);
part.script_string = "its_a_trap";
zm_lockdown_util::function_d67bafb5(part, "lockdown_stub_type_crafting_tables");
continue;
}
part show();
}
foreach(s_trap_button in level.a_s_trap_buttons)
{
if(s_trap_button.script_int === 2)
{
s_trap_button.scene_ents[#"prop 1"] clientfield::set("trap_switch_green", 1);
}
}
break;
}
}
level thread zm_crafting::function_ca244624("zblueprint_trap_hellpools");
level scene::function_f81475ae(#"p8_fxanim_zm_towers_trap_acid_bundle");
}
/*
Name: function_b54b9d5e
Namespace: zm_traps_hellpools
Checksum: 0xE5998B1
Offset: 0x1380
Size: 0x5C
Parameters: 2
Flags: Linked
*/
function function_b54b9d5e(e_holder, w_item)
{
mdl_clip = getent("mdl_acid_trap_cauldron_piece_clip", "targetname");
if(isdefined(mdl_clip))
{
mdl_clip delete();
}
}
/*
Name: function_9cc4d7b9
Namespace: zm_traps_hellpools
Checksum: 0x7640E9F0
Offset: 0x13E8
Size: 0x20
Parameters: 1
Flags: Linked
*/
function function_9cc4d7b9(e_ent)
{
return e_ent.script_noteworthy == "hellpool";
}
/*
Name: function_586dd237
Namespace: zm_traps_hellpools
Checksum: 0xF93EACB3
Offset: 0x1410
Size: 0x24
Parameters: 0
Flags: Linked
*/
function function_586dd237()
{
self flag::init("activated");
}
/*
Name: function_722def57
Namespace: zm_traps_hellpools
Checksum: 0x80F724D1
Offset: 0x1440
Size: 0x4
Parameters: 0
Flags: Linked
*/
function function_722def57()
{
}
/*
Name: function_1d86d117
Namespace: zm_traps_hellpools
Checksum: 0xA60EFB1A
Offset: 0x1450
Size: 0x1D4
Parameters: 0
Flags: Linked
*/
function function_1d86d117()
{
self._trap_duration = 15;
self._trap_cooldown_time = 60;
if(isdefined(level.sndtrapfunc))
{
level thread [[level.sndtrapfunc]](self, 1);
}
self notify(#"trap_activate");
level notify(#"trap_activate", self);
wait(1);
self.activated_by_player thread function_45a2294f(self.script_string);
foreach(e_trap in level.var_482bcfef)
{
if(e_trap.script_string === self.script_string)
{
e_trap thread zm_traps::trap_damage();
}
}
self waittilltimeout(self._trap_duration, #"trap_deactivate");
foreach(e_trap in level.var_482bcfef)
{
if(e_trap.script_string === self.script_string)
{
e_trap notify(#"trap_done");
}
}
}
/*
Name: function_45a2294f
Namespace: zm_traps_hellpools
Checksum: 0x4AC2BE9B
Offset: 0x1630
Size: 0x160
Parameters: 1
Flags: Linked
*/
function function_45a2294f(str_id)
{
if(!isdefined(self))
{
return;
}
self.b_activated = 1;
foreach(e_hellpool in level.a_e_hellpools)
{
if(e_hellpool.script_string === str_id)
{
e_hellpool thread activate_trap(self);
}
}
level notify(#"traps_activated", {#hash_be3f58a:str_id});
wait(15);
level notify(#"traps_cooldown", {#hash_be3f58a:str_id});
n_cooldown = zm_traps::function_da13db45(60, self);
wait(n_cooldown);
level notify(#"traps_available", {#hash_be3f58a:str_id});
}
/*
Name: activate_trap
Namespace: zm_traps_hellpools
Checksum: 0x3F2144E1
Offset: 0x1798
Size: 0xA4
Parameters: 1
Flags: Linked
*/
function activate_trap(e_player)
{
if(!self flag::get("activated"))
{
if(isdefined(e_player))
{
self.activated_by_player = e_player;
}
self flag::set("activated");
self thread function_692db12();
self waittilltimeout(15, #"hash_5aa6001392300725");
self deactivate_trap();
}
}
/*
Name: deactivate_trap
Namespace: zm_traps_hellpools
Checksum: 0x629E34A7
Offset: 0x1848
Size: 0x6E
Parameters: 0
Flags: Linked
*/
function deactivate_trap()
{
if(self flag::get("activated"))
{
self function_efd16da2();
self flag::clear("activated");
self notify(#"deactivate");
}
}
/*
Name: function_692db12
Namespace: zm_traps_hellpools
Checksum: 0xC773F327
Offset: 0x18C0
Size: 0x98
Parameters: 0
Flags: Linked
*/
function function_692db12()
{
foreach(s_cauldron in level.a_s_hellpool_cauldron)
{
if(s_cauldron.script_string === self.script_string)
{
self thread function_b327ce68(s_cauldron);
}
}
}
/*
Name: function_efd16da2
Namespace: zm_traps_hellpools
Checksum: 0x2A215385
Offset: 0x1960
Size: 0x98
Parameters: 0
Flags: Linked
*/
function function_efd16da2()
{
foreach(s_cauldron in level.a_s_hellpool_cauldron)
{
if(s_cauldron.script_string === self.script_string)
{
self thread function_2e78a71b(s_cauldron);
}
}
}
/*
Name: function_b327ce68
Namespace: zm_traps_hellpools
Checksum: 0xBBFED10A
Offset: 0x1A00
Size: 0x5C
Parameters: 1
Flags: Linked
*/
function function_b327ce68(s_cauldron)
{
s_cauldron thread scene::play("shot 1");
level waittill(#"hash_189e686c493a2a23");
s_cauldron thread function_4c1fe94b();
}
/*
Name: function_2e78a71b
Namespace: zm_traps_hellpools
Checksum: 0x8413EA19
Offset: 0x1A68
Size: 0x2C
Parameters: 1
Flags: Linked
*/
function function_2e78a71b(s_cauldron)
{
s_cauldron thread scene::play("shot 3");
}
/*
Name: function_4c1fe94b
Namespace: zm_traps_hellpools
Checksum: 0x328D9FD2
Offset: 0x1AA0
Size: 0x24
Parameters: 0
Flags: Linked
*/
function function_4c1fe94b()
{
self thread scene::play("shot 2");
}
/*
Name: function_db9410fa
Namespace: zm_traps_hellpools
Checksum: 0xFA011FB9
Offset: 0x1AD0
Size: 0x1AC
Parameters: 1
Flags: Linked
*/
function function_db9410fa(e_trap)
{
if(isactor(self) && (!(isdefined(self.marked_for_death) && self.marked_for_death)))
{
self.marked_for_death = 1;
if(isplayer(e_trap.activated_by_player))
{
e_trap.activated_by_player zm_stats::increment_challenge_stat(#"zombie_hunter_kill_trap");
e_trap.activated_by_player contracts::increment_zm_contract(#"hash_1f11b620a6de486b");
}
if(self.var_6f84b820 == #"miniboss" || self.var_6f84b820 == #"heavy")
{
self.marked_for_death = 0;
return;
}
self clientfield::set("acid_trap_death_fx", 1);
wait(0.75);
if(isalive(self))
{
level notify(#"trap_kill", {#e_trap:e_trap, #e_victim:self});
self dodamage(self.health + 666, self.origin, e_trap);
}
}
}
/*
Name: function_506285c3
Namespace: zm_traps_hellpools
Checksum: 0x9CB7DAA1
Offset: 0x1C88
Size: 0x1FC
Parameters: 1
Flags: Linked
*/
function function_506285c3(t_damage)
{
self endoncallback(&function_6f5e73b5, #"death", #"disconnect");
if(isalive(self) && (!(isdefined(self.var_62b59590) && self.var_62b59590)))
{
self.var_62b59590 = 1;
if(isplayer(self))
{
if(!self laststand::player_is_in_laststand() && !level flag::get("round_reset"))
{
params = getstatuseffect(#"hash_baee445ed1d9b99");
if(zm_utility::is_standard())
{
params.dotdamage = int(params.dotdamage / 4);
}
if(zm_utility::is_ee_enabled() && self flag::get(#"hash_6757075afacfc1b4"))
{
params.dotdamage = int(params.dotdamage * 0.1);
}
self status_effect::status_effect_apply(params);
self clientfield::set_to_player("acid_trap_postfx", 1);
}
self function_6f5e73b5();
}
}
}
/*
Name: function_6f5e73b5
Namespace: zm_traps_hellpools
Checksum: 0x5AF47502
Offset: 0x1E90
Size: 0x44
Parameters: 1
Flags: Linked
*/
function function_6f5e73b5(var_c34665fc)
{
wait(1);
if(isdefined(self))
{
self.var_62b59590 = 0;
self clientfield::set_to_player("acid_trap_postfx", 0);
}
}