#textdomain wesnoth-l
[scenario]
    id=glory
    name= _ "Glory"
    next_scenario=epilog
    victory_when_enemies_defeated=no
    map_data="{campaigns/Liberty/maps/glory.map}"
    {TURNS 48 45 40}
    {AFTERNOON}
    {DUSK}
    {FIRST_WATCH}
    {SECOND_WATCH}
    {DAWN}
    {MORNING}

    {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, 338 years before Asheviere's betrayal, the newly crowned king sought to make safe once and for all the wildlands that separated the human cities surrounding Weldyn and the coastal regions of Elensefar."
        [/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 the protection it provided. 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]

        [part]
            music="battle.ogg"
            show_title=yes
            {TO_GLORY}
        [/part]
    [/story]

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

    {STARTING_VILLAGES 1 4}

    [side]
        side=2
        type=General
        id=Dommel
        name= _ "Dommel"
        canrecruit=yes
        recruit=Swordsman,Pikeman,Shock Trooper,Longbowman,Red Mage,White Mage,Spearman,Heavy Infantryman,Bowman
        {GOLD 200 340 400}
        {INCOME 10 20 40}
        controller=ai
        colour=blue
        {ai/aliases/stable_singleplayer.cfg}
        [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]
                # This is supposed to make the AI tend to group at the gates
                [criteria]
                    side=2,3
                    # These cover the area around the four gates
                    x=14-16,19-21,19-21,25-27
                    y=14-19,10-13,19-22,14-19
                    # Only try to group with 1-2 other units, instead of forming
                    # huge lumps of units
                    [filter_adjacent]
                        side=2,3
                        count=1-2
                    [/filter_adjacent]
                [/criteria]
                value=5
            [/goal]
            {AI_SIMPLE_ALWAYS_ASPECT_VALUE avoid (
                [not]
                    # These cover Halstead itself and a bit of the area around
                    # the four gates
                    x=14-26,12-28,17-23
                    y=11-22,14-20,10-22
                [/not]
            )}
        [/ai]
        team_name=bad_guys
        user_team_name=_"Asheviere"
    [/side]

    {STARTING_VILLAGES 2 20}

    [side]
        side=3
        no_leader=yes
        controller=ai
        colour=blue
        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT village_value 0}
            {AI_SIMPLE_ALWAYS_ASPECT leader_value 0}
            {AI_SIMPLE_ALWAYS_ASPECT aggression 0.4}
            [goal]
                value=10
                [criteria]
                    [filter_location]
                        # These cover Halstead itself and a bit of the area around
                        # the four gates
                        x=14-26,12-28,17-23
                        y=11-22,14-20,10-22
                    [/filter_location]
                [/criteria]
            [/goal]
        [/ai]
        team_name=bad_guys
        user_team_name=_"Asheviere"
    [/side]

    [side]
        side=4
        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
        colour=green
        [ai]
            turns=1-6
            caution=0.2
            aggression=0.8
            scout_village_targeting=1

            [target]
                side=1,5
                value=1.0
            [/target]
            [target]
                side=2,3
                value=2.5
            [/target]
            [target]
                side=6
                value=0.5
            [/target]

            [avoid]
                x,y=1-22,1-40
            [/avoid]
        [/ai]
        [ai]
            turns=7-FOREVER
            caution=0.1
            aggression=0.9
            scout_village_targeting=1

            [target]
                side=1,5
                value=1.0
            [/target]
            [target]
                side=2,3
                value=2.5
            [/target]
            [target]
                side=6
                value=0.5
            [/target]

            [avoid]
                x,y=1-17,1-40
            [/avoid]
        [/ai]
        team_name=orcs_dammit
        user_team_name=_"Orcs"
    [/side]

    {STARTING_VILLAGES 4 5}

    [side]
        side=5
        type=Shadow Lord
        id=Helicrom
        name= _ "Helicrom"
        profile=portraits/p_helicrom.png
        canrecruit=yes
        facing=sw
        recruit=Shadow Mage,Fugitive,Rogue Mage,Rogue,Huntsman
        {GOLD 700 600 500}
        controller=ai
        colour=purple
        [ai]
            recruitment_pattern=mixed fighter,mixed fighter,fighter,mixed fighter,archer
            [target]
                id=Dommel
                value=10
            [/target]
        [/ai]
        team_name=good_guys
        user_team_name=_"Rebels"
    [/side]

    [side]
        side=6
        no_leader=yes
        {GOLD 380 260 160}
        controller=ai
        colour=black
        team_name=good_guys
        user_team_name=_"Rebels"
        [ai]
            turns=1-6
            aggression=0.6
            caution=0.6
            leader_value=0.5

            [target]
                side=2
                value=2.5
            [/target]

            [target]
                side=3
                value=1.5
            [/target]

            [target]
                side=4
                value=0.5
            [/target]

            [target]
                id=Dommel
                value=0.25
            [/target]

            [avoid]
                x,y=18-40,1-40
            [/avoid]
        [/ai]

        [ai]
            turns=7-FOREVER
            aggression=0.6
            caution=0.6
            leader_value=0.5

            [target]
                side=2
                value=2.5
            [/target]

            [target]
                side=3
                value=1.5
            [/target]

            [target]
                side=4
                value=0.5
            [/target]

            [target]
                id=Dommel
                value=0.25
            [/target]

            [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]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]

        #Initialize the counter and switches
        {VARIABLE supports_destroyed 0}
        {VARIABLE harper_dead 0}
        {VARIABLE dommel_dead 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

        {CHG_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]
            [/then]
            [else]
                [kill]
                    side=5
                [/kill]
                {CHG_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}

        [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."
        [/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."
        [/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 dad 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
        [/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=6
            type=Paladin
            id=Sir Gwydion
            name= _ "Sir Gwydion"
            profile=portraits/p_gwydion.png
            x,y=1,1
            canrecruit=yes
        [/unit]

        {MOVE_UNIT (id=Sir Gwydion) 5 3}

        {GENERIC_UNIT 6 (Lancer) 4 3}
        {GENERIC_UNIT 6 (Lancer) 6 2}
        {GENERIC_UNIT 6 (Knight) 4 2}
        {GENERIC_UNIT 6 (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]

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

        [set_recruit]
            side=6
            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]
    [/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 3 (Shock Trooper) 40 23}
        {MOVE_UNIT x,y,side=40,23,3 38 23}

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

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

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

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

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

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

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

    # If the side 3 reinforcements move to a village, it is given to side 2
    [event]
        name=moveto
        first_time_only=no

        [filter]
            side=3

            [filter_location]
                terrain=*^V*
            [/filter_location]
        [/filter]

        [capture_village]
            side=2
            x,y=$x1,$y1
        [/capture_village]
    [/event]

    #
    # Special Event - the first time you kill 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,5,6
        [/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]
            x,y=20,16
            radius=4
            side=1,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,5
        [/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]
        [removeitem]
            x,y={X},{Y}
        [/removeitem]
        [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 NOW!"
                [/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 earthquake 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
                                mask="usage=mask
border_size=0

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]

                            [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 stakes 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]
        {VARIABLE harper_dead 1}
    [/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=die

        [filter]
            id=Dommel
        [/filter]

        [filter_second]
            side=4,5
        [/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,6
        [/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
                    message= _ "You... underestimate the... cruelty and ambition of your Queen... unngh.."
                [/message]
                {VARIABLE dommel_dead 2}
            [/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]
                {VARIABLE dommel_dead 1}
            [/else]
        [/if]
    [/event]
[/scenario]
