-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
sota-utils.cfg
1016 lines (961 loc) · 30.2 KB
/
sota-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
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#textdomain wesnoth-sota
#define SIDE_1_ARDONNA
side=1
controller=human
team_name=good
user_team_name= _ "Ardonna"
# This type of Dark Adept cannot eventually advance to a lich.
type=Dark Adept SotA
id=Ardonna
profile=portraits/ardonna.png
gender=female
name= _ "Ardonna"
canrecruit=yes
[modifications]
{TRAIT_QUICK}
{TRAIT_RESILIENT}
[/modifications]
recruit=Vampire Bat SotA
{FLAG_VARIANT undead}
#enddef
#define SIDE_1_RAS-TABAHN
side=1
controller=human
team_name=good
user_team_name= _ "Ras-Tabahn"
# This type of Dark Sorcerer cannot advance to a lich.
type=Dark Sorcerer SotA
id=Ras-Tabahn
name= _ "Ras-Tabahn"
canrecruit=yes
[modifications]
{TRAIT_STRONG}
{TRAIT_INTELLIGENT}
[/modifications]
recruit=Walking Corpse,Ghost,Skeleton,Skeleton Archer
{FLAG_VARIANT undead}
#enddef
#define SIDE_1_BOTH
side=1
controller=human
team_name=good
user_team_name= _ "Ardryn-Na"
# This type of Dark Adept cannot eventually advance to a lich.
type=Dark Adept SotA
id=Ardonna
profile=portraits/ardonna.png
gender=female
name= _ "Ardryn-Na"
canrecruit=yes
[modifications]
{TRAIT_QUICK}
{TRAIT_RESILIENT}
[/modifications]
{FLAG_VARIANT undead}
recruit=Walking Corpse,Ghost,Skeleton,Skeleton Archer
#enddef
#define RECALL_LOYAL_UNITS
[recall]
id=Bone Captain
show=no
[/recall]
[recall]
id=Carcyn
show=no
[/recall]
# Only one Shynal will be recalled.
[recall]
id=Shynal
show=no
[/recall]
[recall]
id=Corpse Shynal
show=no
[/recall]
[recall]
id=Vendraxis
show=no
[/recall]
[recall]
id=Ras-Tabahn
show=no
[/recall]
#enddef
#define HOW_TO_LOSE_WITH_ARDONNA
[objective]
description= _ "Death of Ardonna"
condition=lose
[/objective]
{TURNS_RUN_OUT}
#enddef
#define HOW_TO_LOSE_WITH_RAS-TABAHN
[objective]
description= _ "Death of Ras-Tabahn"
condition=lose
[/objective]
{TURNS_RUN_OUT}
#enddef
#define HOW_TO_LOSE_WITH_BOTH
[objective]
description= _ "Death of Ardryn-Na"
condition=lose
[/objective]
[objective]
description= _ "Death of Ras-Tabahn"
condition=lose
[/objective]
{TURNS_RUN_OUT}
#enddef
#define HERO_DEATHS
[event]
name=last_breath
[filter]
id=Ardonna
[/filter]
[message]
speaker=Ardonna
message= _ "No, no, NO, <i><b>NO</b></i>!"
[/message]
[/event]
[event]
name=die
[filter]
id=Ardonna
[/filter]
[endlevel]
result=defeat
[/endlevel]
[/event]
[event]
name=last_breath
[filter]
id=Ras-Tabahn
[/filter]
[message]
speaker=Ras-Tabahn
message= _ "Urgh."
[/message]
[/event]
[event]
name=die
[filter]
id=Ras-Tabahn
race=human
[/filter]
[message]
speaker=Ardonna
message= _ "But I don't know how to bring you back yet!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
[event]
name=die
[filter]
id=Ras-Tabahn
race=undead
[/filter]
[endlevel]
result=defeat
[/endlevel]
[/event]
[event]
name=die
[filter]
id=Shynal
race=human
[/filter]
[if]
[have_unit]
id=Carcyn
[/have_unit]
[then]
[message]
speaker=Carcyn
message= _ "Shynal!"
[/message]
[message]
speaker=Carcyn
message= _ "Bring her back. Please!"
[/message]
[message]
speaker=Ardonna
message= _ "I'm not sure that's such a good..."
[/message]
[message]
speaker=Ras-Tabahn
message= _ "If you insist."
[/message]
{ADVANCE_UNIT (id=Shynal) (Walking Corpse Shynal)}
[modify_unit]
[filter]
type=Walking Corpse Shynal
[/filter]
id=Corpse Shynal
[/modify_unit]
[message]
speaker=Corpse Shynal
message= _ "Car. Cyn."
[/message]
[message]
speaker=Ras-Tabahn
message= _ "She will not know you for long, so make the most of it."
[/message]
[event]
name=die
[filter]
id=Corpse Shynal
[/filter]
[message]
speaker=Carcyn
message= _ "Perhaps that was for the best."
[/message]
[/event]
[/then]
[/if]
[/event]
[event]
name=die
[filter]
id=Shynal
type=Lich SotA, Ancient Lich SotA, Lich, Ancient Lich
[/filter]
[if]
[have_unit]
id=Carcyn
[/have_unit]
[then]
[message]
speaker=Carcyn
message= _ "Shynal!"
[/message]
[message]
speaker=Carcyn
message= _ "Bring her back. Please!"
[/message]
[message]
speaker=Ras-Tabahn
message= _ "It's not possible. She was already back from the dead. She has been utterly destroyed this time."
[/message]
[/then]
[/if]
[/event]
[event]
name=last_breath
[filter]
id=Carcyn
[/filter]
[message]
speaker=Shynal
message= _ "Oh, my sweet Carcyn!"
[/message]
[/event]
[event]
name=die
[filter]
id=Carcyn
[/filter]
[if]
[variable]
name=side_number
equals=1
[/variable]
[then]
[message]
speaker=Shynal
message= _ "You were always so reckless."
[/message]
[/then]
[else]
[message]
speaker=Shynal
message= _ "I will miss you."
[/message]
[/else]
[/if]
[/event]
#enddef
# Ardonna is a normal unit, but uses mostly custom portraits. These events cause the
# portrait to change as necessary. The profile event is called automatically by the
# post_advance event or can be called manually. This macro is included in every scenario.
#define MANAGE_PROFILE
[event]
name=post_advance
first_time_only=no
[filter]
id=Ardonna
[/filter]
[fire_event]
name=ardonna_profile
[/fire_event]
[/event]
[event]
name=ardonna_profile
first_time_only=no
[store_unit]
[filter]
id=Ardonna
[/filter]
variable=Ardonna_stored
[/store_unit]
[switch]
variable=Ardonna_stored.type
[case]
value=Necromancer SotA
[set_variable]
name=Ardonna_stored.profile
value="portraits/humans/necromancer+female.png"
[/set_variable]
[/case]
[case]
value=Lich SotA, Ancient Lich SotA
[set_variable]
name=Ardonna_stored.profile
value="portraits/ardonna-lich.png"
[/set_variable]
[/case]
# Other values should not change it from "profile=portraits/ardonna.png"
[/switch]
[unstore_unit]
variable=Ardonna_stored
[/unstore_unit]
[clear_variable]
name=Ardonna_stored
[/clear_variable]
[/event]
#enddef
# If one of the two kids is advanced to something other than a Dark Adept, they complain.
# The player is given the choice to reconsider. They say something about being very
# powerful which may clue the player in to the fact that they can become Ancient Liches,
# and that it would be a good idea to go that way. Maybe.
#define KIDS_ADVANCE
[event]
name=post_advance
first_time_only=no
[filter]
id=Carcyn, Shynal
[/filter]
[if]
[have_unit]
id=$unit.id
type=Footpad, Thug
[/have_unit]
[then]
[fire_event]
name=argue_about_advancement
[primary_unit]
id=$unit.id
[/primary_unit]
[/fire_event]
[/then]
[/if]
[if]
# Shynal uses a couple custom portraits. We manage them here.
[variable]
name=unit.id
equals=Shynal
[/variable]
[then]
[store_unit]
# Her type may have just changed, so we will store a fresh
# copy of the unit.
[filter]
id=$unit.id
[/filter]
variable=Shynal_stored
[/store_unit]
[switch]
variable=Shynal_stored.type
[case]
value=Dark Adept SotA, Dark Adept, Dark Sorcerer SotA, Dark Sorcerer
[set_variable]
name=Shynal_stored.profile
value="portraits/shynal-adept.png"
[/set_variable]
[/case]
[case]
value=Necromancer SotA, Necromancer
[set_variable]
name=Shynal_stored.profile
value="portraits/humans/necromancer+female.png"
[/set_variable]
[/case]
[case]
value=Lich
[set_variable]
name=Shynal_stored.profile
value="portraits/lich.png"
[/set_variable]
[/case]
[case]
value=Ancient Lich
[set_variable]
name=Shynal_stored.profile
value="portraits/brown-lich.png"
[/set_variable]
[/case]
# Other values should not change it from its original
# outlaw-themed value.
[/switch]
[unstore_unit]
variable=Shynal_stored
[/unstore_unit]
[clear_variable]
name=Shynal_stored
[/clear_variable]
[/then]
[/if]
[/event]
# This event is split from above for readability.
[event]
name=argue_about_advancement
first_time_only=no
[if]
# The dialog is different if one of the kids is already a Dark something.
[have_unit]
type=Dark Adept SotA, Dark Sorcerer SotA, Necromancer SotA, Dark Adept, Dark Sorcerer, Necromancer
[and]
id=Shynal
[or]
id=Carcyn
[/or]
[/and]
[/have_unit]
[then]
[if]
[variable]
name=unit.id
equals=Carcyn
[/variable]
[then]
[message]
speaker=$unit.id
message= _ "Aww. I wanted to be a mage like Shynal."
[/message]
[/then]
[else]
[message]
speaker=$unit.id
message= _ "Aww. I wanted to be a mage like Carcyn."
[/message]
[/else]
[/if]
[message]
speaker=Ras-Tabahn
[option]
message= _ "Do not make me regret liberating you from jail. My decision is final."
[/option]
[option]
message= _ "I have reconsidered. Perhaps you will be very powerful one day."
[command]
{ADVANCE_UNIT (id=$unit.id) (Dark Adept SotA)}
[modify_unit]
[filter]
id=$unit.id
[/filter]
experience=$unit.experience
[/modify_unit]
[message]
speaker=$unit.id
message= _ "Thanks!"
[/message]
[/command]
[/option]
[/message]
[/then]
[else]
[if]
[variable]
name=refused_to_make_DA
not_equals=yes
[/variable]
[then]
[message]
speaker=$unit.id
message= _ "Hey, I wanted to be a wizard like you and live forever when you figure it out! I know I could be super-powerful in the end."
[/message]
[message]
speaker=Ras-Tabahn
[option]
message= _ "Hold your tongue. You will do as I command."
[command]
[set_variable]
name=refused_to_make_DA
value=yes
[/set_variable]
[/command]
[/option]
[option]
message= _ "Very well. Having more adepts might be a good idea after all."
[command]
{ADVANCE_UNIT (id=$unit.id) (Dark Adept SotA)}
[modify_unit]
[filter]
id=$unit.id
[/filter]
experience=$unit.experience
[/modify_unit]
[/command]
[/option]
[/message]
[/then]
[/if]
[/else]
[/if]
[/event]
#enddef
#define JOURNEY_PART STAGE
[part]
[background_layer]
image=maps/background.jpg
scale_vertically=yes
scale_horizontally=no
keep_aspect_ratio=yes
[/background_layer]
[background_layer]
image=maps/titlescreen.png
scale_vertically=yes
scale_horizontally=no
keep_aspect_ratio=yes
base_layer=yes
[/background_layer]
show_title=yes
{JOURNEY_STAGE{STAGE}}
[/part]
#enddef
#define FREEZE_UNIT ID
[object]
id=freeze_unit
take_only_once=no
silent=yes
duration=scenario # So this object will not be in the save files forever.
[filter]
id={ID}
[/filter]
[effect]
apply_to=movement_costs
replace=yes
[movement_costs]
shallow_water={UNREACHABLE}
reef={UNREACHABLE}
swamp_water={UNREACHABLE}
flat={UNREACHABLE}
sand={UNREACHABLE}
forest={UNREACHABLE}
hills={UNREACHABLE}
mountains={UNREACHABLE}
village={UNREACHABLE}
castle={UNREACHABLE}
cave={UNREACHABLE}
frozen={UNREACHABLE}
unwalkable={UNREACHABLE}
fungus={UNREACHABLE}
[/movement_costs]
[/effect]
[/object]
#enddef
#define THAW_UNIT ID
[remove_object]
id={ID}
object_id=freeze_unit
[/remove_object]
#enddef
# Finds the nearest hex to (X,Y) within MAX_DISTANCE that matches the FILTER, and stores
# the location in VARIABLE with x, y, and terrain. If there is more than one location
# found, VARIABLE will be an array.
#define NEAREST_HEX X Y MAX_DISTANCE FILTER VAR_NAME
[set_variable]
name=distance
value=0
[/set_variable]
[set_variable]
name=location_found
value=no
[/set_variable]
[clear_variable]
name={VAR_NAME}
[/clear_variable]
# Store any matching locations within a radius of "distance". If nothing got stored,
# add one to "distance" and try again. Do this until a location is found, or
# "distance" goes over the MAX_DISTANCE:
[while]
[variable]
name={VAR_NAME}.length
less_than=1
[/variable]
[and]
[variable]
name=distance
less_than_equal_to={MAX_DISTANCE}
[/variable]
[/and]
[do]
[store_locations]
{FILTER}
[and]
x={X}
y={Y}
radius=$distance
[/and]
variable={VAR_NAME}
[/store_locations]
[if]
[variable]
name={VAR_NAME}.length
greater_than=0
[/variable]
[then]
[set_variable]
name=location_found
value=yes
[/set_variable]
[/then]
[/if]
[set_variable]
name=distance
add=1
[/set_variable]
[/do]
[/while]
[clear_variable]
name=location_found, distance
[/clear_variable]
#enddef
# Conditional clause that means both Carcyn and Shynal are still alive.
#define BOTH_KIDS_LIVE
[and]
[have_unit]
id=Shynal
[/have_unit]
[have_unit]
id=Carcyn
[/have_unit]
[/and]
#enddef
# Conditional clause that means both Carcyn and Shynal are dead.
#define NO_KIDS_LIVE
[and]
[not]
[have_unit]
id=Shynal
[/have_unit]
[/not]
[not]
[have_unit]
id=Carcyn
[/have_unit]
[/not]
[/and]
#enddef
# Conditional clause that means only Carcyn *or* Shynal is still alive.
#define ONE_KID_LIVES
[and]
[have_unit]
id=Shynal
[/have_unit]
[not]
[have_unit]
id=Carcyn
[/have_unit]
[/not]
[/and]
[or]
[and]
[have_unit]
id=Carcyn
[/have_unit]
[not]
[have_unit]
id=Shynal
[/have_unit]
[/not]
[/and]
[/or]
#enddef
# Returns the nearest unoccupied castle hex to the side's starting location. If there
# isn't one, the starting location is returned.
#define FIND_CASTLE_HEX SIDE VARIABLE
[store_starting_location]
side={SIDE}
variable=side{SIDE}_keep_location
[/store_starting_location]
{NEAREST_HEX ($side{SIDE}_keep_location.x) ($side{SIDE}_keep_location.y) 6 (
terrain=C*
[not]
[filter]
[/filter]
[/not]
) {VARIABLE}}
[if]
[variable]
name={VARIABLE}.length
less_than=1
[/variable]
[then]
[set_variables]
name={VARIABLE}
to_variable=side{SIDE}_keep_location
[/set_variables]
[/then]
[/if]
[clear_variable]
name=side{SIDE}_keep_location
[/clear_variable]
#enddef
# This event turns a necromancer into a lich. It can be activated by an event or from
# a right-click menu option. It needs $unit to be set or it won't do anything.
#define TURN_INTO_A_LICH
[event]
name=lichify
first_time_only=no
# This is just to get a more descriptive name for the "unit" variable.
[set_variables]
name=stored_necromancer
mode=replace
to_variable=unit
[/set_variables]
# The necromancer may have AMLAd and had its experience reset to 0. Now, as a
# lich, there is a fourth level available for the unit, and all that experience
# should be applied towards the level-up instead of simply being lost. We will
# "unwind" each AMLA and calculate how much it cost, so we can give back those
# experience points.
[set_variable]
name=num_amlas
# This gives us the number of AMLAs that the unit has had:
value=$stored_necromancer.modifications.advancement.length
[/set_variable]
[set_variable]
# The experience that will be used for the new lich will be at least
# the necromancer's current actual experience.
name=experience_gained_after_max_level
value=$stored_necromancer.experience
[/set_variable]
[set_variable]
# Each AMLA took 20% more experience, so we will need to reduce this
# value as we unwind them. The variable starts out storing the amount
# needed for the *next* AMLA, so we will need to reduce it one step as
# the first operation.
name=experience_for_one_amla
value=$stored_necromancer.max_experience
[/set_variable]
[while]
[variable]
name=num_amlas
greater_than=0
[/variable]
[do]
[set_variable]
# Each AMLA increased the experience needed by 20%, which
# is the same as multiplying by 1.2. We reverse that here.
name=experience_for_one_amla
divide=1.2
[/set_variable]
[set_variable]
# Round it off in case it's a float:
name=experience_for_one_amla
round=0
[/set_variable]
[set_variable]
# Add the experience that was needed for the previous AMLA
# to the amount that will be given to the lich:
name=experience_gained_after_max_level
add=$experience_for_one_amla
[/set_variable]
[set_variable]
name=num_amlas
sub=1
[/set_variable]
[/do]
[/while]
# It's nice if Ardonna looks different as an ancient lich, and since there is
# another sprite available, we will use it. She needs a different type though:
[if]
[variable]
name=stored_necromancer.id
equals=Ardonna
[/variable]
[then]
[set_variable]
name=lich_type
value=Lich SotA
[/set_variable]
[/then]
[else]
[set_variable]
name=lich_type
value=Lich
[/set_variable]
[/else]
[/if]
# We are going to create a new unit instead of transforming the old one.
# Using the old unit would leave its AMLAs in effect, changing the hitpoints
# and experience needed to level up.
[unit]
side=1
type=$lich_type
x=$stored_necromancer.x
y=$stored_necromancer.y
id=$stored_necromancer.id
name=$stored_necromancer.name
facing=$stored_necromancer.facing
moves=$stored_necromancer.moves
overlays=$stored_necromancer.overlays
hitpoints=$stored_necromancer.hitpoints
canrecruit=$stored_necromancer.canrecruit
attacks_left=$stored_necromancer.attacks_left
experience=$experience_gained_after_max_level
# Copy the original traits into the new unit:
[modifications]
[insert_tag]
name=trait
variable=stored_necromancer.modifications.trait[0]
[/insert_tag]
[insert_tag]
name=trait
variable=stored_necromancer.modifications.trait[1]
[/insert_tag]
[/modifications]
to_variable=new_lich # Don't create the unit yet. Just store it.
[/unit]
# Hitpoints are transferred to the new unit so that turning into a lich doesn't
# heal it. However, this could result in the lich having more HP than its
# maximum. If that is the case, we will reset it to the maximum.
[if]
[variable]
name=new_lich.hitpoints
greater_than=$new_lich.max_hitpoints
[/variable]
[then]
[set_variable]
name=new_lich.hitpoints
value=$new_lich.max_hitpoints
[/set_variable]
[/then]
[/if]
# The leaders are changed in a scripted event at the end of a scenario, so
# they need to be handled differently than normal units:
[if]
[variable]
name=stored_necromancer.id
not_equals=Ardonna
[/variable]
[variable]
name=stored_necromancer.id
not_equals=Ras-Tabahn
[/variable]
[then]
[unstore_unit]
# The unit will be automatically advanced to Ancient Lich at
# this point if its experience is sufficient. Theoretically,
# it could even AMLA.
variable=new_lich
text= _ "Lich" # This text goes by quickly, so it must be short.
red,green,blue=220,0,220 # dark-magic purple
animate=yes
[/unstore_unit]
[/then]
[else]
# It's unlikely, but one of the leaders could be at a lower
# level, and therefore have fewer hitpoints than the same unit
# as a lich. We will set the hitpoints to the maximum in case
# that has happened.
[set_variable]
name=new_lich.hitpoints
value=$new_lich.max_hitpoints
[/set_variable]
# The leaders are changed to liches in between scenarios, so if
# we are working with one of them, the new unit needs to get
# sent to the recall list.
[set_variable]
name=new_lich.x
value=recall
[/set_variable]
[set_variable]
name=new_lich.y
value=recall
[/set_variable]
[unstore_unit]
variable=new_lich
[/unstore_unit]
[/else]
[/if]
[clear_variable]
name=stored_necromancer, new_lich, lich_type, num_amlas, experience_for_one_amla, experience_gained_after_max_level
[/clear_variable]
[/event]
#enddef
# OFFSET changes depending on which map the ship is on. It only affects 'y' because the
# x-position of the ship is the same on both maps.
#define HIDE_SAILS_MENU_ITEM OFFSET
[set_menu_item]
id=hide-sails
description= _ "Hide Sails and Rigging"
[show_if]
[variable]
name=sails_hidden
boolean_equals=no
[/variable]
[/show_if]
[command]
[terrain]
x=5
y="$(11+{OFFSET})"
terrain=^
layer=overlay
[/terrain]
[terrain]
x=14
y="$(9+{OFFSET})"
terrain=^
layer=overlay
[/terrain]
[terrain]
x=7
y="$(9+{OFFSET})"
terrain=^Zrlp
layer=overlay
[/terrain]
[set_variable]
name=sails_hidden
value=yes
[/set_variable]
[/command]
[/set_menu_item]
#enddef
#define SHOW_SAILS_MENU_ITEM OFFSET
[set_menu_item]
id=show-sails
description= _ "Show Sails and Rigging"
[show_if]
[variable]
name=sails_hidden
boolean_equals=yes
[/variable]
[/show_if]
[command]
[terrain]
x=5
y="$(11+{OFFSET})"
terrain=^Zrig
layer=overlay
[/terrain]
[terrain]
x=14
y="$(9+{OFFSET})"