#textdomain wesnoth-sotbe

[scenario]
    id=17_The_Human_Attack
    name= _ "The Human Attack"
    map_file=17_The_Human_Attack.map

    turns=25

    victory_when_enemies_defeated="yes"

    {SCENARIO_MUSIC "knalgan_theme.ogg"}
    {EXTRA_SCENARIO_MUSIC "battle.ogg"}

    {DEFAULT_SCHEDULE_MORNING}

    next_scenario=18_Northern_Alliance

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                condition=win
                description=_ "Hold off the humans"
                show_turn_counter=yes
            [/objective]
            {ALTERNATIVE_OBJECTIVE_BONUS ( _ "Defeat Earl Lanbec’h")}
            [objective]
                condition=lose
                description=_ "Death of Kapou’e"
            [/objective]
            [objective]
                description= _ "Death of Al’Brock"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Flar’Tar"
                condition=lose
            [/objective]
            [objective]
                condition=lose
                description= _ "Death of Grüü"
            [/objective]

            [gold_carryover]
                carryover_percentage=40
            [/gold_carryover]

            {GREAT_HORDE_NOTE}
        [/objectives]
    [/event]

    [side]
        side=1
        id="Kapou'e"
        type=Orcish Leader
        controller=human
        team_name=Kapoue
        user_team_name=_ "Kapou’e"
        {GOLD 375 350 325}
        {BLACK_FLAG}
    [/side]

    {STARTING_VILLAGES 1 10}

    [side]
        {ALBROCK_SIDE}
        {GOLD 250 225 200}
        {INCOME 12 10 8}
    [/side]

    {STARTING_VILLAGES 2 6}

    [side]
        {FLARTAR_SIDE}
        {GOLD 250 225 200}
        {INCOME 12 10 8}
    [/side]

    {STARTING_VILLAGES 3 6}

    [side]
        type=Grand Marshal
        id="Earl Lanbec'h"
        name= _ "Earl Lanbec’h"
        profile=portraits/lanbech.webp
        side=4
        canrecruit=yes
        recruit=Dragoon,Swordsman,Pikeman,Longbowman,Shock Trooper,Mage,Duelist,White Mage,Red Mage,Lancer,Knight,Spearman,Bowman,Cavalryman,Horseman
        team_name=villains
        user_team_name=_"Villains"
        {GOLD 600 800 1000}
        {INCOME 30 40 50}
        [ai]
            leader_value=50.0
            villages_per_scout=10
            passive_leader=yes
            [goal]
                name=protect_unit
                [criteria]
                    id="Earl Lanbec'h"
                [/criteria]
                protect_radius=8
                value=20
            [/goal]
        [/ai]
        [ai]
            time_of_day=dawn,morning,afternoon
            aggression=0.9
            caution=0.2
            village_value=0.2
            grouping=offensive
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.2
            caution=0.5
            village_value=0.8
            grouping=defensive
        [/ai]
        {FLAG_VARIANT loyalist}
    [/side]

    {STARTING_VILLAGES 4 10}

    [story]
        [part]
            story= _ "As Kapou’e expected, by the time his forces had been defeated, Shan Taum was nowhere to be found. Gritting his teeth and vowing that he would yet make a mug out of the traitor’s skull, Kapou’e gathered his men and headed for Dorest."
            {SOTBE_BIGMAP}
            {JOURNEY_16_OLD}
        [/part]

        [part]
            story= _ "Once there, he found that his generals, Al’Brock and Flar’Tar, had already arrived along with hundreds of bloodthirsty orcs. The warriors of the tribes that Kapou’e had cowed into submission were also present. In addition, the remaining shamans of the Great Council were also present to help in whatever way they could to preserve the unity of the Horde."
            {SOTBE_BIGMAP}
            {JOURNEY_16_OLD}
        [/part]

        [part]
            story= _ "Their presence proved to be unnecessary. It came as a shock to Kapou’e to discover, after a few days, that his people held him in awe. News of Kapou’e’s exploits had been widely circulated — from his rescue of the shamans at Barag Gór, to his forced march through the northern blizzards. Younger grunts especially worshiped him with such fervor that he found it almost frightening."
            {SOTBE_BIGMAP}
            {JOURNEY_16_OLD}
        [/part]

        [part]
            story= _ "Days passed, the snows melted, and Kapou’e readied his defenses. A few weeks after Kapou’e’s arrival, riders caught sight of Earl Lanbec’h’s army."
            {SOTBE_BIGMAP}
            {JOURNEY_16_OLD}
        [/part]
    [/story]

    {SOTBE_TRACK {JOURNEY_17_NEW} }

    {GOT_THE_GREAT_HORDE 1,2,3}

    [event]
        name=prestart

        {LOYAL_UNIT 4 Halberdier 21 26}
        {LOYAL_UNIT 4 Halberdier 23 26}

        {LOYAL_UNIT 4 Pikeman 19 27}
        {LOYAL_UNIT 4 Pikeman 25 27}

        {LOYAL_UNIT 4 Javelineer 16 27}
        {LOYAL_UNIT 4 Javelineer 28 27}

        {LOYAL_UNIT 4 (Iron Mauler) 16 29}
        {LOYAL_UNIT 4 (Iron Mauler) 28 29}

        {LOYAL_UNIT 4 (Shock Trooper) 16 31}
        {LOYAL_UNIT 4 (Shock Trooper) 28 31}

        {LOYAL_UNIT 4 (Shock Trooper) 17 33}
        {LOYAL_UNIT 4 (Shock Trooper) 27 33}

        {LOYAL_UNIT 4 (Shock Trooper) 19 33}
        {LOYAL_UNIT 4 (Shock Trooper) 25 33}

        {LOYAL_UNIT 4 Swordsman 21 34}
        {LOYAL_UNIT 4 Swordsman 23 34}

        {MODIFY_UNIT side,canrecruit=4,no ai_special guardian}
        {MODIFY_UNIT x=23-42 facing sw}
    [/event]

    # This helps prevent the allies from suiciding themselves by preventing them
    # from leaving their castles and surrounding villages
    [event]
        name=side 2 turn refresh, side 3 turn refresh
        first_time_only=no

        [modify_unit]
            [filter]
                side=$side_number
                canrecruit=yes
            [/filter]

            [movement_costs]
                flat=99
            [/movement_costs]
        [/modify_unit]

        [event]
            name=side turn end

            [modify_unit]
                [filter]
                    side=$side_number
                    canrecruit=yes
                [/filter]

                [movement_costs]
                    flat=1
                [/movement_costs]
            [/modify_unit]
        [/event]
    [/event]

    [event]
        name=start

        [recall]
            id=Grüü
        [/recall]
        [recall]
            id=Jetto
        [/recall]
        [recall]
            id=Inarix
        [/recall]

        [message]
            speaker="Earl Lanbec'h"
            message= _ "This is it, men! It is time to make these orcs pay for all that they have done to us. Attack without compromise, we have several detachments of reinforcements on their way. Spare no orc, and let us take back this land, which is rightfully ours!"
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Forward, men! Our wolves will feed well tonight!"
        [/message]

        [message]
            speaker=Grüü
            # wmllint: local spelling softlings
            message= _ "Come here, human softlings. Grüü has a little present for you..."
        [/message]
    [/event]

