#textdomain wesnoth-nr
[scenario]
    id=slave_of_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/slave_of_the_undead.map}"

    {TURNS4 45 41 38 35}
    {UNDERGROUND}

    next_scenario=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]
            [objective]
                condition=lose
                description=_ "Turns run out"
            [/objective]
        [/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
        {GOLD4 100 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]

        [unit]
            type=Dwarvish Stalwart
            x=15
            y=10
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Bandit
            x=12
            y=7
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Bandit
            x=18
            y=7
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Poacher
            x=13
            y=7
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Thug
            x=11
            y=7
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Poacher
            x=17
            y=7
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Thug
            x=19
            y=7
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Dwarvish Fighter
            x=14
            y=9
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Dwarvish Thunderer
            x=15
            y=9
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Dwarvish Fighter
            x=16
            y=9
            side=2
            ai_special=guardian
        [/unit]

        [unit]
            type=Dwarvish Steelclad
            x=16
            y=4
            side=2
        [/unit]

        [unit]
            type=Bandit
            x=14
            y=4
            side=2
        [/unit]

        [unit]
            type=Trapper
            x=15
            y=4
            side=2
        [/unit]

        [unit]
            type=Swordsman
            x=16
            y=3
            side=2
        [/unit]

        [unit]
            type=Ghost
            x=14
            y=25
            side=1
        [/unit]

        [unit]
            type=Ghost
            x=16
            y=25
            side=1
        [/unit]

        [unit]
            type=Ghost
            x=15
            y=26
            side=1
        [/unit]

        [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= _ "HAHAHAHAHA!"
        [/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= _ "Ahhhh!"
        [/message]

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