#textdomain wesnoth-l
[scenario]
    id=07_Glory
    name= _ "Glory"
    next_scenario=08_Epilogue
    victory_when_enemies_defeated=no
    map_file=07_Glory.map
    {TURNS 36 34 32}
    {DEFAULT_SCHEDULE_AFTERNOON}

    {INTRO_AND_SCENARIO_MUSIC legends_of_the_north.ogg loyalists.ogg}
    {EXTRA_SCENARIO_MUSIC vengeful.ogg}
    {EXTRA_SCENARIO_MUSIC the_city_falls.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}
    {EXTRA_SCENARIO_MUSIC breaking_the_chains.ogg}

    # wmllint: local spelling Archmagi
    [story]
        [part]
            story= _ "From the Annals of Alduin, 98 YW

One score and eight years ago, in 70 YW, the King of Wesnoth and the Lord of Elensefar signed a treaty of trade and alliance in order to further the security of humankind. The realization of this treaty required the creation of a safe path between Weldyn and Elensefar, with all manner of hostile creature or beast scoured from these civilized lands. From Dan’Tonk, the establishment of Aldril and Carcyn secured the once hazardous passage alongside the Grey Woods, completing the way between the two cities. With this, the alliance can truly be deemed a coalition of men."
        [/part]
        [part]
            background=story/Halstead.webp
            story= _ "To commemorate the concordat, six years ago, the Lords of Weldyn and Elensefar decreed that a monument be erected in the heart of these once wildlands. We, the magi of Alduin, lent our services to demonstrate the full prowess and might of human magic. Above a series of old catacombs in a scant hill, we spent these years raising an immense stronghold from the earth’s living rock."
        [/part]
        [part]
            background=story/Halstead.webp
            story= _ "Completed, as it is on this day, this sentinel of the west now towers hundreds of paces tall, a great monolith looming sheer above the plains. The sight of these colossal walls, to even us magi, is both awe-inspiring and terrifying. So tall these towers peak and so mighty these walls arise that such a feat seems more like a force of nature than a work of man. That we have fashioned this mountain as insignificant humans is almost inconceivable. Halstead, as we have named it, is impenetrable. No one shall ever overcome these tidal waves of stone."
        [/part]
    [/story]

    {LIBERTY_BIGMAP {JOURNEY_07_NEW} }

    [side]
        side=1
        color=black
        type=Highwayman
        id=Baldras
        recruit=Thug,Footpad,Poacher,Rogue Mage,Shadow Mage,Thief,Rogue
        canrecruit=yes
        controller=human
        {GOLD 300 270 240}
        team_name=good_guys
        user_team_name=_"Rebels"
    [/side]

    {STARTING_VILLAGES 1 4}

    [side]
        side=2
        color=red
        type=General
        id=Dommel
        name= _ "Dommel"
        profile=portraits/dommel.webp
        canrecruit=yes
        recruit=Swordsman,Pikeman,Dragoon,Shock Trooper,Longbowman,Red Mage,White Mage,Spearman,Heavy Infantryman,Bowman
        {GOLD 240 270 300}
        {INCOME 33 36 39}
        controller=ai
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT passive_leader yes}
            {AI_SIMPLE_ALWAYS_ASPECT village_value 0}
            {AI_SIMPLE_ALWAYS_ASPECT leader_value 0}
            {AI_SIMPLE_DAY_ASPECT aggression 0.4}
            {AI_SIMPLE_NIGHT_ASPECT aggression 0}
            {AI_SIMPLE_ALWAYS_ASPECT caution 0.9}
            [goal]
                name=target_location
                [criteria]
                    x=15-17,23-25,15-17,23-25
                    y=10-12,10-12,16-18,16-18
                [/criteria]
                value=10
            [/goal]
            [goal]
                name=protect_location
                [criteria]
                    x,y=20,14
                [/criteria]
                protect_radius=8
                value=20
            [/goal]
        [/ai]
        team_name=bad_guys
        user_team_name=_"Weldyn"
        {FLAG_VARIANT loyalist}
    [/side]

    {STARTING_VILLAGES 2 20}

    [side]
        side=3
        color=orange
        type=Orcish Warlord
        id=Vashna
        name= _ "Vashna"
        canrecruit=yes
        facing=sw
        recruit=Wolf Rider,Orcish Grunt,Orcish Archer,Orcish Assassin,Troll,Troll Whelp
        {GOLD 300 330 360}
        {INCOME 6 7 8}
        controller=ai
        [ai]
            scout_village_targeting=1
            {AI_SIMPLE_NIGHT_ASPECT aggression 0.9}
            {AI_SIMPLE_DAY_ASPECT aggression 0.5}
            {AI_SIMPLE_ALWAYS_ASPECT caution 0.2}
            [goal]
                [criteria]
                    side=2
                [/criteria]
                value=10
            [/goal]
        [/ai]
        team_name=orcs_dammit
        user_team_name=_"Orcs"
        {FLAG_VARIANT6 ragged}
    [/side]

    {STARTING_VILLAGES 3 5}

    [side]
        side=4
        color=teal
        no_leader=yes
        {GOLD 225 200 175}
        controller=ai
        team_name=good_guys
        user_team_name=_"Rebels"
        [ai]
            aggression=0.6
            caution=0.6
            leader_value=0.5
            [goal]
                [criteria]
                    side=2
                [/criteria]
                value=10
            [/goal]
        [/ai]
    [/side]

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Destroy the stronghold of Halstead"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}
        [/objectives]

        #Initialize the counter and switches
        {VARIABLE supports_destroyed 0}

        #Set up the inside of the fortress just like we want it
        {PLACE_IMAGE scenery/trapdoor-closed.png 15 11}
        {PLACE_IMAGE scenery/trapdoor-closed.png 25 11}
        {PLACE_IMAGE scenery/trapdoor-closed.png 15 18}
        {PLACE_IMAGE scenery/trapdoor-closed.png 25 18}

        #Some badass trapdoor guards
