#textdomain wesnoth-tb
[scenario]
    id=02_The_Chase
    name= _ "The Chase"
    map_data="{campaigns/Two_Brothers/maps/02_The_Chase.map}"
    next_scenario=03_Guarded_Castle
#ifdef EASY
    turns=28
#endif
#ifdef HARD
    turns=24
#endif
    victory_when_enemies_defeated=no

    {DEFAULT_SCHEDULE_DUSK}

    {INTRO_AND_SCENARIO_MUSIC frantic.ogg elf-land.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}
    {EXTRA_SCENARIO_MUSIC wanderer.ogg}
    {EXTRA_SCENARIO_MUSIC legends_of_the_north.ogg}
    {EXTRA_SCENARIO_MUSIC vengeful.ogg}

    [story]
        [part]
            story=_ "Arvith and his band rode north in search of his missing brother."
            background=story/Two_Brothers_M2P1.png
        [/part]
        # Diary entries split into two parts until story screens allow vertical scrolling (FR #17492).
        # wmllint: local spelling Grey
        [part]
            story=_ "16 V, 363 YW
Excerpt from the journal of Arvith of Maghre

We’ve been searching three days for Baran, and turned up nothing. My best hunch was to head north into the borderlands, where the necromancer’s minions could safely hide; everywhere else is more farmland. At first I thought the search might be useless, but late in the first day we found a set of tracks. Some of them had been made by skeletal feet.

We’re close enough to be certain now: those tracks are heading into the Grey Woods. No one from Maghre or any of the other villages has gone into that forest in living memory. Stories have been passed down for generations warning against it. Supposedly the place is haunted by lost souls who hunger for the living, and anyone who dies there is doomed to join them."
            background=story/Two_Brothers_M2P1.png
        [/part]
        [part]
            story=_ "16 V, 363 YW
Excerpt from the journal of Arvith of Maghre

But I’m past superstitions now; I’ve seen enough of the world to guess at the truth behind these sorts of tales. The forest is home to elves — unfriendly ones, if the stories have any basis at all. I worry for my men; horses don’t fight well in forests, and the elves will be more dangerous in their own territory. But there are things that need done and questions that need answered. Something bigger is happening. One necromancer terrorizing townsfolk is nothing new, but why didn’t his servants scatter when he was killed? Where are they headed now? And most importantly, why did they take Baran with them?

Besides... I want my brother back."
            background=story/Two_Brothers_M2P1.png
        [/part]
    [/story]
    {TB_TRACK {JOURNEY_STAGE2}}

    [event]
#ifdef EASY
        [terrain]
            x=10
            y=44
            terrain=Gg^Vh
        [/terrain]
        [terrain]
            x=13
            y=42
            terrain=Gg^Vh
        [/terrain]
        [terrain]
            x=10
            y=26
            terrain=Gg^Vh
        [/terrain]
        [terrain]
            x=3
            y=34
            terrain=Gg^Vh
        [/terrain]
#endif
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Fight your way through the woods before the kidnappers escape"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Arvith"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]
        [remove_shroud]
            side=1
            x=0-20
            y=15-54
        [/remove_shroud]
    [/event]

    {PLACE_IMAGE scenery/signpost.png 10 1}

    [side]
#ifdef EASY
        gold=180
        income=10
#endif
#ifdef HARD
        gold=120
#endif
        type=Knight
        id=Arvith
        name= _ "Arvith"
        unrenamable=yes
        profile="portraits/arvith.png~RIGHT()"
        side=1
        canrecruit=yes
        controller=human
        recruit=Horseman,Bowman,Spearman,Footpad
        team_name=good
        user_team_name=_"Humans"
        shroud=yes
        {FLAG_VARIANT loyalist}
    [/side]

    {STARTING_VILLAGES 1 7}

    [side]
#ifdef EASY
        gold=25
#endif
#ifdef HARD
        gold=60
#endif
        type=Elvish Rider
        id=Nil-Galion
        name= _ "Nil-Galion"
        unrenamable=yes
        side=2
        canrecruit=yes
        recruit=Elvish Scout
        income=-8
        team_name=elves
        user_team_name=_"Elves"
        [ai]
            recruitment_pattern=scout
        [/ai]

        [unit]
            side=2
            type=Elvish Scout
            x=15
            y=20
        [/unit]
        [unit]
            side=2
            type=Elvish Fighter
            x=5
            y=13
        [/unit]
        [unit]
            side=2
            type=Elvish Scout
            x=4
            y=36
        [/unit]
        [unit]
            side=2
            type=Elvish Scout
            x=7
            y=46
        [/unit]
        [unit]
            side=2
            type=Elvish Scout
            x=15
            y=35
        [/unit]
