#textdomain wesnoth-low

[scenario]
    id="09_Bounty_hunters"
    name= _ "Bounty Hunters"
    {LOW_MAP 09_Bounty_Hunters.map}
    {TURNS 32 28 24}

    victory_when_enemies_defeated=no

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC northerners.ogg traveling_minstrels.ogg}
    {EXTRA_SCENARIO_MUSIC breaking_the_chains.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}

    next_scenario=10_Cliffs_of_Thoria
    [story]
        [part]
            delay=4000
            background="story/Thoria.jpeg"
            story= _ "Believing that Wesmere's seeming safety might prove a costly illusion, Kalenz and Olurf left enough troops and resources to guard it strongly before starting off on the long and dangerous trip to the great mage of Thoria. They would soon find that peril was closer than they had reckoned."
        [/part]

        [part]
            show_title=yes
            {TO_BOUNTY_HUNTERS}
        [/part]
    [/story]

    #wmllint: validate-off
    [side]
        {KALENZ}
        # wmllint: recognize Kalenz
        recruit={ELVES},{DWARVES}
    [/side]
    #wmllint: validate-on

    [side]
        type=Saurian Flanker
        id=Huurgh
        name=_ "Huurgh"
        side=2
        canrecruit=yes
        {GOLD 200 240 290}
        {INCOME 4 8 12}
        team_name=Liz
#ifdef EASY
        recruit=Saurian Augur,Saurian Skirmisher,Saurian Ambusher
#else
        recruit=Saurian Augur,Saurian Skirmisher, Saurian Oracle, Saurian Soothsayer, Saurian Flanker
#endif
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_ignore_bad_combat=yes
#ifdef EASY
            recruitment_pattern=scout,scout,healer,scout
#else
            recruitment_pattern=scout,scout,healer,archer,archer,scout
#endif
            grouping=offensive
            aggression=0.75
        [/ai]
    [/side]
    [side]
        type=Saurian Oracle
        id=Shhar
        name=_ "Shhar"
        side=3
        canrecruit=yes
        {GOLD 300 340 400}
        {INCOME 4 8 12}
        team_name=Liz
#ifdef EASY
        recruit=Saurian Augur,Saurian Skirmisher,Saurian Ambusher
#else
        recruit=Saurian Augur,Saurian Skirmisher, Saurian Oracle, Saurian Soothsayer, Saurian Flanker
#endif
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_ignore_bad_combat=yes
#ifdef EASY
            recruitment_pattern=scout,scout,healer,scout
#else
            recruitment_pattern=scout,scout,healer,archer,archer,scout
