#textdomain wesnoth-nr
[scenario]
    id=clearing_the_mines
    name= _ "Clearing the Mines"
    {SCENARIO_MUSIC "battle.ogg"}
    {VICTORY_AND_DEFEAT_MUSIC}

    map_data="{campaigns/Northern_Rebirth/maps/clearing_the_mines.map}"

    {TURNS4 85 75 65 55}
    {STARTING_VILLAGES 1 5}
    {UNDERGROUND}

    next_scenario=pursuit

    [side]
        type=Peasant
        description=Tallin
        user_description=_ "Tallin"
        canrecruit=yes
        side=1
        controller=human
        {GOLD4 550 450 400 350}
        recruit=Peasant,Woodsman,Thug,Poacher,Dwarvish Fighter,Dwarvish Thunderer,Footpad
        team_name=mob
    [/side]

    [side]
        type=Ancient Lich
        description=Malifor
        user_description= _ "Malifor"
        profile=portraits/Malifor.jpg
        canrecruit=yes
        side=2
        {GOLD4 100 125 150 200}
        income=15
        recruit=Dark Adept,Walking Corpse,Blood Bat,Skeleton,Skeleton Archer,Ghost
        team_name=undead
    [/side]

    [side]
        type=Draug
        description=Thorin
        user_description=_ "Thorin"
        canrecruit=yes
        side=3
        {GOLD4 100 125 150 200}
        recruit=Walking Corpse,Skeleton,Skeleton Archer,Vampire Bat
        team_name=undead
    [/side]

    [side]
        type=Draug
        description=Herlin
        user_description=_ "Herlin"
        canrecruit=yes
        side=4
        {GOLD4 100 125 150 200}
        recruit=Walking Corpse,Skeleton,Skeleton Archer,Vampire Bat
        team_name=undead
    [/side]

    [side]
        type=Draug
        description=Fervin
        user_description=_ "Fervin"
        canrecruit=yes
        side=5
        {GOLD4 100 125 150 200}
        recruit=Walking Corpse,Skeleton,Skeleton Archer,Vampire Bat
        team_name=undead
    [/side]

    [side]
        type=Draug
        description=Hellian
        user_description=_ "Hellian"
        canrecruit=yes
        side=6
        {GOLD4 100 125 150 200}
        recruit=Walking Corpse,Skeleton,Skeleton Archer,Vampire Bat
        team_name=undead
    [/side]

    {campaigns/Northern_Rebirth/utils/herodeaths.cfg}
    {DEFEAT_WHEN_HAMEL_DEAD}

    [event]
        name=prestart

        [hide_unit]
            x=33
            y=6
        [/hide_unit]
    [/event]

