#textdomain wesnoth-Invasion_from_the_Unknown

[scenario]
    id=14_Bye_and_Behold
    name= _ "Bye and Behold"
    {MAP 14_Bye_and_Behold.map}
    {TURNS 44 41 38}
    next_scenario=14x_The_Aragwaithi

    {SCENARIO_MUSIC "silvan_sanctuary.ogg"} {CONTINUE_PLAYING_STORY_MUSIC_FIRST}

    {TWO_SUNS_DEFAULT_SCHEDULE}

    {STORYTXT_BYE_AND_BEHOLD}

    {DEATHS_ACT_3}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        team_name=heroes
        user_team_name= _ "team_name^Elves"

        shroud=yes

        {GOLD 270 260 240}
        # Set up the recruit list in prestart, since we need to override E1's.

        # wmllint: recognize Galas
        {CHARACTER_STATS_GALAS}
    [/side]

    [side]
        side=2
        team_name=orcs_and_saurians
        user_team_name= _ "team_name^Mercenaries"
        {RAGGED_FLAG}

        recruit=Saurian Skirmisher,Saurian Augur,Mudcrawler,Water Serpent,Giant Mudcrawler,Naga Fighter
        {GOLD 230 260 280}
        {INCOME 3 5 6}

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT aggression             0.80}
            {AI_SIMPLE_ALWAYS_ASPECT caution                0.25}
        [/ai]

        canrecruit=yes
        type=Saurian Flanker
        id=Grilock
        name= _ "Grilock"
        unrenamable=yes
        [modifications]
            {TRAIT_STRONG}
            {TRAIT_RESILIENT}
        [/modifications]
    [/side]

    [side]
        side=3
        team_name=aragwaithi
        user_team_name= _ "team_name^Aragwaithi"
        {ARAGWAITH_FLAG}
        controller=null

        no_leader=yes
        hidden=yes
    [/side]

    [side]
        side=4
        team_name=orcs_and_saurians
        user_team_name= _ "team_name^Mercenaries"
        {RAGGED_FLAG}

        recruit=Orcish Grunt,Orcish Archer,Orcish Assassin,Wolf Rider
        {GOLD 250 280 300}
        {INCOME 3 6 8}

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

        canrecruit=yes
        type=Orcish Nightblade
        id=Arghalon
        name= _ "Arghalon"
        [modifications]
            {TRAIT_INTELLIGENT}
            {TRAIT_RESILIENT}
        [/modifications]
    [/side]

    [side]
        side=5
        team_name=npc_team
        user_team_name= _ "team_name^Wild Animals"
        color=pink

        no_leader=yes
        hidden=yes

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            # Mostly for the rabbits.
            {AI_SIMPLE_ALWAYS_ASPECT aggression          -100.00}
            {AI_SIMPLE_ALWAYS_ASPECT caution              100.00}
            {AI_SIMPLE_ALWAYS_ASPECT simple_targeting        yes}
            {AI_SIMPLE_ALWAYS_ASPECT grouping                 no}
            {AI_SIMPLE_ALWAYS_ASPECT village_value           0.0}
        [/ai]

        {SIDE_GENERIC_UNIT (Rabbit) 26 28}
        {SIDE_GENERIC_UNIT (Rabbit) 18 22}
        {SIDE_GENERIC_UNIT (Rabbit) 32 22}
        {SIDE_GENERIC_UNIT (Rabbit) 40 29}

        {SIDE_GENERIC_UNIT (Crow)    4  4}
        {SIDE_GENERIC_UNIT (Crow)   38 17}
        {SIDE_GENERIC_UNIT (Crow)    2 21}
        {SIDE_GENERIC_UNIT (Falcon) 15 11}
        {SIDE_GENERIC_UNIT (Falcon) 37  5}
    [/side]

    {NPC_BIRD_BEHAVIOR 5 1 40 1 40}

    {STARTING_VILLAGES 1 5}
    {STARTING_VILLAGES 2 5}
    {STARTING_VILLAGES 4 7}

    {EXPLOSIVE_ARROWS 12 37}

    [event]
        name=prestart

        # Reset recruit list
        # NOTE: This allows recruiting Faerie Sprites, explained later.
        [modify_side]
            side=1
            recruit="Faerie Sprite,Elvish Civilian,Dark Adept,Elvish Fighter,Elvish Archer,Elvish Shaman,Elvish Scout,Elvish Hunter,Skeleton,Skeleton Archer,Skeleton Rider,Ghost,Vampire Bat,Walking Corpse"
        [/modify_side]

        {PLAYER_RECRUITMENT_SETUP_FOR_SCENARIO 14}

        {OBJECTIVES (
            {OBJECTIVE_VICTORY ( _ "Defeat all enemy leaders")}

            {OBJECTIVE_DEFEAT ( _ "Death of Galas")}
            {OBJECTIVE_DEFEAT ( _ "Death of Elynia")}
            {OBJECTIVE_DEFEAT ( _ "Death of Mal Keshar")}

            {TURNS_RUN_OUT}

            {OBJECTIVE_CARRYOVER}
        )}

        # wmllint: recognize Elynia
        {RECALL_ELYNIA_AT     10 39}
        # wmllint: recognize Mal Keshar
        {RECALL_MAL_KESHAR_AT  8 38}
        # wmllint: recognize King Asthorgar
        {RECALL_ASTHORGAR_AT  11 36}
        # wmllint: recognize Althurin
        {RECALL_ALTHURIN_AT   12 36}
        # wmllint: recognize Igor
        {RECALL_IGOR_AT        8 39}

        {FACE_DIRECTION (id=Galas,Elynia,Mal Keshar,Igor) ne}
        {FACE_DIRECTION (id=King Asthorgar,Althurin)      sw}

#ifdef CAMPAIGN_INVASION_FROM_THE_UNKNOWN_EPISODE_II
        [hide_unit]
            id=Galas
        [/hide_unit]
#endif

        {LOCK_VIEW}
    [/event]

    [event]
        name=start
#ifdef CAMPAIGN_INVASION_FROM_THE_UNKNOWN_EPISODE_II

        [character_descriptions_prompt][/character_descriptions_prompt]

        # Crappy Galas advancement dialog
        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "Galas has gained experience since the start of his journey in the last episode. You may now choose what advancement path he should follow from here onwards. Remember that every path has its own advantages and disadvantages."
            [option]
                image="units/elves-wood/captain.png~RC(magenta>brown)"
                label={STR_ELVISH_CAPTAIN} # wmllint: ignore
                [command]
                    {VARIABLE galas_type ("Elvish Captain")}
                [/command]
            [/option]
            [option]
                image="units/elves-wood/hero.png~RC(magenta>brown)"
                label={STR_ELVISH_HERO} # wmllint: ignore
                [command]
                    {VARIABLE galas_type ("Elvish Hero")}
                [/command]
            [/option]
        [/message]

        # Advance Galas
        [modify_unit]
            [filter]
                id=Galas
            [/filter]

            type=$galas_type
            moves=6
        [/modify_unit]

        {CLEAR_VARIABLE galas_type}

        [unhide_unit][/unhide_unit]
