#textdomain wesnoth-tsg
[scenario]
    id=08a_Return_to_Kerlath
    name= _ "Return to Kerlath"
    map_data="{campaigns/The_South_Guard/maps/08a_Return_to_Kerlath.map}"
    next_scenario=09a_Vengeance
    {TURNS 22 20 18}
    victory_when_enemies_defeated=no

    {SCENARIO_MUSIC wanderer.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}
    {EXTRA_SCENARIO_MUSIC silvan_sanctuary.ogg}

#define SG_DEATHS_LAST_LEVEL
#enddef
    {campaigns/The_South_Guard/utils/sg_deaths.cfg}

    {DEFAULT_SCHEDULE_DUSK}

    {SG_RETURN_TO_KERLATH}
    {TSG_BIGMAP {JOURNEY_08A_NEW} }

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Move Deoran into Kerlath Province"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Deoran"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Ethiliel"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

    [label]
        x,y=18,2
        text= _ "Westin"
    [/label]

    [side]
        side=1
        type=Horseman Commander
        id=Deoran
        name= _ "Deoran"
        profile=portraits/deoran.png
        unrenamable=yes

        team_name=South_Guard
        user_team_name=_"South Guard"
        controller=human
        {CUSTOM_SG_FLAG}

        {GOLD 60 50 40}
        {INCOME 6 4 2}

        fog=yes
        shroud=no

        canrecruit=yes
        recruit=Bowman, Spearman, Cavalryman, Elvish Shaman, Elvish Fighter
    [/side]

    {STARTING_VILLAGES 1 3}

    [side]
        side=2
        no_leader=yes
        team_name=elves
        hidden=yes
        controller=ai
        color=green

        [ai]
            aggression=0.7
            caution=0.4
            [goal]
                name=target
                [criteria]
                    side=1
                [/criteria]
                value=5
            [/goal]
        [/ai]
        {FLAG_VARIANT long}
    [/side]

    [side]
        no_leader=yes
        side=3
        controller=ai
        team_name=elves
        hidden=yes
        color=blue
        defeat_condition=always
    [/side]

    [side]
        side=4
        no_leader=yes
        team_name=South_Guard
        hidden=yes
        controller=ai
        {CUSTOM_SG_FLAG}
    [/side]

    {STARTING_VILLAGES 4 10}

    [event]
        name=start

        # the ogre
        {NAMED_GENERIC_UNIT 3 (Ogre) 17 21 (Kramak) (_"Kramak")} {GUARDIAN}

        # enemy elvesk
#ifdef EASY
        {GENERIC_UNIT 2 (Elvish Captain) 9 25} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 10 22} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Scout) 12 23} {GUARDIAN}

        {GENERIC_UNIT 2 (Elvish Hero) 6 18} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Archer) 7 20} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 11 18} {GUARDIAN}

        {GENERIC_UNIT 2 (Elvish Archer) 8 14} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 7 11} {GUARDIAN}
#endif
#ifdef NORMAL
        {GENERIC_UNIT 2 (Elvish Captain) 9 25} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 10 22} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Scout) 12 23} {GUARDIAN}

        {GENERIC_UNIT 2 (Elvish Hero) 6 18} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Ranger) 7 20} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 11 18} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Archer) 12 14} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Scout) 10 19} {GUARDIAN}

        {GENERIC_UNIT 2 (Elvish Archer) 8 14} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 7 11} {GUARDIAN}
#endif
#ifdef HARD
        {GENERIC_UNIT 2 (Elvish Captain) 9 25} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 10 22} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Scout) 12 23} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Archer) 15 24} {GUARDIAN}

        {GENERIC_UNIT 2 (Elvish Hero) 6 18} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Ranger) 7 20} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 11 18} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Marksman) 12 14} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Scout) 10 19} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Archer) 3 20} {GUARDIAN}

        {GENERIC_UNIT 2 (Elvish Archer) 8 14} {GUARDIAN}
        {GENERIC_UNIT 2 (Elvish Fighter) 7 11} {GUARDIAN}
#endif

        [recall]
            id=Ethiliel
        [/recall]
        [redraw][/redraw]

        [recall]
            id=Minister Hylas
        [/recall]
        [redraw][/redraw]

        [recall]
            id=Sir Gerrick
        [/recall]
        [redraw][/redraw]

#ifdef HARD
        [recall]
            type=Royal Guard, Pikeman, Swordsman, Javelineer, Master Bowman, Longbowman, Spearman, Bowman
        [/recall]
        [recall]
            type=Royal Guard, Pikeman, Swordsman, Javelineer, Master Bowman, Longbowman, Spearman, Bowman
        [/recall]
#else
        [recall]
            type=Royal Guard, Pikeman, Swordsman, Javelineer, Master Bowman, Longbowman, Spearman, Bowman
        [/recall]
        [recall]
            type=Royal Guard, Pikeman, Swordsman, Javelineer, Master Bowman, Longbowman, Spearman, Bowman
        [/recall]
        [recall]
            type=Royal Guard, Pikeman, Swordsman, Javelineer, Master Bowman, Longbowman, Spearman, Bowman
        [/recall]
