This file is indexed.

/usr/share/games/wesnoth/1.10/data/campaigns/The_South_Guard/scenarios/07a_Into_the_Depths.cfg is in wesnoth-1.10-tsg 1:1.10.7-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
#textdomain wesnoth-tsg
[scenario]
    id=07a_Into_the_Depths

    name= _ "Into the Depths"
    next_scenario=08a_Return_to_Kerlath

    {SCENARIO_MUSIC the_deep_path.ogg}
    {EXTRA_SCENARIO_MUSIC knalgan_theme.ogg}

    map_data="{campaigns/The_South_Guard/maps/07a_Into_the_Depths.map}"

    {campaigns/The_South_Guard/utils/sg_deaths.cfg}

    {UNDERGROUND}

    victory_when_enemies_defeated=no
    {TURNS 50 45 40}

    # The South Guard.

    [side]
        side=1
        type=Horseman Commander
        id=Deoran
        name= _ "Deoran"
        unrenamable=yes

        team_name=South_Guard
        user_team_name=_"South Guard"
        controller=human
        {CUSTOM_SG_FLAG}

        fog=yes
        shroud=yes

        share_view=yes

        {GOLD 125 100 80}
        {INCOME 10 8 6}
    [/side]

    # The Undead Hordes

    [side]
        side=2
        type=Lich
        id="Mal M'Brin"
        name= _ "Mal M’Brin"
        profile=portraits/mal-mbrin.png

        team_name=undead_hordes
        user_team_name=_"Undead"
        controller=ai

        {GOLD 20 80 140}

        canrecruit=yes
        [ai]
#ifdef EASY
            recruitment_pattern=fighter,scout,fighter
#endif
#ifdef NORMAL
            recruitment_pattern=fighter,scout,fighter
#endif
#ifdef HARD
            recruitment_pattern=fighter,scout,archer,fighter
#endif
            recruitment_ignore_bad_movement=yes
            aggression=0.8
            village_value=0.1

            [avoid]
                x,y=2-14,16-26
            [/avoid]
        [/ai]

#ifdef EASY
        recruit=Skeleton,Ghost,Vampire Bat,Walking Corpse
#endif
#ifdef NORMAL
        recruit=Skeleton,Ghoul,Ghost,Vampire Bat,Walking Corpse
#endif
#ifdef HARD
        recruit=Deathblade,Ghoul,Ghost,Wraith,Blood Bat,Walking Corpse,Dark Adept
#endif
        {FLAG_VARIANT undead}
    [/side]

#ifdef HARD
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 "Deathblade" 2}
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 "Wraith" 2}
#else
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 "Vampire Bat" 4}
#endif

    [side]
        side=3
        type=Soulless
        id=Groth
        name= _ "Groth"

        team_name=undead_hordes
        user_team_name=_"Undead"
        controller=ai

        {GOLD 20 50 125}

        canrecruit=yes
        [ai]
            recruitment_pattern=fighter
            recruitment_ignore_bad_movement=yes
            aggression=0.6
            village_value=0.3

            [avoid]
                x,y=2-14,16-26
            [/avoid]
        [/ai]

#ifdef EASY
        recruit=Walking Corpse,Ghoul
#endif

#ifdef NORMAL
        recruit=Walking Corpse,Ghoul
#endif

#ifdef HARD
        recruit=Walking Corpse,Soulless,Ghoul,Necrophage
#endif
        {FLAG_VARIANT undead}
    [/side]

    # Passive trolls

    [side]
        side=4
        type=Troll Hero
        id=Grek
        name= _ "Grek"

        team_name=South_Guard
        user_team_name=_"South Guard"
        controller=ai

        {GOLD 60 30 10}

        canrecruit=yes

        [ai]
#ifdef EASY
            recruitment_pattern=fighter,fighter,mixed fighter
#else
            recruitment_pattern=fighter
#endif
            aggression=0.1
            caution=0.9
            [avoid]
                x,y=14-38,1-35
            [/avoid]
        [/ai]

#ifdef EASY
        recruit=Troll, Troll Rocklobber
#endif

#ifdef NORMAL
        recruit=Troll Whelp
#endif

#ifdef HARD
        recruit=Troll Whelp
