#textdomain wesnoth-dm
[scenario]
    id=11_Wasteland
    name=_ "Wasteland"
    {MEMOIRS_MAP 11_Wasteland.map}
    next_scenario=12_Terror_at_the_Ford_of_Parthyn
    turns=24
    disallow_recall=yes
    victory_when_enemies_defeated=no
    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC elvish-theme.ogg}   # No story part, so no intro music
    {EXTRA_SCENARIO_MUSIC the_dangerous_symphony.ogg}
    {EXTRA_SCENARIO_MUSIC elf-land.ogg}
    {EXTRA_SCENARIO_MUSIC northerners.ogg}

    {DM_TRACK {CHANTAL_STAGE1} }

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        shroud=yes
        save_id=Player
        team_name=allies
        user_team_name= _ "Loyalists"
        side_name= _ "Delfador"
        {FLAG_VARIANT long}
        [leader]
            {YOUNG_DELFADOR}
        [/leader]
        {GOLD 120 110 100}
    [/side]
    {STARTING_VILLAGES 1 6}

    [side]
        side=2
        controller=ai
        hidden=yes
        recruit=Orcish Archer,Orcish Grunt,Wolf Rider,Orcish Crossbowman,Orcish Warrior,Troll Whelp
        {GOLD 150 200 250}
        team_name=enemies
        user_team_name= _ "Pillagers"
        {FLAG_VARIANT6 ragged}
        [leader]
            id=Tish Golub
            name= _ "Tish Golub"
            type=Orcish Warlord
            facing=ne
        [/leader]
    [/side]
    {STARTING_VILLAGES 2 4}

    [side]
        side=3
        controller=ai
        hidden=yes
        # Shroud is required for share_vision to have the intended effect in the event where the player finds Chantal.
        shroud=yes
        share_vision=none
        recruit=Elvish Ranger,Elvish Rider
        {GOLD 120 110 100}
        team_name=allies
        user_team_name= _ "Elves"
        {FLAG_VARIANT wood-elvish}
        # wmllint: who CHANTAL is Chantal
        [leader]
            {CHANTAL}
            facing=sw
        [/leader]
        {NAMED_UNIT 3 (Elvish Ranger) 21 12 (Istelimir) ( _ "Istelimir") (ai_special=guardian)} {FACING se}
        {NAMED_UNIT 3 (Elvish Ranger) 33 11 (Atellas) ( _ "Atellas") (ai_special=guardian)} {FACING sw}
        [ai]
            caution=0.5
            aggression=0.0 # let player do the dirty work
        [/ai]
    [/side]
    {STARTING_VILLAGES 3 5}
    [event]
        name=prestart
        {CAPTURE_VILLAGES 3 33 11 1}
        {CAPTURE_VILLAGES 3 21 12 1}
    [/event]
    # wmllint: validate-on

    # Move hero to the starting position, and eat recall list
    [event]
        name=prestart
        [disallow_recruit]
            side=1
        [/disallow_recruit]
        {SAVE_UNDEAD_VETERANS}
        {TELEPORT_UNIT id=Delfador 33 20}
        {MODIFY_UNIT (id=Delfador) facing nw}
    [/event]

    [event]
        name=start

        [message]
            speaker=narrator
            message=_"As Delfador followed Iliah-Malal into the portal, a freezing wind sprung up and the air became thick with ghosts pouring through into the land of the living. The ground became icy underfoot, and soon Delfador was following the necromancer’s footsteps in a thick layer of snow. Eventually, even these became indistinct."
            image=wesnoth-icon.png
        [/message]
        [message]
            speaker=Delfador
            message=_"It’s hopeless, I’ve lost all track of Iliah-Malal... and I shall freeze unless I find shelter soon. Perhaps in that forest to the north..."
        [/message]

        [objectives]
            side=1
            [objective]
                description=_ "Find Delfador shelter before he freezes to death"
                condition=win
            [/objective]
            [objective]
                description=_ "Death of Delfador"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

    # Delfador first encounters the elves
    [event]
        name=sighted
        [filter]
            type=Elvish Rider,Elvish Ranger
            side=3
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [modify_side]
            side=3
            hidden=no
        [/modify_side]
        [if]
            [not]
                [have_unit]
                    id=Chantal
                    [filter_vision]
                        visible=yes
                        side=1
                    [/filter_vision]
                [/have_unit]
            [/not]
            [then]
                [message]
                    speaker=unit
                    message=_"What are you doing in our forests, stranger?"
                [/message]
                [message]
                    speaker=Delfador
                    message=_"It’s a long story... but I wonder whether I might first ask for your hospitality? I’m lost, and freezing to death here!"
                [/message]
                [message]
                    speaker=unit
                    message=_"I suppose there can be little harm in one half-frozen human... Our nearest post is to the northeast; I’ll lead you there. But we must not tarry! There are deadlier foes than the weather abroad."
                [/message]
            [/then]
        [/if]
    [/event]

    # Delfador encounters Chantal
    [event]
        name=sighted
        [filter]
            id=Chantal
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [store_unit]
            [filter]
                id=Chantal
            [/filter]
            variable=Chantal
        [/store_unit]
        [remove_shroud]
            [filter_side]
                side=1
            [/filter_side]
            x,y=$Chantal.x,$Chantal.y
            radius=3
        [/remove_shroud]
        {CLEAR_VARIABLE Chantal}

        [modify_side]
            side=2,3
            hidden=no
        [/modify_side]

        {INCIDENTAL_MUSIC love_theme.ogg}
        [message]
            speaker=Chantal
            message=_"Welcome, Delfador!"
        [/message]
        [message]
            speaker=Delfador
            # wmllint: local spelling Er
            message=_"Er, hello... you know my name, then...?"
        [/message]
        [message]
            speaker=Chantal
            message=_"Yes. I am Chantal, and I know many things. I know you come from the great human kingdom of the south and are a master of magic. You have faced great adversity and visited a place from where few hope to return, from where none before have returned unchanged. Fate is heavy upon you, and you deserve our help."
        [/message]
        [message]
            speaker=Delfador
            message=_"Oh... well... very nice of you, but I don’t feel very fated. In fact, I’ve been positively blundering! I was just trying to defend my master Methor’s school against the orcs, and then I was tasked with finding the source of the undead activity... and now I have failed at both."
        [/message]
        [message]
            speaker=Chantal
            message=_"But you have not failed. The southlands have not yet fallen to the orcish army, and have you not learned more about the undead than any man alive? It is he who fears death above all things who deceives the spirits into believing they can live again, and blinds them to the peace and rest of their own domain."
        [/message]
        [message]
            speaker=Delfador
            message=_"You mean Iliah-Malal?"
        [/message]
        [message]
            speaker=Chantal
            message=_"Yes, that is who I mean."
        [/message]
        [message]
            speaker=Delfador
            message=_"If I might ask, where am I? And what of Lionel, and King Garard? What has befallen them?"
        [/message]
        [message]
            speaker=Chantal
            message=_"You are among the North Elves, in the Lintanir Forest. Our arts hold back the winter cold within these woods. To the south and west of here lies a wasteland inhabited only by barbarians and orcs. To the south again, the Great River, and your home. Of your friends, I know nothing."
        [/message]
        [message]
            speaker=Delfador
            message=_"I am deeply grateful for your aid, Chantal. I see now what I must do... I have lost Iliah-Malal, but I must at least try to report back to the King or to Leollyn. I will set out for the south!"
        [/message]
        [if]
            [have_unit]
                id=Tish Golub
            [/have_unit]
            [then]
                [message]
                    speaker=Chantal
                    message=_"It will not be easy. The orcish army lies between here and your destination. We are under attack even here, by an orcish warband encamped in the mountains to the southwest."
                [/message]
                [message]
                    speaker=Delfador
                    message=_"Attacked by orcs? Then I might perhaps help you to defeat them, and repay your assistance and kindness!"
                [/message]
                [set_recruit]
                    recruit=Elvish Scout,Elvish Archer,Elvish Fighter,Elvish Shaman
                    side=1
                [/set_recruit]
                [modify_side]
                    side=3
                    # Originally share_maps=yes. Since player's side has fog=no, this is effectively share_vision=all.
                    share_vision=shroud
                [/modify_side]
                [objectives]
                    side=1
                    [objective]
                        description=_ "Defeat the enemy leader"
                        condition=win
                    [/objective]
                    [objective]
                        description=_ "Death of Delfador"
                        condition=lose
                    [/objective]
                    [objective]
                        description=_ "Death of Chantal"
                        condition=lose
                    [/objective]

                    {TURNS_RUN_OUT}

                    [gold_carryover]
                        bonus=yes
                        carryover_percentage=80
                    [/gold_carryover]
                [/objectives]
                [event]
                    name=die
                    [filter]
                        id=Chantal
                    [/filter]
                    [message]
                        speaker=Delfador
                        message=_"Chantal! No — you can’t be dead! I have no hope of returning to Wesnoth now..."
                    [/message]
                    [endlevel]
                        result=defeat
                    [/endlevel]
                [/event]
                [event]
                    name=die
                    [filter]
                        id=Tish Golub
                    [/filter]
                    [endlevel]
                        result=victory
                    [/endlevel]
                [/event]
            [/then]
            [else]
                [endlevel]
                    result=victory
                [/endlevel]
            [/else]
        [/if]
    [/event]

    [event]
        name=sighted
        [filter]
            side=2
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [modify_side]
            side=2
            hidden=no
        [/modify_side]
    [/event]

    [event]
        name=victory

        [message]
            speaker=Chantal
            message=_"With your help, Delfador, we have overrun the orcish warlord of this area, and our forests are secure. Secure enough that I can even join you in your journey south... at least as far as the Great River."
        [/message]

        {CHANTAL_FOLLOWS_DELFADOR}
    [/event]

#define NOCHANTALDEATH
#enddef
    {MEMOIRS_DEATHS}
#undef NOCHANTALDEATH
[/scenario]
