/
httt_utils.cfg
835 lines (776 loc) · 24.5 KB
/
httt_utils.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
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
#textdomain wesnoth-httt
################################
#
# HTTT MACROS FOLLOW
#
################################
#
# Portrait variation macros
#
#define KONRAD_VARIATION NAME
image=portraits/konrad-human-{NAME}.png
#enddef
#define KONRAD_VARIATION_ELF NAME
image=portraits/konrad-elvish-{NAME}.png
#enddef
#define DELFADOR_VARIATION NAME
image=portraits/delfador-{NAME}.png
#enddef
#define DELFADOR_VARIATION_ELF NAME
image=portraits/delfador-elvish-{NAME}.png
#enddef
#define DELFADOR_MENTORING
image=portraits/delfador-mentoring.png
#enddef
#define DELFADOR_MENTORING_ELF
image=portraits/delfador-elvish-mentoring.png
#enddef
#define LISAR_VARIATION NAME
image=portraits/lisar-{NAME}.png
#enddef
#define ASHEVIERE_VARIATION NAME
image=portraits/asheviere-{NAME}.png
#enddef
#
# HTTT-specific artifacts
#
#define OBJ_SWORD_FIRE X Y ID
# Give a hint the first time a unit stops in a hex near the sword.
# There is a village right there, so that's probably when it will occur,
# but anywhere nearby will do.
[event]
name=moveto
[filter]
side=1
[/filter]
[filter_condition]
[have_location]
x,y=$x1,$y1
[and]
x,y={X},{Y}
radius=2
[/and]
[not]
x,y={X},{Y}
[/not]
[/have_location]
[/filter_condition]
[message]
speaker=narrator
image="wesnoth-icon.png"
message= _ "Nearby is a clearing with a huge tree standing alone in the center."
[/message]
[/event]
[event]
name=moveto
[filter]
side=1
x={X}
y={Y}
[/filter]
[message]
speaker=narrator
image="wesnoth-icon.png"
message= _ "A large tree stands alone in a clearing. Driven into the trunk is a huge sword with flames dancing along its blade. Strangely, while the trunk near the sword is blackened and scorched, the tree seems otherwise unaffected by the flames."
[/message]
{PLACE_IMAGE items/flame-sword.png ({X}) ({Y})}
{VARIABLE sword_taken 0}
[event]
name=victory
{CLEAR_VARIABLE sword_taken}
[/event]
[/event]
[event]
name=moveto
first_time_only=no
[filter]
side=1
x={X}
y={Y}
[/filter]
[if]
[variable]
name=sword_taken
numerical_equals=0
[/variable]
[then]
[message]
speaker=narrator
image="wesnoth-icon.png"
message= _ "Should $unit.name| attempt to pick up the sword?"
[option]
label= _ "Yes"
[command]
[object]
id={ID}
name= _ "Flaming Sword"
image=attacks/sword-flaming.png
duration=forever
# wmllint: local spelling forgemasters
description= _ "This massive blade was created centuries ago by long-forgotten elvish forgemasters, who imbued the bluish steel with an inner magical fire. Tongues of flame dance on the surface, giving the metal a flawless mirrored finish."
cannot_use_message= _ "Only the leader of an army can wield this sword!"
[filter]
type=Fighter,Commander,Lord,Princess,Battle Princess,Elvish Captain,Elvish Hero,Elvish Marshal,Elvish Champion,Paladin,Elvish Lord,Elvish High Lord
x,y={X},{Y}
[/filter]
[then]
[remove_item]
x,y={X},{Y}
[/remove_item]
[message]
speaker=$unit.id|
image="wesnoth-icon.png"
caption=""
male_message= _ "As $unit.name| places his hand around the glittering leather hilt, the sword roars to life! Strangely, he feels no heat once he picks it up, yet the grass at his feet bursts into flame as he tests the heft of this mighty weapon."
female_message= _ "As $unit.name| places her hand around the glittering leather hilt, the sword roars to life! Strangely, she feels no heat once she picks it up, yet the grass at her feet bursts into flame as she tests the heft of this mighty weapon."
[/message]
{VARIABLE sword_taken 1}
[/then]
[effect]
apply_to=attack
name=sword,saber
set_description= _ "flaming sword"
set_icon=attacks/sword-flaming.png
set_type=fire
[set_specials]
{WEAPON_SPECIAL_MAGICAL}
[/set_specials]
increase_damage=25%
[/effect]
[/object]
[/command]
[/option]
[option]
label= _ "No"
[command]
[allow_undo]
[/allow_undo]
[/command]
[/option]
[/message]
[/then]
[else]
[allow_undo]
[/allow_undo]
[/else]
[/if]
[/event]
#enddef
#define OBJ_VOID_ARMOR X Y ID
{PLACE_IMAGE items/armor-golden.png ({X}) ({Y})}
{VARIABLE armor_taken 0}
[event]
name=moveto
first_time_only=no
[filter]
side=1
x,y={X},{Y}
[/filter]
[if]
[variable]
name=armor_taken
numerical_equals=0
[/variable]
[then]
[message]
speaker=narrator
image="wesnoth-icon.png"
message= _ "Should $unit.name| attempt to pick up the armor?"
[option]
label= _ "Yes"
[command]
[object]
id={ID}
name= _ "Void Armor"
image="icon_armor.png"
description= _ "A beautiful chest plate crafted from shimmering black steel, the Void Armor is virtually impenetrable to physical weapons!"
cannot_use_message= _ "Only a powerful warrior may don this armor!"
duration=forever
[filter]
side=1
x,y={X},{Y}
type=Fighter,Commander,Lord,Princess,Battle Princess,Elvish Lord,Elvish High Lord,Elvish Fighter,Elvish Captain,Elvish Hero,Elvish Marshal,Elvish Champion,Elvish Ranger,Elvish Avenger,Horseman,Knight,Lancer,Paladin,Grand Knight,Dwarvish Fighter,Dwarvish Steelclad,Dwarvish Lord,Dwarvish Guardsman,Dwarvish Stalwart,Dwarvish Sentinel
[/filter]
[then]
[remove_item]
x,y={X},{Y}
[/remove_item]
[message]
speaker=$unit.id|
image="wesnoth-icon.png"
caption=""
male_message= _ "$unit.name| struggles to lift and don the heavy plate. Once worn, however, it is amazingly comfortable. He feels an increased resistance to all physical damage!"
female_message= _ "$unit.name| struggles to lift and don the heavy plate. Once worn, however, it is amazingly comfortable. She feels an increased resistance to all physical damage!"
[/message]
{VARIABLE armor_taken 1}
[modify_unit]
[filter]
x,y={X},{Y}
[/filter]
[trait]
id=void_armor
name= _ "void armor"
description= _ "The Void Armor grants the following resistances:
blade: 50%
pierce: 40%
impact: 40%
fire: +10%"
[/trait]
[/modify_unit]
[/then]
#
# Set physical resistance to 50/40/40
#
[effect]
apply_to=resistance
replace=yes
[resistance]
blade=50
pierce=60
impact=60
[/resistance]
[/effect]
#
# Increase fire resistance by 10%
#
[effect]
apply_to=resistance
[resistance]
fire=-10
[/resistance]
[/effect]
[/object]
[/command]
[/option]
[option]
label= _ "No"
[/option]
[/message]
[/then]
[/if]
[/event]
#enddef
################################
#
# SCEPTRE OF FIRE MACROS FOLLOW
#
################################
#define SOF_TERRAIN_MASK
[terrain_mask]
x,y=1,1
mask="{campaigns/Heir_To_The_Throne/masks/17_Scepter_of_Fire.mask}"
[rule] # Make sure your castle keep and cave walls are not converted
old=Cud, Xu, Kud
new=Re, Uu^Vud, Uh, Uu^Uf
use_old=yes
[/rule]
[rule] # Convert cave villages to stone villages
old=Vu
new=Re, Uu^Vud, Uh, Uu^Uf # wmllint: ignore
terrain=Uu^Vud
[/rule]
[rule] # Add stone villages
old=Uu
new=Uu^Vud
terrain=Uu^Vud
[/rule]
[rule] # Add roads
old=Uu
new=Re
terrain=Re
[/rule]
[rule] # Add hilly caves
old=Uu
new=Uh
terrain=Uh
[/rule]
[rule] # Add a mushroom forest
old=Uu
new=Uu^Uf
terrain=Uu^Uf
[/rule]
[/terrain_mask]
#enddef
#define PLACE_SCEPTRE
[event]
name=prestart
[item]
location_id="sceptre"
image=items/sceptre-of-fire.png
[/item]
[/event]
[event]
name=moveto
first_time_only=no
[filter]
side=1
[filter_location]
location_id="sceptre"
[/filter_location]
[/filter]
[object]
id=object_sceptre
name= _ "Sceptre of Fire"
image=items/sceptre-of-fire.png
duration=forever
description= _ "This ancient Sceptre was forged by the great Dwarves of the Heart Mountains. A symbol of the kingship of Wesnoth, the Sceptre has the power to shoot fireballs at enemies of the bearer!"
cannot_use_message= _ "This is the Sceptre of Fire. Only a true successor to the throne can possibly dare to take this!"
[filter]
type=Princess,Battle Princess,Fighter,Commander,Lord
x,y=$x1,$y1
[/filter]
[effect]
apply_to=variation
name=sceptre
[/effect]
[/object]
[/event]
#enddef
#define KONRAD_GETS_SCEPTRE
[event]
name=moveto
[filter]
id=Konrad
[filter_location]
location_id="sceptre"
[/filter_location]
[/filter]
[set_variable]
name=sceptre
value="Konrad"
[/set_variable]
{MODIFY_UNIT id=Konrad profile "portraits/konrad-human-sceptre.png"}
[message]
speaker=Konrad
message= _ "Here it is at last, I have the Sceptre!"
[/message]
[message]
speaker=Kalenz
message= _ "So it is in our hands! Now let us leave this stinking pit."
[/message]
[message]
speaker="Li'sar"
message= _ "I think that if we travel just a little north, we might be able to get out."
[/message]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]
#enddef
#define LISAR_GETS_SCEPTRE
[event]
name=moveto
[filter]
id="Li'sar"
[filter_location]
location_id="sceptre"
[/filter_location]
[/filter]
[set_variable]
name=sceptre
value="Li'sar"
[/set_variable]
{MODIFY_UNIT id="Li'sar" profile "portraits/lisar-sceptre.png"}
[message]
speaker="Li'sar"
message= _ "At last! I have the Sceptre!"
[/message]
[message]
speaker=Konrad
message= _ "Indeed. You managed to reach it, Li’sar. I hope you shall use it wisely."
[/message]
[message]
speaker="Li'sar"
message= _ "My first use for it is going to be to help us get out of this hole! I hope you consider that wise."
[/message]
[message]
speaker=Delfador
{DELFADOR_MENTORING}
message= _ "The Sceptre makes its wielder powerful, but hardly immortal, child. Use it prudently. Now come, I believe there is an exit to the north!"
[/message]
[message]
speaker="Li'sar"
message= _ "I think I know what I’m doing. Come, let us go!"
[/message]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]
#enddef
#define PASSAGE_NORMAL DESTINATION_NAME WIDTH_NUMBER WINDINESS_NUMBER JAGGED_NUMBER
[passage]
destination={DESTINATION_NAME}
width={WIDTH_NUMBER}
windiness={WINDINESS_NUMBER}
jagged={JAGGED_NUMBER}
[/passage]
#enddef
#define PASSAGE_CHANCE CHANCE_NUMBER DESTINATION_NAME WIDTH_NUMBER WINDINESS_NUMBER JAGGED_NUMBER
[passage]
chance={CHANCE_NUMBER}
destination={DESTINATION_NAME}
width={WIDTH_NUMBER}
windiness={WINDINESS_NUMBER}
jagged={JAGGED_NUMBER}
[/passage]
#enddef
#define ERASE_CASTLE SIDE TERRAIN
[store_unit]
variable=side_store
[filter]
side={SIDE}
canrecruit=yes
[/filter]
[/store_unit]
{VARIABLE min_x $side_store.x}
{VARIABLE_OP min_x sub 1}
{VARIABLE min_y $side_store.y}
{VARIABLE_OP min_y sub 1}
{VARIABLE max_x $side_store.x}
{VARIABLE_OP max_x add 1}
{VARIABLE max_y $side_store.y}
{VARIABLE_OP max_y add 1}
{VARIABLE x_range ("$min_x|-$max_x")}
{VARIABLE y_range ("$min_y|-$max_y")}
[terrain]
x=$x_range
y=$y_range
terrain={TERRAIN}
[/terrain]
{CLEAR_VARIABLE side_store,min_x,min_y,max_x,max_y,x_range,y_range}
#enddef
#textdomain wesnoth-help
#define UNDERGROUND_VOLCANO RED GREEN BLUE
#
# -30, -40, -40 are the default good values for an underground
# reddish hue
#
[time]
id=underground
name= _ "Underground"
image=misc/time-schedules/schedule-underground.png
lawful_bonus=-25
red={RED}
green={GREEN}
blue={BLUE}
[/time]
#enddef
#textdomain wesnoth-httt
#define NEXT_LAVA
[store_locations]
variable=potential_locs
terrain=Xu
[filter_adjacent_location]
terrain=U*, Re
[filter_adjacent_location]
terrain=U*, Re
count=4-5
[/filter_adjacent_location]
[/filter_adjacent_location]
[not]
# don't start near the cave floor around the sceptre
x=$sceptre_x
y=$sceptre_y
radius=5
[/not]
[not]
# don't start near the existing lava
terrain=Ql
radius=5
[/not]
[/store_locations]
[if]
[variable]
name=potential_locs.length
greater_than=0
[/variable]
[then]
{VARIABLE lava_count 0}
{VARIABLE randrange $potential_locs.length}
{VARIABLE_OP randrange sub 1}
{VARIABLE randrange "0..$randrange"}
{RANDOM $randrange}
{CLEAR_VARIABLE lava_body}
{VARIABLE lava_body.x $potential_locs[$random].x}
{VARIABLE lava_body.y $potential_locs[$random].y}
{CLEAR_VARIABLE random}
[terrain]
x=$lava_body.x
y=$lava_body.y
terrain=Ql
[/terrain]
{CLEAR_VARIABLE randrange}
[/then]
[/if]
{CLEAR_VARIABLE potential_locs}
#enddef
#define EXPAND_LAVA
# the lava should expand to any cave floor that is not next to a cavewall,
# or cave floor that is next to cavewall that is already next to lava
# also if it comes near another lavabody, it should not expand in that direction
# first we store cavewall that is not already next to this lava
[store_locations]
variable=far_walls
terrain=Xu
[not]
find_in=lava_body
radius=1
[/not]
[/store_locations]
# next we store lava that is not part of this body
[store_locations]
variable=far_lava
terrain=Ql
[not]
find_in=lava_body
[/not]
[/store_locations]
# now we store cave floor nearby that doesn't approach the bad stuff
[store_locations]
variable=good_floor
terrain=U*,Re
[and]
find_in=lava_body
radius=1
[/and]
[not]
find_in=far_walls
radius=1
[/not]
[not]
find_in=far_lava
radius=1
[/not]
[not]
# don't go anywhere near the cave floor around the sceptre
x,y=$sceptre_x,$sceptre_y
radius=4
[filter_radius]
terrain=U*,Re
[/filter_radius]
[/not]
[/store_locations]
[if]
[variable]
name=good_floor.length
greater_than=0
[/variable]
[then]
[foreach]
array=good_floor
[do]
[terrain]
x=$this_item.x
y=$this_item.y
terrain=Ql
[/terrain]
[/do]
[/foreach]
[store_locations]
variable=lava_body
find_in=lava_body
[or]
find_in=good_floor
[/or]
[/store_locations]
[/then]
[else]
# this lava can't expand so force a new eruption
{NEXT_LAVA}
[/else]
[/if]
{CLEAR_VARIABLE far_walls}
{CLEAR_VARIABLE far_lava}
{CLEAR_VARIABLE good_floor}
# everyone on lava dies
[kill]
[not]
type=Gryphon Rider,Gryphon Master
[/not]
[filter_location]
terrain=Ql
[/filter_location]
animate=yes
fire_event=yes
[/kill]
#enddef
#define WATERFALL_MASK X Y
[item]
image=projectiles/icemissile-n-6.png
x={X}
y={Y}
[/item]
[item]
image=projectiles/icemissile-n-5.png
x={X}
y={Y}
[/item]
[item]
image=projectiles/icemissile-n-4.png
x={X}
y={Y}
[/item]
[item]
image=projectiles/icemissile-n-3.png
x={X}
y={Y}
[/item]
[item]
image=halo/elven/nature-halo1.png
x={X}
y={Y}
[/item]
#enddef
#define CHECK_VARIABLE NAME VALUE
[variable]
name={NAME}
equals={VALUE}
[/variable]
#enddef
#define NEED_DELFADOR PLACEMENT
[unit]
id=Delfador
name= _ "Delfador"
profile=portraits/delfador-elvish.png
unrenamable=yes
type=Elder Mage
{PLACEMENT}
{IS_HERO}
[modifications]
{TRAIT_LOYAL}
{TRAIT_INTELLIGENT}
[/modifications]
[/unit]
#enddef
#define NEED_KALENZ PLACEMENT
[unit]
id=Kalenz
name= _ "Kalenz"
profile=portraits/kalenz.png
unrenamable=yes
type=Elvish Lord
{PLACEMENT}
{IS_HERO}
random_traits=no
[modifications]
{TRAIT_LOYAL}
[/modifications]
[/unit]
#enddef
#define NEED_LISAR PLACEMENT
[unit]
id="Li'sar"
name= _ "Li'sar"
profile=portraits/lisar.png
unrenamable=yes
type=Princess
{PLACEMENT}
{IS_HERO}
random_traits=no
[modifications]
{TRAIT_LOYAL}
[/modifications]
[/unit]
#enddef
#define STORE_DELFADOR
[if]
[have_unit]
id=Delfador
search_recall_list=yes
[/have_unit]
[then]
[store_unit]
[filter]
id=Delfador
[/filter]
kill=yes
variable=delfador_store
[/store_unit]
[/then]
[/if]
#enddef
#define RESTORE_DELFADOR
[if]
[variable]
name=delfador_store.id
equals="Delfador"
[/variable]
[then]
[unstore_unit]
variable=delfador_store
x,y=recall,recall
[/unstore_unit]
{CLEAR_VARIABLE delfador_store}
[/then]
[/if]
#enddef
#define STORE_KALENZ
[if]
[have_unit]
id=Kalenz
search_recall_list=yes
[/have_unit]
[then]
[store_unit]
[filter]
id=Kalenz
[/filter]
kill=yes
variable=kalenz_store
[/store_unit]
[/then]
[/if]
#enddef
#define RESTORE_KALENZ
[if]
[variable]
name=kalenz_store.id
equals="Kalenz"
[/variable]
[then]
[unstore_unit]
variable=kalenz_store
x,y=recall,recall
[/unstore_unit]
{CLEAR_VARIABLE kalenz_store}
[/then]
[/if]
#enddef
#define STORE_LISAR
[if]
[have_unit]
side=1
id="Li'sar"
search_recall_list=yes
[/have_unit]
[then]
[store_unit]
[filter]
side=1
id="Li'sar"
[/filter]
kill=yes
variable=lisar_store
[/store_unit]
[/then]
[/if]
#enddef
#define RESTORE_LISAR
[if]
[variable]
name=lisar_store.id
equals="Li'sar"
[/variable]
[then]
[unstore_unit]
variable=lisar_store
x,y=recall,recall
[/unstore_unit]
{CLEAR_VARIABLE lisar_store}
[/then]
[/if]
#enddef