#textdomain wesnoth-After_the_Storm

[scenario]
    id=05_Pass_of_Sorrows
    name= _ "Pass of Sorrows"
    {MAP 05_Pass_of_Sorrows.map}
    {TURNS 48 46 44}
    next_scenario=06_Divergence
    victory_when_enemies_defeated=no

    {F_DEATHS}

    {SCENARIO_MUSIC "snowfall.ogg"} {CONTINUE_PLAYING_STORY_MUSIC_FIRST}

    {STORYTXT_PASS_OF_SORROWS}

    {AFTERNOON2}
    {AFTERNOON2}
    {AFTERNOON2}
    {DUSK2}
    {DUSK2}
    {DUSK2}
    {LONGDARK1}
    {LONGDARK1}
    {LONGDARK1}
    {LONGDARK2}
    {LONGDARK2}
    {LONGDARK2}
    {LONGDARK3}
    {LONGDARK3}
    {LONGDARK3}
    {LONGDARK4}
    {LONGDARK4}
    {LONGDARK4}
    {DAWN1}
    {DAWN1}
    {DAWN1}
    {MORNING1}
    {MORNING1}
    {MORNING1}
    {MIDDAY1}
    {MIDDAY1}
    {MIDDAY1}
    {AFTERNOON1}
    {AFTERNOON1}
    {AFTERNOON1}
    {DUSK1}
    {DUSK1}
    {DUSK1}
    {SHORTDARK}
    {SHORTDARK}
    {SHORTDARK}
    {DAWN2}
    {DAWN2}
    {DAWN2}
    {MORNING2}
    {MORNING2}
    {MORNING2}
    {MIDDAY2}
    {MIDDAY2}
    {MIDDAY2}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        save_id=player
        team_name=good
        user_team_name= _ "team_name^Elynia"

        {GOLD 170 160 150}

        shroud=yes

        # wmllint: recognize Elynia
        {CHARACTER_STATS_ELYNIA}
    [/side]
    # wmllint: validate-on

    [side]
        side=2
        team_name=evil
        user_team_name= _ "team_name^Enemies"
        {RAGGED_FLAG}

        {GOLD 190 210 225}
        {INCOME 1 2 3}
#ifndef EASY
        recruit=Skeleton,Ghost,Skeleton Archer,Bone Shooter
#else
        recruit=Skeleton,Ghost,Skeleton Archer
#endif

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,fighter,archer,archer,scout,fighter"}
        [/ai]

        [village]
            x,y=9,38
        [/village]

        [village]
            x,y=15,34
        [/village]

        canrecruit=yes
        type=Ancient Lich
        id=Vissalen
        name= _ "Vissalen"
        [modifications]
            {TRAIT_UNDEAD}
            {TRAIT_RESILIENT}
            {BOSS_BOOST 10% 0 0 0 0}
        [/modifications]

        {GENERIC_UNIT () (Death Knight) 11 29} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING se}
        {GENERIC_UNIT () (Death Knight)  5 31} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING sw}

        {GENERIC_UNIT () (Wraith) 17 35} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING ne}
        {GENERIC_UNIT () (Wraith)  9 31} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING ne}
#ifndef EASY
        {GENERIC_UNIT () (Wraith) 11 26} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING ne}
#endif
    [/side]

    {LIMIT_RECRUITS 2 (Bone Shooter) 2}

    [side]
        side=3
        team_name=evil
        user_team_name= _ "team_name^Enemies"
        {RAGGED_FLAG}

        {GOLD 150 160 170}
        {INCOME 1 2 3}
        recruit=Ghoul,Walking Corpse,Vampire Bat,Skeleton Archer

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,fighter,archer,scout,scout"}
        [/ai]

        canrecruit=yes
        type=Ancient Lich
        id=Algessel
        name= _ "Algessel"
        [modifications]
            {TRAIT_UNDEAD}
            {TRAIT_INTELLIGENT}
            {BOSS_BOOST 10% 0 0 0 0}
            [object]
                {EFFECTS_STAFF_OF_AKHYLS_COMMON}
            [/object]
        [/modifications]

        {GENERIC_UNIT () (Bone Shooter) 23 31} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING ne}
        {GENERIC_UNIT () (Deathblade) 27 33} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING se}
        {GENERIC_UNIT () (Bone Shooter) 29 34} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING nw}

        {GENERIC_UNIT () (Blood Bat) 29 32} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}
        {GENERIC_UNIT () (Blood Bat) 30 38} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}
        {GENERIC_UNIT () (Blood Bat) 21 34} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}
    [/side]

    [side]
        side=4
        team_name=evil
        user_team_name= _ "team_name^Enemies"
        {RAGGED_FLAG}

        {NO_ECONOMY}
        no_leader=yes
        hidden=yes

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT aggression 1.00}
            {AI_SIMPLE_ALWAYS_ASPECT caution    0.00}
        [/ai]

        {GENERIC_UNIT () (Giant Rat) 32 9} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING nw}
        {GENERIC_UNIT () (Giant Rat) 28 5} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING se}

        {GENERIC_UNIT () (Direwolf) 21 12} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING sw}
        {GENERIC_UNIT () (Direwolf) 23  4} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING sw}
        {GENERIC_UNIT () (Direwolf) 23 26} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING ne}
        {GENERIC_UNIT () (Direwolf) 34 24} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING nw}
        {GENERIC_UNIT () (Direwolf) 26 20} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING nw}

        {GENERIC_UNIT () (Great Wolf) 21 23} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING se}

        {GENERIC_UNIT () (Dread Bat) 35  9} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING sw}
        {GENERIC_UNIT () (Dread Bat) 30 10} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING ne}
        {GENERIC_UNIT () (Dread Bat) 22 39} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING ne}

        {GENERIC_UNIT () (Leech) 32  8} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}
        {GENERIC_UNIT () (Leech) 30  8} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}

#ifndef EASY
        {GENERIC_UNIT () (Leech) 29 18} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}
        {GENERIC_UNIT () (Leech) 32 22} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}
#endif

        {GENERIC_UNIT () (Shaxthal Thunderbird) 26 24} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING n}
        {GENERIC_UNIT () (Shaxthal Thunderbird) 22 18} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING se}
        {GENERIC_UNIT () (Shaxthal Thunderbird) 35 20} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING sw}

        {GENERIC_UNIT () (Fungoid) 26 39} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}
        {GENERIC_UNIT () (Fungoid) 29 40} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY}

        {GENERIC_UNIT () (Lesser Giant Spider) 13 38} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING nw}
#ifndef EASY
        {GENERIC_UNIT () (Giant Spider) 13 40} {GUARDIAN} {NO_UPKEEP_NO_OVERLAY} {FACING nw}
