This file is indexed.

/usr/share/games/wesnoth/1.10/data/campaigns/The_South_Guard/scenarios/04_Vale_of_Tears.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
#textdomain wesnoth-tsg
[scenario]
    id=04_Vale_of_Tears

    name= _ "Vale of Tears"
    next_scenario=05_Choice_in_the_Fog

    {SCENARIO_MUSIC elvish-theme.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}

    map_data="{campaigns/The_South_Guard/maps/04_Vale_of_Tears.map}"

    {campaigns/The_South_Guard/utils/sg_deaths.cfg}

    {DEFAULT_SCHEDULE}

    {TURNS 40 32 28}
    victory_when_enemies_defeated=no

    # 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}

        {GOLD 150 125 80}

        canrecruit=yes
        recruit=Bowman, Spearman, Cavalryman

        [village]
            x,y=3,10
        [/village]

        [village]
            x,y=4,13
        [/village]

        [village]
            x,y=8,15
        [/village]
    [/side]

    {STARTING_VILLAGES 1 5}

    # The Undead Hordes

    [side]
        side=2
#ifdef EASY
        type=Dark Adept
#endif
#ifdef NORMAL
        type=Dark Sorcerer
#endif
#ifdef HARD
        type=Necromancer
#endif
        id="Mal A'kai"
        name= _ "Mal A’kai"
        facing=sw

        {GOLD 70 90 120}

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

        canrecruit=yes
        [ai]
#ifdef EASY
            recruitment_pattern=fighter
#else
            recruitment_pattern=fighter,archer
#endif
            {QUANTITY aggression 0.5 0.6 0.7}
            {ATTACK_DEPTH 3 4 5}
            [target]
                id=Ethiliel
                value=3.0
            [/target]
        [/ai]
#ifdef EASY
        recruit=Walking Corpse,Skeleton
#endif
#ifdef NORMAL
        recruit=Walking Corpse,Skeleton, Skeleton Archer,Ghoul
#endif
#ifdef HARD
        recruit=Walking Corpse,Skeleton, Revenant, Skeleton Archer,Bone Shooter,Ghoul
#endif
        {FLAG_VARIANT undead}
    [/side]

    {STARTING_VILLAGES 2 14}

    # The Bandit Army

    [side]
        side=3
        type=Outlaw
        id=Jera Ilras
        name= _ "Jera Ilras"
        facing=sw

        {GOLD 30 40 80}

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

        canrecruit=yes
        [ai]
#ifdef EASY
            recruitment_pattern=scout,archer
#else
            recruitment_pattern=fighter,scout,archer
#endif
            {QUANTITY aggression 0.2 0.3 0.4}
            [target]
                id=Ethiliel
                value=2.0
            [/target]
            [avoid]
                x,y=27-35,29-35
            [/avoid]
        [/ai]
#ifdef EASY
        recruit=Footpad,Poacher
#endif
#ifdef NORMAL
        recruit=Footpad,Thug,Poacher
#endif
#ifdef HARD
        recruit=Footpad,Thug,Poacher,Thief