#define MK_GUARD SIDE TYPE X Y
    # Create a guard unit TYPE belonging to SIDE at X,Y
    # Will have a guardian AI, no traits, and a generated description.
    [unit]
        type={TYPE}
        side={SIDE}
        x={X}
        y={Y}
        ai_special=guardian
        generate_name=yes
    [/unit]
#enddef
        {MK_GUARD 2 (Swordsman)  16 11}
        {MK_GUARD 2 (Swordsman)  24 11}
        {MK_GUARD 2 (Swordsman)  16 17}
        {MK_GUARD 2 (Swordsman)  24 17}
        {MK_GUARD 2 (Pikeman)      17 11}
        {MK_GUARD 2 (Pikeman)      24 12}
        {MK_GUARD 2 (Pikeman)      16 16}
        {MK_GUARD 2 (Pikeman)      23 18}
#ifdef NORMAL
        {MK_GUARD 2 (Longbowman)   16 12}
        {MK_GUARD 2 (Longbowman)   23 11}
        {MK_GUARD 2 (Longbowman)   17 18}
        {MK_GUARD 2 (Longbowman)   24 16}
#endif
#ifdef HARD
        {MK_GUARD 2 (Longbowman)   15 11}
        {MK_GUARD 2 (Pikeman)      16 12}
        {MK_GUARD 2 (Longbowman)   25 11}
        {MK_GUARD 2 (Pikeman)      23 11}
        {MK_GUARD 2 (Longbowman)   15 18}
        {MK_GUARD 2 (Pikeman)      17 18}
        {MK_GUARD 2 (Longbowman)   25 18}
        {MK_GUARD 2 (Pikeman)      24 16}
        {MK_GUARD 2 (Halberdier)   18 14}
