#textdomain wesnoth-tb
[scenario]
    id=01_Rooting_Out_a_Mage
    name=_ "Rooting Out a Mage"
    map_data="{campaigns/Two_Brothers/maps/01_Rooting_Out_a_Mage.map}"
    turns=18
    next_scenario=02_The_Chase

    {DEFAULT_SCHEDULE_DUSK}

    {INTRO_AND_SCENARIO_MUSIC legends_of_the_north.ogg transience.ogg}
    {EXTRA_SCENARIO_MUSIC underground.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}
    {EXTRA_SCENARIO_MUSIC vengeful.ogg}
    {EXTRA_SCENARIO_MUSIC revelation.ogg}

    # This campaign, as originally written, had no definite time or
    # place.  There was a vague reference to "the eastern reaches of
    # the kingdom of Wesnoth".  In a later revision the epilog hints
    # that Arvith may have traveled with the elf-lord Kalenz, but this is
    # not much of a constraint as Kalenz was around in 1YW and at
    # least until the beginning of HttT in 517 YW.
    #
    # Maghre has to be within reach of the orcs, but in a time and
    # place where there haven't been orc raids for generations. I (ESR)
    # think this limits us to *western* Wesnoth, orc raids having been a
    # chronic problem in the northeast even during the Kingdom's strongest
    # periods. The logical time would be shortly after the death of
    # Haldric IV in 350, the beginning of the First Dark Age.  I'm arbitrarily
    # setting it at 363; Kalenz began his wanderings ten years later, so the
    # timing for Arvith to meet him later in life isn't bad.  (Later moved
    # to 363 so the timing of the Epilog A-Red's backstory changes works
    # better.)

    # Placing the campaign is a little trickier.  Our main textual
    # clue is that there is a dense wood, said by legend to be
    # haunted, a few days' ride north.  Later, the boss's keep is said to
    # be still further north.  Neither of these directions has plot importance,
    # but they do suggest a locale for Maghre - near the Grey Woods.  The
    # battle maps exclude it from being in a featureless plain, though;
    # there are hills to the south and west.
    #
    # So let it be written, so let it be done.  See the tracking map
    # for the result.

    # wmllint: directory spelling Maghre
    [story]
        [part]
            story=_ "The remote freehold of Maghre in the western reaches of the kingdom of Wesnoth was once a peaceful place, its inhabitants largely unaware of the comings and goings of the wider world. Wars and the rumor of wars touched them not, until the day a dark mage settled in the region and began seeking sacrifices for his evil summonings."
            background=story/Two_Brothers_M1P1.png
        [/part]
        [part]
            story=_ "Skeletons and zombies killed cattle and fired fields. <i>“Fear and obey Mordak the Mage!”</i> they cried in fell voices as they did their foul deeds. People vanished from isolated farmsteads. Men and women began to fear the night, and their children even the bright day. But the nearest lord was more than a day’s ride distant, and messengers sent to seek his help did not return."
            background=story/Two_Brothers_M1P1.png
        [/part]
        [part]
            story=_ "There was a man named Baran who had shown talent as a mage when he was young, gone to the great Academy on the Isle of Alduin, and returned to work his magic in the land where he was born. The people looked to him for help and leadership. He found weapons half-forgotten from the times of their sires and grandsires hanging in many houses, and bade the villagers to take them down and clean and oil them. He set the smiths of Maghre to making spearheads and ax-blades for the rest."
            background=story/Two_Brothers_M1P1.png
        [/part]
        [part]
            story=_ "Now Baran had a brother named Arvith who had also left Maghre to seek his fortune, and had become the leader of a small band of horsemen who hired out as guards to merchant caravans. Fortunate it was for all that when Baran was but an apprentice mage, he had made a pair of amulets for himself and his brother, with which they might call to each other when in dire need. Baran sent out that call."
            background=story/Two_Brothers_M1P2.png
        [/part]
        [part]
            story=_ "12 V, 363 YW
Excerpt from the journal of Baran of Maghre

If I could but face this ‘Mordak’! I think my magic might prove stronger than his. But he bides in the hills, well-guarded by his servants, and I muster frightened peasants to fight his minions with blades and sticks. I need my brother; he always had a better head for battle than I.

Will he heed the call? I do not know if he has kept the amulet; we have not spoken since that evil day at Toen Caric. If he will not come for me, perhaps he will return to aid our village in its hour of desperate need."
            background=story/Two_Brothers_M1P2.png
        [/part]
        [part]
            story=_ "Heeding the call of his amulet, Arvith gathered such men as he could and hurried to Maghre to help Baran."
            show_title=yes
            {TB_BIGMAP}
            {JOURNEY_STAGE1}
        [/part]
    [/story]

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Slay Mordak, the evil mage"
                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]

    [side]
        {FLAG_VARIANT loyalist}
#ifdef EASY
        gold=40
#endif
#ifdef HARD
        gold=25
#endif
        type=Knight
        id=Arvith
        name= _ "Arvith"
        unrenamable=yes
        profile="portraits/arvith.png~RIGHT()"
        facing=sw
        side=1
        canrecruit=yes
        controller=human
        recruit=Horseman,Bowman,Spearman,Footpad
        [unit]
            id=Baran
            name= _ "Baran"
            unrenamable=yes
            type=Red Mage
            profile=portraits/baran.png
            side=1
            {IS_HERO}
            x=31
            y=21
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_INTELLIGENT}
            [/modifications]
        [/unit]

        #the armed villagers, beware them
#define SOUTHWEST
    [+unit]
        facing=sw
    [/unit]
