#textdomain wesnoth-sof
[scenario]
    name= _ "Outriding the Outriders"
    id=7_Outriding_the_Outriders
    turns=12
    map_data="{campaigns/Sceptre_of_Fire/maps/7_Outriding_the_Outriders.map}"
    next_scenario=8_The_Dragon
    victory_when_enemies_defeated=no
    village_gold=0

    {SCENARIO_MUSIC "vengeful.ogg"}

    {DEFAULT_SCHEDULE}

    [side]
        id=Alanin
        type=Dragoon
        save_id=Rugnur
        side=1
        canrecruit=yes
        controller=human
        recruit=
        shroud=yes
        fog=yes
        gold=0
        income=-2
        village_gold=0
    [/side]

    [side]
        no_leader=yes
        side=2
        [ai]
            [target]
                id=Alanin
                value=1
            [/target]
            [target]
                type=Bowman,Spearman
                value=0.1
            [/target]
            [avoid]
                x=11,17,18,16,14,22
                y=5,12,20,33,28,14
            [/avoid]
            village_value=0
            aggression=1.0
            caution=0
            grouping=no
        [/ai]
    [/side]

    [story]
        [part]
            story= _ "Rugnur had fled across the Arkan-thoria, but Alanin could not do that. He went south - back to the Wesnoth border."
        [/part]
        [part]
            story= _ "The elves followed both of them. First I will tell of their pursuit of Alanin, before we descend into the caves to learn Rugnur's fate."
        [/part]
        [part]
            show_title=yes
            {TO_OUTRIDING_OF_OUTRIDERS}
        [/part]
    [/story]

    [event]
        name=prestart

        [unhide_unit]
        [/unhide_unit]

        [objectives]
            side=1
            [objective]
                description= _ "Reach the Wesnothian outpost in the south"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Alanin"
                condition=lose
            [/objective]
            [objective]
                description= _ "Time runs out"
                condition=lose
            [/objective]

            note={NO_GOLD_CARRYOVER_NOTE}
        [/objectives]
        [unit]
            x,y=1,1
            type=Galleon
            side=2
        [/unit]
    [/event]

    [event]
        name=start
        [message]
            speaker=Alanin
            message= _ "Well, the elves are behind me for now, but they will send riders to catch me, and elvish riders are faster than me."
        [/message]
        [message]
            speaker=Alanin
            message= _ "My only hope is to convince the peasants to stop the elves from passing through their land, so I can get ahead of them."
        [/message]

        [unit]
            type=Elvish Outrider
            id=Asaeri
            name= _ "Lord Asaeri"
            x,y=18,1
            side=2
            [modifications]
                {TRAIT_STRONG}
                {TRAIT_DEXTROUS}
            [/modifications]
        [/unit]
        [unit]
            type=Elvish Outrider
            id=Gaelir
            name= _ "Gaelir"
            x,y=18,1
            side=2
            [modifications]
                {TRAIT_QUICK}
                {TRAIT_DEXTROUS}
            [/modifications]
        [/unit]
        [unit]
            type=Elvish Outrider
            id=Salira
            name= _ "Salira"
            x,y=18,1
            side=2
            facing=sw
            [modifications]
                {TRAIT_STRONG}
                {TRAIT_QUICK}
            [/modifications]
        [/unit]
        [unit]
            type=Elvish Outrider
            id=Losnin
            name= _ "Losnin"
            x,y=18,1
            side=2
            facing=sw
            [modifications]
                {TRAIT_STRONG}
                {TRAIT_RESILIENT}
            [/modifications]
        [/unit]
        [unit]
            type=Elvish Outrider
            id=Ealin
            name= _ "Ealin"
            x,y=18,1
            side=2
            facing=sw
            [modifications]
                {TRAIT_QUICK}
                {TRAIT_RESILIENT}
            [/modifications]
        [/unit]
        [kill]
            type=Galleon
        [/kill]
        [scroll_to]
            x,y=18,1
        [/scroll_to]
        [message]
            speaker=Asaeri
            # wmllint: local spelling outride
            message= _ "You cannot outride us, horseman of Wesnoth! Whatever message you are carrying, it will not be delivered!"
        [/message]
        [message]
            speaker=Alanin
            message= _ "We shall see about that!"
        [/message]
    [/event]

    [event]
        name=turn 2
        [unit]
            type=Elvish Outrider
            id=Raesil
            name= _ "Raesil"
            x,y=18,1
            side=2
            [modifications]
                {TRAIT_QUICK}
                {TRAIT_RESILIENT}
            [/modifications]
        [/unit]
    [/event]

    [event]
        name=capture
        [filter]
            id=Alanin
        [/filter]
        [message]
            speaker=Alanin
            message= _ "The villagers here are loyal to Wesnoth. They should be willing to help me escape these elves!"
        [/message]
        [unit]
            type=Spearman
            id=Rolin    # wmllint: ignore
            name= _ "Rolin"
            x,y=$x1,$y1
            side=1
            random_traits=yes
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [message]
            speaker=Rolin   # wmllint: ignore
            message= _ "We will certainly help any warrior of Wesnoth who needs our help!"
        [/message]
    [/event]

    [event]
        name=capture
        first_time_only=no
        [filter]
            id=Alanin
        [/filter]

        {RANDOM "Spearman,Bowman"}

        [unit]
            type=$random
            generate_name=yes
            x,y=$x1,$y1
            side=1
            random_traits=yes
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]

        {RANDOM "Spearman,Bowman"}

        [unit]
            type=$random
            generate_name=yes
            x,y=$x1,$y1
            side=1
            random_traits=yes
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
    [/event]

    [event]
        name=moveto
        [filter]
            id=Alanin

            [filter_location]
                terrain=Ce,Ke
            [/filter_location]
        [/filter]
        [unit]
            type=Lieutenant
            id=Hadlin   # wmllint: ignore
            name= _ "Hadlin"
            x,y=10,63
            side=1
            upkeep=loyal
            random_traits=no
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [message]
            speaker=Hadlin  # wmllint: ignore
            message= _ "Who goes there?"
        [/message]
        [message]
            speaker=Alanin
            message= _ "I'm a dragoon, with Haldric II's personal bodyguard. I was sent on a mission in the northlands, and now elvish horsemen are chasing me. I barely evaded them."
        [/message]
        [message]
            speaker=Hadlin  # wmllint: ignore
            message= _ "I see. Well, come on in. I doubt they would be able to capture this fort, even if they did want to start a war, which I doubt."
        [/message]
        [store_unit]
            [filter]
                id=Alanin
            [/filter]
            variable=alanin
            kill=yes
        [/store_unit]
        [kill]
            side=1
        [/kill]
        {FOREACH dwarves i}
            {VARIABLE dwarves[$i].x "recall"}
            {VARIABLE dwarves[$i].y "recall"}

            [unstore_unit]
                variable=dwarves[$i]
            [/unstore_unit]
        {NEXT i}
        {CLEAR_VARIABLE dwarves}
        {CLEAR_VARIABLE stored_Rugnur_side}
        [endlevel]
            result=victory
            bonus=no
            {NEW_GOLD_CARRYOVER 100}
            carryover_report=no
        [/endlevel]
    [/event]
[/scenario]