#endif
#undef MK_GUARD

        {MODIFY_TERRAIN Gg (5) (3)}

        [objectives]
            side=1
            [objective]
                description= _ "Destroy the stronghold of Halstead"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}
        [/objectives]
    [/event]

    #
    # Starting conversation and actions
    #
    [event]
        name=start

        [recall]
            id=Harper
        [/recall]
        [recall]
            id=Helicrom
        [/recall]

        [message]
            speaker=Baldras
            message= _ "There be it. The stronghold of Halstead."
        [/message]

        [scroll_to]
            x,y=20,14
        [/scroll_to]

        [delay]
            time=1000
        [/delay]

        [message]
            speaker=Harper
            message= _ "Look at how tall it is! Those towers be so sheer and smooth, it almost looks like magic called them up out of the earth!"
            scroll=no
        [/message]
        [message]
            speaker=Baldras
            message= _ "Aye, there may be some truths in that. Old stories tells us that in times past, Elensefar and Weldyn had some real strong mages, much more adept than them ones who only be politicking nowadays. They helped tame the lands between the cities and forged the walls of Halstead itself to honor the alliance."
            scroll=no
        [/message]
        [message]
            speaker=Harper
            message= _ "I don’t see how we can bring it down. They seem invincible in there!"
        [/message]
        [message]
            speaker=Baldras
            message= _ "Indeed..."
        [/message]
        [message]
            speaker=Helicrom
            message= _ "Worry not, Halstead has a weakness. What Baldras spoke was partly true. Previous orders of magi did help erect the fortress. What is not made known to most is that the original construction of the castle was flawed."
        [/message]
        [message]
            speaker=Helicrom
            message= _ "These walls were raised over a system of catacombs, which connect the four towers to the central keep. Though they appear impressive, the tunnels were never meant to hold up such a tremendous weight. Supports were added later to hold up the middle, which eventually began to collapse without them. Naturally, this was made secret by the magi, who did not want others to learn of their error."
        [/message]
        [message]
            speaker=Harper
            message= _ "So... we can knock out the supports and bring down the main keep. Would it really work?"
        [/message]
        [message]
            speaker=Helicrom
            message= _ "I believe it will. Each tower has a passage down to the catacombs. We must enter the tunnels and demolish all four supports, then the fortress should crumble."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Let’s hope you be right. Everything be hinging on this battle."
        [/message]
    [/event]

    [event]
        name=side 3 turn 1

        [message]
            speaker=Vashna
            message= _ "Dommel! The Queen has sent me and my warriors to support your forces. We come to squash the puny peasant rebellion."
        [/message]
        [message]
            speaker=Dommel
            message= _ "I received no word from Her Majesty of your arrival, orc."
        [/message]
        [message]
            speaker=Vashna
            message= _ "I have the orders right here."
        [/message]
        [message]
            speaker=Dommel
            message= _ "As if those could possibly be real. I would be a fool and an oaf to let a band of stinky raider orcs into Halstead without a fight."
        [/message]
        [message]
            speaker=Vashna
            message= _ "What? Now look here, you coddled pinkskin. Your helpless ‘soldiers’ have been getting bested by a filthy bunch of vagrant bandits. Your army is as useless as you are pink. The Queen sent us here to clean up the mess that you are clearly too stupid to fix on your own."
        [/message]
        [message]
            speaker=Dommel
            message= _ "A fine story. Most likely, this is a pitiful excuse for you to enter our fortress to plunder our armory. Even if Her Majesty did order you here, we have no need for the help of you uncouth orcs. We have always managed just fine without you."
        [/message]
        [message]
            speaker=Vashna
            message= _ "Yeah? Well, we will see how fine you manage <i>against</i> us. I’ll show you just how weak you pinkskins are."
        [/message]
        [message]
            speaker=Dommel
            message= _ "Come try it, cretin."
        [/message]
        [message]
            speaker=Helicrom
            message= _ "Infighting among the forces of Weldyn does not bode well for the new queen, but is awfully convenient for us..."
        [/message]
    [/event]

    #
    # Special Event - The cavalry comes (to help YOU)
    #
    [event]
        name=turn 8
        [role]
            role=farseer
            type=Outlaw,Footpad,Bandit,Thug,Thief,Huntsman,Trapper,Poacher,Rogue Mage,Rogue,Shadow Mage
            [not]
                id=Baldras
            [/not]
        [/role]
        [message]
            role=farseer
            message= _ "Look in the distance... riders approach!"
        [/message]

        [unit]
            side=4
            type=Paladin
            id=Sir Gwydion
            name= _ "Sir Gwydion"
            x,y=1,1
            canrecruit=yes
        [/unit]

        {MOVE_UNIT (id=Sir Gwydion) 5 3}

        {GENERIC_UNIT 4 (Lancer) 4 3}
        {GENERIC_UNIT 4 (Lancer) 6 2}
        {GENERIC_UNIT 4 (Knight) 4 2}
        {GENERIC_UNIT 4 (Knight) 5 2}
        #
        #
        [message]
            type=Lancer
            message= _ "Sound the advance!"
        [/message]
        [message]
            type=Lancer
            message= _ "At your order, my liege."
        [/message]
        [message]
            speaker=Sir Gwydion
            message= _ "Lo, Knights of Elensefar, the battle hath begun ere our arrival. Though I disobey my father in this endeavor, our presence surely is much needed."
        [/message]
        [message]
            speaker=Sir Gwydion
            message= _ "Ready thy lances! Let us trample the armies of Weldyn beneath our steeds!"
        [/message]

        {MODIFY_TERRAIN Ce (4-6,4) (2-2,3)}
        {MODIFY_TERRAIN Ke (5) (3)}

        [set_recruit]
            side=4
            recruit=Knight,Lancer
        [/set_recruit]

        [message]
            role=farseer
            message= _ "A horde of knights, bearing the emblem of Elensefar! Amazing. I’ve never seen me so many riders in one place."
        [/message]
        [message]
            speaker=Baldras
            # wmllint: local spelling Gwydion
            message= _ "Gwydion be Lord Maddock’s son... more be hinging on victory than I thought. This battle don’t just be about our little villages no more."
        [/message]

        [objectives]
            side=1
            [objective]
                description= _ "Destroy the stronghold of Halstead"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}
        [/objectives]
    [/event]

    #
    # Special Event - The cavalry comes (to help THEM) -
    # every morning a platoon arrives
    #
