#textdomain wesnoth-sotbe
[scenario]
    id="Toward_Mountains_of_Haag"
    name= _ "Toward Mountains of Haag"
    map_data="{campaigns/Son_Of_The_Black_Eye/maps/Towards_Mountains_of_Haag.map}"

    {TURNS 27 24 20}

    victory_when_enemies_defeated="no"

    {MORNING}
    {AFTERNOON}
    {DUSK}
    {FIRST_WATCH}
    {SECOND_WATCH}
    {DAWN}

    next_scenario="The_Siege_Of_Barag_Gor"
    {SCENARIO_MUSIC "wanderer.ogg"}
    {VICTORY_AND_DEFEAT_MUSIC}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                condition=win
                description=_ "Move Kapou'e to the end of the mountains"
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Kapou'e"
            [/objective]
            [objective]
                condition=lose
                description=_ "Turns run out"
            [/objective]
        [/objectives]
    [/event]

    [item]
        x=26
        y=19
        image=items/orcish-flag.png
    [/item]
    [item]
        x=30
        y=16
        image=items/orcish-flag.png
    [/item]
    [item]
        x=24
        y=22
        image=items/orcish-flag.png
    [/item]

    [item]
        x=1
        y=5
        image=scenery/signpost.png
    [/item]

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

    {STARTING_VILLAGES 1 6}

    [side]
        type=Dwarvish Lord
        description=Kwili
        user_description= _ "Kwili"
        side=2
        canrecruit=yes
        recruit=Dwarvish Fighter, Dwarvish Thunderer
        [ai]
            recruitment_pattern=fighter,fighter,mixed fighter
        [/ai]
        {GOLD 100 140 180}
        team_name=Dwarves
    [/side]

    {STARTING_VILLAGES 2 6}

    [side]
        side=3
        team_name=Kapoue
        no_leader=yes
    [/side]

    [story]
        [part]
            background=sotbe1.png
            show_title=yes
            {DOT 496 294}
            {DOT 488 258}
            {DOT 478 226}
            {DOT 468 204}
            {DOT 448 187}
            {DOT 426 197}
            {DOT 399 208}
            {CROSS 374 221}
        [/part]
    [/story]

    [event]
        name=start

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

        [recall]
            role=Helper
        [/recall]

        [message]
            description="Kapou'e"
            message= _ "We have almost crossed the mountains. The lands of the free tribes must be near now. So far so good."
        [/message]
        [message]
            description=Kwili
            message= _ "Halt! Who goes there?"
        [/message]

        [message]
            description="Kapou'e"
            message= _ "It is I, Kapou'e, son of the Black-Eye Karun. What do you want, dwarf?"
        [/message]

        [message]
            description=Kwili
            message= _ "Oh, so it's another group o' foul orcs, eh. Begone, or we shall stain our axes wi' yer blood."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Look, stinky-midget, we aren't out to kill you so why don't you just scamper away and hide in a cave or something. We'll be through here in a few hours."
        [/message]

        [message]
            role=Helper
            message= _ " *snicker*"
        [/message]

        [message]
            description=Kwili
            message= _ "You orcs think you are so tough, don't you? Well we'll show you. Dwarves, let no orc pass this way alive!"
        [/message]

        [message]
            description="Kapou'e"
            message= _ "It looks like we might have to fight them after all."
        [/message]

        [message]
            role=Helper
            message= _ "Hey Chief, I was thinking - since all dwarves are pretty slow why don't we just bypass them?"
        [/message]

        [message]
            role=Helper
            message= _ "I mean, we could defeat them easily but it would just slow us down."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "We could, but then again, if we do defeat them then we will have an opportunity to uh... 'collect taxes' from the locals. I am sure the gold would be useful in the future."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Whatever else happens, we have to pass through these mountains and I dislike leaving enemies in our rear. Stab, smite, and slay!"
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x=22,   23,   24-26,27,   28,   29,   30,   31-32
            y=13-22,14-23,15-23,16-24,15-23,16-24,15-23,16-23
            side=1
        [/filter]
        [message]
            speaker=unit
            message= _ "I've never pushed so far. We are crossing the border of the Black-Eye lands."
        [/message]
    [/event]

    [event]
        name=turn 7
        [unit]
            description=Blemaker
            user_description= _ "Blemaker"
            type=Troll Warrior
            side=3
            x=28
            y=13
            facing=sw
        [/unit]
        [unit]
            description=Grüü
            user_description= _ "Grüü"
            type=Troll Hero
            side=3
            x=27
            y=13
            profile=portraits/gruu.png
            facing=sw
        [/unit]
        [unit]
            description=Toughkon
            user_description= _ "Toughkon"
            type=Troll Whelp
            side=3
            x=25
            y=12
            facing=sw
        [/unit]
        [unit]
            description=Pe
            user_description= _ "Pe"
            type=Troll Whelp
            side=3
            x=26
            y=12
            facing=sw
        [/unit]

        [message]
            description=Blemaker
            message= _ "Look! Dwarves are fighting against orcs!"
        [/message]
        [message]
            description=Grüü
            message= _ "Father, we should help them. Orcs are our allies."
        [/message]
        [message]
            description=Blemaker
            message= _ "I don't know if we should do that. Orcs have been our allies in the past, but they have always treated us as fools."
        [/message]
        [message]
            description=Grüü
            message= _ "But, Father, we don't know what they are seeking there, maybe this is a good occasion to get rid of these dwarves."
        [/message]
        [message]
            description=Blemaker
            message= _ "You are right, my son. We will help our orcish friends. But take care of you ... I would be desperate if something would happen to you."
        [/message]

        [objectives]
            side=1
            [objective]
                condition=win
                description=_ "Move Kapou'e to the end of the mountains"
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Kapou'e"
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Grüü"
            [/objective]
            [objective]
                condition=lose
                description=_ "Turns run out"
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=die
        [filter]
            description="Kapou'e"
        [/filter]
        [message]
            speaker=unit
            message= _ "Argh! I'm done. My people are doomed!"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            description=Blemaker
        [/filter]
        [message]
            description=Grüü
            message= _ "Father! Oh no!"
        [/message]
        [message]
            description=Grüü
            message= _ "Filthy dwarves! Now I'm to kill you to the last!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            description=Grüü
        [/filter]
        [message]
            speaker=unit
            message= _ "Oh no, I'm defeated."
        [/message]
        [if]
            [have_unit]
                description=Blemaker
            [/have_unit]
            [then]
                [message]
                    description=Blemaker
                    message= _ "My son! I should have never brought him to this fight. Now we are to return to our caverns, and we will never return."
                [/message]
                [endlevel]
                    result=defeat
                [/endlevel]
            [/then]
        [/if]
        [message]
            description="Kapou'e"
            message= _ "Our troll friends are done. We will desperately need their help in the coming battles. Without them there is no hope."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            description=Kwili
        [/filter]
        [message]
            speaker=unit
            message= _ "Argh! I die!"
        [/message]

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

        [message]
            description="Kapou'e"
            message= _ "You were warned, dwarf. Riders, spread out of the area and collect tax from each of these houses. If anyone refuses to pay, tie them up and plunder them. Let them know that it is only due to my benevolence that they are still alive. The main body along with myself shall continue on to Barag Gór. Catch up to us when your task is completed."
        [/message]

        [role]
            type=Direwolf Rider,Goblin Pillager,Goblin Knight,Wolf Rider
            role=doggie
        [/role]

        [message]
            role=doggie
            message= _ "Sounds like fun. Alright boys, let's go!"
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x=1
            y=5
            description="Kapou'e"
        [/filter]

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

            [then]
                [endlevel]
                    result=victory
                    bonus=yes
                [/endlevel]
            [/then]
        [/if]

        [if]
            [variable]
                name=Kwili_dead
                numerical_equals=0
            [/variable]

            [then]
                [endlevel]
                    bonus=no
                [/endlevel]
            [/then]
        [/if]

        {CLEAR_VARIABLE	Kwili_dead}
    [/event]

    [event]
        name=victory

        [if]
            [have_unit]
                description=Blemaker
            [/have_unit]
            [then]
                [message]
                    description="Kapou'e"
                    message= _ "We've succeeded! We've passed through the Mountains of Haag! Look at these green hills! The land of the free tribes is near now. I can see the walls of Barag Gór in the distance."
                [/message]
                [message]
                    description="Kapou'e"
                    message= _ "Blemaker, many thanks for your help in this fight. Would you like to join us in our journey with your son? Your help would be very appreciated!"
                [/message]

                [message]
                    description=Grüü
                    message= _ "Father, I'd like to join them. Would you mind it?"
                [/message]
                [message]
                    description=Blemaker
                    message= _ "My son, you're old enough to discover the world. Me, I have to stay here. But take care, there are plenty of creatures that seek our end, like elves or humans. They are clever and merciless."
                [/message]
                [message]
                    description=Grüü
                    message= _ "Thanks, father. Don't worry, I'll take care of myself."
                [/message]
            [/then]
            [else]
                [message]
                    description="Kapou'e"
                    message= _ "We've succeeded! We've passed through the Mountains of Haag! Look at these green hills! The land of the free tribes is near now. I can see the walls of Barag Gór in the distance."
                [/message]
                [message]
                    description="Kapou'e"
                    message= _ "Grüü, many thanks for your help in this fight. I'm sorry for your father. Would you like to join us in our journey? Your help would be very appreciated!"
                [/message]
                [message]
                    description=Grüü
                    message= _ "My father would have come to help you. I would insult his memory not to help you. I come!"
                [/message]
            [/else]
        [/if]
        [kill]
            description=Blemaker
        [/kill]
        [store_unit]
            [filter]
                description=Grüü
            [/filter]
            variable=gruu_store
        [/store_unit]
        {VARIABLE gruu_store.side 1}
        [unstore_unit]
            variable=gruu_store
        [/unstore_unit]
        {CLEAR_VARIABLE gruu_store}
    [/event]
[/scenario]
