-
-
Notifications
You must be signed in to change notification settings - Fork 994
/
09_A_Small_Favor3.cfg
514 lines (442 loc) · 12.8 KB
/
09_A_Small_Favor3.cfg
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
#textdomain wesnoth-did
[scenario]
id=09_A_Small_Favor3
name=_ "A Small Favor — Part 3"
map_data="{campaigns/Descent_Into_Darkness/maps/09_A_Small_Favor3.map}"
{TURNS 30 27 25}
next_scenario=10_Alone_at_Last
victory_when_enemies_defeated=no
{UNDERGROUND}
{SCENARIO_MUSIC underground.ogg}
{EXTRA_SCENARIO_MUSIC loyalists.ogg}
{EXTRA_SCENARIO_MUSIC suspense.ogg}
# no story -- this occurs immediately after the previous scenario
[side]
side=1
controller=human
team_name=intruders
user_team_name=_"Intruders"
type=Apprentice Mage
id=Malin Keshar
name=_ "Malin Keshar"
profile=portraits/malin_old.png
unrenamable=yes
canrecruit=yes
gold=0
income=-2
shroud=yes
share_maps=yes
{FLAG_VARIANT undead}
[/side]
[side]
# Mages
side=2
controller=ai
team_name=defenders
user_team_name=_"Defenders"
no_leader=yes
# Mages in rooms
{NAMED_NOTRAIT_UNIT () Mage 16 15 () (_"Guardian")} {GUARDIAN}
{NAMED_NOTRAIT_UNIT () Mage 18 15 () (_"Guardian")} {GUARDIAN}
{NAMED_NOTRAIT_UNIT () Mage 22 13 () (_"Guardian")} {GUARDIAN}
{NAMED_NOTRAIT_UNIT () Mage 24 12 () (_"Guardian")} {GUARDIAN}
{NAMED_NOTRAIT_UNIT () Mage 27 10 () (_"Guardian")} {GUARDIAN}
{NAMED_NOTRAIT_UNIT () Mage 29 10 () (_"Guardian")} {GUARDIAN}
# Mages in great hall
{NAMED_NOTRAIT_UNIT () (Silver Mage) 13 8 ("") (_"Guardian")} {GUARDIAN}
{NAMED_NOTRAIT_UNIT () (Red Mage) 14 9 ("") (_"Guardian")} {GUARDIAN}
{NAMED_NOTRAIT_UNIT () (White Mage) 16 8 ("") (_"Guardian")} {GUARDIAN}
[ai]
village_value=0
aggression=0.8
[/ai]
[/side]
[side]
side=3
controller=ai
team_name=intruders
user_team_name=_"Intruders"
no_leader=yes
shroud=yes
fog=no
share_maps=no
[ai]
village_value=0
aggression=0.8
[goal]
name=protect_unit
[criteria]
side=3
canrecruit=yes
[/criteria]
value=5
[/goal]
[goal]
name=protect_unit
[criteria]
id=Darken Volk
[/criteria]
protect_radius=6
value=20
[/goal]
[/ai]
[/side]
# This macro places the doors and adds the door-opening event
{MANOR_DOORS 1,3}
#TODO: Create some scenery (fire, torches, ...)
{PLACE_IMAGE items/book5.png 11 7}
[event]
name=prestart
[objectives]
side=1
[objective]
condition=win
description=_ "Find the book"
[/objective]
[objective]
condition=lose
description=_ "Death of Malin Keshar"
[/objective]
[objective]
condition=lose
description=_ "Death of Darken Volk"
[/objective]
{TURNS_RUN_OUT}
[/objectives]
# Scatter manor guards
{SCATTER_UNITS 6 Pikeman,Duelist,Pikeman,Spearman,Pikeman,Swordsman 3 (
terrain=Rr
[not]
x,y=25,18
radius=4
[/not]
[not]
x,y=31,15
radius=2
[/not]
[not]
x,y=11,7
[/not]
[not]
[filter]
[/filter]
[/not]
) (
side=2
name= _ "Guard"
random_traits=yes
)}
# Who has the book?
{VARIABLE hasBook none}
# Switch Volk's side
[recall]
id=Darken Volk
x,y=26,16
[/recall]
[store_unit]
[filter]
id=Darken Volk
[/filter]
kill=yes
variable=stored_Darken
[/store_unit]
{VARIABLE stored_Darken.side 3}
{VARIABLE stored_Darken.canrecruit yes}
{CLEAR_VARIABLE stored_Darken.ellipse}
[unstore_unit]
variable=stored_Darken
[/unstore_unit]
{CLEAR_VARIABLE stored_Darken}
[/event]
[event]
name=start
[store_unit]
[filter]
[filter_wml]
[variables]
got_inside_manor=yes
[/variables]
[/filter_wml]
[/filter]
kill=yes
variable=units_inside_manor
[/store_unit]
{FOREACH units_inside_manor i}
{VARIABLE units_inside_manor[$i].upkeep loyal}
[unstore_unit]
variable=units_inside_manor[$i]
find_vacant=no
[/unstore_unit]
[recall]
id=$units_inside_manor[$i].id
[/recall]
{NEXT i}
{CLEAR_VARIABLE units_inside_manor}
# Create DV's units
{GENERIC_UNIT 3 (Revenant) 26 16}
[+unit]
animate=yes
[/unit]
{GENERIC_UNIT 3 (Spectre) 26 16}
[+unit]
animate=yes
[/unit]
{GENERIC_UNIT 3 (Deathblade) 26 16}
[+unit]
animate=yes
[/unit]
{GENERIC_UNIT 3 (Necrophage) 26 16}
[+unit]
animate=yes
[/unit]
{GENERIC_UNIT 3 (Banebow) 26 16}
[+unit]
animate=yes
[/unit]
{GENERIC_UNIT 3 (Nightgaunt) 26 16}
[+unit]
animate=yes
[/unit]
[message]
speaker=Malin Keshar
message=_ "I feel the book is very close, somewhere to the northwest."
[/message]
[/event]
[event]
name=turn refresh
first_time_only=no
[filter_condition]
[variable]
name=side_number
equals=3
[/variable]
[/filter_condition]
[store_unit]
[filter]
id=Darken Volk
[/filter]
variable=stored_Darken
[/store_unit]
[if]
[variable]
name=hasBook
equals=none
[/variable]
[then]
[if]
[variable]
name=turn_number
greater_than=3
[/variable]
[then]
{VARIABLE dest.x 11}
{VARIABLE dest.y 7}
[/then]
[else]
{VARIABLE dest.x 16}
{VARIABLE dest.y 14}
[/else]
[/if]
[/then]
[else]
{VARIABLE dest.x 31}
{VARIABLE dest.y 1}
[/else]
[/if]
[find_path]
[traveler]
id=Darken Volk
[/traveler]
[destination]
x=$dest.x
y=$dest.y
[/destination]
variable=darken_goto
allow_multiple_turns=yes
[/find_path]
[if]
[variable]
name=darken_goto.step.length
greater_than=0
[/variable]
[then]
{VARIABLE index "$(min($stored_Darken.max_moves,$darken_goto.step.length-1))"}
{VARIABLE stored_Darken.goto_x $darken_goto.step[$index].x}
{VARIABLE stored_Darken.goto_y $darken_goto.step[$index].y}
[/then]
[else]
{VARIABLE stored_Darken.goto_x $dest.x}
{VARIABLE stored_Darken.goto_y $dest.y}
[/else]
[/if]
[unstore_unit]
variable=stored_Darken
[/unstore_unit]
{CLEAR_VARIABLE stored_Darken,dest,darken_goto,index}
[/event]
[event]
# Malin gets the book
name=moveto
[filter]
id=Malin Keshar
x,y=11,7
[/filter]
[filter_condition]
[variable]
name=hasBook
equals=none
[/variable]
[/filter_condition]
{VARIABLE hasBook Malin}
[message]
speaker=Malin Keshar
message=_ "We’ve got the book, but now how do we get out of here?"
[/message]
[message]
speaker=Darken Volk
message=_ "There’s a small tunnel in the cellar to the northeast. It will lead us far enough out of the city that we can escape pursuit."
[/message]
[remove_item]
x,y=11,7
[/remove_item]
[objectives]
side=1
[objective]
condition=win
description=_ "Escape via the tunnel in the northeast cellar"
[/objective]
[objective]
condition=lose
description=_ "Death of Malin Keshar"
[/objective]
[objective]
condition=lose
description=_ "Death of Darken Volk"
[/objective]
{TURNS_RUN_OUT}
[/objectives]
[event]
name=moveto
[filter]
id=Malin Keshar
x,y=30-31,1
[/filter]
[message]
speaker=Malin Keshar
message=_ "Phew! Let’s get out of here."
[/message]
[endlevel]
result=victory
bonus=no
{NEW_GOLD_CARRYOVER 100}
carryover_report=no
[/endlevel]
[/event]
[/event]
[event]
# DV gets the book
name=moveto
[filter]
id=Darken Volk
x,y=11,7
[/filter]
[filter_condition]
[variable]
name=hasBook
equals=none
[/variable]
[/filter_condition]
{VARIABLE hasBook Darken}
[remove_item]
x,y=11,7
[/remove_item]
[objectives]
side=1
[objective]
condition=win
description=_ "Escape the manor"
[/objective]
[objective]
condition=lose
description=_ "Death of Malin Keshar"
[/objective]
[objective]
condition=lose
description=_ "Death of Darken Volk"
[/objective]
{TURNS_RUN_OUT}
[/objectives]
[event]
name=moveto
[filter]
id=Darken Volk
side=3
[/filter]
[message]
speaker=Malin Keshar
message=_ "We’ve got the book, but now how do we get out of here?"
[/message]
[scroll_to_unit]
id=Darken Volk
[/scroll_to_unit]
[message]
speaker=Malin Keshar
message=_ "Wait, you aren’t leaving me behind, are you?"
[/message]
[/event]
[event]
name=moveto
[filter]
id=Darken Volk
x,y=30-31,1
[/filter]
[message]
speaker=Darken Volk
message=_ "You have served me well, my apprentice."
[/message]
[message]
speaker=narrator
message=_ "As he heads into the tunnel Darken Volk collapses its entrance, leaving Malin to be captured and executed by the city guards."
image=wesnoth-icon.png
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
[event]
name=moveto
[filter]
id=Malin Keshar
x,y=30-31,1
[/filter]
[message]
speaker=Malin Keshar
message=_ "Phew! Let’s get out of here."
[/message]
[endlevel]
result=victory
bonus=no
{NEW_GOLD_CARRYOVER 100}
carryover_report=no
[/endlevel]
[/event]
[/event]
# Defeat Conditions
{MALIN_DEATH}
{VOLK_DEATH2}
[event]
name=time over
[message]
speaker=narrator
message=_ "As dawn breaks, the city guards force their way into the manor and capture the two necromancers."
image=wesnoth-icon.png
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
[event]
name=victory
{MODIFY_UNIT (id=Darken Volk) side 1}
[/event]
[/scenario]