#textdomain wesnoth-l
[scenario]
    id=08_Glory
    name= _ "Glory"
    next_scenario=09_Epilogue
    victory_when_enemies_defeated=no
    map_data="{campaigns/Liberty/maps/08_Glory.map}"
    {TURNS 48 45 40}
    {DEFAULT_SCHEDULE_AFTERNOON}

    {INTRO_AND_SCENARIO_MUSIC heroes_rite.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= _ "In the Year of Wesnoth 161, the newly crowned king sought to tame the wildlands that separated the human cities surrounding Weldyn and the coastal regions of Elensefar once and for all."
        [/part]
        [part]
            story= _ "The grand army of Wesnoth, personally led by the High Council of Archmagi, scoured the plains of all manner of hostile creature, be it beast, orc, or elf. The city-state of Elensefar was formally united to the kingdom and settlements rapidly spread. The country of Wesnoth had been carved in deed as well as in name."
        [/part]
        [part]
            background=story/Halstead.jpg
            story= _ "A monument to this achievement was erected in the very heart of the wildlands. In a twelve-year ritual, the High Council demonstrated the height to which human magic had grown over the years by drawing the monument directly from the earth’s living rock."
        [/part]
        [part]
            background=story/Halstead.jpg
            story= _ "Hundreds of feet tall, the mountain towered high above the plains, its sheer walls both inspiring and terrifying. Men from all over the countryside labored there, building the most formidable fortress ever conceived. It became the Stronghold of Halstead."
        [/part]
        [part]
            background=story/Halstead.jpg
            story= _ "This sentinel of the western plains stood watch as Wesnoth prospered for many centuries under its protection. No war has overcome it, and its walls have never been overrun. The blood of invaders stains its parapets and the bones of the defeated crumble at the base of Halstead’s frozen waves of stone."
        [/part]
    [/story]

    {LIBERTY_BIGMAP {JOURNEY_08_NEW} }

    [side]
        side=1
        type=Highwayman
        id=Baldras
        canrecruit=yes
        controller=human
        gold=200
        team_name=good_guys
        user_team_name=_"Rebels"
    [/side]

    {AI_CONTROLLER () 1 4,5 ()}

    {STARTING_VILLAGES 1 4}

    [side]
        side=2
        type=General
        id=Dommel
        name= _ "Dommel"
        profile=portraits/dommel.png
        canrecruit=yes
        recruit=Swordsman,Pikeman,Dragoon,Shock Trooper,Longbowman,Red Mage,White Mage,Spearman,Heavy Infantryman,Bowman
        {GOLD 200 340 400}
        {INCOME 10 20 40}
        controller=ai
        [ai]
            {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=18-22,14-16,18-22,24-26
                    y=18-20,15-18,12-14,15-18
                [/criteria]
                value=10
            [/goal]
            [goal]
                name=protect_location
                [criteria]
                    x,y=20,16
                [/criteria]
                protect_radius=8
                value=20
            [/goal]
        [/ai]
        team_name=bad_guys
        user_team_name=_"Asheviere"
        {FLAG_VARIANT loyalist}
    [/side]

    {STARTING_VILLAGES 2 20}

    [side]
        side=3
        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
        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]
        [ai]
            turns=1-6

            # Don't let orcs reach Dommel and Sir Gwydion
            [avoid]
                x,y=1-22,1-40
            [/avoid]
        [/ai]
        [ai]
            turns=7-99999

            # Now just avoid Sir Gwydion
            [avoid]
                x,y=1-17,1-40
            [/avoid]
        [/ai]
        team_name=orcs_dammit
        user_team_name=_"Orcs"
        {FLAG_VARIANT6 ragged}
    [/side]

    {STARTING_VILLAGES 3 5}

    [side]
        side=4
        type=Shadow Lord
        id=Helicrom
        name= _ "Helicrom"
        profile=portraits/helicrom.png
        canrecruit=yes
        facing=sw
        recruit=Shadow Mage,Fugitive,Rogue Mage,Rogue,Huntsman
        {GOLD 700 600 500}
        controller=ai
        [ai]
            recruitment_pattern=mixed fighter,mixed fighter,fighter,mixed fighter,archer
            [goal]
                [criteria]
                    side=2
                [/criteria]
                value=10
            [/goal]

            # Don't let side 4 accidentally move to a trapdoor
            [avoid]
                x=16,16,24,24
                y=13,19,13,19
            [/avoid]
        [/ai]
        team_name=good_guys
        user_team_name=_"Rebels"
    [/side]

    [side]
        side=5
        no_leader=yes
        {GOLD 380 260 160}
        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]
        [ai]
            turns=1-6

            # Don't let the allies reach the human leader and
            # the orcish one
            [avoid]
                x,y=18-40,1-40
            [/avoid]
        [/ai]
        [ai]
            turns=7-99999

            # Now just avoid the orc leader
            [avoid]
                x,y=22-40,1-40
            [/avoid]
        [/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]

            {TURNS_RUN_OUT}
            {IS_LAST_SCENARIO}
        [/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 16 13}
        {PLACE_IMAGE scenery/trapdoor-closed.png 24 13}
        {PLACE_IMAGE scenery/trapdoor-closed.png 16 19}
        {PLACE_IMAGE scenery/trapdoor-closed.png 24 19}

        #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 (Royal Guard)  16 13}
        {MK_GUARD 2 (Royal Guard)  24 13}
        {MK_GUARD 2 (Royal Guard)  16 19}
        {MK_GUARD 2 (Royal Guard)  24 19}