#endif

        [message]
            speaker=King Asthorgar
            message= _ "Our forefathers could never ha’ imagined their legacy would meet such a shameful end. Shameful, I say! I canna’ wait to see the faces of our kin in Valgran — surely they will be amused to see the King of Herthgar become the head of a band of homeless beggars! PAH!"
        [/message]

        [message]
            speaker=Althurin
            message= _ "My king, you didn’t seem too bothered about the situation back in—"
        [/message]

        [message]
            speaker=King Asthorgar
            message= _ "And what did ye expect me to do, Althurin? Act pessimistic in front of our people right before leading them out o’ the caves on a suicide mission?! ’Course that was na’ option."
        [/message]

        {FACE_DIRECTION (id=King Asthorgar) ne}

        [delay]
            time=500
        [/delay]

        [message]
            speaker=King Asthorgar
            message= _ "I apologize for venting like this, Galas, lady, I just couldna’ hold my frustration any longer. (sighs)"
        [/message]

        [delay]
            time=500
        [/delay]

        {FACE_DIRECTION (id=King Asthorgar) sw}

        [message]
            speaker=King Asthorgar
            message= _ "Though, mayhap there is a silver lining to all this. What d’ye think, Galas?"
        [/message]

        [message]
            speaker=Galas
            message= _ "It is our hope that the northerners will acknowledge the threat and help us retaliate, Majesty. It would be highly unreasonable on their part to turn a blind eye to the destruction that the Chaos Empire has and will continue to wreak."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=King Asthorgar
            message= _ "Only a complete fool wouldna’ take ye and yer people seriously, Galas. Would that we had the men and resources to aid ye in this crusade... Still, Althurin would like to hand ye a gift as token of our gratitude. Use it wisely."
        [/message]

        {HIGHLIGHT_GOAL x,y=12,37}

        [message]
            speaker=King Asthorgar
            message= _ "I wouldna’ be surprised if our children a few generations from now spoke legends about the exploits of the Elves of the Valley of Elynia against the dark Empire in the south. Farewell! May the Bright Gods let our paths cross again!"
        [/message]

        [message]
            speaker=Galas
            message= _ "Farewell, friends."
        [/message]

        [message]
            speaker=Althurin
            message= _ "Farewell, Elynia! I wish we had more time to exchange notes about our cultures’ respective brands of magic."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Bye, Althurin. May we meet a second time."
        [/message]

        [redraw][/redraw]

        #
        # Stash him away for a later scenario
        #
        [store_unit]
            [filter]
                id=Althurin
            [/filter]
            variable=s14_althurin_store
            kill=yes
        [/store_unit]

        [kill]
            id=King Asthorgar
        [/kill]

        [redraw][/redraw]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "And thus, the dwarves of Herthgar and the elves of the Valley parted ways."
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "So, now we need to find the rest of the elves. Any ideas?"
        [/message]

        [message]
            speaker=Galas
            message= _ "We should be able to find the northern country’s capital if we follow the dwarves’ instructions. It’s supposed to be only about three days from here if we avoid stopping to rest during daytime. I’m just unsure about walking through human lands with a lich among us..."
        [/message]

        [message]
            speaker=Elynia
            message= _ "I am ready to banish him from this world if you wish, my lord."
        [/message]

        [message]
            speaker=Galas
            message= _ "You... don’t need to call me ‘lord’. It doesn’t sit well with me, considering how much older you... I mean, no offense my lady, but..."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Hahahaha! I did notice it makes you uncomfortable, young Galas. I have been but a homeless wanderer for so long, I think it only proper for me to defer to the last regent lord of my kin — but if you wish me to stop then I will... (moves closer) on the condition that you call me Elynia like I said before."
        [/message]

        [message]
            speaker=Galas
            message= _ "(blushing) I will... try."
        [/message]

        # wmllint: local spelling pffft

        [message]
            speaker=Mal Keshar
            message= _ "Pffft, what is this? You both have fancy titles to flaunt around, and instead opt for this trite fraternization thing? This is a waste of everyone’s time."
        [/message]

        [message]
            speaker=Galas
            message= _ "As if you ever cared about anyone’s titles or ranks, Mal Keshar."
        [/message]

        {REPLACE_SCENARIO_MUSIC "revelation.ogg"}

        [message]
            speaker=Elynia
            message= _ "Someone is observing us."
        [/message]

        [move_unit_fake]
            type=Aragwaith Strongbow
            side=3
            x=10,11
            y=27,36
        [/move_unit_fake]

        [unit]
            # wmllint: recognize Erathan
            {CHARACTER_STATS_ERATHAN}
            side=3
            x,y=11,36
            facing=sw
            canrecruit=yes
            # No hero ellipse or overlay for this appearance.
            ellipse,overlays="",""
        [/unit]

        [move_unit_fake]
            type=Aragwaith Strongbow
            side=3
            x=10,11
            y=27,35
        [/move_unit_fake]

        {NAMED_GENERIC_UNIT 3 (Aragwaith Strongbow) 11 35 (Blynyr) ( _ "Blynyr")} {FACING sw}

        [move_unit_fake]
            type=Aragwaith Longswordsman
            side=3
            x=10,12
            y=27,35
        [/move_unit_fake]

        {NAMED_GENERIC_UNIT 3 (Aragwaith Longswordsman) 12 35 (Zednal) ( _ "Zednal")} {FACING sw}

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Erathan
            message= _ "Outsiders! What brings you to Aragwaith territory?"
        [/message]

        [message]
            speaker=Galas
            message= _ "You don’t need to point your bow at us, sir. We come in peace, as refugees!"
        [/message]

        [message]
            speaker=Erathan
            message= _ "Is that a lich behind you?! This is unexpected. But nothing we cannot handle!"
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "Someone ought to teach you to pick your fights more cautiously, whelp—"
        [/message]

        [message]
            speaker=Galas
            message= _ "No! Please, listen to us. We are elves! You may have heard of a large number of us coming to this country seeking refuge from a war in the southern lands."
        [/message]

        [message]
            speaker=Erathan
            message= _ "... Elves? Refugees, you say? Hah! Elves, indeed — those pointy-eared creatures that don’t exist but in tall tales of a past age."
        [/message]

        [message]
            speaker=Elynia
            message={ASIDE ( _ "Galas, allow me to do the talking. I could seduce him into cooperating with us.")}
        [/message]

        [message]
            speaker=Mal Keshar
            message={ASIDE ( _ "Galas, boy, I am ready to strike down this nuisance if you wish.")}
        [/message]

        [message]
            speaker=Galas
            message= _ "Sssht, quiet you two!"
        [/message]

        [message]
            speaker=Zednal
            message={ASIDE ( _ "Erathan, they must be the creatures we were searching for. Maybe we should take them to the Grand Council before those fiends return.")}
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Erathan
            message= _ "Elves, with a subservient lich and a faerie of the forest walking among them. This is quite the odd picture — it’s almost entertaining. You, faerie, what do you have to say in defense of you and your friends?"
        [/message]

        [message]
            speaker=Elynia
            message= _ "Perhaps we can make a deal. These seem to be difficult times for your country. I can tell from your worn attire that you were involved in some sort of skirmish recently. Was it against human invaders from the south? Our people are well acquainted with their tactics and weapons, as they lost their home to none other than those barbarians and their demon allies. Perhaps there is some task we could assist you with in exchange for guaranteeing us safe passage through the northern marchlands?"
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Erathan
            message= _ "Hah! You read me well, faerie. To tell you the truth, we were sent by the Grand Council of the Northern Peoples to Herthgar, to escort your leader back to the Council for an audience. But it seems you came to us instead. I take it that something bad happened back there. Lord Galas, right?"
        [/message]

        [message]
            speaker=Galas
            message= _ "Yes, sir. The kingdom of Herthgar has fallen to the Chaos Empire."
        [/message]

        [message]
            speaker=Erathan
            message= _ "Huh. So that’s how dire the situation is. Very well, then, elf lord — we can escort you to our capital, Raelthyn, but we cannot guarantee your safety right now. You see, a group of orcish mercenaries allied with these ‘Chaos’ fiends set up camp north of the river. Just as we managed to cross, their saurian allies arrived and seized control of the bridge. There is a mountain pass we can use but... none of you seem adequately equipped for an expedition like that. So, my proposal is as follows: you repel the invaders, and we’ll take you to Raelthyn."
        [/message]

        [message]
            speaker=Galas
            message= _ "Seems like a sound plan to me."
        [/message]

        [message]
            speaker=Erathan
            message= _ "I thought so. We’ll be watching you from close range."
        [/message]

        [store_unit]
            [filter]
                side=3
            [/filter]
            kill=no
            variable=erathan_sidekicks_store
        [/store_unit]

        [foreach]
            array=erathan_sidekicks_store
            variable=sidekick
            [do]
                [kill]
                    x=$sidekick.x
                    y=$sidekick.y
                [/kill]

                [move_unit_fake]
                    x=$sidekick.x|,11
                    y=$sidekick.y|,24
                    type=$sidekick.type
                    side=$sidekick.side
                [/move_unit_fake]
            [/do]
        [/foreach]

        {CLEAR_VARIABLE erathan_sidekicks_store}

        [scroll_to_unit]
            id=Galas
        [/scroll_to_unit]

        [message]
            speaker=Galas
            message= _ "They do not seem to trust us much, do they?"
        [/message]

        [message]
            speaker=Elynia
            message= _ "Would you trust people who consort with necromancers, Galas? We should be thankful they didn’t decide to kill us on sight."
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "Hey, don’t be so sure of yourself, girl. He seemed to take offense at your presence as well."
        [/message]

        [message]
            speaker=Elynia
            message= _ "It sounds like forest faeries have become a more common sight in the northern forests for some reason. I understand that these humans might not trust them, but... we might be able to enlist their help somehow."
        [/message]

        [if]
            [have_unit]
                side=1
                id=Igor
            [/have_unit]
            [then]
                [message]
                    speaker=Galas
                    message= _ "It’s interesting that he did not pay any attention to our goblin friend."
                [/message]

                [message]
                    speaker=Igor
                    message= _ "I feared for my life for a moment there... phew."
                [/message]
            [/then]
        [/if]

        [message]
            speaker=Mal Keshar
            message= _ "Well, now... This mission will be pleasant to accomplish — for me at least."
        [/message]

        [message]
            speaker=Galas
            message= _ "What are those creatures he mentioned, the ‘saurians’?"
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "Treacherous scaled pests that frolic in swampy waters and impale you with their rusty spears from beneath the surface. They rarely pose a threat on their own, until they swarm you in numbers."
        [/message]

        [message]
            speaker=Galas
            message= _ "Well, let’s be about it, then."
        [/message]

        {UNLOCK_VIEW}

        {RECRUITMENT_HINT units/faeries/sprite.png
        ( _ "Elynia’s affinity with the faerie realm allows you to control forest sprites. They have both a melee and a ranged attack which inflict fire damage to foes. The drawback, however, is that they are very fragile creatures and can be easily slain by enemies in a one-on-one fight; furthermore, they are costlier to recruit than most other units. Never send them against your adversaries without protection!")}

        {REPLACE_SCENARIO_MUSIC "knolls.ogg"}
        {APPEND_MUSIC           "wanderer.ogg"}
    [/event]