#endif
            grouping=offensive
            aggression=0.75
        [/ai]
    [/side]

    [side]
        side=4
        no_leader=yes
        team_name=creatures
        [ai]
            aggression=200.0
            caution=-100.0
            grouping=no
            [avoid]
                x=1-37,1-17,21-37, 1-5,23-37,1-3,28-37,34-37
                y= 1-2,   3,    3,   4,    4,  5,    5,    6
            [/avoid]
            [avoid]
                x=1-37
                y=12-32
            [/avoid]
            [avoid]
                x=1-4,13-17,26-37
                y= 11,   11,   11
            [/avoid]
            [avoid]
                x=9-10, 8-13,10-13,9-12,21-24,22-23,22-24
                y=   5,    6,    7,   8,    8,    9,    7
            [/avoid]
            village_value=0
        [/ai]
    [/side]

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Kalenz crosses the river"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Landar"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Cleodil"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Olurf"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]

        {RECALL_LOYALS}
        # wmllint: recognize Arkildur
        # wmllint: recognize Tameril-Isimeril
        # wmllint: recognize Laril

        [recall]
            id=Olurf # wmllint: recognize Olurf
        [/recall]

        {CHECK_LANDAR}        # wmllint: recognize Landar
        {CHECK_CLEODIL}       # wmllint: recognize CLEODIL
        {CHECK_OLURF}

        # these have been left behind to guard the Ka'lian
        [store_unit]
            variable=l3_selector_store
            kill=yes
            [filter]
                type=Elvish Marshal,Elvish Champion,Elvish Avenger,Elvish Sharpshooter
                [not]
                    id=Kalenz
                [/not]
                [not]
                    id=Landar
                [/not]
                [not]
                    id=Arkildur
                [/not]
                [not]
                    id=Tameril-Isimeril
                [/not]
                [not]
                    id=Laril
                [/not]
            [/filter]
        [/store_unit]

        [if]
            [variable]
                name=l3_selector_store.length
                numerical_equals=0
            [/variable]
            [then]
                [set_variable]
                    name=left_behind
                    value= _ "some experienced warriors"	# wmllint: ignore
                [/set_variable]
            [/then]
        [/if]

        {VARIABLE l3_length $l3_selector_store.length}
        {VARIABLE_OP l3_length add -1}
        {FOREACH l3_selector_store i}
            # for-case, what a great anti-pattern
            [switch]
                variable=i
                [case]
                    value=0
                    [set_variable]
                        name=left_behind
                        format=$l3_selector_store[$i].name
                    [/set_variable]
                [/case]
                [case]
                    value=$l3_length
                    [set_variable]
                        name=left_behind
                        format= _ "$left_behind and $l3_selector_store[$i].name"	# wmllint: ignore
                    [/set_variable]
                [/case]
                [else]
                    [set_variable]
                        name=left_behind
                        format= _ "$left_behind|, $l3_selector_store[$i].name"	# wmllint: ignore
                    [/set_variable]
                [/else]
            [/switch]
        {NEXT i}
        {CLEAR_VARIABLE l3_length}
    [/event]

    [event]
        name=start

        [message]
            id=Huurgh
            # wmllint: local spelling Yesss
            message= _ "Yesss! It's the elves who stole our gold! The bounty is mine!"
        [/message]
        [message]
            id=Shhar
            message= _ "I saw them first, fool! The bounty is all mine."
        [/message]
        [message]
            id=Olurf
            message= _ "What are they talking about?"
        [/message]
        [message]
            id=Landar
            message= _ "It would seem the saurians put a bounty on our heads for having the effrontery to take our gold back after they stole it. Are you interested?"
        [/message]
        [message]
            id=Olurf
            message= _ "No, but my axe is interested in some saurian heads! They ha' been too friendly with the orcs for my liking!"
        [/message]
        [message]
            id=Kalenz
            message= _ "Remember, we are here on a mission. We will fight these saurians if we must, but our mission is to get to Thoria."
        [/message]
        [message]
            id=Olurf
            message= _ "Crossing the river without a bridge? We dwarves know water is a very dangerous thing!"
        [/message]
        [message]
            id=Kalenz
            message= _ "Indeed, this river is, I believe, Arkan-Thoria. There are fell legends about it. May be they are but children's tales...still, be very careful when you cross it."
        [/message]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "Before Kalenz left the Ka'lian he had ordered $left_behind to stay and guard it. Kalenz is from now on able to recruit Dwarves."
        [/message]

        {CLEAR_VARIABLE left_behind}
    [/event]

    [event]
        name=moveto
        [filter]
            x=1-37,1-17,21-37, 1-5,23-37,1-3,28-37,35-37
            y= 1-2,   3,    3,   4,    4,  5,    5,    6
            id=Kalenz
        [/filter]
        [message]
            speaker=unit
            message= _ "We made it. Onwards to Thoria!"
        [/message]
        [message]
            id=Olurf
            message= _ "At last!"
        [/message]
        [message]
            id=Landar
            message= _ "We'll need to settle things with these saurians once and for all!"
        [/message]

        [endlevel]
            result=victory
            bonus=yes
        [/endlevel]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=1-37
            y=6-9
        [/filter]

        {RANDOM_PLACEMENT 32 7 1 (
            [unit]
                type=Sea Serpent
                id=Sealurr
                name= _ "Sealurr"
                side=4
                [modifications]
                    {TRAIT_RESILIENT}
                    {TRAIT_STRONG}
                [/modifications]
            [/unit]
        ) }

        [message]
            speaker=unit
            message= _ "The legends are true! Sea creatures are upon us!"
        [/message]

        [scroll_to_unit]
            id=Sealurr
        [/scroll_to_unit]

        {RANDOM_PLACEMENT 3 8 2 (
            [unit]
                type=Cuttle Fish
                id=Kallub
                name= _ "Kallub"
                side=4
                [modifications]
                    {TRAIT_RESILIENT}
                    {TRAIT_STRONG}
                [/modifications]
            [/unit]
        ) }

        [message]
            speaker=unit
            message= _ "They are coming at us from all sides!"
        [/message]

        [scroll_to_unit]
            id=Kallub
        [/scroll_to_unit]

#ifndef EASY
        {RANDOM_PLACEMENT 3 9 2 (
            [unit]
                type=Sea Serpent
                id=Scardeep
                name= _ "Scardeep"
                side=4
                [modifications]
                    {TRAIT_RESILIENT}
                    {TRAIT_STRONG}
                [/modifications]
            [/unit]
        ) }

        [message]
            speaker=unit
            message= _ "Watch for the Serpent!"
        [/message]

        [scroll_to_unit]
            id=Scardeep
        [/scroll_to_unit]

        {RANDOM_PLACEMENT 16 6 2 (
            [unit]
                type=Cuttle Fish
                id=Kalimar
                name= _ "Kalimar"
                side=4
                [modifications]
                    {TRAIT_RESILIENT}
                    {TRAIT_STRONG}
                [/modifications]
            [/unit]
        ) }

        [scroll_to_unit]
            id=Kalimar
        [/scroll_to_unit]
#endif

#ifdef HARD
        {RANDOM_PLACEMENT 34 8 1 (
            [unit]
                type=Cuttle Fish
                id=Alkamar
                name= _ "Alkamar"
                side=4
                [modifications]
                    {TRAIT_RESILIENT}
                    {TRAIT_STRONG}
                [/modifications]
            [/unit]
        ) }

        [scroll_to_unit]
            id=Alkamar
        [/scroll_to_unit]
#endif
    [/event]

    {@campaigns/Legend_of_Wesmere/utils/deaths.cfg}
[/scenario]
