#textdomain wesnoth-trow
[scenario]
    id=The_Fall
    name= _ "The Fall"
    map_data="{campaigns/The_Rise_Of_Wesnoth/maps/The_Fall.map}"
    {TURNS 23 20 17}

    {DEFAULT_SCHEDULE}

    next_scenario=A_Harrowing_Escape

    [music]
        name="northerners.ogg"
    [/music]

    {campaigns/The_Rise_Of_Wesnoth/utils/trow-deaths.cfg}

    {THE_FALL_BIGMAP}

    [side]
        type=Noble Fighter
        description=Prince Haldric
        user_description= _ "Prince Haldric"
        unrenamable=yes
        side=1
        canrecruit=yes
        controller=human
        team_name=Haldric
    [/side]

    {STARTING_VILLAGES 1 6}

    [side]
        side=2
        canrecruit=yes
        recruit=Footpad,Poacher,Thief,Thug
        no_leader=yes
        [ai]
            recruitment_pattern=fighter,fighter,archer,scout
            {NO_SCOUTS}
            aggression=0.15
            caution=0.5
            passive_leader=yes
            grouping=defensive
            {ATTACK_DEPTH 3 4 5}
        [/ai]
        {GOLD 90 130 170}
        team_name=wesfolk
    [/side]

    {STARTING_VILLAGES 2 7}

    [side]
        type=Orcish Warlord
        description=Tan-Rarbag
        user_description= _ "Tan-Rarbag"
        side=3
        canrecruit=yes
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Goblin Spearman
        {GOLD 180 260 350}
        team_name=orcs
        [ai]
            recruitment_pattern=scout,scout,fighter,fighter,archer
            {NO_SCOUTS}
            passive_leader=yes
            recruitment_ignore_bad_movement=yes
        [/ai]
        [ai]
            time_of_day=first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
    [/side]

    [side]
        type=Orcish Warrior
        description=Tan-Erang
        user_description= _ "Tan-Erang"
        side=4
        canrecruit=yes
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Goblin Spearman
        {GOLD 160 220 310}
        team_name=orcs
        [ai]
            recruitment_pattern=scout,scout,fighter,fighter,archer
            {NO_SCOUTS}
        [/ai]
        [ai]
            time_of_day=first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
    [/side]

#define NORTH_GUARD X Y DESCRIPTION USER_DESCRIPTION SECOND_TRAIT_WML
    [unit]
#ifdef EASY
        type=Shock Trooper
#endif
#ifdef NORMAL
        type=Heavy Infantryman
#endif
#ifdef HARD
        type=Heavy Infantryman
#endif
        side=1
        description={DESCRIPTION}
        user_description={USER_DESCRIPTION}	# wmllint: ignore
        x={X}
        y={Y}
        [modifications]
            {TRAIT_LOYAL}
            {SECOND_TRAIT_WML}
        [/modifications]
    [/unit]
#enddef

    [event]
        name=prestart

        # These names look unimaginative because "Lady Jessica" is
        # the only character in BfW with a personal name that is a
        # normal English name. I'm making the Wesfolk follow suit.
#ifdef EASY
        {GUARD_UNIT (Poacher) (Thomas) ( _ "Thomas") 2 11 20}
#else
        {GUARD_UNIT (Poacher) (Richard) ( _ "Richard") 2 11 20}
        {GUARD_UNIT (Poacher) (Henry) ( _ "Henry") 2 7 21}
        {GUARD_UNIT (Poacher) (Robert) ( _ "Robert") 2 9 22}
