#textdomain wesnoth-httt
[scenario]
    id=11_The_Ford_of_Abez
    name= _ "The Ford of Abez"
    map_data="{campaigns/Heir_To_The_Throne/maps/11_The_Ford_of_Abez.map}"
    {SCENARIO_MUSIC "loyalists.ogg"}
    {EXTRA_SCENARIO_MUSIC "revelation.ogg"}
    {TURNS 27 24 21}

    {DEFAULT_SCHEDULE}

    next_scenario=12_Northern_Winter

    {BIGMAP_FORD_OF_ABEZ}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Move Konrad to the north side of the river"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Konrad"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Delfador"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]

            note={EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
        [/objectives]
    [/event]

    [side]
        type=Commander
        id=Konrad
        name= _ "Konrad"
        unrenamable=yes
        side=1
        canrecruit=yes
        team_name=elves
        user_team_name=_"Rebels"
        controller=human
        gold=200
    [/side]

    {STARTING_VILLAGES 1 5}

    [side]
        type=Princess
        id="Li'sar"
        name= _ "Li'sar"
        side=2
        canrecruit=yes
        recruit=Cavalryman,Swordsman,Spearman,Red Mage,Ogre,Duelist
        [ai]
            {ATTACK_DEPTH 4 5 5}
            recruitment_pattern=scout,fighter,fighter,fighter,mixed fighter
            aggression=1.0
            caution=-5.0
            grouping=no
            leader_value=100
        [/ai]
        gold=200
        income=50
        team_name=bad
        user_team_name=_"Asheviere"
    [/side]

    {STARTING_VILLAGES 2 5}

    [side]
        type=Orcish Warlord
        id=Gaga-Breuk
        name= _ "Gaga-Breuk"
        side=3
        canrecruit=yes
        team_name=orcs
        user_team_name=_"Orcs"
#ifdef EASY
        recruit=Orcish Warrior,Orcish Crossbowman,Wolf Rider
#endif

#ifdef NORMAL
        recruit=Orcish Warrior,Orcish Crossbowman,Goblin Knight
#endif

#ifdef HARD
        recruit=Orcish Warrior,Orcish Crossbowman,Blood Bat
#endif

        {GOLD 140 200 260}
        [ai]
            {ATTACK_DEPTH 4 5 5}
            aggression=1.0
            caution=-4.0
            grouping=no
            recruitment_pattern=scout,fighter,fighter,archer

            leader_value=100

            #target Konrad especially heavily
            [target]
                id=Konrad
                value=100
            [/target]
        [/ai]
    [/side]

    {STARTING_VILLAGES 3 5}

    [side]
        side=4
        no_leader=yes
        team_name=creature
        user_team_name=_"Monsters"
        [ai]
            aggression=1.0
            caution=-4.0
            grouping=no
            [avoid]
                x=1-100
                y=21-100
            [/avoid]
            [avoid]
                x=1-100
                y=1-12
            [/avoid]
            #target Konrad especially heavily
            [target]
                id=Konrad
                value=100
            [/target]
            village_value=0
        [/ai]
    [/side]

    {OBJ_TRIDENT_STORM 16 17 ford_trident}

#define FORD_GUARD X Y
    [unit]
        type=Royal Guard
        generate_name=yes
        ai_special=guardian
        x={X}
        y={Y}
        side=2
        [modifications]
            {TRAIT_LOYAL}
        [/modifications]
    [/unit]
#enddef

    [event]
        name=prestart

        # {SCATTER_IMAGE (terrain=Gg) 12 scenery/pine1.png}

        {FORD_GUARD 7 27}
        {FORD_GUARD 6 28}
        {FORD_GUARD 6 25}
        {FORD_GUARD 4 25}
        {FORD_GUARD 3 27}
        {FORD_GUARD 4 28}

        [recall]
            id=Delfador
        [/recall]
        [recall]
            id=Kalenz
        [/recall]
    [/event]

    [event]
        name=start
        [message]
            speaker=Delfador
            message= _ "This is the Ford of Abez. When we ford this river, we will be leaving Wesnoth, and entering the lands of the North. The dwarves once ruled these lands, but they are now filled only with chaos. This is where your father and uncle were betrayed, almost nineteen years ago now, Konrad."
        [/message]
        [message]
            speaker=Konrad
            message= _ "Really? So what happened, Delfador?"
        [/message]
        [message]
            speaker=Delfador
            message= _ "The forces of the king were encamped here, and the forces of the north were on the north side of the river. For three days and three nights the armies faced each other, neither willing to ford the river. On the fourth day, the northern armies crossed and attacked us."
        [/message]
        [message]
            speaker=Konrad
            message= _ "And then... we were defeated?"
        [/message]
        [message]
            speaker=Delfador
            message= _ "We were winning the battle. We were repelling them..."
        [/message]
        [message]
            speaker=Kalenz
            message= _ "And then the king's son, in the heat of battle, turned upon the king!"
        [/message]
        [message]
            speaker=Konrad
            message= _ "But you avenged the murder. You killed the prince. Right, Delfador?"
        [/message]
        [message]
            speaker=Delfador
            message= _ "When I saw the king betrayed and his banner fallen, I fled the battle. I know not now whether it was wisdom or cowardice, but I did flee, seeing no further hope on that day."
        [/message]
        [message]
            speaker=Konrad
            message= _ "Oh, but the elves always told me that you killed the prince, Delfador, even though you never talked about it."
        [/message]
        [message]
            speaker=Delfador
            message= _ "That foolish boy killed himself."
        [/message]
        [message]
            speaker=Konrad
            message= _ "What do you mean?"
        [/message]
        [message]
            speaker=Delfador
            message= _ "I mustered men to fight against the traitor-king, and of course Asheviere too, for she was behind it all. We met them; not here, but on the road from Weldyn, at Tath. We were outnumbered, perhaps four to one. In the heat of battle, that boy, fool that he was, came charging at me, slashing wildly. I had little choice but to end his life."
        [/message]
        [message]
            speaker=Konrad
            message= _ "So it is true, you did kill him?"
        [/message]
        [message]
            speaker=Delfador
            message= _ "He did die in battle at my hand. It is sad that your brothers did not have the opportunity to experience such an honorable death, Konrad."
        [/message]
        [message]
            speaker=Kalenz
            message= _ "With all respect, my lords, we must make haste. We have to ford the river immediately. And, look! It seems that the guard-towers on the river banks are manned!"
        [/message]
        [message]
            speaker=Gaga-Breuk
            image=portraits/orcs/warlord2.png
            message= _ "Look! Some of the southerners, men of Wesnoth, are trying to cross into our lands! We will slaughter them by the river's edge!"
        [/message]
        [message]
            speaker=Konrad
            message= _ "Isn't there somewhere else we can cross? Maybe upstream?"
        [/message]
        [message]
            speaker=Delfador
            message= _ "Winter quickly bears down upon us. We have only a few days to make the crossing, and the nearest bridge is far upstream. To be trapped south of the river when winter arrives would be suicide. Asheviere would have us trapped like rats! Look to the west! Asheviere has a border fort, and it seems to be full of soldiers! We must cross here, and quickly!"
        [/message]
        [message]
            speaker="Li'sar"
            message= _ "There they are! So it is true, they foiled the undead. Now they are trying to leave Wesnoth. We can't let them cross the river. After them, men!"
        [/message]

        [if]
            [variable]
                name=get_gryphons
                numerical_equals=1
            [/variable]
            [then]
                [message]
                    speaker=Konrad
                    message= _ "Not her again! We must hurry! Do not forget to bring the gryphon eggs. They must be allowed more time to hatch. Quickly!"
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Konrad
                    message= _ "Not her again! Quickly! We must hurry!"
                [/message]
            [/else]
        [/if]
        [set_variable]
            name=lisar_still_here
            value=1
        [/set_variable]
    [/event]

    #if the players marches over to Li'sar's keep, reinforcements appear
    [event]
        name=moveto
        [filter_second]
            side=1
            x=0-16
            y=23,34
        [/filter_second]
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
        {FORD_GUARD 1 29}
    [/event]

    #getting closer --> more reinforcements
    [event]
        name=moveto
        [filter_second]
            side=1
            x=2-9
            y=24,30
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "Stop! You shall not pass! Quick, reinforcements, protect the Princess!"
        [/message]
        {FORD_GUARD 1 27}
        {FORD_GUARD 1 27}
        {FORD_GUARD 1 27}
        {FORD_GUARD 1 27}
        {FORD_GUARD 1 27}
        {FORD_GUARD 1 27}
    [/event]

    #if the player dares attack Li'sar's escort, they are pounced on by
    #many Royal Guards
    [event]
        name=attack
        [filter_second]
            type=Royal Guard
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "Stop! You shall not pass! Quick, reinforcements, protect the Princess!"
        [/message]
        {FORD_GUARD 5 27}
        {FORD_GUARD 5 27}
        {FORD_GUARD 5 27}
        {FORD_GUARD 5 27}
        {FORD_GUARD 5 27}
        {FORD_GUARD 5 27}
    [/event]

    # Defeating Li'sar just sends her away
    [event]
        name=die
        [filter]
            id="Li'sar"
        [/filter]
        [message]
            speaker="Li'sar"
            message= _ "You drive me from the field, but you have not vanquished me, impostor!"
        [/message]
        [set_variable]
            name=lisar_still_here
            value=0
        [/set_variable]
    [/event]

    [event]
        name=turn 5

        {NAMED_LOYAL_UNIT 4 (Sea Serpent) 1 15 (Sea Serpent) ( _ "Sea Serpent")}

#define SEA_CREATURE
    {NAMED_LOYAL_UNIT 4 (Cuttle Fish) 1 15 (Cuttle Fish) ( _ "Cuttle Fish")}
#enddef

        {SEA_CREATURE}
        {SEA_CREATURE}
        {SEA_CREATURE}

#ifdef NORMAL
        {SEA_CREATURE}
        {SEA_CREATURE}
#endif

#ifdef HARD
        {SEA_CREATURE}
        {SEA_CREATURE}
        {SEA_CREATURE}
        {SEA_CREATURE}
#endif
        [message]
            type=Sea Serpent
            message= _ "Ruaarrrrrrrr!"	# wmllint: no spellcheck
        [/message]
        [message]
            speaker=Konrad
            message= _ "What is that?"
        [/message]
        [message]
            speaker=Kalenz
            message= _ "Creatures of the deep are upon us! This may be very dangerous. Be quick! We must get to the other side with all haste!"
        [/message]
    [/event]

    #moving Konrad to the other shore
    [event]
        name=moveto
        [filter]
            id=Konrad
            x=1-44
            y=1-8
        [/filter]

        [message]
            speaker=Konrad
            message= _ "We made it across the river safely! Where to now?"
        [/message]

        [message]
            speaker=Delfador
            message= _ "If we are to have any hope of penetrating into Knalga, we must continue north to seek help from the Dwarves of the Heart Mountains in the north."
        [/message]

        [if]
            [variable]
                name=lisar_still_here
                numerical_equals=1
            [/variable]
            [then]
                [message]
                    speaker="Li'sar"
                    message= _ "I cannot believe it. They have made it away! We must make chase. After them, men! Let us cross the river too! We will meet again, foul impostor."
                [/message]

                [message]
                    speaker=Konrad
                    message= _ "Do you think she's really going to chase us, Delfador?"
                [/message]

                [message]
                    speaker=Delfador
                    message= _ "It surely looks like she will try. But many more creatures than we have fought lurk in this river; that will make it difficult for her. We must continue onward. If she makes it across before winter, then so be it!"
                [/message]
            [/then]
        [/if]

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

    {campaigns/Heir_To_The_Throne/utils/deaths.cfg}
[/scenario]