#ifdef CAMPAIGN_INVASION_FROM_THE_UNKNOWN_EPISODE_II
    {ELYNIA_1ST_TIME_HELP}

    {MAL_KESHAR_1ST_TIME_HELP}
#endif

    [event]
        name=enemies defeated

        {ENDLEVEL_VICTORY yes}
    [/event]

    [event]
        name=victory

        {LOCK_VIEW}

        [role]
            role=doubtful_elf
            side=1
            race=elf
            [not]
                id=Galas
            [/not]
        [/role]

        [if]
            [have_unit]
                role=doubtful_elf
            [/have_unit]
            [then]
                [message]
                    speaker=Galas
                    message= _ "We did it. Now what?"
                [/message]

                [message]
                    role=doubtful_elf
                    message= _ "That was not too difficult. But why make us do the dirty work for them, I wonder? They could have sent a real escort to Herthgar rather than those three individuals alone. It’s the sensible thing to do."
                [/message]

                [message]
                    speaker=Galas
                    message= _ "I assume their military is preoccupied dealing with the Chaos Empire’s forces elsewhere."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Galas
                    message= _ "That was not too difficult. But why did they set things up so we’d have to do the dirty work for them, I wonder? They could have sent a real escort to Herthgar rather than those three individuals alone. Perhaps their military is preoccupied dealing with the Chaos Empire’s forces elsewhere."
                [/message]
            [/else]
        [/if]

        [move_unit_fake]
            type=Aragwaith Strongbow
            side=3
            x=35,31
            y= 2, 4
        [/move_unit_fake]

        [unit]
            {CHARACTER_STATS_ERATHAN}
            side=3
            x,y=31,4
            facing=se
            canrecruit=yes
            # No hero ellipse or overlay for this appearance.
            ellipse,overlays="",""
        [/unit]

        [move_unit_fake]
            type=Aragwaith Strongbow
            side=3
            x=35,31
            y= 2, 3
        [/move_unit_fake]

        {NAMED_GENERIC_UNIT 3 (Aragwaith Strongbow) 31  3 (Blynyr) ( _ "Blynyr")} {FACING se}

        [move_unit_fake]
            type=Aragwaith Longswordsman
            side=3
            x=35,32
            y= 2, 3
        [/move_unit_fake]

        {NAMED_GENERIC_UNIT 3 (Aragwaith Longswordsman) 32  3 (Zednal) ( _ "Zednal")} {FACING se}

        [message]
            speaker=Erathan
            message= _ "I must admit, I’m pleasantly surprised by your performance in battle, lord Galas. Very well, then, let us proceed to Raelthyn."
        [/message]

        [delay]
            time=750
        [/delay]

        [if]
            [have_unit]
                side=1
                race=faerie
                [not]
                    id=Elynia
                [/not]
            [/have_unit]
            [then]
                [message]
                    speaker=Erathan
                    message={ASIDE ( _ "Zednal? Just for safety, I want you to keep an eye on the forest faeries, especially the lavender-haired one. The last thing we want is creatures like her flirting with our men in the capital.")}
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Erathan
                    message={ASIDE ( _ "Zednal? Just for safety, I want you to keep an eye on that lavender-haired forest faerie. The last thing we want is creatures like her flirting with our men in the capital.")}
                [/message]
            [/else]
        [/if]

        [message]
            speaker=Zednal
            message={ASIDE ( _ "Yes, as you command, sir.")}
        [/message]

        [message]
            speaker=Galas
            message={ASIDE ( _ "You heard that?")}
        [/message]

        [message]
            speaker=Elynia
            message={ASIDE ( _ "Yes. (sighs) Oh well, their love problems are not our business.")}
        [/message]

        {UNLOCK_VIEW}
    [/event]

    {FIRE_EVENT_ON_STUMBLE_UPON "found enemy" (
        side=2,4
        [not]
            type=Water Serpent,Mudcrawler,Giant Mudcrawler
        [/not]
    )}

    [event]
        name=found enemy

        [message]
            speaker=second_unit
            message= _ "What the hell? Are those elves? And undead at their command? This is most unusual!"
        [/message]

        [message]
            speaker=Arghalon
            message= _ "The lich wants to see our leader’s head on a stake! Go get them, you useless scum!"
        [/message]

        [message]
            speaker=Grilock
            message= _ "Already working on it, boss!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            race=orc,goblin
        [/filter]
        [filter_second]
            id=Igor
        [/filter_second]

        [message]
            speaker=Igor
            message= _ "This feels so wrong..."
        [/message]
    [/event]

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

        # wmllint: local spelling gaaargh

        [message]
            speaker=unit
            message= _ "Gaaargh... How could this happen to me!"
        [/message]
    [/event]

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

        [message]
            speaker=unit
            message= _ "You wose-born fiends may take me down, but at the end of the day, the Chaos Empire will prevail! It’s not too late for your people yet... join them and perhaps they’ll spare your miserable lives!"
        [/message]

        [message]
            speaker=Galas
            message= _ "Hah! Is this why you and your people chose to serve them? It’s appalling that orcs would rather surrender to a band of bloodthirsty humans than fight back. What has the world come to?"
        [/message]

        [message]
            speaker=unit
            message= _ "You... clearly haven’t seen the full extent of their power. The followers of Uria... they are not a threat to be taken lightly, elf. You’ll rue the day you decided to cross them."
        [/message]
    [/event]

    [item]
        x,y=32,16
        image=scenery/signpost.png
    [/item]

    [event]
        name=moveto
        [filter]
            x,y=32,16
            side=1
        [/filter]

        [redraw][/redraw]

        [allow_undo][/allow_undo]

        [message]
            speaker=narrator
            image=scenery/signpost.png
            message= _ "Danger! Bridge no longer maintained. Use at own risk."
        [/message]

        [message]
            speaker=unit
            {UNIT_SPEAKS_FOR_UNDEAD_MINION (id=Mal Keshar)}
            message= _ "So this is why it broke in half."
        [/message]
    [/event]

    #
    # Allow me to have some fun with these two before breaking Elynia at the
    # end of the campaign.
    #

    [event]
        name=moveto
        [filter]
            id=Elynia
            [filter_adjacent]
                type=Rabbit
            [/filter_adjacent]
        [/filter]

        [message]
            speaker=Elynia
            message= _ "Awww, look it’s a bunny! It’s nice to see that these cute little fur balls still exist."
        [/message]
    [/event]

    [event]
        name=attack
        [filter]
            id=Elynia
        [/filter]
        [filter_second]
            type=Rabbit
        [/filter_second]

        [message]
            speaker=Elynia
            message= _ "Why would you ask me to murder such an adorable creature! Have someone else do it."
        [/message]

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

        [store_locations]
            [filter_adjacent_location]
                x,y=$x1,$y1
                adjacent=$direction
            [/filter_adjacent_location]
            variable=location
        [/store_locations]

        {MOVE_UNIT id=Elynia $location.x $location.y}
    [/event]

    [event]
        name=die
        [filter]
            type=Rabbit
        [/filter]
        [filter_second]
            id=Elynia
        [/filter_second]

        [message]
            speaker=Elynia
            message= _ "What... Why? What possessed me to do such a horrible thing?"
        [/message]

        [message]
            speaker=Mal Keshar
            scroll=no
            message= _ "That was surprisingly cruel of you, Elynia. (snickers)"
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            id=Mal Keshar
            [filter_adjacent]
                type=Rabbit
            [/filter_adjacent]
        [/filter]

        [message]
            speaker=Mal Keshar
            message= _ "Blargh, get that thing out of my sight!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            type=Rabbit
        [/filter]
        [filter_second]
            id=Mal Keshar
        [/filter_second]

        [message]
            speaker=Mal Keshar
            message= _ "Yes! YES!"
        [/message]

        [message]
            speaker=Elynia
            scroll=no
            message= _ "You are such a disgusting creature, Malin Keshar."
        [/message]
    [/event]