#ifdef HARD
        [unit]
            side=2
            type=Elvish Scout
            x=7
            y=25
        [/unit]
        [unit]
            side=2
            type=Elvish Scout
            x=10
            y=33
        [/unit]
        [unit]
            side=2
            type=Elvish Hero
            x=11
            y=45
        [/unit]
        [unit]
            side=2
            type=Elvish Rider
            x=15
            y=23
        [/unit]
        [unit]
            side=2
            type=Wose
            x=7
            y=29
        [/unit]
#endif
        {FLAG_VARIANT wood-elvish}
    [/side]

#ifdef EASY
    {STARTING_VILLAGES 2 17}
#endif
#ifdef HARD
    {STARTING_VILLAGES 2 30}
#endif

    [event]
        name=start

        [if]
            [have_unit]
                side=1
                type=Horseman
                search_recall_list=yes
            [/have_unit]

            [then]
                [role]
                    type=Horseman
                    role=speaker
                [/role]

                [recall]
                    role=speaker
                [/recall]
            [/then]

            [else]
                [unit]
                    type=Horseman
                    side=1
                    placement=leader
                    generate_name=yes
                    role=speaker
                [/unit]
            [/else]
        [/if]

        [message]
            speaker=Arvith
            message= _ "Come on, men. A stroll through such lovely green woods, what could be finer?"
        [/message]
        [message]
            speaker=Nil-Galion
            message= _ "You there! Halt and explain yourself."
        [/message]
        [message]
            speaker=Arvith
            message= _ "We’re chasing after some men who kidnapped my brother!"
        [/message]
        [message]
            speaker=Nil-Galion
            message= _ "Those men told me their prisoner had attempted to murder their master, and warned that evil men would follow him. Advance no further, or you will die."
        [/message]
        [message]
            speaker=Arvith
            message= _ "So much for those ghost stories. Mere elves will not stop me from freeing Baran!"
        [/message]
        [message]
            role=speaker
            message= _ "I am glad at least that we will not have to face ghosts. But those elves will have us at a disadvantage; our horses will not maneuver well in the trees."
        [/message]
        [message]
            speaker=Arvith
            message= _ "Bah, just stay on the paths; our spearmen and bowmen can fight in the deeper woods. We have faced and won through greater perils than those amateurs can offer."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=1-19
            y=1-12
        [/filter]

        [unit]
            type=Dark Adept
            id=Muff Toras
            name= _ "Muff Toras"
            {IS_HERO}
            unrenamable=yes
            x=9
            y=4
            ai_special=guardian
            side=2
        [/unit]
#ifdef EASY
        [unit]
            type=Skeleton
            x=9
            y=5
            ai_special=guardian
            side=2
        [/unit]
        [unit]
            type=Skeleton
            x=9
            y=3
            ai_special=guardian
            side=2
        [/unit]
#endif
#ifdef HARD
        [unit]
            type=Revenant
            x=9
            y=5
            ai_special=guardian
            side=2
        [/unit]
        [unit]
            type=Revenant
            x=9
            y=3
            ai_special=guardian
            side=2
        [/unit]