#define TEMPTATION_OF_TALLIN
    # wmllint: recognize Hamel
    [message]
        description=Malifor
        message= _ "But my my, what do we have here - Tallin."
    [/message]

    [message]
        role=Supporter

        message= _ "He knows your name, Tallin. I don't like the looks of this."
    [/message]

    [message]
        description=Malifor
        message= _ "Oh yes, I know you, Tallin. I have been watching you for a long time. You are a perfect candidate to become one of my immortal generals."
    [/message]

    [message]
        description=Tallin
        message= _ "....!"
    [/message]

    [message]
        description=Malifor
        message= _ "Look around you Tallin, see all the power, see all of the wealth, the glory, the pleasure that the realm of death has to offer. Think of the great empire of Knalga; it can be yours. Come share it with me!"
    [/message]

    [message]
        role=Supporter

        message= _ "Tallin, are you OK?!"
    [/message]

    [message]
        description=Malifor
        message= _ "It's very easy, Tallin, see that little vermin by your side? Take out your knife...... cut his throat .......feel his hot blood pump over your hands..... sacrifice him to death!"

        [option]
            message= _ "......die.... you..... little.....dwarf.....vermin!"
            [command]
                [message]
                    role=Supporter

                    message= _ "Tallin! No!"
                [/message]

                [message]
                    description=Hamel
                    message= _ "Tallin, what are you doing?"
                [/message]

                [message]
                    description=Tallin
                    message= _ ".....Death!..... Blood!...."
                [/message]

                {MODIFY_UNIT description=Tallin profile portraits/Tallin-Evil.jpg}

                [sound]
                    name=dagger-swish.wav
                [/sound]

                [delay]
                    time=50
                [/delay]

                [sound]
                    name=dwarf-hit-3.ogg
                [/sound]

                [message]
                    description=Hamel
                    message= _ "Ahhh! Treacherous human! Kill him, men!"
                [/message]

                [message]
                    description=Malifor
                    message= _ "HAHAHAHAHAHAHA!"
                [/message]

                [sound]
                    name=fire.wav
                [/sound]
                [sound]
                    name=ugg.wav
                [/sound]

                [colour_adjust]
                    red=100
                    green=100
                    blue=100
                [/colour_adjust]

                [delay]
                    time=10
                [/delay]

                [colour_adjust]
                    red=0
                    green=0
                    blue=0
                [/colour_adjust]

                [teleport]
                    [filter]
                        description=Tallin
                    [/filter]
                    x=34
                    y=6
                [/teleport]

                [message]
                    description=Hamel
                    message= _ "What the! Where did he go?"
                [/message]

                [message]
                    description=Malifor
                    message= _ "Right here with me, fools! He is mine now."
                [/message]

                [disallow_recruit]
                    side=1
                    type=Dwarvish Fighter,Dwarvish Thunderer,Peasant,Thug,Poacher,Woodsman,Footpad
                [/disallow_recruit]

                [store_unit]
                    [filter]
                        role=Supporter
                    [/filter]
                    variable=betrayed_friend
                [/store_unit]

                [set_variable]
                    name=turned_evil
                    value=1
                [/set_variable]

                [endlevel]
                    # Disable this option in 1.4.
                    #    result=victory
                    #    bonus=no
                    #    next_scenario=compelled
                    result=defeat
                [/endlevel]
            [/command]
        [/option]

        [option]
            message= _ " *Shakes head* I reject your evil. Attack, men! Let us rid the good green world of this rotting filth!"
            [command]
                [message]
                    description=Hamel
                    message= _ "Aye! That's the way of it, lad! For the murdered dwarves of Knalga! Attack!"
                [/message]

                [message]
                    description=Malifor
                    message= _ "You fool! You will pay for your folly with your life."
                [/message]

                [message]
                    description=Tallin
                    message= _ "Yeah, right, buddy."
                [/message]
            [/command]
        [/option]
    [/message]
