#textdomain wesnoth-dm
[scenario]
    id=14_shadows
    name= _ "Shadows in the dark"
    next_scenario=15_save_the_king
    {MEMOIRS_MAP shadows.map}
    {TURNS 32 28 24}
    #    {TURNS 24 28 32}

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC the_deep_path.ogg underground.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}
    {EXTRA_SCENARIO_MUSIC legends_of_the_north.ogg}
    {EXTRA_SCENARIO_MUSIC frantic.ogg}

    [story]
        [part]
            story= _ "Kalenz and his troops fared swiftly south and then westward along the north bank of the Great River. They successfully evaded the orcs, but would soon find there were grimmer foes awaiting them."
            delay=4000
        [/part]
        [part]
            show_title=yes
            {TO_SHADOWS}
        [/part]
    [/story]

    #wmllint: validate-off
    [side]
        {KALENZ}
        # wmllint: recognize Kalenz
        recruit={ELVES}
        fog=yes
    [/side]
    #wmllint: validate-on

    [side]
        type=Death Knight
        id=Rudimil
        name= _"Rudimil"

        side=2
        canrecruit=yes
        controller=ai
        team_name=undead
        recruit=Skeleton,Skeleton Archer
        {GOLD 120 170 180}
        {INCOME 0 2 2}
        [ai]
            recruitment_pattern=fighter,archer
            [target]
                id=Kalenz
                value=10
            [/target]
        [/ai]
    [/side]

    [side]
        type=Necromancer
        id=Roth-Malal
        name=_ "Roth-Malal"
        side=3
        canrecruit=yes
        controller=ai
        recruit=Vampire Bat,Dark Adept,Walking Corpse,Ghost,Soulless
        [ai]
            recruitment_pattern=scout,fighter,archer
        [/ai]
        team_name=undead
        {GOLD 120 200 250}
    [/side]

    [side]
        type=Necromancer
        id=Barth-Malal
        name=_ "Barth-Malal"
        #TODO find a portrait for barthmalal or remove this line
        #        profile="portraits/barthmalal.png"
        side=4
        team_name=undead
        controller=ai

        {GOLD 50 90 170}
        {INCOME 1 2 4}

        canrecruit=yes
        [ai]
            recruitment_pattern=scout,fighter,archer
            aggression=0.2
        [/ai]

#ifdef EASY
        recruit=Skeleton, Skeleton Archer, Vampire Bat
#endif

#ifdef NORMAL
        recruit=Skeleton, Revenant, Skeleton Archer, Bone Shooter, Ghost, Vampire Bat, Blood Bat, Chocobone, Dark Adept
#endif

#ifdef HARD
        recruit=Skeleton, Skeleton Archer, Revenant, Draug, Banebow, Bone Shooter, Deathblade, Ghost, Wraith, Shadow, Nightgaunt, Chocobone, Dark Adept, Spectre, Blood Bat, Vampire Bat
