#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}

    {SCENARIO_MUSIC       battle.ogg}{LET_INTRO_MUSIC_FINISH}
    {EXTRA_SCENARIO_MUSIC casualties_of_war.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}
    {EXTRA_SCENARIO_MUSIC suspense.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 epilogue 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 Epilogue. 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]
            music=revelation.ogg
            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]

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        recruit=Horseman,Bowman,Spearman,Footpad
#ifdef EASY
        gold=40
#else
        gold=25
#endif
        team_name=good
        user_team_name= _ "Humans"
        {FLAG_VARIANT loyalist}

        # wmllint: recognize Arvith
        {CHARACTER_STATS_ARVITH}

        facing=nw
    [/side]
    # wmllint: validate-on

    [side]
        side=2
        controller=ai
#ifdef EASY
        recruit=Walking Corpse,Vampire Bat,Dark Adept,Ghoul
        gold=120
#else
        recruit=Skeleton,Walking Corpse,Vampire Bat,Ghost,Dark Adept,Ghoul
        gold=200
#endif
        team_name=evil
        user_team_name= _ "Enemies"
        {FLAG_VARIANT undead}

        type=Dark Sorcerer
        id=Mordak
        name= _ "Mordak"
        canrecruit=yes

        facing=se

        [ai]
            grouping=no
            passive_leader=yes
        [/ai]
    [/side]

    {STARTING_VILLAGES 1 12}
    {STARTING_VILLAGES 2 5}

    [event]
        name=prestart

        [kill]
            id=Alwyn,Brent,Cadell,Dannen,Efran,Faren,Tarek,Hann,Magrid
        [/kill]

        {NEED_BARAN (
            x,y=31,21
            facing=se
        )}

        # The armed villagers, beware them
        {NAMED_LOYAL_UNIT 1 Spearman 30 22 Alwyn  (_ "Alwyn")}  {FACING nw}
        {NAMED_LOYAL_UNIT 1 Spearman 30 21 Brent  (_ "Brent")}  {FACING nw}
        {NAMED_LOYAL_UNIT 1 Spearman 31 22 Cadell (_ "Cadell")} {FACING nw}
        {NAMED_LOYAL_UNIT 1 Spearman 32 19 Dannen (_ "Dannen")} {FACING nw}
        {NAMED_LOYAL_UNIT 1 Bowman   33 19 Efran  (_ "Efran")}  {FACING nw}
        {NAMED_LOYAL_UNIT 1 Footpad  32 18 Faren  (_ "Faren")}  {FACING nw}

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

        [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]
#ifdef EASY
            {HINT ( _ "Use footpads as fodder to protect your loyal units and attack during the day to minimize the damage your forces take.") ()}
#endif
        [/objectives]
    [/event]

    [event]
        name=start

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

        {STORE_BARAN}
    [/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

        {NEED_MERCENARY}

        [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="Royal Guard,Halberdier,Master Bowman,Paladin,Grand Knight,Fugitive," +
                "Swordsman,Pikeman,Javelineer,Longbowman,Knight,Lancer,Outlaw," +
                "Spearman,Bowman,Horseman,Footpad"
            role=Reporter
            [not]
                id=Arvith
            [/not]
            [else]
                [unit]
                    role=Reporter
                    type=Spearman
                    placement=leader
                [/unit]
            [/else]
        [/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]

    [event]
        name=victory

        {RESTORE_BARAN}
    [/event]

    [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,Blood Bat,Dread Bat,Necromancer,Soulless,Walking Corpse
            [/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,Blood Bat,Dread Bat,Necromancer
            [/not]
        [/filter]

        [message]
            speaker=second_unit
            message= _ "That was not so hard!"
        [/message]
    [/event]

    {ARVITH_LAST_BREATH}
[/scenario]
