#textdomain wesnoth-nr
[scenario]
    id=13a_Showdown
    name= _ "Showdown"
    map_data="{campaigns/Northern_Rebirth/maps/13a_Showdown.map}"
    {DEFAULT_SCHEDULE}
    turns=unlimited
    next_scenario=14a_Epilogue

    {INTRO_AND_SCENARIO_MUSIC "revelation.ogg" "legends_of_the_north.ogg"}
    {EXTRA_SCENARIO_MUSIC "knalgan_theme.ogg"}
    {EXTRA_SCENARIO_MUSIC "vengeful.ogg"}
    {EXTRA_SCENARIO_MUSIC "elvish-theme.ogg"}
    {EXTRA_SCENARIO_MUSIC "the_city_falls.ogg"}
    {EXTRA_SCENARIO_MUSIC "northerners.ogg"}
    {EXTRA_SCENARIO_MUSIC "battle.ogg"}
    {EXTRA_SCENARIO_MUSIC "loyalists.ogg"}
    {EXTRA_SCENARIO_MUSIC "revelation.ogg"}

    [story]
        [part]
            story= _ "The party once again took up Rakshas’s trail. They soon received a report from a scouting gryphon that in an enormous fortress a few leagues west from them, Rakshas was assembling a massive orcish force, clearly intending to crush their revolt once and for all."
        [/part]
        [part]
            story= _ "The gryphon further reported that a few more leagues west was a large force of dwarvish veterans, advancing steadily on the orcish fortress."
        [/part]
        [part]
            story= _ "Battle plans were quickly made; the party split into three groups. Two of the groups immediately set off northwest and southwest respectively while the third group rested for an hour and then set off directly west."
        [/part]
        [part]
            story= _ "The idea was to completely surround Rakshas on all sides, cutting off any chance of escape or reinforcements."
        [/part]
    [/story]
    {NR_TRACK {SHOWDOWN_STAGE1}}

    # Players side - Tallin
    [side]
        type=Lieutenant
        id=Tallin
        name=_ "Tallin"
        canrecruit=yes
        side=1
        controller=human
        recruit=Thug,Poacher,Spearman,Bowman,Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Ulfserker,Dwarvish Scout,Gryphon,Footpad
        team_name=knalgans
        user_team_name=_"Alliance"
        gold=100
    [/side]
    {STARTING_VILLAGES 1 5}
    # Main enemy
    [side]
        {CHARACTER_STATS_RAKSHAS}
        side=2
        recruit=Orcish Warrior,Orcish Slayer,Troll,Troll Rocklobber,Orcish Crossbowman
        {GOLD 800 1200 1600}
        {INCOME 20 35 50}
        team_name=orcs
        user_team_name=_"Orcs"
        [ai]
            [goal]
                name=protect_location
                [criteria]
                    x=30
                    y=30
                [/criteria]
                value=400
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=1
                [/criteria]
                value=300
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=7
                [/criteria]
                value=150
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=8
                [/criteria]
                value=50
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=9
                [/criteria]
                value=250
            [/goal]
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]
    {STARTING_VILLAGES 2 3}
    # Sidekicks
    [side]
        type=Orcish Warlord
        id="Ha'Tuil"
        name= _ "Ha’Tuil"
        canrecruit=yes
        side=3
        recruit=Orcish Warrior,Orcish Slayer,Troll,Troll Rocklobber,Orcish Crossbowman
        {GOLD 800 1000 1200}
        {INCOME 10 25 40}
        team_name=orcs
        user_team_name=_"Orcs"
        [ai]
            [goal]
                name=target
                [criteria]
                    side=1
                [/criteria]
                value=400
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=7
                [/criteria]
                value=300
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=8
                [/criteria]
                value=200
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=9
                [/criteria]
                value=350
            [/goal]
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]
    {STARTING_VILLAGES 3 4}

    [side]
        type=Orcish Warlord
        id="Ar'Muff"
        name= _ "Ar’Muff"
        canrecruit=yes
        side=4
        recruit=Orcish Warrior,Orcish Slayer,Troll,Troll Rocklobber,Orcish Crossbowman
        {GOLD 800 1000 1200}
        {INCOME 10 25 40}
        team_name=orcs
        user_team_name=_"Orcs"
        [ai]
            [goal]
                name=target
                [criteria]
                    side=1
                [/criteria]
                value=400
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=7
                [/criteria]
                value=300
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=8
                [/criteria]
                value=200
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=9
                [/criteria]
                value=350
            [/goal]
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]
    {STARTING_VILLAGES 4 4}

    [side]
        type=Orcish Warlord
        id=Calter
        name= _ "Calter"
        canrecruit=yes
        side=5
        recruit=Orcish Warrior,Orcish Slayer,Troll,Troll Rocklobber,Orcish Crossbowman
        {GOLD 800 1000 1200}
        {INCOME 10 25 40}
        team_name=orcs
        user_team_name=_"Orcs"
        [ai]
            [goal]
                name=target
                [criteria]
                    side=1
                [/criteria]
                value=400
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=7
                [/criteria]
                value=300
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=8
                [/criteria]
                value=200
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=9
                [/criteria]
                value=350
            [/goal]
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]
    {STARTING_VILLAGES 5 4}

    [side]
        type=Orcish Warlord
        id=Halter
        name= _ "Halter"
        canrecruit=yes
        side=6
        recruit=Orcish Warrior,Orcish Slayer,Troll,Troll Rocklobber,Orcish Crossbowman
        {GOLD 800 1000 1200}
        {INCOME 10 25 40}
        team_name=orcs
        user_team_name=_"Orcs"
        [ai]
            [goal]
                name=target
                [criteria]
                    side=1
                [/criteria]
                value=400
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=7
                [/criteria]
                value=300
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=8
                [/criteria]
                value=200
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=9
                [/criteria]
                value=350
            [/goal]
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]
    {STARTING_VILLAGES 6 4}

    # 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.  Later, we'll edit in another leader if he's dead.
    [side]
        side=7
        save_id=Krash
        side_name= _ "Krash"
        gold=200
        recruit=Drake Fighter,Drake Glider,Drake Burner,Drake Clasher
        team_name=knalgans
        user_team_name=_"Alliance"
        controller=human
        no_leader=yes
        defeat_condition=never # changed in prestart
        {FLAG_VARIANT long}
        # passive_leader=yes, if his death causes the scenario to be lost
    [/side]
    # STARTING_VILLAGES works due to defeat_condition & having a starting location
    {STARTING_VILLAGES 7 10}

    # Allied AI
    [side]
        type=Dwarvish Lord
        id=Hamel
        name= _ "Hamel"
        profile=portraits/Hamel.png
        canrecruit=yes
        side=8
        {GOLD 1200 1000 800}
        {INCOME 30 20 10}
        recruit=Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart
        team_name=knalgans
        user_team_name=_"Alliance"
        persistent=yes
        [ai]
            leader_aggression=-10.0
            {AI_SIMPLE_DAY_ASPECT   aggression 0.5}
            {AI_SIMPLE_DAY_ASPECT   caution    0.5}
            {AI_SIMPLE_NIGHT_ASPECT aggression 0.0}
            {AI_SIMPLE_NIGHT_ASPECT caution    2.0}
            {AI_SIMPLE_NIGHT_ASPECT grouping   defensive}
        [/ai]
        [ai]
            [aspect]
                id=recruitment_instructions
                [facet]
                    time_of_day=dawn,morning,afternoon
                    [value]
                        [recruit]
                            type=Dwarvish Steelclad,Dwarvish Thunderguard
                            importance=2
                        [/recruit]
                        [recruit]
                            type=Dwarvish Stalwart
                            importance=0
                        [/recruit]
                    [/value]
                [/facet]
                [facet]
                    time_of_day=dusk,first watch,second watch
                    [value]
                        [recruit]
                            type=Dwarvish Steelclad,Dwarvish Thunderguard
                            importance=0
                        [/recruit]
                        [recruit]
                            type=Dwarvish Stalwart
                            importance=2
                        [/recruit]
                    [/value]
                [/facet]
            [/aspect]
        [/ai]
        {FLAG_VARIANT knalgan}
    [/side]
    {STARTING_VILLAGES 8 10}

    {AI_CONTROLLER () 1 8 ()}

    # Side for Eryssa if alive
    [side]
        side=9
        gold=200
        recruit=Elvish Fighter,Elvish Archer,Elvish Shaman,Elvish Scout,Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Rider,Elvish Druid,Elvish Sorceress
        team_name=knalgans
        user_team_name=_"Alliance"
        save_id=Elves
        controller=human
        no_leader=yes
        defeat_condition=never # changed in prestart
        {FLAG_VARIANT wood-elvish}
        # passive_leader=yes, if his death causes the scenario to be lost
    [/side]
    # STARTING_VILLAGES works due to defeat_condition & having a starting location
    {STARTING_VILLAGES 9 10}

    [event]
        name=prestart

        # Check if Krash is alive, if yes place him at helm of side 7,
        # otherwise it's taken over by older lich.
        {RECALL_KRASH 7}
        [store_starting_location]
            side=7
            variable=side_seven_starts_at
        [/store_starting_location]
        [if]
            [not]
                [have_unit]
                    id=Krash
                [/have_unit]
            [/not]
            [then]
                [store_unit]
                    [filter]
                        id="Ro'Arthian"
                    [/filter]
                    variable=place_lich_at
                    kill=yes
                [/store_unit]
                {VARIABLE place_lich_at.side 7}
                {VARIABLE place_lich_at.canrecruit yes}
                [unstore_unit]
                    variable=place_lich_at
                    x,y=$side_seven_starts_at.x,$side_seven_starts_at.y
                [/unstore_unit]
                {UNMAKE_HERO "Ro'Arthian"}
                [kill]
                    side=7
                    race=drake
                [/kill]
                [disallow_recruit]
                    side=7
                    type=Drake Fighter,Drake Glider,Drake Burner,Drake Clasher
                [/disallow_recruit]
                [allow_recruit]
                    side=7
                    type=Troll,Troll Whelp,Ogre,Young Ogre,Mage,Red Mage,Gryphon
                [/allow_recruit]
                # dwarves also get gold if no krash, since it's much harder to defend them
                [gold]
                    side=7,8
                    amount=400
                [/gold]
                [modify_side]
                    side=7
                    side_name= _ "Ro’Arthian"
                    {FLAG_VARIANT undead}
                    [ai]
                        passive_leader=yes
                    [/ai]
                [/modify_side]
                {CLEAR_VARIABLE place_lich_at}
            [/then]
        [/if]
        [modify_side]
            side=7
            defeat_condition=no_leader_left
        [/modify_side]

        # Hide unit for spectacular entrance
        [hide_unit]
            x=$side_seven_starts_at.x
            y=$side_seven_starts_at.y
        [/hide_unit]

        # Check if Eryssa is alive. If yes place her at the helm of side 9;
        # if not, younger lich assumes command and elves are scrubbed from
        # the side’s recall list.
        [recall]
            id=Eryssa
        [/recall]
        [store_starting_location]
            side=9
            variable=side_nine_starts_at
        [/store_starting_location]
        [if]
            [have_unit]
                id=Eryssa
            [/have_unit]
            [then]
                {TELEPORT_UNIT id="Eryssa" $side_nine_starts_at.x $side_nine_starts_at.y}
                {MODIFY_UNIT id="Eryssa" canrecruit yes}
                {MODIFY_UNIT id="Eryssa" side 9}
                [modify_side]
                    side=9
                    side_name= _ "Eryssa"
                [/modify_side]
            [/then]
            [else]
                [store_unit]
                    [filter]
                        id="Ro'Sothian"
                    [/filter]
                    variable=place_second_lich_at
                    kill=yes
                [/store_unit]
                {VARIABLE place_second_lich_at.side 9}
                {VARIABLE place_second_lich_at.canrecruit yes}
                [unstore_unit]
                    variable=place_second_lich_at
                    x,y=$side_nine_starts_at.x,$side_nine_starts_at.y
                [/unstore_unit]
                {UNMAKE_HERO "Ro'Sothian"}
                [kill]
                    side=9
                    race=elf
                [/kill]
                [disallow_recruit]
                    side=9
                    type=Elvish Fighter,Elvish Archer,Elvish Shaman,Elvish Scout,Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Rider,Elvish Druid,Elvish Sorceress
                [/disallow_recruit]
                [allow_recruit]
                    side=9
                    type=Troll,Troll Whelp,Ogre,Young Ogre,Mage,Red Mage,Gryphon
                [/allow_recruit]
                [gold]
                    side=8,9
                    amount=400
                [/gold]
                [modify_side]
                    side=9
                    side_name= _ "Ro’Sothian"
                    {FLAG_VARIANT undead}
                    [ai]
                        passive_leader=yes
                    [/ai]
                [/modify_side]
                {CLEAR_VARIABLE place_second_lich_at}
            [/else]
        [/if]
        [modify_side]
            side=9
            defeat_condition=no_leader_left
        [/modify_side]

        # Hide leader of side 9, Hamel and Tallin for great entrance
        [hide_unit]
            x=$side_nine_starts_at.x
            y=$side_nine_starts_at.y
        [/hide_unit]
        [store_starting_location]
            side=1
            variable=side_one_starts_at
        [/store_starting_location]
        [hide_unit]
            x=$side_one_starts_at.x
            y=$side_one_starts_at.y
        [/hide_unit]
        [store_starting_location]
            side=8
            variable=side_eight_starts_at
        [/store_starting_location]
        [hide_unit]
            x=$side_eight_starts_at.x
            y=$side_eight_starts_at.y
        [/hide_unit]

        # Place bad guys
        {LOYAL_UNIT 2 "Orcish Warlord" 28 22} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 29 23} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 31 23} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 32 22} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 34 22} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 36 23} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 38 24} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 40 25} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 40 27} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 40 29} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 40 31} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 40 33} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 40 35} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 38 36} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 36 37} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 34 38} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 33 39} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 31 39} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 29 39} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 27 39} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 25 38} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 23 37} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 21 36} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 20 35} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 20 33} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 20 31} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 20 29} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 20 27} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 20 25} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 22 24} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 24 23} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Warlord" 26 22} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 33 23} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 35 23} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 37 24} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 39 36} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 39 25} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 40 26} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 40 28} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 40 32} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 40 34} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 37 37} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 35 38} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 32 38} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 28 38} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 26 38} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 24 37} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 22 36} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 20 32} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 20 28} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 20 26} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 21 25} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 23 24} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 25 23} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 20 34} {GUARDIAN}
        {LOYAL_UNIT 2 "Orcish Slurbow" 27 23} {GUARDIAN}
    [/event]

    [event]
        name=start

        # If Sisal is alive it means gold was recovered, give it back to
        # three player sided split evenly
        [if]
            [have_unit]
                id=Sisal
                search_recall_list=yes
            [/have_unit]
            [then]
                {VARIABLE_OP stored_gold multiply 0.33}
                [gold]
                    side=1
                    amount=$stored_gold
                [/gold]
                [gold]
                    side=7
                    amount=$stored_gold
                [/gold]
                [gold]
                    side=9
                    amount=$stored_gold
                [/gold]
            [/then]
        [/if]
        # Intro depending on who we have alive
        [if]
            [have_unit]
                id=Krash
            [/have_unit]
            [then]
                [message]
                    speaker=narrator
                    message= _ "The group that went to the north was led by Krash and his drake friends."
                    image=wesnoth-icon.png
                [/message]
                [store_unit]
                    [filter]
                        id=Krash
                    [/filter]
                    variable=krash_store
                [/store_unit]
                [move_unit_fake]
                    type=$krash_store.type
                    side=7
                    x=30,30,30,30,30,30,30,30,30,30,30
                    y=1,2,3,4,5,6,7,8,9,10,11
                [/move_unit_fake]
                {CLEAR_VARIABLE krash_store}
            [/then]
            [else]
                [message]
                    speaker=narrator
                    message= _ "The group that went to the north was led by Ro’Arthian and was composed of trolls, ogres and some selected mages."
                    image=wesnoth-icon.png
                [/message]
                [store_unit]
                    [filter]
                        id="Ro'Arthian"
                    [/filter]
                    variable=ro_arthian_store
                [/store_unit]
                [move_unit_fake]
                    type=$ro_arthian_store.type
                    side=7
                    x=30,30,30,30,30,30,30,30,30,30,30
                    y=1,2,3,4,5,6,7,8,9,10,11
                [/move_unit_fake]
                {CLEAR_VARIABLE ro_arthian_store}
            [/else]
        [/if]
        {MODIFY_UNIT (x,y=$side_seven_starts_at.x,$side_seven_starts_at.y) facing se}
        [unhide_unit]
            x=$side_seven_starts_at.x
            y=$side_seven_starts_at.y
        [/unhide_unit]

        [recall]
            id=Eryssa
        [/recall]
        [if]
            [have_unit]
                id=Eryssa
            [/have_unit]
            [then]
                [message]
                    speaker=narrator
                    message= _ "Eryssa and the remaining elves, eager to avenge Hidel, went south, while Tallin himself led the western group."
                    image=wesnoth-icon.png
                [/message]
                [store_unit]
                    [filter]
                        id=Eryssa
                    [/filter]
                    variable=eryssa_store
                [/store_unit]
                [move_unit_fake]
                    type=$eryssa_store.type
                    side=9
                    x=31,31,31,31,31,31,31
                    y=60,59,58,57,56,55,54
                [/move_unit_fake]
                {CLEAR_VARIABLE eryssa_store}
                [if]
                    [have_unit]
                        id=Sisal
                        search_recall_list=yes
                    [/have_unit]
                    [then]
                        {MODIFY_UNIT id=Sisal side 9}
                        [recall]
                            id=Sisal
                            show=no #so Eryssa move to unhide animation is not interrupted
                        [/recall]
                    [/then]
                [/if]
            [/then]
            [else]
                [message]
                    speaker=narrator
                    message= _ "Ro’Arthian’s brother, Ro’Sothian, went south with another crew of trolls, ogres and mages. Tallin himself led the western group."
                    image=wesnoth-icon.png
                [/message]
                [store_unit]
                    [filter]
                        id="Ro'Sothian"
                    [/filter]
                    variable=ro_sothian_store
                [/store_unit]
                [move_unit_fake]
                    type=$ro_sothian_store.type
                    side=9
                    x=31,31,31,31,31,31,31
                    y=60,59,58,57,56,55,54
                [/move_unit_fake]
                {CLEAR_VARIABLE ro_sothian_store}
            [/else]
        [/if]
        {MODIFY_UNIT (x,y=$side_nine_starts_at.x,$side_nine_starts_at.y) facing nw}
        [unhide_unit]
            x=$side_nine_starts_at.x
            y=$side_nine_starts_at.y
        [/unhide_unit]
        [store_unit]
            [filter]
                id=Tallin
            [/filter]
            variable=tallin_store
        [/store_unit]
        [move_unit_fake]
            type=$tallin_store.type
            side=1
            x=60,59,58,57,56
            y=30,30,30,30,30
        [/move_unit_fake]
        {CLEAR_VARIABLE tallin_store}
        {MODIFY_UNIT (x,y=$side_one_starts_at.x,$side_one_starts_at.y) facing sw}
        [unhide_unit]
            x=$side_one_starts_at.x
            y=$side_one_starts_at.y
        [/unhide_unit]
        [message]
            speaker=narrator
            message= _ "A few short hours later all the groups converged on the fortress."
            image=wesnoth-icon.png
        [/message]

        # Recall heroes
        {RECALL_SUPPORTER}
        [recall]
            id=Camerin
        [/recall]
        [recall]
            id=Abhai
        [/recall]
        [recall]
            id=Father Morvin
        [/recall]
        [recall]
            id=Sister Thera
        [/recall]
        [recall]
            id=Elenia
        [/recall]
        [recall] #if not recalled above
            id=Sisal
        [/recall]
        [recall]
            id=Stalrag
        [/recall]
        [recall] #if not placed above
            id="Ro'Arthian"
        [/recall]
        [recall] #if not placed above
            id="Ro'Sothian"
        [/recall]
        # Intro
        [message]
            id=Tallin
            message= _ "Rakshas! You have evaded me for the last time. Now come out and die like a man!"
        [/message]
        [message]
            id=Rakshas
            message= _ "What the...? How did he get here?"
        [/message]
        [if]
            [have_unit]
                id=Eryssa
            [/have_unit]
            [then]
                [message]
                    id=Eryssa
                    message= _ "We have crushed and scattered your entire eastern flank, and now it’s your turn!"
                [/message]
                [message]
                    id=Rakshas
                    message= _ "You slimy little elf! So you have joined hands with these humans, have you? Very well, both of you shall soon be dead!"
                [/message]
                [message]
                    id=Eryssa
                    message= _ "Good luck, you monster. You are cut off and surrounded. We shall kill you and feed your carcass to the vultures and wild beasts."
                [/message]
                [message]
                    id=Rakshas
                    message= _ "Hahahahah! You fools, do you not see that you are right in the heart of orcish territory, surrounded yourselves! Why, at this very moment my entire western army is marching this way. They will soon be here and will scatter your forces like straw!"
                [/message]
            [/then]
            [else]
                [message]
                    id="Ro'Arthian"
                    message= _ "We have crushed and scattered your entire eastern flank, buddy, and now it’s your turn!"
                [/message]
                [message]
                    id=Rakshas
                    message= _ "Argh, you frustrating little vermin! I am going to pluck your eyeballs out and..."
                [/message]
                [message]
                    id="Ro'Arthian"
                    message= _ "We don’t have any eyeballs, you idiot!"
                [/message]
                [message]
                    id=Rakshas
                    # wmllint: local spelling PAH
                    message= _ "PAH! You fools, know that you shall soon be outnumbered and surrounded. At this very moment my entire western army is marching this way. They will soon be here and will scatter your puny forces like straw!"
                [/message]
            [/else]
        [/if]
        # And the dwarves' grand entrance
        [store_unit]
            [filter]
                id=Hamel
            [/filter]
            variable=hamel_store
        [/store_unit]
        [move_unit_fake]
            type=$hamel_store.type
            side=8
            x=1,2,3,4,5,6,7,8,9,10,11
            y=31,31,31,31,31,31,31,31,32,32,32
        [/move_unit_fake]
        {CLEAR_VARIABLE hamel_store}
        {MODIFY_UNIT (x,y=$side_eight_starts_at.x,$side_eight_starts_at.y) facing ne}
        [unhide_unit]
            x=$side_eight_starts_at.x
            y=$side_eight_starts_at.y
        [/unhide_unit]
        [move_unit_fake]
            type=Dwarvish Steelclad
            side=8
            x=1,2,3,4,5,6,7,8,9,10,11
            y=31,31,31,31,31,31,31,31,32,32,33
        [/move_unit_fake]
        {GENERIC_UNIT 8 "Dwarvish Steelclad" 11 33}
        [move_unit_fake]
            type=Dwarvish Steelclad
            side=8
            x=1,2,3,4,5,6,7,8,9,10,11
            y=31,31,31,31,31,31,31,31,32,31,31
        [/move_unit_fake]
        {GENERIC_UNIT 8 "Dwarvish Steelclad" 11 31}
        [move_unit_fake]
            type=Dwarvish Thunderguard
            side=8
            x=1,2,3,4,5,6,7,8,9,10
            y=31,31,31,31,31,31,31,31,32,32
        [/move_unit_fake]
        {GENERIC_UNIT 8 "Dwarvish Thunderguard" 10 32}
        [move_unit_fake]
            type=Dwarvish Thunderguard
            side=8
            x=1,2,3,4,5,6,7,8,9,10
            y=31,31,31,31,31,31,31,31,32,31
        [/move_unit_fake]
        {GENERIC_UNIT 8 "Dwarvish Thunderguard" 10 31}
        [message]
            id=Hamel
            message= _ "Will they, now?"
        [/message]
        [message]
            id=Rakshas
            message= _ "<i>What</i>?!"
        [/message]
        [message]
            id=Hamel
            message= _ "Your western army has been slaughtered, Rakshas, and <i>you</i> will soon join them!"
        [/message]
        [message]
            id=Rakshas
            message= _ "But... but... how can this be?"
        [/message]
        [message]
            id=Hamel
            message= _ "It’s called ‘The End’, foul orc. Forward! FOR KNALGA!!"
        [/message]
        [message]
            id=Krash
            message= _ "FOR FRIENDSHIP!!"
        [/message]
        [message]
            id="Ro'Arthian"
            message= _ "FOR PEACE!!"
        [/message]
        [message]
            id=Camerin
            message= _ "FOR FUN!"
        [/message]
        [message]
            id=Eryssa
            message= _ "FOR HIDEL!!"
        [/message]
        [message]
            role=Supporter
            message= _ "FOR DWARVEN DOORS!!"
        [/message]
        [message]
            id=Tallin
            message= _ "FOR THE FREE PEOPLES OF THE NORTH! FALL ON THEM, MEN!!"
        [/message]
        [objectives]
            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 Hamel"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Eryssa"
                condition=lose
                [show_if]
                    [have_unit]
                        id=Eryssa
                    [/have_unit]
                [/show_if]
            [/objective]

            {IS_LAST_SCENARIO}
            {AI_CONTROLLER_NOTE}
        [/objectives]
    [/event]
    # Flavour event at turn 5
    [event]
        name=turn 5

        [message]
            id=Tallin
            message= _ "Sweet gods, look at all those orcs pouring out of that fortress."
        [/message]
        [message]
            id=Hamel
            message= _ "Aye, and not just any orcs either, those are all hardened veterans!"
        [/message]
        [message]
            id=Tallin
            message= _ "Yeah. Obviously this is going to take some time. If necessary we can sit tight in our fortifications and besiege them until they starve!"
        [/message]
    [/event]
    # Rakashas death
    [event]
        name=last breath
        [filter]
            id=Rakshas
        [/filter]

        [message]
            id=Tallin
            message= _ "Die, you murderous beast! No longer shall you terrorize the people of the North."
        [/message]
        [message]
            id=Hamel
            message= _ "Learn the fate of one who offends the Dwarves of Knalga."
        [/message]
        [message]
            id=Eryssa
            message= _ "Or the elves of the Northern Forests."
        [/message]
        [message]
            role=Supporter
            message= _ "Or the humans of Dwarven Doors."
        [/message]
        [message]
            id=Rakshas
            message= _ "(<i>Gurgle</i>) No...! This... cannot... be... happening... to... me..."
        [/message]
        [message]
            id=Sister Thera
            message= _ "Such were the last words of Rakshas the great!"
        [/message]
        [message]
            id="Ro'Sothian"
            message= _ "(<i>Snicker</i>)"
        [/message]
    [/event]
    # Victory
    [event]
        name=victory

        [message]
            id=Tallin
            message= _ "At last! Rakshas has been slain, and the orcish host has been crushed. Peace and prosperity will come to the Northlands once again!"
        [/message]
        [message]
            speaker=narrator
            message= _ "At these words all the allied forces gave out a combined and thunderous cheer. Their long ordeal was finally over."
            image=wesnoth-icon.png
        [/message]
        [message]
            id=Camerin
            message= _ "(<i>Small voice lost in the uproar</i>) Awww, is it over already?"
        [/message]
        # Place Krash, Eryssa and Hamel on players recall list to go
        # around some engine limitations Empty recall lists of sides
        # 7,8 and 9 to save us declaring empty sides in epilogue
        {MODIFY_UNIT (side=7,8,9) side 1}
    [/event]

    # Hamel death
    [event]
        name=last breath
        [filter]
            id=Hamel
        [/filter]

        [message]
            id=Hamel
            message= _ "Argh!"
        [/message]
        [message]
            id=Tallin
            message= _ "Hamel! Blast it, without the dwarves to hold the western flank we are as good as defeated."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    # Sisal death
    [event]
        name=last breath
        [filter]
            id=Sisal
        [/filter]

        {INCIDENTAL_MUSIC "sad.ogg"}
        [message]
            id=Sisal
            message= _ "Ahhhh! Farewell, friends. I now go to join Hidel."
        [/message]
        [message]
            id=Eryssa
            message= _ "Sisal! Noooo! Not you too!"
        [/message]
    [/event]

    [event]
        name=enemies defeated

        [endlevel]
            result=victory
            carryover_report=no
        [/endlevel]
    [/event]
    # Load death events
    {HERODEATH_EVERYONE}
[/scenario]