[/scenario]

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


#textdomain wesnoth-Invasion_from_the_Unknown

[scenario]
    id=15x_Parting_Ways
    name= _ "Parting Ways"
    {MAP 14y_The_Grand_Council.map}
    turns=-1
    next_scenario=16_Dawn_of_War

    {CUTSCENE_UI}

    {SCENARIO_MUSIC "elvish-theme.ogg"}

    {INDOORS}

    {STORYTXT_PARTING_WAYS}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        team_name=heroes
        user_team_name= _ "team_name^Elves"

        {NO_ECONOMY}

        # wmllint: recognize Galas
        {CHARACTER_STATS_GALAS}
    [/side]

    [side]
        side=2
        team_name=heroes
        {ARAGWAITH_FLAG}
        color=blue

        {NO_ECONOMY}

        canrecruit=yes
        # wmllint: recognize De'Arthian
        {CHARACTER_STATS_DE_ARTHIAN}
    [/side]

    [side]
        side=3
        team_name=heroes
        {ALLIANCE_FLAG}
        color=teal

        {NO_ECONOMY}

        no_leader=yes
        #canrecruit=yes
        # wmllint: recognize Inodien
        #{CHARACTER_STATS_INODIEN}
    [/side]

    [side]
        side=4
        team_name=heroes
        {ARAGWAITH_FLAG}
        color=purple

        {NO_ECONOMY}

        canrecruit=yes
        # wmllint: recognize Illana
        {CHARACTER_STATS_ILLANA}
    [/side]

    [side]
        side=5
        team_name=heroes
        {ARAGWAITH_FLAG}
        color=black

        {NO_ECONOMY}

        canrecruit=yes
        # wmllint: recognize Arnesius
        {CHARACTER_STATS_ARNESIUS}
    [/side]

    [side]
        side=6
        team_name=heroes
        {ARAGWAITH_FLAG}
        color=brown

        {NO_ECONOMY}

        canrecruit=yes
        # wmllint: recognize Delarel
        {CHARACTER_STATS_DELAREL}
    [/side]

    [side]
        side=7
        team_name=heroes
        {ARAGWAITH_FLAG}
        color=orange

        {NO_ECONOMY}

        canrecruit=yes
        # wmllint: recognize Torancyn
        {CHARACTER_STATS_TORANCYN}
    [/side]

    [side]
        side=8
        team_name=heroes
        {ARAGWAITH_FLAG}
        color=white

        {NO_ECONOMY}

        canrecruit=yes
        # wmllint: recognize Aleazar
        {CHARACTER_STATS_ALEAZAR}
    [/side]
    # wmllint: validate-on

    [event]
        name=prestart

        # wmllint: recognize Elynia
        {RECALL_ELYNIA_AT      9  8}
        # wmllint: recognize Mal Keshar
        {RECALL_MAL_KESHAR_AT  9  6}
        # wmllint: recognize Erathan
        {RECALL_ERATHAN_AT     8  7}
        # wmllint: recognize Unarye
        #{RECALL_UNARYE_AT      8  6}

        {FACE_LOCATION () x,y=12,7}

        {LOCK_VIEW}
    [/event]

    [event]
        name=start

        [message]
            speaker=Illana
            message= _ "We have sent our declaration of war to the Chaos outpost near Dervale. I believe we already have troops stationed in Aran-Balgur, Ardgam and Aran-Nitar, ready for combat. Also, the dwarves of Valgran agreed to send us a few experts and supplies. Now that the pact is sealed, all that remains to be decided is the elves’ role in all of this."
        [/message]

        [message]
            speaker=Galas
            message= _ "Well, about that..."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "Galas explained his plan to the Grand Council."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker="De'Arthian"
            message= _ "So you intend to infiltrate the Empire’s lands and assassinate their Emperor! Hah! You elves sure are full of surprises! I never expected such an audacious plan from your people!"
        [/message]

        [message]
            speaker=Arnesius
            message= _ "Lady of Light, I am inclined to suggest that you stay in the northlands with us where we may be able to make better use of your services."
        [/message]

        [message]
            speaker=Elynia
            message= _ "I would normally agree with that, but I am certain you and Lady Illana have also felt the dark presence that enshrouds the lands to the south of the Heart Mountains. Have you not?"
        [/message]

        [message]
            speaker=Arnesius
            message= _ "It is a power beyond our understanding, yes. We have consulted our best sorcerers about it over the years, and none of them have managed to descry the secrets it guards. The situation in this regard is quite reminiscent of the stories from over three hundred years ago."
        [/message]

        [message]
            speaker=Elynia
            message= _ "And I believe this is the real reason you acceded to declare war on the Chaos Empire. Sooner or later you will want us to investigate anyway, so why not allow us to do so now that the Empire and their demon allies will have their hands busy dealing with the Alliance’s forces? If you want to look at it another way, it also serves to keep a dangerous criminal away from the country. (points at Mal Keshar)"
        [/message]

        [message]
            speaker=Mal Keshar
            message={ASIDE ( _ "My only crime is not ripping out your throat when I had the chance.")}
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Illana
            message= _ "You do make a valid point. Very well, then. We authorize you and the lich Mal Keshar to assist Lord Galas in infiltrating the Chaos Empire. Erathan will accompany you."
        [/message]

        [message]
            speaker=Galas
            message= _ "Erathan? But... he... (deep sigh) Fair enough."
        [/message]

        [message]
            speaker=Torancyn
            message= _ "I don’t think..."
        [/message]

        [message]
            speaker=Illana
            message= _ "Yes, Lord Torancyn?"
        [/message]

        [message]
            speaker=Torancyn
            message= _ "... Never mind, it’s not important. Not anymore."
        [/message]

        [message]
            speaker=Erathan
            message= _ "Don’t worry, Lord Galas. I am willing to risk my life if needed to ensure no harm comes to you or your advisors."
        [/message]

        [message]
            speaker=Elynia
            message={ASIDE ( _ "They intend to keep watching us? Really? How paranoid can you be?")}
        [/message]

        [message]
            speaker=Mal Keshar
            message={ASIDE ( _ "I say we murder him in his sleep.")}
        [/message]

        [message]
            speaker=Delarel
            message= _ "And thus, the Council has spoken."
        [/message]

        [message]
            speaker=Aleazar
            message= _ "I cannot believe we just approved this."
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "Well, well. This has certainly been an interesting and productive council for everyone, and I for one am looking forward to tearing those demons apart now that we are done with the incessant chit-chat."
        [/message]

        [message]
            speaker=Galas
            message= _ "I could not possibly enjoy massacring living creatures by the hundreds, no matter how evil they might be — but I can’t say I will miss doing this diplomacy thing either."
        [/message]

        [message]
            speaker=Elynia
            message= _ "I have been through worse, trust me. At least this time we didn’t have to wait years for a decision to be made."
        [/message]

        {ENDLEVEL_CONTINUE} {NO_REPLAY_SAVE}
    [/event]
