-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathorchard1.tsct
365 lines (341 loc) · 8.66 KB
/
orchard1.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
/*
* 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_0 { 3148, 175, 1980 }
VAR_3 { 0, 0 }
init_position { 4333, 175, 1039 }
init_position1 { 2243, 175, -920 }
arr { 0, 0 }
arr_2 { 0, 0, 0 }
arr_1 { 0, 2 }
VAR_19 { 1879, 175, -659, 4086, 175, -877 }
VAR_20 { 2188, 175, 662, 3971, 183, 726 }
VAR_22 { 3208, 1163, -2464, 3282, 1138, -1706, 3740, 875, -1079, 3286, 875, -1044, 2819, 875, -1019, 2269, 875, -982 }
VAR_23 { 3835, 875, -549, 3813, 875, -156, 3712, 875, 352, 2573, 875, -344, 2479, 875, 90, 2482, 875, 489 }
VAR_24 { 3289, 875, -1704, 2712, 875, -938, 3784, 875, -1019 }
/*
Interpretation of: enemy_gen_script
Generate at 6 positions from: VAR_22
Order of positions: Random
Total waves: 1; 3 enemies generated in each wave.
Trigger wave when there are less than 2 enemies left.
Delay for first enemy: 0; delay between each enemy: 0
Enemies:
plagueman_sword
plagueman_sword
plagueman_earth
Item drops:
apple
*/
enemy_gen_script { 0, 1, 6, VAR_22, 8, 2, 4, 0, 9, 2, 1, 1, 142, 142, 139, -1, 5, 0, 0, 7, 1, 2, 6, 1, 10, 40, -1, -1 }
/*
Interpretation of: enemy_gen_script1
Generate at 6 positions from: VAR_23
Order of positions: Random
Total waves: 1; 3 enemies generated in each wave.
Trigger wave when there are less than 2 enemies left.
Delay for first enemy: 0; delay between each enemy: 0
Enemies:
plagueman_drops
plagueman_earth
plagueman_sword
Item drops:
veggies
*/
enemy_gen_script1 { 0, 1, 6, VAR_23, 8, 2, 4, 0, 9, 2, 1, 1, 95, 139, 142, -1, 5, 0, 0, 7, 1, 2, 10, 41, -1, 6, 1, -1 }
/*
Interpretation of: enemy_gen_script2
Generate at 3 positions from: VAR_24
Order of positions: Random
Total waves: 1; 3 enemies generated in each wave.
Trigger wave when there are less than 2 enemies left.
Delay for first enemy: 0; delay between each enemy: 0
Enemies:
plagueman_3way
plagueman_3way
plagueman_sword
d
Item drops:
apple
quiverb
*/
enemy_gen_script2 { 0, 1, 3, VAR_24, 8, 2, 4, 0, 9, 2, 1, 1, 141, 141, 142, -1, 5, 0, 0, 7, 1, 2, 6, 1, 10, 40, 109, -1, -1 }
VAR_28 { 4030, 875, 1654, 3755, 875, 1607, 3623, 875, 1452, 3554, 875, 1112, 3775, 875, 732 }
/*
Interpretation of: enemy_gen_script3
Generate at 5 positions from: VAR_28
Order of positions: Random
Total waves: 1; 5 enemies generated in each wave.
Trigger wave when there are less than 2 enemies left.
Delay for first enemy: 0; delay between each enemy: 0
Enemies:
plagueman_earth
plagueman_3way
plagueman_drops
plagueman_sword
plagueman_sword
Item drops:
quiverb
*/
enemy_gen_script3 { 0, 1, 5, VAR_28, 8, 2, 4, 0, 9, 2, 1, 1, 139, 141, 95, 142, 142, -1, 5, 0, 0, 7, 1, 2, 6, 1, 10, 109, -1, -1 }
VAR_32 3
VAR_40 { 3835, 875, -549, 3813, 875, -156, 3712, 875, 352 }
wandering_gen_script { 0, 1, 3, VAR_40, 8, 1, 19, 1070, -2275, 7082, 12, 142, 141, 139, -1, 13, 1, 14, 0, 1, 2, 5, 0, 60, 18, 25, 11, -1 }
._on_load
if(call play_bgm("HAVNBPT1"))
{
call func_114(int 1)
call func_5a(int -1)
}
call load_sound_set(int 12)
/* play the sound 'sent1' */
call play_loaded_sound(int 8, int -1, int 12, int 0)
call load_sound_set(int 37)
call func_ec(int 2, int -1, int 37, var &VAR_0)
if(gamevar is_room_cleared)
{
execute SCRIPT_15
}
else
{
switch(gamevar room_state)
{
case 1
execute SCRIPT_5
break
case 2
execute SCRIPT_14
break
case 0
break
}
}
._infinite_loop
if(gamevar !is_room_cleared)
{
switch(gamevar room_state)
{
case 1
execute SCRIPT_4
break
case 2
execute SCRIPT_13
break
case 0
break
}
}
execute SCRIPT_16
._on_exit
if(gamevar !is_room_cleared)
{
switch(gamevar room_state)
{
case 1
gamevar room_state ++
gamevar is_room_cleared = int 1
break
case 2
gamevar room_state ++
gamevar is_room_cleared = int 1
break
case 0
break
default
gamevar room_state = int 0
break
}
}
._SCRIPT_3
var david = call get_david_char()
var VAR_9 = call get_next_char_from_list()
var VAR_10 = call get_next_char_from_list()
var VAR_11 = call get_next_char_from_list()
execute SCRIPT_8
call log_string("Init trigger zones")
._SCRIPT_4
execute SCRIPT_9
switch(var VAR_34)
{
case 0
if(call get_num_of_enemies() < int 1)
{
var VAR_34 ++
var VAR_35 = int 0
}
break
case 1
if(var VAR_33 < var VAR_32)
{
switch(var VAR_17)
{
case 0
var VAR_33 ++
var VAR_36 = call run_enemy_generator(var &enemy_gen_script, int 0)
var VAR_34 ++
var VAR_35 = int 0
break
case 1
var VAR_33 ++
var VAR_36 = call run_enemy_generator(var &enemy_gen_script1, int 0)
var VAR_34 ++
var VAR_35 = int 0
break
case 2
var VAR_33 ++
var VAR_36 = call run_enemy_generator(var &enemy_gen_script2, int 0)
var VAR_34 ++
var VAR_35 = int 0
break
default
break
}
}
else
{
var VAR_34 = int 3
var VAR_35 = int 0
}
break
case 2
if(call func_9(var VAR_36))
{
var VAR_34 = int 1
var VAR_35 = int 0
}
break
case 3
if(call get_num_of_enemies() < int 1)
{
if(call ! func_ab(int 600, var &init_position))
{
execute SCRIPT_6
var VAR_34 ++
}
}
break
case 4
if(call func_ab(int 600, var &init_position))
{
var VAR_34 ++
var VAR_35 = int 0
}
break
case 5
var VAR_35 ++
if(var VAR_35 > int 60)
{
var VAR_36 = call run_enemy_generator(var &enemy_gen_script3, int 0)
var VAR_34 ++
var VAR_35 = int 0
}
break
case 6
var VAR_35 ++
if(call get_num_of_enemies() < int 1)
{
if(var VAR_35 > int 120)
{
execute SCRIPT_7
var VAR_34 ++
}
}
break
}
._SCRIPT_5
call load_char("plguemen")
call load_char("treasure")
execute SCRIPT_3
._SCRIPT_6
var treasure = call create_enemy(int 136, int 0, var &init_position, int 280)
call add_item_to_char(var treasure, int 42 /* bread */ , int 1, int 0)
call add_item_to_char(var treasure, int 45 /* deadmous */ , int 1, int 0)
call add_item_to_char(var treasure, int 83 /* borb */ , int 1, int 0)
call add_item_to_char(var treasure, int 83 /* borb */ , int 1, int 0)
._SCRIPT_7
var treasure1 = call create_enemy(int 136, int 0, var &init_position1, int 6)
call add_item_to_char(var treasure1, int 46 /* pie */ , int 1, int 0)
call add_item_to_char(var treasure1, int 45 /* deadmous */ , int 1, int 0)
call add_item_to_char(var treasure1, int 83 /* borb */ , int 1, int 0)
call add_item_to_char(var treasure1, int 83 /* borb */ , int 1, int 0)
call add_item_to_char(var treasure1, int 85 /* moneybag */ , int 6554113, int 0)
._SCRIPT_8
var index = int 0
while(@david[var VAR_18])
{
@arr[var index]= var VAR_37
@arr_2[var index]= var VAR_37
var index ++
}
._SCRIPT_9
var index = int 0
while(@david[var index])
{
var VAR_16 = @david[var index]
execute SCRIPT_10
@arr[var index]= var VAR_15
var index ++
}
execute SCRIPT_12
if(var VAR_17 == int -1)
{
if(gamevar CLICKED_DOOR != int -1)
{
execute SCRIPT_11
}
}
._SCRIPT_10
if(call ! func_12b(var VAR_16, var &VAR_19))
{
var VAR_15 = int 0
exit_script
}
if(call ! func_12b(var VAR_16, var &VAR_20))
{
var VAR_15 = int 1
exit_script
}
call log_var(var VAR_15)
var VAR_15 = int 2
._SCRIPT_11
var index = int 0
while(@david[var index])
{
if(@arr[var index] == @arr_1[gamevar CLICKED_DOOR])
{
var VAR_17 = @arr[var index]
}
var index ++
}
._SCRIPT_12
var VAR_17 = int -1
var index = int 0
while(@david[var index])
{
if(@arr[var index] != @arr_2[var index])
{
var VAR_17 = @arr[var index]
@arr_2[var index]= @arr[var index]
}
var index ++
}
._SCRIPT_13
._SCRIPT_14
._SCRIPT_15
call log_string("WANDERING BADDIES")
call load_char("plguemen")
call run_wandering_generator(var &wandering_gen_script, int 70)
._SCRIPT_16
if(gamevar script_time > var VAR_3)
{
var VAR_3 = gamevar script_time + int 80 + call randomize_int(int 0, int 60)
var VAR_2 = int 2 + call randomize_int(int 0, int 6)
call play_loaded_sound(var VAR_2, int 0, int 12, int 0)
}