#endif
    [/side]

    [side]
        side=5
        team_name=good
        user_team_name= _ "team_name^Unknown"
        {CHAOS_FLAG}

        {NO_ECONOMY}
        no_leader=yes
        hidden=yes
    [/side]

    {STARTING_VILLAGES 1 6}
    {STARTING_VILLAGES 2 6}
    {STARTING_VILLAGES 3 6}

    {PLACE_IMAGE scenery/castle-ruins3.png 30 17}
    {PLACE_IMAGE scenery/castle-ruins.png  23 18}
    {PLACE_IMAGE scenery/castle-ruins3.png 22 18}
    {PLACE_IMAGE scenery/castle-ruins.png  26 20}
    {PLACE_IMAGE scenery/castle-ruins2.png 21 24}

    [event]
        name=prestart

        {REPLACE_SCENARIO_MUSIC "knolls.ogg"}

        [time_area]
            terrain=X*,X*^*,U*,U*^*,Cud,Kud,Qxu
            [or]
                terrain=R*,R*^*
                x=3-15 ,21-34,14-16
                y=25-32,27-34,41-43
            [/or]
            [or]
                x=0-7  ,27-34
                y=26-34, 4-10
            [/or]
            {UNDERGROUND}
        [/time_area]

        # wmllint: recognize Anya
        {RECALL_ANYA_AT_LOCATION 7 10}
        # wmllint: recognize Irylean
        {RECALL_IRYLEAN_AT_LOCATION 7 9}
        # wmllint: recognize Igor
        {RECALL_IGOR_AT_LOCATION 5 9}

        {FACE_DIRECTION (id=Elynia,Anya) se}
        {FACE_DIRECTION (id=Irylean) sw}

        {OBJECTIVES (
            victory_string= _ "Current Objectives:"
            {OBJECTIVE_VICTORY ( _ "Explore around")}

            {OBJECTIVE_DEFEAT  ( _ "Death of Elynia")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Anya")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Irylean")}

            {TURNS_RUN_OUT}

            {OBJECTIVE_CARRYOVER}
        )}
    [/event]

    [event]
        name=start
        [message]
            speaker=Irylean
            message= _ "There’s absolutely <i>nothing</i> hinting at this place having served as a Chaos base of any sort in recent times. It’s completely deserted and ruined. I fear we have been misled. We might not even be in Kalari for all I know."
        [/message]

        [message]
            speaker=Elynia
            message= _ "No. I recognize that mountain range to the south. We... we never saw what lay north of it. We are a little farther from Kalari than I expected, but it’s not like any of us—or our allies—knew exactly where the Pass of Sorrows is. Let us proceed south, carefully."
        [/message]

        [if]
            [have_unit]
                id=Igor
            [/have_unit]
            [then]
                # While at first this may seem like me trying to get rid of the comedic relief,
                # the real purpose of stashing Igor away is ensuring the player doesn't have any
                # tanky high-mobility units besides ghosts for this scenario.

                [message]
                    speaker=Elynia
                    message= _ "Igor, do you think you could help watch our backline for any potential attacks from the north?"
                [/message]

                [message]
                    speaker=Igor
                    message= _ "Awww, but I wanted to help..."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I have seen that you prefer a more frontal approach to battle these days, but right now my main concern is that we don’t get ambushed. You will still be able to help by alerting us of any possible threats."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "If you think that’s the best way I can help then I’ll do it, my lady. Let’s go, Willow!"
                [/message]

                [store_unit]
                    [filter]
                        id=Igor
                    [/filter]
                    variable=igor_store
                    kill=yes
                [/store_unit]
            [/then]
        [/if]
    [/event]

    [event]
        name=turn 5
        [message]
            speaker=Elynia
            message= _ "The solitude of this place is unsettling."
        [/message]
    [/event]

    [event]
        name=turn 4
        [modify_side]
            side=1
            fog=yes
        [/modify_side]

        [redraw]
            side=1
        [/redraw]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Anya
            message= _ "Ugh. The fog is getting thicker..."
        [/message]
    [/event]

#define SO_TELEPORT_IF_NOT_IN_REGION _ID _REGION _TARGET_X _TARGET_Y
    [if]
        [have_unit]
            id={_ID}
            [filter_location]
                [not]
                    {_REGION}
                [/not]
            [/filter_location]
        [/have_unit]
        [then]
            [teleport]
                [filter]
                    id={_ID}
                [/filter]
                x={_TARGET_X}
                y={_TARGET_Y}
                animate=yes
            [/teleport]
        [/then]
    [/if]
#enddef

    [event]
        name=moveto
        [filter]
            side=1
            x=26-38
            y=11-23
        [/filter]

        [fade_out_music][/fade_out_music]

        {REPLACE_SCENARIO_MUSIC ("gameplay06.ogg")}
        {APPEND_MUSIC           ("suspense.ogg")}
        {APPEND_MUSIC           ("nunc_dimittis.ogg")}

        [remove_shroud]
            side=1
            x=27
            y=20
            radius=12
            [filter_radius]
                [not]
                    terrain=X*,*^X*
                [/not]
            [/filter_radius]
        [/remove_shroud]

        {CLEAR_FOG 1 27 20 12}

        {SO_TELEPORT_IF_NOT_IN_REGION (Anya) (
            x=26-38,19-25
            y=11-26,14-26
        ) 30 15}

        [message]
            speaker=Anya
            message= _ "Elynia, Irylean... you should see this."
        [/message]

        {SO_TELEPORT_IF_NOT_IN_REGION (Elynia) (
            x=26-38,19-25
            y=11-26,14-26
        ) 31 16 }

        {SO_TELEPORT_IF_NOT_IN_REGION (Irylean) (
            x=26-38,19-25
            y=11-26,14-26
        ) 31 15 }

        [scroll_to]
            x,y=27,20
        [/scroll_to]

        [delay]
            time=1000
        [/delay]

        [message]
            speaker=Elynia
            message= _ "These ruins appear to be centuries old — probably older than the Chaos Empire itself. I imagine they have remained untouched by our enemies because of their inconvenient location. What may have become of their former denizens?"
        [/message]

        [message]
            speaker=Irylean
            message= _ "There’s a large monolith over there."
        [/message]

        [remove_item]
            x,y=33,27
        [/remove_item]

        {HIGHLIGHT_IMAGE 33 27 scenery/monolith2.png ()}

        {UNCLEAR_FOG}

        [scroll_to]
            x,y=$x1,$y1
        [/scroll_to]
    [/event]

    {PLACE_IMAGE scenery/monolith2.png 33 27}

    [event]
        id=monolith_description_eh
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=33,27
            [not]
                id=Elynia
            [/not]
        [/filter]

        [allow_undo][/allow_undo]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "Elynia should be the one to investigate this monolith."
        [/message]
    [/event]

    {FIRE_ESSENCE_E3S5_A 26 18}
    {FIRE_ESSENCE_E3S5_A 30 24}
    {FIRE_ESSENCE_E3S5_A 24 31}
    {FIRE_ESSENCE_E3S5_B 28 38}
    {FIRE_ESSENCE_E3S5_A 30 40}
    {FIRE_ESSENCE_E3S5_A  8 24}
    {FIRE_ESSENCE_E3S5_A 15 33}
    {FIRE_ESSENCE_E3S5_A 14 36}

    [event]
        name=moveto
        first_time_only=yes # important
        [filter]
            id=Elynia
            x,y=33,27
        [/filter]

        {LOCK_VIEW}

        [message]
            speaker=Elynia
            message= _ "I don’t understand this inscription — some glyphs vaguely resemble the ancient ceremonial Elvish script, but I don’t recognize the rest."
        [/message]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            sound=wail-long.wav
            message= _ "The wind blows."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Wait..."
        [/message]

        [delay]
            time=750
        [/delay]

        [scroll_to]
            x,y=27,20
        [/scroll_to]

        {VARIABLE ghost_id 0}

#define SO_GHOST _X _Y
    [store_direction]
        from_x={_X}
        from_y={_Y}
        [to]
            [filter]
                id=Elynia
            [/filter]
        [/to]
    [/store_direction]

    [terrain]
        x={_X}
        y={_Y}
        terrain=Gg
    [/terrain]

    [redraw][/redraw]

    [sound]
        name=wail.wav
    [/sound]

    [unit]
        animate=yes
        side=2
        x={_X}
        y={_Y}
        id="ruins ghost $ghost_id"
        type={DIFF Shadow Nightgaunt Nightgaunt}
        facing=$direction
        upkeep=free
        [modifications]
            {TRAIT_UNDEAD}
        [/modifications]
        [status]
            uncovered=yes
        [/status]
    [/unit]

    {CLEAR_VARIABLE direction}

    {VARIABLE_INC ghost_id}
#enddef

        {SO_GHOST 27 18}
        {SO_GHOST 23 20}
        {SO_GHOST 25 23}
        {SO_GHOST 33 22}
        {SO_GHOST 30 19}

