This file is indexed.

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

    name= _ "The Tides of War"
    next_scenario=09b_Bandit_Epilogue

    {SCENARIO_MUSIC knalgan_theme.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}
    {EXTRA_SCENARIO_MUSIC siege_of_laurelmor.ogg}

    map_data="{campaigns/The_South_Guard/maps/08b_The_Tides_of_War.map}"

    {DAWN}
    {MORNING}
    {AFTERNOON}
    {DUSK}
    {FIRST_WATCH}
    {SECOND_WATCH}

    victory_when_enemies_defeated=yes
    turns=60

    # 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=200
        {INCOME 4 2 0}

        fog=no
        shroud=no

        canrecruit=yes
        recruit=Bowman, Spearman, Cavalryman, Footpad, Thug
    [/side]

    # The Undead Hordes

    [side]
        side=2
        type=Ancient Lich
        id="Mal M'Brin"
        name= _ "Mal M’Brin"

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

        {GOLD 400 700 900}
        {INCOME 20 30 40}

        canrecruit=yes
        [ai]
            recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,archer,mixed fighter
            aggression=1.0
            caution=0.0
            [target]
                id=Deoran
                value=6.0
            [/target]
        [/ai]
        recruit=Wraith,Shadow,Revenant,Draug,Bone Shooter,Blood Bat,Chocobone,Dark Sorcerer,Necrophage
        {FLAG_VARIANT undead}
    [/side]

    {STARTING_VILLAGES 2 5}

    [event]
        name=prestart

#define ILLUMINATING_CAMPFIRE X Y
    # {ANIMATED_CAMPFIRE {X} {Y}}

    [item]
        x,y={X},{Y}
        image=scenery/fire1.png
    [/item]

    [item]
        x,y={X},{Y}
        halo=halo/fire-aura.png
    [/item]

    [store_locations]
        x,y={X},{Y}
        radius=2

        variable=illuminated_locations
    [/store_locations]

    [time_area]
        find_in=illuminated_locations

        {MORNING}
        {MORNING}
        {AFTERNOON}
        {AFTERNOON}
        {DUSK}
        {DAWN}
    [/time_area]