#endif
        {FLAG_VARIANT ragged}
    [/side]

    {STARTING_VILLAGES 3 9}

    #start
    [event]
        name=start
        [recall]
            id=Sir Gerrick
        [/recall]
        [recall]
            id=Ethiliel
        [/recall]
        [recall]
            id=Minister Hylas
        [/recall]
        [recall]
            id=Jarek
        [/recall]

        [message]
            speaker=Deoran
            message= _ "We have followed you away from our homes and left them unguarded. Now, where can we find this sage who knows the southern forest well?"
        [/message]

        [message]
            speaker=Ethiliel
            message= _ "This is the Vale of Blossoming Trees. Our great sages come here to live when they feel that it is time for them to allow others to lead our people. The sage you speak of lives in a secluded village between the two lakes."
        [/message]

        {HIGHLIGHT_IMAGE 31 32 items/gohere.png ()}

        [message]
            speaker=Sir Gerrick
            message= _ "Why, my lady, are there humans camped to the south of us? Are they friends of the elves? I had thought that no humans had set foot in this valley."
        [/message]

        [message]
            speaker=Ethiliel
            image=portraits/ethiliel-mad.png
            message= _ "What?! Those are no friends of the elves! They are brigands, and they must be destroyed!"
        [/message]

        [message]
            speaker=Deoran
            message= _ "Perhaps they are allied with the bandits who have been sacking our towns! They have grown bold to attack the elves!"
        [/message]

        [message]
            speaker=Ethiliel
            message= _ "Destroy these intruders, and I will ask him to help you. He is ancient, and he remembers well Haldric’s betrayal of the elves, so if a human sets foot in his village first, he almost certainly will have nothing to do with us!"
        [/message]

        [message]
            speaker=Sir Gerrick
            message= _ "Sounds like a charming fellow..."
        [/message]

        [message]
            speaker=Deoran
            message= _ "Yet, as she says, he is our best hope to rid our lands of this new menace. We do that which we must. Ethiliel, you make for Mebrin’s village. We will handle the intruders."
        [/message]

        [message]
            speaker="Mal A'kai"
            message= _ "Ha! You’re too late. We’ve taken what we want from this valley."
        [/message]

        [message]
            speaker=Jera Ilras
            message= _ "Now your blood and tears will join that of the elves!"
        [/message]

        [objectives]
            side=1
            [objective]
                description= _ "Cleanse the Vale of Tears"
                condition=win
            [/objective]
            [objective]
                description= _ "Move Ethiliel to Mebrin’s village"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Deoran"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Sir Gerrick"
                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=attack_end

        [filter]
            side=1
        [/filter]

        [filter_attack]
            type=pierce
        [/filter_attack]

        [filter_second]
            type=Skeleton, Revenant, Deathblade, Draug, Skeleton Archer, Bone Shooter, Banebow
        [/filter_second]

        # only comment on pierce damage being useless if the player didn't
        # actually kill the skeleton with it
        [if]
            [variable]
                name=second_unit.hitpoints
                greater_than=0
            [/variable]

            [then]
                [message]
                    speaker=unit
                    message= _ "Our weapons are useless against these skeletons! They have nothing for our shafts to pierce but air!"
                [/message]
            [/then]
        [/if]

        [message]
            speaker=Deoran
            message= _ "We must clear out these undead if you are to reach Mebrin’s village! What should we do?"
        [/message]

        [message]
            speaker=Ethiliel
            message= _ "For now, I can slow them down. Where are the elves who used to live in this valley? They should come to our aid!"
        [/message]

        [message]
            speaker=Deoran
            message= _ "You said this valley would be safe, and we find it filled with skeletal foes! Cannot some of your elf friends help us in our struggle?"
        [/message]
    [/event]

    [event]
        name=last breath

        [filter]
            side=1
        [/filter]

        [message]
            speaker=unit
            message= _ "I shall not join these accursed undead! Bury me deeply my friends..."
        [/message]

        [kill]
            x,y=$x1,$y1
            animate=yes
        [/kill]

        [message]
            speaker=Ethiliel
            message= _ "You shall not die in vain! My bodyguard will avenge you!"
        [/message]

        [message]
            speaker=Sir Gerrick
            message= _ "You have a bodyguard?!"
        [/message]

        [message]
            speaker=Deoran
            message= _ "You have a bodyguard?!"
        [/message]

        [store_unit]
            [filter]
                id=Ethiliel
            [/filter]
            variable=ethiliel_loc
            kill=no
        [/store_unit]

        [store_locations]
            terrain=*^F*
            [and]
                x,y=$ethiliel_loc.x,$ethiliel_loc.y
                radius=3
            [/and]
            variable=bodyguard_loc
        [/store_locations]

        {VARIABLE number 0}
        [while]
            [variable]
                name=number
                less_than=$bodyguard_loc.length
            [/variable]
            [variable]
                name=number
#ifdef EASY
                less_than=4
#endif
#ifdef NORMAL
                less_than=3
#endif
#ifdef HARD
                less_than=2
