-
Notifications
You must be signed in to change notification settings - Fork 3
/
subarch.tsct
575 lines (550 loc) · 14.7 KB
/
subarch.tsct
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
/*
* This file was auto-generated using 'silver-reversing-sct' tool
* to better understand the scripts presented, one is encouraged to
* view the catalogs at:
* https://github.com/nadavshemesh/silver-reversing-sct/blob/master/docs/index.md
*
* Any further information and support of this project please visit:
* https://github.com/nadavshemesh/silver-reversing-sct
*/
._DATA
VAR_18 { 0, 0, -1 }
VAR_23 -1
VAR_39 { -1416, 0, 168 }
init_position4 { -473, 0, -108 }
init_position5 { -18, 0, -441 }
init_position6 { -683, 0, -460 }
init_position7 { -964, 0, -271 }
init_position8 { -364, 0, -729 }
init_position9 { -83, 0, -780 }
init_position10 { 3580, 0, -309 }
NVILOWFAT 0
init_position { 1598, 0, -1151 }
init_position1 { 4502, 0, -773 }
init_position2 { -74, 0, -2268 }
init_position3 { 2266, 0, -729 }
ai_script { 5, 230, 0, 1649, 0, 295, 5, 80, 0, 2170, 0, 747, 3, VAR_68, 0, 0, 2698, 0, 932, 3, VAR_69, 0, 0, 2782, 0, 578, 3, VAR_70, 0, 0, 262, 0, -1933, 3, VAR_71, 0, 5, 100, 0, -2288, 0, 627, 3, VAR_72, 0, 0, 24, 0, -401, 7, 8 }
VAR_68 "duck"
VAR_69 "impjump"
VAR_70 "laugh"
VAR_71 "temper"
VAR_72 "lookout"
ai_script1 { 0, 2695, 0, -622, 0, 1084, 0, -1590, 0, -913, 0, 333, 2, -1000, -750, 867, 5, 200, 3, VAR_74, 0, 5, 100, 3, VAR_75, 0, 5, 100, 0, 2167, 0, 681, 5, 100, 7, 8 }
VAR_74 "throw"
VAR_75 "throw"
ai_script2 { 7, 8 }
ai_script3 { 9, NVILOWFAT, 0, -595, 0, 353, 3, VAR_78, 0, 0, 111, 0, -1129, 7, 8 }
VAR_78 "taichi"
walk_position { 3190, 0, -163 }
walk_position1 { 3017, 0, -581 }
VAR_91 1
VAR_92 1
walk_position3 { -1214, 0, 270 }
walk_position2 { -1214, 0, -129 }
init_position11 { -1068, -600, 4753 }
init_position12 { -3746, -250, 1781 }
ai_script4 { 10, -3584, 1200, 900, 5, 408, 10, 2872, -250, 3100, 5, 312, 10, -3946, -50, 1781, 5, 146, 10, -1068, -400, 4753, 5, 108, 7, 8 }
ai_script5 { 10, 2872, -450, 3100, 5, 305, 10, -3584, 1400, 900, 5, 507, 10, 500, 700, 4100, 5, 259, 10, -3946, -250, 1781, 5, 403, 7, 8 }
wandering_gen_script { 0, 0, 0, 1, -1, 8, 2, 12, 156, -1, 14, 0, 1, 1, 18, 25, -1 }
init_position13 { -2201, 0, -589 }
._on_load
call load_sound_set(int 4)
call remove_face(var &VAR_39)
/* play the sound 'hwave1' */
call play_loaded_sound(int 4, int -1, int 4, var &VAR_39)
execute SCRIPT_4
execute SCRIPT_14
execute SCRIPT_16
switch(gamevar room_state)
{
case 1
execute SCRIPT_6
break
case 2
call stop_bgm(int 1)
execute SCRIPT_11
break
case 3
call stop_bgm(int 1)
execute SCRIPT_15
break
}
._infinite_loop
execute SCRIPT_13
var VAR_0 = int 20
execute SCRIPT_17
switch(gamevar room_state)
{
case 1
execute SCRIPT_7
break
case 2
execute SCRIPT_12
break
}
._on_exit
execute SCRIPT_18
switch(gamevar room_state)
{
case 1
if(gamevar global_exit_door == int 0)
{
call stop_bgm(int 1)
}
gamevar room_state = int 2
break
case 2
break
case 3
gamevar room_state = int 2
break
case 20
gamevar room_state = int 2
break
}
._SCRIPT_3
var fpiont_anim = call load_anim("fpiont")
._SCRIPT_4
execute SCRIPT_5
gamevar SMACKER_X = int 0
gamevar SMACKER_Y = int 320
call play_2d_anim("subarch", int 1, int 1, int 0)
._SCRIPT_5
var NVILLBOY = call create_char(var &init_position, "NVILLBOY", int 270, int 13)
call set_char_running(var NVILLBOY)
call set_char_init_state(var NVILLBOY, int 13)
call play_char_ai_script(var NVILLBOY, var &ai_script)
var NVILLOW = call create_char(var &init_position1, "NVILLOW", int -90, int 13)
call set_char_init_state(var NVILLOW, int 13)
call play_char_ai_script(var NVILLOW, var &ai_script1)
var NVILOWFAT = call create_char(var &init_position2, "NVILOWFAT", int 296, int 13)
call set_char_init_state(var NVILOWFAT, int 13)
call play_char_ai_script(var NVILOWFAT, var &ai_script2)
var NVILLHAT = call create_char(var &init_position3, "NVILLHAT", int 0, int 13)
call set_char_init_state(var NVILLHAT, int 13)
call play_char_ai_script(var NVILLHAT, var &ai_script3)
call func_109(var NVILLBOY, int -1)
call func_109(var NVILLOW, int -1)
call func_109(var NVILOWFAT, int -1)
call func_109(var NVILLHAT, int -1)
._SCRIPT_6
execute SCRIPT_3
var DAVID = call get_char_handle(int 65536)
var fuge = call create_enemy(int 97, int 0, var &init_position4, int 85)
gamevar script_object = var fuge
gamevar *character_movement_p+60 = int 1
call freeze_enemy(var fuge)
var jennifer = call create_enemy(int 96, int 0, var &init_position5, int 265)
gamevar script_object = var jennifer
gamevar *character_movement_p+60 = int 1
var start_grunt = call create_enemy(int 156, int 0, var &init_position6, int 25)
call func_106(var start_grunt, int 1, int 0, int 0)
call set_char_init_state(var start_grunt, int 1)
var start_grunt1 = call create_enemy(int 156, int 1, var &init_position7, int 50)
call func_106(var start_grunt1, int 1, int 0, int 0)
call set_char_init_state(var start_grunt1, int 1)
var start_grunt2 = call create_enemy(int 156, int 2, var &init_position8, int 10)
call func_106(var start_grunt2, int 1, int 0, int 1)
call set_char_init_state(var start_grunt2, int 1)
var start_grunt3 = call create_enemy(int 156, int 3, var &init_position9, int 305)
call func_106(var start_grunt3, int 1, int 0, int 1)
call set_char_init_state(var start_grunt3, int 1)
var grunt_wooden_shield = call create_enemy(int 99, int 4, var &init_position10, int 290)
call func_106(var grunt_wooden_shield, int 1, int 0, int 1)
call set_char_init_state(var grunt_wooden_shield, int 1)
call set_input_system(int 2)
call play_bgm("GNBATPT1")
._SCRIPT_7
if(var VAR_83 == int 0)
{
if(var VAR_84 > int 60)
{
if(call is_char_standing(var DAVID))
{
call set_input_system(int 1)
call start_dialog("DVDJEN", "NULL")
var VAR_83 ++
}
}
}
if(var VAR_83 == int 1)
{
if(call get_input_sys() != int 4)
{
var VAR_83 ++
}
}
if(var VAR_83 == int 2)
{
execute SCRIPT_8
execute SCRIPT_9
}
var VAR_84 ++
._SCRIPT_8
if(var VAR_90 == int 0)
{
call play_char_anim(var fuge, var fpiont_anim, int 0)
var VAR_90 ++
var VAR_89 = int 0
}
if(var VAR_90 == int 1)
{
if(call func_5c(var fuge))
{
if(call is_char_handle_in_level(int 4128770 /* SGRUNT */ ))
{
call set_char_running(var start_grunt2)
call char_walk_to_pos(var start_grunt2, var &walk_position)
}
var VAR_90 ++
var VAR_89 = int 0
}
}
if(var VAR_90 == int 2)
{
if(var VAR_89 > int 20)
{
call set_char_running(var jennifer)
call func_2b(var jennifer, int 0)
var VAR_90 ++
var VAR_89 = int 0
}
}
if(var VAR_90 == int 3)
{
if(var VAR_89 > int 20)
{
if(call is_char_handle_in_level(int 4128771 /* SGRUNT */ ))
{
call set_char_running(var start_grunt3)
call char_walk_to_pos(var start_grunt3, var &walk_position1)
}
var VAR_90 ++
var VAR_89 = int 0
}
}
if(var VAR_90 == int 4)
{
if(var VAR_89 > int 30)
{
if(call is_char_handle_in_level(int 4063232 /* FUGE */ ))
{
call set_char_running(var fuge)
call func_2b(var fuge, int 0)
}
var VAR_90 ++
var VAR_89 = int 0
}
}
if(var VAR_90 == int 5)
{
if(var VAR_91)
{
if(call is_char_handle_in_level(int 4063232 /* FUGE */ ))
{
if(call is_char_standing(var fuge))
{
call remove_char(var fuge)
var VAR_91 = int 0
}
}
else
{
var VAR_91 = int 0
}
}
if(var VAR_92)
{
if(call is_char_standing(var jennifer))
{
call remove_char(var jennifer)
var VAR_92 = int 0
}
}
if(var VAR_92 + var VAR_91 == int 0)
{
var VAR_90 ++
var VAR_89 = int 0
}
}
var VAR_89 ++
._SCRIPT_9
if(var VAR_94 == int 0)
{
if(var VAR_93 == int 25)
{
if(call is_char_handle_in_level(int 4128769 /* SGRUNT */ ))
{
call set_char_running(var start_grunt1)
call char_walk_to_pos(var start_grunt, var &walk_position2)
}
}
if(var VAR_93 > int 35)
{
if(call is_char_handle_in_level(int 4128768 /* SGRUNT */ ))
{
call set_char_running(var start_grunt)
call char_walk_to_pos(var start_grunt1, var &walk_position3)
}
var VAR_94 ++
var VAR_93 = int 0
}
}
if(var VAR_90 >= int 4)
{
if(var VAR_94 == int 1)
{
if(call is_char_handle_in_level(int 4128771 /* SGRUNT */ ))
{
if(call is_char_standing(var start_grunt3))
{
call char_turn_to_pos(var start_grunt3, call get_char_pos(var DAVID))
var VAR_94 ++
}
}
else
{
var VAR_94 ++
}
}
if(var VAR_94 == int 2)
{
if(call is_char_handle_in_level(int 4128770 /* SGRUNT */ ))
{
if(call is_char_standing(var start_grunt2))
{
call char_turn_to_pos(var start_grunt2, call get_char_pos(var DAVID))
var VAR_94 ++
}
}
else
{
var VAR_94 ++
}
}
}
var VAR_93 ++
._SCRIPT_10
var NGULL1 = call create_char(var &init_position11, "NGULL1", int 230, int 16)
var NGULL2 = call create_char(var &init_position12, "NGULL2", int 70, int 16)
gamevar script_object = var NGULL1
gamevar *character_stats_p+14 = int 98304
gamevar script_object = var NGULL2
gamevar *character_stats_p+14 = int 98304
call set_char_init_state(var NGULL1, int 13)
call play_char_ai_script(var NGULL1, var &ai_script4)
call set_char_init_state(var NGULL2, int 13)
call play_char_ai_script(var NGULL2, var &ai_script5)
._SCRIPT_11
call func_108("act2")
call run_wandering_generator(var &wandering_gen_script, int 100)
._SCRIPT_12
._SCRIPT_13
if(gamevar script_time > var VAR_108)
{
var VAR_108 = gamevar script_time + int 60 + call randomize_int(int 0, int 40)
var VAR_107 = int 5 + call randomize_int(int 0, int 6)
call play_loaded_sound(var VAR_107, int 0, int 4, var &VAR_39)
}
if(gamevar script_time > var VAR_109)
{
var VAR_109 = gamevar script_time + int 80 + call randomize_int(int 0, int 40)
var VAR_107 = int 1 + call randomize_int(int 0, int 2)
call play_loaded_sound(var VAR_107, int 0, int 4, int 0)
}
if(gamevar script_time > var VAR_110)
{
var VAR_110 = gamevar script_time + int 80 + call randomize_int(int 0, int 40)
var VAR_107 = int 16 + call randomize_int(int 0, int 2)
call play_loaded_sound(var VAR_107, int 0, int 4, var &VAR_39)
}
._SCRIPT_14
._SCRIPT_15
var fade_chronicler = call create_enemy(int 178, int 0, var &init_position13, int 0)
._SCRIPT_16
if(call ! is_char_handle_in_level(int 6291456 /* CHRONICL */ ))
{
exit_script
}
else
{
if(var fade_chronicler == int 0)
{
var fade_chronicler = call get_char_handle(int 6291456)
}
}
._SCRIPT_17
if(call ! is_char_handle_in_level(int 6291456 /* CHRONICL */ ))
{
exit_script
}
else
{
if(var fade_chronicler == int 0)
{
var fade_chronicler = call get_char_handle(int 6291456)
}
}
if(var VAR_23 != var VAR_17)
{
var VAR_23 = var VAR_17
call log_var(var VAR_17)
}
switch(var VAR_17)
{
case 0
if(gamevar chronicler_variation != int -1)
{
execute SCRIPT_19
}
gamevar script_object = var fade_chronicler
var VAR_20 = gamevar *character_movement_p+3
var VAR_21 = gamevar *character_movement_p+4
var VAR_22 = gamevar *character_movement_p+5
var VAR_3 = int 0
call func_10c(var fade_chronicler, int 0)
var VAR_17 ++
var VAR_18 = int 0
break
case 1
if(call func_127(var fade_chronicler))
{
var VAR_19 = gamevar saved_games_count
var VAR_3 = int 1
var VAR_17 ++
var VAR_18 = int 0
}
break
case 2
if(call get_input_sys() != int 4)
{
call set_input_system(int 2)
var VAR_17 ++
var VAR_18 = int 0
}
break
case 3
if(var VAR_18 > int 40)
{
call open_save_screen(var VAR_0)
var VAR_17 ++
var VAR_18 = int 0
}
break
case 4
if(var VAR_18 > int 10)
{
if(gamevar !current_menu_level_p)
{
var VAR_17 ++
var VAR_18 = int 0
}
}
break
case 5
if(var VAR_19 != gamevar saved_games_count)
{
call log_string("game saved")
call func_11d()
var VAR_17 = int 7
var VAR_18 = int 0
}
else
{
call log_string("game not saved")
call func_2a(var fade_chronicler, var &VAR_20)
execute SCRIPT_20
gamevar chronicler_variation = var VAR_2
var VAR_17 ++
var VAR_18 = int 0
}
break
case 6
if(var VAR_18 > int 30)
{
call set_input_system(int 1)
gamevar clicked_character = int 0
var VAR_3 = int 0
var VAR_17 = int 1
var VAR_18 = int 0
}
break
case 7
if(var VAR_18 > int 40)
{
call apply_effect_on_char(gamevar char_gen_fx_scripts, int 8, int 0, var fade_chronicler)
execute SCRIPT_20
gamevar chronicler_variation = var VAR_2
var VAR_17 ++
var VAR_18 = int 0
}
break
case 8
if(var VAR_18 > int 100)
{
call remove_char(var fade_chronicler)
call set_input_system(int 1)
var VAR_3 = int 0
var VAR_17 ++
var VAR_18 = int 0
}
break
}
var VAR_18 ++
._SCRIPT_18
if(call is_char_handle_in_level(int 6291456 /* CHRONICL */ ))
{
if(var fade_chronicler == int 0)
{
var fade_chronicler = call get_char_handle(int 6291456)
}
call func_34(var fade_chronicler)
}
._SCRIPT_19
var VAR_4 = call get_char_handle_id(gamevar control_char_p)
switch(var VAR_4)
{
case 65536
call load_dialog_by_number("DVDCHR", "NULL", gamevar chronicler_variation)
break
case 786432
call load_dialog_by_number("SEKCHR", "NULL", gamevar chronicler_variation)
break
case 262144
call load_dialog_by_number("CAGCHR", "NULL", gamevar chronicler_variation)
break
case 327680
call load_dialog_by_number("JUGCHR", "NULL", gamevar chronicler_variation)
break
case 131072
call load_dialog_by_number("CHICHR", "NULL", gamevar chronicler_variation)
break
case 196608
call load_dialog_by_number("VIVCHR", "NULL", gamevar chronicler_variation)
break
}
._SCRIPT_20
var VAR_26 = call get_char_handle_id(gamevar control_char_p)
switch(var VAR_26)
{
case 65536
var VAR_2 = call load_next_dialog("DVDCHR", "NULL")
break
case 786432
var VAR_2 = call load_next_dialog("SEKCHR", "NULL")
break
case 262144
var VAR_2 = call load_next_dialog("CAGCHR", "NULL")
break
case 327680
var VAR_2 = call load_next_dialog("JUGCHR", "NULL")
break
case 131072
var VAR_2 = call load_next_dialog("CHICHR", "NULL")
break
case 196608
var VAR_2 = call load_next_dialog("VIVCHR", "NULL")
break
}
._SCRIPT_21
call clear_char_waypoints()