#textdomain wesnoth-dw

# This is a fairly easy level to give you a break. Go north, then lure
# wolves into the water where you can pick them off. You really should
# get a second healer leveled up here if you haven't yet. Netcasters
# and enchantresses are probably you next priorities. You'll want a
# bunch of both. There is a storm trident in the south-east. I would
# give it to a fighter. They are not very useful in this campaign, but
# they have a lot of hitpoints, so they can stay alive well. The
# trident will help him level quickly.

[scenario]
    name= _ "Wolf Coast"
    map_file=Wolf_Coast.map

    id=03_Wolf_Coast
    next_scenario=04_Slavers
    [story]
        [part]
            {DW_BIGMAP}
            story= _ "Distrustful of the open ocean, Kai Krellis led his people up the coast."
        [/part]

        [part]
            {DW_BIGMAP}
            story= _ "They had only just begun their trek when they encountered wolves who had gotten wind of the battle. Many of the wolves were ridden by goblins. The orcs of Tirigaz, chastened by Kai Laudiss’s victory, might have decided not to bother the merfolk, but these goblins were bandits and outcasts even to their own kind."
        [/part]
    [/story]

    {DW_TRACK {JOURNEY_03_NEW} }

    {DEFAULT_SCHEDULE}
    {TURNS4 20 19 18 17}

    [item]
        x=20
        y=17
        image=items/storm-trident-buried.png
    [/item]

    [side]
        {SIDE_1}
        {GOLD4 120 110 100 90}
    [/side]

    {STARTING_VILLAGES 1 6}

    [event]
        name=prestart

        [music]
            name=traveling_minstrels.ogg
        [/music]
        [music]
            name=knolls.ogg
            append=yes
        [/music]

        # wmllint: who RECALL_LOYAL_UNITS is Friendly Bat, Undead Bat, Fearsome Bat
        {RECALL_LOYAL_UNITS}

        [objectives]
            side=1
            [objective]
                description= _ "Defeat enemy leader"
                condition=win
            [/objective]

            {HOW_TO_LOSE}

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

    [side]
        side=2
        controller=ai
        user_team_name= _ "Wolf Riders"
        team_name=bad guys

        id=Gashnok
        name= _ "Gashnok"
        canrecruit=yes

#ifdef EASY
        type=Goblin Knight
        recruit=Wolf Rider, Goblin Knight
#endif

#ifdef NORMAL
        type=Goblin Knight
        recruit=Wolf Rider, Goblin Knight, Goblin Pillager
#endif

#ifdef HARD
        type=Direwolf Rider
        recruit=Wolf Rider, Goblin Knight, Goblin Pillager
#endif

#ifdef NIGHTMARE
        type=Direwolf Rider
        recruit=Wolf Rider, Goblin Knight, Goblin Pillager
#endif

        [ai]
            [goal]
                name=target
                [criteria]
                    race=monster
                [/criteria]
                value=0
            [/goal]
            [goal]
                name=target
                [criteria]
                    race=merman
                [/criteria]
                value=100
            [/goal]
            recruitment_pattern="scout, scout"
            village_value=0
        [/ai]
        # For some reason, the leader tends to go on a little
        # walkabout before recruiting anything. This [ai] tag keeps
        # him home until he's recruited for a couple rounds.
        [ai]
            turns=1-4
            passive_leader=yes
        [/ai]

        {GOLD4 150 200 250 300}
        {INCOME4 4 6 8 10}
        {FLAG_VARIANT6 ragged}
    [/side]

    [side]
        side=3
        controller=ai
        no_leader=yes
        user_team_name= _ "Wild Wolves"
        [ai]
            [goal]
                name=target
                [criteria]
                    race=merman
                [/criteria]
                value=100
            [/goal]
            [goal]
                name=target
                [criteria]
                    race=goblin
                [/criteria]
                value=0
            [/goal]
        [/ai]
    [/side]

    [event]
        name=prestart
        [unit]
            type=Wolf
            x=20
            y=24
            side=3
        [/unit]
        [unit]
            type=Wolf
            x=20
            y=25
            side=3
        [/unit]
    [/event]

    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 (Goblin Knight) 3}

#ifdef NORMAL
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 (Goblin Pillager) 2}
#endif

#ifdef HARD
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 (Goblin Pillager) 3}
#endif