#enddef

        [set_variables]
            name=pebbles_defense_benefits

            [value]
                turn=6
                {MODIFY_TERRAIN Ce 30 17}
                {VARIABLE defenses some}
            [/value]
            [value]
                turn=7
                {NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 30 17 () (_"Provincial Guard")} {GUARDIAN}
                {VARIABLE provincial_guard some}
            [/value]
            [value]
                turn=8
                {MODIFY_TERRAIN Ce 27 17}
            [/value]
            [value]
                turn=9
                {NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 27 17 () (_"Provincial Guard")} {GUARDIAN}
            [/value]
            [value]
                turn=10
                {MODIFY_TERRAIN Re^Vct 16 9}
                {MODIFY_TERRAIN Re^Vct 16 11}
            [/value]
            [value]
                turn=11
                {MODIFY_TERRAIN Re^Vct 17 14}
                {MODIFY_TERRAIN Re^Vct 19 15}
            [/value]
            [value]
                turn=12
                {MODIFY_TERRAIN Ch 20 11}
                {MODIFY_TERRAIN Ch 22 10}
            [/value]
            [value]
                turn=13
                {MODIFY_TERRAIN Ce 25 17}
                {MODIFY_TERRAIN Gd 26 16}
                {NAMED_GENERIC_UNIT 1 (Lieutenant) 25 17 (Lt. Nilaf) (_"Lt. Nilaf")} {GUARDIAN}
            [/value]
            [value]
                turn=14
                {MODIFY_TERRAIN Ce 23 17}
                {MODIFY_TERRAIN Gd 24 16}
                {NAMED_GENERIC_UNIT 1 (Spearman) 23 17 () (_"Provincial Guard")} {GUARDIAN}
            [/value]
            [value]
                turn=15
                {MODIFY_TERRAIN Ce 14 17}
                {NAMED_GENERIC_UNIT 1 (Bowman) 14 17 () (_"Provincial Guard")} {GUARDIAN}
            [/value]
            [value]
                turn=16
                {MODIFY_TERRAIN Ce 34 17}
                {NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 34 17 () (_"Provincial Guard")} {GUARDIAN}
                {VARIABLE provincial_guard full}
            [/value]
            [value]
                turn=17
                {ILLUMINATING_CAMPFIRE 20 16}
            [/value]
            [value]
                turn=18
                {ILLUMINATING_CAMPFIRE 11 14}
            [/value]
            [value]
                turn=19
                {ILLUMINATING_CAMPFIRE 26 16}
            [/value]
            [value]
                turn=20
                {MODIFY_TERRAIN Gd 35 17}
                {ILLUMINATING_CAMPFIRE 35 17}
            [/value]
            [value]
                turn=21
                {MODIFY_TERRAIN Ce 23 21}
            [/value]
            [value]
                turn=22
                {MODIFY_TERRAIN Ce 26 21}
                {VARIABLE defenses full}
            [/value]
        [/set_variables]

        {FOREACH pebbles_defense_benefits i}
            [if]
                [variable]
                    name=pebbles_defense_length
                    greater_than_equal_to=$pebbles_defense_benefits[$i].turn
                [/variable]

                [then]
                    [insert_tag]
                        name=command
                        variable=pebbles_defense_benefits[$i]
                    [/insert_tag]
                [/then]
            [/if]
        {NEXT i}

        # the player gets 20 extra starting gold for each turn past 22
        [if]
            [variable]
                name=pebbles_defense_length
                greater_than=22
            [/variable]

            [then]
                {VARIABLE turns_past_22 $pebbles_defense_length}
                {VARIABLE_OP turns_past_22 sub 22}

                {VARIABLE extra_starting_gold 20}
                {VARIABLE_OP extra_starting_gold multiply $turns_past_22}

                [gold]
                    side=1
                    amount=$extra_starting_gold
                [/gold]
            [/then]
        [/if]

        {CLEAR_VARIABLE pebbles_defense_benefits,illuminated_locations}
    [/event]

    [event]
        name=prestart

        {VARIABLE village_radius $pebbles_defense_length}
        {VARIABLE_OP village_radius sub 5}

        [if]
            [variable]
                name=village_radius
                less_than=2
            [/variable]

            [then]
                {VARIABLE village_radius 2}
            [/then]
        [/if]

        [if]
            [variable]
                name=village_radius
                greater_than=20
            [/variable]

            [then]
                {VARIABLE village_radius 20}
            [/then]
        [/if]
    [/event]

    {STARTING_VILLAGES 1 $village_radius}

    #start
    [event]
        name=start
        [recall]
            id=Minister Hylas
            x,y=21,11
        [/recall]
        [recall]
            id=Jarek
            x,y=21,12
        [/recall]
        [recall]
            id=Moreth
            x,y=22,12
        [/recall]

        [message]
            speaker=Deoran
            message= _ "Look! The undead army has broken through Sir Gerrick’s lines! Alas, he is lost!"
        [/message]

        [message]
            speaker=Moreth
            message= _ "Since I was a boy, Gerrick was my leader, and there was no one braver. Today we shall defend our homes, and avenge him!"
        [/message]

        [if]
            [variable]
                name=provincial_guard
                equals=some
            [/variable]
            [variable]
                name=defenses
                equals=some
            [/variable]
            [then]
                [message]
                    speaker=Deoran
                    message= _ "But in the narrow window his valiant stand gave us, we have roused some of the provincial guard and reinforced our defenses!"
                [/message]
            [/then]
            [else]
                [if]
                    [variable]
                        name=provincial_guard
                        equals=full
                    [/variable]
                    [variable]
                        name=defenses
                        equals=some
                    [/variable]
                    [then]
                        [message]
                            speaker=Deoran
                            message= _ "But in the narrow window his valiant stand gave us, we have roused the whole provincial guard and reinforced our defenses!"
                        [/message]
                    [/then]
                    [else]
                        [if]
                            [variable]
                                name=provincial_guard
                                equals=full
                            [/variable]
                            [variable]
                                name=defenses
                                equals=full
                            [/variable]
                            [then]
                                [message]
                                    speaker=Deoran
                                    message= _ "But in the narrow window his valiant stand gave us, we have roused the whole provincial guard and fully embattled the city!"
                                [/message]
                            [/then]
                        [/if]
                    [/else]
                [/if]
            [/else]
        [/if]

        [message]
            speaker=Lt. Nilaf
            message= _ "Indeed, Lord, we are ready to defend our homes!"
        [/message]

        [if]
            [variable]
                name=pebbles_defense_length
                less_than=24
            [/variable]
            [then]
                [message]
                    speaker=Minister Hylas
                    message= _ "I have summoned the great Council of Westin!"
                [/message]
                # wmllint: local spelling Mefel
                {NAMED_LOYAL_UNIT 1 (Silver Mage) 11 1 (Minister Mefel) (_"Minister Mefel")}
                [message]
                    speaker=Minister Mefel
                    message= _ "Hylas, I have made all possible haste, but my Council brethren are not as swift as I. It will take more time for them to arrive."
                [/message]
                {VARIABLE council_arrive_turn 25}
                {VARIABLE_OP council_arrive_turn sub $pebbles_defense_length}
            [/then]

            [else]
                [message]
                    speaker=Minister Hylas
                    message= _ "And I have summoned the great Council of Westin! They will battle with all their might!"
                [/message]
                {NAMED_LOYAL_UNIT 1 (Silver Mage) 11 1 (Minister Mefel) (_"Minister Mefel")}
                {NAMED_LOYAL_UNIT 1 (Arch Mage) 10 1 (Minister Romand) (_"Minister Romand")}
                {NAMED_LOYAL_UNIT 1 (Red Mage) 12 1 (Minister Alanafel) (_"Minister Alanafel")}
                {GENERIC_UNIT 1 (White Mage) 9 1}
                {GENERIC_UNIT 1 (White Mage) 13 1}
                [message]
                    speaker=Minister Mefel
                    message= _ "We have heard your summons, and we shall send these dark foes back to the abyss that spawned them!"
                [/message]
                [message]
                    speaker=Deoran
                    message= _ "Council of Westin, we are cheered by your presence. Your aid will be most welcome."
                [/message]
            [/else]
        [/if]

        [message]
            speaker=Deoran
            message= _ "We have rallied all the forces that we will be able to! Let us not make Sir Gerrick’s sacrifice a vain one. For Wesnoth!"
        [/message]

        [if]
            [variable]
                name=pebbles_defense_length
                less_than=24
            [/variable]
            [then]
                [objectives]
                    side=1
                    [objective]
                        description= _ "Defeat Mal M’Brin"
                        condition=win
                    [/objective]
                    [objective]
                        description= _ "Death of Deoran"
                        condition=lose
                    [/objective]

                    {TURNS_RUN_OUT}

                    note= _ "The Council of Westin will arrive on turn $council_arrive_turn|."
                [/objectives]
            [/then]
            [else]
                [objectives]
                    side=1
                    [objective]
                        description= _ "Defeat Mal M’Brin"
                        condition=win
                    [/objective]
                    [objective]
                        description= _ "Death of Deoran"
                        condition=lose
                    [/objective]

                    {TURNS_RUN_OUT}
                [/objectives]
            [/else]
        [/if]
    [/event]

    [event]
        name=new turn
        first_time_only=no

        [if]
            [variable]
                name=council_arrive_turn
                equals=$turn_number
            [/variable]
            [variable]
                name=council_arrive_turn
                not_equals=$empty
            [/variable]
            [then]
                {NAMED_LOYAL_UNIT 1 (Arch Mage) 10 1 (Minister Romand) (_"Minister Romand")}
                {NAMED_LOYAL_UNIT 1 (Red Mage) 12 1 (Minister Alanafel) (_"Minister Alanafel")}
                {GENERIC_UNIT 1 (White Mage) 9 1}
                {GENERIC_UNIT 1 (White Mage) 13 1}
                [message]
                    speaker=Minister Romand
                    message= _ "We have heard your summons, and we shall send these dark foes back to the abyss that spawned them!"
                [/message]
                [message]
                    speaker=Deoran
                    message= _ "Council of Westin, we are cheered by your presence. Your aid will be most welcome."
                [/message]

                [objectives]
                    side=1
                    silent=yes
                    [objective]
                        description= _ "Defeat Mal M’Brin"
                        condition=win
                    [/objective]
                    [objective]
                        description= _ "Death of Deoran"
                        condition=lose
                    [/objective]

                    {TURNS_RUN_OUT}
                [/objectives]
            [/then]
        [/if]
    [/event]

    [event]
        name=die

        [filter]
            id="Mal M'Brin"
        [/filter]

        [endlevel]
            result=victory
            carryover_report=no
            save=no
        [/endlevel]
    [/event]

    # in order to allow Hylas to die, the death events aren't included from the
    # standard location here
    [event]
        name=last breath
        [filter]
            id=Deoran
        [/filter]
        [message]
            speaker=unit
            image=portraits/deoran-sad.png
            message= _ "I have failed my kingdom and duty..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Minister Hylas
        [/filter]
        [message]
            speaker=unit
            image=portraits/hylas.png
            message= _ "Now I will never see Westin free again..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Jarek
        [/filter]
        [message]
            speaker=unit
            message= _ "Far from home I fall — but not in vain! Guard our people, Deoran!"
        [/message]
    [/event]
[/scenario]