#enddef
        {NAMED_LOYAL_UNIT 1 Spearman 30 22 Alwyn  (_ "Alwyn")}  {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Spearman 30 21 Brent  (_ "Brent")}  {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Spearman 31 22 Cadell (_ "Cadell")} {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Spearman 32 19 Dannen (_ "Dannen")} {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Bowman   33 19 Efran  (_ "Efran")}  {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Footpad  32 18 Faren  (_ "Faren")}  {SOUTHWEST}

        # Arvith’s mercenary band
        {NAMED_LOYAL_UNIT 1 Horseman 33 21 Tarek  (_ "Tarek")}  {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Horseman 32 21 Hann   (_ "Hann")}   {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Horseman 33 20 Magrid (_ "Magrid")} {SOUTHWEST}
#undef SOUTHWEST

        team_name=good
        user_team_name=_"Humans"
    [/side]

    {STARTING_VILLAGES 1 12}

    [side]
#ifdef HARD
        gold=200
#else
        gold=120
#endif
        type=Dark Sorcerer
        id=Mordak
        name= _ "Mordak"
        side=2
        canrecruit=yes
#ifdef HARD
        recruit=Skeleton,Walking Corpse,Vampire Bat,Ghost,Dark Adept,Ghoul
#else
        recruit=Walking Corpse,Vampire Bat,Dark Adept,Ghoul
#endif
        [ai]
            recruitment_ignore_bad_movement=yes
            grouping=no
            passive_leader=yes
        [/ai]
        team_name=evil
        user_team_name=_"Enemies"
        {FLAG_VARIANT undead}
    [/side]

    {STARTING_VILLAGES 2 5}

    [event]
        name=start

        [role]
            type=Horseman
            [not]
                canrecruit=yes
            [/not]
            role=Mercenary
        [/role]

        [message]
            speaker=Baran
            message= _ "Greetings, brother, and welcome home."
        [/message]
        [message]
            speaker=Arvith
            message= _ "Hail."
        [/message]
        [message]
            speaker=Baran
            message= _ "Is that all, Arvith? I understand, but..."
        [/message]
        [message]
            speaker=Arvith
            message= _ "You called, and I came; be content with that. What ails Maghre?"
        [/message]
        [message]
            speaker=Baran
            message= _ "A dark mage has come upon us; his creatures call him Mordak. They have been terrorizing outlying farms, and we fear they may soon attack the village itself! The villagers of Maghre have taken up weapons but they are not trained fighters; but we need your men, and you to lead them."
        [/message]
        [message]
            speaker=Baran
            message= _ "I can feel Mordak’s foul touch on the hidden currents of the earth and air. He is somewhere due north of here, I would say not more than two days’ ride."
        [/message]
        [message]
            speaker=Arvith
            message= _ "All right. I will do this for the village. Can you keep the mage off our backs?"
        [/message]
        [message]
            speaker=Baran
            message= _ "I will go stealthily with a handful of our best scouts and woodsmen. While you demonstrate against him and kill his creatures, I will try to defeat Mordak himself with magic at an unguarded moment. You shall be the right hand, I the left... aye, brother?"
        [/message]
        [message]
            speaker=Arvith
            message= _ "... Aye. Just make sure you’re there when we need you."
        [/message]
        [kill]
            id=Baran
        [/kill]
    [/event]

    [event]
        name=turn 6
        [message]
            speaker=Arvith
            message= _ "Baran should be in position by now. Press them, distract the adept so Baran can spring his trap!"
        [/message]
    [/event]

    [event]
        name=turn 10
        [message]
            speaker=Arvith
            message= _ "Baran has not made his attack!"
        [/message]
        [message]
            role="Mercenary"
            message= _ "Could he have abandoned us?"
        [/message]
        [message]
            speaker=Arvith
            message= _ "No... No. This is something else. I’m worried about him... but right now it means we have to deal with this Mordak ourselves."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Mordak
        [/filter]
        [message]
            speaker=unit
            message= _ "Argh!"
        [/message]
        [message]
            speaker=Arvith
            message= _ "Good work, men! But what has become of my brother?"
        [/message]
        [message]
            speaker=unit
            message= _ "Worried about him, are you? E-he-he... hergh... gaargh..." # wmllint: no spellcheck
        [/message]
        [kill]
            id=Mordak
            animate=yes
        [/kill]
        [message]
            speaker=Arvith
            message= _ "There’s nothing more to be had from this one; we will have to search for Baran ourselves!"
        [/message]
        [role]
            type=Spearman,Bowman,Horseman
            role=Reporter
        [/role]
        [message]
            role=Reporter
            message= _ "Sir, our scouts report that Baran was seen captured and carried away further north!"
        [/message]
        [message]
            speaker=Arvith
            message= _ "That they should dare this! We will give chase at once."
        [/message]
        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    #you lose
    [event]
        name=time over
        [message]
            speaker=Mordak
            message= _ "Your brother’s plan to ambush me has failed. He is our prisoner now."
        [/message]
        [message]
            speaker=Arvith
            message= _ "My brother, kidnapped? I have failed you, Baran! And even now Mordak’s forces descend upon the village!"
        [/message]
    [/event]

    #When you attack
    [event]
        name=attack
        [filter_second]
            side=2
            [not]
                type=Dark Adept,Dark Sorcerer,Vampire Bat
            [/not]
        [/filter_second]
        [message]
            speaker=Arvith
            message= _ "I hear these creatures are nigh-immune to our weapons, let us see!"
        [/message]
    [/event]

    #killer saying some bravado
    [event]
        name=die
        [filter]
            side=2
            [not]
                type=Dark Adept,Dark Sorcerer,Vampire Bat
            [/not]
        [/filter]
        [message]
            speaker=second_unit
            message= _ "That was not so hard!"
        [/message]
    [/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]
