-
Notifications
You must be signed in to change notification settings - Fork 3
/
lighttow.tsct
775 lines (753 loc) · 19 KB
/
lighttow.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
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
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
/*
* 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_17 { 0, 0 }
fx_position { 982, 2615, -2736 }
VAR_20 { 7587, 2615, 3049 }
lightning 0
scroll_position { -4046, 795, -1220 }
VAR_27 { -4910, 795, -915 }
VAR_28 { -4690, 795, -500 }
VAR_29 { -4252, 795, -390 }
arr { VAR_27, VAR_28, VAR_29 }
VAR_44 0
VAR_45 0
VAR_54 { -5305, 796, -1955, -3210, 796, -1924, -3138, 796, 1074, -4743, 796, 678, -3279, 796, -291, -5159, 796, -230, -4982, 796, -1440, -5856, 796, -757, -5192, 796, -1349, -4728, 796, -2413 }
ai_script { 34, 3, 0, 3, VAR_56, 0, 3, VAR_57, 0, 5, 30, 34, 1, 0, 3, VAR_58, 0, 34, 4, 0, 0, -4127, 795, -1700, 3, VAR_59, 0, 0, -3566, 796, -1145, 34, 5, 0, 3, VAR_60, 0, 4, VAR_44, 19, 17, 10, VAR_54, 0, 4, VAR_45, 20, 21, lightning, 23, 22, lightning, 34, 1, 0, 3, VAR_61, 0, 5, 10, 6, 13, 0, 8 }
VAR_56 "impjeer"
VAR_57 "implook"
VAR_58 "laugh"
VAR_59 "implook"
VAR_60 "impish"
VAR_61 "laugh"
VAR_76 -1
VAR_96 { -6880, 1286, -2151, -7018, 796, -1436, -3033, 796, -2397, -2552, 796, 1396 }
VAR_97 { -6880, 1286, -2151, -7018, 796, -1436, -3033, 796, -2397, -2552, 796, 1396 }
VAR_98 { -6880, 1286, -2151, -7018, 796, -1436, -3033, 796, -2397, -2552, 796, 1396 }
/*
Interpretation of: enemy_gen_script
Generate at 4 positions from: VAR_96
Order of positions: Random
Total waves: 1; 1 enemies generated in each wave.
Trigger wave when there are less than 1 enemies left.
Delay for first enemy: 1; delay between each enemy: 50
Enemies:
orc
Item drops:
cheese
*/
enemy_gen_script { 0, 1, 4, VAR_96, 8, 2, 4, 0, 9, 1, 1, 1, 78, -1, 5, 1, 1, 50, 6, 1, 7, 1, 1, 10, 43, -1, -1 }
/*
Interpretation of: enemy_gen_script1
Generate at 4 positions from: VAR_97
Order of positions: Random
Total waves: 1; 1 enemies generated in each wave.
Trigger wave when there are less than 1 enemies left.
Delay for first enemy: 5; delay between each enemy: 50
Enemies:
ogre
Item drops:
apple
*/
enemy_gen_script1 { 0, 1, 4, VAR_97, 8, 2, 4, 0, 9, 1, 1, 1, 76, -1, 5, 1, 5, 50, 6, 1, 7, 1, 1, 10, 40, -1, -1 }
/*
Interpretation of: enemy_gen_script2
Generate at 4 positions from: VAR_98
Order of positions: Random
Total waves: 1; 1 enemies generated in each wave.
Trigger wave when there are less than 1 enemies left.
Delay for first enemy: 5; delay between each enemy: 50
Enemies:
ronnie
Item drops:
bread
*/
enemy_gen_script2 { 0, 1, 4, VAR_98, 8, 2, 4, 0, 9, 1, 1, 1, 77, -1, 5, 1, 5, 50, 6, 1, 7, 1, 1, 10, 42, -1, -1 }
VAR_109 0
VAR_110 { 5, 10, 20, 16, VAR_109, 1, 8 }
VAR_111 -1
._on_load
execute SCRIPT_3
if(gamevar is_room_cleared)
{
execute SCRIPT_9
}
else
{
switch(gamevar room_state)
{
case 1
execute SCRIPT_5
break
case 2
execute SCRIPT_8
break
case 0
break
}
}
._infinite_loop
execute SCRIPT_11
if(gamevar !is_room_cleared)
{
switch(gamevar room_state)
{
case 1
execute SCRIPT_4
break
case 2
execute SCRIPT_7
break
case 0
break
}
}
._on_exit
if(gamevar !is_room_cleared)
{
switch(gamevar room_state)
{
case 1
gamevar room_state ++
break
case 2
break
case 0
break
default
gamevar room_state = int 0
break
}
}
._SCRIPT_3
call log_string("it's_raining")
call play_3d_fx("RAIN", var &fx_position, var &VAR_20, int 0)
execute SCRIPT_10
._SCRIPT_4
if(var VAR_76 != var VAR_22)
{
var VAR_76 = var VAR_22
call log_var(var VAR_22)
}
switch(var VAR_22)
{
case 0
if(var VAR_23 > int 3)
{
call set_input_system(int 2)
var david = call get_david_char()
while(var david)
{
call char_walk_to_pos(var david, @arr[var VAR_36])
var index ++
var david = call get_next_char_from_list()
}
var VAR_23 = int 0
var VAR_22 ++
}
break
case 1
if(var VAR_23 > int 150)
{
call force_scroll_to_pos(var &scroll_position)
var VAR_23 = int 0
var VAR_22 ++
}
break
case 2
if(call is_char_standing(var DAVID))
{
gamevar script_object = var DAVID
gamevar *object_p+8 |= int 67108864
var VAR_22 ++
var VAR_23 = int 0
}
break
case 3
if(var VAR_23 == int 20)
{
call func_36(var DAVID, int -3769, int 796, int -1128)
}
if(var VAR_23 > int 60)
{
call set_char_walking(var DAVID)
call play_char_anim(var DAVID, var confused_anim, int 0)
var VAR_22 ++
var VAR_23 = int 0
}
break
case 4
if(var VAR_23 > int 200)
{
call char_walk_to(var DAVID, int -3652, int 795, int -711)
var VAR_22 ++
var VAR_23 = int 0
}
break
case 5
if(var VAR_23 == int 220)
{
var position = call get_char_pos(var DAVID)
call char_turn_to_pos(var gonchfx, var position)
var david = call get_david_char()
var position = call get_char_pos(var gonchfx)
while(var david)
{
call char_turn_to_pos(var david, var position)
var david = call get_next_char_from_list()
}
var VAR_23 = int 0
var VAR_22 ++
}
break
case 6
if(var VAR_23 > int 100)
{
var david = call get_david_char()
while(var david)
{
var VAR_35 = call get_char_handle_id(var david)
if(var VAR_35 == int 65536)
{
var david = call get_next_char_from_list()
}
else
{
switch(var VAR_35)
{
case 786432
call start_dialog("S_Sekgon", "NULL")
var VAR_32 = var VAR_38
call log_string("S_Sekgon started")
break
case 327680
call start_dialog("S_Juggon", "NULL")
var VAR_32 = var VAR_39
call log_string("S_Juggon started")
break
case 196608
call start_dialog("S_Vivgonc", "NULL")
var VAR_32 = var VAR_40
call log_string("S_Vivgonc started")
break
case 131072
call start_dialog("S_Chigonc", "NULL")
var VAR_32 = var VAR_41
call log_string("S_Chigonc started")
break
case 262144
call start_dialog("S_Caggon", "NULL")
var VAR_32 = var VAR_42
call log_string("S_Caggonc started")
break
default
call log_string("no char!!!")
break
}
var david = call get_next_char_from_list()
if(var david)
{
var VAR_35 = call get_char_handle_id(var david)
if(var VAR_35 != int 65536)
{
var VAR_33 = var david
call set_char_walking(var VAR_33)
}
else
{
var david = call get_next_char_from_list()
if(var david)
{
var VAR_35 = call get_char_handle_id(var david)
if(var VAR_35 != int 65536)
{
var VAR_33 = var david
call set_char_walking(var VAR_33)
}
}
}
}
var david = int 0
}
}
call set_input_system(int 4)
var VAR_22 ++
var VAR_23 = int 0
}
case 7
if(call func_6d() == int 1)
{
call play_char_anim(var gonchfx, var strut_anim, int 0)
var VAR_23 = int 0
var VAR_22 ++
if(var VAR_33)
{
call char_walk_to(var VAR_33, int -3981, int 796, int -519)
}
}
break
case 8
if(var VAR_23 > int 25)
{
call play_char_anim(var gonchfx, var impish_anim, int 0)
call resume_conversation()
var VAR_22 ++
var VAR_23 = int 0
}
break
case 9
if(call func_6d() == int 2)
{
if(var VAR_23 == int 2)
{
var position = call get_char_pos(var DAVID)
call char_turn_to_pos(var gonchfx, var position)
}
if(var VAR_23 > int 30)
{
var position = call get_char_pos(var gonchfx)
call char_turn_to_pos(var DAVID, var position)
call play_char_anim(var gonchfx, var stepb_anim, int 0)
var VAR_23 = int 0
var VAR_22 ++
}
}
break
case 10
if(var VAR_23 == int 50)
{
call play_char_anim(var DAVID, var confused_anim, int 0)
}
if(var VAR_23 == int 120)
{
call char_stop(var gonchfx)
}
if(var VAR_23 > int 130)
{
call char_turn_to_pos(var gonchfx, call get_char_movement_ptr(var DAVID))
var VAR_22 ++
var VAR_23 = int 0
}
break
case 11
if(var VAR_23 == int 60)
{
call func_55(var gonchfx, int 3)
}
if(var VAR_23 > int 180)
{
call set_char_type(var gonchfx, int 8)
gamevar script_object = var gonchfx
gamevar *object_p+8 |= int 4194304
gamevar script_object = var DAVID
gamevar *object_p+8 |= int 4194304
if(var VAR_32)
{
gamevar script_object = var VAR_32
gamevar *object_p+8 |= int 4194304
gamevar script_object = var VAR_32
gamevar *object_p+8 |= int 67108864
}
if(var VAR_33)
{
gamevar script_object = var VAR_33
gamevar *object_p+8 |= int 4194304
gamevar script_object = var VAR_33
gamevar *object_p+8 |= int 67108864
}
call func_1e(var gonchfx, var DAVID)
if(var VAR_33)
{
call play_char_anim(var VAR_33, var startle_anim, int 0)
}
var VAR_23 = int 0
var VAR_22 ++
}
break
case 12
if(var VAR_23 > int 120)
{
gamevar script_object = var DAVID
gamevar *object_p+8 &= int -6710886
gamevar script_object = var DAVID
gamevar *object_p+8 &= int -4194305
if(var VAR_32)
{
gamevar script_object = var VAR_32
gamevar *object_p+8 &= int -4194305
gamevar script_object = var VAR_32
gamevar *object_p+8 &= int -6710886
}
if(var VAR_33)
{
gamevar script_object = var VAR_33
gamevar *object_p+8 &= int -4194305
gamevar script_object = var VAR_33
gamevar *object_p+8 &= int -6710886
}
call play_char_anim(var gonchfx, var laugh_anim, int 0)
var VAR_22 ++
}
break
case 13
var position = call get_char_pos(var gonchfx)
call char_turn_to_pos(var DAVID, var position)
call resume_conversation()
var VAR_22 ++
break
case 14
if(call func_6d() == int 3)
{
var VAR_23 = int 0
call func_132(var gonchfx, int 3)
var VAR_22 ++
}
break
case 15
if(var VAR_23 > int 30)
{
call play_char_anim(var DAVID, var strut_anim, int 0)
var VAR_44 = int 1
var VAR_22 ++
var VAR_23 = int 0
}
break
case 16
if(var VAR_23 > int 50)
{
if(var VAR_32)
{
call play_char_anim(var VAR_32, var lookout_anim, int 0)
}
if(var VAR_33)
{
call play_char_anim(var VAR_33, var confused_anim, int 0)
}
call resume_conversation()
var VAR_22 ++
}
break
case 17
if(call get_input_sys() != int 4)
{
var VAR_45 = int 1
call set_input_system(int 1)
var VAR_22 ++
}
break
}
var VAR_23 ++
if(call is_char_handle_in_level(int 8847360 /* GONCH */ ))
{
execute SCRIPT_6
}
._SCRIPT_5
var gonchfx = call create_enemy(int 73, int 0, var &scroll_position, int 80)
call set_char_type(var gonchfx, int 131072)
gamevar script_object = var gonchfx
gamevar *object_p+8 |= int 4194304
call add_item_to_char(var gonchfx, int 76 /* goldring */ , int 1, int 0)
var lightning = call add_item_to_char(var gonchfx, int 3, int 0, int 0)
call add_item_to_char(var gonchfx, int 85 /* moneybag */ , int 1638913, int 0)
call func_f7(var lightning, int 1)
call set_char_init_state(var gonchfx, int 0)
call func_106(var gonchfx, int 0, int 3, int 360)
gamevar script_object = var gonchfx
gamevar *character_stats_p+15 = int 4000
gamevar *character_stats_p+16 = int 4000
gamevar script_object = var gonchfx
gamevar *object_p+6 |= int 67108864
var DAVID = call get_char_handle(int 65536)
var david = call get_david_char()
while(var david)
{
var VAR_35 = call get_char_handle_id(var david)
switch(var VAR_35)
{
case 65536
call log_string("david")
var VAR_37 = var david
break
case 786432
call log_string("sekune")
var VAR_38 = var david
break
case 327680
call log_string("jug")
var VAR_39 = var david
break
case 196608
call log_string("vivienne")
var VAR_40 = var david
break
case 131072
call log_string("chiaro")
var VAR_41 = var david
break
case 262144
call log_string("cagen")
var VAR_42 = var david
break
default
call log_string("WARNING! Unknown hero while checking heroes")
call log_string("Get a goober -- QUICKLY!!")
break
}
var david = call get_next_char_from_list()
}
call func_50(var gonchfx, int 8192)
call play_char_ai_script(var gonchfx, var &ai_script)
call set_char_running(var gonchfx)
var strut_anim = call load_anim("strut")
var impish_anim = call load_anim("impish")
var confused_anim = call load_anim("confused")
var startle_anim = call load_anim("startle")
var stepb_anim = call load_anim("stepb")
var laugh_anim = call load_anim("laugh")
var lookout_anim = call load_anim("lookout")
._SCRIPT_6
if(var VAR_108 == int 0)
{
gamevar script_object = var gonchfx
if(var VAR_111 != gamevar *character_combat_p+15)
{
var VAR_111 = gamevar *character_combat_p+15
call log_var(gamevar *character_combat_p+15)
}
if(gamevar *character_combat_p+15)
{
var VAR_107 ++
call log_string("We hit gonch")
gamevar script_object = var gonchfx
gamevar *character_combat_p+15 = int 0
}
if(var VAR_107 >= int 4)
{
var VAR_108 ++
call func_47(var gonchfx, int 8192)
call func_115(var gonchfx, var &VAR_110)
call func_50(var gonchfx, int 8192)
call func_28(var gonchfx)
gamevar script_object = var gonchfx
gamevar *object_p+6 |= int 1
call set_char_type(var gonchfx, int 131072)
gamevar script_object = var gonchfx
gamevar *object_p+8 |= int 4194304
}
}
if(var VAR_108 == int 1)
{
if(var VAR_109)
{
call func_2b(var gonchfx, int 0)
var VAR_108 ++
}
}
if(var VAR_108 == int 2)
{
if(call is_char_standing(var gonchfx))
{
call remove_char(var gonchfx)
var VAR_108 ++
}
}
._SCRIPT_7
if(var ! VAR_106)
{
var VAR_105 ++
if(var VAR_105 > int 60)
{
var VAR_106 ++
call set_input_system(int 1)
}
}
._SCRIPT_8
call load_char("orc")
call load_char("ogre")
call load_char("ronnie")
call load_item(int 96 /* pick */ )
call set_input_system(int 2)
var VAR_102 = call randomize_int(int 0, int 3)
var VAR_103 = call randomize_int(int 0, int 3)
call log_string("shall I do baddies?")
if(var VAR_103 == int 0)
{
if(var ! VAR_102)
{
call run_enemy_generator(var &enemy_gen_script, int 10)
}
if(var VAR_102 == int 1)
{
call run_enemy_generator(var &enemy_gen_script1, int 10)
}
if(var VAR_102 == int 2)
{
call run_enemy_generator(var &enemy_gen_script2, int 10)
}
}
._SCRIPT_9
._SCRIPT_10
call load_sound_set(int 25)
/* play the sound 'blank' */
call play_loaded_sound(int 1, int -1, int 25, int 0)
var thunrumb_sound_ref = call play_loaded_sound(int 3, int -1, int 25, int 0)
var VAR_1 = int 70
call set_sound_volume(var thunrumb_sound_ref, var VAR_1)
var VAR_0 = int 1
._SCRIPT_11
if(var ! VAR_0)
{
call log_string("random_rain_fx: Rain SFX not initialised! See Marc")
exit_script
}
switch(var VAR_4)
{
case 0
if(var VAR_3)
{
var VAR_6 = int 1
var VAR_4 ++
var VAR_5 = int 0
}
break
case 1
if(var VAR_1 < int 200)
{
var VAR_7 = var VAR_5 % int 2
if(var VAR_7 == int 0)
{
var VAR_1 += var VAR_6
call set_sound_volume(var thunrumb_sound_ref, var VAR_1)
}
}
else
{
var VAR_4 ++
var VAR_5 = int 0
}
break
case 2
if(var VAR_5 > int 150)
{
var VAR_4 ++
var VAR_5 = int 0
}
break
case 3
if(var VAR_1 > int 70)
{
var VAR_7 = var VAR_5 % int 2
if(var VAR_7)
{
var VAR_1 -= var VAR_6
call set_sound_volume(var thunrumb_sound_ref, var VAR_1)
}
}
else
{
var VAR_3 = int 0
var VAR_4 = int 0
var VAR_5 = int 0
}
break
}
execute SCRIPT_12
execute SCRIPT_13
var VAR_5 ++
._SCRIPT_12
switch(var VAR_9)
{
case 0
var VAR_10 = int 0
var VAR_11 = call randomize_int(int 1200, int 1801)
var VAR_9 ++
break
case 1
if(var VAR_10 > var VAR_11)
{
var thunstrk_sound_ref = call play_loaded_sound(int 4, int 0, int 25, int 0)
call set_sound_volume(var thunstrk_sound_ref, call randomize_int(int 100, int 201))
call func_11a(var thunstrk_sound_ref, call randomize_int(int 0, int 128))
if(var ! VAR_3)
{
var VAR_3 = int 1
}
var VAR_9 ++
var VAR_10 = int 0
}
break
case 2
if(var VAR_10 > int 200)
{
var VAR_9 = int 0
var VAR_10 = int 0
}
break
}
var VAR_10 ++
._SCRIPT_13
switch(var VAR_13)
{
case 0
if(gamevar scene_counter > int 600)
{
var VAR_13 ++
}
break
case 1
var VAR_14 = int 0
call reset_local_timer()
var VAR_16 = call randomize_int(int 400, int 601)
var VAR_13 ++
break
case 2
if(call is_local_timer_greater_than(var VAR_16))
{
call apply_effect_on_char(gamevar misc_fx_scripts, int 6, int 0, int 0)
call reset_local_timer()
var VAR_17 = int 255
var VAR_16 = call randomize_int(int 1, int 31)
var VAR_14 = int 0
var VAR_13 ++
}
break
case 3
if(call is_local_timer_greater_than(var VAR_16))
{
var VAR_17 -= int 4 * var VAR_16
var verwind_sound_ref = call play_loaded_sound(int 5, int 0, int 25, int 0)
call set_sound_volume(var verwind_sound_ref, var VAR_17)
var VAR_16 = int 255 - var VAR_17
var VAR_14 = int 0
var VAR_13 ++
}
break
case 4
if(var VAR_14 > var VAR_16)
{
var verwind_sound_ref = call play_loaded_sound /* 'thunstrk' */ (int 4, int 0, int 25, int 0)
call set_sound_volume(var verwind_sound_ref, var VAR_17)
if(var ! VAR_3)
{
var VAR_3 = int 1
}
var VAR_13 ++
var VAR_14 = int 0
}
break
case 5
if(var VAR_14 > int 100)
{
var VAR_13 = int 1
var VAR_14 = int 0
}
break
}
var VAR_14 ++