This file is indexed.

/usr/share/games/wesnoth/1.10/data/campaigns/Eastern_Invasion/scenarios/13_The_Drowned_Plains.cfg is in wesnoth-1.10-ei 1:1.10.2-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
#textdomain wesnoth-ei
[scenario]
    id=13_The_Drowned_Plains
    name= _ "The Drowned Plains"
    map_data="{campaigns/Eastern_Invasion/maps/13_The_Drowned_Plains.map}"
    {TURNS 28 26 24}
    next_scenario=14_Approaching_Weldyn

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC heroes_rite.ogg underground.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}
    {EXTRA_SCENARIO_MUSIC the_king_is_dead.ogg}

    {campaigns/Eastern_Invasion/utils/deaths.cfg}

    [story]
        [part]
            show_title=yes
            {TO_THE_DROWNED_PLAINS}
        [/part]
    [/story]

    [side]
        type=Lieutenant
        id=Gweddry
        name= _ "Gweddry"
        side=1
        canrecruit=yes
        controller=human
        team_name=wesnothians
        user_team_name=_"Wesnothians"
        fog=yes
        gold=200
        {FLAG_VARIANT loyalist}
    [/side]

    [side]
        no_leader=yes
        side=2
        color=blue
        controller=ai
        team_name=baddies
        user_team_name=_"Evil"
    [/side]

    [side]
        side=3
        color=green
        controller=ai
        team_name=baddies
        user_team_name=_"Evil"
        gold=0
        no_leader=yes
        [ai]
            #don't target any of the default things
            village_value=0
            leader_value=0
            protect_leader=0
            #stay in the middle of the map
            [avoid]
                [not]
                    x=14-32
                    y=10-45
                [/not]
            [/avoid]
            #and target anyone in it (otherwise it will have nothing to do when
            #it can't attack in the current turn)
            [target]
                #who knows what would happen if it targetted itself
                [not]
                    type="Skeletal Dragon"
                [/not]
                x=14-32
                y=10-45
                value=100.0
            [/target]
            #I don't know if this is needed, but it sure would be stupid to use
            #any grouping behavior when there's only one unit on this side!
            grouping=no
            #not sure if this really does anything; it was copied from IP's code
            aggression=1.0
            leader_aggression=0.4
            caution=0.0
        [/ai]

        #give the skeletal dragon something to do when there are no
        #enemies available let it look like it's wandering around
        #semi-randomly
        [ai]
            [leader_goal]
                x,y=14,10
            [/leader_goal]
            time_of_day=dawn
        [/ai]
        [ai]
            [leader_goal]
                x,y=23,26
            [/leader_goal]
            time_of_day=morning
        [/ai]
        [ai]
            [leader_goal]
                x,y=23,26
            [/leader_goal]
            time_of_day=afternoon
        [/ai]
        [ai]
            [leader_goal]
                x,y=32,32
            [/leader_goal]
            time_of_day=dusk
        [/ai]
        [ai]
            [leader_goal]
                x,y=32,10
            [/leader_goal]
            time_of_day=first_watch
        [/ai]
        [ai]
            [leader_goal]
                x,y=14,32
            [/leader_goal]
            time_of_day=second_watch
        [/ai]
    [/side]

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Defeat Khrakrahs"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Gweddry"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Dacyn"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Owaec"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

        [unit]
            type="Skeletal Dragon"
            id="Khrakrahs"
            name= _ "Khrakrahs"
            side=3
            x=28
            y=23
            canrecruit=yes
        [/unit]

        # Note: the code for the ambushers is mostly identical to that of
        # Crossroads in HttT.

        # Here we set up an array that holds the possible ambusher unit types.
        # We do this instead of just using a random type when creating the
        # ambusher so that the even distribution of different types is
        # guaranteed.

        {VARIABLE random_ambusher_type_table[0].type "Bone Shooter"}
        {VARIABLE random_ambusher_type_table[1].type "Revenant"}
        {VARIABLE random_ambusher_type_table[2].type "Shadow"}
        {VARIABLE random_ambusher_type_table[3].type "Wraith"}
        {VARIABLE random_ambusher_type_table[4].type "Necrophage"}