#endif
    [/side]

    {STARTING_VILLAGES 4 8}

    # Aggressive trolls; the trolls turn to this side and start being useful if
    # the player pays them

    [side]
        side=5
        no_leader=yes
        team_name=South_Guard
        user_team_name=_"South Guard"
        controller=ai
        color=purple

        fog=yes
        share_view=yes

        [ai]
            recruitment_pattern=fighter,fighter,mixed fighter
            aggression=0.9
            caution=0.5
            village_value=0.0

            [target]
                side=2
                value=5
            [/target]
        [/ai]

        recruit=Troll Whelp,Troll,Troll Rocklobber
    [/side]

    # Scenario Setup

    [event]
        name=prestart

        {CLEAR_VARIABLE stored_Deoran_side}

        [unit]
            side=2
            type=Eyestalk
            x,y=10,8
            id=Eye Guardian
            name=_ "Eye Guardian"
            facing=sw
        [/unit]

        [unit]
            side=2
            type=Revenant
            x,y=13,9
            facing=sw
            ai_special=guardian
        [/unit]
    [/event]

    # Scenario Beginning

    [event]
        name=start

        [set_recruit]
            side=1
            recruit=Bowman,Spearman,Cavalryman,Elvish Shaman,Elvish Fighter
        [/set_recruit]

        [recall]
            id=Ethiliel
        [/recall]

        [recall]
            id=Minister Hylas
        [/recall]

        [message]
            speaker=Ethiliel
            message= _ "Proceed slowly, who knows what evils inhabited these parts before Mebrin was turned! We cannot be too careful."
        [/message]

#ifdef EASY
        [message]
            speaker=narrator
            message= _ "Cavalrymen and Dragoons will be less useful in the caves than soldiers who fight on foot."
            image=wesnoth-icon.png
        [/message]
        [message]
            speaker=narrator
            message= _ "Also, soldiers with the <i>quick</i> trait will be useful in the dark."
            image=wesnoth-icon.png
        [/message]
#endif

        [objectives]
            side=1
            [objective]
                description= _ "Find the source of the undead under the citadel"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Deoran"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Minister Hylas"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Ethiliel"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]
    [/event]

    [event]
        name=sighted

        [filter]
            type=Eyestalk
        [/filter]

        [redraw]
            side=1
        [/redraw]

        [message]
            speaker=Minister Hylas
            message= _ "What horrid creature may that be? I’ve seen many wicked things in my life, but never one such as that."
        [/message]

        [message]
            speaker=Ethiliel
            message= _ "It must be a guardian of some kind set here by Mebrin. We elves have heard stories of these creatures but I wouldn’t have expected to come across one... the least of all here. Let us proceed with caution."
        [/message]
    [/event]

    [event]
        name=sighted
        [filter]
            side=4
        [/filter]

        [redraw][/redraw]
        [message]
            speaker=Grek
            message= _ "Ha! Humans and elves! What are you doing in our caves, and why shouldn’t we grind your bones and gnaw on your flesh?"
        [/message]

        [message]
            speaker=Deoran
            message= _ "We mean no trespass. We are hunting the undead."
        [/message]

        [message]
            speaker=Grek
            message= _ "Undead! Ha! We kill undead all the time. You be friendly enough so we won’t kill you, but why should we help you?"
        [/message]

#ifdef EASY
        {VARIABLE troll_help_cost 100}
#endif
#ifdef NORMAL
        {VARIABLE troll_help_cost 150}
#endif
#ifdef HARD
        {VARIABLE troll_help_cost 200}
#endif

        # The help from the trolls can be received either on first sighting of them or
        # later; so here's what the trolls do to help you wrapped inside a macro so that
        # the WML doesn't need to be duplicated by hand

#define TROLL_HELP
    [gold]
        side=1
        amount=-$troll_help_cost
    [/gold]

    [remove_shroud]
        side=1
        x,y=1-38,1-35
    [/remove_shroud]

    [store_side]
        side=4
        variable=stored_side_4
    [/store_side]

    [modify_side]
        side=5
        gold=$stored_side_4.gold
    [/modify_side]

    # Note: the order of storing the villages, flipping the
    # units and recapturing the villages is important, because a
    # side with no leader cannot own villages.

    [store_villages]
        owner_side=4
        variable=side_4_villages
    [/store_villages]

    {MODIFY_UNIT side=4 side 5}

    {FOREACH side_4_villages i}
        [capture_village]
            x,y=$side_4_villages[$i].x,$side_4_villages[$i].y
            side=5
        [/capture_village]
    {NEXT i}

    {CLEAR_VARIABLE stored_side_4}
    {CLEAR_VARIABLE side_4_villages}

    [message]
        speaker=Grek
        message= _ "Gold is good. We can trade gold for weapons and fire. We will help you defeat the undead now."
    [/message]
    [message]
        speaker=Deoran
        message= _ "What aid can you offer us? We are not well suited to fighting in the caves."
    [/message]
    [message]
        speaker=Grek
        message= _ "We already planned to kill the undead ourselves... First we kill dwarves though! Now we have dwarvish thunder fire and many trolls ready for fighting. They come too and help you smash them undead."
    [/message]
    [message]
        speaker=Grek
        message= _ "Go here and light the thunder fire and it will blast a back door into the lich’s lair!"
    [/message]

    {HIGHLIGHT_IMAGE 17 24 items/bomb.png ()}

    {VARIABLE bomb_status ready}
    {VARIABLE troll_allies yes}
