-
Notifications
You must be signed in to change notification settings - Fork 3
/
temple.tsct
494 lines (477 loc) · 14.1 KB
/
temple.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
/*
* 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
init_position8 { 562, -1650, 1920 }
init_position { 1871, -1650, 1425 }
nmuscles 0
greater_gimpv 0
rat_raptor_max5 0
init_position1 { 2043, -1650, 1846 }
init_position2 { 1660, -1650, 1829 }
init_position3 { 1480, -1650, 1608 }
init_position4 { 1848, -1650, 2229 }
init_position5 { 1440, -1650, 1794 }
init_position6 { 1509, -1650, 2015 }
init_position7 { 1632, -1650, 2204 }
VAR_57 0
ai_script { 5, 100, 1, rat_raptor_max5, 5, 30, 1, greater_gimpv, 5, 20, 3, VAR_59, 0, 16, VAR_57, 1, 3, VAR_60, 0, 8 }
VAR_59 "no"
VAR_60 "stepb"
ai_script1 { 4, VAR_57, 5, 20, 3, VAR_62, 0, 14, 0, 2123, -1650, 1953, 12, 12, 5, 100, 1, nmuscles, 7, 8 }
VAR_62 "yes"
ai_script2 { 4, VAR_57, 5, 120, 14, 0, 2123, -1650, 1953, 8 }
ai_script3 { 4, VAR_57, 5, 130, 11, 1, 20, 3, VAR_65, 0, 11, 1, 20, 3, VAR_66, 0, 11, 1, 20, 3, VAR_67, 0, 11, 1, 20, 3, VAR_68, 0, 11, 1, 20, 3, VAR_69, 0, 11, 1, 20, 3, VAR_70, 0, 11, 1, 20, 3, VAR_71, 0, 11, 1, 20, 3, VAR_72, 0, 8 }
VAR_65 "walk"
VAR_66 "walk"
VAR_67 "walk"
VAR_68 "walk"
VAR_69 "walk"
VAR_70 "walk"
VAR_71 "walk"
VAR_72 "walk"
ai_script4 { 4, VAR_57, 5, 110, 11, 1, 20, 3, VAR_74, 0, 11, 1, 20, 3, VAR_75, 0, 11, 1, 20, 3, VAR_76, 0, 11, 1, 20, 3, VAR_77, 0, 11, 1, 20, 3, VAR_78, 0, 11, 1, 20, 3, VAR_79, 0, 11, 1, 20, 3, VAR_80, 0, 11, 1, 20, 3, VAR_81, 0, 8 }
VAR_74 "walk"
VAR_75 "walk"
VAR_76 "walk"
VAR_77 "walk"
VAR_78 "walk"
VAR_79 "walk"
VAR_80 "walk"
VAR_81 "walk"
ai_script5 { 4, VAR_57, 5, 100, 11, 1, 20, 3, VAR_83, 0, 11, 1, 20, 3, VAR_84, 0, 11, 1, 20, 3, VAR_85, 0, 11, 1, 20, 3, VAR_86, 0, 11, 1, 20, 3, VAR_87, 0, 11, 1, 20, 3, VAR_88, 0, 11, 1, 20, 3, VAR_89, 0, 11, 1, 20, 3, VAR_90, 0, 8 }
VAR_83 "walk"
VAR_84 "walk"
VAR_85 "walk"
VAR_86 "walk"
VAR_87 "walk"
VAR_88 "walk"
VAR_89 "walk"
VAR_90 "walk"
ai_script6 { 4, VAR_57, 5, 115, 11, 1, 20, 3, VAR_92, 0, 11, 1, 20, 3, VAR_93, 0, 11, 1, 20, 3, VAR_94, 0, 11, 1, 20, 3, VAR_95, 0, 11, 1, 20, 3, VAR_96, 0, 11, 1, 20, 3, VAR_97, 0, 11, 1, 20, 3, VAR_98, 0, 11, 1, 20, 3, VAR_99, 0, 8 }
VAR_92 "walk"
VAR_93 "walk"
VAR_94 "walk"
VAR_95 "walk"
VAR_96 "walk"
VAR_97 "walk"
VAR_98 "walk"
VAR_99 "walk"
/*
Interpretation of: enemy_gen_script
Generate at -1 positions from: VAR_1
Order of positions: Single position
Trigger wave when there are less than 0 enemies left.
Delay for first enemy: 0; delay between each enemy: 0
*/
enemy_gen_script { 0, 0, 0, 1, 1, 0, 0, 1, -1, 1, 2, 46, 87, 87, 46, 46, 86, -1, 2, 3, 3, 2, 7, 1, 3, 5, 1, 50, 100, 8, 1, 4, 0, 9, 1, -1 }
/*
Interpretation of: enemy_gen_script1
Generate at -1 positions from: VAR_1
Order of positions: Sequential
Total waves: 87; 4 enemies generated in each wave.
Trigger wave when there are less than 1 enemies left.
Delay for first enemy: 25; delay between each enemy: 50
Enemies:
rat_raptor_max5
rat_raptor_max5
rat_raptor_max5
rat_raptor_max5
Item drops:
cheese
*/
enemy_gen_script1 { 0, 0, 1, 0, 1, 0, 1, -1, 1, 1, 87, 87, 87, 87, 87, -1, 7, 1, 1, 5, 1, 25, 50, 8, 1, 4, 0, 9, 1, 10, 43, -1, -1 }
._on_load
execute SCRIPT_6
call play_bgm("SEWERPT1")
call load_sound_set(int 33)
call load_sound_set(int 38)
/* play the sound 'spires1' */
call play_loaded_sound(int 3, int -1, int 38, int 0)
gamevar SMACKER_X = int 500
gamevar SMACKER_Y = int 188
call play_2d_anim("right", int 1, int 0, int 0)
gamevar SMACKER_X = int 44
gamevar SMACKER_Y = int 400
call play_2d_anim("left", int 1, int 1, int 0)
switch(gamevar room_state)
{
case 1
execute SCRIPT_3
break
default
break
}
._infinite_loop
var VAR_0 = int 2
execute SCRIPT_7
execute SCRIPT_5
switch(gamevar room_state)
{
case 1
execute SCRIPT_4
break
default
break
}
._on_exit
execute SCRIPT_8
switch(gamevar room_state)
{
case 1
gamevar room_state = int 0
break
default
break
}
._SCRIPT_3
call load_anim("no")
call load_anim("yes")
call load_anim("stepb")
call load_anim("walk")
call load_char("chronicl")
if(call ! func_bf(int 0, gamevar CURRENT_LEVEL, gamevar CURRENT_SCENE))
{
call save_pos_to_room_memory(int 0, int 1, int 1, int 1)
call create_char(var &init_position, "btreasure", int 25, int 15)
}
var nmuscles = call create_char(var &init_position1, "nmuscles", int 255, int 13)
gamevar script_object = var nmuscles
gamevar *object_p+6 |= int 2048
gamevar script_object = var nmuscles
gamevar HP = int 2
call add_item_to_char(var nmuscles, int 85 /* moneybag */ , int 19661313, int 0)
var greater_gimpv = call create_enemy(int 46, int 0, var &init_position2, int 75)
var greater_gimpv1 = call create_enemy(int 46, int 1, var &init_position3, int 60)
call add_item_to_char(var greater_gimpv, int 21 /* polearm */ , int 1, int 0)
var rat_raptor_max5 = call create_enemy(int 87, int 0, var &init_position4, int 105)
var rat_raptor_max51 = call create_enemy(int 87, int 1, var &init_position5, int 50)
var rat_raptor_max52 = call create_enemy(int 87, int 2, var &init_position6, int 65)
var rat_raptor_max53 = call create_enemy(int 87, int 3, var &init_position7, int 80)
call add_item_to_char(var rat_raptor_max51, int 43 /* cheese */ , int 1, int 0)
call add_item_to_char(var rat_raptor_max52, int 43 /* cheese */ , int 1, int 0)
call func_46(var greater_gimpv, int 0)
call func_46(var greater_gimpv1, int 0)
call func_46(var rat_raptor_max5, int 0)
call func_46(var rat_raptor_max51, int 0)
call func_46(var rat_raptor_max52, int 0)
call func_46(var rat_raptor_max53, int 0)
call set_char_init_state(var nmuscles, int 13)
call set_char_init_state(var greater_gimpv, int 13)
call set_char_init_state(var greater_gimpv1, int 13)
call set_char_init_state(var rat_raptor_max5, int 13)
call set_char_init_state(var rat_raptor_max51, int 13)
call set_char_init_state(var rat_raptor_max52, int 13)
call set_char_init_state(var rat_raptor_max53, int 13)
call play_char_ai_script(var nmuscles, var &ai_script)
call play_char_ai_script(var greater_gimpv, var &ai_script1)
call play_char_ai_script(var greater_gimpv1, var &ai_script2)
call play_char_ai_script(var rat_raptor_max5, var &ai_script3)
call play_char_ai_script(var rat_raptor_max51, var &ai_script4)
call play_char_ai_script(var rat_raptor_max52, var &ai_script5)
call play_char_ai_script(var rat_raptor_max53, var &ai_script6)
var VAR_40 = int 0
call set_input_system(int 2)
._SCRIPT_4
switch(var VAR_40)
{
case 0
gamevar script_object = var nmuscles
if(gamevar HP <= int 1)
{
call func_ea(var nmuscles)
if(call is_char_handle_in_level(int 10551296))
{
call func_46(var greater_gimpv, int 13)
call set_char_init_state(var greater_gimpv, int 0)
}
if(call is_char_handle_in_level(int 10551297))
{
call func_46(var greater_gimpv1, int 13)
call set_char_init_state(var greater_gimpv1, int 0)
}
if(call is_char_handle_in_level(int 9240576))
{
call func_46(var rat_raptor_max5, int 13)
call set_char_init_state(var rat_raptor_max5, int 0)
}
if(call is_char_handle_in_level(int 9240577))
{
call func_46(var rat_raptor_max51, int 13)
call set_char_init_state(var rat_raptor_max51, int 0)
}
if(call is_char_handle_in_level(int 9240578))
{
call func_46(var rat_raptor_max52, int 13)
call set_char_init_state(var rat_raptor_max52, int 0)
}
if(call is_char_handle_in_level(int 9240579))
{
call func_46(var rat_raptor_max53, int 13)
call set_char_init_state(var rat_raptor_max53, int 0)
}
var VAR_41 = int 90
var VAR_40 ++
call set_input_system(int 1)
}
break
case 1
var VAR_41 --
switch(var VAR_41)
{
case 70
if(call is_char_handle_in_level(int 9240576))
{
call char_walk_to(var rat_raptor_max5, int -3015, int -1650, int 1375)
}
break
case 65
if(call is_char_handle_in_level(int 9240578))
{
call char_walk_to(var rat_raptor_max52, int -3015, int -1650, int 1375)
}
break
case 40
if(call is_char_handle_in_level(int 10551296))
{
call char_walk_to(var greater_gimpv, int -3015, int -1650, int 1375)
}
break
case 38
if(call is_char_handle_in_level(int 9240577))
{
call char_walk_to(var rat_raptor_max51, int -3015, int -1650, int 1375)
}
break
case 20
if(call is_char_handle_in_level(int 10551297))
{
call char_walk_to(var greater_gimpv1, int -3015, int -1650, int 1375)
}
break
case 7
if(call is_char_handle_in_level(int 9240579))
{
call char_walk_to(var rat_raptor_max53, int -3015, int -1650, int 1375)
}
break
case 0
var VAR_100 = call run_enemy_generator(var &enemy_gen_script, int 400)
var VAR_102 = call run_enemy_generator(var &enemy_gen_script1, int 500)
call set_input_system(int 1)
var VAR_40 ++
break
default
break
}
break
case 2
if(call get_num_of_enemies() == int 0&&call ! func_122(var VAR_100)&&call ! func_122(var VAR_102))
{
var fade_chronicler = call create_enemy(int 178, int 0, var &init_position8, int 312)
var VAR_40 ++
}
break
default
break
}
._SCRIPT_5
if(gamevar script_time > var VAR_114)
{
var VAR_114 = gamevar script_time + int 50 + call randomize_int(int 0, int 70)
/* play the sound 'echdrip1' */
call play_loaded_sound(int 1, int 0, int 38, int 0)
}
._SCRIPT_6
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_7
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_9
}
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_10
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_10
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_8
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_9
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_10
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
}