#undef SO_GHOST

        {CLEAR_VARIABLE ghost_id}

        [message]
            # wmllint: recognize ruins ghost 4
            speaker=ruins ghost 4
            message= _ "... Mal-Zagarn..."
        [/message]

        [message]
            # wmllint: recognize ruins ghost 3
            speaker=ruins ghost 3
            message= _ "... come..."
        [/message]

        [message]
            # wmllint: recognize ruins ghost 2
            speaker=ruins ghost 2
            message= _ "... she..."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Anya
            message= _ "Wh— What’s going on?"
        [/message]

        [message]
            speaker=Irylean
            message= _ "This pass is inhabited by restless spirits of the past! My lady!"
        [/message]

        {APPEND_MUSIC ("northerners.ogg")}

        {UNLOCK_VIEW}

        {OBJECTIVES (
            victory_string= _ "Current Objectives:"
            {OBJECTIVE_VICTORY ( _ "Defeat all enemy leaders")}

            {OBJECTIVE_DEFEAT  ( _ "Death of Elynia")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Anya")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Irylean")}

            {TURNS_RUN_OUT}

            {OBJECTIVE_CARRYOVER}
        )}

        [remove_event]
            id=monolith_description_eh # wmllint: ignore
        [/remove_event]

        [event]
            name=attack end

            [fire_event]
                name=open passage
            [/fire_event]

            [scroll_to]
                x,y=$x1,$y1
            [/scroll_to]
        [/event]

        [event]
            name=new turn
            #
            # In case the previous event handler never runs.
            #
            [fire_event]
                name=open passage
            [/fire_event]
        [/event]
    [/event]

    [event]
        name=open passage

        {QUAKE cave-in.ogg}

        [terrain]
            x=31,34,23,26
            y=28,28,28,27
            terrain=Mm
        [/terrain]

        [terrain]
            x=32,33,24,25
            y=28,29,28,28
            terrain=Re^Es
        [/terrain]

        [redraw]
            side=1
        [/redraw]

        [scroll_to]
            x,y=28,28
        [/scroll_to]

        {HIGHLIGHT_GOAL (
            x=32,33,24,25
            y=28,29,28,28
        )}

        [message]
            speaker=Elynia
            message= _ "There seem to be more undead creatures crawling out of the caverns to the south. Perhaps if we can clear them out we’ll find a way out of this valley."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Algessel
        [/filter]

        [message]
            speaker=Algessel
            message= _ "Thank... you..."
        [/message]

        [kill]
            id=Algessel
            animate=yes
            fire_event=no
        [/kill]

        [fire_event]
            name=check event gate
            [primary_unit]
                x,y=$x2,$y2
            [/primary_unit]
        [/fire_event]

        {STAFF_OF_AKHLYS $x1 $y1}

        {HIGHLIGHT_GOAL x,y=$x1,$y1}

        [message]
            speaker=Irylean
            message= _ "The lich’s staff is glowing! What could it possibly mean?"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Vissalen
        [/filter]

        {LOCK_VIEW}

        {CLEAR_LABELS}

        [fade_out_music][/fade_out_music]

        {REPLACE_SCENARIO_MUSIC ("the_king_is_dead.ogg")}

        {QUAKE cave-in.ogg}

        [message]
            speaker=Vissalen
            message= _ "Free..."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Vissalen
            message= _ "... at last..."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Who are you?"
        [/message]

        [delay]
            time=750
        [/delay]

        [sound]
            name=lightning.ogg
        [/sound]

        [hide_unit][/hide_unit]

        {BLACK_SCREEN}

        [scroll_to]
            x,y=$x1,$y1
            {WARP}
        [/scroll_to]

        [delay]
            time=1000
        [/delay]

#define SO_NARRATION _MSG
    [message]
        speaker=narrator
        image=misc/blank-hex.png
        message="<i>"+{_MSG}+"</i>" # wmllint: ignore
    [/message]
