#textdomain wesnoth-low
[scenario]
    id=23_End_of_War
    name= _ "End of War"
    {LOW_MAP 23_End_of_War.map}
    {TURNS 24 21 18}

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC sad.ogg heroes_rite.ogg}
    {EXTRA_SCENARIO_MUSIC siege_of_laurelmor.ogg}
    {EXTRA_SCENARIO_MUSIC elvish-theme.ogg}
    {EXTRA_SCENARIO_MUSIC weight_of_revenge.ogg}
    {EXTRA_SCENARIO_MUSIC the_city_falls.ogg}
    {EXTRA_SCENARIO_MUSIC breaking_the_chains.ogg}
    {EXTRA_SCENARIO_MUSIC casualties_of_war.ogg}

    #TODO music

    {LOW_PRESTART}

    next_scenario=24_Epilogue
    [story]
        [part]
            # wmllint: local spelling Gitamoth
            story= _ "It is said that the battle with the North Elves was the beginning of the end for Landar's revolt. But civil war smoldered on for many more years, neither side mustering enough strength to achieve a decisive victory. Until, eventually, Landar's increasingly harsh and arrogant ways drove away many of his followers. After assembling all the troops he could, Kalenz marched against his old friend and now mortal enemy, Landar, in the forest of Gitamoth... "
            {TO_END_OF_WAR}
        [/part]
    [/story]

    #wmllint: validate-off
    [side]
        {KALENZ}
        # wmllint: recognize Kalenz
        recruit={ELVES}
        {GOLD 200 160 160}
        [unit]
            {CLEODIL}
            #wmllint: recognize Cleodil
            placement=leader
        [/unit]
    [/side]
    #wmllint: validate-on
    [event]
        name=prestart
        {LOW_STEAL_UNIT_TO "Landar" 2}
        {RECALL_LOYALS}
    [/event]

    #wmllint: validate-off
    [side]
        side=2
        persistent=yes
        save_id=Landar
        {LANDAR}
        # wmllint: recognize Landar
        canrecruit=yes
#ifdef EASY
        recruit=Elvish Archer, Elvish Fighter, Elvish Hero
#endif
#ifdef NORMAL
        recruit=Elvish Archer, Elvish Fighter, Elvish Hero, Elvish Ranger, Elvish Captain, Elvish Marksman
#endif
#ifdef HARD
        recruit=Elvish Archer, Elvish Fighter, Elvish Hero, Elvish Ranger, Elvish Captain, Elvish Marksman, Elvish Avenger, Elvish Sharpshooter
#endif
        team_name=landar
        user_team_name= _ "Enemies"
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
#ifdef EASY
            recruitment_pattern=fighter, archer, fighter
#else
            recruitment_pattern=fighter, archer, mixed fighter
#endif
        [/ai]
        {GOLD 250 520 710}
        {INCOME 4 8 12}
    [/side]
    #wmllint: validate-on

    #### /Side setup ####

    #### Scenario Objectives ####
    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Defeat Landar"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Cleodil"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
            note={NO_GOLD_CARRYOVER_NOTE}
        [/objectives]
    [/event]

    [event]
        name=start
        [message]
            id=Kalenz
            message= _ "Landar, let us spill no more elvish blood. Give up. We can help you!"
        [/message]
        [message]
            id=Landar
            message= _ "No! It all ends here!"
        [/message]
    [/event]

    #TODO add speech for Landar and Kalenz
    [event]
        name=last breath
        # Second_unit (on kalenz's side) kills unit (on landar's side);
        # both came from the player's recall list and so have fought
        # side by side.
        [filter]
            role=landar_loyal
        [/filter]
        [filter_second]
            role=kalenz_loyal
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "Forgive me $unit.name|. I will sing your name in praise under the stars!"
        [/message]
        [message]
            speaker=unit
            message= _ "We must all pass, $second_unit.name|. Make your song beautiful.."
        [/message]
    [/event]

    [event]
        name=last breath
        # Same as above but with roles exchanged. One of Landar's men
        # kills his former comrade.
        [filter]
            role=kalenz_loyal
        [/filter]
        [filter_second]
            role=landar_loyal
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "Forgive me, $unit.name|, this victory brings me no joy."
        [/message]
        [message]
            speaker=unit
            message= _ "Remember me to the trees, $second_unit.name|."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Landar
        [/filter]

        [message]
            id=Landar
            message= _ "I fall. Perhaps now I can rest!"
        [/message]
        [message]
            id=Kalenz
            message= _ "I am deeply grieved that it came to this, Landar. You were my best friend. I was blind to what the potion was doing to you. I was fighting it myself!"
        [/message]
        [message]
            id=Landar
            message= _ "I know. But you are not at fault, for I did not take just one bottle. I wanted to make sure we could kill the orcish Great Chief, so I went back for a second and drank that one, too. Now I have driven our dwarvish allies away and brought death and disaster to our own people. I have even tried to kill my own friend. I am a disgrace to elven-kind."
        [/message]
        [message]
            id=Kalenz
            message= _ "It was not all your fault. May be the curse of Aquagar struck true, or may be yours was the blood-price fate required of us for victory. Rest well, my friend. Rest well Landar, Hero of the Elves!"
        [/message]
        [endlevel]
            result=victory
            bonus=no
            carryover_report=no
            save=no
            carryover_percentage=0
        [/endlevel]
    [/event]

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