#define BAD_CAVALRY TURN
    [event]
        name=turn {TURN}
        [if]
            [variable]
                name=turn_number
                numerical_equals=6
            [/variable]
            [then]
                [message]
                    speaker=narrator
                    message= _ "Not even a full day had passed before the first advance elements of Wesnoth’s main army began to arrive..."
                    image="wesnoth-icon.png"
                [/message]
            [/then]
            [else]
                [message]
                    speaker=narrator
                    message= _ "That morning, another advance element of the main Wesnoth army arrived..."
                    image="wesnoth-icon.png"
                [/message]
            [/else]
        [/if]

        # The side filter in MOVE_UNIT is used to ensure that only the spawned
        # unit can be moved, in case the player would have misplaced his units
        # on the spawn coordinates.

        {GENERIC_UNIT 2 (Shock Trooper) 35 15}
        {MOVE_UNIT x,y,side=35,15,2 31 14}

        {GENERIC_UNIT 2 (Shock Trooper) 35 16}
        {MOVE_UNIT x,y,side=35,16,2 31 15}

        {GENERIC_UNIT 2 (Shock Trooper) 36 16}
        {MOVE_UNIT x,y,side=36,16,2 32 15}

        {GENERIC_UNIT 2 (Pikeman) 36 15}
        {MOVE_UNIT x,y,side=36,15,2 32 13}

        {GENERIC_UNIT 2 (Lieutenant) 36 14}
        {MOVE_UNIT x,y,side=36,14,2 32 14}

        {GENERIC_UNIT 2 (Longbowman) 37 16}
        {MOVE_UNIT x,y,side=37,16,2 33 14}

        {GENERIC_UNIT 2 (Heavy Infantryman) 37 15}
        {MOVE_UNIT x,y,side=37,15,2 33 15}

        [gold]
            side=2
