#textdomain wesnoth-ei
[scenario]
    id=The_Outpost
    name= _ "The Outpost"
    map_data="{campaigns/Eastern_Invasion/maps/The_Outpost.map}"
    turns=16
    {campaigns/Eastern_Invasion/utils/intro.cfg}

    {DEFAULT_SCHEDULE}

    next_scenario=Escape_Tunnel

    {DEFAULT_MUSIC_PLAYLIST}
    {VICTORY_AND_DEFEAT_MUSIC}

    {campaigns/Eastern_Invasion/utils/deaths.cfg}

    [side]
        type=Sergeant
        description=Gweddry
        user_description= _ "Gweddry"
        side=1
        canrecruit=yes
        recruit=Spearman,Cavalryman,Mage,Heavy Infantryman
        controller=human
        profile=portraits/gweddry.png
        {GOLD 180 130 80}
        [unit]
            type=White Mage
            description=Dacyn
            user_description= _ "Dacyn"
            {IS_HERO}
            side=1
            x=9
            y=16
            profile=portraits/dacyn.png
        [/unit]
    [/side]

    # The intent here is that Gweddry starts with control of all
    # villages west of the river (e.g. within Wesnoth) and those very
    # close to the outpost east of the river. This will be worth
    # about unit-build per turn. But he won't keep all of these
    # for long...
    {STARTING_VILLAGES 1 9}
    {STARTING_VILLAGES_AREA 1 15 2 7}
    {STARTING_VILLAGES_AREA 1 5 4 4}

#define OUTPOST_AI_STUFF
    [ai]
        passive_leader=yes
        grouping=no
        aggression=0.6
    [/ai]
#enddef

    [side]
        type=Dark Sorcerer
        description=Mal-Sakkat
        user_description= _ "Mal-Sakkat"
        side=2
        canrecruit=yes
        facing=sw
#ifdef EASY
        recruit=Walking Corpse,Skeleton Archer
#else
        recruit=Walking Corpse,Skeleton,Skeleton Archer
#endif
        [ai]
            recruitment_pattern=fighter, fighter, archer, fighter
        [/ai]
        team_name=undead
        {GOLD 40 60 120}
        {OUTPOST_AI_STUFF}
    [/side]

    {STARTING_VILLAGES 2 5}

    [side]
        type=Dark Sorcerer
        description=Mal-Talar
        user_description= _ "Mal-Talar"
        facing=sw
#ifdef EASY
        recruit=Vampire Bat,Skeleton Archer
#else
        recruit=Vampire Bat,Skeleton,Skeleton Archer
#endif
        side=3
        canrecruit=yes

        team_name=undead
        {GOLD 50 70 140}
        {OUTPOST_AI_STUFF}
    [/side]

    {STARTING_VILLAGES 3 5}

    [side]
        type=Lich
        description=Mal-Uldhar
        user_description= _ "Mal-Uldhar"
        facing=sw
#ifdef EASY
        recruit=Vampire Bat,Revenant
#else
        recruit=Vampire Bat,Revenant,Bone Shooter
#endif
        side=4
        canrecruit=yes
        team_name=undead
        {GOLD 80 110 180}
        {OUTPOST_AI_STUFF}
    [/side]

    {STARTING_VILLAGES 4 8}

    [event]
        name=prestart

        # {SCATTER_IMAGE (terrain=Gs^Fp) 20 scenery/pine1.png}
        # {SCATTER_IMAGE (terrain=Gg) 4 scenery/oak-leaning.png}

        [objectives]
            side=1
            [objective]
#ifdef EASY
                description= _ "Resist until Dacyn's return tomorrow night"
#else
                description= _ "Resist until Dacyn's return in two days"
#endif
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Gweddry"
                condition=lose
            [/objective]
        [/objectives]
#ifdef EASY
        [terrain]
            x,y=4,13
            terrain=Gg
        [/terrain]
        [terrain]
            x,y=5,14
            terrain=Gg^Ve
        [/terrain]
