#textdomain wesnoth-nr
[scenario]
    id=06b_Slave_of_the_Undead
    name= _ "Slave of the Undead"

    [story]
        [part]
            story= _ "Having completed his mission, Tallin reported back to his master."
        [/part]

        [part]
            story= _ "Well done, my loyal slave. I see you have successfully completed your mission."
            background=portraits/Malifor.png
        [/part]

        [part]
            story= _ "Yes, Master."
            background=portraits/Tallin-Evil.png
        [/part]

        [part]
            story= _ "Very well. Now, I have a new mission for you. Your old friends are becoming a bit of an annoyance. Instead of just giving up as they should, they keep foolishly attempting to attack me time and again. This time they have attacked and seized one of the northern entrances. Although I can easily defeat them as I have done several times when you were in training, this time I want you to take care of them in a more... final way. Consider it a test of your loyalty."
            background=portraits/Malifor.png
        [/part]

        [part]
            story= _ "... As you command, Master."
            background=portraits/Tallin-Evil.png
        [/part]

        [part]
            story= _ "Good boy. Now, I am giving you the power to raise more powerful types of undead. In addition, I will put under you command a few disembodied spirits as well as some of my more promising adepts. Use them wisely. Now, go and destroy those vermin!"
            background=portraits/Malifor.png
        [/part]

        [part]
            story= _ "Upon hearing the order of his master to kill his friends, something that had been dormant inside Tallin these last few months revolted. But the magical control that Malifor had over him was so great that he had no choice but to obey his master. Thus, with his own will madly struggling to break free of the lich, Tallin made his way to the northern entrance."
        [/part]
    [/story]

    map_data="{campaigns/Northern_Rebirth/maps/06b_Slave_of_the_Undead.map}"

    {TURNS 41 38 35}
    {UNDERGROUND}

    next_scenario=07b_Protecting_the_Master

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                condition=win
                description=_ "Destroy the Invaders"
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Tallin"
            [/objective]

            {TURNS_RUN_OUT}
        [/objectives]
    [/event]

    [side]
        type=Peasant
        id=Tallin
        name=_ "Tallin"
        canrecruit=yes
        side=1
        controller=human
        gold=100
        recruit=Walking Corpse,Skeleton,Skeleton Archer
        team_name=mob
        user_team_name=_"Minions"
    [/side]

    [side]
        type=Swordsman
        id=Friend
        name=_ "Friend"
        canrecruit=yes
        side=2
        {GOLD 150 200 250}
        recruit=Thug,Poacher,Peasant,Footpad
        [ai]
            recruitment_pattern=scout,fighter,fighter,fighter,archer
        [/ai]

        [village]
            x=11
            y=2
        [/village]

        [village]
            x=19
            y=2
        [/village]

        [village]
            x=10
            y=8
        [/village]

        [village]
            x=20
            y=8
        [/village]
    [/side]

    [event]
        name=start
        [kill]
            id=Friend
        [/kill]

        [unit]
            type=$betrayed_friend.type
            side=2
            x=15
            y=3
            id=Betrayed Friend
            name=$betrayed_friend.name
            canrecruit=yes
            experience=$betrayed_friend.experience
            hitpoints=$betrayed_friend.hitpoints
        [/unit]

        {GENERIC_UNIT 2 (Dwarvish Stalwart)  15 10} {GUARDIAN}
        {GENERIC_UNIT 2 (Bandit)             12  7} {GUARDIAN}
        {GENERIC_UNIT 2 (Bandit)             18  7} {GUARDIAN}
        {GENERIC_UNIT 2 (Poacher)            13  7} {GUARDIAN}
        {GENERIC_UNIT 2 (Poacher)            17  7} {GUARDIAN}
        {GENERIC_UNIT 2 (Thug)               11  7} {GUARDIAN}
        {GENERIC_UNIT 2 (Thug)               19  7} {GUARDIAN}
        {GENERIC_UNIT 2 (Dwarvish Fighter)   14  9} {GUARDIAN}
        {GENERIC_UNIT 2 (Dwarvish Fighter)   16  9} {GUARDIAN}
        {GENERIC_UNIT 2 (Dwarvish Thunderer) 15  9} {GUARDIAN}
        {GENERIC_UNIT 2 (Dwarvish Steelclad) 16  4}
        {GENERIC_UNIT 2 (Bandit)             14  4}
        {GENERIC_UNIT 2 (Trapper)            15  4}
        {GENERIC_UNIT 2 (Swordsman)          16  3}
        {GENERIC_UNIT 1 (Ghost) 14 25}
        {GENERIC_UNIT 1 (Ghost) 16 25}
        {GENERIC_UNIT 1 (Ghost) 15 26}

        [unit]
            type=Dark Adept
            id=James
            name= _ "James"
            x=14
            y=26
            side=1
        [/unit]

        [unit]
            type=Dark Adept
            id=Aledor
            name= _ "Aledor"
            x=16
            y=26
            side=1
        [/unit]

        [message]
            speaker=Betrayed Friend
            message= _ "My God! Tallin is that you?"
        [/message]

        [message]
            speaker=Tallin
            image=portraits/Tallin-Evil.png
            message= _ "$betrayed_friend.name, I..."
        [/message]

        [message]
            speaker=Betrayed Friend
            message= _ "Come on, Tallin, talk to me!"
        [/message]

        [message]
            speaker=Tallin
            image=portraits/Tallin-Evil.png
            message= _ "..."
        [/message]

        [message]
            speaker=Betrayed Friend
            message= _ "Tallin, break free! Don’t let that lich control you!"
        [/message]

        [message]
            speaker=Tallin
            image=portraits/Tallin-Evil.png
            message= _ "... KILL THE RABBLE!"
        [/message]

        [message]
            speaker=Betrayed Friend
            message= _ "No, Tallin! Stop!"
        [/message]

        [message]
            speaker=narrator
            message= _ "Deaf to the calls of his friend, Tallin commenced the attack."
            image=wesnoth-icon.png
        [/message]
    [/event]

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

        [message]
            speaker=Tallin
            image=portraits/Tallin-Evil.png
            message= _ "Argh! I have failed my master."
        [/message]

        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=victory
        [message]
            speaker=Tallin
            image=portraits/Tallin-Evil.png
            message= _ "What have I done...?"
        [/message]
    [/event]

    [event]
        name=time over

        [move_unit_fake]
            type=Ancient Lich
            side=2
            x=20,20,20,19,18
            y=30,29,28,28,27
        [/move_unit_fake]

        [unit]
            type=Ancient Lich
            id=Malifor
            name= _ "Malifor"
            profile=portraits/Malifor.png
            x=18
            y=27
            side=2
        [/unit]

        [message]
            speaker=Malifor
            message= _ "You fool! You have spared the humans and betrayed me! But I am not concerned, I had already foreseen that possibility."
        [/message]

        [scroll]
            x=5
            y=0
        [/scroll]
        [delay]
            time=10
        [/delay]
        [scroll]
            x=-10
            y=0
        [/scroll]
        [delay]
            time=10
        [/delay]
        [scroll]
            x=0
            y=5
        [/scroll]
        [delay]
            time=10
        [/delay]
        [scroll]
            x=0
            y=-10
        [/scroll]

        [message]
            speaker=Betrayed Friend
            message= _ "What the... everybody get out! The roof of the cave is collapsing!"
        [/message]

        [message]
            speaker=Malifor
            message= _ "HAHAHA!"
        [/message]

        [kill]
            id=Malifor
        [/kill]

        [move_unit_fake]
            type=Ancient Lich
            side=2
            x=18,19,20,20,20
            y=27,28,28,29,30
        [/move_unit_fake]

        [terrain]
            x=2-29
            y=2-29
            terrain=Xu
        [/terrain]
    [/event]

    [event]
        name=defeat
        [message]
            speaker=Tallin
            image=portraits/Tallin-Evil.png
            message= _ "Ahhh!"
        [/message]

        [kill]
            side=1
            animate=yes
        [/kill]
    [/event]
[/scenario]