#enddef

        {SO_NARRATION ( _ "Many centuries ago, our ancestors came from the Great Southern Desert seeking fertile lands to settle. They gave up much to get to this valley: their lives, their families... Most of them died along the way. The few survivors found a ruined temple amidst the mountains, probably built by an extinct civilization. From that temple they learned the ways of fire magic, and the song of Shardia, She who forged knowledge from the fire of our hearts.

They thrived with their newfound skills and the protection granted by the precipitous mountain range. They continued to learn from Her, and longed for the day when She would come to this earth and bless it with Her song. And in time, so did we.

Until...")}

        # wmllint: local spelling Mal-Zagarn

        {SO_NARRATION ( _ "One day, a man shrouded in darkness came. His eyes were bright like Naia’s never-ending shine; his mouth, concealed by twisted metal and decayed flesh. His companions called him Mal-Zagarn.

He spoke a message from the so-called Goddess of Life from beyond the Void, Uria, who had tasked him with the mission of spreading her voice to all non-believers in this land. But other than the Goddess who gave us our fire magic, we would worship no-one, especially not someone who only communicated through an embodiment of the unnatural like that dark prophet. And so we dismissed his words as the blasphemous ramblings of a barbarian.

In time, we would be proven wrong.")}

        {SO_NARRATION ( _ "Years later, the man returned, but not with a handful of trusted followers. Instead, he brought with him innumerable horrors from the Abyss to rain acid and smoke upon our homes. He gave our leader a last chance to convert to his unholy sect.

That is to say, <b>I</b> was offered that last chance.

Everyone was slaughtered. Everyone except me, my brother, and a child with beautiful hair, whom we believed was the heiress of Her fire; for never before we saw one of our own be born with the same hair color as our Goddess. But just like the scrolls and books we hoarded, we eventually lost her to the walking vultures of the desert, who took her as their own. They spared her life, seeing as she was but a child, but our own fate was vastly different.")}

        {SO_NARRATION ( _ "The Goddess of Life had cursed us to linger in this form, and dwell in the caves beneath the earth in shame. The light of the suns we once revered became a scorching enemy by day. Our fire magic was quickly displaced by shadow magic as we could no longer even withstand the heat of our flames. We had too become embodiments of corruption, a mockery of the beings we once were.

We vowed to take revenge upon the dark courier who brought disgrace upon our kind, and anyone who was ever close to him or his followers. Either we would be destroyed and released from our prison, or our curse would be extended to the creatures we abhorred.

But it is all over now.")}

        {SO_NARRATION ( _ "We may still be able to find Her on the other side of the Veil, and bask in the glory of Her song...")}

#undef SO_NARRATION

        [fade_out_music]
            duration=1000
        [/fade_out_music]

        [delay]
            time=1000
        [/delay]

        {FADE_IN}

        [kill]
            id=Vissalen
            animate=no # i.e. offscreen
            fire_event=no
        [/kill]

        [unhide_unit][/unhide_unit]

        [delay]
            time=750
        [/delay]

        {REPLACE_SCENARIO_MUSIC ("snowfall.ogg")}

        [message]
            speaker=Elynia
            message= _ "Argan..."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Anya
            message= _ "Elynia..."
        [/message]

        [message]
            speaker=Elynia
            message= _ "I— I am fine. Don’t worry about it."
        [/message]

        {UNLOCK_VIEW}

        [fire_event]
            name=check event gate
            [primary_unit]
                x,y=$x2,$y2
            [/primary_unit]
        [/fire_event]
    [/event]

    [event]
        name=check event gate
        [filter_condition]
            [not]
                [have_unit]
                    canrecruit=yes
                    side=2,3
                [/have_unit]
            [/not]
        [/filter_condition]

        [simplify_location_filter]
            terrain=*^Zz*
            variable=event_gate_locs
        [/simplify_location_filter]

        [remove_terrain_overlays]
            x=$event_gate_locs.x
            y=$event_gate_locs.y
        [/remove_terrain_overlays]

        [remove_shroud]
            side=1
            x=$event_gate_locs.x
            y=$event_gate_locs.y
        [/remove_shroud]

        [redraw]
            side=1
        [/redraw]

        [scroll_to]
            x,y=7,36
        [/scroll_to]

        {HIGHLIGHT_GOAL (
            x=$event_gate_locs.x
            y=$event_gate_locs.y
        )}

        [scroll_to]
            x,y=$x1,$y1
        [/scroll_to]

        [redraw][/redraw]

        {CLEAR_VARIABLE event_gate_locs}

        {OBJECTIVES (
            victory_string= _ "Current Objectives:"
            {OBJECTIVE_VICTORY ( _ "Proceed to the southern cavern exit with Elynia")}

            {OBJECTIVE_DEFEAT  ( _ "Death of Elynia")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Anya")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Irylean")}

            {TURNS_RUN_OUT}

            {OBJECTIVE_CARRYOVER}
        )}
    [/event]

    {PLACE_IMAGE items/gohere.png 14 41}

    [event]
        name=moveto
        first_time_only=no
        [filter]
            id=Elynia
            x,y=14,41
        [/filter]

        [allow_undo][/allow_undo]

        [message]
            speaker=Irylean
            message= _ "We don’t know what lies outside. Are you sure you want to proceed, my lady?"
        [/message]

        [message]
            speaker=Elynia
            message= _ "Allow me to ponder this for a moment..."
            [option]
                label= _ "Yes, I think it’s time to go."
                [command]
                    {ENDLEVEL_VICTORY yes} {NO_ENDLEVEL_MUSIC}
                [/command]
            [/option]
            [option]
                label= _ "No, let us see whether there might be something else of value in these caves first."
                [command]
                    [message]
                        speaker=Irylean
                        message= _ "Very well."
                    [/message]

                    [scroll_to]
                        x,y=$x1,$y1
                    [/scroll_to]
                [/command]
            [/option]
        [/message]
    [/event]

    [event]
        name=victory

        {LOCK_VIEW}

        [fade_out_music][/fade_out_music]

        {REPLACE_SCENARIO_MUSIC ("wanderer.ogg")}

        #
        # Heal the protagonists for this cutscene.
        #

        [heal_unit]
            [filter]
                id=Elynia,Anya,Irylean
            [/filter]
        [/heal_unit]

        [remove_terrain_overlays]
            x=13,14,15
            y=43,42,42
        [/remove_terrain_overlays]

        [remove_shroud]
            side=1
            x= 0-39
            y=41-65
            [not]
                terrain=X*,X*^*,*^X*
            [/not]
        [/remove_shroud]

        [modify_side]
            side=1
            fog=no
        [/modify_side]

        [redraw]
            side=1
        [/redraw]

        [store_starting_location]
            side=5
        [/store_starting_location]

        # wmllint: recognize Cron
        {RECALL_CRON_AT_LOCATION $location.x $location.y}
        [+unit]
            side=5
            facing=nw
            [+modifications]
                {TEAM_COLOR_OVERRIDE () red}
            [/modifications]
        [/unit]

        {CLEAR_VARIABLE location}

        {MOVE_UNIT (id=Elynia) 16,18 47,48}

        [teleport]
            [filter]
                id=Anya
            [/filter]
            x,y=19,49
            animate=yes
        [/teleport]

        {FACE_DIRECTION (id=Anya) se}

        [teleport]
            [filter]
                id=Irylean
            [/filter]
            x,y=20,48
            animate=yes
        [/teleport]

        {FACE_DIRECTION (id=Irylean) se}

        [scroll_to_unit]
            id=Cron
        [/scroll_to_unit]

        [delay]
            time=1000
        [/delay]

        [message]
            speaker=Irylean
            message= _ "A lone troll?"
        [/message]

        # wmllint: local spelling sigil

        [message]
            speaker=Anya
            message= _ "He bears an unusual sigil on his armor for a troll..."
        [/message]

        [delay]
            time=750
        [/delay]

        {MOVE_UNIT (id=Cron) 21 54}

        [message]
            speaker=Elynia
            message= _ "Hail there, whoever you are. Are you our enemy?"
        [/message]

        [delay]
            time=1000
        [/delay]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "The old battle-hardened troll stared at the sky for a minute before answering, while Anya and Irylean eyed each other nervously."
        [/message]

        [message]
            speaker=Cron
            message= _ "Cron works for no-one but the storm lady."
        [/message]

        [message]
            speaker=Anya
            message= _ "(<i>whispering</i>) Elynia, would that be..."
        [/message]

        [message]
            speaker=Elynia
            message= _ "(<i>whispering</i>) Yes, I think so."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Cron, if you allow me to ask, where is this person? We... may or may not have arranged a meeting with her, here. This is a quite urgent matter, and... Are you even listening to me?"
        [/message]

        [message]
            speaker=Cron
            message= _ "(<i>pointing at the sky</i>) There."
        [/message]

        [scroll_to]
            x,y=16,45
        [/scroll_to]

        [delay]
            time=750
        [/delay]

        {FACE_DIRECTION (id=Elynia,Anya,Irylean) nw}

        # wmllint: recognize Ergea
        {RECALL_ERGEA_AT_LOCATION 16 45}
        [+unit]
            side=5
            facing=se
            # Visual effects provided by Ergea's recruit animation.
            animate=yes
            [+modifications]
                {TEAM_COLOR_OVERRIDE () red}
            [/modifications]
        [/unit]

        [redraw][/redraw]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "The demoness descended from the sky in an impressive whirl of dust and leaves. Anya and Irylean stared in awe, and immediately knew they would be at a disadvantage if she were, in fact, their enemy. But Elynia did not have an opportunity to entertain such thoughts. She could tell at first glance that in spite of her young age, the Demon Lord of the Storms was not the type that would take admiration and other displays of weakness very well.

After all, she had risked it all and come only to enlist powerful allies for her dwindling cause."
        [/message]

        [message]
            speaker=Irylean
            message= _ "(<i>whispering</i>) All right... I <i>think</i> these two look rather frightening..."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Ergea, Demon Lord of the Storms, I suppose?"
        [/message]

        [message]
            speaker=Ergea
            message= _ "That is correct, Elynia, the Lady of Light. I have been eagerly awaiting this moment for weeks. What took you and your party so long? I heard you hired the services of the northerners to prepare an assault to the gateway fortress, instead of infiltrating it on your own. That wasteful spectacle could have ruined our plans."
        [/message]

        [message]
            speaker=Elynia
            message= _ "And your plans are intended to help us, or is this just part of a convoluted scheme to catch me off-guard near your headquarters?"
        [/message]

        [message]
            speaker=Ergea
            message= _ "My priority is putting a halt to Uria’s schemes, preferably while keeping collateral damage to a minimum. There just are not a lot of people these days who can truly be trusted. I had to ask the human seer to deliver my message to you because sensing people’s intentions is not one of your powers, and you have committed too many mistakes as of late in that vein, much like Elorran."
        [/message]

        [message]
            speaker=Anya
            message= _ "Elorran...?"
        [/message]

        [message]
            speaker=Ergea
            message= _ "I tried to warn him that Zhangor sent his new pets after him, but that fool never allowed my minions to approach him or his informants. I assume he never told you that—"
        [/message]

        {REPLACE_SCENARIO_MUSIC silence.ogg} # no fadeout

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Elynia
            message= _ "Repeat that name."
        [/message]

        {INCIDENTAL_MUSIC overlive.ogg}

        [message]
            speaker=Ergea
            message= _ "Zhangor?"
        [/message]

        [message]
            speaker=Elynia
            message= _ "How...?"
        [/message]

        [message]
            speaker=Ergea
            message= _ "He recently became the Fist of Uria. I thought Elorran and you of all people on Irdya would be aware of this."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Anya
            message= _ "Elynia? You don’t look good..."
        [/message]

        # wmllint: local spelling Wh

        [message]
            speaker=Elynia
            message= _ "Wh— why...? Why is he here? Why is he... on Irdya... again? I— I did everything within my power to... to..."
        [/message]

        [message]
            speaker=Ergea
            message= _ "Destroying a shapeshifter of his level is nigh impossible; and frankly, you never truly learned to employ the Power of the Union effectively. Argan and you played around with it like children instead of working towards harnessing its full potential. But I don’t blame you. There is a lot you need to learn right now, and I can help you with that. However, we are running out of time."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Will you help me?"
        [/message]

        [message]
            speaker=Ergea
            message= _ "I came to seek your help only because our goals converge on the ultimate purpose of ending this war. I can only help you if you are willing to help us — and first I need to speak to you in private."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Elynia
            message= _ "... Very well."
        [/message]

        # If we had Igor at the start, restore him into the recall list.

        [if]
            {VARIABLE_ARRAY_NOT_EMPTY igor_store}
            [then]
                [unstore_unit]
                    variable=igor_store
                    x,y=recall,recall
                [/unstore_unit]

                {CLEAR_VARIABLE igor_store}
            [/then]
        [/if]

        # The Cron and Ergea used here aren't transfered to the player,
        # letting E3S6 or later take care of that and allowing them to
        # have the correct TC without overriding it again.

        {UNLOCK_VIEW}
    [/event]

#undef SO_TELEPORT_IF_NOT_IN_REGION
[/scenario]

# kate: indent-mode normal; encoding utf-8; space-indent on;


#textdomain wesnoth-After_the_Storm

[scenario]
    id=06_Divergence
    name= _ "Divergence"
    {MAP 06_Divergence.map}
    turns=-1
    next_scenario=07A_Dark_Fire_part_1
    victory_when_enemies_defeated=no
    #disallow_recall=yes
    {DO_NOT_REMOVE_FROM_CARRYOVER_ON_DEFEAT}

    {SCENARIO_MUSIC       "climactic_contemplation.ogg"}
    {EXTRA_SCENARIO_MUSIC "heroes_rite.ogg"}
    {EXTRA_SCENARIO_MUSIC "nunc_dimittis.ogg"}

    {STORYTXT_DIVERGENCE}

    {LONGDARK1} {GLOBAL_LIGHTING_BAD_NIGHT}
    {LONGDARK2} {GLOBAL_LIGHTING_BAD_NIGHT}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        save_id=player
        team_name=good
        user_team_name= _ "team_name^Elynia"

        gold=0 # No minimum starting gold.
        village_gold=0
        {NO_INCOME}

        # Disable map snapshot on Load Game dialog.
        shroud=yes

        scroll_to_leader=no

        # wmllint: recognize Elynia
        {CHARACTER_STATS_ELYNIA}
    [/side]
    # wmllint: validate-on

    {STARTING_VILLAGES_ALL 1}

#define DI_SET_OBJECTIVE _OBJECTIVE
    {OBJECTIVES (
        victory_string= _ "Objective:" # wmllint: ignore
        {OBJECTIVE_VICTORY ({_OBJECTIVE})}
        {OBJECTIVE_FULL_CARRYOVER}
        {UNLIMITED_LEADER_MOVES_NOTE}
        {CONVERSATION_SCENARIO_NOTES}
    )}
#enddef

    {PLACE_IMAGE scenery/rock3.png 20 11}
    {PLACE_IMAGE scenery/trash.png 21 11}
    # Let’s pretend it’s a burrow.
    {PLACE_IMAGE scenery/nest-empty.png 1 20}

    [event]
        name=prestart

        [modify_side]
            side=1
            shroud=no
        [/modify_side]

        # wmllint: recognize Anya
        {RECALL_ANYA_AT_LOCATION 10 11}
        {FACE_DIRECTION id=Anya sw}
        # wmllint: recognize Irylean
        {RECALL_IRYLEAN_AT_LOCATION 20 9}
        {FACE_DIRECTION id=Irylean se}
        # wmllint: recognize Igor
        {RECALL_IGOR_AT_LOCATION 20 3}
        # wmllint: recognize Cron
        {RECALL_CRON_AT_LOCATION 16 6}
        {FACE_DIRECTION id=Cron ne}

        [if]
            [have_unit]
                id=Igor
            [/have_unit]
            [then]
                {FACE_DIRECTION id=Igor ne}
            [/then]
        [/if]

        # Don't let anyone other than Elynia move around.
        {MODIFY_UNIT (
            [not]
                id=Elynia
            [/not]
        ) moves 0}

        {SET_TALK_UNITS id=Anya,Elynia,Cron,Irylean,Igor}

        {DISALLOW_END_TURN}

        {DI_SET_OBJECTIVE ( _ "Talk to Anya before going to sleep")}

        {VARIABLE talked_to_anya no}
        {VARIABLE went_to_bed    no}
        {VARIABLE poison_staff   no}

        #
        # Make Irylean immune to poison.
        #
        [if]
            # I don't know why anyone would ever *not* give the staff to Iry
            # but you never know...
            [have_unit]
                id=Irylean
                [has_attack]
                    type=arcane
                    special=poison
                [/has_attack]
            [/have_unit]
            [then]
                [modify_unit]
                    [filter]
                        id=Irylean
                    [/filter]
                    [trait]
                        id=staff_of_akhlys_lvl1_tag
                        name= _ "staff of akhlys"
                        description= _ "Immune to poison"
                        help_text= _ "The wielder of this staff is immune to poison."
                        [effect]
                            apply_to=status
                            add=unpoisonable
                        [/effect]
                    [/trait]
                [/modify_unit]

                {VARIABLE poison_staff yes}
            [/then]
        [/if]
    [/event]

    #
    # Don't allow recruits or recalls.
    #

    {NO_RECRUITS_OR_RECALLS ()}

    {UNLIMITED_PLAYER_MOVES}

    [event]
        name=moveto #,select
        first_time_only=no
        [filter]
            [filter_adjacent]
                [filter_wml]
                    [variables]
                        can_talk=yes
                    [/variables]
                [/filter_wml]
            [/filter_adjacent]
        [/filter]

        [fire_event]
            name=conversation controller
            [primary_unit]
                x,y=$x1,$y1
            [/primary_unit]
            [secondary_unit]
                [filter_adjacent]
                    x,y=$x1,$y1
                    [filter_wml]
                        [variables]
                            can_talk=yes
                        [/variables]
                    [/filter_wml]
                [/filter_adjacent]
            [/secondary_unit]
        [/fire_event]
    [/event]

#define DI_COND_UNITS _FIRST_UNIT_ID _SECOND_UNIT_ID
    {VARIABLE_LEXICAL_EQUALS unit.id        {_FIRST_UNIT_ID}  }
    {VARIABLE_LEXICAL_EQUALS second_unit.id {_SECOND_UNIT_ID} }
#enddef

    [event]
        name=conversation controller
        first_time_only=no

        # Make both units face each other for the duration of
        # the event.

        {VARIABLE old_unit_facing $unit.facing}
        {VARIABLE old_second_unit_facing $second_unit.facing}

        [store_direction]
            from_x,from_y=$x1,$y1
            to_x,to_y=$x2,$y2
        [/store_direction]

        {VARIABLE unit.facing $direction}

        [store_direction]
            from_x,from_y=$x2,$y2
            to_x,to_y=$x1,$y1
        [/store_direction]

        {VARIABLE second_unit.facing $direction}

        [unstore_unit]
            variable=unit
            find_vacant=no
        [/unstore_unit]

        [unstore_unit]
            variable=second_unit
            find_vacant=no
        [/unstore_unit]

        [redraw][/redraw]

        # Fire the conversation event handler.
        # NOTE: it's assumed that unit and second_unit aren't
        # modified by the handler. Their auto-stored variables
        # should also be assumed unavailable by the handler.

        [if]
            {DI_COND_UNITS Elynia Anya}
            [then]
                [fire_event]
                    name=conversation elynia anya
                [/fire_event]
            [/then]
        [/if]
        [if]
            {DI_COND_UNITS Elynia Cron}
            [then]
                [fire_event]
                    name=conversation elynia cron
                [/fire_event]
            [/then]
        [/if]
        [if]
            {DI_COND_UNITS Elynia Irylean}
            [then]
                [fire_event]
                    name=conversation elynia irylean
                [/fire_event]
            [/then]
        [/if]
        [if]
            {DI_COND_UNITS Elynia Igor}
            [then]
                [fire_event]
                    name=conversation elynia igor
                [/fire_event]
            [/then]
        [/if]

        {VARIABLE unit.facing $old_unit_facing}

        {VARIABLE second_unit.facing $old_second_unit_facing}

        [unstore_unit]
            variable=unit
            find_vacant=no
        [/unstore_unit]

        [unstore_unit]
            variable=second_unit
            find_vacant=no
        [/unstore_unit]

        {CLEAR_VARIABLE old_unit_facing,old_second_unit_facing}
    [/event]

    [event]
        name=conversation elynia anya
        first_time_only=yes

        [message]
            speaker=Anya
            message= _ "Still awake? You haven’t slept well in months."
        [/message]

        [message]
            speaker=Elynia
            message= _ "I just can’t get to sleep knowing that we are in this land, Anya — it brings back bad memories."
        [/message]

        [message]
            speaker=Anya
            message= _ "I understand."
        [/message]
    [/event]

    [event]
        name=conversation elynia anya
        first_time_only=no

        [character_action_dialog]
            [option]
                message= _ "Discuss your plans with Anya."
            [/option]
            [option]
                message= _ "Speak to Anya about Ergea."
            [/option]
            [option]
                message= _ "Ask Anya a question."
            [/option]
        [/character_action_dialog]

        [switch]
            variable=choice
            [case]
                value=0
                [message]
                    speaker=Elynia
                    message= _ "I am still worried about tomorrow. Ergea said reinforcements were coming for us, but we have not gotten confirmation from Aran-Balgur and that damned portal closed on its own. And regardless, it would be foolish to rely on Bardyl and his people."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "We still have the undead, and surely Ergea wouldn’t lie to us?"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I suppose not, but her sources might not necessarily be the most reliable. For all we know, they could have already betrayed her. They might be leading us to a slaughter, and—"
                [/message]

                [message]
                    speaker=Anya
                    message= _ "(holding Elynia’s hand) I am sure... that with Ergea’s power and yours, we can do this. The bulk of their forces went north, the Triad is now missing that disgusting lich... and we will be joined by those reinforcements soon — I hope. And if we are meant to die here, then we’ll all die fighting for a just cause."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "... Well, yes..."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "But somehow, I feel that everything will go well!"
                [/message]
            [/case]
            [case]
                value=1
                [message]
                    speaker=Anya
                    # po: "Us" here being Anya and Irylean.
                    message= _ "Elynia, what was it like talking to Ergea? She seemed quite, uh, intimidating to us."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I got the impression that she’s simply been through too much in her life, and it’s surely not her fault. From what I gather, Urvatha, the world we usually call Inferno... is decidedly not the best place to live. Demon Lords competing for succession and killing each other all the time, oppressing and enslaving their subjects, and Uria coercing them into doing her bidding by abusing the ancient powers she was granted by destiny... "
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I can only say that Ergea is a much nicer person in reality if you know how to approach her."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "Hm. (smiling) I guess you would have enjoyed talking with Elorran, too."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I guess."
                [/message]
            [/case]
            [case]
                value=2
                [message]
                    speaker=Elynia
                    message= _ "So, why did you not tell us that you were a shapeshifter?"
                [/message]

                [delay]
                    time=500
                [/delay]

                [message]
                    speaker=Anya
                    message= _ "(surprised) I... What are you talking about?"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I did hear your quiet remark when we were fighting those creatures in Aran-Balgur. Having spent a considerable part of my life in the wild, did you expect any less? I imagine your sense of hearing is just as good despite your smaller ears."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "Well... I... I think I have never felt comfortable with my heritage. After all... it is the very reason of my abandonment as a child..."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "I can only wonder why I wasn’t raised by my real parents. Who were they? Could they still be out there, alive? But on second thought... perhaps I don’t want to know."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "If I had told you from the very beginning that I am a shapeshifter, you would have never trusted me. How can you trust a creature who could be concealing their true appearance and nature?"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Are you, though?"
                [/message]

                [message]
                    speaker=Anya
                    # po: 'We' being demonkind.
                    message= _ "No! But that doesn’t change the fact that you would have distrusted me back then! I mean... more than you did. You were always so distant and obsessed with your duty... almost like an emotionless machine, just like you have always assumed we were..."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "(sighs) I guess I still am. You could call it a coping mechanism, I suppose. I originally became a druid to help others, not to take people’s lives. All this bloodshed... it could have been avoided if I hadn’t made all the terrible choices that led me here — the same choices that led to the downfall of this world. Nobody in this era would remember, but I am in large part responsible for bringing the people who ultimately doomed us all to the throne of Wesnoth."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "When you are forced to live through the consequences of your mistakes, when it’s not in your nature to kill but you have no choice... you begin to put reality aside just to keep yourself in one piece. Instead of being the one doing the killing, you are watching someone else do it for you. Sometimes it may even seem like an enticing distraction from your own thoughts."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Other people recall good memories to comfort themselves in times like these, but each day that passes I struggle more and more to remember anything other than my worst moments: the utter destruction of an era of balance and life, the fall of my people, the horrors wrought by Zhangor... the blood of my husband, in my own hands and drawn with my own power... and my... friends... killed or destroyed in front of me... before I could do... do anything to prevent it..."
                [/message]

                [delay]
                    time=500
                [/delay]

                [message]
                    speaker=Elynia
                    message= _ "... I fear it, Anya... I fear what would happen if I allowed myself to be controlled by my emotions."
                [/message]

                [delay]
                    time=750
                [/delay]

                [message]
                    speaker=Anya
                    message= _ "Elynia... I’m sorry, I did not mean to make you feel like this."
                [/message]

                [delay]
                    time=750
                [/delay]

                [message]
                    speaker=Elynia
                    message= _ "... No, I am the one who should apologize. Perhaps if I shared my feelings with other people more often, I— I wouldn’t be like this..."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "I haven’t lived for a thousand years, but I know that it is true — you would feel at least a little better if you talked to someone about whatever troubles you instead of blindly killing creature after creature to distract yourself from the pain."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "Perhaps... you could do that? Talk with me more often?"
                [/message]

                [delay]
                    time=750
                [/delay]

                [message]
                    speaker=Elynia
                    message= _ "Yes, I could... If we survive this encounter, that is."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "But you must promise!"
                [/message]

                [delay]
                    time=750
                [/delay]

                [message]
                    speaker=Elynia
                    message= _ "... I... I promise."
                [/message]

                [message]
                    speaker=Anya
                    message= _ "(smiling)"
                [/message]
            [/case]
        [/switch]

        [allow_undo][/allow_undo]

        [if]
            {VARIABLE_NUMERICAL_NOT_EQUALS choice 3}
            {VARIABLE_BOOLEAN_EQUALS talked_to_anya no}
            [then]
                {VARIABLE talked_to_anya yes}

                {DI_SET_OBJECTIVE ( _ "Go back to sleep (move Elynia back to the encampment keep)")}
            [/then]
        [/if]

        {CLEAR_VARIABLE choice}
    [/event]

    [event]
        name=conversation elynia cron
        first_time_only=no
        [filter_condition]
            {VARIABLE_BOOLEAN_EQUALS went_to_bed no}
        [/filter_condition]

        [character_action_dialog]
            [option]
                message= _ "Ask Cron about Ergea."
            [/option]
            [option]
                message= _ "Ask Cron about tomorrow."
            [/option]
        [/character_action_dialog]

        [switch]
            variable=choice
            [case]
                value=0
                [message]
                    speaker=Elynia
                    message= _ "If I may ask, for how long have you been serving under Ergea’s banner and why?"
                [/message]

                [message]
                    speaker=Cron
                    message= _ "Cron works for the storm lady since his home in the mountains was taken by the flying metal-shells. He was promised things in return for protection."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Protection?"
                [/message]

                [message]
                    speaker=Cron
                    message= _ "The storm lady does not trust the masked men and their rusty swords. She prefers help from Cron and the lizard people of the swamps. She feels safer this way."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "What kind of things did she promise to you?"
                [/message]

                [message]
                    speaker=Cron
                    message= _ "The lady promised us a new home if we can help her kill the Iron Council and their leader, Zhangor."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Hm, is her intention to seize Kalari for her own people and allies then?"
                [/message]

                [message]
                    speaker=Cron
                    message= _ "Cron must not discuss the storm lady’s plans with anyone else."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "... Fair enough."
                [/message]
            [/case]
            [case]
                value=1
                [message]
                    speaker=Elynia
                    message= _ "There’s a lot of things awaiting us tomorrow, and we will need all the help we can get. Do you think your people will accede?"
                [/message]

                [message]
                    speaker=Cron
                    message= _ "Cron is very sure they will, but they are not many, and they cannot help as much as they want."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "A little help is better than nothing — Ergea said we would be getting reinforcements, but I don’t find that likely to happen."
                [/message]

                [message]
                    speaker=Cron
                    message= _ "The storm lady always says the truth."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Yes... that’s very true... Too true, perhaps."
                [/message]
            [/case]
        [/switch]

        {CLEAR_VARIABLE choice}
    [/event]

    [event]
        name=conversation elynia irylean
        first_time_only=no
        [filter_condition]
            {VARIABLE_BOOLEAN_EQUALS went_to_bed no}
        [/filter_condition]

        [set_variables]
            name=temp_wml
            mode=replace
            [value]
                [option]
                    message= _ "Talk to Irylean."
                [/option]
                [option]
                    message= _ "Ask Irylean about her retirement."
                [/option]
            [/value]
        [/set_variables]

        [if]
            {VARIABLE_BOOLEAN_EQUALS poison_staff yes}
            [then]
                [set_variables]
                    name=temp_wml.option
                    mode=append
                    [value]
                        message= _ "Ask Irylean about the Staff of Akhlys."
                    [/value]
                [/set_variables]
            [/then]
        [/if]

        [insert_tag]
            name=character_action_dialog
            variable=temp_wml
        [/insert_tag]

        {CLEAR_VARIABLE temp_wml}

        [switch]
            variable=choice
            [case]
                value=0
                [message]
                    speaker=Irylean
                    message= _ "You seem very weary, my lady. Shouldn’t you be getting some sleep?"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Yes... But you know the situation with that. So, do you think your disciples will be able to help? Can they be trusted?"
                [/message]

                [message]
                    speaker=Irylean
                    message= _ "They have proven to be quite reliable thus far, haven’t they? Unfortunately, I can’t know whether they intend to betray us at the end like your previous assistant did, my lady. If they were consorting with our enemy they’d make sure we wouldn’t find out until it was too late."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Indeed. That’s why I am worried. If only Galas were still with us... He always seemed to make the right choices."
                [/message]

                [message]
                    speaker=Irylean
                    message= _ "Hm... perhaps."
                [/message]
            [/case]
            [case]
                value=1
                [message]
                    speaker=Elynia
                    message= _ "If you don’t mind the question, why did you retire before?"
                [/message]

                # wmllint: local spelling Erathan

                [message]
                    speaker=Irylean
                    message= _ "I guess it was a combination of circumstances... I felt Galas’ decision to delegate the government of your people to those four was horribly ill-advised. Then you all decided to go south and... I knew that wouldn’t end well for me. From what I heard that fellow Erathan didn’t fare well in the capital."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "That’s unfortunately true. And I suppose I owe you an apology for forcing you to come here."
                [/message]

                [message]
                    speaker=Irylean
                    message= _ "Bah, nobody can force me to go anywhere if I don’t want to!"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "So, what were your motives?"
                [/message]

                [message]
                    speaker=Irylean
                    message= _ "My lady, I am old, and I already spent enough time in the Far North to know that it could never be my home. Plus, it is because of these bastards that my master’s time in this world came to such an abrupt end. You know what I mean with this — I have seen it in your eyes, your thirst for revenge and how you quench it with the blood of your enemies..."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I do not want to talk of that now."
                [/message]

                [message]
                    speaker=Irylean
                    message= _ "Well... my apologies if I have offended you, my lady. It was not my intention. I’ll just... go back to watching over the encampment, silently, as usual."
                [/message]
            [/case]
            [case]
                value=2
                [message]
                    speaker=Elynia
                    message= _ "So, did you solve your little problem with that staff?"
                [/message]

                [message]
                    speaker=Irylean
                    message= _ "Well, yes. It’s quite interesting, actually. It turns out that with some adjustments to my shielding spell, I can channel the staff’s aura and become immune to poison myself!"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "... And that would be why you asked me to heal you from the symptoms of a ‘cold’ at least ten times during the day, right?"
                [/message]

                [message]
                    speaker=Irylean
                    message= _ "... Right."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I mean, if you think it’s safe to use the artifact like that, I’m in no place to stop you. My knowledge of necromancy is not exhaustive enough to know exactly how that staff works or whether it might be hazardous to its user. Just... be careful when using it near our people, please?"
                [/message]

                [message]
                    speaker=Irylean
                    message= _ "I will be, my lady, don’t worry!"
                [/message]
            [/case]
        [/switch]

        {CLEAR_VARIABLE choice}
    [/event]

    [event]
        name=conversation elynia igor
        first_time_only=no
        [filter_condition]
            {VARIABLE_BOOLEAN_EQUALS went_to_bed no}
        [/filter_condition]

        [character_action_dialog]
            [option]
                message= _ "Talk to Igor."
            [/option]
            [option]
                message= _ "Ask Igor about his time in the northern country."
            [/option]
            [option]
                message= _ "Ask Igor about Anya."
            [/option]
        [/character_action_dialog]

        [switch]
            variable=choice
            [case]
                value=0
                [message]
                    speaker=Elynia
                    message= _ "Everything all right, Igor?"
                [/message]

                [message]
                    speaker=Igor
                    message= _ "Yes... I guess. It’s just that I can’t stop thinking... The elf friend died in these lands."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "... Yes. Yes, he did. I am sorry, I couldn’t do anything—"
                [/message]

                [message]
                    speaker=Igor
                    message= _ "No, there was nothing you could do. The demon lady knew what she was doing. She’s a trained assassin or something, isn’t she? I have seen how my kind do it. Quickly, cleanly. Their prey falls to the ground already dead. You can’t heal the dead. Nobody can."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "I just regret not coming with you... Maybe then things would’ve turned out different, you know. If we had all been together?"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Perhaps. I don’t think it would have changed much, though. If anything, you would have been in danger as well and I don’t think I could have managed to pull all three of us out of that accursed citadel in one piece. Mal Keshar barely made it."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "I know... I’m sorry. I need to stop beating myself up about it — I’m just a goblin after all, fighting things I really don’t understand in the middle of something much bigger than me. Not battle goblin, just... goblin."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Don’t say such things. Your time will come when you will be able to show everyone that you can accomplish great things despite the labels they force upon you, Igor. I am sure of it. I believe in you."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "That’s actually the nicest thing anyone’s ever told me... Thank you, my lady. I just wish the elf friend and the scary lich were still with us. I miss them a lot."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "So do I, Igor. So do I."
                [/message]
            [/case]
            [case]
                value=1
                [message]
                    speaker=Elynia
                    message= _ "How did your adventures in the Aragwaith country go, anyway?"
                [/message]

                [message]
                    speaker=Igor
                    message= _ "Oh, uh, about that..."
                [/message]

                [delay]
                    time=750
                [/delay]

                [message]
                    speaker=Igor
                    message= _ "Kinda disappointing really."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Go on."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "Well, you see, I didn’t do any street performing for most of it. I first found this gloomy old man in a tavern in a frontier town. He told me a buncha vague stuff and left? After that I did errands for random people for something like an eternity. I even helped save a town from a fire! And then I remembered... he told me to search for a lady seer and bring her to the capital... but I nearly got myself killed while searching for her all over the north. I’m not even sure why I did any of that — I kept hearing the old man’s words in my head like a command."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Old man? Who was he?"
                [/message]

                [message]
                    speaker=Igor
                    message= _ "Dunno! He never told me who he really was, but... you know that feeling like you’re doing something really important and you can’t mess it up? That’s how I felt about the whole thing, even though thinking back I realize... if it hadn’t been me, it could’ve been anyone else, right?"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "... Yes, I think I know what you mean. Somehow that sounds familiar... But my head hurts if I try to remember, it must have been too long ago, before the Great Fall."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "I’m sorry lady Elynia, I just needed to get that outta my chest. I know it doesn’t make sense but sometimes I’m afraid that maybe I did mess up in the end."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "It sounds like our paths almost crossed at the capital back then, though. I wonder why I never found you there."
                [/message]

                [message]
                    speaker=Igor
                    # po: Yes, apparently Igor doesn't realize that what he calls 'water longbirds'
                    # po: are actually swans.
                    message= _ "Welllll, you see, sometime after taking the seer lady there, the city guard kicked me out on orders from the heavy swords guy because of something to do with the “local swan population”? Dunno what that was all about, Willow only eats water longbirds anyway."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "... Really, now?"
                [/message]

                [message]
                    speaker=Igor
                    message= _ "Mhm!"
                [/message]
            [/case]
            [case]
                value=2
                [message]
                    speaker=Elynia
                    message= _ "You seem to be getting along well with Anya."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "Yes! And the purple lady likes Willow a lot. I’m so used to everyone being afraid of her for no reason even though she’s just a big puppy. The archer guy, for example — he’d constantly avoid her. I don’t understand why."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "I don’t think he and the other people from the Heart Forest are fond of wolves in general. They have their reasons."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "If you say so... But let me ask you, how come you don’t mind the demons all of a sudden?"
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "It’s complicated. It is not so much that I don’t mind them, but rather that I have seen that reality isn’t as black and white as we thought. Ergea and her people... they have their own conflict with Uria going on. It turns out there is no shortage of Demon Lords who tried to wage war against her in the past to escape oppression. But all those attemtps were doomed to fail, until now."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "It is now up to me... to us, to make a difference. Tomorrow we shall fight for the fate of Irdya, and if we succeed, then Inferno will follow."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "That sounds great and all but I don’t like the way she looks at me scrunching up her nose every time she passes me by..."
                [/message]

                [message]
                    speaker=Elynia
                    message= _ "Oh, uh... that... that might just be that she has difficulty breathing the air of Irdya. I think."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "Oh, I see. Nothing to worry about then!"
                [/message]
            [/case]
        [/switch]

        {CLEAR_VARIABLE choice}
    [/event]

#undef DI_COND_UNITS

    #
    # These events trigger after Elynia has talked to Anya.
    #

    [event]
        name=enter hex
        [filter]
            id=Elynia
            [filter_location]
                [not]
                    [filter_adjacent_location]
                        [filter]
                            id=Anya
                        [/filter]
                    [/filter_adjacent_location]
                [/not]
                [not]
                    [filter]
                        id=Anya
                    [/filter]
                [/not]
            [/filter_location]
        [/filter]
        [filter_condition]
            {VARIABLE_BOOLEAN_EQUALS talked_to_anya yes}
        [/filter_condition]

        [allow_undo][/allow_undo]

        {VARIABLE elynia_old_facing $unit.facing}

        [store_unit]
            [filter]
                id=Anya
            [/filter]
            kill=no
            variable=anya_store
        [/store_unit]

        {VARIABLE anya_old_facing $anya_store.facing}

        {CLEAR_VARIABLE anya_store}

        [message]
            speaker=Elynia
            message= _ "Anya..."
        [/message]

        {FACE_LOCATION id=Anya x,y=$x1,$y1}

        [redraw][/redraw]

        [message]
            speaker=Anya
            message= _ "Yes?"
        [/message]

        [store_direction]
            from_x,from_y=$x1,$y1
            [to]
                [filter]
                    id=Anya
                [/filter]
            [/to]
        [/store_direction]

        {VARIABLE unit.facing $direction}

        [unstore_unit]
            variable=unit
            find_vacant=no
        [/unstore_unit]

        [redraw][/redraw]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Elynia
            message= _ "Good night."
        [/message]

        [message]
            speaker=Anya
            message= _ "Sleep well!"
        [/message]

        {VARIABLE unit.facing $elynia_old_facing}

        [unstore_unit]
            variable=unit
            find_vacant=no
        [/unstore_unit]

        {FACE_DIRECTION id=Anya $anya_old_facing}

        [redraw][/redraw]

        {CLEAR_VARIABLE anya_old_facing,elynia_old_facing,direction}

        {SET_TALK_UNITS id=Elynia,Cron,Irylean,Igor}
    [/event]

#define DI_ENABLE_STEALTH
    [store_unit]
        [filter]
            id=Elynia
        [/filter]
        variable=elynia_store
    [/store_unit]

    {VARIABLE elynia_store.variables.using_stealth yes}

    [unstore_unit]
        variable=elynia_store
        find_vacant=no
    [/unstore_unit]

    {CLEAR_VARIABLE elynia_store}

    [object]
        silent=yes
        id=div_elynia_stealth_effect_set
        duration=scenario
        [filter]
            id=Elynia
        [/filter]
        [effect]
            apply_to=image_mod
            add="O(0.25)"
        [/effect]
    [/object]
#enddef

#define DI_DISABLE_STEALTH
    # Only remove the variable flag. The object should be
    # automatically purged by the game logic.
    [store_unit]
        [filter]
            id=Elynia
        [/filter]
        variable=elynia_store
    [/store_unit]

    {CLEAR_VARIABLE elynia_store.variables.using_stealth}

    [unstore_unit]
        variable=elynia_store
        find_vacant=no
    [/unstore_unit]

    {CLEAR_VARIABLE elynia_store}
#enddef

    [event]
        name=moveto
        [filter]
            id=Elynia
            [filter_location]
                terrain=K*,K*^*
            [/filter_location]
        [/filter]
        [filter_condition]
            {VARIABLE_BOOLEAN_EQUALS talked_to_anya yes}
        [/filter_condition]

        {LOCK_VIEW}

        {CLEAR_LABELS}

        {DI_ENABLE_STEALTH}

        [hide_unit][/hide_unit]

        {FADE_TO_BLACK}

        [fade_out_music][/fade_out_music]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "elynia^You purposefully enter your tent for the last time before the inevitable confrontation with your enemies.

Fully aware of the odds, you decide to grab a few things you know you will need — except for your journal, that is. You also opt to leave Argan’s and Galas’ journals behind, along with a note."
        [/message]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "elynia^When done, you give your enticing makeshift bed a final glance. Anya is right — you have not gotten any proper sleep in what seems to you like ages, and this could be your last opportunity to rest in your entire life.

But you have different plans for tonight."
        [/message]

        {FADE_IN}

        [unhide_unit][/unhide_unit]

        {REPLACE_SCENARIO_MUSIC ("harp.ogg")}

        [delay]
            time=500
        [/delay]

        {VARIABLE went_to_bed yes}

        {SET_TALK_UNITS (id=Elynia,Cron)}

        {DI_SET_OBJECTIVE ( _ "Talk to Cron")}

        {UNLOCK_VIEW}
    [/event]

    [event]
        name=moveto
        [filter]
            id=Elynia
            [filter_wml]
                [variables]
                    using_stealth=yes
                [/variables]
            [/filter_wml]
            [filter_adjacent]
                id=Anya
            [/filter_adjacent]
        [/filter]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "elynia^You silently approach Anya. Just as you expected, she is still wide awake and completely attentive to her surroundings. But she obviously was not counting on your stealth spell. You shudder to think what would happen if Uria’s underlings decided to use similar magic to dispose of you and your friends in the middle of the night."
        [/message]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "elynia^You feel terrible for having to resort to such a tactic yourself. Hopefully she will understand in time."
        [/message]
    [/event]

    [event]
        name=conversation elynia cron
        first_time_only=no
        [filter_condition]
            {VARIABLE_BOOLEAN_EQUALS went_to_bed yes}
        [/filter_condition]

        [character_action_dialog]
            [option]
                message= _ "Tell Cron you are leaving now."
            [/option]
        [/character_action_dialog]

        [switch]
            variable=choice
            [case]
                value=0
                [message]
                    speaker=Elynia
                    message= _ "It’s time, Cron. Please take care of Anya in my absence."
                [/message]

                [message]
                    speaker=Cron
                    message= _ "Cron will do his best to make sure nothing bad happens to the storm lady’s friends."
                [/message]

                [fire_event]
                    name=enable final objective
                [/fire_event]
            [/case]
        [/switch]

        {CLEAR_VARIABLE choice}
    [/event]

    [event]
        name=enable final objective
        first_time_only=yes

        {SET_TALK_UNITS (id=Elynia)}

        [scroll_to]
            x,y=26,22
        [/scroll_to]

        {HIGHLIGHT_IMAGE 26 22 "items/gohere.png" ()}

        [scroll_to_unit]
            id=Elynia
        [/scroll_to_unit]

        {DI_SET_OBJECTIVE ( _ "Leave the encampment")}

        [event]
            name=moveto
            [filter]
                id=Elynia
                x,y=26,22
            [/filter]

            [end_turn][/end_turn]
        [/event]
    [/event]

    [event]
        name=side 1 turn 1 end

        {LOCK_VIEW}

        {CLEAR_LABELS}

        [hide_unit][/hide_unit]

        {FADE_TO_BLACK}

        [scroll_to]
            x,y=10,11
            {WARP}
        [/scroll_to]

        [delay]
            time=1000
        [/delay]
    [/event]

    [event]
        name=side 1 turn 2

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "Time passes..."
        [/message]

        [delay]
            time=1000
        [/delay]

        {FADE_IN}

        [unhide_unit]
            [not]
                id=Elynia
            [/not]
        [/unhide_unit]

        [delay]
            time=1000
        [/delay]

        [message]
            speaker=Anya
            message= _ "Hm."
        [/message]

        [delay]
            time=750
        [/delay]

        {MOVE_UNIT id=Anya 11 9}

        [message]
            speaker=Anya
            message= _ "Elynia, are you there?"
        [/message]

        [delay]
            time=750
        [/delay]

        {MOVE_UNIT id=Anya 11 8}

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Anya
            message= _ "... Elynia?"
        [/message]

        [delay]
            time=750
        [/delay]

        [hide_unit][/hide_unit]

        {FADE_TO_BLACK}

        [fade_out_music][/fade_out_music]

        {ENDLEVEL_QUIET} {NO_REPLAY_SAVE}
    [/event]

    {PLACE_IMAGE scenery/signpost.png 7 20}

    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=7,20
        [/filter]

        [allow_undo][/allow_undo]

        [message]
            speaker=narrator
            image=scenery/signpost.png
            # wmllint: display on
            message= _ "N: Pass of Sorrows
S: Kalari Peninsula
SE: Kalari Central" # wmllint: no spellcheck
            # wmllint: display off
        [/message]
    [/event]

    #
    # Cleanup.
    #

    [event]
        name=victory

        {DI_DISABLE_STEALTH}

        [store_unit]
            [filter]
                [filter_wml]
                    [variables]
                        can_talk=yes
                    [/variables]
                [/filter_wml]
            [/filter]
            variable=can_talk_store
        [/store_unit]

        [foreach]
            array=can_talk_store
            [do]
                {CLEAR_VARIABLE this_item.variables.can_talk}

                [unstore_unit]
                    variable=this_item
                    find_vacant=no
                [/unstore_unit]
            [/do]
        [/foreach]

        {CLEAR_VARIABLE can_talk_store}

        {CLEAR_VARIABLE talked_to_anya,went_to_bed,poison_staff}
    [/event]
[/scenario]

#undef DI_ENABLE_STEALTH
#undef DI_DISABLE_STEALTH
#undef DI_SET_OBJECTIVE

# kate: indent-mode normal; encoding utf-8; space-indent on;