#ifdef EASY
            amount=30
#endif
#ifdef NORMAL
            amount=45
#endif
#ifdef HARD
            amount=60
#endif
        [/gold]
    [/event]
#enddef

    {BAD_CAVALRY 6}
    {BAD_CAVALRY 12}
    {BAD_CAVALRY 18}
    {BAD_CAVALRY 24}
    {BAD_CAVALRY 30}

    #
    # Special Event - the first time you attack one of them, they catch on
    #
    [event]
        name=attack
        [filter]
            side=1,4
        [/filter]
        [filter_second]
            side=2
        [/filter_second]
        [message]
            speaker=Dommel
            message= _ "I think... I think they’re trying to storm Halstead itself... the fools!"
        [/message]
    [/event]

    #
    # Special Event - when you enter the fortress proper they freak out
    #
    [event]
        name=moveto
        [filter]
            [filter_location]
                x,y=20,14
                radius=4
            [/filter_location]

            side=1,3,4
        [/filter]
        [message]
            speaker=Dommel
            message= _ "They have breached the fortress gate! Repulse them!"
        [/message]
    [/event]

    #
    # Special Event - You move a unit to a tower center
    #
#define MOVETO_TRAPDOOR X Y
    [event]
        name=moveto
        [filter]
            x,y={X},{Y}
            side=1
        [/filter]
        [if]
            [variable]
                name=supports_destroyed
                numerical_equals=0
            [/variable]
            [then]
                [message]
                    speaker=unit
                    message= _ "I’m inside! I’m heading down to the catacombs."
                [/message]
            [/then]
        [/if]
        [hide_unit]
            x,y={X},{Y}
        [/hide_unit]
        [sound]
            name=fuse.ogg
        [/sound]
        [if]
            [variable]
                name=supports_destroyed
                numerical_equals=0
            [/variable]
            [then]
                [message]
                    speaker=narrator
                    message= _ "After some time..."
                    image="wesnoth-icon.png"
                [/message]
            [/then]
            [else]
                [delay]
                    time=750
                [/delay]
            [/else]
        [/if]
        [sound]
            name=explosion.ogg
        [/sound]
        [delay]
            time=750
        [/delay]
        [unhide_unit]
        [/unhide_unit]
        [message]
            speaker=unit
            message= _ "It’s done."
        [/message]
        [set_variable]
            name=supports_destroyed
            add=1
        [/set_variable]
        [remove_item]
            x,y={X},{Y}
        [/remove_item]
        [if]
            [variable]
                name=supports_destroyed
                numerical_equals=4
            [/variable]
            [then]
                [sound]
                    name=fire.wav
                [/sound]
                {QUAKE "rumble.ogg"}
                {QUAKE "rumble.ogg"}
                {QUAKE "rumble.ogg"}
                [sound]
                    name=fire.wav
                [/sound]
                {QUAKE "rumble.ogg"}
                [message]
                    speaker=narrator
                    message= _ "The stronghold of Halstead began to shake..."
                    image="wesnoth-icon.png"
                [/message]
                {QUAKE "rumble.ogg"}
                [message]
                    speaker=unit
                    message= _ "We can’t stay here. The fortress is starting to collapse!"
                [/message]
                {VARIABLE supports_destroyed all}
            [/then]
        [/if]
    [/event]
