/
18_Abandoned_Outpost.cfg
656 lines (605 loc) · 21.1 KB
/
18_Abandoned_Outpost.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
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
#textdomain wesnoth-sota
# Liches are now available to the player. All the stored units from the DA line need to
# have that option added to their unit trees. Since all dark sorcerers have been leveling
# into necromancers until this point, a menu option is included to turn them into liches
# too.
# The spiders nearest to the player start with no movement points, and get one added
# each turn for the first few turns. That keeps the spiders from swarming the player
# immediately, and lets the battle happen in the middle of the map. For difficulty
# levels other than hard, a few changes are made to the map that make the scenario
# a bit easier.
# The spiderweb terrain can be applied anywhere, but will be invisible if it is not used
# with specific shapes of corners or chasms. This limited the amount of artwork needed.
[scenario]
name= _ "Abandoned Outpost"
map_data="{campaigns/Secrets_of_the_Ancients/maps/18_Abandoned_Outpost.map}"
id=18_Abandoned_Outpost
next_scenario=19_Lava_and_Stone
victory_when_enemies_defeated=no
[story]
[part]
[background_layer]
image=story/book.png
scale=no
[/background_layer]
story= _ "9 VI, 23 YW
To become a lich, one must first die. The spells of necromancy bind the spirit, but only once it has been unbound from the body. To become a lich, the mage must make the necessary incantations with his dying breaths. He thus binds his own spirit in much the same way he binds the spirits of others.... An altar serves to hold his soul in the physical plane long enough to make the transition, and a suitable object must be found to hold the consciousness for one crucial moment when the body expires."
[/part]
[part]
[background_layer]
image=portraits/undead/lich.png
scale=no
[/background_layer]
story= _ "13 VI, 23 YW
So, Ras-Tabahn is now undead. In the beginning, his health was not much improved, and he complained of being cold. His life force was weak, but he was able to absorb life from the rats infesting the ancient castle. Now he is more strong and vigorous than I have ever seen him. This is despite the fact that his flesh is starting to rot away, a process that causes him no discomfort. Nor can he smell it any more than I can. If all continues to go well, I will make the transition soon myself."
[/part]
[part]
[background_layer]
image=portraits/ardonna-lich.png
scale=no
[/background_layer]
story= _ "17 VI, 23 YW
Now the process is complete for both of us. I posted a guard so nothing could happen to me in my weakened state, and nothing did. I am restored. I don’t feel much different, but I suppose I look a fright. Ah well, it can’t be helped. But my primary goal is achieved! I cannot die! I suppose I could be broken apart like a skeleton or maybe burned, but I do not have to fear these unlikely events: I have the awesome powers of the spirit realm flowing through me, and can protect myself quite adequately! My next goal is to share my knowledge with the world so that <i>no one</i> need die."
[/part]
[/story]
{UNDERGROUND}
{DEFAULT_MUSIC_PLAYLIST}
{TURNS 32 29 25}
[side]
{SIDE_1_BOTH}
{GOLD 230 190 110}
shroud=yes
[/side]
[side]
side=2
controller=ai
user_team_name= _ "Spiders"
team_name=bad
no_leader=yes
gold=0
hidden=yes
[/side]
# *************************** PRESTART ***************************
[event]
name=prestart
[objectives]
side=1
[objective]
description= _ "Move Ardryn-Na and Ras-Tabahn to the west end of the cave"
condition=win
[/objective]
{ALTERNATIVE_OBJECTIVE ( _ "Kill every enemy unit")}
{HOW_TO_LOSE_WITH_BOTH}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
# There is now a menu option to turn necromancers into liches.
[set_menu_item]
id=lichify
description= _ "Make into a lich."
image=units/icons/icon-lich.png
[show_if]
[have_unit]
x=$x1
y=$y1
side=1
type=Necromancer, Necromancer SotA
[/have_unit]
[/show_if]
[command]
[if]
[have_location]
x=$x1
y=$y1
terrain=C*^*,K*^*,*^K*,*^C* # castles and keeps
[/have_location]
[then]
[fire_event]
name=lichify # See: sota-utils.cfg
[primary_unit]
x=$x1
y=$y1
[/primary_unit]
[/fire_event]
[/then]
[else]
[message]
speaker=narrator
image=logo.png
message= _ "You can only do this in a castle."
[/message]
[/else]
[/if]
[/command]
[/set_menu_item]
# From now on, newly recruited DAs need to be able to eventually advance to
# liches like normal. We will stop using the custom units in the recruit list.
[disallow_recruit]
side=1
type=Dark Adept SotA
[/disallow_recruit]
[allow_recruit]
side=1
type=Dark Adept
[/allow_recruit]
# This section changes all *existing* units so that they have liches in their
# advancement trees. As of 1.12 at least, [modify_unit] doesn't apply to
# the recall list, so we have to do it the long way.
[store_unit]
[filter]
type=Dark Adept SotA, Dark Sorcerer SotA
[/filter]
variable=DA # Even though it might actually be a DS.
[/store_unit]
[for]
array=DA
variable=i
[do]
[if]
[variable]
name=DA[$i].type
equals=Dark Adept SotA
[/variable]
[then]
[set_variable]
# Custom DA's will advance to normal dark sorcerers
# which will fix them.
name=DA[$i].advances_to
value=Dark Sorcerer
[/set_variable]
[/then]
[else]
[set_variable]
# Custom DS's just get the other advancement added.
name=DA[$i].advances_to
value=Necromancer,Lich
[/set_variable]
[/else]
[/if]
[unstore_unit]
variable=DA[$i]
[/unstore_unit]
[/do]
[/for]
[clear_variable]
name=DA
[/clear_variable]
# We need to change all existing bats to normal types instead of SotA types
# so they are drawn above terrains. SotA bats were necessary for the ship
# where they were drawn behind the rigging, but for the spiderwebs in this
# scenario, normal bats look a lot better. First, we'll make sure newly
# recruited ones will be correct:
[disallow_recruit]
side=1
type=Vampire Bat SotA
[/disallow_recruit]
[allow_recruit]
side=1
type=Vampire Bat
[/allow_recruit]
# Now, all the bats on the recall list get copied, except for the type.
[store_unit]
[filter]
type=Vampire Bat SotA, Blood Bat SotA, Dread Bat SotA
[/filter]
variable=bats
kill=yes
[/store_unit]
[for]
array=bats
variable=i
[do]
# Get the new type:
[switch]
variable=bats[$i].type
[case]
value=Vampire Bat SotA
[set_variable]
name=new_type
value=Vampire Bat
[/set_variable]
[/case]
[case]
value=Blood Bat SotA
[set_variable]
name=new_type
value=Blood Bat
[/set_variable]
[/case]
[case]
value=Dread Bat SotA
[set_variable]
name=new_type
value=Dread Bat
[/set_variable]
[/case]
[/switch]
# Create a new bat with the same attributes as the old one:
[unit]
type=$new_type
max_experience=$bats[$i].max_experience
max_hitpoints=$bats[$i].max_hitpoints
experience=$bats[$i].experience
name=$bats[$i].name
id=$bats[$i].id
side=1
placement=recall # The only place they can be at the moment.
[modifications]
[insert_tag]
name=trait
variable=bats[$i].modifications.trait[0]
[/insert_tag]
[insert_tag]
name=trait
variable=bats[$i].modifications.trait[1]
[/insert_tag]
[/modifications]
[/unit]
[/do]
[/for]
[clear_variable]
name=bats, new_type
[/clear_variable]
#ifndef HARD
[terrain]
x,y=28,7
terrain=Xu
[/terrain]
[terrain]
x=25
y=10-11
terrain=Rb
[/terrain]
[terrain]
x,y=32,7
terrain=Qxu
[/terrain]
#endif
# The value of spider_number is *not* the number of spiders, but this variable does
# help determine how many spiders get placed. See the repeats below.
#ifdef EASY
[set_variable]
name=spider_number
value=4
[/set_variable]
#endif
#ifdef NORMAL
[set_variable]
name=spider_number
value=5
[/set_variable]
#endif
#ifdef HARD
[set_variable]
name=spider_number
value=6
[/set_variable]
#endif
[repeat]
times="$($spider_number+5)"
[do]
[unit]
x,y=23,7
type=Giant Spider
side=2
placement=map_passable
[/unit]
[/do]
[/repeat]
[repeat]
times=5
[do]
[unit]
x,y=9,8
type=Giant Spider
side=2
placement=map_passable
ai_special=guardian
[/unit]
[/do]
[/repeat]
[repeat]
times=$spider_number
[do]
[unit]
x,y=9,10
type=Giant Spider
side=2
placement=map_passable
ai_special=guardian
[/unit]
[/do]
[/repeat]
[clear_variable]
name=spider_number
[/clear_variable]
# We aren't using the normal macro for the following recalls because it
# doesn't specify locations, and that's important this time.
[recall]
id=Ras-Tabahn
x,y=44,11
[/recall]
[recall]
id=Carcyn
x,y=44,11
[/recall]
[recall]
id=Shynal
x,y=44,11
[/recall]
[recall]
id=Bone Captain
x,y=39,9
[/recall]
[recall]
id=Vendraxis
x,y=39,10
[/recall]
# This map is just a larger version of the previous one, and that one had
# a lot of its shroud removed. These tags cause the same hexes to be revealed
# on this map as well.
[remove_shroud]
x,y=51,4
radius=3
[/remove_shroud]
[remove_shroud]
x,y=48,6
radius=4
[/remove_shroud]
[remove_shroud]
x,y=45,8
radius=5
[/remove_shroud]
[remove_shroud]
x,y=44,4
radius=2
[/remove_shroud]
# The experience of either leader could be enough to level it into an ancient
# lich, but that won't happen automatically. Unstoring a unit *does* cause it
# to advance though, so we will store and unstore them both just in case.
[store_unit]
[filter]
canrecruit=yes
[/filter]
variable=leaders
[/store_unit]
[unstore_unit]
variable=leaders[0]
[/unstore_unit]
[unstore_unit]
variable=leaders[1]
[/unstore_unit]
[fire_event]
name=ardonna_profile
[/fire_event]
[clear_variable]
name=leaders
[/clear_variable]
# This image is colored so that it looks the same as the one in the previous
# scenario *after* the adjustment for underground light levels. The previous
# one was a unit so it wasn't adjusted.
[item]
image=items/altar-sacrifice.png
x,y=45,7
[/item]
[item]
image=items/altar-sacrifice-shadow.png
x,y=44,7
[/item]
[/event]
# *************************** PLAY ***************************
# The closest group of spiders can't be allowed to move the full amount during the first
# turns, or they would immediately block the tunnel and make the scenario boring. We
# need to increase their movement gradually, so we will make their movement points be
# one less than the turn number. We change their movement points with an object instead
# of [modify_unit] so the correct distance they can move will be visible to the player.
#define CHANGE_SPIDER_MOVES MOVES
[store_unit]
[filter]
# The far group of spiders won't move because they are guardians.
# So, store only the closest group:
x=20-40
side=2
[/filter]
variable=spiders
[/store_unit]
[for]
array=spiders
variable=i
[do]
[object]
[filter]
id=$spiders[$i].id
[/filter]
[effect]
apply_to=movement
set={MOVES}
[/effect]
silent=yes
duration=turn
[/object]
[/do]
[/for]
[clear_variable]
name=spiders
[/clear_variable]
#enddef
# This event needs to happen on the refresh for *both* sides so the player can see
# the results during their turn. This event will be removed at a later turn.
[event]
name=side 1 turn refresh,side 2 turn refresh
first_time_only=no
id=spider_move_restrictions
{CHANGE_SPIDER_MOVES ("$($turn_number - 1)")}
[/event]
[event]
name=side 1 turn 5
[event]
id=spider_move_restrictions
remove=yes
[/event]
{CHANGE_SPIDER_MOVES 6}
[/event]
# This moves one leader out of the cave. If it's the first one, they get
# refreshed and stored. If it's the second one, the scenario ends.
[event]
name=moveto
first_time_only=no
[filter]
id=Ardonna
x,y=1,10
[or]
id=Ras-Tabahn
x,y=1,10
[/or]
[/filter]
[if]
[variable]
name=leader_gone.length
equals=1
[/variable]
[then]
[hide_unit]
canrecruit=yes
[/hide_unit]
[fire_event]
name=end_scenario
[/fire_event]
[/then]
[else]
[heal_unit]
[filter]
side=1
[/filter]
amount=full
restore_statuses=yes
[/heal_unit]
[store_unit]
[filter]
x,y=1,10
[/filter]
variable=leader_gone
kill=yes
[/store_unit]
# The [set_variables] are to refresh this leader since they won't
# be on the map at the end to be refreshed automatically.
[set_variables]
name=leader_gone
mode=merge
[value]
x=recall
y=recall
[/value]
[/set_variables]
# The leader can't be unstored to the recall list yet, or the
# other leader would be able to recall them. We'll do it just
# before [endlevel].
[/else]
[/if]
[/event]
# *************************** ENDING / OPENING ***************************
[event]
name=start
[message]
speaker=narrator
image=portraits/undead/lich.png~SCALE(93, 93)
message= _ "You can now advance dark sorcerers to liches! You can also right-click on an existing necromancer to turn it into a lich as long as it is in a castle."
[/message]
[message]
speaker=Ardonna
message= _ "We have conquered death! Let us bring the news back to Wesnoth. We should to let them know that nobody ever need die again."
[/message]
[message]
speaker=Ras-Tabahn
message= _ "I was planning to go that direction myself, so I have no objection. But, let us not go over those wretched mountain passes again. These tunnels should connect to the realm of Knalga and take us there directly."
[/message]
[message]
speaker=Ardonna
message= _ "Why would the Dwarvish empire abandon an outpost like this?"
[/message]
[message]
speaker=Ras-Tabahn
message= _ "We may find out. We should proceed cautiously."
[/message]
[/event]
[event]
name=sighted
[filter]
side=2
[/filter]
[if]
[have_unit]
id=Vendraxis
[/have_unit]
[then]
[message]
speaker=Vendraxis
message= _ "Giant spidersss! That explainsss the cobwebsss everywhere." #no spellcheck
[/message]
[/then]
[else]
[message]
speaker=Ardonna
message= _ "Giant spiders! That explains the cobwebs everywhere."
[/message]
[/else]
[/if]
[message]
speaker=Ardonna
message= _ "They are not moving much. Hopefully they continue to stay sleepy."
[/message]
[event]
name=side 2 turn 3
[message]
speaker=Shynal
message= _ "They’re waking up now. Watch out."
[/message]
[/event]
[/event]
[event]
name=die
first_time_only=no
[if]
[not]
[have_unit]
side=2
[/have_unit]
[/not]
[then]
[fire_event]
name=end_scenario
[/fire_event]
[/then]
[/if]
[/event]
[event]
name=end_scenario
# If one of the leaders left the map and is stored, bring it back now:
[if]
[variable]
name=leader_gone.length
equals=1
[/variable]
[then]
[unstore_unit]
variable=leader_gone
[/unstore_unit]
[clear_variable]
name=leader_gone
[/clear_variable]
[/then]
[/if]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]
{TURN_INTO_A_LICH}
{HERO_DEATHS}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
#undef CHANGE_SPIDER_MOVES
[/scenario]