#endif
        [redraw][/redraw]

        [message]
            id=Deoran
            message= _"We are finally back in familiar territory. Westin is no more than a couple days’ journey from here. Let us make haste back to our homes."
        [/message]

        {HIGHLIGHT_IMAGE 3 7 items/gohere.png ()}
    [/event]

    # Kramak, the wild ogre

    [event]
        name=sighted
        [filter]
            id=Kramak
        [/filter]
        [message]
            speaker=Kramak
            #po: The ogre purposely has very bad grammar, because he is very stupid.
            message= _ "Oh! Me see human. Human tasty food?"
        [/message]
        [message]
            speaker=Deoran
            # wmllint: local spelling Mr.
            message= _ "Err, Mr. Ogre, we are not very tasty."
        [/message]
        [message]
            speaker=Kramak
            message= _ "Oh. Me like only tasty meat. You go away."
        [/message]
        [message]
            speaker=Kramak
            message= _ "..."
        [/message]
        [message]
            speaker=Kramak
            message= _ "Wait! Me no believe! Me eat you!"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Kramak
        [/filter]
        [message]
            speaker=Kramak
            message= _ "Bad food! It hurt me. Me no like. Me ouch..."
        [/message]
    [/event]

    [event]
        name=sighted

        [filter]
            side=2
        [/filter]

        [message]
            speaker=unit
            message= _"Humans! Vile beasts!"
        [/message]
        [message]
            id=Deoran
            message= _"What? We are your friends, not your enemies! We mean no harm to you. My men and I are simply tired and wish to return to our homes."
        [/message]
        [message]
            speaker=unit
            message= _"Save those wishes for another life, cur! You kidnapped and slew the Sage Mebrin!"
        [/message]
        [message]
            id=Deoran
            message= _"We did no such thing! Mebrin adopted the dark arts of his own volition. He was consumed by it and twisted into a being of great evil!"
        [/message]
        [message]
            speaker=unit
            message= _"How dare you! To accuse our beloved sage of such things... does the stupidity of humanity know no bounds?"
        [/message]
        [message]
            id=Ethiliel
            message= _"The human speaks the truth. As much as my heart grieves for Mebrin, he was not innocent either."
        [/message]
        [message]
            speaker=unit
            message= _"Fine words for a traitor."
        [/message]
        [message]
            id=Ethiliel
            image=portraits/ethiliel-mad.png
            message= _"You dare speak to me so? Have you forgotten who I am? I <i>order</i> you to stand down this instant, warrior!"
        [/message]
        [message]
            speaker=unit
            message= _"Your orders no longer hold any weight, friend of the tree-killers. If you will not withdraw, we will kill you along with them!"
        [/message]
        [message]
            id=Deoran
            message= _"<i>Ethiliel, what in the world is going on?</i>"
        [/message]
        [message]
            id=Ethiliel
            message= _"<i>I am not sure. Mebrin was beloved by many of our people. His death must have angered some of them greatly, perhaps to the point that they have become utterly irrational. Even so, this seems like madness to me.</i>"
        [/message]
        [message]
            id=Deoran
            message= _"<i>But to be angered enough to attack you? And besides, you were his student. You have the right to be the most angry of all, yet even you have made peace with us. Should they not recognize this?</i>"
        [/message]
        [message]
            id=Ethiliel
            message= _"<i>The events that transpired in those caves brought too much grief for me to be angry any longer. But, I am afraid the rest of my people did not see firsthand what Mebrin had become. As for attacking me, I am not usually the one in command of our warriors; that responsibility belongs to Ithelden, whom I very much doubt sent anyone to come hunt us down. Something else is going on.</i>"
        [/message]
        [message]
            id=Deoran
            message= _"<i>What should we do?</i>"
        [/message]
        [message]
            id=Ethiliel
            message= _"<i>Fight past our foes, but if possible, fight to subdue and not to kill. We elves have suffered enough from this ordeal. I would not have our people be slaughtered needlessly as well.</i>"
        [/message]
        [message]
            id=Deoran
            message= _"<i>Very well.</i>"
        [/message]
    [/event]

    [event]
        name=time over

        [remove_shroud]
            [filter_side]
                side=1
            [/filter_side]
            x=10-18
            y=0-5
        [/remove_shroud]
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x=10-18
            y=0-5
            multiturn=yes
        [/lift_fog]
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]

        [unit]
            type=Elvish Avenger
            side=2
            id=Eltenmir
            name= _ "Eltenmir"
            animate=yes
            x,y=13,2
        [/unit]
        {GENERIC_UNIT 2 (Elvish Hero) 12 1}
        {GENERIC_UNIT 2 (Elvish Captain) 12 2}
        {GENERIC_UNIT 2 (Elvish Marksman) 11 3}

        [message]
            speaker=Eltenmir
            # po: Defeat message after time-over
            message= _ "These human beasts slew our people and murdered Mebrin! We must have vengeance for this vile atrocity. Burn their city to the ground!"
        [/message]
        [message]
            speaker=Deoran
            # po: Defeat message after time-over
            message= _ "The elves are attacking Westin! They'll surely destroy the city without us there to defend it..."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x,y=3,7
            id=Deoran
        [/filter]

        [remove_item]
            x,y=3,7
        [/remove_item]

        [unit]
            side=4
            type=Lieutenant
            id=Liryn
            name= _ "Liryn"
            x,y=2,6
        [/unit]

        [message]
            speaker=Liryn
            message= _ "Halt! Who comes to the border of Wesnoth?"
        [/message]

        [message]
            speaker="Deoran"
            message= _ "It is I, Deoran, commander of the South Guard."
        [/message]

        [message]
            speaker=Liryn
            message= _ "Deoran? It truly is you? We had thought you had been lost to the undead."
        [/message]

        [message]
            speaker="Deoran"
            message= _ "We and our elvish allies have won a great battle against a lich. The undead are no more."
        [/message]

        [message]
            speaker=Liryn
            message= _ "This is wonderful news, commander! I shall spread word about your heroic deed! But... I am afraid there is another problem. There are rumors of trouble with the elves of the Aethenwood."
        [/message]

        [message]
            speaker="Ethiliel"
            message= _ "That does not surprise me, given our troubles in even getting here. Deoran, we had best hurry back to your city. I will need to see what the circumstances are."
        [/message]

        [message]
            speaker="Deoran"
            message= _ "Very well, let us make haste to Westin."
        [/message]

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