#define HUMAN_REINFORCEMENTS ID_GENERAL
    [unit]
        type=General
        id={ID_GENERAL}
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [unit]
        type=Swordsman
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [unit]
        type=Swordsman
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [unit]
        type=Longbowman
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [unit]
        type=Longbowman
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [unit]
        type=Horseman
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [unit]
        type=Horseman
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [unit]
        type=Spearman
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [unit]
        type=Spearman
        side=4
        x=22
        y=38
        generate_name=yes
        random_traits=yes
    [/unit]

    [scroll_to]
        x,y=22,38
    [/scroll_to]
#enddef

    [event]
        name=turn 6

        {HUMAN_REINFORCEMENTS general1}

        [message]
            speaker=narrator
            message= _ "As a fresh day dawned, more human forces arrived."
            image=wesnoth-icon.png
        [/message]
    [/event]

    [event]
        name=turn 10

        {HUMAN_REINFORCEMENTS Bruce}
        # wmllint: recognize Bruce

        [message]
            speaker=Bruce
            message= _ "We have arrived, my lord."
        [/message]
    [/event]

    [event]
        name=turn 14

        {HUMAN_REINFORCEMENTS general3}

        [message]
            speaker="Earl Lanbec'h"
            message= _ "Ahhh, perfect. More reinforcements."
        [/message]
    [/event]

    [event]
        name=wrapup

        [move_unit_fake]
            type=General
            side=4
            x=35,34,33,32,31,31,32,32,32,32,32
            y=30,30,31,30,30,29,28,27,26,25,24
        [/move_unit_fake]

        [unit]
            side=4
            type=General
            id=Howgarth III
            name= _ "Howgarth III"
            profile=portraits/howgarth.webp
            random_traits=no
            x=32
            y=24
        [/unit]

        [move_unit_fake]
            type=Royal Guard
            side=4
            x=35,34,33,32,31,31,32,32,32,32,31
            y=30,30,31,30,30,29,28,27,26,25,25
        [/move_unit_fake]

        [unit]
            side=4
            type=Royal Guard
            x=31
            y=25
            generate_name=yes
            random_traits=yes
        [/unit]

        [move_unit_fake]
            type=Royal Guard
            side=4
            x=35,34,33,32,31,31,32,32,32,32,32,33
            y=30,30,31,30,30,29,28,27,26,25,24,24
        [/move_unit_fake]

        [unit]
            side=4
            type=Royal Guard
            x=33
            y=24
            generate_name=yes
            random_traits=yes
        [/unit]

        [message]
            speaker=Howgarth III
            message= _ "Hold it! What in the wide green world is going on here!"
        [/message]

        [message]
            speaker="Earl Lanbec'h"
            image=portraits/lanbech.webp~FL()~RIGHT()
            message= _ "Howgarth? You and your interfering alliance always show up at the worst possible time."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Just who do you think you are, slug?"
            image=portraits/kapoue-angry.webp
        [/message]

        [message]
            speaker=Howgarth III
            message= _ "I am Howgarth of the Northern Alliance, successor to the late Rahul I."
        [/message]

        [message]
            speaker="Earl Lanbec'h"
            image=portraits/lanbech.webp~FL()~RIGHT()
            message= _ "This is a strictly territorial matter, Howgarth. The Northern Alliance has no right to intervene in this affair."
        [/message]

        [message]
            speaker=Howgarth III
            message= _ "The hell I don’t, Earl Lanbec’h, the Northern Alliance was witness to a treaty some seventeen years ago between your people and the orcs, which both of you are no doubt violating. It is our duty as the orchestrator and witness of this treaty to see that it is honored."
        [/message]

        [message]
            speaker="Earl Lanbec'h"
            image=portraits/lanbech.webp~FL()~RIGHT()
            message= _ "Well, good for you. As a matter of fact, this land is clearly defined under your precious treaty as human territory. So if you are so keen on being all high and noble, then muster your men to help us push back this orcish menace."
        [/message]

        [message]
            speaker=Howgarth III
            message= _ "Cease your lies, Lanbec’h. We all know that you were the one who started this war. But enough. It is time for all this to end. I call for both sides to parley and we shall discuss this matter."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Ha ha, very funny, old fool. You think we are stupid enough to fall for that? I’ve not forgotten what you people did to my father."
            image=portraits/kapoue-angry.webp
        [/message]

        [message]
            speaker=Howgarth III
            message= _ "What in the world are you talking about?"
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "I am Kapou’e, son of the Black-Eye Karun. Seventeen years ago, you people assassinated my father after inviting him to join the Northern Alliance."
            image=portraits/kapoue-angry.webp
        [/message]

        [message]
            speaker=Howgarth III
            message= _ "What? We received word that he declined our invitation and that was the end of the matter. I know nothing of his assassination. As a matter of fact, I was there when the orcish messenger brought Rahul Karun’s reply."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Messenger, what messenger?"
            image=portraits/kapoue-angry.webp
        [/message]

        [message]
            speaker=Howgarth III
            message= _ "If I remember correctly, it was some orc named Shan Taum."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Funny, that name sounds oddly familiar..."
        [/message]
    [/event]

    [event]
        name=time over

        [fire_event]
            name=wrapup
        [/fire_event]

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

    [event]
        name=last breath

        [filter]
            id="Earl Lanbec'h"
        [/filter]

        {VARIABLE unit.hitpoints 1}

        [unstore_unit]
            variable=unit
            find_vacant=no
        [/unstore_unit]

        [fire_event]
            name=wrapup
        [/fire_event]

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

    {HERO_DEATHS}
    {GENERALS_MUST_SURVIVE}
[/scenario]
