#textdomain wesnoth-dm
[scenario]
    name=_ "Ur-Thorodor"
    id=08_ur_thorodor
    next_scenario=09_houses_of_the_dead
    {MEMOIRS_MAP island.map}
    turns=18
    victory_when_enemies_defeated=no

    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC elvish-theme.ogg}	# No story part, so no intro music
    {EXTRA_SCENARIO_MUSIC the_king_is_dead.ogg}
    {EXTRA_SCENARIO_MUSIC sad.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}

    [story]
        [part]
            delay=4000
            show_title=yes
            {TO_UR_THORODOR}
        [/part]
    [/story]

    #### Delfador's code ####
    [side]
        {YOUNG_DELFADOR}
        type=Journeyman Mage
        canrecruit=yes
        recruit=Mage,Spearman,Horseman,Bowman
        team_name=player
        user_team_name= _ "Player"
    [/side]
    [event]
        name=prestart
        {RECALL_OR_CREATE_UNIT {LIONEL} Lionel}
        # wmllint: recognize Lionel
        {MAKE_HERO Lionel}
    [/event]
    {STARTING_VILLAGES 1 4}
    #### /Delfador's code ####

    [side] # 23,11
        type=Ancient Wose
        id=Ur-Thorodor
        name= _ "Ur-Thorodor"
        profile=portraits/ur-thorodor.png
        side=2
        canrecruit=yes
        controller=ai
        recruit=Wose,Gryphon,Wose Shaman
        team_name=foe
        user_team_name= _ "Enemies"
        {GOLD 200 250 300}
        [ai]
            caution=0.8 # make him use those woses well
            recruitment_pattern=scout,fighter,mixed fighter
        [/ai]
    [/side]
    {LIMIT_RECRUITS 2 (Gryphon) 2}
    {STARTING_VILLAGES 2 6}

    [side]
        type=Orcish Warrior
        id=Tan-Garthak
        name= _ "Tan-Garthak"
        side=3
        canrecruit=yes
        controller=ai
        recruit=Orcish Warrior
        team_name=baddies
        user_team_name= _ "Enemies"
        no_leader=yes
        [target]
            id=Delfador
            value=100
        [/target]
    [/side]

    {MEMOIRS_DEATHS}

    [event]
        name=start

        [message]
            speaker=Lionel
            message=_"We have arrived. And there is the island Leollyn spoke of. But what are those strange shapes moving among the trees?"
        [/message]
        [message]
            speaker=Delfador
            message=_"I believe that they are woses - tree guardians. I have heard of them, but thought they were gone from Wesnoth forever. They are not evil, it is said, but yet they may be hostile to us. We had best be careful."
        [/message]
        [message]
            speaker=Ur-Thorodor
            message=_"I am Ur-Thorodor, eldest of the forest. Who are you human-creatures? You may not trespass on our island."
        [/message]
        [message]
            speaker=Delfador
            message=_"Ur-Thorodor, please let us pass! We are on a vital mission for King Garard, in the interests of all living things in Wesnoth."
        [/message]
        [message]
            speaker=Ur-Thorodor
            message=_"We care nothing for your kings, human-creatures. It is centuries since your kind have been here, and only now are our roots destroying the last of your accursed stonework. Now I will speak no more. Leave us, or suffer our wrath!"
        [/message]
        [message]
            speaker=Lionel
            message=_"This Ur-Thorodor should not speak of King Garard that way! 'Suffer our wrath' indeed... I'll show him wrath!"
        [/message]
        [message]
            speaker=Delfador
            message=_"It seems there is no alternative - we must get onto that island! Perhaps if we can get close to Ur-Thorodor, and speak with him again, he will understand."
        [/message]
        [objectives]
            side=1
            [objective]
                description=_ "Move Delfador to Ur-Thorodor's castle"
                condition=win
            [/objective]
            [objective]
                description=_ "Death of Delfador"
                condition=lose
            [/objective]
            [objective]
                description=_ "Death of Lionel"
                condition=lose
            [/objective]
            [objective]
                description=_ "Death of Ur-Thorodor"
                condition=lose
            [/objective]
            [objective]
                description=_ "Time runs out"
                condition=lose
            [/objective]
            note={NO_EARLY_FINISH_BONUS_NOTE}
        [/objectives]
    [/event]

    ### give the Woses a boost when their leader is first attacked
    [event]
        name=attack
        first_time_only=yes
        [filter_second]
            id=Ur-Thorodor
        [/filter_second]
        [gold]
            side=2
            amount=200
        [/gold]
        [message]
            speaker=Ur-Thorodor
            # wmllint: local spelling Hruuuarrgh
            message=_"Hruuuarrgh! The vile human-creatures hew at me..."
        [/message]
        [message]
            speaker=Delfador
            message=_"Ur-Thorodor, you must listen to us! A great evil power threatens all living things in Wesnoth - we must fight against it together, or all life here will perish."
        [/message]
        [message]
            speaker=Ur-Thorodor
            message=_"I trust no humans! Drive them out, my children!"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Ur-Thorodor
        [/filter]
        [message]
            speaker=unit
            message=_"I am defeated... My children: hear my last words! Destroy the humans, and never let them set foot on our island again!"
        [/message]
        [message]
            speaker=Delfador
            message=_"This is hopeless! If carrying out my mission means killing these noble creatures, then I cannot continue."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=moveto
        [filter]
            id=Delfador
            x=22,24,23,23
            y=10,10,12,11
        [/filter]

        [message]
            speaker=Delfador
            message=_"Ur-Thorodor, listen to me! We are not here to take your island. If you will let just me remain here, then I promise you, on behalf of King Garard, that no Wesnothian will set foot on your island without your permission again. As a token of good faith, I command my army to return to the mainland."
        [/message]
        [message]
            speaker=Lionel
            message=_"Are you sure that's wise?"
        [/message]
        [message]
            speaker=Delfador
            message=_"It's the only way! Lionel, lead our soldiers back to the mainland. I will rejoin you when I have carried out my mission, and determined what is amiss in the world of the dead."
        [/message]

        {SAVE_WESNOTH_VETERANS}

        [message]
            speaker=Ur-Thorodor
            message=_"I see I had misjudged you, human. You are not like those who came before. I accept your offer!"
        [/message]

        [message]
            speaker=narrator
            message=_"As the Wesnothians withdrew from the island, the woses melted away into the trees. Delfador began the meditation that would place him in contact with the spirit world.