#endif
        [remove_shroud]
            side=1
            x=0-20
            y=0-15
        [/remove_shroud]

        [message]
            speaker=unit
            message= _ "I see them! There they are!"
        [/message]
        [message]
            speaker=Muff Toras
            message= _ "Curses! If they had been an hour slower our master’s reinforcements would already be here to meet us."
        [/message]
        [objectives]
            side=1
            [objective]
                description= _ "Kill the Dark Adept before his reinforcements arrive"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Arvith"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

    [event]
        name=turn 12
        [message]
            speaker=Arvith
            message= _ "Come on, men, let’s catch those kidnappers!"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Muff Toras
        [/filter]
        [message]
            speaker=unit
            message= _ "Hah! You have captured me, but it will avail you nothing. I sent your precious brother the mage north with half my men a day since; he will be safely locked away in our master’s dungeons by now."
        [/message]
        [message]
            speaker=Arvith
            message= _ "My blade is at your throat. Give us the way to my brother now, or I will spill your wretched blood on the ground."
        [/message]

        {VARIABLE first_password_1 _"Sithrak"}
        {VARIABLE first_password_2 _"Eleben"}
        {VARIABLE first_password_3 _"Jarlom"}
        {VARIABLE first_password_4 _"Hamik"}
        {VARIABLE_OP first_password_number rand "1..4"}

        {VARIABLE second_password_1 _"Akranbral"}
        {VARIABLE second_password_2 _"Drakanal"}
        {VARIABLE second_password_3 _"Xaskanat"}
        {VARIABLE second_password_4 _"Katklagad"}
        {VARIABLE_OP second_password_number rand "1..4"}

        [if]
            [not]
                [have_unit]
                    role=speaker
                [/have_unit]
            [/not]

            [then]
                [role]
                    side=1
                    [not]
                        id=Arvith
                    [/not]
                    role=speaker
                [/role]
            [/then]
        [/if]

        [message]
            speaker=unit
            message= _ "Three days ride to the northeast, in a deserted castle. The passwords to the guards are $first_password_$first_password_number and $second_password_$second_password_number|."
        [/message]
        [message]
            speaker=Arvith
            message= _ "Bind him and take him with us. If he has played us false, he will die."
        [/message]
        [message]
            role=speaker
            message= _ "Captain, what are we riding into? I thought you wanted nothing to do with Baran any more, not since Toen Caric."
        [/message]
        [message]
            speaker=Arvith
            message= _ "I’m no longer sure. What’s between us remains, but knowing someone else has lain hands on him changes things. Mount up, and let’s get moving."
        [/message]

#ifdef EASY
        [move_unit_fake]
            type=Iron Mauler
            side=1
            x=1,1,3,4,8
            y=6,4,3,3,1
        [/move_unit_fake]
        {NAMED_UNIT 1 (Iron Mauler) 8 1 Brena _"Brena" (
            overlays="misc/loyal-icon.png"
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_STRONG}
            [/modifications]
        )}
        [message]
            speaker=Brena
            message= _ "Greetings. I am Brena, a knight errant. I saw you pursuing and fighting the foul undead. Are there more of them to be destroyed?"
        [/message]
        [message]
            speaker=Arvith
            message= _ "Aye. We think there’s a nest of them north-east of here. They’ve captured my brother."
        [/message]
        [message]
            speaker=Brena
            message= _ "I bear a great hatred towards their kind. I will follow and fight them with you, if you permit."
        [/message]
        [message]
            role=speaker
            message= _ "He would only slow us down!"
        [/message]
        [message]
            speaker=Arvith
            message= _ "It is my place to decide this."
            [option]
                message= _ "Oh, all right then. Come along with us."
                [command]
                    [message]
                        speaker=Brena
                        message= _ "Thank you. My comrades and I will help you on your noble quest."
                    [/message]
                    [allow_recruit]
                        side=1
                        type=Heavy Infantryman
                    [/allow_recruit]
                [/command]
            [/option]
            [option]
                message= _ "I am sorry. We have not the time to spare."
                [command]
                    [message]
                        speaker=Brena
                        message= _ "Take this, then, for I see that you are on a quest. My comrades will help you whenever you call for them."
                    [/message]
                    [allow_recruit]
                        side=1
                        type=Heavy Infantryman
                    [/allow_recruit]
                    [kill]
                        id=Brena
                    [/kill]
                    [kill]
                        type=Iron Mauler
                    [/kill]
                    [sound]
                        name=gold.ogg
                    [/sound]
                    [message]
                        speaker=narrator
                        image="wesnoth-icon.png"
                        message= _ "You receive 70 pieces of gold!"
                    [/message]
                    [gold]
                        side=1
                        amount=70
                    [/gold]
                [/command]
            [/option]
        [/message]
#endif
        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    [event]
        name=time over
        [message]
            speaker=Muff Toras
            message= _ "My reinforcements are here!"
        [/message]
        [message]
            speaker=Arvith
            message= _ "He escaped us..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Nil-Galion
        [/filter]
        [message]
            speaker=Nil-Galion
            message= _ "Foolish human, you have killed me but you will not catch the undead in time. I have fulfilled my contract, and will be reanimated soon to become a lord of their armies."
        [/message]
        [kill]
            id=Nil-Galion
            animate=yes
        [/kill]
        [message]
            speaker=Arvith
            message= _ "Follow their back trail!"
        [/message]
        [objectives]
            side=1
            [objective]
                description= _ "Catch the kidnappers"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Arvith"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

    [event]
        name=last breath
        [filter]
            id=Arvith
        [/filter]
        [message]
            speaker=Arvith
            message= _ "All is lost now that I am dead..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
[/scenario]