#enddef

    {MOVETO_TRAPDOOR 15 11}
    {MOVETO_TRAPDOOR 25 11}
    {MOVETO_TRAPDOOR 15 18}
    {MOVETO_TRAPDOOR 25 18}

    #
    # Special event - you knock out all four supports
    #
    [event]
        name=new turn
        first_time_only=no
        [if]
            [variable]
                name=supports_destroyed
                equals=all
            [/variable]
            [then]
                [scroll_to]
                    x,y=20,14
                [/scroll_to]
                {QUAKE "rumble.ogg"}
                [sound]
                    name=fire.wav
                [/sound]
                {QUAKE "rumble.ogg"}
                [message]
                    speaker=Baldras
                    message= _ "I think it be working! Everybody get clear!"
                [/message]

                # When you finish your turn, the fortress will collapse

                [event]
                    name=side turn
                    first_time_only=no

                    [if]
                        [variable]
                            name=side_number
                            equals=2
                        [/variable]
                        [then]
                            [scroll_to]
                                x,y=20,14
                            [/scroll_to]
                            [sound]
                                name=fire.wav
                            [/sound]
                            {QUAKE "cave-in.ogg"}
                            [delay]
                                time=200
                            [/delay]
                            [sound]
                                name=dragonstick.ogg
                            [/sound]
                            [delay]
                                time=400
                            [/delay]
                            {QUAKE "rumble.ogg"}
                            [delay]
                                time=200
                            [/delay]
                            [sound]
                                name=dragonstick.ogg
                            [/sound]
                            {QUAKE "cave-in.ogg"}
                            [message]
                                speaker=narrator
                                message= _ "With a thunderous roar and a vast billowing of dust, thousands of tons of stone and wood crashed in on itself. Some of the wreckage tumbled down the steep sides, while the remainder came to rest several hundred feet below ground, in the bowels of the hollowed-out mountain."
                                image="wesnoth-icon.png"
                            [/message]
                            {QUAKE "rumble.ogg"}
                            {QUAKE "rumble.ogg"}
                            {QUAKE "rumble.ogg"}
                            [message]
                                speaker=narrator
                                message= _ "No one inside the fortress would make it out alive."
                                image="wesnoth-icon.png"
                            [/message]

                            {QUAKE "cave-in.ogg"}
                            [sound]
                                name=dragonstick.ogg
                            [/sound]
                            {QUAKE "rumble.ogg"}
                            {QUAKE "cave-in.ogg"}
                            {QUAKE "rumble.ogg"}
                            [sound]
                                name=dragonstick.ogg
                            [/sound]
                            {QUAKE "cave-in.ogg"}
                            [sound]
                                name=dragonstick.ogg
                            [/sound]

                            [kill]
                                fire_event=yes
                                animate=no
                                x=15-25
                                y=10-18
                            [/kill]
                            [redraw][/redraw]

                            [scroll_to]
                                x,y=20,14
                            [/scroll_to]

                            #
                            # Wrecking the castle
                            #
                            [terrain_mask]
                                x,y=15,9
                                border=no
                                mask="Re, Mm^Xm, Re, Ww, Rr, Ww^Bw|, Rr, Rr, Gs^Fds, Mm^Xm, Gs^Fds