[/scenario]

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


#textdomain wesnoth-Invasion_from_the_Unknown

[scenario]
    id=15_Shadows_of_Time
    name= _ "Shadows of Time"
    {MAP 15_Shadows_of_Time.map}
    {TURNS 42 40 38}
    next_scenario=15x_Parting_Ways

    {SCENARIO_MUSIC "revelation.ogg"}

    {TWO_SUNS_DEFAULT_SCHEDULE}

    {STORYTXT_SHADOWS_OF_TIME}

    {DEATHS_ACT_3}

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

        share_vision=all

        {GOLD 170 160 150}
        {INCOME 3 2 0}

        # wmllint: recognize Galas
        {CHARACTER_STATS_GALAS}
    [/side]
    # wmllint: validate-on

    [side]
        side=2
        team_name=good
        user_team_name= _ "team_name^Orcs"
        # Default flag.

        {GOLD 230 200 170}
        recruit=Orcish Grunt,Orcish Archer,Orcish Assassin,Wolf Rider,Goblin Spearman,Goblin Rouser

        share_vision=all

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT aggression          1.0}
            {AI_SIMPLE_ALWAYS_ASPECT caution             0.0}
            {AI_SIMPLE_ALWAYS_ASPECT village_value       0.3}
        [/ai]

        canrecruit=yes
        type=Orcish Sovereign
        id=Quogar Ratham
        name= _ "Quogar Ratham"
        facing=sw
        profile="portraits/orcs/ruler.png"
        [modifications]
            {TRAIT_INTELLIGENT}
            {TRAIT_STRONG}
        [/modifications]
    [/side]

#define SOT_ENEMY_AI_TARGETS_ELVES
    [goal]
        [criteria]
            id=Galas
        [/criteria]
        value=10.0
    [/goal]
    [goal]
        [criteria]
            id=Elynia
        [/criteria]
        value=9.0
    [/goal]
    [goal]
        [criteria]
            race=elf
        [/criteria]
        value=6.0
    [/goal]
#enddef

#define SOT_ENEMY_AI_PROTECTS_SIDE _SIDE
    [goal]
        [criteria]
            side={_SIDE}
        [/criteria]
        name=protect_unit
        value=2.0
        protect_radius=8
    [/goal]