#enddef

    [event]
        name=start

        {SUPPORTER}
        [recall]
            role=Supporter
        [/recall]

        [role]
            type=Dwarvish Fighter
            role=man1
        [/role]
        [recall]
            role=man1
        [/recall]

        [role]
            type=Dwarvish Thunderer
            role=man2
        [/role]

        [recall]
            role=man2
        [/recall]

        [recall]
            description=Camerin
        [/recall]

        [recall]
            description=Hamel
        [/recall]

        [unit]
            type=Skeleton
            x=11
            y=24
            side=3
            ai_special=guardian
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=11
            y=22
            side=3
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=16
            y=18
            side=3
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=15
            y=19
            side=3
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=8
            y=17
            side=3
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=5
            y=18
            side=3
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=8
            y=13
            side=6
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=9
            y=14
            side=6
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=9
            y=13
            side=6
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=10
            y=9
            side=6
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=12
            y=8
            side=6
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=18
            y=7
            side=6
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=18
            y=9
            side=6
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=24
            y=7
            side=6
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=24
            y=9
            side=6
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=14
            y=19
            side=3
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=29
            y=7
            side=2
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=29
            y=10
            side=2
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=28
            y=7
            side=2
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=28
            y=9
            side=2
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=28
            y=11
            side=2
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=27
            y=11
            side=2
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=33
            y=10
            side=2
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=28
            y=17
            side=5
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=29
            y=21
            side=5
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=32
            y=14
            side=5
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=35
            y=22
            side=5
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=37
            y=20
            side=5
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=35
            y=22
            side=5
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=37
            y=24
            side=5
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=37
            y=25
            side=5
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=38
            y=24
            side=5
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=33
            y=27
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=35
            y=29
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=28
            y=29
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=30
            y=31
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=32
            y=32
            side=4
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=33
            y=32
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=29
            y=34
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=29
            y=35
            side=4
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=30
            y=34
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=20
            y=32
            side=4
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=21
            y=32
            side=4
        [/unit]

        [unit]
            type=Skeleton Archer
            ai_special=guardian
            x=19
            y=32
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=24
            y=24
            side=4
        [/unit]

        [unit]
            type=Skeleton
            ai_special=guardian
            x=26
            y=25
            side=4
        [/unit]

        [message]
            speaker=narrator
            message= _ "When the party finally reached the mines they were not disappointed."
            image=wesnoth-icon.png
        [/message]

        [message]
            description=Hamel
            message= _ "Behold! The Dwarven Mines."
        [/message]

        [message]
            description=Hamel
            message= _ "Look at yon canal. Dwarves built it to transport mined metals deeper into Knalga. And d'ye ken those two rooms, one to the norr-west and the other to the south-east? If we'd justa' capture those rooms we would gain o' great tactical advantage."
        [/message]

        [message]
            role=Supporter

            message= _ "Grim gods of darkness! The whole place is swarming with undead! They have raised corpses to do their work."
        [/message]

        [message]
            description=Tallin
            message= _ "And they seem to have good security, too. Look, most of the fortifications are repaired and they have those nasty skeletons everywhere."
        [/message]

        [message]
            role=Supporter

            message= _ "Fortunately, this entrance seems to be in disrepair. It doesn't look like they have noticed us yet."
        [/message]

        [message]
            description=Thorin
            message= _ "WHO GOES THERE?"
        [/message]

        [message]
            role=Supporter

            message= _ "Oops, I spoke too soon."
        [/message]

        [message]
            description=Hamel
            message= _ " *wince* You can turn the volume down, pal."
        [/message]

        [message]
            description=Camerin
            message= _ "Maybe he needs a fireball..."
        [/message]

        [message]
            description=Thorin
            message= _ "YOU DO NOT ANSWER. ALERT THE MASTER!"
        [/message]

        [move_unit_fake]
            type=Ancient Lich
            side=2
            x=40,39,38,37,36,35,34,33,33
            y=1,2,2,3,3,4,4,5,6
        [/move_unit_fake]

        [unhide_unit]
            description=Malifor
        [/unhide_unit]

        [message]
            description=Malifor
            message= _ "Who goes there? Ahhh, more slaves, I see."
        [/message]

        [message]
            description=Tallin
            message= _ "Others have made that mistake before. Who are you?"
        [/message]

        [message]
            description=Malifor
            message= _ "Who am I? *CACKLES WILDLY* I am Malifor the Great, the master of death! These tunnels, haunted by the ghosts of the dead dwarves of Knalga, are the domain of my power."
        [/message]

        [message]
            description=Hamel
            message= _ "You dared disturb the rest of those brave dwarves? You shall pay in blood!"
        [/message]

        [message]
            description=Malifor
            message= _ "HAHAHAHA! Your petty temper tantrums are most amusing, you puny dwarf. Soon I will finish the slaughter that the orcs have begun so promisingly, and Knalga will be all mine! From there I will sweep the whole north of all living creatures, and then swoop down upon Wesnoth!"
        [/message]

        [message]
            description=Hamel
            message= _ "Quit your ranting, you wretched bag of bones! Prepare to return to the dust!"
        [/message]

        [message]
            description=Malifor
            message= _ "HAHAHAHAHAHA! Such vast threats from one so small? HAHAHAHA!"
        [/message]

        {TEMPTATION_OF_TALLIN}

        [objectives]
            side=1
            [objective]
                description= _ "Clear the Mines"
                condition=win
            [/objective]

            [objective]
                description= _ "Death of Tallin"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Hamel"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns Run Out"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=die
        [filter]
            description=Malifor
        [/filter]

        [message]
            description=Malifor
            message= _ "HAHAHAHA, you puny weaklings think you can destroy me? FOOLS! You will all soon be serving me!"
        [/message]

        {FLASH}

        [message]
            speaker=second_unit
            message= _ "Oh no, he just.... disappeared."
        [/message]
    [/event]

    [event]
        name=victory

        [if]
            [variable]
                name=turned_evil
                numerical_equals=0
            [/variable]

            [then]
                [message]
                    description=Tallin
                    message= _ "We have finally secured the mines. But what should we do about that foul lich? He is a menace to all that lives, and must be ended."
                [/message]

                [message]
                    description=Hamel
                    message= _ "Aye! We'll have to lay both his skeletons and himself to final rest before these caves will be fit for dwarvenkind again."
                [/message]

                [message]
                    description=Tallin
                    message= _ "But I'm sore vexed. We need better weapons, Luck and spirit can carry us only so far."
                [/message]

                [message]
                    description=Hamel
                    message= _ "Aye. We must do both. I'm thinking it might be best if I muster my folk to start on the weapon-making while you and your followers pursue yon lich. By the time you've laid him to final rest and return here, we'll ha' made a good start on the work."
                [/message]

                [message]
                    description=Tallin
                    message= _ "So it shall be."
                [/message]

                [role]
                    type=Dwarvish Steelclad,Dwarvish Fighter,Dwarvish Dragonguard,Dwarvish Thunderguard,Dwarvish Thunderer
                    role=follower
                [/role]

                [message]
                    role=follower
                    message= _ "With all respect, Lord Hamel, some o' us would like to fare forth with Tallin. He's lucky, he is - or he makes his own luck."
                [/message]

                [message]
                    description=Hamel
                    message= _ "And so it shall be. You've my leave and welcome. Try to keep the lad safe..."
                [/message]

                [message]
                    role=follower
                    message= _ "Thank you, Lord Hamel."
                [/message]

                # Lord Hamel becomes unavailable for following scenarios,
                # until the big showdown.
                [kill]
                    description=Hamel
                [/kill]

                [disallow_recruit]
                    side=1
                    type=Dwarvish Fighter,Dwarvish Thunderer
                [/disallow_recruit]

                [endlevel]
                    result=victory
                    bonus=yes
                [/endlevel]
            [/then]
        [/if]
    [/event]

    [event]
        name=turn 20

        [message]
            description=Malifor
            message= _ "These little vermin are making progress! This is unacceptable. Rise my minions - gorge on the flesh of these scurrying little rats!"
        [/message]

        [terrain]
            x=13,14,15,15,16,17,18,19,20,21,22,23,25,25,26,27,31,30,29,30,30,30,30,29,29,29,29,29,29,29,28,27,27,27,26,25,24,25,25,24,30
            y=11,11,11,10,9,10,10,10,9,10,9,10,10,10,9,10,5,5,6,6,7,8,10,11,12,13,14,15,16,18,18,19,20,21,21,22,21,23,24,10,9
            terrain=Ss
        [/terrain]

        [terrain]
            terrain=Ss^Bw|
            x=28
            y=10
        [/terrain]
        [terrain]
            terrain=Ss^Bw/
            x=30,29,25
            y=8,17,25
        [/terrain]

        [message]
            description=Tallin
            message= _ "Look out everyone, something is coming out of the canals! Already the water is churning and clogging with their filth. Get back and brace yourselves."
        [/message]
    [/event]

    [event]
        name=turn 21

        [unit]
            type=Necrophage
            x=28
            y=10
            side=2
            description=Necrophage
        [/unit]

        {GHOUL 13 11}
        {GHOUL 15 11}
        {NECROPHAGE 14 11}
        {GHOUL 15 10}
        {GHOUL 16 9}
        {GHOUL 17 10}
        {GHOUL 19 10}
        {GHOUL 20 9}
        {GHOUL 21 10}
        {NECROPHAGE 18 10}
        {GHOUL 22 9}
        {GHOUL 23 10}
        {NECROPHAGE 24 10}
        {GHOUL 25 10}
        {GHOUL 26 9}
        {GHOUL 27 10}
        {GHOUL 30 9}
        {GHOUL 30 10}
        {GHOUL 29 11}
        {NECROPHAGE 30 8}
        {NECROPHAGE 30 7}
        {GHOUL 30 6}
        {GHOUL 29 6}
        {GHOUL 29 12}
        {GHOUL 29 13}
        {GHOUL 29 14}
        {NECROPHAGE 29 17 }
        {GHOUL 29 15}
        {GHOUL 29 16}
        {GHOUL 29 18}
        {GHOUL 28 18}
        {GHOUL 27 19}
        {GHOUL 27 20}
        {NECROPHAGE 27 21}
        {GHOUL 26 21}
        {GHOUL 25 22}
        {NECROPHAGE 24 21}
        {GHOUL 25 23}
        {GHOUL 25 24}
        {NECROPHAGE 25 25}

        [message]
            description=Necrophage
            message= _ "FOOOOOOOD!"
        [/message]

        {SUPPORTER}
        [message]
            role=Supporter
            message= _ "Holly Lords of Light, what kind of vile creation are those things!"
        [/message]

        [if]
            [have_unit]
                description=Camerin
            [/have_unit]

            [then]
                [message]
                    description=Camerin
                    message= _ "Out of all of a necromancer's creations, I must say those things are the most tortured and vilest. They have an insatiable hunger for flesh and mindlessly shrug of all manner of damage to get it. Even my fire bolts have a slightly lesser effect on them."
                [/message]

                [message]
                    description=Camerin
                    message= _ "Oh, and try to stay away from their claws. If you get even one scratch, and don't get it treated quickly, you will soon find yourself week, sick and unable to fight further."
                [/message]
            [/then]
        [/if]

        [message]
            description=Hamel
            message= _ "Pah! They look like fat slugs to me. Come on boys, lets chop them to pieces before they can leave the canal."
        [/message]
    [/event]
[/scenario]