#endif
    [/side]

    [event]
        name=prestart

        [recall]
            id=Chantal
        [/recall]

        [objectives]
            side=1
            [objective]
                description= _ "Defeat all enemy leaders"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Chantal"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
            note={EARLY_FINISH_BONUS_NOTE}
        [/objectives]

        {OBJ_POTION_HOLY 16 5  shadows_holywater1}
        {OBJ_POTION_HOLY 32 5  shadows_holywater2}
        {OBJ_POTION_HOLY 20 10 shadows_holywater3}
    [/event]

    [event]
        name=start

        [message]
            id=Kalenz
            message= _ "This forest looks quiet - too quiet. Proceed carefully, I don't like this at all."
        [/message]
    [/event]
    [event]
        name=turn 2
        [message]
            id=Barth-Malal
            message= _ "Living... Soon, you'll be more troops for my master!"
        [/message]
        [message]
            id=Kalenz
            message= _ "Undead! Where did they come from?"
        [/message]
        [message]
            id=Chantal
            message= _ "We should try to go west. I sense things are worse on the eastern front."
        [/message]
    [/event]
    [event]
        name=turn 8
        [unit]
            id=Nameless
            name=_ "Nameless"
            type=Spectre
            side=2
            x=51
            y=1
        [/unit]
        [unit]
            id=Hraul
            name=_ "Hraul"
            type=Spectre
            side=2
            x=51
            y=2
        [/unit]
        [unit]
            id=Atrag
            name=_ "Atrag"
            type=Draug
            side=2
            x=51
            y=3
        [/unit]
        [unit]
            id=Horr
            name=_ "Horr"
            type=Banebow
            side=2
            x=51
            y=4
        [/unit]
        [unit]
            id=Nfrigt
            name=_ "Nfrigt"
            type=Nightgaunt
            side=2
            x=50
            y=4
        [/unit]
        [unit]
            id=Rkrin
            name=_ "Rkrin"
            type=Revenant
            side=2
            x=50
            y=3
        [/unit]
        [message]
            id=Rudimil
            message= _ "We have more help!"
        [/message]
    [/event]

    [event]
        name=turn 11
        [unit]
            id=Haunt
            name=_ "Haunt"
            type=Spectre
            side=2
            x=51
            y=16
        [/unit]
        [unit]
            id=Gdal
            name=_ "Gdal"
            type=Spectre
            side=2
            x=51
            y=17
        [/unit]
        [unit]
            id=Oltr
            name=_ "Oltr"
            type=Draug
            side=2
            x=50
            y=16
        [/unit]
        [unit]
            id=Orbl
            name=_ "Orbl"
            type=Deathblade
            side=2
            x=50
            y=17
        [/unit]
        [unit]
            id=Nifigt
            name=_ "Nifigt"
            type=Nightgaunt
            side=2
            x=49
            y=16
        [/unit]
        [unit]
            id=Dert
            name=_ "Dert"
            type=Deathblade
            side=2
            x=49
            y=17
        [/unit]

        [message]
            id=Rudimil
            message= _ "And now even more help!"
        [/message]
    [/event]

    #wmllint: recognize Delfador
    [event]
        name=delfador

        {DELFADOR_REAPPEARS 50 19}
    [/event]

    [event]
        name=turn 12

        [fire_event]
            name=delfador
        [/fire_event]

        [message]
            id=Delfador
            message= _ "Foul creatures, it is time for your final rest!"
        [/message]
        [message]
            id=Chantal
            message= _ "That is Delfador. Do you see, now?"
        [/message]
        [message]
            id=Kalenz
            message= _ "I do. He is a like a blazing fire to my inner eye. I think you have chosen well, granddaughter; he is indeed the one to whom the Book of Crelanu should pass."
        [/message]
        [message]
            id=Chantal
            message= _ "If I were human, I think I would be in love with him."
        [/message]
        [message]
            id=Kalenz
            message= _ "If you were human, you would be quite right to be. Strange...they are such surly children in the main, short-lived and crude and quarrelsome. And yet, even our greatest mystics do not shine so brightly as this one."
        [/message]
        [message]
            id=Chantal
            message= _ "I hope the Book does not destroy him."
        [/message]
        [message]
            id=Kalenz
            message= _ "You speak my thought, granddaughter. May it be so."
        [/message]

        [objectives]
            side=1
            [objective]
                description= _ "New Objective: Defeat all enemies"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Delfador"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Chantal"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=38-52
            y=1-5
        [/filter]

        [if]
            [variable]
                name=turn_number
                less_than=12
            [/variable]
            # do not allow an elvish victory before Delfador shows up
            # TODO maybe we should do this in a more deterministic way...
            [then]
                [unit]
                    id=Krumful
                    name=_ "Krumful"
                    type=Draug
                    side=2
                    x=42
                    y=3
                [/unit]
                [unit]
                    id=Unhul
                    name=_ "Unhul"
                    type=Spectre
                    side=2
                    x=42
                    y=2
                [/unit]
            [/then]
        [/if]
    [/event]

    [event]
        name=victory

        ## In case we won before Delfador's time to show up...
        [if]
            [not]
                [have_unit]
                    id=Delfador
                [/have_unit]
            [/not]

            [then]
                [fire_event]
                    name=delfador
                [/fire_event]
                [message]
                    id=Delfador
                    message= _ "I arrive too late for the entertainment, it would seem."
                [/message]
            [/then]
        [/if]

        [message]
            id=Kalenz
            message= _ "Well met, Delfador. Chantal has told me of you. I am Kalenz, High Lord of the Elves, and we are in your debt today."
        [/message]
        [message]
            id=Delfador
            message= _ "It is my honor to meet you. And it relieves my mind to know Chantal is safe and with her kin again."
        [/message]
        [message]
            id=Chantal
            message= _ "I am not sure there is safety for anyone in these days, but we all travel the same road and face the same foes."
        [/message]
        [message]
            id=Kalenz
            message= _ "Yes. We will follow you to the Ford of Abez, Delfador. Let us hope we are not too late to prevent an orcish victory there."
        [/message]

        {DELFADOR_TAKES_CONTROL}
    [/event]

    {MEMOIRS_DEATHS}
[/scenario]
