/
17_Scepter_of_Fire.cfg
726 lines (674 loc) · 20.2 KB
/
17_Scepter_of_Fire.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
#textdomain wesnoth-httt
[scenario]
id=17_Sceptre_of_Fire
name= _ "The Sceptre of Fire"
next_scenario=18_A_Choice_Must_Be_Made
map_generation=lua
[generator]
id="cavegen"
config_name="Lua Cave Generator"
create_map = << return wesnoth.require("lua/cave_map_generator.lua").generate_map(...) >>
map_width=50
map_height=70
village_density=20
terrain_wall = "Xu"
terrain_clear = "Uu"
terrain_keep = "Kud"
terrain_castle = "Cud"
terrain_village = "Uu^Vud"
transforms=flip_x
transform_chance=50
#
# The chamber with the player. Somewhere in the far south
#
[chamber]
id=player
x=15..35
y=65
size=8
jagged=50
[item_location]
id = 1
place_castle = yes
[/item_location]
[/chamber]
#
# The antechambers
#
[chamber]
id=antechamber_1
x=10..25
y=50..60
size=7
jagged=5
{PASSAGE_NORMAL player 2 10 10}
[item_location]
id = 2
place_castle = yes
[/item_location]
[/chamber]
[chamber]
id=antechamber_2
x=25..40
y=50..60
size=7
jagged=2
{PASSAGE_NORMAL player 2 3 1}
{PASSAGE_CHANCE 40 antechamber_1 1 9 9}
[item_location]
id = 3
place_castle = yes
[/item_location]
[/chamber]
#
# The central volcano
#
[chamber]
id=center
x=25..26
y=35..36
size=2
jagged=1
{PASSAGE_NORMAL antechamber_1 1 20 3}
{PASSAGE_NORMAL antechamber_2 1 20 3}
[/chamber]
#
# The 5 minichambers encircling the central volcano and a 6th chamber
# to serve as the exit
#
[chamber]
id=mini_1
x=10..16
y=36..40
size=5
jagged=2
{PASSAGE_NORMAL center 1 5 2}
{PASSAGE_NORMAL antechamber_1 2 5 2}
[/chamber]
[chamber]
id=mini_2
x=8..20
y=17..26
size=5
jagged=3
{PASSAGE_NORMAL center 1 5 2}
{PASSAGE_NORMAL mini_1 1 5 2}
[/chamber]
[chamber]
id=mini_3
x=6..44
y=14..30
size=3
jagged=4
{PASSAGE_NORMAL center 1 5 2}
{PASSAGE_NORMAL mini_2 2 5 2}
[item_location]
id = sceptre
[/item_location]
[/chamber]
[chamber]
id=mini_4
x=30..42
y=17..26
size=5
jagged=5
{PASSAGE_NORMAL center 1 5 2}
{PASSAGE_NORMAL mini_3 2 5 2}
[/chamber]
[chamber]
id=mini_5
x=34..40
y=36..40
size=5
jagged=5
{PASSAGE_NORMAL mini_4 2 5 2}
{PASSAGE_NORMAL center 1 5 2}
{PASSAGE_NORMAL antechamber_2 2 5 2}
[/chamber]
[chamber]
id=exit
x=25
y=1
size=2
jagged=1
{PASSAGE_NORMAL mini_2 1 5 2}
{PASSAGE_NORMAL mini_3 1 5 2}
{PASSAGE_NORMAL mini_4 1 5 2}
[/chamber]
#
# There are 4 chambers for enemies randomly scattered on the map
#
[chamber]
id=enemy_1
x=6..15
y=45..55
size=5
jagged=3
{PASSAGE_NORMAL mini_1 2 5 2}
{PASSAGE_CHANCE 60 mini_2 1 5 2}
{PASSAGE_CHANCE 40 antechamber_2 1 5 2}
[item_location]
id = 4
place_castle = yes
[/item_location]
[/chamber]
[chamber]
id=enemy_2
x=6..15
y=1..35
size=5
jagged=3
{PASSAGE_NORMAL mini_2 2 5 2}
{PASSAGE_NORMAL enemy_1 2 5 5}
{PASSAGE_CHANCE 60 mini_1 1 5 2}
{PASSAGE_CHANCE 40 mini_3 1 5 2}
[item_location]
id = 5
place_castle = yes
[/item_location]
[/chamber]
[chamber]
id=enemy_3
x=35..45
y=1..35
size=5
jagged=3
{PASSAGE_NORMAL mini_4 2 5 2}
{PASSAGE_CHANCE 60 mini_5 1 5 2}
{PASSAGE_CHANCE 40 mini_3 1 5 2}
[item_location]
id = 6
place_castle = yes
[/item_location]
[/chamber]
[chamber]
id=enemy_4
x=35..45
y=45..55
size=5
jagged=3
{PASSAGE_NORMAL mini_5 2 5 2}
{PASSAGE_NORMAL enemy_3 2 5 5}
{PASSAGE_CHANCE 60 mini_4 1 5 2}
{PASSAGE_CHANCE 40 antechamber_2 1 5 2}
[item_location]
id = 7
place_castle = yes
[/item_location]
[/chamber]
[/generator]
#
# If you think this is laying it on a bit thick, I'm open to
# suggestions for better wording or something less
# melodramatic.
#
[story]
[part]
story= _ "Across the chasm, the air almost crackled with magical energy. It also became steadily warmer. The floor was smooth and glassy in places, and a faint glow provided a small reprieve from the thick blackness. Volcanic fumes drifted up from cracks in the floor."
show_title=no
[/part]
[part]
story= _ "Distant rumbles and earthquakes made it difficult to keep steady footing. The very earth had come alive, heaving, struggling to be relieved of its centuries-old burden..."
show_title=no
[/part]
[/story]
{HTTT_TRACK {JOURNEY_17_NEW} }
{TURNS 50 45 35}
victory_when_enemies_defeated=no
#
# This is a custom schedule that gives everything a slight
# reddish hue and gently pulsates. -30, -40, -40 are default
# values that look good
#
{UNDERGROUND_VOLCANO -27 -37 -37}
{UNDERGROUND_VOLCANO -28 -38 -38}
{UNDERGROUND_VOLCANO -32 -42 -42}
{UNDERGROUND_VOLCANO -36 -46 -46}
{UNDERGROUND_VOLCANO -37 -47 -47}
{UNDERGROUND_VOLCANO -36 -46 -46}
{UNDERGROUND_VOLCANO -32 -42 -42}
{UNDERGROUND_VOLCANO -28 -38 -38}
# wmllint: recognize Konrad
{SCENARIO_MUSIC "the_deep_path.ogg"}
{EXTRA_SCENARIO_MUSIC "knalgan_theme.ogg"}
{EXTRA_SCENARIO_MUSIC "heroes_rite.ogg"}
{EXTRA_SCENARIO_MUSIC "underground.ogg"}
{EXTRA_SCENARIO_MUSIC "into_the_shadows.ogg"}
[side]
type=Commander
id=Konrad
name= _ "Konrad"
unrenamable=yes
profile=portraits/konrad-human.png
side=1
canrecruit=yes
team_name=elves
user_team_name=_"Rebels"
controller=human
shroud=yes
gold=200
{FLAG_VARIANT long}
[/side]
[side]
type=Goblin Rouser
side=2
canrecruit=yes
controller=ai
recruit=Goblin Spearman
team_name=orcs
user_team_name=_"Orcs"
gold=70
[ai]
aggression=1.0
village_value=0.0
leader_value=50.0
villages_per_scout=0.0
[/ai]
[/side]
[side]
type=Goblin Rouser
side=3
canrecruit=yes
controller=ai
recruit=Goblin Spearman
team_name=orcs
user_team_name=_"Orcs"
gold=70
[ai]
aggression=1.0
village_value=0.0
leader_value=50.0
villages_per_scout=0.0
[/ai]
{FLAG_VARIANT6 ragged}
[/side]
[side]
type=Orcish Warlord
side=4
canrecruit=yes
controller=ai
[ai]
leader_value=10
{ATTACK_DEPTH 5 5 6}
[/ai]
recruit=Wolf Rider,Orcish Grunt,Orcish Archer
team_name=orcs
user_team_name=_"Orcs"
{GOLD 30 40 50}
{INCOME 2 4 6}
{FLAG_VARIANT6 ragged}
[/side]
[side]
type=Troll Warrior
side=5
canrecruit=yes
controller=ai
[ai]
{ATTACK_DEPTH 5 5 6}
leader_value=10
recruitment_pattern=fighter
[/ai]
#ifdef EASY
recruit=Troll Whelp,Ogre
#else
recruit=Troll Whelp,Troll,Troll Warrior,Ogre
#endif
team_name=orcs
user_team_name=_"Orcs"
{GOLD 30 40 50}
{INCOME 2 4 6}
[/side]
[side]
type=Orcish Warlord
side=6
canrecruit=yes
controller=ai
[ai]
{ATTACK_DEPTH 5 5 6}
leader_value=10
recruitment_pattern=fighter,fighter,scout
[/ai]
#ifdef EASY
recruit=Ogre,Goblin Knight,Wolf Rider,Troll Whelp
#else
recruit=Troll,Ogre,Goblin Knight,Wolf Rider,Troll Whelp,Saurian Skirmisher
#endif
team_name=orcs
user_team_name=_"Orcs"
{GOLD 10 20 30}
{INCOME 2 4 6}
[/side]
[side]
type=Orcish Warlord
side=7
canrecruit=yes
controller=ai
[ai]
{ATTACK_DEPTH 5 5 6}
leader_value=10
recruitment_pattern=fighter,fighter,scout
[/ai]
#ifdef EASY
recruit=Wolf Rider,Goblin Impaler
#else
recruit=Goblin Knight,Wolf Rider,Goblin Spearman,Goblin Impaler,Saurian Skirmisher
#endif
team_name=orcs
user_team_name=_"Orcs"
{GOLD 20 30 40}
{INCOME 2 4 6}
{FLAG_VARIANT6 ragged}
[/side]
[event]
name=prestart
{VARIABLE moved_too_close false}
[objectives]
side=1
[objective]
description= _ "Capture the Sceptre of Fire with Konrad or Li’sar"
condition=win
[/objective]
[objective]
description= _ "Death of Konrad"
condition=lose
[/objective]
[objective]
description= _ "Death of Delfador"
condition=lose
[/objective]
[objective]
description= _ "Death of Li’sar"
condition=lose
[/objective]
[objective]
description= _ "Death of Kalenz"
condition=lose
[/objective]
{TURNS_RUN_OUT}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[note]
[show_if]
{VARIABLE_CONDITIONAL moved_too_close boolean_equals false}
[/show_if]
description= _ "If Delfador rests, he can concentrate on the location of the Sceptre of Fire."
[/note]
[/objectives]
{SOF_TERRAIN_MASK}
#
# Except on hard, you only have to face 4 enemies
# instead of 5. This part randomly kills 1 or 2 of the
# 6 leaders.
#
#ifdef HARD
#else
{VARIABLE_OP side_kill rand "4..7"}
{ERASE_CASTLE $side_kill Uu}
[kill]
side=$side_kill
[/kill]
[modify_side]
side=$side_kill
hidden=yes
[/modify_side]
#endif
{VARIABLE_OP side_kill rand "2..3"}
{ERASE_CASTLE $side_kill Uu}
[kill]
side=$side_kill
[/kill]
[modify_side]
side=$side_kill
hidden=yes
[/modify_side]
{CLEAR_VARIABLE side_kill}
# just making sure that the starting castle is big enough that
# no recalled units can end up inside walls
[store_locations]
[and]
[filter]
id=Konrad
[/filter]
radius=1
[/and]
[not]
terrain=C*,K*
[/not]
variable=adjacent_to_starting_loc
[/store_locations]
[foreach]
array=adjacent_to_starting_loc
[do]
[terrain]
x,y=$this_item.x,$this_item.y
terrain=Cud
[/terrain]
[/do]
[/foreach]
{CLEAR_VARIABLE adjacent_to_starting_loc}
[/event]
[event]
name=prestart
#
# Initialize the lava growing effect
#
{NEXT_LAVA}
{CLEAR_VARIABLE sceptre}
{NEED_DELFADOR placement=leader}
{NEED_KALENZ placement=leader}
{NEED_LISAR placement=leader}
[/event]
[event]
name=start
[message]
speaker=Konrad
message= _ "The Sceptre must be getting close now! Where shall we go?"
[/message]
[message]
speaker=Kalenz
message= _ "We cannot explore this much area by ourselves, especially if we are beset by the denizens of these caves. We must ask our dwarven allies to help search the caves with us."
[/message]
[message]
speaker=Delfador
message= _ "Yes, I feel it is near here! We must search for it carefully."
[/message]
{QUAKE "rumble.ogg"}
{QUAKE "rumble.ogg"}
[message]
speaker="Li'sar"
message= _ "An earthquake! We’ll be trapped!"
[/message]
[message]
speaker=Kalenz
message= _ "No, not an earthquake, Princess. I feel it too. Something is... aware... of us."
[/message]
[message]
speaker="Li'sar"
message= _ "Aware? Who? Delfador, what does he mean?"
[/message]
[message]
speaker=Delfador
message= _ "The Sceptre... the earth... the molten lava... the fire... the air around us... everything. It calls out to the heir — I can barely hold it back in my mind. It was forged here, not far north of where we now stand. The sheer power of it!"
[/message]
{QUAKE "rumble.ogg"}
[message]
speaker=Konrad
message= _ "Where? Where is it?"
[/message]
[message]
speaker=Delfador
message= _ "North. More than that, I cannot tell."
[/message]
[message]
speaker="Li'sar"
message= _ "Konrad, as promised, here is my purse, full of gold."
[/message]
[sound]
name=gold.ogg
[/sound]
[message]
speaker=narrator
image="wesnoth-icon.png"
message= _ "You receive 300 pieces of gold!"
[/message]
[gold]
side=1
amount=300
[/gold]
[store_locations]
terrain=Xu,Qxu,Ql
[and]
location_id="sceptre"
radius=3
[/and]
[or]
location_id="sceptre"
radius=1
[/or]
variable=sceptre_vicinity
[/store_locations]
[foreach]
array=sceptre_vicinity
[do]
[terrain]
x=$this_item.x
y=$this_item.y
terrain=Uu
[/terrain]
[/do]
[/foreach]
{CLEAR_VARIABLE sceptre_vicinity}
[terrain]
location_id="sceptre"
terrain=Uu^Ii
[/terrain]
[message]
speaker=Delfador
message= _ "I think... I think if I were to concentrate a bit I could tell you where it is."
[/message]
[message]
speaker=narrator
image="wesnoth-icon.png"
message= _ "If Delfador rests, he can concentrate on the location of the Sceptre of Fire."
[/message]
[/event]
[event]
name=side 1 turn end
first_time_only=no
[store_unit]
[filter]
id=Delfador
[/filter]
kill=no
variable=delfador_moves
[/store_unit]
[if]
{VARIABLE_CONDITIONAL delfador_moves.moves numerical_equals $delfador_moves.max_moves}
{VARIABLE_CONDITIONAL moved_too_close boolean_equals false}
[then]
[floating_text]
[filter]
id=Delfador
[/filter]
text= _ "Concentrating"
[/floating_text]
{VARIABLE concentrating true}
[/then]
[else]
{VARIABLE concentrating false}
[/else]
[/if]
{CLEAR_VARIABLE delfador_moves}
[/event]
[event]
name=moveto
[filter]
[filter_location]
location_id="sceptre"
radius=6
[/filter_location]
side=1
[/filter]
[message]
speaker=Delfador
message= _ "I sense we are quite near the Sceptre; in fact, we should be able to see it right about now..."
[/message]
{VARIABLE moved_too_close true}
[/event]
[event]
name=victory
{CLEAR_VARIABLE concentrating,moved_too_close,lava_body,lava_count,sceptre_x,sceptre_y}
[/event]
[event]
name=side 1 turn refresh
first_time_only=no
[filter_condition]
{VARIABLE_CONDITIONAL concentrating boolean_equals true}
[/filter_condition]
# The revealing of the path is much easier done in lua. Thanks mattsc for the code!
[lua]
# wmllint: markcheck off
code= <<
local ai_helper = wesnoth.require "ai/lua/ai_helper.lua"
local H = wesnoth.require "lua/helper.lua"
local W = H.set_wml_action_metatable {}
local delf = wesnoth.get_units { id = 'Delfador' }[1]
local sceptre_loc= wesnoth.special_locations.sceptre
local path = wesnoth.find_path(delf, sceptre_loc[1], sceptre_loc[2], {ignore_units = true, viewing_side = 0}) -- # wmllint: noconvert
_ = wesnoth.textdomain 'wesnoth-httt'
local dirs = { _"I sense the path to the Sceptre is to the east of me.",
_"I sense the path to the Sceptre is to the south-east of me.",
_"I sense the path to the Sceptre is to the south of me.",
_"I sense the path to the Sceptre is to the south-west of me.",
_"I sense the path to the Sceptre is to the west of me.",
_"I sense the path to the Sceptre is to the north-west of me.",
_"I sense the path to the Sceptre is to the north of me.",
_"I sense the path to the Sceptre is to the north-east of me." }
local goal = { x = path[6][1], y = path[6][2] }
W.message{ speaker = 'Delfador', message= dirs[ai_helper.get_direction_index(delf, goal, 8, true)]}
>>
# wmllint: markcheck on
[/lua]
[/event]
#
# Some volcanic ambiance
#
[event]
name=moveto
first_time_only=no
[allow_undo]
[/allow_undo]
[filter]
side=1,4,5
[/filter]
{VARIABLE_OP rumble_test rand "1..35"}
[if]
[variable]
name=rumble_test
numerical_equals=1
[/variable]
[then]
{QUAKE "rumble.ogg"}
{VARIABLE_OP lava_count add 1}
{EXPAND_LAVA}
# Reset the counter if it gets too large (it slows things down)
[if]
[variable]
name=lava_count
numerical_equals=3
[/variable]
[then]
{NEXT_LAVA}
[/then]
[/if]
[/then]
[/if]
{CLEAR_VARIABLE rumble_test}
[/event]
{campaigns/Heir_To_The_Throne/utils/deaths.cfg}
{PLACE_SCEPTRE}
{KONRAD_GETS_SCEPTRE}
{LISAR_GETS_SCEPTRE}
[/scenario]