#enddef

    [side]
        side=3
        team_name=undead
        user_team_name= _ "team_name^Undead"
        {RAGGED_FLAG}

        {GOLD 225 250 275}
        {INCOME 2 4 6}
        recruit=Elvish Warrior Spirit,Shadow Minion,Walking Corpse,Skeleton,Skeleton Archer

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT aggression          1.0}
            {AI_SIMPLE_ALWAYS_ASPECT caution             0.0}
            {AI_SIMPLE_ALWAYS_ASPECT leader_value        9.0}
            {AI_SIMPLE_ALWAYS_ASPECT village_value       0.5}

            {SOT_ENEMY_AI_TARGETS_ELVES}

            {SOT_ENEMY_AI_PROTECTS_SIDE 4}
        [/ai]

        canrecruit=yes
        type=Death Knight
        id=Tanstafaal
        name= _ "Tanstafaal"
        facing=se
        [modifications]
            {TRAIT_UNDEAD}
            # From UtBS scenario 9 as of 1.12.x, single trait for some reason.
            {TRAIT_RESILIENT}
        [/modifications]
    [/side]

    [side]
        side=4
        team_name=undead
        user_team_name= _ "team_name^Mercenaries"
        {RAGGED_FLAG}

        {GOLD 150 200 250}
        recruit=Orcish Grunt,Wolf Rider,Orcish Archer,Goblin Spearman,Saurian Skirmisher,Saurian Augur,Mudcrawler

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT aggression          0.7 }
            {AI_SIMPLE_ALWAYS_ASPECT caution             0.25}
            {AI_SIMPLE_ALWAYS_ASPECT leader_value        6.0 }
            {AI_SIMPLE_ALWAYS_ASPECT village_value       0.8 }
            #{AI_SIMPLE_ALWAYS_ASPECT grouping            no  }
        [/ai]

        canrecruit=yes
        type=Orcish Slurbow
        id=Tan Zalfargat
        name= _ "Tan Zalfargat"
        facing=se
        profile="portraits/orcs/grunt-2.png"
        [modifications]
            {TRAIT_QUICK}
            {TRAIT_RESILIENT}
        [/modifications]
    [/side]

    # wmllint: validate-off
    [side]
        side=5
        team_name=undead
        user_team_name= _ "team_name^Chaos Empire"
        {CHAOS_FLAG}

        {GOLD 180 220 260}
        {INCOME 4 8 12}
        recruit=Skeleton Rider,Skeleton,Skeleton Archer,Walking Corpse,Ghoul

        {ai/aliases/stable_singleplayer.cfg}
        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT aggression          1.0}
            {AI_SIMPLE_ALWAYS_ASPECT caution             0.0}
            {AI_SIMPLE_ALWAYS_ASPECT leader_value       10.0}
            {AI_SIMPLE_ALWAYS_ASPECT village_value       0.1}
            {AI_SIMPLE_ALWAYS_ASPECT passive_leader      yes}

            {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "scout,scout,fighter,fighter,archer,archer,fighter,archer"}

            {SOT_ENEMY_AI_TARGETS_ELVES}

            {SOT_ENEMY_AI_PROTECTS_SIDE 3}
        [/ai]

        canrecruit=yes
        # wmllint: recognize Mal Hekuba
        {CHARACTER_STATS_MAL_HEKUBA}
        facing=sw
    [/side]
    # wmllint: validate-on

    {RECRUIT_UNIT_VARIATIONS 3 "Walking Corpse" none,none,none,saurian,wose,bat,bat,mounted,mounted,saurian,swimmer,saurian,saurian,wose}
    {RECRUIT_UNIT_VARIATIONS 5 "Walking Corpse" none,none,mounted,mounted,mounted,swimmer,swimmer,mounted,bat,bat,saurian,saurian,wose}

    {STARTING_VILLAGES 1 5}
    {STARTING_VILLAGES 2 4}
    {STARTING_VILLAGES 3 7}
    {STARTING_VILLAGES 4 7}
    {STARTING_VILLAGES 5 7}

    [event]
        name=prestart

        {PLAYER_RECRUITMENT_SETUP_FOR_SCENARIO 15}

        #
        # Recall heroes
        #

        # wmllint: recognize Elynia
        {RECALL_ELYNIA}
        # wmllint: recognize Mal Keshar
        {RECALL_MAL_KESHAR}
        # wmllint: recognize Erathan
        {RECALL_ERATHAN}
        # wmllint: recognize Igor
        {RECALL_IGOR}

        {FACE_UNIT (side=1) (id=Quogar Ratham)}

        {OBJECTIVES (
            {OBJECTIVE_VICTORY ( _ "Defeat all enemy leaders")}

            {OBJECTIVE_DEFEAT ( _ "Death of Galas")}
            {OBJECTIVE_DEFEAT ( _ "Death of Elynia")}
            {OBJECTIVE_DEFEAT ( _ "Death of Mal Keshar")}
            {OBJECTIVE_DEFEAT ( _ "Death of Erathan")}
            {OBJECTIVE_DEFEAT ( _ "Death of Quogar Ratham")}

            {TURNS_RUN_OUT}

            {OBJECTIVE_CARRYOVER}
        )}

        [hide_unit]
            [filter_side]
                [enemy_of]
                    side=1
                [/enemy_of]
            [/filter_side]
        [/hide_unit]
    [/event]

    [event]
        name=start

        [message]
            speaker=Quogar Ratham
            message= _ "I must admit, it is a tempting deal... for other orcs, maybe, not us! We are not dogs who do all the hard work for inferior creatures like you in exchange for scraps. If we decide we want more lands and riches, we will take them by force on our own!"
        [/message]

        [message]
            speaker=Galas
            message= _ "‘Inferior’ creatures, you say? How dare you insult us, when it is only thanks to our sacrifices that you may yet have a chance to maintain your lifestyle?"
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "Oh Galas, I told you, using words and diplomacy with these illiterate beasts will not get us anywhere."
        [/message]

        [message]
            speaker=Quogar Ratham
            message= _ "Ha, and what do you propose then, lich? You’d rather kill us? What benefit would that bring you?"
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "I could at least quench my thirst! It has been days since I last felled one of your kind..."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Squabbling like children will not get us anywhere! This is not the time for resurrecting ancient conflicts. We must focus on fighting the real enemy that threatens all life on the Great Continent — that includes you, orcs."
        [/message]

        [message]
            speaker=Quogar Ratham
            message= _ "As if I would believe your fantasy tales, faerie. It’s obvious that you’re trying to trick us to obtain cheap war-beasts to solve your own problems."
        [/message]

        [message]
            speaker=Erathan
            message= _ "Our problems will eventually be yours as well. If you refuse to take part in our alliance, then we’ll not insist further — but know that you will receive no help from us when you and your people see the truth."
        [/message]

        {REPLACE_SCENARIO_MUSIC "data/core/sounds/ambient/wardrums.ogg"}

        [delay]
            time=250
        [/delay]

        {FACE_DIRECTION (id=Mal Keshar) sw}

        [delay]
            time=250
        [/delay]

        {FACE_DIRECTION (id=Mal Keshar) ne}

        [delay]
            time=250
        [/delay]

        {FACE_DIRECTION (id=Mal Keshar) sw}

        [delay]
            time=250
        [/delay]

        {FACE_DIRECTION (id=Mal Keshar) ne}

        [message]
            speaker=Mal Keshar
            message= _ "Are those war drums I hear? So was it your plan all along to lure us into your domain to dispose of us, orc?"
        [/message]

        [message]
            speaker=Quogar Ratham
            message= _ "It is not, you decrepit sack of bones! Where do they come from?"
        [/message]

        [unhide_unit][/unhide_unit]

        [message]
            speaker=Tan Zalfargat
            message= _ "Hail there, ‘friend’!"
        [/message]

        {FACE_UNIT (side=1) (id=Tan Zalfargat)}

        [message]
            speaker=Quogar Ratham
            message= _ "What are you doing in my lands again?! Exactly how many times do I have to rub your face in the mud before you’ll give up your obsession with overthrowing me, you thick-headed turd!?"
        [/message]

        [message]
            speaker=Tan Zalfargat
            message= _ "Ha, see who speaks — the weakling who’s got a soft spot for the humans and their new tree-shagger friends! Sorry, but this time I don’t come alone. You see, cousin..."
        [/message]

        {FACE_UNIT (side=1) (id=Tanstafaal)}

        [scroll_to_unit]
            id=Tanstafaal
        [/scroll_to_unit]

        {REPLACE_SCENARIO_MUSIC "the_dangerous_symphony.ogg"}
        {APPEND_MUSIC           "northerners.ogg"}
        {APPEND_MUSIC           "siege_of_laurelmor.ogg"}

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Tan Zalfargat
            scroll=no
            message= _ "I brought new friends. HA HA!"
        [/message]

        {FACE_UNIT (side=1) (id=Mal Hekuba)}

        [scroll_to_unit]
            id=Mal Hekuba
        [/scroll_to_unit]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Quogar Ratham
            scroll=no
            message= _ "Ah, so you deal with those rotten necromancers now as well? That makes no difference to me, really."
        [/message]

        [message]
            speaker=Mal Hekuba
            message= _ "I see the Emperor was right to suspect that the elves would team up with the northerners. Very well, heathens! This is the last time your kind escapes the power of Uria and the Dark Lady! You shall not escape the might of the Iron Council again!"
        [/message]

        [message]
            speaker=Erathan
            message= _ "What is that lich rambling about?"
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "Iron Council? Hah! The Chaos Emperor must be getting desperate if he would resort to sending one of their foulest priests of Yechnagoth! I presume that our suicidal lady gave your precious Warlord a hard time?"
        [/message]

        [message]
            speaker=Galas
            message= _ "Yechnagoth? But... She was vanquished... wasn’t she?"
        [/message]

        [message]
            speaker=Mal Hekuba
            message= _ "Those are blatant lies made up by heretics like you, elf. Her power still lives, and is greater now than ever thanks to Uria’s grace! Tanstafaal! Give them a taste of her power!"
        [/message]

        [message]
            speaker=Tanstafaal
            message= _ "As you command, my master. By Eloh’s wrath I shall make you suffer for your betrayal!"
        [/message]

#define SOT_SPIRIT_RECRUIT _ID _NAME
    [sound]
        name=wail.wav
    [/sound]

    [unit]
        animate=yes
        side=3
        placement=leader

#ifdef EASY
        type=Elvish Ancestor
