#textdomain wesnoth-dm
[scenario]
    id=13_The_Return_of_Trouble
    name= _ "The Return of Trouble"
    {MEMOIRS_MAP 13_The_Return_of_Trouble.map}
    next_scenario=14_Shadows_in_the_Dark
    {TURNS 28 26 24}
    {DEFAULT_SCHEDULE}
    disallow_recall=yes

    {INTRO_AND_SCENARIO_MUSIC northerners.ogg elvish-theme.ogg}
    {EXTRA_SCENARIO_MUSIC wanderer.ogg}
    {EXTRA_SCENARIO_MUSIC elf-land.ogg}
    {EXTRA_SCENARIO_MUSIC nunc_dimittis.ogg}

    [story]
        [part]
            story=_"While Delfador was still at the Academy, major events were taking place throughout Wesnoth. After centuries of squabbling, a warlord emerged to unite the orcs. This was ill tidings for humans and elves alike."
        [/part]
        [part]
            #po: "errantry" is an archaic English word associated with medieval
            #po: knights. It means he wandered around looking for monsters to
            #po: slay and wrongs to right.
            story=_"There was an elf named Kalenz who had already, in Delfador’s time, been a legend among his people for centuries; his tale, <i>The Legend of Wesmere</i>, is known throughout the elven lands. Prolonged in life by a necromantic potion, he put aside the High Lordship of the Elves after the death of his beloved wife, and wandered the Great Continent in errantry."
        [/part]
        [part]
            story=_"But Kalenz half-knew and half-feared he would be needed again, and the day he had long foreseen finally arrived. Reports came to him of large orcish forces attacking the outskirts of elvish forests, including Lintanir itself. Kalenz quickly gathered a small troop of handpicked guards. War had returned to the land of the elves."
        [/part]
    [/story]
    {DM_TRACK {KALENZ_STAGE1}}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        # recruit handled in {KALENZ_TAKES_CONTROL}
        {GOLD 300 275 250}
        {INCOME 2 1 0}
        save_id=Player
        team_name=allies
        user_team_name= _ "Elves"
        side_name= _ "Kalenz"
        {FLAG_VARIANT wood-elvish}
        # wmllint: who KALENZ is Kalenz
        [leader]
            {KALENZ}
            facing=sw
        [/leader]
    [/side]

    {STARTING_VILLAGES 1 {ON_DIFFICULTY 5 4 3}}

    ### Protagonist switching ###
    [event]
        name=prestart
        {KALENZ_TAKES_CONTROL}
    [/event]

    [side]
        side=2
        controller=ai
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Goblin Spearman
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Orcish Slayer, Goblin Pillager, Goblin Spearman
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Goblin Spearman
#endif
        {GOLD 120 160 200}
        {INCOME 2 4 6}
        team_name=enemies
        user_team_name= _ "Pillagers"
        {FLAG_VARIANT6 ragged}
        [leader]
            id=Knafa-ord
            name=_ "Knafa-ord"
            type=Orcish Warlord
            facing=ne
        [/leader]
        [ai]
            {NO_SCOUTS}
            recruitment_pattern=scout,fighter,fighter,archer,mixed fighter
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression={ON_DIFFICULTY 0.71 0.73 0.75}
            caution={ON_DIFFICULTY 0.2 0.1 0.0}
            grouping=no
        [/ai]
    [/side]

    [side]
        side=3
        controller=ai
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Goblin Spearman
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Orcish Slayer, Goblin Pillager, Goblin Spearman
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Goblin Spearman
#endif
        {GOLD 160 200 240}
        {INCOME 3 6 9}
        team_name=enemies
        user_team_name= _ "Pillagers"
        {FLAG_VARIANT6 ragged}
        [leader]
            id=Tan-drul
            name=_ "Tan-drul"
            type=Orcish Warlord
            facing=se
        [/leader]
        [ai]
            {NO_SCOUTS}
            recruitment_pattern=scout,fighter,fighter,archer,mixed fighter
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression={ON_DIFFICULTY 0.71 0.73 0.75}
            caution={ON_DIFFICULTY 0.2 0.1 0.0}
            grouping=no
        [/ai]
    [/side]

    [side]
        side=4
        controller=ai
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Goblin Spearman
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Orcish Slayer, Goblin Pillager, Goblin Spearman
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Goblin Spearman
#endif
        {GOLD 160 200 240}
        {INCOME 3 6 9}
        team_name=enemies
        user_team_name= _ "Pillagers"
        {FLAG_VARIANT6 ragged}
        [leader]
            id=Krardul
            name=_ "Krardul"
            type=Orcish Warlord
            facing=sw
        [/leader]
        [ai]
            {NO_SCOUTS}
            recruitment_pattern=scout,fighter,fighter,archer,mixed fighter
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression={ON_DIFFICULTY 0.71 0.73 0.75}
            caution={ON_DIFFICULTY 0.2 0.1 0.0}
            grouping=no
        [/ai]
    [/side]

    [side]
        side=5
        controller=ai
        recruit={ELVES}
        {GOLD 270 250 290}
        team_name=allies
        user_team_name= _ "Elves"
        {FLAG_VARIANT wood-elvish}
        [leader]
            id=Clartakis
            name=_ "Clartakis"
            type=Elvish Captain
            facing=nw
        [/leader]
    [/side]
    # wmllint: validate-on

    {STARTING_VILLAGES 5 {ON_DIFFICULTY 8 7 6}}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Defeat all enemy leaders"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

    [event]
        name=start
        [message]
            speaker=Tan-drul
            message= _ "Kill these filthy elves! Show all warlords the might of Zorlan! When they accept him as sovereign we will all be rewarded!"
        [/message]
        [message]
            speaker=Kalenz
            message= _ "This is what we have been training for! Now we drive these beasts back!"
        [/message]
    [/event]

    [event]
        name=victory
        [switch]
            variable=chantal_store.type
            [case]
                value="Elvish Shyde"
                [message]
                    speaker=Kalenz
                    message= _ "The orcs are retreating! And... what is this? A shyde flying towards us as if hell were on her heels..."
                [/message]
            [/case]
            [else]
                [message]
                    speaker=Kalenz
                    message= _ "The orcs are retreating! And... what is this? A druid running to meet us as though hell were on her heels..."
                [/message]
            [/else]
        [/switch]

        # wmllint: recognize Chantal
        {CHANTAL_RETURNS 1 14}
        {MAKE_HERO Chantal}
        [store_unit]
            variable=kalenz
            [filter]
                id=Kalenz
            [/filter]
        [/store_unit]
        {MOVE_UNIT (id=Chantal) "$kalenz.x" "$kalenz.y"}
        {CLEAR_VARIABLE kalenz}

        {INCIDENTAL_MUSIC love_theme.ogg}
        [message]
            speaker=Chantal
            message= _ "My lord Kalenz, at last I have found you!"
        [/message]
        [message]
            speaker=Kalenz
            message= _ "Chantal! Granddaughter! What are you doing here? You were not attacked, I hope."
        [/message]
        [message]
            speaker=Chantal
            message= _ "We were, but the enemy was vanquished. There are much more serious matters that require your attention."
        [/message]
        [message]
            speaker=Chantal
            message= _ "A paramount chief of all the orcs has arisen, and he is setting a trap for the humans at the Ford of Abez. I think we must aid the humans, lest we be defeated separately once they are crushed."
        [/message]
        [message]
            speaker=Chantal
            message= _ "There is more ill news. Evil has been unleashed. A portal has been opened from the Land of the Dead. An army of undead is being raised as we speak."
        [/message]
        [message]
            speaker=Kalenz
            message= _ "This is very serious. Have you informed the elvish settlements?"
        [/message]
        [message]
            speaker=Chantal
            message= _ "Yes. And I have prepared holy water for our warriors. They should be able to hold against the undead in our forests, at least for now."
        [/message]
        [message]
            speaker=Kalenz
            message= _ "Holy water? What is this? Have you been dabbling where you should not, in the Book of Crelanu?"
        [/message]
        [message]
            speaker=Chantal
            message= _ "No. The preparation of holy water was a secret that Lady Cleodil passed on to her daughters and granddaughters. She thought it wise to share the least dangerous secrets of the Book."
        [/message]
        [message]
            speaker=Chantal
            message= _ "Returning to present matters, I believe I have found the one we have been awaiting ever since Lady Cleodil accepted guardianship of the Book. You know of what I speak."
        [/message]
        [message]
            speaker=Kalenz
            message= _ "I never thought to see such a human, not even in all the years I have lived. Who is this person?"
        [/message]
        [message]
            speaker=Chantal
            message= _ "Delfador, a mage trusted of their king. He has survived a passage through the Land of the Dead not merely alive but uncorrupted. He helped us defeat the orcs when they threatened Lintanir, and I fought undead with him at Parthyn Ford. I have come north partly because I am thinking to fetch the Book of Crelanu so I can take it to him."
        [/message]
        [message]
            speaker=Kalenz
            message= _ "He is uncorrupted? You are sure of this?"
        [/message]
        [message]
            speaker=Chantal
            message= _ "I have bent my healing senses upon him. I am as sure as I can be."
        [/message]
        {INCIDENTAL_MUSIC loyalists.ogg}
        [message]
            speaker=Kalenz
            message= _ "Then we must aid him, and I must meet him. The King of Wesnoth is just a king; it is inner strength such as you describe that will turn back the darkness, if anything can. West, to the Ford of Abez!"
        [/message]
    [/event]

    {MEMOIRS_DEATHS}
[/scenario]