#ifdef NORMAL
        {VARIABLE random_ambusher_type_table[5].type "Banebow"}
#endif

#ifdef HARD
        {VARIABLE random_ambusher_type_table[5].type "Banebow"}
        {VARIABLE random_ambusher_type_table[6].type "Spectre"}
        {VARIABLE random_ambusher_type_table[7].type "Nightgaunt"}
#endif

        {VARIABLE random_ambusher_type_i 0}

        # With this macro we place a set number of ambushers (from the above list) to a
        # given rectangular area. We do this in blocks so that we can guarantee that
        # every major area has at least some ambushers: if we randomized the ambush
        # locations across all possible locations at once, the RNG could theoretically
        # clump all the ambushers into a single corner of the map.

#define UNDEAD_AMBUSH_AREA SIDE X_SPAN Y_SPAN NUMBER
    [store_locations]
        x={X_SPAN}
        y={Y_SPAN}
        terrain=Ss

        [filter_adjacent_location]
            [not]
                terrain=Ss
            [/not]

            [not]
                [filter]
                [/filter]
            [/not]
        [/filter_adjacent_location]

        variable=possible_ambush_locations
    [/store_locations]

    {VARIABLE ambusher 0}

    [while]
        [variable]
            name=ambusher
            less_than={NUMBER}
        [/variable]

        [do]
            {RANDOM 1..$possible_ambush_locations.length}
            {VARIABLE_OP random sub 1}

            # Check if the random location picked already contains an ambusher
            # and if it does, we loop again to pick another one until an empty
            # one is found.

            [if]
                [have_unit]
                    x,y=$possible_ambush_locations[$random].x,$possible_ambush_locations[$random].y
                [/have_unit]

                [else]
                    # random_ambusher_type_i is just a counter variable with
                    # which we point to a given element of the
                    # random_ambusher_type_table array. Here we make it loop
                    # over the array continuously.

                    [if]
                        [variable]
                            name=random_ambusher_type_i
                            less_than=4
                        [/variable]

                        [then]
                            {VARIABLE_OP random_ambusher_type_i add 1}
                        [/then]

                        [else]
                            {VARIABLE random_ambusher_type_i 0}
                        [/else]
                    [/if]

                    # And here we place an ambusher of a type specified by the
                    # random_ambusher_type_table and random_ambusher_type_i
                    # variables, thus always having the same ratio of different
                    # types.

                    [unit]
                        x,y=$possible_ambush_locations[$random].x,$possible_ambush_locations[$random].y
                        type=$random_ambusher_type_table[$random_ambusher_type_i].type
                        side={SIDE}
                        role=ambusher
                        random_traits=yes
                        upkeep=loyal
                    [/unit]

                    [object]
                        silent=yes

                        [filter]
                            x,y=$possible_ambush_locations[$random].x,$possible_ambush_locations[$random].y
                        [/filter]

                        [effect]
                            apply_to=new_ability

                            [abilities]
                                [hides]
                                    id=undead_ambush
                                    affect_self=yes

                                    [filter_self]
                                        role=ambusher

                                        [filter_location]
                                            terrain=Ss
                                        [/filter_location]
                                    [/filter_self]
                                [/hides]
                            [/abilities]
                        [/effect]
                    [/object]

                    {VARIABLE_OP ambusher add 1}
                [/else]
            [/if]
        [/do]
    [/while]
#enddef

        # Only the number of ambushers differs by difficulty here.

#ifdef EASY
        {UNDEAD_AMBUSH_AREA 2 1-27 1-32 25}
        {UNDEAD_AMBUSH_AREA 2 28-38 1-21 15}
        {UNDEAD_AMBUSH_AREA 2 38-45 5-28 10}
