#textdomain wesnoth-dm
[scenario]
    name=_ "Leollyn"
    id=04_leollyn
    next_scenario=05_council_in_weldyn
    {MEMOIRS_MAP leollyn.map}
    turns=24
    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC loyalists.ogg}	# No story text, so no intro music
    {EXTRA_SCENARIO_MUSIC northerners.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}
    {EXTRA_SCENARIO_MUSIC elvish-theme.ogg}

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

    [side]
        {YOUNG_DELFADOR}
        type=Journeyman Mage
        canrecruit=yes
        #TODO goodies is not a good teamname
        team_name=goodies

        recruit={LOYALISTS}
    [/side]
    [event]
        name=prestart
        # bowmen said they would "come with you"
        [recall]
            type=Master Bowman,Longbowman,Bowman
        [/recall]
        [recall]
            type=Master Bowman,Longbowman,Bowman
        [/recall]
    [/event]

    [side]
        type=Orcish Slayer
        id=Hagha-Tan
        name= _ "Hagha-Tan"
        side=2
        controller=ai
        canrecruit=yes
        recruit=Wolf Rider, Orcish Assassin, Orcish Archer
        [ai]
            recruitment_pattern=scout, mixed fighter, mixed fighter, archer
            # there are a lot of close villages
            villages_per_scout=6

            # attack Delfador more heavily than Leollyn
            leader_value=2.0
            [target]
                id=Delfador
                value=3.0
            [/target]
        [/ai]
        {GOLD 200 200 300}
        team_name=baddies
    [/side]

    [side]
        type=Arch Mage
        id=Leollyn
        name= _ "Leollyn"
        side=3
        controller=ai
        canrecruit=yes
        recruit=Red Mage,White Mage
        [ai]
            recruitment_pattern=mixed fighter,mixed fighter,healer
            aggression=0.0
        [/ai]
        gold=0
        income=8
        team_name=goodies
        {UNIT 3 Spearman 2 18 (ai_special=guardian)}
        {UNIT 3 Spearman 4 18 (ai_special=guardian)}
    [/side]

    {MEMOIRS_DEATHS}

    #############################
    # defeat player if leollyn is killed
    #############################
    [event]
        name=die
        [filter]
            id=Leollyn
            side=3
            type=Arch Mage
        [/filter]
        [message]
            speaker=Delfador
            message=_"Leollyn is slain! This is terrible... I had best give up and return home."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description=_ "Defeat Hagha-Tan"
                condition=win
            [/objective]
            [objective]
                description=_ "Death of Delfador"
                condition=lose
            [/objective]
            [objective]
                description=_ "Death of Leollyn"
                condition=lose
            [/objective]
            [objective]
                description=_ "Time runs out"
                condition=lose
            [/objective]
            note={EARLY_FINISH_BONUS_NOTE}
        [/objectives]
    [/event]

    #############################
    # opening dialog
    #############################
    [event]
        name=start
        [message]
            speaker=Delfador
            message=_"Methor told me that I could find Leollyn in his tower in the Royal Forest outside the city. It should be near here..."
        [/message]
        [message]
            speaker=Hagha-Tan
            message=_"Ah, another human is approaching... yes... more meat for my war-band..."
        [/message]
        [message]
            speaker=Leollyn
            message=_"Hail, strangers to the west! I crave your aid; hurry, for we are sorely besieged!"
        [/message]
        [message]
            speaker=Delfador
            message=_"Well met, Leollyn! My friends and I will roust this barbarian for you. We're getting used to such work by now - I did not expect to have so much trouble getting here!"
        [/message]
        [message]
            speaker=Leollyn
            message=_"Then you have not heard... but there will be time enough for talking. If you can distract those vile creatures, I will try to organize a counterattack."
        [/message]
    [/event]

    #############################
    # alert player before they face poison
    #############################
    [event]
        name=attack
        [filter]
            type=Orcish Assassin
        [/filter]
        [filter_second]
            side=1
        [/filter_second]
        [message]
            speaker=Hagha-Tan
            message=_"Yes... yes... slay them, my assassins!"
        [/message]
        [message]
            speaker=second_unit
            message=_"Uh oh... I don't like the look of this..."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            type=Orcish Assassin
        [/filter]
        [filter_second]
            side=1
        [/filter_second]
        [message]
            speaker=Delfador
            message=_ "Their blood sheds as readily as any man's."
        [/message]
        [message]
            speaker=Leollyn
            message=_"You are a brave fighter, young friend."
        [/message]
    [/event]

    [event]
        #TODO I don't like that dialogue.
        name=die
        [filter]
            side=1
        [/filter]
        [filter_second]
            type=Orcish Assassin,Orcish Slayer
        [/filter_second]
        [message]
            speaker=Leollyn
            message=_ "I've told you, all of you have to be extra careful!"
        [/message]
        [message]
            speaker=Delfador
            message=_"Kill them all! For our murdered friends."
        [/message]
    [/event]

    #############################
    # closing dialog
    #############################
    [event]
        name=victory
        [message]
            speaker=Leollyn
            message=_"Well now, you arrived just in the nick of time. A fellow mage, too, I see. Now what did you say your name was?"
        [/message]
        [if]
            [variable]
                name=Methor
                equals=1
            [/variable]
            [then]
                [message]
                    speaker=Delfador
                    message=_"Delfador, sir. Actually, I came seeking you - you see, I was a student of Methor's. He said that you might find me employment in Weldyn."
                [/message]
                [message]
                    speaker=Leollyn
                    message=_"Ah, one of Methor's, eh? Good, good... Well, young Garard certainly needs all the hands he can muster right now. Especially those who know their magic!"
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Delfador
                    message=_"Delfador, sir. But I bring you ill news... Methor, my teacher, is dead."
                [/message]
                [message]
                    speaker=Leollyn
                    message=_"That is ill news indeed... these are dark times. I think you had best return with me to Weldyn. Garard too, must hear your news."
                [/message]
            [/else]
        [/if]
        [message]
            speaker=Delfador
            message=_"Is that Garard, King of Wesnoth, you refer to?!"
        [/message]
        [message]
            speaker=Leollyn
            message=_"Of course - do you know any other kings by that name? I was one of his father's most trusted advisors until he passed away earlier this year, and I still have the son's ear, though being young he listens perhaps less well than he should."
        [/message]
    [/event]

    [event]
        name=enemies defeated
        [endlevel]
            result=victory
            save=no
        [/endlevel]
    [/event]
[/scenario]
