-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathscript_127cabc795c374b9.gsc
283 lines (271 loc) · 6.39 KB
/
script_127cabc795c374b9.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
// 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\core_common\util_shared.gsc;
#using scripts\core_common\clientfield_shared.gsc;
#using scripts\core_common\gamestate.gsc;
#using scripts\wz_common\wz_ai_utils.gsc;
#using scripts\core_common\math_shared.gsc;
#using scripts\core_common\struct.gsc;
#using script_cb32d07c95e5628;
#using scripts\core_common\player\player_stats.gsc;
#using scripts\core_common\callbacks_shared.gsc;
#using scripts\core_common\system_shared.gsc;
#namespace namespace_87f097c4;
/*
Name: __init__system__
Namespace: namespace_87f097c4
Checksum: 0xD8528663
Offset: 0x130
Size: 0x3C
Parameters: 0
Flags: AutoExec
*/
function autoexec __init__system__()
{
system::register(#"hash_7551e984c9a42af9", &__init__, undefined, undefined);
}
/*
Name: __init__
Namespace: namespace_87f097c4
Checksum: 0x9294CB1A
Offset: 0x178
Size: 0x1DC
Parameters: 0
Flags: Linked
*/
function __init__()
{
level.var_6e0c26c7 = (isdefined(getgametypesetting(#"hash_30b11d064f146fcc")) ? getgametypesetting(#"hash_30b11d064f146fcc") : 0) || (isdefined(getgametypesetting(#"hash_697d65a68cc6c6f1")) ? getgametypesetting(#"hash_697d65a68cc6c6f1") : 0);
if(level.var_6e0c26c7)
{
clientfield::register("world", "zombie_arm_blood_splash", 20000, 1, "counter");
clientfield::register("world", "bathtub_fake_soul_sfx", 20000, 1, "counter");
level.var_e91bcfae = 0;
zombie_arm = getent("zombie_arm", "targetname");
if(isdefined(zombie_arm))
{
zombie_arm ghost();
}
level.var_afdd2ed7 = 0;
callback::on_ai_killed(&on_ai_killed);
callback::on_item_pickup(&on_player_item_pickup);
}
/#
function_4ed420e3();
#/
}
/*
Name: on_ai_killed
Namespace: namespace_87f097c4
Checksum: 0x13827EE7
Offset: 0x360
Size: 0x176
Parameters: 1
Flags: Linked
*/
function on_ai_killed(params)
{
if(isdefined(level.var_e91bcfae) && level.var_e91bcfae)
{
return;
}
if(isplayer(params.eattacker))
{
attacker = params.eattacker;
bathtub = struct::get(#"zombie_bathub", "targetname");
if(isdefined(bathtub))
{
distance = distance(bathtub.origin, attacker.origin);
if(distance < 256)
{
level.var_afdd2ed7++;
level clientfield::increment("bathtub_fake_soul_sfx", 1);
}
if(level.var_afdd2ed7 >= 3)
{
level thread function_613448ed(attacker, bathtub);
callback::remove_callback(#"on_ai_killed", &on_ai_killed);
level.var_afdd2ed7 = undefined;
}
}
}
}
/*
Name: on_player_item_pickup
Namespace: namespace_87f097c4
Checksum: 0x5AF52F1E
Offset: 0x4E0
Size: 0x184
Parameters: 1
Flags: Linked
*/
function on_player_item_pickup(params)
{
if(!isdefined(params.item))
{
return;
}
item = params.item;
if(isplayer(self))
{
if(isdefined(item.var_cd8fb96) && item.var_cd8fb96)
{
zombie_arm = getent("zombie_arm", "targetname");
if(isdefined(zombie_arm))
{
var_4805bfaa = (zombie_arm.origin[0], zombie_arm.origin[1], zombie_arm.origin[2] + -24);
zombie_arm playsound(#"hash_134bc3c2ce6ed759");
level thread function_ca44f5a5(zombie_arm, var_4805bfaa, 1);
level clientfield::increment("zombie_arm_blood_splash", 1);
callback::remove_callback(#"on_item_pickup", &on_player_item_pickup);
}
}
}
}
/*
Name: function_613448ed
Namespace: namespace_87f097c4
Checksum: 0x7A03AB61
Offset: 0x670
Size: 0x264
Parameters: 2
Flags: Linked
*/
function function_613448ed(player, bathtub)
{
self notify("1db1954ce3ca6f10");
self endon("1db1954ce3ca6f10");
if(isdefined(level.var_e91bcfae) && level.var_e91bcfae)
{
return;
}
var_47943768 = function_1deb2b38(bathtub);
zombie_arm = getent("zombie_arm", "targetname");
if(isdefined(zombie_arm) && isdefined(var_47943768))
{
var_47943768.var_cd8fb96 = 1;
var_4805bfaa = (zombie_arm.origin[0], zombie_arm.origin[1], zombie_arm.origin[2] + 24);
var_47943768.origin = (zombie_arm.origin[0] + 2, zombie_arm.origin[1] + 1.5, zombie_arm.origin[2] + 15);
var_47943768.angles = (0, -50, -90);
var_45f173ec = (var_47943768.origin[0], var_47943768.origin[1], var_47943768.origin[2] + 24);
zombie_arm show();
zombie_arm playsound(#"hash_2b9e3e8f3a11bcdb");
level clientfield::increment("zombie_arm_blood_splash", 1);
level thread function_ca44f5a5(zombie_arm, var_4805bfaa);
level thread function_b413daad(var_47943768, var_45f173ec);
}
}
/*
Name: function_ca44f5a5
Namespace: namespace_87f097c4
Checksum: 0x1F80A52B
Offset: 0x8E0
Size: 0xB4
Parameters: 3
Flags: Linked
*/
function function_ca44f5a5(zombie_arm, target_pos, var_e77e9de = 0)
{
if(!isdefined(zombie_arm) || !isdefined(target_pos))
{
return;
}
zombie_arm endon(#"death");
zombie_arm moveto(target_pos, 2);
if(var_e77e9de)
{
zombie_arm waittill(#"movedone");
zombie_arm ghost();
}
}
/*
Name: function_b413daad
Namespace: namespace_87f097c4
Checksum: 0xDBCCEBDD
Offset: 0x9A0
Size: 0x34
Parameters: 2
Flags: Linked
*/
function function_b413daad(var_47943768, target_pos)
{
var_47943768 moveto(target_pos, 2);
}
/*
Name: function_1deb2b38
Namespace: namespace_87f097c4
Checksum: 0xC1E0DA75
Offset: 0x9E0
Size: 0xEA
Parameters: 1
Flags: Linked
*/
function function_1deb2b38(var_b721e8a9)
{
if(!isdefined(var_b721e8a9) || (isdefined(level.var_e91bcfae) && level.var_e91bcfae))
{
return;
}
level.var_e91bcfae = 1;
if(isdefined(var_b721e8a9))
{
a_items = var_b721e8a9 namespace_65181344::function_fd87c780(#"zombie_bathtub_ee_list", 1);
foreach(item in a_items)
{
if(isdefined(item))
{
return item;
}
}
}
}
/*
Name: function_4ed420e3
Namespace: namespace_87f097c4
Checksum: 0x3BDC5C43
Offset: 0xAD8
Size: 0x84
Parameters: 0
Flags: None
*/
function function_4ed420e3()
{
/#
while(!canadddebugcommand())
{
waitframe(1);
}
mapname = util::get_map_name();
adddebugcommand(("" + mapname) + "");
level thread function_7eabf705();
#/
}
/*
Name: function_7eabf705
Namespace: namespace_87f097c4
Checksum: 0x7EB489F3
Offset: 0xB68
Size: 0x10E
Parameters: 0
Flags: None
*/
function function_7eabf705()
{
/#
self notify("");
self endon("");
level endon(#"game_ended");
level endon(#"hash_671b150516dd9870");
while(true)
{
if(getdvarint(#"hash_7e7b9e2edcf6d1ee", 0))
{
players = getplayers();
bathtub = struct::get(#"zombie_bathub", "");
function_613448ed(players[0], bathtub);
level notify(#"hash_671b150516dd9870");
break;
}
waitframe(1);
}
#/
}