#endif
#ifdef NORMAL
        {UNDEAD_AMBUSH_AREA 2 1-27 1-32 27}
        {UNDEAD_AMBUSH_AREA 2 28-38 1-21 19}
        {UNDEAD_AMBUSH_AREA 2 38-45 5-28 13}
#endif
#ifdef HARD
        {UNDEAD_AMBUSH_AREA 2 1-27 1-32 29}
        {UNDEAD_AMBUSH_AREA 2 28-38 1-21 21}
        {UNDEAD_AMBUSH_AREA 2 38-45 5-28 16}
#endif

        {CLEAR_VARIABLE possible_ambush_locations}
        {CLEAR_VARIABLE random_ambusher_type_table}
        {CLEAR_VARIABLE random_ambusher_type_i}
        {CLEAR_VARIABLE ambusher}
    [/event]

    [event]
        name=turn refresh
        first_time_only=no

        [if]
            [variable]
                name=side_number
                numerical_equals=2
            [/variable]

            [then]
                {MODIFY_UNIT side,role=2,ambusher moves 0}
            [/then]
        [/if]
    [/event]

    [event]
        name=moveto
        first_time_only=no

        [filter]
            side=1

            [filter_adjacent]
                side=2
                role=ambusher
            [/filter_adjacent]
        [/filter]

        {MODIFY_UNIT (
            side=2
            role=ambusher

            [filter_adjacent]
                x,y=$x1,$y1
            [/filter_adjacent]
        ) role not_ambusher}

        [redraw][/redraw]
    [/event]

    [event]
        name=start
        [recall]
            id=Dacyn
        [/recall]
        [recall]
            id=Owaec
        [/recall]
        [recall]
            id=Grug
        [/recall]
        [recall]
            id=Engineer
        [/recall]
        [message]
            speaker=Owaec
            message= _ "Now, we have reached the Horse Plains, the fair homeland of my people. They may be able to help us in—"
        [/message]
        [message]
            speaker=Owaec
            message= _ "What?! Swamps?! Those undead have destroyed the grasslands of my House, and they shall pay for it!"
        [/message]
        [message]
            speaker=Dacyn
            message= _ "The lich-lord must have flooded the valley. The undead like the swamp. It is death, decay, everything that they are themselves. I can sense them lurking in the swamps, waiting to ambush us."
        [/message]
        [message]
            speaker=Engineer
            message= _ "I s’ppose we’ll hav’ to wade across it anyway... ugh."  # wmllint: no spellcheck
        [/message]
        [scroll_to]
            x,y=28,23
        [/scroll_to]
        [message]
            caption= _ "Khrakrahs"
            image=units/unknown-unit.png
            message= _ "Findshhhh... slayhhhh... killhhhh..."   # wmllint: no spellcheck
        [/message]
        [message]
            speaker=Gweddry
            message= _ "What is that sound?!"
        [/message]
        [message]
            speaker=Dacyn
            message= _ "I do not know, but my guess is the dragon Khrakrahs. He was a powerful beast indeed, in the time of Haldric, living in the Northern Mountains. But he does not sound alive. I know not what happened, but we must surely destroy him."
        [/message]
    [/event]

    [event]
        name=sighted
        [filter]
            id=Khrakrahs
        [/filter]
        [fire_event]
            name=KK_spotted
        [/fire_event]
    [/event]
    [event]
        name=moveto
        [filter]
            id=Khrakrahs
            [filter_vision]
                viewing_side=1
            [/filter_vision]
        [/filter]
        [fire_event]
            name=KK_spotted
        [/fire_event]
    [/event]

    [event]
        name=KK_spotted
        [redraw]
            side=1
        [/redraw]
        [scroll_to]
            x,y=$x1,$y1
        [/scroll_to]
        [message]
            caption= _ "Dacyn"
            image=portraits/dacyn.png
            message= _ "Aha! I see what they have done. They have raised him as an undead dragon. But he does not appear to be weak to my arcane senses... this is strange magic indeed."
        [/message]
    [/event]

    [event]
        name=enemies defeated

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

    {WESNOTH_DEFEAT}
[/scenario]