#ifdef NORMAL
        {MK_GUARD 2 (Longbowman)   16 14}
        {MK_GUARD 2 (Pikeman)      17 13}
        {MK_GUARD 2 (Longbowman)   23 13}
        {MK_GUARD 2 (Pikeman)      24 14}
        {MK_GUARD 2 (Pikeman)      16 18}
        {MK_GUARD 2 (Longbowman)   17 20}
        {MK_GUARD 2 (Pikeman)      23 20}
        {MK_GUARD 2 (Longbowman)   24 18}
#endif
#ifdef HARD
        {MK_GUARD 2 (Longbowman)   15 13}
        {MK_GUARD 2 (Pikeman)      16 14}
        {MK_GUARD 2 (Pikeman)      17 13}
        {MK_GUARD 2 (Longbowman)   25 13}
        {MK_GUARD 2 (Pikeman)      23 13}
        {MK_GUARD 2 (Pikeman)      24 14}
        {MK_GUARD 2 (Longbowman)   15 20}
        {MK_GUARD 2 (Pikeman)      16 18}
        {MK_GUARD 2 (Pikeman)      17 20}
        {MK_GUARD 2 (Longbowman)   25 20}
        {MK_GUARD 2 (Pikeman)      23 20}
        {MK_GUARD 2 (Pikeman)      24 18}
        {MK_GUARD 2 (Halberdier)   18 16}
