#textdomain wesnoth-low
[scenario]
    id=01_The_Uprooting
    name=_ "The Uprooting"
    {LOW_MAP  Lintanir.map}
    {LOW_MASK 01_Uprooting.mask}

    {TURNS 16 14 12}

    {INTRO_AND_SCENARIO_MUSIC elf-land.ogg breaking_the_chains.ogg}
    {EXTRA_SCENARIO_MUSIC elvish-theme.ogg}
    {EXTRA_SCENARIO_MUSIC nunc_dimittis.ogg}

    {DEFAULT_SCHEDULE}
    {STARTING_VILLAGES 2 50}

    next_scenario=02_Hostile_mountains
    victory_when_enemies_defeated=no

    [story]
        [part]
            delay=4000
            show_title=yes
            {TO_THE_UPROOTING}
        [/part]
        [part]
            story=_ "The great elvish hero Kalenz was born in a quiet green wood in Lintanir on the fringes of the Great Northern Forest. Though not of noble birth, he showed early promise in the arts of his people. His quick intelligence gained him more than usual respect among elders normally inclined to pay little heed to anyone younger than a century old."
            delay=4000
            background="story/characters/kalenz.png"
            scale_background=no
        [/part]
        [part]
            story=_ "Perhaps the elders sensed that changing times would require more flexible minds; these were the years when humans from the Green Isle were establishing themselves south of the Great River, and the known world was changing more rapidly than it had for a thousand years before."
            delay=4000
            background="story/characters/kalenz.png"
            scale_background=no
        [/part]
        [part]
            story=_ "Some changes were good. The Elves, awakened as from a long dream, began to increase in population. But some were very bad, and the worst of those was the coming of the orcs, the wreckers, the tree-killers. The years of Kalenz's long childhood were a golden age, and the last time of untroubled peace."
            delay=4000
            background="story/characters/kalenz.png"
            scale_background=no
        [/part]
        [part]
            story=_ "The elves had never been a martial people, and they were not prepared for the inevitable war with the orcs. Kalenz came of age in the very year that Erlornas of Wesmere fought the first orcish raiders. Within the next decade orcish raids greatly increased, and their shadow loomed ever greater over the elves.