#else
        type=Elvish Forefather
#endif
        id={_ID}
        name={_NAME}

        [modifications]
            {TRAIT_LOYAL}
            {TRAIT_UNDEAD}
            {TRAIT_FEARLESS}
        [/modifications]
    [/unit]
#enddef

        {SOT_SPIRIT_RECRUIT Zelru'el ( _ "Zelru’el")}

        {SOT_SPIRIT_RECRUIT Galenea ( _ "Galenea")} {GENDER female}

        {SOT_SPIRIT_RECRUIT Avalien ( _ "Avalien")}

#ifndef EASY
        {SOT_SPIRIT_RECRUIT Kaalnuil ( _ "Kaalnuil")}
#endif

        [message]
            speaker=Galas
            message= _ "Curse the Dark Gods... those are elvish warriors! What is this new enemy we are facing?"
        [/message]

        # ???
        # wmllint: local spelling spectres

        [message]
            speaker=Elynia
            message= _ "Althurin mentioned a rebel faction betraying the Quenoth elves while under Yechnagoth’s control. These spectres must have been created from their lingering souls — it’s unlikely that anyone else in this era worships this ‘Eloh’ figure. I fear we have no choice but to fight them."
        [/message]

        [message]
            speaker=Galas
            message= _ "I don’t like the sound of this. Orc chieftain, you and your people had better stay clear of this battle. It is not yours to fight."
        [/message]

        [message]
            speaker=Quogar Ratham
            message= _ "Bah, I’m not running away like a puny elf just because of an undead incursion. I shall fight by your side. Odds are you will perish without our ‘help’ anyway, heh heh."
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "You pathetic piece of—"
        [/message]

        [message]
            speaker=Elynia
            message= _ "Malin, for the sake of... Can you not at least put your issues from your past life aside for a short while?!"
        [/message]

        [message]
            speaker=Galas
            message= _ "To arms!"
        [/message]

        [message]
            speaker=Mal Hekuba
            message= _ "By the power bestowed upon me by the Dark Lady, I call forth the shadows from beyond the veil! May these plains be devoid of joy and peace! May they see only darkness and decay!"
        [/message]

        [fire_event]
            name=unleash darkness
        [/fire_event]

        [message]
            speaker=Quogar Ratham
            message= _ "Blargh! Where did this accursed fog come from?!"
        [/message]
    [/event]

    {ERATHAN_1ST_TIME_HELP}

    [event]
        name=unleash darkness

        # Set Fog-of-War on and place zombies randomly all over the place

        [modify_side]
            side=1,2
            fog,shroud=yes,yes
        [/modify_side]

        [redraw]
            side=1,2
        [/redraw]

        [store_locations]
            # Not around starting locations; should avoid blocking enemy keeps with units
            # of their same allegiance but that cannot move
            [not]
                [filter]
                    canrecruit=yes
                [/filter]
                radius=6
            [/not]
            [not]
                [filter][/filter]
            [/not]
            variable=locs
        [/store_locations]

        # wmlindent: start ignoring

        [repeat]
            times={DIFF (12) (24) (32)}
            [do]
                {VARIABLE_RANDOM k         ("0..$($locs.length - 1)")}

                {VARIABLE_RANDOM temp_side ("3,5")}

                #
                # EASY:   100% chance of WCs
                # NORMAL:  75% chance of WCs; 25% chance of Soullesses
                # HARD:    50% chance of WCs; 50% chance of Soullesses
                #

                {VARIABLE_RANDOM temp_type ({DIFF
                    ("Walking Corpse")
                    ("Walking Corpse,Walking Corpse,Walking Corpse,Soulless")
                    ("Walking Corpse,Soulless,Soulless,Walking Corpse")
                })}

                {VARIABLE_RANDOM temp_variation ("mounted,saurian,wose,bat,none")}

                [unit]
                    x,y=$locs[$k].x,$locs[$k].y
                    type=$temp_type
                    variation=$temp_variation
                    side=$temp_side

                    ai_special=guardian
                    random_traits,generate_name=yes,yes
                    upkeep=free
                [/unit]
            [/do]
        [/repeat]

        {CLEAR_VARIABLE k,temp_side,temp_type,temp_variation,locs}
    [/event]

    [event]
        name=last breath
        [filter]
            id=Quogar Ratham
        [/filter]

        [message]
            speaker=unit
            message= _ "Argh. This was not supposed to be my final day!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            id=Quogar Ratham
        [/filter]

        [message]
            speaker=Elynia
            message= _ "The orcish chieftain has fallen. It’s unlikely we’ll ever manage to obtain the orcs’ support now. Our mission has failed!"
        [/message]

        {ENDLEVEL_DEFEAT}
    [/event]

    #
    # The reveal begins on turn 6, the first Short Dark turn. No-one could
    # possibly finish the scenario before this, right?
    #
    [event]
        name=turn 6

        [message]
            speaker=Mal Hekuba
            # po: As with other appearances before "Face of the enemy" later,
            # po: try to make all references to the Chaos Warlord gender-neutral
            # po: if at all possible without it sounding too awkward.
            message= _ "Oh... Oh! Oh my, how could I not notice this before? The elves brought their precious Lady of Light with them! Hm, surely the Emperor would be pleased if I brought her to him after the Warlord’s mission ended in such a lamentable disaster, hm..."
        [/message]

        [message]
            # Hekuba being visible to the player is rather unlikely to be the
            # case by turn 6, but just in case...
            [show_if]
                [not]
                    [have_unit]
                        id=Mal Hekuba
                        [filter_vision]
                            visible=no
                            side=1
                        [/filter_vision]
                    [/have_unit]
                [/not]
            [/show_if]
            speaker=Elynia
            message= _ "Where are you, fiend?"
        [/message]

        [message]
            speaker=Mal Hekuba
            message= _ "Say, Lady of Light... Elynia is your name, right? Do you feel lonely? Without your dear partner, the fabled Master of Darkness?"
        [/message]

        [message]
            speaker=Elynia
            message= _ "How I feel is none of your business."
        [/message]
    [/event]

    [event]
        name=side 1 turn 6 end

        [message]
            speaker=Mal Hekuba
            message= _ "Ever since that fateful day you have asked yourself time and again why it had to happen. You are haunted by lingering doubt that you didn’t do enough. You could have saved him, really... and that festers, because deep down, you still don’t know how to move forward without him. Elynia, let me tell you this: Uria knows many things about the past, present, and future."
        [/message]

        [message]
            speaker=Galas
            message= _ "Elynia, focus on the battle at hand and pay no attention to this wretched scum."
        [/message]

        [message]
            speaker=Mal Hekuba
            message= _ "You and the other heathens don’t believe Uria is real; I can assure you otherwise. She is as real as she is beautiful, Elynia. And she can answer all your questions — especially those pertaining to Argan’s fate in the depths of Irdya. You have only to come see our Master, and he will take you to her palace in Inferno."
        [/message]

        [message]
            speaker=Galas
            message= _ "Elynia! I said, don’t listen to our enemy!"
        [/message]

        [message]
            speaker=Elynia
            message= _ "(startled) Huh?! Yes, yes... I am sorry, Galas, I... really shouldn’t heed his words..."
        [/message]

        [message]
            speaker=Mal Hekuba
            message= _ "Oh, Elynia, we all know your curiosity is insatiable. And, our Master is patient..."
        [/message]
    [/event]

    #
    # Mal Hekuba escape logic.
    #

#define SOT_GO_BYEBYE
    [fire_event]
        name=hekuba escapes
    [/fire_event]
#enddef

#define SOT_BYEBYE_COND _UNIT_STORE
    [filter_condition]
        {VARIABLE_NUMERICAL_LESS_THAN_OR_EQUAL {_UNIT_STORE}.hitpoints "$(0.5 * ${_UNIT_STORE}.max_hitpoints)"}
    [/filter_condition]
#enddef

    [event]
        name=attacker_hits
        first_time_only=no
        [filter_second]
            id=Mal Hekuba
        [/filter_second]

        {SOT_BYEBYE_COND second_unit}

        {SOT_GO_BYEBYE}
    [/event]

    [event]
        name=defender hits
        first_time_only=no
        [filter]
            id=Mal Hekuba
        [/filter]

        {SOT_BYEBYE_COND unit}

        {SOT_GO_BYEBYE}
    [/event]

    [event]
        name=last breath
        [filter]
            id=Mal Hekuba
        [/filter]

        {SOT_GO_BYEBYE}
    [/event]

#define SOT_SET_HEKUBA_OPACITY _VALUE
    [object]
        silent=yes
        [filter]
            id=Mal Hekuba
        [/filter]
        [effect]
            apply_to=image_mod
            replace="RC(magenta>purple)~O("+{_VALUE}+")"
        [/effect]
    [/object]
#enddef

    [event]
        name=hekuba escapes

        {LOCK_VIEW}

        [message]
            speaker=Mal Hekuba
            message= _ "It is truly a pity that I must report back to our Master. But worry not, Elynia, for I will be back... eventually... Ha, ha, ha, ha!"
        [/message]

        # Go dark.

        {FADE_STEP -32 25}

        {SOT_SET_HEKUBA_OPACITY 0.9}
        {FADE_STEP -64 25}

        {SOT_SET_HEKUBA_OPACITY 0.8}
        {FADE_STEP -96 25}

        {SOT_SET_HEKUBA_OPACITY 0.7}
        {FADE_STEP -128 25}

        [message]
            speaker=Elynia
            scroll=no
            message= _ "I cannot hold against this darkness!"
        [/message]

        {SOT_SET_HEKUBA_OPACITY 0.6}
        {FADE_STEP -160 25}

        {SOT_SET_HEKUBA_OPACITY 0.5}
        {FADE_STEP -192 25}

        {SOT_SET_HEKUBA_OPACITY 0.4}
        {FADE_STEP -224 25}

        {SOT_SET_HEKUBA_OPACITY 0.3}
        {FADE_STEP -256 25}

        # Keep going in case we are on a daytime ToD with a positive lighting
        # color shift.

        [hide_unit][/hide_unit]

        {FADE_STEP -280 25}

        {FADE_STEP -340 25}

        {FADE_STEP -500 25}

        [kill]
            id=Mal Hekuba
        [/kill]

        [delay]
            time=750
        [/delay]

        {FADE_STEP -340 25}

        {FADE_STEP -280 25}

        [unhide_unit][/unhide_unit]

        {FADE_STEP -256 25}

        {FADE_STEP -224 25}

        {FADE_STEP -192 25}

        {FADE_STEP -160 25}

        {FADE_STEP -128 25}

        {FADE_STEP -96 25}

        {FADE_STEP -64 25}

        {FADE_STEP -32 25}

        {FADE_STEP 0 500}

        [message]
            speaker=Galas
            message= _ "Damn that wretched necromancer! He used the darkness to escape. Elynia, are you all right?"
        [/message]

        [message]
            speaker=Elynia
            message= _ "I... think so... I feel a little lightheaded, that’s all."
        [/message]

        [message]
            speaker=Tan Zalfargat
            message= _ "Huh? WHAT?! I should have known better than to trust a lich. I guess I’ll have to finish this by myself."
        [/message]

        [fire_event]
            name=check remaining enemies
        [/fire_event]

        {UNLOCK_VIEW}
    [/event]

    [event]
        name=die
        [filter]
            id=Tanstafaal
        [/filter]

        [message]
            speaker=Elynia
            message= _ "Rest in peace, Tanstafaal. Even if you betrayed our kinsmen, to roam the world in undeath is not a fate I would wish for anyone."
        [/message]

        [message]
            speaker=Galas
            message= _ "Their devotion to an impostor goddess has allowed them to persist in this world for centuries. It’s quite perturbing to see."
        [/message]

        [fire_event]
            name=check remaining enemies
        [/fire_event]
    [/event]

    [event]
        name=check remaining enemies
        [filter_condition]
            [have_unit]
                id=Tan Zalfargat
            [/have_unit]
            [not]
                [have_unit]
                    id=Tanstafaal,Mal Hekuba
                [/have_unit]
            [/not]
        [/filter_condition]

        [message]
            speaker=Quogar Ratham
            message= _ "Well, well, now you are finished. Your undead companions have either been smashed to dust or have fled in shame, and we have got you cornered. Any last words?"
        [/message]

        [message]
            speaker=Tan Zalfargat
            message= _ "Bah, I still stand on my feet — that is enough to defeat you! This time I will not be merciful with you or your kin!"
        [/message]
    [/event]

    [event]
        name=enemies defeated

        {ENDLEVEL_VICTORY yes}
    [/event]

    [event]
        name=victory

        [message]
            speaker=Quogar Ratham
            message= _ "So, how many more upstarts like this should I expect now that those dark cultists have infiltrated our lands? I suppose there is some value in uniting our forces under a single banner after all."
        [/message]

        [message]
            speaker=Galas
            message= _ "So you will accept the Grand Council’s proposal, then?"
        [/message]

        [message]
            speaker=Quogar Ratham
            message= _ "Of course. As long as you people honor the pact, so shall we."
        [/message]

        [message]
            speaker=Mal Keshar
            message= _ "... Pah! You are all such disgusting creatures. You and everyone else who allies with these orcs."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Galas, about that suicidal infiltration mission of yours..."
        [/message]

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

        [message]
            speaker=Elynia
            message= _ "I have decided to go with you after all. I don’t necessarily agree that your plan is a good idea, but... There is something deeply troubling about this Chaos Empire. Even though Mal Keshar is a truly powerful lich and I am sure there are many capable warriors amongst our people’s ranks, I feel there is something more to the followers of Uria than I first thought. Something... ominous."
        [/message]

        [message]
            speaker=Galas
            message= _ "Elynia, if the Chaos Emperor is after you like the lich’s words implied, I think it would be preferable if you stayed here in the north’s safety — I mean, compared to the lands of Chaos."
        [/message]

        [message]
            speaker=Elynia
            message= _ "I thought you wanted me by your side anyway, Galas, if only to provide you with useful counsel now that Anlindë is gone. Besides, what is there to stop me from following your trail after you departure?"
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Galas
            message= _ "I do need your help. I really do."
        [/message]

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

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Galas
            message= _ "And... I hope you can forgive me for not consulting you about our mission before."
        [/message]

        [message]
            speaker=Elynia
            message= _ "Oh, don’t worry. (chuckles) I have a whole eternity ahead of me to decide."
        [/message]

        [message]
            speaker=Galas
            message= _ "I... That’s not very reassuring. But I am taking that as a ‘yes’."
        [/message]

        [message]
            speaker=Elynia
            message= _ "(smiles) Just remember to trust me as you would a friend, Galas. I promise to do my very best to help you, no matter what situation you get us into."
        [/message]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Mal Keshar
            message= _ "No, I will not forgive you, Galas! I hope your death will be as painful as it will be ironic."
        [/message]
    [/event]
[/scenario]

#undef SOT_ENEMY_AI_PROTECTS_SIDE
#undef SOT_ENEMY_AI_TARGETS_ELVES
#undef SOT_SPIRIT_RECRUIT
#undef SOT_GO_BYEBYE
#undef SOT_BYEBYE_COND
#undef SOT_SET_HEKUBA_OPACITY

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