#endif
#undef MK_GUARD

        {MODIFY_TERRAIN Gg (5) (3)}

        #If the shadow gang is supposed to come help, then leave things
        # otherwise kill the shadow lord and erase his castle
        [if]
            [variable]
                name=Helicrom_status
                numerical_equals=3
            [/variable]
            [then]
                # Add the AI controller note if Helicrom is helping out
                [objectives]
                    side=1
                    [objective]
                        description= _ "Destroy the stronghold of Halstead"
                        condition=win
                    [/objective]
                    [objective]
                        description= _ "Death of Baldras"
                        condition=lose
                    [/objective]

                    {TURNS_RUN_OUT}
                    {IS_LAST_SCENARIO}

                    {AI_CONTROLLER_NOTE}
                [/objectives]
            [/then]
            [else]
                [kill]
                    side=4
                [/kill]
                {MODIFY_TERRAIN Gs^Fds (25-28) (37-40)}
            [/else]
        [/if]
    [/event]

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

        #First, take away Harper's shield. He can die now. Sorry, Harper!
        [recall]
            id=Harper
        [/recall]

        {UNMAKE_HERO Harper}

        # He's still a loyal unit with dialogue when he dies
        [unit_overlay]
            id=Harper
            image=misc/loyal-icon.png
        [/unit_overlay]

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

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

        [delay]
            time=1000
        [/delay]

        [message]
            speaker=Harper
            message= _ "Look at how tall it is! Those towers rise sheer out of the ground, as if called forth out of the earth."
            scroll=no
        [/message]
        [message]
            speaker=Baldras
            message= _ "That may not be too far from the truth. During the time of the Great Kings of Wesnoth, this land was tamed with powerful magic. Wizards of an ancient era forged the walls of Halstead from the rock below."
            scroll=no
        [/message]
        [message]
            speaker=Harper
            message= _ "I don’t see how we can bring it down. They are already invincible in there!"
        [/message]

        [if]
            [variable]
                name=Helicrom_status
                numerical_equals=3
            [/variable]
            [then]
                [message]
                    speaker=Helicrom
                    message= _ "No, my young friend. Halstead indeed has a weakness. Among my many assets is access to a wealth of secrets few in Wesnoth are privy to."
                [/message]
                [message]
                    speaker=Helicrom
                    message= _ "You see, the mountain on which the fort was built is solid, but the castle on top has been built and rebuilt many times over the ages. It is not as indestructible as you might think."
                [/message]
                [message]
                    speaker=Helicrom
                    message= _ "Beneath the structure is a system of catacombs that connects all four towers to the central keep. Over time, after many wars, supports were required to hold up the middle."
                [/message]
                [message]
                    speaker=Harper
                    message= _ "So... we can knock out the supports and bring down the stronghold of Halstead. Would it really work?"
                [/message]
                [message]
                    speaker=Helicrom
                    message= _ "I believe it will. Each tower has a passage down to the catacombs. If we can reach the center of each tower, one of our men can escape down to the bowels of the mountain and destroy its support. I am sure we will need to demolish no less than all four supports to raze the fortress."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Baldras
                    message= _ "No, young one. Halstead indeed has a weakness."
                [/message]
                [message]
                    speaker=Harper
                    message= _ "How do you know?"
                [/message]
                [message]
                    speaker=Baldras
                    message= _ "When I was a boy, my father — your grandfather — brought your mother and me to live in Aldril after orcs massacred many in our village. We grew up around here, and we learned many things."
                [/message]
                [message]
                    speaker=Baldras
                    message= _ "Beneath the structure is a system of catacombs that connects all four towers to the central keep. The catacombs growing over time, combined with centuries of war, made it necessary to install supports to hold up the middle."
                [/message]
                [message]
                    speaker=Harper
                    message= _ "So... we can knock out the supports and bring down the stronghold of Halstead. Would it really work?"
                [/message]
                [message]
                    speaker=Baldras
                    message= _ "I believe it will. Each tower has a passage down to the catacombs. If we can reach the center of each tower, one of our men can escape down to the bowels of the mountain and destroy its support. I am sure we will need to demolish no less than all four supports to raze the fortress."
                [/message]
            [/else]
        [/if]
        [message]
            speaker=Harper
            message= _ "I hope you’re right. In a few hours, night will fall, and we will find out."
        [/message]
        [message]
            speaker=Baldras
            message= _ "We must be cautious. Look there, a substantial orc force is also advancing on Halstead. They must think Wesnoth’s army is spread out right now."
        [/message]
        [message]
            speaker=Harper
            message= _ "Heh. They’re in for a surprise. This may work to our advantage."
        [/message]
    [/event]

    #
    # Special Event - The cavalry comes (to help YOU)
    #
    [event]
        name=turn 4
        [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]
        [if]
            [have_unit]
                role=farseer
            [/have_unit]
            [then]
                [message]
                    speaker=Baldras
                    message= _ "Who is it?"
                [/message]
                [message]
                    role=farseer
                    message= _ "Help, I hope. Circumstances cannot afford to get much more dire."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Baldras
                    message= _ "Riders approach from the northwest! Stand fast, men."
                [/message]
            [/else]
        [/if]

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

        {MOVE_UNIT (id=Sir Gwydion) 5 3}

        {GENERIC_UNIT 5 (Lancer) 4 3}
        {GENERIC_UNIT 5 (Lancer) 6 2}
        {GENERIC_UNIT 5 (Knight) 4 2}
        {GENERIC_UNIT 5 (Knight) 5 2}
        #
        #
        [message]
            type=Lancer
            message= _ "Sound the advance!"
        [/message]
        [message]
            speaker=Sir Gwydion
            message= _ "Knights of Elensefar, behold: the battle has already begun! Make camp here. Then, we charge!"
        [/message]

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

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

        [message]
            speaker=Baldras
            message= _ "Amazing. Lord Maddock sent his house guards... his finest troops! Elensefar must be defenseless now. More hinges on this battle than I thought."
        [/message]
        [message]
            role=farseer
            # wmllint: local spelling Gwydion
            message= _ "Baldras, Gwydion is Lord Maddock’s son. This battle isn’t just about Annuvin anymore."
        [/message]

        # Add the AI controller note when Gwydion shows up
        [objectives]
            side=1
            [objective]
                description= _ "Destroy the stronghold of Halstead"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}
            {IS_LAST_SCENARIO}

            {AI_CONTROLLER_NOTE}
        [/objectives]
    [/event]

    #
    # Special Event - The cavalry comes (to help THEM) -
    # every other afternoon a platoon arrives
    #
