#textdomain wesnoth-dm
[scenario]
    name=_ "The Swamps of Illuven"
    id=06_swamps_of_illuven
    next_scenario=07_night_in_the_swamp
    {MEMOIRS_MAP swamp.map}
    #TODO differentiate the difficult levels
    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}

    [story]
        [part]
            delay=4000
            show_title=yes
            {TO_SWAMPS_OF_ILLUVEN}
        [/part]
    [/story]

    [side]
        {YOUNG_DELFADOR}
        type=Journeyman Mage
        canrecruit=yes
        recruit=Mage,Spearman,Horseman,Bowman,Cavalryman,Heavy Infantryman
        team_name=goodies
        user_team_name= _ "Player"
    [/side]
    [event]
        name=prestart
        {RECALL_OR_CREATE_UNIT {LIONEL} Lionel}
        # wmllint: recognize Lionel
    [/event]
    {STARTING_VILLAGES 1 4}

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

    [side]
        type=Bandit
        id=Harold
        name=_ "Harold"
        side=3
        canrecruit=yes
        recruit=Footpad,Poacher,Thug
        team_name=baddies
        user_team_name= _ "Enemies"
        {GOLD 80 100 150}
        [ai]
            villages_per_scout=10
        [/ai]
    [/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.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]
            [objective]
                description=_ "Time runs out"
                condition=lose
            [/objective]
            note={EARLY_FINISH_BONUS_NOTE}
        [/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}
        [message]
            speaker=Garrath
            message=_"Greetings, strangers! This swamp is dangerous... You wanna cross it, you'll need protection - cost you only $fee gold!"
            [option]
                message=_"Thanks very much. Here's the gold..."
                [command]
                    {VARIABLE_OP fee multiply -1}
                    [gold]
                        side=1
                        amount=$fee
                    [/gold]
                    [set_variable]
                        name=bought_protection
                        value=1
                    [/set_variable]
                    [message]
                        speaker=Garrath
                        message=_"It's been a pleasure doing business with you... Bye!"
                    [/message]
                    [kill]
                        side=2
                    [/kill]
                    # take his gold too
                    [removeitem]
                        x=4
                        y=3
                    [/removeitem]
                    [redraw]
                    [/redraw]
                    [delay]
                        time=500
                    [/delay]
                    [message]
                        speaker=Delfador
                        message=_"Where did he go?"
                    [/message]
                    [message]
                        speaker=Harold
                        message=_"Haw haw haw! Suckers!"
                    [/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]
                message=_"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]
                        #TODO add the gold sound effect
                        [gold]
                            amount=100
                        [/gold]
                        [message]
                            speaker=unit
                            message=_"This chest contains all the money that rogue has taken from unwary travelers!"
                        [/message]
                        [removeitem]
                            x=4
                            y=3
                        [/removeitem]
                    [/event]
                [/command]
            [/option]
        [/message]
        {CLEAR_VARIABLE fee}
    [/event]
[/scenario]