#ifdef NIGHTMARE
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 (Goblin Pillager) 4}
#endif

    [event]
        name=prestart
        [unit]
            type=Goblin Knight
            x=15
            y=5
            side=2
            id=Vrunt
            name= _ "Vrunt"
            unrenamable=yes
        [/unit]
    [/event]

    [event]
        name=start

        [message]
            speaker=Gashnok
            message= _ "Smells like lots of death in the south near that merman town. Hey, Vrunt, you think the wolves like eatin’ merfish?"
        [/message]

        [message]
            speaker=Vrunt
            message= _ "Talking or not, fish are fish. Wolves’ll probably love them. Besides, look there! Some fresh ones are coming our way!"
        [/message]

        [message]
            speaker=Gashnok
            message= _ "They look mighty good to me. Might even have a taste later, myself. Let’s get ’em, boys!"
        [/message]

        [message]
            speaker=Kai Krellis
            message= _ "Beware, people!"
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes

        [filter]
            x=20
            y=17
            id=Friendly Bat,Undead Bat,Fearsome Bat
        [/filter]

        [if]
            [variable]
                name=get_trident
                not_equals=done
            [/variable]

            [then]
                [message]
                    speaker=unit
                    message= _ "Neep, neep!"
                [/message]

                [message]
                    speaker=Kai Krellis
                    message= _ "Someone go find out what is exciting the bat."
                [/message]

                [allow_undo][/allow_undo]
            [/then]
        [/if]
    [/event]

    # This event makes the storm trident even more obvious

    [event]
        name=turn 3

        [unit]
            type=Great Wolf
            variation=red
            x=20
            y=16
            side=3
            animate=yes
        [/unit]

        [message]
            speaker=Kai Krellis
            message= _ "I wonder why such a strangely colored wolf emerged from the forest over there."
        [/message]
    [/event]
    # The first_time_only moveto event causes a trident *image* to
    # show up on the hex, and causes tridents to be explained. The
    # moved unit gets the option to take it.
    #
    # If the unit takes it, a trident *object* is put on the hex, and
    # the unit gets it because he is standing there already.
    #
    # If the unit does not take it, another moveto event is
    # added. This one is *not* first_time_only. It does pretty much
    # the same thing, but with shorter messages.
    #
    # If the unit does not take the trident, an [allow_undo] is added
    # to the event.
    [event]
        name=moveto
        first_time_only=yes

        [filter]
            x=20
            y=17
            side=1
            race=merman
        [/filter]

        [message]
            speaker=unit
            message= _ "There is something sticking out of the mud here. Ah! I got it."
        [/message]

        {PLACE_IMAGE items/storm-trident.png 20 17}

        [message]
            speaker=Cylanna
            message= _ "I know what that is. It’s a storm trident. It is supposed to let you control the lightning."
        [/message]

        [message]
            speaker=narrator
            message= _ "The trident is 14×2, magical, ranged, with <i>fire</i> damage."
            image=wesnoth-icon.png
        [/message]

        [message]
            speaker=unit
            [option]
                label= _ "That sounds great! I’ll take it."
                [command]
                    [set_variable]
                        name=get_trident
                        value=yes
                    [/set_variable]
                [/command]
            [/option]
            [option]
                label= _ "That sounds frightening. Let someone else have it."
            [/option]
        [/message]

        [if]
            [variable]
                name=get_trident
                equals=yes
            [/variable]
            [then]
                {STORM_TRIDENT 20 17 trident1}
                [set_variable]
                    name=get_trident
                    value=done
                [/set_variable]
            [/then]
            [else]
                [allow_undo][/allow_undo]
                [event]
                    name=moveto
                    first_time_only=no

                    [filter]
                        x=20
                        y=17
                        side=1
                        race=merman
                    [/filter]

                    [if]
                        [variable]
                            name=get_trident
                            not_equals=done
                        [/variable]
                        [then]
                            [message]
                                speaker=unit
                                [option]
                                    label= _ "Let me have that trident. I want to control lightning!"
                                    [command]
                                        [set_variable]
                                            name=get_trident
                                            value=yes
                                        [/set_variable]
                                    [/command]
                                [/option]
                                [option]
                                    label= _ "I’ll just leave that trident where it is."
                                [/option]
                            [/message]
                        [/then]
                    [/if]

                    [if]
                        [variable]
                            name=get_trident
                            equals=yes
                        [/variable]
                        [then]
                            {STORM_TRIDENT 20 17 trident1}
                            [set_variable]
                                name=get_trident
                                value=done
                            [/set_variable]
                        [/then]
                        [else]
                            [allow_undo][/allow_undo]
                        [/else]
                    [/if]
                [/event]
            [/else]
        [/if]
    [/event]

    [event]
        name=enemies defeated

        [clear_variable]
            name=get_trident
        [/clear_variable]

        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    {HERO_DEATHS}
[/scenario]