But as Delfador's meditation deepened, and the woses sank into their timeless dreams of earth and trees, something else stirred on the island - for a few orcish scouts had indeed crossed the Ford of Abez..."
            image=wesnoth-icon.png
        [/message]

        [kill]
            side=2
        [/kill]

        [message]
            speaker=Delfador
            message=_"Ommmmmmm...."        # wmllint: no spellcheck
        [/message]

        [redraw]
        [/redraw]
        [delay]
            time=800
        [/delay]

        [move_unit_fake]
            type=Goblin Knight
            side=3
            x=21,21,22,23,24,24
            y=8,9,9,10,10,11
        [/move_unit_fake]
        [unit]
            type=Goblin Knight
            id=Gurbash
            side=3
            x,y=24,11
        [/unit]

        [move_unit_fake]
            type=Orcish Warrior
            side=3
            x=21,21,22,23
            y=8,9,9,10
        [/move_unit_fake]
        [unit]
            type=Orcish Warrior
            id=Pruark
            side=3
            x,y=23,10
        [/unit]

        [redraw]
        [/redraw]
        [delay]
            time=800
        [/delay]

        [message]
            side=3
            speaker=Pruark
            message=_"A human mage... is it dead?"
        [/message]
        [message]
            side=3
            speaker=Gurbash
            message=_"Easy to find out... thump it and see if it wakes up!"
        [/message]
        [message]
            speaker=narrator
            message=_"THUMP!"
            image=wesnoth-icon.png
        [/message]
        [colour_adjust]
            red=-32
            green=-32
            blue=-32
        [/colour_adjust]
        [delay]
            time=10
        [/delay]
        [colour_adjust]
            red=-64
            green=-64
            blue=-64
        [/colour_adjust]
        [delay]
            time=10
        [/delay]
        [colour_adjust]
            red=-128
            green=-128
            blue=-128
        [/colour_adjust]
        [delay]
            time=10
        [/delay]
        [kill]
            side=3
        [/kill]
        [colour_adjust]
            red=-255
            green=-255
            blue=-255
        [/colour_adjust]

        [endlevel]
            result=victory
            carryover_report=no
            #result=continue
            bonus=no
        [/endlevel]
    [/event]
[/scenario]
