-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
20_North_Knalga.cfg
819 lines (756 loc) · 22.2 KB
/
20_North_Knalga.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
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
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
#textdomain wesnoth-sota
# There is a lot of terrain dedicated to this map. There is a twinkling overlay, two
# versions of a stone gate, and a passable hex that looks very small to represent a
# narrow passage. The twinkling overlay is pretty generic, but for the others, no attempt
# has been made to make them work anywhere other than where they are drawn.
[scenario]
name= _ "North Knalga"
map_data="{campaigns/Secrets_of_the_Ancients/maps/20_North_Knalga.map}"
id=20_North_Knalga
next_scenario=21_Against_the_World
[story]
[part]
story= _ "27 VI, 23 YW
We left the fires of the mountain behind and plunged once more into darkness. After a long trek, we were brought up short by a dead end in the tunnel... but the wall was not solid."
[/part]
{JOURNEY_PART 20}
[/story]
{UNDERGROUND}
{DEFAULT_MUSIC_PLAYLIST}
{TURNS 32 31 30}
[side]
{SIDE_1_BOTH}
# The player should have a lot of gold after the last scenario, so:
{GOLD 100 40 20}
shroud=yes
[/side]
[side]
side=2
controller=ai
user_team_name= _ "Dwarves"
team_name=bad
type=Dwarvish Lord
name= _ "Golbanduth"
id=Golbanduth
{GOLD 600 800 1000}
recruit=Dwarvish Fighter, Dwarvish Steelclad, Dwarvish Lord, Dwarvish Thunderguard, Dwarvish Pathfinder, Dwarvish Runesmith
# The castle tiles are connected through two posts (stone walls), but that
# means the AI could recruit on the posts. These two units sit on those
# locations in order to prevent that. In prestart, they will be hidden and
# petrified so they don't affect the gameplay.
[unit]
x,y=18, 26
type=Dummy
[/unit]
[unit]
x,y=22, 26
type=Dummy
[/unit]
{FLAG_VARIANT knalgan}
shroud=yes # This is necessary for some sighted events.
[/side]
{STARTING_VILLAGES 2 10}
{ANIMATED_MAUSOLEUM 33 4}
{ANIMATED_MAUSOLEUM 33 6}
{ANIMATED_MAUSOLEUM 33 8}
# *************************** PRESTART ***************************
[event]
name=prestart
[objectives]
side=1
[objective]
description= _ "Defeat the enemy leader"
condition=win
[/objective]
{HOW_TO_LOSE_WITH_BOTH}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[note]
description= _ "You can recruit from anywhere in the Hall of Heroes."
[/note]
[/objectives]
[hide_unit]
id=Ardonna
[/hide_unit]
[petrify]
type=Dummy
[/petrify]
[hide_unit]
type=Dummy
[/hide_unit]
# Add a few miners to the Crystal Caves for flavor. They will run away as the
# player approaches, but could be used to level up a unit.
[store_locations]
x=3-25
y=1-11
terrain=!,X*
variable=possible_dwarf_locations
[/store_locations]
[repeat]
times=4
[do]
# Choose a location by selecting an array index:
[set_variable]
name=location_index
rand="0..$($possible_dwarf_locations.length-1)"
[/set_variable]
[unit]
type=Dwarvish Miner
x=$possible_dwarf_locations[$location_index].x
y=$possible_dwarf_locations[$location_index].y
side=2
[/unit]
[/do]
[/repeat]
[clear_variable]
name=possible_dwarf_locations, location_index, dwarf_index
[/clear_variable]
# Add one more miner who will have some dialog:
[unit]
type=Dwarvish Miner
placement=map_passable
x,y=25,12
side=2
id=spotter
max_moves=4
[/unit]
# All miners run away from side 1 because they are not soldiers.
[micro_ai]
side=2
action=add
ai_type=coward
distance=4
attack_if_trapped=yes # In case running away doesn't work.
[filter]
type=Dwarvish Miner
[/filter]
[/micro_ai]
# Unit that will go get more gold for the leader.
[unit]
type=Dwarvish Berserker
x,y=19,27
id=porter
side=2
[/unit]
# These two guys shouldn't move until the player has seen them.
{FREEZE_UNIT porter}
{FREEZE_UNIT Golbanduth}
# We want the dwarves to reach the caves ahead of the player's units, but
# player 1 gets a head start. To compensate for that, we will give side 2 an
# initial castle-full of recruits. In effect, side 2 goes first. The player
# doesn't see that because of the shroud, so it doesn't need to be explained.
[repeat]
times=11
[do]
{FIND_CASTLE_HEX 2 location}
[set_variable]
name=dwarf_type
rand=Dwarvish Steelclad, Dwarvish Lord, Dwarvish Thunderguard, Dwarvish Pathfinder, Dwarvish Runesmith
[/set_variable]
[unit]
type=$dwarf_type
side=2
x=$location.x
y=$location.y
[/unit]
[/do]
[/repeat]
[clear_variable]
name=dwarf_type, location
[/clear_variable]
[item]
image=scenery/rune4.png
x,y=32,15
[/item]
# ----- Hall of Heroes -----
[item]
image=items/coffin-dwarf.png~FL()
x,y=36,2
[/item]
[item]
image=items/coffin-dwarf.png
x,y=30,2
[/item]
[item]
image=items/coffin-dwarf.png~FL()
x,y=36,4
[/item]
[item]
image=items/coffin-dwarf.png
x,y=30,4
[/item]
[item]
image=items/coffin-dwarf.png~FL()
x,y=36,6
[/item]
[item]
image=items/coffin-dwarf.png
x,y=30,6
[/item]
[item]
image=items/coffin-dwarf.png~FL()
x,y=36,8
[/item]
[item]
image=items/coffin-dwarf.png
x,y=30,8
[/item]
# These images are statues. They are scaled so they are larger than life.
[item]
image=units/dwarves/dragonguard/dragonguard-se-blade-defend1.png~GS()~SCALE(90,90)~CROP(0,20,60,60)
x,y=31,3
[/item]
[item]
image=units/dwarves/explorer-ranged-1.png~FL()~GS()~SCALE(90,90)~CROP(0,15,70,70)
x,y=35,3
[/item]
[item]
image=units/dwarves/lord.png~GS()~SCALE(90,90)~CROP(0,20,70,60)
x,y=31,5
[/item]
[item]
image=units/dwarves/dragonguard/dragonguard-s-ranged6.png~FL()~GS()~SCALE(90,90)~CROP(0,30,65,60)
x,y=35,5
[/item]
[item]
image=units/dwarves/arcanister.png~GS()~SCALE(90,90)~CROP(0,20,70,60)
x,y=31,7
[/item]
[item]
image=units/dwarves/sentinel.png~FL()~GS()~SCALE(90,90)~CROP(0,20,66,60)
x,y=35,7
[/item]
[item]
image=units/dwarves/explorer-melee-3.png~FL()~GS()~SCALE(90,90)~CROP(0,20,85,60)
x,y=35,9
[/item]
[item]
image=units/dwarves/lord-se-axe2.png~GS()~SCALE(90,90)~CROP(0,10,60,60)
x,y=31,9
[/item]
# The statues are not passable, but we want the player to be able to *see*
# behind them, so we'll remove the shroud in those hexes.
[remove_shroud]
side=1
radius=1
x,y=36,2
[/remove_shroud]
[remove_shroud]
side=1
radius=1
x,y=30,2
[/remove_shroud]
[remove_shroud]
side=1
radius=1
x,y=36,4
[/remove_shroud]
[remove_shroud]
side=1
radius=1
x,y=30,4
[/remove_shroud]
[remove_shroud]
side=1
radius=1
x,y=36,6
[/remove_shroud]
[remove_shroud]
side=1
radius=1
x,y=30,6
[/remove_shroud]
[remove_shroud]
side=1
radius=1
x,y=30,8
[/remove_shroud]
[remove_shroud]
side=1
radius=1
x,y=36,8
[/remove_shroud]
# ----- Water Barrels -----
[item]
image=items/barrel.png
x,y=39,23
[/item]
[item]
image=items/barrel.png
x,y=39,24
[/item]
[item]
image=items/barrel.png
x,y=38,23
[/item]
[item]
image=items/barrel.png
x,y=36,23
[/item]
# ----- Workshop -----
[item]
image=items/anvil.png
x,y=4,33
[/item]
[item]
image=items/anvil.png
x,y=7,35
[/item]
[item]
image=items/axe.png
x,y=6,34
[/item]
[item]
image=items/axe.png
x,y=7,34
[/item]
[item]
image=items/gold.png
x,y=8,32
[/item]
[item]
image=items/gold.png
x,y=9,33
[/item]
[item]
image=items/coal.png
x,y=7,32
[/item]
# ----- Treasury -----
[item]
image=items/chest-open.png
x,y=13,34
[/item]
[item]
image=items/chest-open.png
x,y=14,34
[/item]
[item]
image=items/chest-open.png
x,y=14,35
[/item]
[item]
image=items/chest-open.png
x,y=16,35
[/item]
[item]
image=items/chest.png
x,y=17,36
[/item]
[/event]
# *************************** PLAY ***************************
[event]
# This event fires when the king sees a unit approaching the castle, and he
# is alerted that he needs more units. We want the player to be able to see
# the king while he talks about this, so that's what we're actually going to
# check: That a player's unit can see the side-2 leader. We can't use
# "sighted" for this because that only works when a unit is revealed for the
# first time, and the king may have already been revealed by a shadow or other
# hidden unit. (But, of course, the king wouldn't have been alerted in that
# case.) We fire a custom event to have the king open another chest of gold.
name=moveto
first_time_only=no
id=king_alerted_1
[filter]
side=1
[/filter]
[store_reachable_locations]
[filter]
id=$unit.id
# These three units are hidden, so they don't count:
[not]
type=Shadow, Nightgaunt
[/not]
[and]
[not]
type=Fugitive
[filter_location]
terrain=*^V* # Hidden only in villages
[/filter_location]
[/not]
[/and]
[/filter]
range=vision
[filter_location]
x,y=20,26
[/filter_location]
variable=can_see_the_king
[/store_reachable_locations]
[if]
[variable]
name=can_see_the_king.length
greater_than=0
[/variable]
[then]
[store_unit]
[filter]
id=$unit.id
[/filter]
variable=alerting_unit
[/store_unit]
[clear_variable]
name=can_see_the_king
[/clear_variable]
[fire_event]
name=get_more_gold
[/fire_event]
[/then]
[else]
# If a unit can see the king, this else won't be reached, so undo
# won't work for that unit. To solve that, this whole event will
# be removed by the get_more_gold event, and undo will only be
# blocked on the one move that causes get_more_gold to fire.
[allow_undo][/allow_undo]
[/else]
[/if]
[/event]
[event]
# If a previously hidden unit becomes visible near the leader of side 2, we
# want that to have the same effect as moving a unit close to him. This event
# fires the same custom event as the event above.
name=sighted
id=king_alerted_2
[filter]
type=Shadow, Nightgaunt, Fugitive
# If the fugitive is not keeping to villages, the event above will
# fire first with the same effect.
[filter_location]
x,y=20,26
# This is the sight distance of all the units involved:
radius=8
[/filter_location]
[/filter]
[store_unit]
[filter]
id=$unit.id
[/filter]
variable=alerting_unit
[/store_unit]
[fire_event]
name=get_more_gold
[/fire_event]
[/event]
[event]
name=get_more_gold
[remove_event]
# We have to remove the first event to preserve the undo ability. It
# shouldn't actually be necessary to remove the second event, but
# we might as well.
id=king_alerted_1, king_alerted_2
[/remove_event]
# Removing the shroud is necessary here because otherwise, it won't be
# cleared until after the event is over, and the king may not be visible
# while he talks.
[store_reachable_locations]
[filter]
id=$alerting_unit.id
[/filter]
range=vision
variable=clear_shroud
[/store_reachable_locations]
[clear_variable]
name=alerting_unit
[/clear_variable]
[remove_shroud]
side=1
find_in=clear_shroud
[/remove_shroud]
[redraw][/redraw]
[clear_variable]
name=clear_shroud
[/clear_variable]
[message]
speaker=Golbanduth
message= _ "The invaders approach! Fetch the last chest o’ gold. We’re equippin’ more soldiers."
[/message]
[message]
speaker=porter
message= _ "Yes, sire."
[/message]
{THAW_UNIT porter}
{THAW_UNIT Golbanduth}
[move_unit]
id=porter
to_x=16
to_y=33
[/move_unit]
[terrain]
terrain=^Pr\o
x,y=16,34
layer=overlay
[/terrain]
# Now that the gate to the dwarves' treasury is open, the player might be
# able to see into it. We will remove the shroud for all visible locations
# in case that's true.
[store_reachable_locations]
[filter]
side=1
[/filter]
range=vision
variable=clear_shroud
[/store_reachable_locations]
[remove_shroud]
side=1
find_in=clear_shroud
[/remove_shroud]
[redraw][/redraw]
[clear_variable]
name=clear_shroud
[/clear_variable]
[move_unit]
id=porter
to_x=17
to_y=36
[/move_unit]
[remove_item]
x,y=17,36
[/remove_item]
[move_unit]
id=porter
to_x=18
to_y=27
[/move_unit]
[item]
image=items/chest-open.png
x,y=19,27
[/item]
[gold]
side=2
#ifdef EASY
amount=300
#endif
#ifdef NORMAL
amount=450
#endif
#ifdef HARD
amount=600
#endif
[/gold]
[/event]
# *************************** ENDING / OPENING ***************************
#define SHAKE X Y
[scroll]
x,y={X},{Y}
[/scroll]
[delay]
time=150
[/delay]
#enddef
#define BREAK_STATUE
[animate_unit]
[filter]
id=Ras-Tabahn
[/filter]
flag=attack
[primary_attack]
range=ranged
[/primary_attack]
hits=yes
[facing]
x,y=31,9
[/facing]
[/animate_unit]
[remove_item]
x,y=31,9
[/remove_item]
#enddef
[event]
name=start
[teleport]
[filter]
id=Ardonna
[/filter]
x,y=33,1
animate=no
clear_shroud=yes
check_passability=no
[/teleport]
[message]
speaker=Ardonna
message= _ "Actually, I don’t think this is the end. There is air coming through here. Help me shift these stones."
[/message]
[sound]
name=cave-in.ogg
[/sound]
[delay]
time=1000
[/delay]
[terrain]
x,y=33,1
terrain=Uu
[/terrain]
[unhide_unit]
id=Ardonna
[/unhide_unit]
[delay]
time=1000
[/delay]
[move_unit]
id=Ardonna
to_x=33
to_y=9
[/move_unit]
[recall]
id=Ras-Tabahn
x,y=32,8 # We want him on a specific hex...
show=no
[/recall]
[modify_unit]
[filter]
id=Ras-Tabahn
[/filter]
# ...facing a specific way.
facing=nw
[/modify_unit]
{RECALL_LOYAL_UNITS}
[terrain]
x,y=31,9
terrain=^Kov
layer=overlay
[/terrain]
[message]
speaker=Ardonna
message= _ "Now, where are we?"
[/message]
[message]
speaker=Ras-Tabahn
message= _ "We are in a Dwarvish burial chamber it seems. That is good. We could always use some more soldiers."
[/message]
[move_unit_fake]
type=Dwarvish Sentinel
side=2
x=31, 33
y=17, 12
[/move_unit_fake]
[unit]
x,y=33,12
type=Dwarvish Sentinel
side=2
name= _ "Aigondur"
id=Aigondur
[/unit]
[message]
speaker=Aigondur
message= _ "Human invaders be comin’ through the Hall o’ Heroes! I’m closin’ th’ Troll Gate!"
[/message]
[move_unit]
id=Aigondur
to_x=32
to_y=15
[/move_unit]
[remove_item]
image=scenery/rune4.png
x,y=32,15
[/remove_item]
[item]
image=scenery/rune4-glow.png
x,y=32,15
[/item]
[redraw][/redraw]
[delay]
time=100
[/delay]
[terrain]
x,y=33,15
terrain=^Gytc
layer=overlay
[/terrain]
[redraw][/redraw]
[sound]
name=explosion.ogg
[/sound]
{SHAKE 2 1}
{SHAKE -1 -3}
{SHAKE -3 1}
{SHAKE 1 3}
{SHAKE 1 -2}
[delay]
time=500
[/delay]
[message]
speaker=Ardonna
message= _ "Well, we are not going that way."
[/message]
[message]
speaker=Ras-Tabahn
message= _ "But look. There is a large crack in the wall to our left! I’m certain we could squeeze through."
[/message]
[message]
speaker=Ras-Tabahn
message= _ "We’ll just remove the statue..."
[/message]
{BREAK_STATUE}
[item]
image=items/debris1.png
x,y=31,9
[/item]
[item]
image=misc/blank-hex.png~BLIT(units/dwarves/lord-se-axe2.png~GS()~SCALE(90,90)~CROP(0,30,60,40),0,20)
x,y=31,9
[/item]
{BREAK_STATUE}
[item]
image=items/debris2.png
x,y=31,9
[/item]
[item]
image=misc/blank-hex.png~BLIT(units/dwarves/lord-se-axe2.png~GS()~SCALE(90,90)~CROP(0,45,60,25),0,35)
x,y=31,9
[/item]
{BREAK_STATUE}
[item]
image=items/debris3.png
x,y=31,9
[/item]
[move_unit]
id=Ras-Tabahn
to_x=30
to_y=8
[/move_unit]
[message]
speaker=Ras-Tabahn
message= _ "... and push the coffin out of the way."
[/message]
[remove_item]
x,y=30,8
[/remove_item]
[item]
image=items/coffin-dwarf-back.png
x,y=30,8
[/item]
[terrain]
x,y=29,9
terrain=''
layer=overlay
[/terrain]
# We want a "sighted" event for the first dwarf other than the guard who sees
# a unit from side 1. Now that the guard can't see them anymore, we can add
# this event. The next dwarf who sees a unit from side 1 will almost
# certainly be the closest miner, so he has the dialog.
[event]
name=sighted
[filter]
side=1
[/filter]
# The other side will always be 2, so we don't need to filter for it.
[message]
speaker=spotter
message= _ "Ach! Th’ invaders have made it inna the Crystal Caves!"
[/message]
[/event]
[/event]
[event]
name=enemies defeated
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]
{TURN_INTO_A_LICH}
{HERO_DEATHS}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
[/scenario]