#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 "knolls.ogg"}
    {EXTRA_SCENARIO_MUSIC "breaking_the_chains.ogg"}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                condition=win
                description=_ "Move Kapou'e to the end of the mountains"
            [/objective]
            [objective]
                condition=win
                description=_ "<255,255,255>Bonus objective:
@Defeat the enemy leader
`(early finish bonus)"
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Kapou'e"
            [/objective]
            [objective]
                condition=lose
                description=_ "Turns run out"
            [/objective]

            note={NEW_GOLD_CARRYOVER_NOTE_40}
        [/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]

    [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]

    {STARTING_VILLAGES 1 6}

    [side]
        type=Dwarvish Lord
        id=Kwili
        name= _ "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
        user_team_name=_"Dwarves"
    [/side]

    {STARTING_VILLAGES 2 6}

    [side]
        side=3
        team_name=Kapoue
        user_team_name=_ "Kapou'e"
        no_leader=yes
    [/side]

    [story]
        [part]
            show_title=yes
            {TO_TOWARD_MOUNTAINS_OF_HAAG}
        [/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]
            speaker="Kapou'e"
            message= _ "We have almost crossed the mountains. We're close to the lands of the free tribes. So far so good."
        [/message]
        [message]
            speaker=Kwili
            message= _ "Halt! Who goes there?"
        [/message]

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

        [message]
            speaker=Kwili
            # wmllint: local spelling stinkin'
            message= _ "Oh, so it's another group o' stinkin' orcs, eh. Begone, or we shall wash our axes in yer blood."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Look, you pint-sized idiot, 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]
            speaker=Kwili
            message= _ "Your scorn and rudeness shall be your undoing. Dwarves, let no orc pass this way alive!"
        [/message]

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

        [message]
            role=Helper
            message= _ "Hey, Chief, I was thinking - 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]
            speaker="Kapou'e"
            message= _ "We could, but then again, if we crush them then we can loot their treasury and their dwellings. The gold will be useful."
        [/message]

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

        {HIGHLIGHT_IMAGE 1 5 scenery/signpost.png ()}
    [/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]
            id=Blemaker
            name= _ "Blemaker"
            type=Troll Warrior
            side=3
            x=28
            y=13
            facing=sw
        [/unit]
        [unit]
            id=Grüü
            name= _ "Grüü"
            type=Troll Hero
            side=3
            x=27
            y=13
            profile=portraits/gruu.png
            facing=sw
            random_traits=no
            {IS_HERO}
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
        [/unit]
        [unit]
            id=Toughkon
            name= _ "Toughkon"
            type=Troll Whelp
            side=3
            x=25
            y=12
            facing=sw
        [/unit]
        [unit]
            id=Pe
            name= _ "Pe"
            type=Troll Whelp
            side=3
            x=26
            y=12
            facing=sw
        [/unit]

        [message]
            speaker=Blemaker
            message= _ "Look! Dwarves are fighting orcs!"
        [/message]
        [message]
            speaker=Grüü
            message= _ "Father, we should help them. Orcs are our allies."
        [/message]
        [message]
            speaker=Blemaker
            message= _ "I don't know. Orcs have been our allies in the past, but they treat us as fools."
        [/message]
        [message]
            speaker=Grüü
            message= _ "But, Father, we don't know what they are seeking there. Between us, we could squash these dwarves."
        [/message]
        [message]
            speaker=Blemaker
            message= _ "Right, my son. We help our orcish friends. But you take care ... I would be desperate if something happened to you."
        [/message]

        [objectives]
            side=1
            [objective]
                condition=win
                description=_ "Move Kapou'e to the end of the mountains"
            [/objective]
            [objective]
                condition=win
                description=_ "<255,255,255>Bonus objective:
@Defeat the enemy leader
`(early finish bonus)"
            [/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]

            note={NEW_GOLD_CARRYOVER_NOTE_40}
        [/objectives]
    [/event]

    [event]
        name=die
        [filter]
            id="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]
            id=Blemaker
        [/filter]
        [message]
            speaker=Grüü
            message= _ "Father! Oh no!"
        [/message]
        [message]
            speaker=Grüü
            message= _ "Filthy dwarves! Now I'll kill you to the last!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            id=Grüü
        [/filter]
        [message]
            speaker=unit
            message= _ "Oh no, I'm defeated."
        [/message]
        [if]
            [have_unit]
                id=Blemaker
            [/have_unit]
            [then]
                [message]
                    speaker=Blemaker
                    message= _ "My son! I should have never brought him to this fight. Now we return to our caverns, and we never return."
                [/message]
                [endlevel]
                    result=defeat
                [/endlevel]
            [/then]
        [/if]
        [message]
            speaker="Kapou'e"
            message= _ "The trolls 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]
            id=Kwili
        [/filter]
        [message]
            speaker=unit
            message= _ "Argh! I die!"
        [/message]

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

        [message]
            speaker="Kapou'e"
            message= _ "You were warned, dwarf. Riders, spread out of the area and collect what you can from each of these houses. If anyone refuses to pay, tie them up and take it anyway. Let them know that they live only on my good graces. I'll take the army to Barag Gór. Catch up when you're done."
        [/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
            id="Kapou'e"
        [/filter]

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

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

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

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

        {CLEAR_VARIABLE Kwili_dead}
    [/event]

    [event]
        name=victory

        [if]
            [have_unit]
                id=Blemaker
            [/have_unit]
            [then]
                [message]
                    speaker="Kapou'e"
                    message= _ "We've succeeded! We've passed through the Mountains of Haag! Look at these green hills! We've reached the lands of the free tribes. I can see the walls of Barag Gór in the distance."
                [/message]
                [message]
                    speaker="Kapou'e"
                    message= _ "Blemaker, many thanks for your help in this fight. Would you like to join us in our journey with your son? You are a powerful warrior, and you would be of great help."
                [/message]

                [message]
                    speaker=Grüü
                    message= _ "Father, I'd like to join them. Would you mind it?"
                [/message]
                [message]
                    speaker=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]
                    speaker=Grüü
                    message= _ "Thanks, father. Don't worry, I'll take care of myself."
                [/message]
            [/then]
            [else]
                [message]
                    speaker="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]
                    speaker="Kapou'e"
                    message= _ "Grüü, many thanks for your help in this fight. I'm sorry for the loss of your father. Would you like to join us in our journey? Your help would be useful to me."
                [/message]
                [message]
                    speaker=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]
            id=Blemaker
        [/kill]
        [store_unit]
            [filter]
                id=Grüü
            [/filter]
            kill=yes
            variable=gruu_store
        [/store_unit]
        {VARIABLE gruu_store.side 1}
        [unstore_unit]
            variable=gruu_store
        [/unstore_unit]
        {CLEAR_VARIABLE gruu_store}
    [/event]
[/scenario]
