#textdomain wesnoth-tb
[scenario]
    id=1_Rooting_Out_A_Mage
    name=_ "Rooting Out A Mage"
    map_data="{campaigns/Two_Brothers/maps/1_Rooting_Out_A_Mage.map}"
    turns=18
    next_scenario=2_The_Chase

    {DUSK}
    {FIRST_WATCH}
    {SECOND_WATCH}
    {DAWN}
    {MORNING}
    {AFTERNOON}

    {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 Arne 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 353; Kalenz began his wanderings ten years later, so the
    # timing for Arne to meet him later in life isn't bad.

    # 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 Gray 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. 'Fear and obey Mordak the Mage!' 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 Bjarn 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 Bjarn had a brother named Arne 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 Bjarn 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. Bjarn sent out that call."
            background=story/Two_Brothers_M1P2.png
        [/part]
        [part]
            story=_ "Heeding the call of his amulet, Arne gathered such men as he could and hurried to Maghre to help Bjarn."
            show_title=yes
            {TO_ROOTING_OUT_A_MAGE}
        [/part]
    [/story]

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Slay Mordak, the evil mage"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Arne"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]

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

    [side]
#ifdef EASY
        gold=40
#endif
#ifdef HARD
        gold=25
#endif
        type=Knight
        id=Arne
        name= _ "Arne"
        unrenamable=yes
        profile="portraits/humans/knight.png"
        facing=sw
        side=1
        canrecruit=yes
        controller=human
        recruit=Horseman,Bowman,Spearman,Footpad
        [unit]
            id=Bjarn
            name= _ "Bjarn"
            unrenamable=yes
            type=Red Mage
            profile="portraits/humans/mage-red.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 Alwn   (_ "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 Fargus (_ "Fargus")} {SOUTHWEST}

        #Arne's mercenary band
        {NAMED_LOYAL_UNIT 1 Horseman 33 21 Erik   (_ "Erik")}   {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Horseman 32 21 Heine  (_ "Heine")}  {SOUTHWEST}
        {NAMED_LOYAL_UNIT 1 Horseman 33 20 Magnus (_ "Magnus")} {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"
    [/side]

    {STARTING_VILLAGES 2 5}

    [event]
        name=start

        [message]
            speaker=Arne
            message= _ "Greetings, my brother! How may my men and I be of aid?"
        [/message]
        [message]
            speaker=Bjarn
            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=Bjarn
            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=Arne
            message= _ "I will lead my men, and such villagers as can keep up with us, north to slay this Mordak! What will you do?"
        [/message]
        [message]
            speaker=Bjarn
            message= _ "You shall be the right hand, I the left. 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. Together we may accomplish what either alone may not."
        [/message]
        [kill]
            id=Bjarn
        [/kill]
    [/event]

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

    [event]
        name=turn 10
        [message]
            speaker=Arne
            message= _ "Bjarn has not made his attack! I begin to fear for him... and it means we must deal with this Mordak ourselves!"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Mordak
        [/filter]
        [message]
            speaker=unit
            message= _ "Argh!"
        [/message]
        [message]
            speaker=Arne
            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=Arne
            message= _ "There's nothing more to be had from this one; we will have to search for Bjarn ourselves!"
        [/message]
        [role]
            type=Spearman,Bowman,Horseman
            role=Reporter
        [/role]
        [message]
            role=Reporter
            message= _ "Sir, our scouts report that Bjarn was seen captured and carried away further north!"
        [/message]
        [message]
            speaker=Arne
            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=Arne
            message= _ "My brother, kidnapped? I have failed you, Bjarn! 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=Arne
            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=Arne
        [/filter]
        [message]
            speaker=Arne
            message= _ "All is lost now that I am dead..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
[/scenario]
