#textdomain wesnoth-sotbe
[scenario]
    id=the_human_army
    name= _ "The Human Army"
    map_data="{campaigns/Son_Of_The_Black_Eye/maps/End_Of_Peace.map}"

    turns=18

    {DEFAULT_SCHEDULE}

    next_scenario="Toward_Mountains_of_Haag"
    {SCENARIO_MUSIC "loyalists.ogg"}
    {VICTORY_AND_DEFEAT_MUSIC}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Defeat Lanbec'h"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kapou'e"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    {PLACE_IMAGE scenery/signpost.png 28 1}

    [side]
        type=Orcish Leader
        description="Kapou'e"
        user_description= _ "Kapou'e"
        side=1
        canrecruit=yes
        controller=human
        recruit= Wolf Rider, Orcish Grunt, Orcish Archer
        enemy=2
        gold=100
        {BLACK_FLAG}
    [/side]

    # Give Kapou'e the northern tier of villages near his keep.
    {STARTING_VILLAGES 1 7}
    {STARTING_VILLAGES_AREA 1 28 3 3}
    {STARTING_VILLAGES_AREA 1 6 9 3}

    [side]
        type=General
        description="Lanbec'h"
        user_description= _ "Lanbec'h"
        side=2
        canrecruit=yes
        recruit=Dragoon, Swordsman, Pikeman, Longbowman
        gold=10000

        enemy=1
    [/side]

    # Lanbec'h starts with all villages south of the river.
    # Not that this matters, given his starting gold.
    {STARTING_VILLAGES 2 19}

    [story]
        [part]
            story= _ "Refusing to yield to fear, Kapou'e rallied his warriors in preparation for the upcoming battle."
            background=sotbe1.png
        [/part]

        [part]
            story= _ "He was not disappointed. A few days later the main body of the human army arrived. Driven to a hungry rage due to the death of his son-in-law, Earl Lanbec'h led the army himself."
            background=sotbe1.png
        [/part]

        [part]
            background=sotbe1.png
            show_title=yes
            {CROSS 496 294}
        [/part]
    [/story]

    [event]
        name=start

        [recall]
            description=Vrag
        [/recall]

        [message]
            description="Lanbec'h"
            message= _ "So this is the bold orc who has dared kill my son-in-law."
        [/message]
        [message]
            description="Kapou'e"
            message= _ "And this is that stupid human who dares march against Kapou'e - Son of the Black-Eye!"
        [/message]
        [message]
            speaker=narrator
            message= _ "The battle begun."
            image=wesnoth-icon.png
        [/message]
    [/event]

    [event]
        name=turn 7

        [message]
            speaker=narrator
            message= _ "As Kapou'e saw the hardened troops pour out of the human camp, he began to have second thoughts."
            image=wesnoth-icon.png
        [/message]

        [message]
            description="Kapou'e"
            message= _ "That is many troops. I am not sure if we can handle them."
        [/message]

        [message]
            description=Vrag
            message= _ "I told you so!"
        [/message]

        [message]
            description="Kapou'e"
            message= _ "I have learned my lesson. I will no longer ignore the advice of my supporters. But what should we do now?"
        [/message]

        [message]
            description=Vrag
            message= _ "We must flee! There is no way we can stand up against such a force."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "The Son of the Black-Eye will never 'flee'. But making a 'strategic withdrawal' is another matter."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "My father often spoke of the shamans of the Great Council who live in Barag Gór in the lands of the free tribes. We shall go ask them for assistance. With their help, perhaps we can unite the orcish tribes and crush these humans."
        [/message]

        [role]
            type=Orcish Warlord, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Grunt, Orcish Crossbowman, Orcish Archer
            role=Helper
        [/role]

        [store_unit]
            [filter]
                role=Helper
            [/filter]
            kill=no
            variable=stored_helper
        [/store_unit]

        [message]
            description="Kapou'e"
            message= _ " $stored_helper.user_description|!"
        [/message]

        [message]
            role=Helper
            message= _ "Yeah Chief?"
        [/message]

        [message]
            description="Kapou'e"
            message= _ "You, gather up our people and assemble them on the road some distance north of here. We will hold back the humans here until you are finished."
        [/message]

        [message]
            role=Helper
            message= _ "Ok."
        [/message]

        [kill]
            role=Helper
            animate=no
        [/kill]

        [objectives]
            side=1
            [objective]
                description= _ "Resist until your people are ready to go"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kapou'e"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=turn 13

        [set_variable]
            name=time_to_go
            value=1
        [/set_variable]

        {VARIABLE stored_helper.x 27}
        {VARIABLE stored_helper.y 1}

        [unstore_unit]
            variable=stored_helper
            find_vacant=yes
        [/unstore_unit]

        {MOVE_UNIT description=$stored_helper.description 26 2}

        [message]
            role=Helper
            message= _ "Chief, we have all our people ready to go. Come on, this way."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Took you long enough. Let's go!"
        [/message]

        [objectives]
            side=1
            [objective]
                description= _ "Move Kapou'e to the signpost in the Northeast"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kapou'e"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=moveto

        [filter]
            x=28
            y=1
            description="Kapou'e"
        [/filter]

        [if]
            [variable]
                name=time_to_go
                numerical_equals=1
            [/variable]

            [then]
                [message]
                    description="Kapou'e"
                    message= _ "We'll be back, foul mud-sucking humans!"
                [/message]

                [message]
                    description="Lanbec'h"
                    message= _ "Ha ha! Run, you cowardly orcs! This land now belongs to humans!"
                [/message]

                [message]
                    description="Kapou'e"
                    message= _ "In your dreams, human-worms. When the time comes you will pay for all this with your life!"
                [/message]

                [endlevel]
                    result=victory
                    bonus=no
                [/endlevel]
            [/then]

            [else]
                [allow_undo]
                [/allow_undo]
            [/else]
        [/if]
    [/event]

    [event]
        name=victory

        {CLEAR_VARIABLE time_to_go}
        {CLEAR_VARIABLE name}
    [/event]

    {@campaigns/Son_Of_The_Black_Eye/utils/deaths.cfg}
[/scenario]