#define BAD_CAVALRY TURN
    [event]
        name=turn {TURN}
        [message]
            speaker=narrator
            message= _ "That afternoon, another advance element of the main Wesnoth army arrived..."
            image="wesnoth-icon.png"
        [/message]

        # 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) 40 23}
        {MOVE_UNIT x,y,side=40,23,2 38 23}

        {GENERIC_UNIT 2 (Shock Trooper) 40 24}
        {MOVE_UNIT x,y,side=40,24,2 39 23}

        {GENERIC_UNIT 2 (Shock Trooper) 40 23}
        {MOVE_UNIT x,y,side=40,23,2 38 22}

        {GENERIC_UNIT 2 (Pikeman) 40 24}
        {MOVE_UNIT x,y,side=40,24,2 39 21}

        {GENERIC_UNIT 2 (Lieutenant) 40 23}
        {MOVE_UNIT x,y,side=40,23,2 37 21}

        {GENERIC_UNIT 2 (Longbowman) 40 24}
        {MOVE_UNIT x,y,side=40,24,2 38 21}

        {GENERIC_UNIT 2 (Heavy Infantryman) 40 23}
        {MOVE_UNIT x,y,side=40,23,2 39 24}
    [/event]
#enddef

    {BAD_CAVALRY 7}
    {BAD_CAVALRY 13}
    {BAD_CAVALRY 19}
    {BAD_CAVALRY 25}
    {BAD_CAVALRY 31}

    #
    # Special Event - the first time you attack one of them, they catch on
    # that you're trying to storm the fortress (color dialogue)
    #
    [event]
        name=attack
        [filter]
            side=2
        [/filter]
        [filter_second]
            side=1,4,5
        [/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
    # (color dialogue)
    #
    [event]
        name=moveto
        [filter]
            [filter_location]
                x,y=20,16
                radius=4
            [/filter_location]

            side=1,3,4,5
        [/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]
        [message]
            speaker=unit
            message= _ "I’m inside the tower! I’m going down to the catacombs — cover me."
        [/message]
        [hide_unit]
            x,y={X},{Y}
        [/hide_unit]
        [sound]
            name=fuse.ogg
        [/sound]
        [message]
            speaker=narrator
            message= _ "After about an hour..."
            image="wesnoth-icon.png"
        [/message]
        [sound]
            name=explosion.ogg
        [/sound]
        [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]
                [message]
                    speaker=unit
                    message= _ "We cannot stay here. The fortress has started to collapse!"
                [/message]
                {VARIABLE supports_destroyed all}
            [/then]
        [/if]
    [/event]
#enddef

    {MOVETO_TRAPDOOR 16 13}
    {MOVETO_TRAPDOOR 24 13}
    {MOVETO_TRAPDOOR 16 19}
    {MOVETO_TRAPDOOR 24 19}

    #
    # 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,16
                [/scroll_to]
                {QUAKE "rumble.ogg"}
                [message]
                    speaker=Baldras
                    message= _ "I think it’s working! Everybody get clear <i>now</i>!"
                [/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,16
                            [/scroll_to]
                            [sound]
                                name=fire.wav
                            [/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 it 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]
                            [message]
                                speaker=narrator
                                message= _ "No one inside the fortress would make it out alive."
                                image="wesnoth-icon.png"
                            [/message]

                            {QUAKE "cave-in.ogg"}
                            {QUAKE "cave-in.ogg"}

                            [kill]
                                fire_event=yes
                                animate=no
                                x=15-25
                                y=12-20
                            [/kill]
                            [redraw][/redraw]

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

                            #
                            # Wrecking the castle
                            #
                            [terrain_mask]
                                x,y=15,11
                                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]

                            [delay]
                                time=2000
                            [/delay]

                            {CLEAR_VARIABLE Helicrom_status}
                            {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 more than a week of fierce fighting, the main body of Asheviere’s host arrived from Weldyn. The battle was soon finished. Every last man from the Province of Annuvin was executed."
            image="wesnoth-icon.png"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    #
    # Deaths - Baldras (loss condition)
    #
    # wmllint: local spelling Unngh
    [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= _ "Men, help me out of here! I am trapped 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]
                [message]
                    speaker=Baldras
                    message= _ "I hope this sacrifice is not in vain... but we will never know."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Baldras
                    message= _ "Our dream of freedom... gone... Unngh."
                [/message]
            [/else]
        [/if]
        [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 villagers, ground beneath the wheels of Asheviere’s wrath."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
    #
    # Deaths - Harper
    #
    [event]
        name=last breath
        [filter]
            id=Harper
        [/filter]
        [message]
            speaker=Harper
            message= _ "Uncle!"
        [/message]
        [message]
            speaker=Baldras
            message= _ "NO!"
        [/message]
        [message]
            speaker=Baldras
            message= _ "I promised your father I would watch after you... and I failed."
        [/message]
        [message]
            speaker=Baldras
            message= _ "But we are so close to the end. We must finish this. I am sorry you will not be able to enjoy our freedom. Goodbye, Harper."
        [/message]
    [/event]
    #
    # Deaths - Helicrom
    #
    [event]
        name=last breath
        [filter]
            id=Helicrom
        [/filter]
        [message]
            speaker=Helicrom
            message= _ "Carry on, my friends. Fighting by your side is the most honorable thing I have done..."
        [/message]
    [/event]

    #
    # Deaths - Dommel
    #

    # If either the orcs or Helicrom's guys 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,4
        [/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,5
        [/filter_second]

        [message]
            speaker=second_unit
            message= _ "Your reign of terror is over, General."
        [/message]

        [message]
            speaker=Dommel
            message= _ "You will never successfully oppose Asheviere. Her power is too great... This small victory today is but a reprieve from the unimaginable pain you will suffer when the full force of her wrath descends upon you."
        [/message]

        [if]
            [variable]
                name=supports_destroyed
                equals=all
            [/variable]
            [then]
                [message]
                    speaker=Baldras
                    message= _ "This was no small victory. You underestimate the power of love for freedom."
                [/message]
                [message]
                    speaker=Dommel
                    # wmllint: local spelling Uungh
                    message= _ "You... underestimate the... cruelty and ambition of your Queen... Uungh..."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Baldras
                    message= _ "Small victory? Bah! Now we will raze this fortress and bury it in the earth from whence it came."
                [/message]
            [/else]
        [/if]
    [/event]
[/scenario]

#undef MOVETO_TRAPDOOR
#undef BAD_CAVALRY
