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

    turns=18

    {DEFAULT_SCHEDULE}

    next_scenario=03_Toward_Mountains_of_Haag

    {SCENARIO_MUSIC "loyalists.ogg"}
    {EXTRA_SCENARIO_MUSIC "battle.ogg"}
    {EXTRA_SCENARIO_MUSIC "heroes_rite.ogg"}

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

            [gold_carryover]
                bonus=no
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]
    [/event]

    {PLACE_IMAGE scenery/signpost.png 28 1}

    [side]
        type=Orcish Leader
        id="Kapou'e"
        name= _ "Kapou’e"
        side=1
        canrecruit=yes
        controller=human
        recruit= Wolf Rider, Orcish Grunt, Orcish Archer
        team_name=Kapoue
        user_team_name=_ "Kapou’e"
        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
        id="Lanbec'h"
        name= _ "Lanbec’h"
        profile=portraits/lanbech.png
        side=2
        canrecruit=yes
        facing=sw
        recruit=Dragoon, Swordsman, Pikeman, Longbowman
        team_name=Humans
        user_team_name=_ "Humans"
        gold=10000
        {FLAG_VARIANT loyalist}
    [/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=farnorth.png
        [/part]

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

        [part]
            show_title=yes
            {TO_THE_HUMAN_ARMY}
        [/part]
    [/story]

    [event]
        name=start

        [recall]
            id=Vrag
        [/recall]

        [message]
            speaker="Lanbec'h"
            message= _ "So this is the bold orc who has dared kill my son-in-law."
        [/message]
        [message]
            speaker="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 began."
            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 encampment, he began to have second thoughts."
            image=wesnoth-icon.png
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "They are too many and too tough. The few here don’t stand a chance."
        [/message]

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

        [message]
            speaker="Kapou'e"
            message= _ "Insolence! But you make a good point all the same. I should have paid attention to my supporters before. But what should we do now?"
        [/message]

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

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

        [message]
            speaker="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 ask them for support. 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]
            speaker="Kapou'e"
            message= _ "$stored_helper.name|!"
        [/message]

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

        [message]
            speaker="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= _ "Done."
        [/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]

            [gold_carryover]
                bonus=no
                carryover_percentage=40
            [/gold_carryover]
        [/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]

        {CLEAR_VARIABLE stored_helper}

        {MOVE_UNIT role=Helper 26 2}

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

        [message]
            speaker="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]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=no
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]

        [event]
            name=moveto

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

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

            [message]
                speaker="Lanbec'h"
                message= _ "That’s right, flee, you cowardly orcs! This land is mine!"
            [/message]

            [message]
                speaker="Kapou'e"
                message= _ "In your dreams, worm. When the time comes you will pay for all this with your life!"
                image=portraits/kapoue-angry.png
            [/message]

            [endlevel]
                result=victory
                bonus=no
                {NEW_GOLD_CARRYOVER 40}
            [/endlevel]
        [/event]
    [/event]

    [event]
        name=victory

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

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