#textdomain wesnoth-sota

# Walkthrough tip if you have trouble: Use walking corpses. Recruit about five, including
# a soulless or two. Make more at every opportunity: two or three per turn. You need the
# enemy to attack their former soldiers instead of your leveled ones.

[scenario]
    name= _ "Entering the Northlands"
    map_data="{campaigns/Secrets_of_the_Ancients/maps/14_Entering_the_Northlands.map}"

    id=14_Entering_the_Northlands
    next_scenario=15_Mountain_Pass

    [story]
        [part]
            [background_layer]
                image=story/black-background.png
                scale=yes
                base_layer=yes
            [/background_layer]
            [image]
                x,y=400,200
                centered=yes
                file=story/ford-of-abez-1.jpg
            [/image]
            title= _ "<i>Chapter Three:</i> To Conquer Death"
            show_title=yes
            title_alignment=left
            story= _ "24 IV, 23 YW

We reached the Ford of Abez as the dawn light spread behind the mountain peaks to the north. As we waded across, the dark water reached to our waists, which made for slow going. I dared not imagine what manner of tentacled creature lurked below, but we completed the crossing without incident. The water was chill with snowmelt, so our teeth were chattering when we reached the far shore. The rising sun was warm though, and had us dried in short order. Despite this, Ras-Tabahn was not well off. He collapsed in the sand and went into a paroxysm of coughing the like of which I had never seen. When he could speak again, he assured me that it was only on account of the cold, and I should not be unduly troubled. I am uneasy all the same."
        [/part]
        {JOURNEY_PART 14}
    [/story]

    {DEFAULT_SCHEDULE}
    {DEFAULT_MUSIC_PLAYLIST}
    {TURNS 36 35 34}

    [side]
        # wmllint: unwho SIDE_1_ARDONNA
        # wmllint: unwho SIDE_1_RAS-TABAHN
        # wmllint: who SIDE_1_BOTH is Ardonna,Ras-Tabahn
        # wmllint: who RECALL_LOYAL_UNITS is Bone Captain, Vendraxis, Shynal, Carcyn
        {SIDE_1_BOTH}
        {GOLD 170 170 170}
    [/side]

    [side]
        side=2
        type=Orcish Sovereign
        controller=ai
        user_team_name= _ "Orcs"
        name= _ "Rod-Ishnak"
        id=Rod-Ishnak
        team_name=bad
        recruit=Orcish Crossbowman,Orcish Warrior
        {GOLD 100 140 200}
        {INCOME 17 22 28}
        {FLAG_VARIANT6 ragged}
    [/side]

    [side]
        side=3
        type=Orcish Warlord
        controller=ai
        user_team_name= _ "Orcs"
        name= _ "Vok-Hroog"
        id=Vok-Hroog
        profile=portraits/orcs/grunt-6.png
        team_name=bad
        [unit]
            x,y=6,6
            type=Orcish Shaman
            name= _ "Krongk"
            id=Krongk
        [/unit]
        recruit=Orcish Crossbowman,Orcish Warrior
        {GOLD 100 140 200}
        {INCOME 15 20 26}
        {FLAG_VARIANT6 ragged}
    [/side]

    # Without these, the AI tends to get nothing *but* Orcish Crossbowmen, and the scenario
    # becomes unbeatable (probably), not to mention boring.
#ifdef EASY
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2,3 (Orcish Crossbowman) 4}
#endif
#ifdef NORMAL
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2,3 (Orcish Crossbowman) 5}
#endif
#ifdef HARD
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2,3 (Orcish Crossbowman) 6}
#endif

    {STARTING_VILLAGES 2 6}

    # *************************** PRESTART ***************************
#define STARTING_ORC SIDE TYPE
    {FIND_CASTLE_HEX {SIDE} location}
    [unit]
        x=$location.x
        y=$location.y
        type={TYPE}
        side={SIDE}
    [/unit]