#enddef

        [message]
            speaker=Deoran
            message= _ "What should we offer them for their help?"
            [option]
                message= _ "We will give you $troll_help_cost gold pieces if you help us defeat the undead."
                [command]
                    [store_side]
                        side=1
                        variable=stored_side_1
                    [/store_side]

                    [if]
                        [variable]
                            name=stored_side_1.gold
                            greater_than_equal_to=$troll_help_cost
                        [/variable]

                        [then]
                            {TROLL_HELP}
                        [/then]

                        [else]
                            [message]
                                speaker=Grek
                                message= _ "Haha, you humans and elves poor, you have not enough gold! If you want troll help, you must come to me when you have the gold."
                            [/message]

                            [objectives]
                                side=1
                                [objective]
                                    description= _ "Find the source of the undead under the citadel"
                                    condition=win
                                [/objective]
                                [objective]
                                    description= _ "Meet with and pay the troll leader $troll_help_cost gold to receive their help"
                                    condition=win
                                [/objective]
                                [objective]
                                    description= _ "Death of Deoran"
                                    condition=lose
                                [/objective]
                                [objective]
                                    description= _ "Death of Minister Hylas"
                                    condition=lose
                                [/objective]
                                [objective]
                                    description= _ "Death of Ethiliel"
                                    condition=lose
                                [/objective]

                                {TURNS_RUN_OUT}

                                [gold_carryover]
                                    bonus=yes
                                    carryover_percentage=40
                                [/gold_carryover]
                            [/objectives]

                            {VARIABLE late_payment_for_troll_help yes}
                        [/else]
                    [/if]
                [/command]
            [/option]

            [option]
                message= _ "We will offer you freedom and a place in our lands."
                [command]
                    [message]
                        speaker=Grek
                        message= _ "Ha! Who wants stupid human lands!"
                    [/message]
                    [message]
                        speaker=Minister Hylas
                        message= _ "Then you will not aid us in our quest to destroy the undead menace?"
                    [/message]
                    [message]
                        speaker=Grek
                        # wmllint: local spelling "Bah"
                        message= _ "Bah! We destroy the undead when we want. Maybe wait for a few years first. If you want troll help, you come see me and give proper payment!"
                    [/message]
                    [message]
                        speaker=Ethiliel
                        message= _ "These creatures are much too simpleminded to be of any help to us but at least they will not attack us outright. We will have to face Mebrin alone."
                    [/message]

                    [objectives]
                        side=1
                        [objective]
                            description= _ "Find the source of the undead under the citadel"
                            condition=win
                        [/objective]
                        [objective]
                            description= _ "Meet with and pay the troll leader $troll_help_cost gold to receive their help"
                            condition=win
                        [/objective]
                        [objective]
                            description= _ "Death of Deoran"
                            condition=lose
                        [/objective]
                        [objective]
                            description= _ "Death of Minister Hylas"
                            condition=lose
                        [/objective]
                        [objective]
                            description= _ "Death of Ethiliel"
                            condition=lose
                        [/objective]

                        {TURNS_RUN_OUT}

                        [gold_carryover]
                            bonus=yes
                            carryover_percentage=40
                        [/gold_carryover]
                    [/objectives]

                    {VARIABLE late_payment_for_troll_help yes}
                [/command]
            [/option]
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no

        [filter]
            side=1
            [filter_adjacent]
                id=Grek
            [/filter_adjacent]
        [/filter]

        [if]
            [variable]
                name=late_payment_for_troll_help
                equals=yes
            [/variable]

            [variable]
                name=troll_allies
                not_equals=yes
            [/variable]

            [then]
                [store_side]
                    side=1
                    variable=stored_side_1
                [/store_side]

                [message]
                    speaker=Grek
                    message= _ "Ha, you can afford troll help this time?"
                    [option]
                        [show_if]
                            [variable]
                                name=stored_side_1.gold
                                greater_than_equal_to=$troll_help_cost
                            [/variable]
                        [/show_if]

                        message= _ "Here’s $troll_help_cost for your help against the undead."

                        [command]
                            {TROLL_HELP}
                        [/command]
                    [/option]

                    [option]
                        message= _ "No, sorry."

                        [command]
                            [allow_undo][/allow_undo]
                        [/command]
                    [/option]
                [/message]
            [/then]

            [else]
                [allow_undo][/allow_undo]
            [/else]
        [/if]
    [/event]

    [event]
        name=moveto
        first_time_only=no

        [filter]
            side=1
            x,y=17,24
        [/filter]

        [if]
            [variable]
                name=bomb_status
                equals=ready
            [/variable]

            [then]
                [message]
                    speaker=unit
                    message= _ "I’m lighting it!"
                [/message]
                [sound]
                    name=fuse.ogg
                [/sound]
                [delay]
                    time=2000
                [/delay]
                [sound]
                    name=explosion.ogg
                [/sound]

                [remove_item]
                    x,y=17,24
                [/remove_item]

                [scroll]
                    x,y=10,10
                [/scroll]
                [scroll]
                    x,y=-10,-10
                [/scroll]
                [scroll]
                    x,y=10,10
                [/scroll]
                [scroll]
                    x,y=-10,-10
                [/scroll]
                {MODIFY_TERRAIN Re 18 23}
                {MODIFY_TERRAIN Ww 18 24}

                [redraw][/redraw]
                [message]
                    speaker=unit
                    message= _ "I’ve broken through!"
                [/message]

                {VARIABLE bomb_status blown}
            [/then]

            [else]
                [allow_undo]
                [/allow_undo]
            [/else]
        [/if]
    [/event]

    # Confrontation with Mal Brin
    [event]
        name=sighted
        [filter]
            id="Mal M'Brin"
        [/filter]

        [redraw][/redraw]
        [message]
            speaker="Ethiliel"
            message= _ "Mebrin! My teacher of old! Can that truly be you?"
        [/message]

        [message]
            speaker="Mal M'Brin"
            # wmllint: local spelling Eth
            message = _ "Eth...Ethiliel? You are here?"
        [/message]

        [message]
            speaker="Ethiliel"
            message= _ "How did you come to be here, you of all people, shut away from the trees and the light of the sun?"
        [/message]

        [message]
            speaker="Mal M'Brin"
            message = _ "I broke their chains. They bound me, the accursed humans. Bound me! Kidnapped me to raise undead for them. Menaced me with cold iron... ahh, the iron on my skin, it burned, it burned!"
        [/message]

        [message]
            speaker="Deoran"
            message= _ "What is this? Elves bear steel swords."
        [/message]

        [message]
            speaker="Ethiliel"
            message= _ "They are but warriors. All elves feel the shadow of iron, and to those who walk our higher paths it is a bane, interfering with our magic. But this touches on mysteries that are not for men to know, human. I bind you never to speak of it."
        [/message]

        [message]
            speaker="Mal M'Brin"
            message = _ "Humans! Betrayers! Tree-killers! They are a blight on the world! I shall bring my new servants north to the lands we so foolishly granted to men in ages past, and destroy them all!"
        [/message]

        [message]
            speaker="Ethiliel"
            message= _ "Your servants! Your servants are abominations worse than any human. They stink of the grave. This cannot be the sage Mebrin that I knew and revered speaking. He would never have allied himself with the dead against the living!"
        [/message]

        [message]
            speaker="Mal M'Brin"
            message= _ "I am called Mal M’Brin now, Ethiliel, best student of mine. It is time for a new lesson. I was such as you, full of doubt and weakness, but now I have passed over and become more than you know. There is infinity in death; I have touched the void at the heart of all things. You, too, can partake of its boundless power."
        [/message]

        [message]
            speaker="Mal M'Brin"
            message= _ "Join me! Stand by my side! We shall rise and sweep the humans from the green world. Their corpses will serve us; their bones will dance for our pleasure."
        [/message]

        [message]
            speaker="Ethiliel"
            message= _ "And when we were done, what would we have become? Unlife. Hungering shadows, devouring all we once cherished."
            image=portraits/ethiliel-mad.png
        [/message]

        [message]
            speaker="Ethiliel"
            message= _ "No. It shall not be. The sage Mebrin is dead. It is time to put him to rest."
        [/message]

        [message]
            speaker=Deoran
            image=portraits/deoran-mad.png
            message= _ "Even a mere human can see that you have become a mockery of all that you once believed in. I will destroy you and your works if it’s the last thing I do!"
        [/message]
        [message]
            speaker="Mal M'Brin"
            message= _ "You, destroy me? Fool human. You will die, and the elves you have seduced with you. And you shall serve me beyond death, forever."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id="Mal M'Brin"
        [/filter]

        [message]
            speaker="Mal M'Brin"
            message= _ "Nooo! This cannot be. The elves I once led have destroyed me. After all I have sacrificed, I still die..."
        [/message]

        {CLEAR_VARIABLE bomb_status}
        {CLEAR_VARIABLE troll_allies}
        {CLEAR_VARIABLE stored_side_1}
        {CLEAR_VARIABLE late_payment_for_troll_help}

        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]
[/scenario]