-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
16_The_Mage.cfg
527 lines (484 loc) · 14.8 KB
/
16_The_Mage.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
#textdomain wesnoth-sota
# Two events in the "play" section are to remove four HP from Ras-Tabahn each turn. (He
# is suffering from tuberculosis.) There are some mages who put holy water around
# Crelanu. The water destroys undead, but can be removed by living units. It is there
# to prevent easy assassination of Crelanu with a few specters.
# This is slightly hackish since the closer contains VAR_NAME...
# wmlindent: opener "{NEAREST_HEX "
# wmlindent: closer "location}"
[scenario]
name= _ "The Mage"
map_data="{campaigns/Secrets_of_the_Ancients/maps/16_The_Mage.map}"
id=16_The_Mage
next_scenario=17_Mortality
victory_when_enemies_defeated=no
[story]
[part]
[background_layer]
image=story/mountain-pass.jpg
scale=no
[/background_layer]
story= _ "3 VI, 23 YW
We crossed the high plateaus, and forded the Arkan-thoria. Then we headed up into the mountains again before we found the mage. This was Ras-Tabahn’s plan, and with the goal in sight, he gained a little strength. However, he is quite weak and ill now, and breathing raggedly. I don’t know how much longer he can survive."
[/part]
{JOURNEY_PART 16}
[/story]
{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}
{TURNS 22 22 22}
[side]
{SIDE_1_BOTH}
{GOLD 150 120 100}
# There is only a little bit shrouded in this scenario (in the cave), but
# we still need this:
shroud=yes
[/side]
[side]
side=2
type=Elder Mage
controller=ai
user_team_name= _ "Crelanu"
id=Crelanu
profile=portraits/crelanu.png
name= _ "Crelanu"
team_name=bad
recruit=Red Mage,White Mage,Mage
{GOLD 140 200 230}
{INCOME 15 22 30}
color=green # To match his color in LoW
{FLAG_VARIANT loyalist}
[/side]
{STARTING_VILLAGES 1 6}
{STARTING_VILLAGES 2 6}
# *************************** PRESTART ***************************
[event]
name=prestart
[objectives]
side=1
[objective]
description= _ "Defeat Crelanu"
condition=win
[/objective]
{HOW_TO_LOSE_WITH_BOTH}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[note]
description= _ "Ras-Tabahn is slowed and will lose four hitpoints every turn. He will die if he reaches zero."
[/note]
[note]
description= _ "Moving any unit onto a bottle of holy water will remove the bottle. An undead unit will be destroyed."
[/note]
[/objectives]
[remove_shroud]
side=1
[/remove_shroud]
# For the cave:
[place_shroud]
side=1
x=0-3
y=24
[/place_shroud]
{RECALL_LOYAL_UNITS}
[store_unit]
[filter]
id=Ras-Tabahn
[/filter]
variable=rastabahn_stored
[/store_unit]
[set_variables]
name=rastabahn_stored.status
mode=merge
[value]
slowed=yes
[/value]
[/set_variables]
[unstore_unit]
variable=rastabahn_stored
[/unstore_unit]
[/event]
# *************************** PLAY ***************************
# This gives side 2 level-3 units, but gives us control over when they appear.
# Their appearance doesn't depend on side 2 saving gold for them either.
[event]
name=side 2 turn 1 refresh, side 2 turn 5 refresh
first_time_only=no
# He's not paying for these, but hopefully no one will notice!
[unit]
type=Arch Mage
side=2
x,y=20,7 # Otherwise, the first one goes for a village.
moves=0 # Pretending it was just recruited.
[/unit]
[/event]
# The next two events take four HP from Ras-Tabahn. If his HP is very low, he needs
# to receive any healing (from villages or resting) *first*, or he will die. On the
# other hand, if he has a lot of HP, and he is healed first, he will not receive
# the full benefit. That is why we need two events. We will also be slowing him at
# this time.
[event]
name=side 1 turn
first_time_only=no
[store_unit]
[filter]
id=Ras-Tabahn
[/filter]
variable=rastabahn_stored
[/store_unit]
[set_variable]
name=rastabahn_harmed
value=no
[/set_variable]
[if]
[variable]
name=rastabahn_stored.hitpoints
greater_than=4
[/variable]
[then]
[harm_unit]
[filter]
id=Ras-Tabahn
[/filter]
amount=4
fire_event=yes
[/harm_unit]
[set_variable]
name=rastabahn_harmed
value=yes
[/set_variable]
[/then]
# [else] This will happen in the next event, *after* the refresh.
[/if]
[/event]
[event]
name=side 1 turn refresh
first_time_only=no
[store_unit]
[filter]
id=Ras-Tabahn
[/filter]
variable=rastabahn_stored
[/store_unit]
[set_variables]
name=rastabahn_stored.status
mode=merge
[value]
slowed=yes
[/value]
[/set_variables]
[unstore_unit]
variable=rastabahn_stored
[/unstore_unit]
[if]
[variable]
name=rastabahn_harmed
boolean_not_equals=yes
[/variable]
[then]
[harm_unit]
[filter]
id=Ras-Tabahn
[/filter]
amount=4
fire_event=yes
[/harm_unit]
[/then]
[/if]
[/event]
# The next two events control the holy water.
[event]
name=recruit, recall
[filter]
race=undead
[/filter]
[unit]
x,y=21,7
type=White Mage
name= _ "Ginmera"
id=Ginmera
side=2
[modifications]
{TRAIT_RESILIENT}
{TRAIT_INTELLIGENT}
[/modifications]
[/unit]
#define PLACE_HOLY_WATER X Y
[item]
x={X}
y={Y}
image=items/holy-water.png
[/item]
#enddef
{PLACE_HOLY_WATER 20 6}
{PLACE_HOLY_WATER 20 5}
{PLACE_HOLY_WATER 21 5}
{PLACE_HOLY_WATER 22 5}
{PLACE_HOLY_WATER 22 6}
#undef PLACE_HOLY_WATER
[store_items]
variable=holy_waters
[/store_items]
[message]
speaker=Ginmera
message= _ "It seems that the invaders can raise undead soldiers, so I placed some holy water around the castle for protection."
[/message]
[unit]
x,y=21,5
type=White Mage
name= _ "Rinconan"
id=Rinconan
side=2
[modifications]
{TRAIT_RESILIENT}
{TRAIT_STRONG}
[/modifications]
[/unit]
{FREEZE_UNIT Rinconan}
{FREEZE_UNIT Ginmera}
[message]
speaker=Ginmera
message= _ "Rinconan and I will stay here to guard you."
[/message]
[message]
speaker=Crelanu
message= _ "Yes. Thank you Ginmera."
[/message]
[message]
speaker=narrator
image=logo.png
message= _ "Moving a unit onto a bottle of holy water will remove the bottle. A living unit can do this safely, but any undead unit will be destroyed."
[/message]
[/event]
[event]
name=moveto
first_time_only=no
[filter]
side=1
[filter_location]
find_in=holy_waters
[/filter_location]
[/filter]
[if]
[have_unit]
x,y=$x1,$y1
[and]
race=undead
[/and]
[/have_unit]
[then]
[kill]
x,y=$x1,$y1
animate=yes
fire_event=yes
[/kill]
[/then]
[/if]
[remove_item]
x,y=$x1,$y1
[/remove_item]
[store_items]
variable=holy_waters
[/store_items]
[/event]
[event]
name=moveto
[filter]
id=Crelanu
[/filter]
{THAW_UNIT Ginmera}
{THAW_UNIT Rinconan}
[/event]
# *************************** ENDING / OPENING ***************************
[event]
name=start
[message]
speaker=Ras-Tabahn
message= _ "Crelanu! (<i>Cough, cough</i>) We have come... for your book."
[/message]
[message]
speaker=Ardonna
message= _ "We need to borrow it."
[/message]
[message]
speaker=Crelanu
message= _ "Yes, I knew people like you would be coming, but the book is out of reach now — for all of us. I have given it to the elves. Only they know where it is."
[/message]
[message]
speaker=Ardonna
message= _ "Why would you do such a thing?"
[/message]
[message]
speaker=Crelanu
message= _ "So that one like you would not be tempted to do what you intend. Oh, yes. I know well what you seek."
[/message]
[message]
speaker=Ardonna
message= _ "Then you can tell us what we want to know."
[/message]
[message]
speaker=Crelanu
message= _ "I shall not."
[/message]
[message]
speaker=Ras-Tabahn
message= _ "We shall see."
[/message]
[message]
speaker=narrator
image=logo.png
message= _ "Ras-Tabahn is sick. He is slowed, and will lose four hitpoints every turn. He will die if he reaches zero."
[/message]
[/event]
[event]
name=last breath
[filter]
id=Crelanu
[/filter]
# Bring Crelanu back to life, barely:
[store_unit]
[filter]
id=Crelanu
[/filter]
variable=crelanu_stored
kill=yes
[/store_unit]
[set_variable]
name=crelanu_stored.hitpoints
value=1
[/set_variable]
[unstore_unit]
variable=crelanu_stored
[/unstore_unit]
[message]
speaker=Ardonna
message= _ "Now, you will tell us the secret of immortality or die!"
[/message]
[message]
speaker=Crelanu
message= _ "There <i>is no secret</i>, you fools! Magic cannot stop aging. You cannot live forever. It is the way of nature, and the greatest thing we have in common with all of creation. You <i>must</i> die, and your soul depart. I would not try this thing for any reason."
[/message]
[message]
speaker=Ardonna
message= _ "You are the fool, for you have, indeed, told us all we required. For that, I will spare you to live a few more lonely years with your cowardice."
[/message]
[teleport]
[filter]
side=1
canrecruit=yes
[/filter]
x,y=6,21
animate=no
[/teleport]
[message]
speaker=Ras-Tabahn
message= _ "I don’t understand. What did Crelanu tell us?"
[/message]
[message]
speaker=Ardonna
message= _ "I will explain. Let us get you somewhere safe first. We’ll go into the cave. Come with me."
[/message]
[move_unit]
id=Ardonna
to_x=1
to_y=24
[/move_unit]
[hide_unit]
id=Ardonna
[/hide_unit]
# Move Ardonna out of the way so that Ras-Tabahn can reach this hex too.
[teleport]
[filter]
id=Ardonna
[/filter]
x,y=1,22
animate=no
[/teleport]
[move_unit]
id=Ras-Tabahn
to_x=1
to_y=24
[/move_unit]
# Since no side-1 units should be around to see what Crelanu does next,
# we'll hide everyone.
[hide_unit]
side=1
[/hide_unit]
# Crelanu moves to his keep to recruit a gryphon.
[move_unit]
id=Crelanu
to_x=21
to_y=6
[/move_unit]
[store_unit]
[filter]
id=Crelanu
[/filter]
variable=crelanu_stored
[/store_unit]
# We'd prefer the gryphon to be recruited in a castle hex, so we'll try to
# find an empty one.
{NEAREST_HEX 21 6 3 (terrain=C*
[not]
[filter]
[/filter]
[/not])
location}
[if]
[variable]
name=location.length
greater_than=0
[/variable]
[then]
[unit]
type=Gryphon
side=2
x=$location.x
y=$location.y
animate=yes
id=messenger
[/unit]
[/then]
[else]
[unit]
type=Gryphon
side=2
placement=leader
animate=yes
id=messenger
[/unit]
[/else]
[/if]
[move_unit]
id=messenger
to_x=16
to_y=24
[/move_unit]
[kill]
id=messenger
[/kill]
[redraw][/redraw]
[clear_variable]
name=rastabahn_stored, rastabahn_harmed, location, holy_waters
[/clear_variable]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]
[event]
# Crelanu should still be there as the scenario ends. The last breath event
# is going to remove him, but we stored him so we can put him back.
name=victory
[unstore_unit]
variable=crelanu_stored
[/unstore_unit]
[clear_variable]
name=crelanu_stored
[/clear_variable]
[/event]
{HERO_DEATHS}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
[/scenario]