This is the story of Kalenz, and of the Elves in the days of the humans in Wesnoth."
            delay=8000
            background="story/landscape-battlefield.jpg"
        [/part]
    [/story]

    #### Kalenz's side ####
    [side]
        side=1
        no_leader=yes
        save_id=Kalenz
        controller=human
        team_name=kalenz
        recruit={ELVES}
        {GOLD 300 200 180}
        #wmllint: validate-off
        [unit]
            {KALENZ}
            # wmllint: recognize Kalenz
            x=17
            y=14
        [/unit]
        [unit]
            {LANDAR}
            # wmllint: recognize Landar
            x,y=16,15
        [/unit]
        #wmllint: validate-on
        [unit]
            type=Elvish Fighter
            id=Anduilas
            name=_ "Anduilas"
            unrenamable=yes
            side=1
            x,y=19,15
            [modifications]
                {TRAIT_INTELLIGENT}
                {TRAIT_STRONG}
                {TRAIT_LOYAL}
            [/modifications]
        [/unit]
    [/side]
    [event]
        name=prestart
        {INIT_LANDAR}
    [/event]
    [event]
        name=last breath
        [filter_second]
            id=Kalenz
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "You trifled with the wrong elf!"
        [/message]
    [/event]
    [event]
        name=last breath
        [filter_second]
            id=Landar
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "Take that, you orcish scum!"
        [/message]
    [/event]
    #### /Kalenz side ####

    [side]
        side=2
        no_leader=yes
        controller=ai
        team_name=kalenz
        recruit=Elvish Fighter,Elvish Archer,Elvish Shaman
        {GOLD 100 100 100}
        [unit]
            type=Elvish Captain
            profile="portraits/velon.png"
            id=Velon
            name=_ "Velon"
            canrecruit=yes
            team_name=kalenz
            x=5
            y=15
            [modifications]
                [trait]
                    id=aged
                    male_name= _ "aged"
                    [effect]
                        apply_to=hitpoints
                        increase_total=-8
                    [/effect]
                    [effect]
                        apply_to=movement
                        increase=-1
                    [/effect]
                [/trait]
                {TRAIT_INTELLIGENT}
            [/modifications]
        [/unit]
        [ai]
            village_value=0
            leader_value=0
            protect_leader=0
            [avoid]
                x=1-30,1-30,1-3,7-30
                y=1-13,17-30,1-30,1-30
            [/avoid]
        [/ai]
    [/side]

    [side]
        side=3
        no_leader=yes
        team_name=orcs
        [unit]
            type=Orcish Warrior
            id="T'baran"
            name= _ "T'baran"
            canrecruit=yes
            x=27
            y=14
        [/unit]
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Orcish Slayer
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer
#endif
        {GOLD 150 230 300}
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=fighter,fighter,archer,fighter,fighter,mixed fighter,scout
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
        {INCOME 4 8 12}
    [/side]

    [side]
        side=4
        no_leader=yes
        team_name=orcs
        [unit]
            type=Orcish Warrior
            id=Wrulf
            name= _ "Wrulf"
            canrecruit=yes
            x=7
            y=29
        [/unit]
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Orcish Slayer
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer
#endif
        {GOLD 150 230 300}

        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=scout,fighter,fighter,archer,scout,mixed fighter
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
        {INCOME 4 8 12}
    [/side]
    [side]
        side=5
        no_leader=yes
        team_name=orcs
        [unit]
            type=Orcish Warrior
            id=Qumseh
            name= _ "Qumseh"
            profile=portraits/orcs/warlord2.png
            canrecruit=yes
            x=28
            y=2
        [/unit]
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Orcish Slayer
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer
#endif
        {GOLD 150 230 300}

        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=fighter,fighter,archer,fighter,fighter,mixed fighter,scout
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
        {INCOME 4 8 12}
    [/side]
    [side]
        side=6
        team_name=orcs
        no_leader=yes
        [unit]
            type=Orcish Warrior
            id=Graur-Tan
            name= _ "Graur-Tan"
            profile=portraits/orcs/warlord.png
            canrecruit=yes
            x=2
            y=4
        [/unit]
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Orcish Slayer
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer
#endif
        {GOLD 150 230 300}

        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=fighter,scout,fighter,fighter,archer,scout,mixed fighter
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
        {INCOME 4 8 12}
    [/side]

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Kalenz must reach the signpost"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Landar"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=start

        [message]
            id=Kalenz
            message= _ "Orcs are pressing on us from all directions! To arms!"
        [/message]
        [message]
            id=Velon
            message= _ "Hold, Kalenz. The Ka'lian council should discuss our response. Maybe we can reach an agreement with them!"
        [/message]
        [message]
            id=Qumseh
            message= _ "Surrender or die, tree-shaggers!"
        [/message]
        [message]
            id=Velon
            message= _ "They are too many. We have no choice but to submit!"
        [/message]
        [message]
            id=Kalenz
            message= _ "Elves must never surrender to these foul beasts! Who will fight them beside me?"
        [/message]
        [message]
            id=Landar
            message= _ "We will follow you, Kalenz - but where can we go? We are surrounded!"
        [/message]
        [message]
            id=Kalenz
            message= _ "We must reach the elvish council in Ka'lian and enlist their help to recapture our home. Let's storm the orcs' southern outpost before more enemies arrive!"
        [/message]
        [message]
            id=Anduilas
            message= _ "Very well, Kalenz - lead us!"
        [/message]

        {HIGHLIGHT_IMAGE 1 30 scenery/signpost.png ()}
        [scroll_to_unit]
            id=Kalenz
        [/scroll_to_unit]
    [/event]

    [event]
        name=attack
        [filter_second]
            side=2
        [/filter_second]

        {INCIDENTAL_MUSIC the_king_is_dead.ogg}

        [message]
            id=Velon
            message= _ "We surrender!"
        [/message]
        [message]
            id=Graur-Tan
            message= _ "Did I mention that we take no prisoners? Die!"
        [/message]
        [message]
            id=Velon
            message= _ "Kalenz was right and I was wrong. Go; join Kalenz while yet you can. I and the remaining elders will cover your retreat as best we may."
        [/message]

        {MODIFY_UNIT (side=2) side 1 }
        {MODIFY_UNIT (id=Velon) canrecruit no}
        {TRANSFER_VILLAGE_OWNERSHIP 2 1}
    [/event]

    [event]
        name=moveto
        [filter]
            x=1
            y=30
            id=Kalenz
        [/filter]
        [message]
            id=Velon
            #TODO change theat speech after the string freeze
            message= _ "Flee, Kalenz...our hopes ride with you..."
        [/message]
        [message]
            id=Kalenz
            message= _ "We have escaped them, but we will not forget. We shall return!"
        [/message]
        [message]
            id=Graur-Tan
            message= _ "You won't get very far! After them!"
        [/message]
        [endlevel]
            result=victory
            bonus=yes
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            id=Wrulf
        [/filter]

        [filter_second]
            side=1
        [/filter_second]

        #TODO Make some speach about the loot
        {LOOT 50 1}
    [/event]

    [event]
        name="last breath"
        [filter]
            id=Velon
        [/filter]

        {INCIDENTAL_MUSIC sad.ogg}

        [message]
            id=Velon
            message= _ "Flee, Kalenz...our hopes ride with you..."
        [/message]
    [/event]

    [event]
        name=victory

        [kill]
            id=Velon
        [/kill]
    [/event]
    {@campaigns/Legend_of_Wesmere/utils/deaths.cfg}
[/scenario]
