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

    {TURNS 27 24 20}

    victory_when_enemies_defeated="no"

    {DEFAULT_SCHEDULE_MORNING}

    next_scenario=04_The_Siege_of_Barag_Gor

    {SCENARIO_MUSIC "knolls.ogg"}
    {EXTRA_SCENARIO_MUSIC "breaking_the_chains.ogg"}
    {EXTRA_SCENARIO_MUSIC "knalgan_theme.ogg"}

    [event]
        name=prestart

        [capture_village]
            side=2
            x=1-17
        [/capture_village]

        [objectives]
            side=1
            [objective]
                condition=win
                description=_ "Move Kapou’e to the end of the mountains or"
            [/objective]
            [objective]
                condition=win
                description= _ "Defeat the enemy leader"+{EARLY_FINISH_BONUS_FOOTNOTE}
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Kapou’e"
            [/objective]

            {TURNS_RUN_OUT}

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

    [item]
        x=33
        y=23
        image=items/orcish-flag.png
    [/item]
    [item]
        x=36
        y=19
        image=items/orcish-flag.png
    [/item]

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

    {STARTING_VILLAGES 1 4}

    [side]
#ifdef HARD
        type=Dwarvish Lord
#else
        type=Dwarvish Steelclad
#endif
        id=Kwili
        name= _ "Kwili"
        side=2
        canrecruit=yes
        facing=se
        recruit=Dwarvish Steelclad, Dwarvish Thunderguard, Dwarvish Pathfinder, Dwarvish Fighter, Dwarvish Thunderer, Dwarvish Scout
        {GOLD 120 160 200}
        team_name=Dwarves
        user_team_name=_"Dwarves"
        [ai]
            [aspect]
                id=recruitment_instructions
                [facet]
                    [value]
                        [recruit]
                            type=2
#ifdef EASY
                            number=0
#endif
#ifdef NORMAL
                            number=1
#endif
#ifdef HARD
                            number=2
#endif
                            total=yes
                            importance=1
                        [/recruit]
                        [recruit]
                            type=1
                            importance=0
                        [/recruit]
                    [/value]
                [/facet]
            [/aspect]
        [/ai]
    [/side]

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

    {BIGMAP_03}

    [event]
        name=start

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

        [if]
            [have_unit]
                role=Helper
                search_recall_list=yes
            [/have_unit]
            [then]
                [recall]
                    role=Helper
                [/recall]
            [/then]
            [else]
                {UNIT 1 (Orcish Grunt) 35 23 (role=Helper)}
            [/else]
        [/if]

        [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= _ "(<i>Snicker</i>)"
        [/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 4

        [fire_event]
            name=trolls_appear
        [/fire_event]
    [/event]

    # Needs to fire on Turn 4 or at victory, whichever happens first.
    # It gets a custom name, rather 'name=turn 4,victory', so that
    # we can guarantee that it fires before the victory event below
    [event]
        name=trolls_appear
        [unit]
            id=Blemaker
            name= _ "Blemaker"
            type=Troll Warrior
            side=3
            x=31
            y=10
            facing=sw
        [/unit]
        [unit]
            id=Grüü
            name= _ "Grüü"
            unrenamable=yes
            type=Troll Hero
            side=3
            x=30
            y=9
            profile=portraits/gruu.png
            facing=sw
            random_traits=no
            {IS_HERO}
            [modifications]
                {TRAIT_LOYAL}
                [object]
                    [effect]
                        apply_to=image_mod
                        # This shifts the skin colors to be slightly more red
                        replace="PAL(D0CFBF,A8A8A8,747F73,616153,374336>D3BCC1,A8A8A8,817D71,635054,454133)"
                    [/effect]
                [/object]
            [/modifications]
        [/unit]
        [unit]
            id=Toughkon
            name= _ "Toughkon"
            type=Troll Whelp
            side=3
            x=32
            y=10
            facing=sw
        [/unit]
        [unit]
            id=Pe
            name= _ "Pe"
            type=Troll Whelp
            side=3
            x=33
            y=11
            facing=sw
        [/unit]

        {AI_CONTROLLER_ALLOW_UNIT_CONTROL 1 "Grüü"}

        [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 or"
            [/objective]
            [objective]
                condition=win
                description= _ "Defeat the enemy leader"+{EARLY_FINISH_BONUS_FOOTNOTE}
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Kapou’e"
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Grüü"
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                carryover_percentage=40
            [/gold_carryover]
            [note]
                description= _ "In this scenario, you may ask Grüü to move to any hex by right-clicking on that hex."
            [/note]
        [/objectives]
    [/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=last breath
        [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=last breath
        [filter]
            id=Kwili
        [/filter]
        [message]
            speaker=unit
            message= _ "Argh! I die!"
        [/message]

        [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. All right boys, let’s go!"
        [/message]

        # Just in case the trolls have not appeared yet, bring them out
        [fire_event]
            name=trolls_appear
        [/fire_event]

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

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

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

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

    [event]
        name=victory

        [if]
            [have_unit]
                id=Blemaker
            [/have_unit]
            [then]
                [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= _ "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]

        [modify_unit]
            [filter]
                id=Grüü
            [/filter]
            side=1
        [/modify_unit]
    [/event]

    {KAPOUE_DEATH}
[/scenario]
