#textdomain wesnoth-nr

# If Krash lives, the player can play his side, otherwise he gets his gold and the scenario is made easier.

[scenario]
    id=11a_The_Eastern_Flank
    name= _ "The Eastern Flank"
    map_file=11a_The_Eastern_Flank.map
    {TURNS 53 50 47}
    next_scenario=12a_Get_the_Gold

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC "northerners.ogg" "loyalists.ogg"}
    {EXTRA_SCENARIO_MUSIC     "battle.ogg"}
    {EXTRA_SCENARIO_MUSIC     "frantic.ogg"}

    [story]
        [part]
            story= _ "After breaking out of their encirclement, the party continued in pursuit of the trolls."
        [/part]
        [part]
            # wmllint: local spelling Angthurim
            story= _ "Following the bank of a river, they soon entered a valley. At the mouth of the valley there loomed the massive orcish fortress of Angthurim."
        [/part]
    [/story]

    {NR_TRACK {RECOVERY_STAGE5}}

    # Players side
    # wmllint: validate-off
    [side]
        side=1
        controller=human
        recruit=Thug,Poacher,Spearman,Bowman,Gryphon,Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Ulfserker,Dwarvish Scout,Footpad
        {GOLD 250 200 150}
        team_name=knalgans
        user_team_name= _ "Alliance"

        # wmllint: recognize Tallin
        {CHARACTER_STATS_TALLIN}
    [/side]
    # wmllint: validate-on

    # Opposing AIs, trolls, [ai] keys force it to utilise full recall list
    [side]
        side=2
        controller=ai
        recruit=Troll Whelp,Troll,Troll Rocklobber
        {GOLD 500 600 700}
        {INCOME 25 35 45}
        team_name=orcs
        user_team_name= _ "Orcs"

        type=Troll Warrior
        name= _ "Gore"
        id=Gore
        canrecruit=yes

        [unit]
            {CHARACTER_STATS_RAKSHAS}
            x,y=7,15
        [/unit]

        {GENERIC_UNIT 2 "Orcish Warlord" 8 14}
        {GENERIC_UNIT 2 "Orcish Warlord" 6 14}
    [/side]

    # Orcs
    [side]
        side=3
        controller=ai
        recruit=Orcish Grunt,Orcish Warrior,Orcish Archer,Orcish Crossbowman,Wolf Rider,Orcish Assassin
        {GOLD 400 500 600}
        {INCOME 25 35 45}
        team_name=orcs
        user_team_name= _ "Orcs"
        {FLAG_VARIANT6 ragged}

        type=Orcish Warlord
        id=Carron
        name= _ "Carron"
        canrecruit=yes
    [/side]

    [side]
        side=4
        controller=ai
        recruit=Orcish Grunt,Orcish Warrior,Orcish Archer,Orcish Crossbowman,Wolf Rider,Orcish Assassin
        {GOLD 400 500 600}
        {INCOME 25 35 45}
        team_name=orcs
        user_team_name= _ "Orcs"
        {FLAG_VARIANT6 ragged}

        type=Orcish Warlord
        id=Rash
        name= _ "Rash"
        canrecruit=yes
    [/side]

    [side]
        side=5
        controller=ai
        recruit=Orcish Grunt,Orcish Warrior,Orcish Archer,Orcish Crossbowman,Wolf Rider,Orcish Assassin
        {GOLD 400 500 600}
        {INCOME 25 35 45}
        team_name=orcs
        user_team_name= _ "Orcs"
        {FLAG_VARIANT6 ragged}

        type=Orcish Warlord
        id="Al'Mar"
        name= _ "Al’Mar"
        canrecruit=yes
    [/side]

    [side]
        side=6
        controller=ai
        recruit=Orcish Grunt,Orcish Warrior,Orcish Archer,Orcish Crossbowman,Wolf Rider,Orcish Assassin
        {GOLD 400 500 600}
        {INCOME 25 35 45}
        team_name=orcs
        user_team_name= _ "Orcs"
        {FLAG_VARIANT6 ragged}

        type=Orcish Warlord
        id="Ha'Tang"
        name= _ "Ha’Tang"
        canrecruit=yes
    [/side]

    # Krash may not actually still be alive at this point, but setting up
    # his side this way is the only way to reliably pick up his recall
    # list if he is.
    [side]
        side=7
        controller=human
        save_id=Krash
        side_name= _ "Krash"
        recruit=Drake Fighter,Drake Glider,Drake Burner,Drake Clasher
        {GOLD 250 200 150}
        team_name=knalgans
        user_team_name= _ "Alliance"
        no_leader=yes
        # Krash's color
        color=orange
        {FLAG_VARIANT long}
    [/side]

    {STARTING_VILLAGES 1 6}

    # Here’s where we edit out Krash's side if he's dead.
    [event]
        name=prestart

        {RECALL_KRASH 7}
        [if]
            [not]
                [have_unit]
                    #wmllint: recognize Krash
                    id=Krash
                [/have_unit]
            [/not]
            [then]
                [kill]
                    side=7
                [/kill]

                [terrain]
                    x=29,29,30,30,30,31,31,31,32,32
                    y=6,7,5,6,7,6,7,8,6,7
                    terrain=Mm
                [/terrain]

                [modify_side]
                    side=7
                    hidden=yes
                [/modify_side]

                # adjust gold if no krash
                [gold]
                    side=1
                    amount={ON_DIFFICULTY 250 200 150}
                [/gold]
                [gold]
                    side=2,3,4,5,6
                    amount={ON_DIFFICULTY -125 -100 -75}
                [/gold]
                {CAPTURE_VILLAGES 1 30 3 5}
            [/then]
            [else]
                {CAPTURE_VILLAGES 7 30 3 5}
            [/else]
        [/if]

        [objectives]
            #side=0 sets the objectives for all sides.
            side=0
            [objective]
                description= _ "Defeat the enemy leaders"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Tallin"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Ro’Arthian"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Ro’Sothian"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Eryssa"
                condition=lose
                [show_if]
                    [have_unit]
                        #wmllint: recognize Eryssa
                        id=Eryssa
                        search_recall_list=yes
                    [/have_unit]
                [/show_if]
            [/objective]

            {TURNS_RUN_OUT}

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

    # Recall heroes, place some bad guys, do initial dialogue
    [event]
        name=start

        {RECALL_SUPPORTER}

        {RECALL_OR_REPLACE id=Abhai}

        {RECALL_OR_REPLACE id=Camerin}

        [recall]
            id=Father Morvin
        [/recall]

        [recall]
            id=Sister Thera
        [/recall]

        {RECALL_OR_REPLACE id=Elenia}

        {RECALL_OR_REPLACE id=Eryssa}

        {RECALL_OR_REPLACE id=Stalrag}

        [recall]
            id="Ro'Arthian"
        [/recall]

        [recall]
            id="Ro'Sothian"
        [/recall]

        [message]
            speaker=Tallin
            message= _ "Gods of Light, look at that fortress! The castle Angthurim is even grimmer than its reputation!"
        [/message]

        # Hidel part takes place only if Eryssa is alive
        [if]
            [have_unit]
                id=Eryssa
            [/have_unit]
            [then]
                [message]
                    speaker=Eryssa
                    message= _ "I was not idle in my captivity; I watched, and listened, and learned. The hints I got from my guards’ boastings and foul jests have been confirmed by our scouts; Angthurim is the linchpin of their entire eastern flank. If we could take it, their defense would be near to collapse."
                [/message]

                [unit]
                    side=1
                    type=Elvish Marshal
                    id=Hidel
                    name= _ "Hidel"
                    profile=portraits/Hidel.webp
                    x,y=33,13
                [/unit]
            [/then]
            [else]
                [message]
                    speaker="Ro'Arthian"
                    message= _ "Fitting. My gryphons tell me Angthurim is the keystone of their entire eastern flank. If we can destroy it their defense will be near to collapse."
                [/message]
            [/else]
        [/if]

        [message]
            role=Supporter
            message= _ "Hey, look who is here!"
        [/message]

        [message]
            #wmllint: recognize Rakshas
            speaker=Rakshas
            message= _ "Where is my gold?!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "It’s Rakshas!"
        [/message]

        [message]
            speaker=Gore
            message= _ "Right here, Master."
        [/message]

        [message]
            speaker=Rakshas
            message= _ "Ahhhhh, very good, my loyal servant. You will be richly rewarded for this! Tell me, what news do you have on that human vermin that has so persistently evaded my clutches?"
        [/message]

        [message]
            speaker=Gore
            message= _ "We trapped him and his pitiful band of followers. By now they will have been mashed to paste and fed to the whelps."
        [/message]

        [message]
            speaker=Rakshas
            message= _ "Hahahaha! Very g—"
        [/message]

        [message]
            speaker=Tallin
            message= _ "<big>RAKSHAS!!</big>"
        [/message]

        [message]
            speaker=Rakshas
            message= _ "What?! YOU! YOU ANNOYING, DISGUSTING LITTLE VERMIN! DON’T YOU KNOW HOW TO DIE?!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "Foul one, the only one who will be dying here is you. Stand and fight!"
        [/message]

        [message]
            speaker=Rakshas
            message= _ "Bah! I have better things to do than stamp out your insignificant life. Generals, bring me his head!"
        [/message]

        [kill]
            race=orc
            side=2
            fire_event=no
        [/kill]

        [move_unit_fake]
            type=Orcish Sovereign
            side=2
            x=7,7,7,7,7,7,8,8,8,7,7,8,9,9,9,9,10,10
            y=16,17,18,19,20,21,21,22,23,24,25,25,26,27,28,29,29,30
        [/move_unit_fake]

        [move_unit_fake]
            type=Orcish Warlord
            side=2
            x=7,7,7,7,7,7,8,8,8,7,7,8,9,9,9,9,10,10
            y=16,17,18,19,20,21,21,22,23,24,25,25,26,27,28,29,29,30
        [/move_unit_fake]

        [move_unit_fake]
            type=Orcish Warlord
            side=2
            x=7,7,7,7,7,7,8,8,8,7,7,8,9,9,9,9,10,10
            y=16,17,18,19,20,21,21,22,23,24,25,25,26,27,28,29,29,30
        [/move_unit_fake]

        [if]
            [have_unit]
                id=Eryssa
            [/have_unit]
            [then]
                [message]
                    speaker=Tallin
                    message= _ "Blast it! The coward has fled. Eryssa, your elves are good at moving quickly through the forests. Do you think they can overtake him while we deal with this fortress?"
                [/message]

                [message]
                    speaker=Eryssa
                    message= _ "Hidel?"
                [/message]

                [message]
                    speaker=Hidel
                    message= _ "Easily, Your Highness. We shall move unseen through the trees, overtake him, and put an end to his flight."
                [/message]

                [message]
                    speaker=Eryssa
                    message= _ "Then do it. I shall stay with Tallin and... um... because he could use my assistance."
                [/message]

                [message]
                    speaker=Tallin
                    message= _ "(<i>Blushes slightly</i>)"
                [/message]

                [message]
                    speaker=Sister Thera
                    message= _ "(<i>Wink wink</i>)"
                [/message]

                [message]
                    speaker=Hidel
                    message= _ "(<i>Raises eyebrow</i>) Very well, my lady."
                [/message]

                [kill]
                    id=Hidel
                [/kill]

                [move_unit_fake]
                    type=Elvish Marshal
                    side=1
                    x=32,31,30,29,28,27,26,26,26,26,26,26,25,24,23,23,23,23,23,23,23,23,23
                    y=13,14,14,14,14,15,15,16,17,18,19,20,21,21,22,23,24,25,26,27,28,29,30
                [/move_unit_fake]

                [move_unit_fake]
                    type=Elvish Scout
                    side=1
                    x=32,31,30,29,28,27,26,26,26,26,26,26,25,24,23,23,23,23,23,23,23,23,23
                    y=13,14,14,14,14,15,15,16,17,18,19,20,21,21,22,23,24,25,26,27,28,29,30
                [/move_unit_fake]

                [move_unit_fake]
                    type=Elvish Avenger
                    gender=female
                    side=1
                    x=32,31,30,29,28,27,26,26,26,26,26,26,25,24,23,23,23,23,23,23,23,23,23
                    y=13,14,14,14,14,15,15,16,17,18,19,20,21,21,22,23,24,25,26,27,28,29,30
                [/move_unit_fake]
            [/then]
            [else]
                [message]
                    speaker=Tallin
                    message= _ "Blast it. The coward has fled. Quickly men, we must storm this fortress before he can spend that gold."
                [/message]

                [message]
                    #wmllint: recognize Stalrag
                    speaker=Stalrag
                    message= _ "Aye! Down wi’ the orcs!"
                [/message]
            [/else]
        [/if]

        [message]
            speaker=Tallin
            message= _ "Ro’Arthian, send a message to Hamel. Tell him it’s time."
        [/message]

        [move_unit_fake]
            type=Gryphon
            side=1
            x=32,31
            y=9,1
        [/move_unit_fake]

        [delay]
            time=500
        [/delay]
        [move_unit_fake]
            type=Gryphon
            side=1
            x=31,31,31,31,31,31,31,31,31,32
            y=1,2,3,4,5,6,7,8,9,9
        [/move_unit_fake]

        {GENERIC_UNIT 1 "Gryphon" 32 9}

        [message]
            speaker="Ro'Arthian"
            message= _ "It’s done."
        [/message]

        [message]
            speaker=Tallin
            message= _ "Very well. Forward! Victory or death!"
        [/message]

        [message]
            speaker=Krash
            message= _ "Come on boys, let’s give it to ’em!"
        [/message]
    [/event]

    [event]
        name=turn 2

        [message]
            speaker=Gore
            message= _ "Move, you stupid orcs! I am trying to recruit here!"
        [/message]

        [message]
            speaker=Rash
            message= _ "Suit yourself, you dumb troll!"
        [/message]

        [message]
            speaker=Sister Thera
            message= _ "Awww, aren’t they the most loving, sharing bunch of orcs you have ever seen?"
        [/message]

        [message]
            speaker=Eryssa
            message= _ "(<i>Snicker</i>)"
        [/message]
    [/event]

    # Victory event, choose next scenario depending on whether Eryssa is alive or not.
    [event]
        name=enemies defeated

        [message]
            id=Tallin
            message= _ "We have torn the heart from their eastern defenses."
        [/message]

        [if]
            [have_unit]
                id=Eryssa
            [/have_unit]
            [then]
                [message]
                    speaker=Tallin
                    message= _ "Now let us make haste to rescue Hidel. I am uneasy for him; some of those bodyguards Rakshas keeps are fell fighters."
                [/message]

                [endlevel]
                    result=victory
                    {NEW_GOLD_CARRYOVER 40}
                [/endlevel]
            [/then]
            [else]
                [message]
                    speaker=Tallin
                    message= _ "Now to settle scores with Rakshas once and for all!"
                [/message]

                [endlevel]
                    result=victory
                    next_scenario=13a_Showdown
                    {NEW_GOLD_CARRYOVER 40}
                [/endlevel]
            [/else]
        [/if]
    [/event]

    # Load death events
    {HERODEATH_EVERYONE}
[/scenario]