Mm, Chr, Mm^Xm, Re, Uh, Uu, Uh, Uh, Mm^Xm, Uu, Mm^Xm
Uu, Uu, Qxu, Uu, Re, Qxu, Re, Qxu, Chr, Rr, Chr
Uu, Chr, Qxu, Qxu, Qxu, Qxu, Qxu, Qxu, Uu, Qxu, Re
Uh, Qxu, Qxu, Re, Uh, Uh, Chr, Chr, Qxu, Qxu, Qxu
Re, Qxu, Qxu, Chr, Mm, Mm^Xm, Mm, Qxu, Qxu, Qxu, Uh
Ce, Qxu, Qxu, Re, Mm, Uh, Mm, Qxu, Qxu, Qxu, Uh
Uh, Qxu, Qxu, Qxu, Qxu, Qxu, Chr, Qxu, Qxu, Uu, Qxu
Chr, Rr, Qxu, Qxu, Qxu, Qxu, Qxu, Qxu, Qxu, Uu, Uu
Uu, Uu, Chr, Uh, Re, Uu, Uu, Uh, Uu, Chr, Chr
"
                            [/terrain_mask]

                            [redraw][/redraw]

                            [sound]
                                name=rumble.ogg
                            [/sound]

                            [sound]
                                name=rumble.ogg
                            [/sound]

                            [delay]
                                time=2000
                            [/delay]

                            {CLEAR_VARIABLE supports_destroyed}

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

    #
    # Loss conditions - turns run out
    #
    [event]
        name=time over
        [message]
            speaker=narrator
            message= _ "After several days of fierce fighting, the main body of Weldyn’s host arrived. The battle was soon finished. Every last man from the rebellion was executed."
            image="wesnoth-icon.png"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    #
    # Deaths - Baldras (loss condition)
    #
    [event]
        name=last breath
        [filter]
            id=Baldras
        [/filter]

        [if]
            [variable]
                name=supports_destroyed
                equals=all
            [/variable]
            [variable]
                name=side_number
                numerical_equals=2
            [/variable]
            [then]
                [message]
                    speaker=Baldras
                    message= _ "The fort be done with... but I be crushed... under this rubble..."
                [/message]
                [message]
                    speaker=narrator
                    message= _ "No one was able to get to Baldras in time. He and many of his companions died that day beneath the stronghold of Halstead."
                    image="wesnoth-icon.png"
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Baldras
                    message= _ "I knew... this wouldn’t work..."
                [/message]
                [message]
                    speaker=narrator
                    image=wesnoth-icon.png
                    message=_ "The rebellion had staked its all on victory at Halstead, but win or lose, there would be no help for the doomed villagers."
                [/message]
            [/else]
        [/if]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
    #
    # Deaths - Harper
    #
    [event]
        name=last breath
        [filter]
            id=Harper
        [/filter]
        [message]
            speaker=Harper
            #wmllint: local spelling Unngh
            message= _ "Unngh..."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Harper, no!"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
    #
    # Deaths - Helicrom
    #
    [event]
        name=last breath
        [filter]
            id=Helicrom
        [/filter]
        [message]
            speaker=Helicrom
            message= _ "Ended... like this? Fight on without me..."
        [/message]
    [/event]

    #
    # Deaths - Dommel
    #

    # If the orcs happen to kill Dommel, we pretend
    # that Baldras killed him so that the dialogue makes more sense
    [event]
        name=last breath

        [filter]
            id=Dommel
        [/filter]

        [filter_second]
            side=3
        [/filter_second]

        [fire_event]
            name=last breath

            [primary_unit]
                id=Dommel
            [/primary_unit]

            [secondary_unit]
                id=Baldras
            [/secondary_unit]
        [/fire_event]
    [/event]

    [event]
        name=last breath

        [filter]
            id=Dommel
        [/filter]

        [filter_second]
            side=1,4
        [/filter_second]

        [message]
            speaker=second_unit
            message= _ "Your time is over, General."
        [/message]

        [message]
            speaker=Dommel
            message= _ "I may be done... but my death shall only bring the full wrath of the Crown upon you... relish your small victory, peasants, while you still can..."
        [/message]

#ifdef HARD
        [set_achievement]
            content_for=liberty
            id="liberty_army"
        [/set_achievement]
#endif
    [/event]

    [event]
        name=last breath

        [filter]
            id=Vashna
        [/filter]

        [message]
            speaker=Vashna
            message= _ "Grrarrghh... you... fools..."
        [/message]

        [message]
            speaker=Dommel
            message= _ "Idiot orc. Know your place."
        [/message]
    [/event]
[/scenario]

#undef MOVETO_TRAPDOOR
#undef BAD_CAVALRY
