#textdomain wesnoth-dm
[scenario]
    name=_ "The Swamps of Illuven"
    id=06_Swamps_of_Illuven
    next_scenario=07_Night_in_the_Swamp
    {MEMOIRS_MAP 06_The_Swamps_of_Illuven.map}
    turns=28
    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC underground.ogg}    # No story part, so no intro music
    {EXTRA_SCENARIO_MUSIC traveling_minstrels.ogg}
    {EXTRA_SCENARIO_MUSIC revelation.ogg}
    {EXTRA_SCENARIO_MUSIC transience.ogg}

    {DM_TRACK {SEARCH_STAGE6}}

    [side]
        {YOUNG_DELFADOR}
        side=1
        save_id=Player
        persistent=yes
        controller=human
        recruit=Mage,Spearman,Horseman,Bowman,Cavalryman,Heavy Infantryman
        team_name=allies
        user_team_name= _ "Loyalists"
        {FLAG_VARIANT loyalist}
    [/side]
    [event]
        name=prestart

        [recall]
            id=Lionel
        [/recall]
        {MODIFY_UNIT (side=1) facing ne}
    [/event]
    {STARTING_VILLAGES 1 4}

    [side]
        type=Rogue
        id=Garrath
        name= _ "Garrath"
        facing=se
        side=2
        canrecruit=yes
        recruit=Thief,Poacher,Thug
        team_name=enemies
        user_team_name= _ "Bandits"
        {GOLD 80 100 150}
        [ai]
            villages_per_scout=15
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]
    {STARTING_VILLAGES 2 4}

    [side]
        type=Bandit
        id=Harold
        name=_ "Harold"
        facing=sw
        side=3
        canrecruit=yes
        recruit=Footpad,Poacher,Thug
        team_name=enemies
        user_team_name= _ "Bandits"
        {GOLD 80 100 150}
        [ai]
            villages_per_scout=10
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]
    {STARTING_VILLAGES 3 4}

    victory_when_enemies_defeated=no
    {MEMOIRS_VICTORY_POSITION 38 3 yes}

    {MEMOIRS_DEATHS}

    # reward for the player who defeats Garrath without paying him
    [item]
        x=4
        y=3
        image=items/chest-plain-closed.png
    [/item]

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description=_ "Move Delfador to the signpost in the northeast"
                condition=win
            [/objective]
            [objective]
                description=_ "Death of Delfador"
                condition=lose
            [/objective]
            [objective]
                description=_ "Death of Lionel"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

    [event]
        name=start
        [message]
            speaker=Lionel
            message=_"These are the swamps of Illuven — lesser kin of the Swamp of Dread north of the Great River, but noxious enough in their own fashion. Our way lies west and north across them to the Ford of Abez. The western road around the other edge of the Brown Hills would have been safer, but..."
        [/message]
        [message]
            speaker=Delfador
            message=_"... I insisted on the most direct possible route. I know; let us both hope the choice was not folly. Who made those villages in the swamps? Orcs?"
        [/message]
        [message]
            speaker=Lionel
            message=_"No, men of Wesnoth... but those who dwell here are a lawless lot."
        [/message]

        [store_gold]
            side=1
            variable=fee
        [/store_gold]
        {VARIABLE_OP fee multiply 8}
        {VARIABLE_OP fee divide 10}
        {VARIABLE_OP fee round 0}
        [message]
            speaker=Garrath
            message=_"Greetings, strangers! This swamp is dangerous... You wanna cross it, you’ll need protection — cost you only $fee gold!"
            [option]
                label=_"Thanks very much. Here’s the gold..."
                [command]
                    {VARIABLE_OP fee multiply -1}
                    [gold]
                        side=1
                        amount=$fee
                    [/gold]
                    [message]
                        speaker=Garrath
                        message=_"It’s been a pleasure doing business with you... Bye!"
                    [/message]
                    [kill]
                        side=2
                    [/kill]
                    # take his gold too
                    [remove_item]
                        x=4
                        y=3
                    [/remove_item]
                    [redraw]
                    [/redraw]
                    [delay]
                        time=500
                    [/delay]
                    [message]
                        speaker=Delfador
                        message=_"Where did he go?"
                    [/message]
                    [message]
                        speaker=Harold
                        message=_"Haw haw haw! Fools!"
                    [/message]
                    [message]
                        speaker=Lionel
                        message=_"Well, at least we only have to deal with one of them now..."
                    [/message]
                    # give the remaining enemy a boost, for balance
                    [gold]
                        side=3
                        amount=40
                    [/gold]
                [/command]
            [/option]
            [option]
                label=_"No thanks — we’ll manage by ourselves..."
                [command]
                    [message]
                        speaker=Garrath
                        message=_"You’ll regret it!"
                    [/message]
                    [message]
                        speaker=Harold
                        message=_"They certainly will! Haw haw haw!"
                    [/message]

                    [event]
                        name=moveto
                        [filter]
                            x=4
                            y=3
                            side=1
                        [/filter]

                        [sound]
                            name=open-chest.wav
                        [/sound]
                        {REMOVE_IMAGE 4 3}
                        {PLACE_IMAGE items/chest-plain-open.png 4 3}
                        [sound]
                            name=gold.ogg
                        [/sound]
                        [gold]
                            side=1
                            amount=100
                        [/gold]
                        [message]
                            speaker=unit
                            message=_"This chest contains all the money that rogue has taken from unwary travelers!"
                        [/message]
                    [/event]
                [/command]
            [/option]
        [/message]
        {CLEAR_VARIABLE fee}
    [/event]
[/scenario]