#endif

        [recall]
            description=King Eldaric IV
            x=28
            y=15
        [/recall]

        {NORTH_GUARD 10 6 (Thegwyn) (_ "Thegwyn") {TRAIT_RESILIENT}}
        {NORTH_GUARD 12 6 (Galdred) (_ "Galdred") {TRAIT_STRONG}}
        {NORTH_GUARD 12 10 (Tromas) (_ "Tromas") {TRAIT_FEARLESS}}

        [objectives]
            side=1
            [objective]
                description= _ "Defeat the Wesfolk Leader"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Prince Haldric"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of King Eldaric IV"
                condition=lose
            [/objective]
            [objective]
                description= _ "Orcs kill the Wesfolk Leader"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=start

        {VARIABLE wesfolk_leader_store.x 4}
        {VARIABLE wesfolk_leader_store.y 23}

        [unstore_unit]
            variable=wesfolk_leader_store
        [/unstore_unit]

        {FULL_HEAL (description=Wesfolk Leader)}

	# wmllint: recognize Wesfolk Leader

        [message]
            speaker=narrator
            message= _ "Summer passes into fall, and King Eldaric fortifies his frontiers. It is not long before the first orcish scouts are spotted. War has come to the valley."
            image=wesnoth-icon.png
        [/message]

        [message]
            description=King Eldaric IV
            message= _ "Haldric, things have not gone well! The orcs have arrived. We met them at the north keep but they were just too many. They have flanked us to the east in the mountains. I have my personal guards holding the pass to the north, but they won't be able to last long... We must evacuate our home."
        [/message]

        [message]
            description=Prince Haldric
            message= _ "That's awful! And it only gets worse. That Wesfolk rabble has set up shop again in the south pass..."
        [/message]

        [message]
            description=King Eldaric IV
            message= _ "That's the only way out of the valley! This is a disaster! We must defeat that Wesfolk scum and flee to the south. Our home is lost... We must make haste."
        [/message]

        [message]
            description=Tan-Rarbag
            message= _ "So HUMAN, care to make your final stand?"
        [/message]

        [message]
            description=Tan-Erang
            message= _ "Die! Die! Die!"
        [/message]

        [message]
            description=Wesfolk Leader
            message= _ "This is going to get ugly..."
        [/message]
    [/event]

    [event]
        name=turn 14
        [message]
            description=King Eldaric IV
            message= _ "Hurry! Only death awaits in this valley!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            description=Tan-Erang
        [/filter]

        [filter_second]
            side=1
        [/filter_second]

        {LOOT 75 1}
    [/event]

    [event]
        name=die
        [filter]
            description=Tan-Rarbag
        [/filter]

        [filter_second]
            side=1
        [/filter_second]

        {LOOT 75 1}
    [/event]

    [event]
        name=die

        [filter]
            description=Wesfolk Leader
        [/filter]

        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=unit
            message= _ "Umm, I invoke the right of surren..."
        [/message]

        [message]
            description=King Eldaric IV
            message= _ "Nay! Off with your hea- - -"
        [/message]

        [message]
            speaker=unit
            message= _ "But I can help! Really! You could use me and my men's skills on the long road ahead!"
        [/message]

        [message]
            description=King Eldaric IV
            message= _ "Haldric, what say you on this matter?"
        [/message]

        [message]
            description=Prince Haldric
            message= _ "Hmm... after some thought..."

            [option]
                message= _ "I think that your skills may be useful. You may join us."
                [command]
                    [message]
                        description=Wesfolk Leader
                        message= _ "Let there be peace between us, our survival depends on it."
                    [/message]
                    [allow_recruit]
                        side=1
                        type=Thief,Thug,Poacher,Footpad
                    [/allow_recruit]
                    [message]
                        description=Prince Haldric
                        message= _ "So what shall I call you?"
                    [/message]
                    [message]
                        description=Wesfolk Leader
                        message= _ "The Lady Outlaw will do."
                    [/message]
                    [store_unit]
                        variable=wesfolk_leader_store
                        kill=yes
                        [filter]
                            description=Wesfolk Leader
                        [/filter]
                    [/store_unit]

                    {VARIABLE wesfolk_leader_store.description (Lady Outlaw)}
                    {VARIABLE wesfolk_leader_store.user_description ( _ "Lady Outlaw")}
                    {VARIABLE wesfolk_leader_store.canrecruit no}
                    {VARIABLE wesfolk_leader_store.side 1}

                    [unstore_unit]
                        variable=wesfolk_leader_store
                    [/unstore_unit]

                    {MAKE_HERO (Lady Outlaw)}
                    # wmliint: recognize Lady Outlaw

                    {FULL_HEAL (description=Lady Outlaw)}

                    [set_variable]
                        name=have_lady
                        value=1
                    [/set_variable]
                [/command]
            [/option]
            [option]
                message= _ "Your word can't be trusted. Prepare to meet your Gods!"
                image=portraits/haldric-mad.png
                [command]
                    [message]
                        description=Wesfolk Leader
                        message= _ "Arrogant fools! (Reaches into pocket) POOF!"
                    [/message]

                    [store_unit]
                        variable=wesfolk_leader_store
                        kill=yes
                        [filter]
                            description=Wesfolk Leader
                        [/filter]
                    [/store_unit]

                    {VARIABLE wesfolk_leader_store.description (Lady Outlaw)}
                    {VARIABLE wesfolk_leader_store.user_description ( _ "Lady Outlaw")}
                    {VARIABLE wesfolk_leader_store.canrecruit no}
                    {VARIABLE wesfolk_leader_store.side 1}

                    [unstore_unit]
                        variable=wesfolk_leader_store
                    [/unstore_unit]

                    {MAKE_HERO (Lady Outlaw)}
                    # wmllint: recognize Lady Outlaw

                    {FULL_HEAL (description=Lady Outlaw)}

                    [store_unit]
                        variable=lady_store
                        kill=yes
                        [filter]
                            description=Lady Outlaw
                        [/filter]
                    [/store_unit]

                    [set_variable]
                        name=have_lady
                        value=0
                    [/set_variable]

                    [message]
                        description=King Eldaric IV
                        message= _ "Argh, she's gone. Next time, more sword, less chat."
                    [/message]

                    [message]
                        description=Prince Haldric
                        message= _ "She's clever! Maybe I made the wrong choice. Well, at least she left some of her gold behind..."
                    [/message]

#ifdef EASY
                    {LOOT 100 1}
#endif

#ifdef NORMAL
                    {LOOT 75 1}
#endif

#ifdef HARD
                    {LOOT 50 1}
#endif
                [/command]
            [/option]
        [/message]
        [message]
            description=King Eldaric IV
            message= _ "Son, you must lead our people through the south pass. I will remain behind to hold off these vile monsters for as long as I can."
        [/message]
        [message]
            description=Prince Haldric
            message= _ "But, Father!"
        [/message]
        [message]
            description=King Eldaric IV
            message= _ "It's the only way. Go now, and don't look back! Luck be with you!"
        [/message]

        [endlevel]
            result=victory
            bonus=yes
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            description=Wesfolk Leader
        [/filter]

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

        [message]
            description=King Eldaric IV
            message= _ "We're surrounded! The orcs have taken the southern pass! All is lost!"
        [/message]

        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=time over
        [message]
            description=King Eldaric IV
            message= _ "We're surrounded! I can see their reinforcements! All is lost!"
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            side=3, 4
            x=26-30
            y=13-15
        [/filter]
        [message]
            description=Prince Haldric
            message= _ "Our home! Where shall we go!"
        [/message]
        [message]
            description=King Eldaric IV
            message= _ "There can be no looking back! We must go south."
        [/message]
    [/event]

    [event]
        name=victory
        [kill]
            description=King Eldaric IV
        [/kill]

        {CLEAR_VARIABLE wesfolk_leader_store}
    [/event]
[/scenario]