#enddef

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Defeat all enemy leaders"
                condition=win
            [/objective]

            {HOW_TO_LOSE_WITH_BOTH}

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

        [set_variables]
            name=starting_orc_units
            mode=append
            [split]
                list="Orcish Archer,Orcish Archer,Wolf Rider,Wolf Rider,Goblin Pillager"
                key=type
                separator=","
            [/split]
        [/set_variables]

        [for]
            array=starting_orc_units
            variable=i
            [do]
                {STARTING_ORC 2 $starting_orc_units[$i].type}
            [/do]
        [/for]

        [for]
            array=starting_orc_units
            variable=i
            [do]
                {STARTING_ORC 3 $starting_orc_units[$i].type}
            [/do]
        [/for]

        [clear_variable]
            name=location,starting_orc_units
        [/clear_variable]

        {FREEZE_UNIT Krongk}

        {RECALL_LOYAL_UNITS}
    [/event]
    # *************************** PLAY ***************************
    # Finishing this scenario without a lot of gold for the next one
    # can cause trouble for players, so give them a hint.
    [event]
        name=turn 2
        [if]
            [have_unit]
                id=Vendraxis
            [/have_unit]
            [then]
                [message]
                    speaker=Vendraxis
                    message= _ "I have a sssense of dark foreboding regarding the sssnowy peaksss ahead. We may meet our doom if we don't have enough coinsss." # no spellcheck
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Ras-Tabahn
                    message= _ "The passes to the north are the end of many travelers. We would be wise to reach them with a reserve of gold. (<i>Cough, cough</i>)"
                [/message]
            [/else]
        [/if]
    [/event]

    [event]
        name=attack
        [filter_second]
            id=Krongk
        [/filter_second]
        [message]
            speaker=Krongk
            message= _ "They’re attacking me!"
        [/message]
        [message]
            speaker=Vok-Hroog
            message= _ "Yeah, yeah."
        [/message]
        {THAW_UNIT Krongk}
    [/event]

    # *************************** ENDING / OPENING ***************************
    [event]
        name=start
        [message]
            speaker=Ras-Tabahn
            message= _ "We have crossed into the north. The dwarven kingdom of Knalga lies straight ahead."
        [/message]
        [message]
            speaker=Shynal
            message= _ "Now I’m really far from home. I’ve never been north of the river before. I hope I get to see some dwarves!"
        [/message]
        [message]
            speaker=Vok-Hroog
            message= _ "I claim this territory in the name of Krag-Ubor, the ruler of all true orcs! Leave now, Ishnak, or face the combined wrath of the five tribes."
        [/message]
        [message]
            speaker=Rod-Ishnak
            message= _ "I arrived first, Hroog. It’s mine!"
        [/message]
        [message]
            speaker=Ardonna
            message= _ "This could be trouble."
        [/message]
        [message]
            speaker=Ras-Tabahn
            message= _ "Many orcs are decent sorts (<i>cough, cough</i>). I fought alongside Krag-Ubor once, who the farther orc just mentioned."
        [/message]
        [message]
            speaker=Vok-Hroog
            message= _ "Wait who’s that?"
        [/message]
        [message]
            speaker=Rod-Ishnak
            message= _ "Wizards and deaders just like from back home! I <i>hate</i> those! I suggest a contest. Whoever kills the most wizards and skeletons and stuff takes this territory and all the human slaves."
        [/message]
        [message]
            speaker=Vok-Hroog
            message= _ "Huh. Fine. That sounds like good sport."
        [/message]
        [message]
            speaker=Krongk
            message= _ "I declare this competition official. I will support the claim of the winner."
        [/message]
        [message]
            speaker=Vok-Hroog
            message= _ "Yeah, yeah."
        [/message]
        [message]
            speaker=Ardonna
            message= _ "I did say this was trouble."
        [/message]
        [message]
            speaker=Shynal
            message= _ "But we’ll win, won’t we?"
        [/message]
    [/event]

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

    {HERO_DEATHS}
    {MANAGE_PROFILE}
    {KIDS_ADVANCE}
[/scenario]