#endif
    [/event]

    #start event
    [event]
        name=start
        [message]
            description=Gweddry
            message= _ "What? What is going on?"
        [/message]
        [message]
            description=Dacyn
            message= _ "Look. To the east. Undead approach! But wait... I sense something... They cannot see me..."
        [/message]
        [kill]
            description=Dacyn
        [/kill]
        [move_unit_fake]
            type=Ancient Lich
            side=1
            x=39,34
            y=16,14
        [/move_unit_fake]
        [unit]
            type=Ancient Lich
            description=Mal-Ravanal
            user_description= _ "Mal-Ravanal"
            x,y=34,14
            side=1
            facing=sw
            profile=portraits/mal-ravanal.png
        [/unit]
        [message]
            description=Mal-Ravanal
            profile=portraits/mal-ravanal.png
            message= _ "Hm. I do not sense anything out of the ordinary here. My scouts must have deceived me. Very well; destroy them."
        [/message]
        [message]
            description=Mal-Sakkat
            message= _ "Very well, Dark Archon. They will die. And then?"
        [/message]
        [message]
            description=Mal-Ravanal
            profile=portraits/mal-ravanal.png
            message= _ "On with the search. I trust you can defeat these men yourself? I have no time to waste here."
        [/message]
        [kill]
            description=Mal-Ravanal
        [/kill]
        [move_unit_fake]
            type=Ancient Lich
            side=1
            x=34,39
            y=14,16
        [/move_unit_fake]
        [message]
            description=Gweddry
            message= _ "What?! Men, to arms! And where did Dacyn go?!"
        [/message]
        [message]
            description=Gweddry
            message= _ "There are too many undead, I cannot defeat them... but my orders are to hold this outpost at all costs. It may be we will die this day."
        [/message]
        [message]
            description=Gweddry
            message= _ "But... somehow, I do not think Dacyn has abandoned us. He must have had a reason for leaving."
        [/message]
    [/event]

    #Dacyn pops out on keep and gives message about trapdoor.
    [event]
#ifdef EASY
        name=turn 10
#else
        name=turn 12
#endif
        [unit]
            type=White Mage
            description=Dacyn
            user_description= _ "Dacyn"
            {IS_HERO}
            side=1
            x=9
            y=16
            profile=portraits/dacyn.png
        [/unit]
        [message]
            description=Dacyn
            message= _ "Gweddry? Good! You are still alive. Quickly, we must leave this place!"
        [/message]
        [message]
            description=Gweddry
            message= _ "Where did you go?! And where did you come from?"
        [/message]
        [message]
            description=Dacyn
            message= _ "There is no time to explain. If you wish to survive, you will escape through this trapdoor."
        [/message]
        [message]
            description=Gweddry
            message= _ "But what about the outpost?"
        [/message]
        [message]
            description=Dacyn
            message= _ "It is pointless to try to defend it. Now, come on, we do not have much time to spare!"
        [/message]
        [objectives]
            side=1
            [objective]
                description= _ "Move Gweddry to the trapdoor"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Gweddry"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Dacyn"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]
        #you win when you move to the trapdoor
        [item]
            x=9
            y=16
            image=scenery/trapdoor-open.png
        [/item]
        [event]
            name=moveto
            [filter]
                x=9
                y=16
                description=Gweddry
            [/filter]
            [message]
                description=Gweddry
                message= _ "Follow me, men! Through the trapdoor!"
            [/message]
            [endlevel]
                result=victory
                bonus=yes
            [/endlevel]
        [/event]
    [/event]

    #you are urged to hurry
    [event]
        name=turn 14
        [message]
            description=Dacyn
            message= _ "Hurry! Before long enemy reinforcements will arrive, and we will all die! Go to the trapdoor!"
        [/message]
    [/event]
[/scenario]