#endif
            [/variable]
            [do]
                # fallback coordinates, in case no nearby vacant forest is found
                {VARIABLE guard_x $ethiliel_loc.x}
                {VARIABLE guard_y $ethiliel_loc.y}

                [set_variable]
                    name=guard_x
                    value=$bodyguard_loc[$number].x
                [/set_variable]

                [set_variable]
                    name=guard_y
                    value=$bodyguard_loc[$number].y
                [/set_variable]

                [unit]
                    role=Elvish Bodyguard
                    name= _ "Elvish Bodyguard"
                    type=Elvish Ranger
                    side=1
                    x,y=$guard_x,$guard_y
                    random_traits=yes
                    [modifications]
                        {TRAIT_LOYAL}
                    [/modifications]
                    {IS_LOYAL}
                [/unit]

                {VARIABLE_OP number add 1}
            [/do]
        [/while]

        {CLEAR_VARIABLE bodyguard_loc,ethiliel_loc,number}

        [message]
            role=Elvish Bodyguard
            message= _ "We stand ready, my lady, to protect you! We shall lead these men of Wesnoth into the fray!"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            role=Elvish Bodyguard
        [/filter]

        [message]
            speaker=unit
            message= _ "For my lady I fall..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id="Mal A'kai"
        [/filter]

        [message]
            speaker="Mal A'kai"
            message= _ "Finally, release! Thank you, my friends..."
        [/message]

        [kill]
            x,y=$x1,$y1
            animate=yes
        [/kill]

        {VARIABLE undead_defeated "yes"}

        [if]
            [variable]
                name=mebrin_found
                equals=yes
            [/variable]
            [variable]
                name=undead_defeated
                equals=yes
            [/variable]
            [variable]
                name=bandits_defeated
                equals=yes
            [/variable]
            [then]
                #           [kill]
                #               type=Elvish Ranger,Elvish Avenger
                #               animate=no
                #               fire_event=no
                #           [/kill]

                {CLEAR_VARIABLE mebrin_found}
                {CLEAR_VARIABLE undead_defeated}
                {CLEAR_VARIABLE bandits_defeated}

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

    [event]
        name=last breath
        [filter]
            id=Jera Ilras
        [/filter]

        [message]
            speaker=Jera Ilras
            message= _ "You’re too late! You’ll never find our stronghold, and even if you did, what can you do against the dead?"
        [/message]

        [message]
            speaker=second_unit
            message= _ "You, at least, will trouble us no more!"
        [/message]

        [kill]
            x,y=$x1,$y1
            animate=yes
        [/kill]

        {VARIABLE bandits_defeated "yes"}

        [if]
            [variable]
                name=mebrin_found
                equals=yes
            [/variable]
            [variable]
                name=undead_defeated
                equals=yes
            [/variable]
            [variable]
                name=bandits_defeated
                equals=yes
            [/variable]
            [then]
                #           [kill]
                #               type=Elvish Ranger,Elvish Avenger
                #               animate=no
                #               fire_event=no
                #           [/kill]

                {CLEAR_VARIABLE mebrin_found}
                {CLEAR_VARIABLE undead_defeated}
                {CLEAR_VARIABLE bandits_defeated}

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

    # Ethieliel arrives at Mebrin’s village

    [event]
        name=moveto
        [filter]
            id=Ethiliel
            x,y=31,32
        [/filter]

        [remove_item]
            x,y=31,32
        [/remove_item]

        [message]
            speaker=Ethiliel
            message= _ "Mebrin! Are you there? We have come to seek your aid!"
        [/message]

        [message]
            speaker=narrator
            message= _ "..."
            image=wesnoth-icon.png
        [/message]

        [message]
            speaker=Ethiliel
            message= _ "Mebrin! Where are you?!"
        [/message]

        [message]
            speaker=narrator
            message= _ "..."
            image=wesnoth-icon.png
        [/message]

        [message]
            speaker=Ethiliel
            message= _ "His home is empty... There are footprints leading away to the south... What can have happened here?"
        [/message]

        [message]
            speaker=Sir Gerrick
            message= _ "Maybe whoever summoned these undead knows where he is?"
        [/message]

        [message]
            speaker=Ethiliel
            message= _ "There is no blood here, yet no Mebrin. Someone must have kidnapped him. But the undead would have slain him and made him one of them. Who then can have taken him?"
        [/message]

        [message]
            speaker=Sir Gerrick
            message= _ "Maybe the bandits who have been summoning the undead took him?"
        [/message]

        [message]
            speaker=Ethiliel
            image=portraits/ethiliel-mad.png
            message= _ "We must follow these footprints into the woods! Whoever took our greatest sage must pay! Nothing will stop the vengeance of the elves!"
        [/message]

        [message]
            speaker=Deoran
            message= _ "Well, vengeance or no, if you will lead us into the forest, we will follow you and battle the undead!"
        [/message]

        {VARIABLE mebrin_found "yes"}

        [if]
            [variable]
                name=mebrin_found
                equals=yes
            [/variable]
            [variable]
                name=undead_defeated
                equals=yes
            [/variable]
            [variable]
                name=bandits_defeated
                equals=yes
            [/variable]
            [then]
                #   [kill]
                #       type=Elvish Ranger,Elvish Avenger
                #       animate=no
                #       fire_event=no
                #   [/kill]

                {CLEAR_VARIABLE mebrin_found}
                {CLEAR_VARIABLE undead_defeated}
                {CLEAR_VARIABLE bandits_defeated}

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