#textdomain wesnoth-nr

[scenario]
    id=02_01_Infested_Caves
    name= _ "Infested Caves"
    map_data="{campaigns/Northern_Rebirth/maps/02_01_Infested_Caves.map}"
    {TURNS 55 50 45}
    next_scenario=02_02_Meeting_With_Dwarves

    {UNDERGROUND}

    {SCENARIO_MUSIC       underground.ogg}
    {EXTRA_SCENARIO_MUSIC revelation.ogg}
    {EXTRA_SCENARIO_MUSIC knalgan_theme.ogg}

    [story]
        [part]
            music=knolls.ogg
            story= _ "Ill-armed and untrained though they were, the people of Dwarven Doors rose against the Orcs. Although their losses had been tremendous, never once did they break or falter. In the end, the orcish host was smashed and the survivors sent scurrying for their lives."
        [/part]
        [part]
            story= _ "Grief for the fallen could not suppress the people’s joy in their newfound freedom. They ransacked the orcish storehouses, sang, danced and drank with abandon. New-fledged warriors boasted of their deeds in the battle, while the women and children looked on with awe."
        [/part]
        [part]
            story= _ "Amidst all the revelry, Tallin alone remained grave. He knew it likely that the orcs would return with a vengeance and slaughter every last one of them. The following morning, he gathered the cooler heads about him so they could set their next course. How might they, untrained in the art of war and without expectation of aid from the prosperous human lands of the south, defend themselves?"
        [/part]
        [part]
            story= _ "The war council’s thoughts quickly turned to the dwarves, close allies in the past. However, nobody knew the state of things in the Knalgan tunnels. The bravest of scouts found in there the spoor of many trolls, and of creatures darker than trolls. It was even rumored that the dwarven dead from the invasion of Knalga had risen in unlife, roaming the tunnels to slay the living. Fighting through all manner of unknown monsters in the mere hope of finding surviving dwarves held but little appeal."
        [/part]
        [part]
            # wmllint: local spelling woodsrunners
            story= _ "So the matter lay, and the peasants dithered from one suggested plan of action to the next, never arriving at any conclusion. In the meantime, some help, unlooked for, arrived in the form of a small band of woodsrunners — escapees from the orcs, grown wood-wise and crafty, and in contact with larger bands of poachers and outlaws roaming the night. Embassies were sent; agreements made. A handful of experienced fighters, scarred and closemouthed, came to Dwarven Doors to find and train the most willing in their rugged fighting style."
        [/part]
        [part]
            # wmllint: local spelling nightrunners
            story= _ "A fortnight after their victory, the town was awakened from slumber in the dead of night by the distant booming of orcish drums. Scouts training with the nightrunners returned to cry the news that a strong orcish company was approaching. Frightened as they had never been before, the folk of Dwarven Doors looked to Tallin for guidance."
        [/part]
        [part]
            story= _ "Faced with certain destruction at the hands of the orcs, or a fate unknown in the caves of Knalga, Tallin chose the latter. The people quickly gathered together and collected whatever food and weapons they could and plunged into the darkness of the caves."
        [/part]
    [/story]

    {NR_TRACK {REVOLT_STAGE2}}

    # Set sides
    # Players side - some more recruit options this time.
    # wmllint: validate-off
    [side]
        side=1
        controller=human
        {GOLD 450 400 350}
        recruit=Peasant,Woodsman,Thug,Poacher,Footpad
        team_name=rebels
        user_team_name= _ "Rebels"
        {FLAG_VARIANT6 ragged}

        # wmllint: recognize Tallin
        {CHARACTER_STATS_TALLIN}

        shroud=yes
    [/side]
    # wmllint: validate-on

    # Three sides for trolls, one lead by troll warrior
    [side]
        side=2
        controller=ai
        recruit=Troll Whelp
        {GOLD 100 150 200}
        team_name=trolls
        user_team_name= _ "Trolls"

        type=Troll
        id=Knash
        name= _ "Knash"
        canrecruit=yes
    [/side]

    [side]
        side=3
        controller=ai
        recruit=Troll Whelp
        {GOLD 100 150 200}
        team_name=trolls
        user_team_name= _ "Trolls"

        type=Troll
        id=Krog
        name= _ "Krog"
        canrecruit=yes
    [/side]

    # Dwarven side
    [side]
        side=4
        controller=ai
        recruit=Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Guardsman,Dwarvish Scout
        {GOLD 130 120 100}
        team_name=rebels
        user_team_name= _ "Rebels"
        {FLAG_VARIANT knalgan}

        type=Dwarvish Lord
        id=Hamel
        name= _ "Hamel"
        profile=portraits/Hamel.png
        canrecruit=yes

        [ai]
            recruitment_pattern=fighter,fighter,fighter,mixed fighter
            grouping=defensive
            support_villages=yes
            passive_leader=yes
            # in the unexpected case that they become too strong they should not clear the whole map
            [avoid]
                x=1-31
                y=1-11
            [/avoid]
        [/ai]

        # The first one is a Steelclad, he guards a critical location from the skeletons.
        # If he goes down, it's assumed he was killed by Trolls, which probably means
        # that the Trolls killed two Skeleton sides and became very strong, and they
        # will trigger afterwards the event which gives a big boost to the dwarves.
        # The second one suplements him, he hinders units to overcome his ZoC.
        # The Steelwart can't move; the Fighter is controlled by an Micro AI.
        {NOTRAIT_UNIT () "Dwarvish Steelclad" 31 28} {GUARDIAN} {NO_UPKEEP} {FACING se}
        {NAMED_NOTRAIT_UNIT () "Dwarvish Fighter" 27 28 (dwarvish_return_guard) ()} {NO_UPKEEP}

        {NOTRAIT_UNIT () "Dwarvish Stalwart" 28 21} {GUARDIAN} {NO_UPKEEP}
        {NOTRAIT_UNIT () "Dwarvish Stalwart" 32 21} {GUARDIAN} {NO_UPKEEP}
        {NOTRAIT_UNIT () "Dwarvish Stalwart" 24 25} {GUARDIAN} {NO_UPKEEP} {FACING se}
    [/side]

    [side]
        side=5
        controller=ai
        recruit=Skeleton,Skeleton Archer
        {GOLD 300 400 500}
        {INCOME 10 15 20}
        team_name=undead
        user_team_name= _ "Undead"
        {FLAG_VARIANT undead}

        type=Death Knight
        id=Mal Barath
        name= _ "Mal Barath"
        canrecruit=yes
    [/side]

    [side]
        side=6
        controller=ai
        recruit=Troll Whelp,Troll,Troll Rocklobber
        {GOLD 300 400 500}
        {INCOME 10 14 18}
        team_name=trolls
        user_team_name= _ "Trolls"

        type=Troll Warrior
        id=Thung
        name= _ "Thung"
        canrecruit=yes

        # make them not focus the leaders, in particular of side 5
        [ai]
            leader_value=1
            # not really useful, deny 2 villages in case they conquer the nord
            [avoid]
                x=16-22
                y=1-3
            [/avoid]
        [/ai]

        {NOTRAIT_UNIT () "Troll Rocklobber" 39 5} {GUARDIAN} {NO_UPKEEP}
        {NOTRAIT_UNIT () "Troll Rocklobber" 39 11} {GUARDIAN} {NO_UPKEEP}
    [/side]

    [side]
        side=7
        controller=ai
        recruit=Skeleton,Skeleton Archer
        {GOLD 250 350 450}
        {INCOME 4 6 8}
        team_name=undead
        user_team_name= _ "Undead"
        {FLAG_VARIANT undead}

        type=Death Knight
        id=Delzath
        name= _ "Delzath"
        canrecruit=yes
    [/side]

    [side]
        side=8
        controller=ai
        recruit=Skeleton,Skeleton Archer
        {GOLD 250 350 450}
        {INCOME 4 6 8}

        team_name=undead
        user_team_name= _ "Undead"
        {FLAG_VARIANT undead}

        type=Death Knight
        id=Mal Tath
        name= _ "Mal Tath"
        canrecruit=yes

        # controlled by Micro AI, more meatshield than guard
        {NAMED_NOTRAIT_UNIT () "Skeleton Archer" 24 2 (skeleton_return_guard) ()} {NO_UPKEEP}
    [/side]

    # And an empty side for the bat used in flavor event
    [side]
        no_leader=yes
        side=9
        hidden=yes
        color=black
    [/side]

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Find the dwarves"
                condition=win
                [show_if]
                    [variable]
                        name=found_dwarves
                        boolean_equals=no
                    [/variable]
                [/show_if]
            [/objective]
            [objective]
                description= _ "Move Tallin to the dwarvish area to meet with Lord Hamel"
                condition=win
                [show_if]
                    [variable]
                        name=found_dwarves
                        boolean_equals=yes
                    [/variable]
                [/show_if]
            [/objective]
            {ALTERNATIVE_OBJECTIVE_BONUS ( _ "Clear the caves")}
            [objective]
                description= _ "Death of Tallin"
                condition=lose
            [/objective]
            [objective]
                description= _ "The dwarves are defeated"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=no
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]

        [time_area]
            terrain=Gg,Mm,Mm^*,Hh,Hh^*
            {DEFAULT_SCHEDULE}
        [/time_area]

        {RECALL_SUPPORTER}
    [/event]

    # Start event - execute the flavor bat encounter.
    [event]
        name=start

        [message]
            role=Supporter
            message= _ "So here we are..."
        [/message]

        [message]
            role=Supporter
            message= _ "(<i>Trip</i>) <i>Oof!</i>" # wmllint: no spellcheck
        [/message]

        [message]
            role=Supporter
            message= _ "Great idea, Tallin, I probably couldn’t even fight a bat down here."
        [/message]

        [move_unit_fake]
            type=Blood Bat
            side=9
            x=15,14,13,12,11
            y=12,12,13,12,12
        [/move_unit_fake]

        {NOTRAIT_UNIT 9 "Blood Bat" 11 12}

        [message]
            type=Blood Bat
            message= _ "Neep Neep!" # wmmlint: no spellcheck
        [/message]

        [message]
            role=Supporter
            message= _ "Ahhhh!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "Calm down. Come what may, we’ll handle them. Come on now, let’s find those dwarves!"
        [/message]
    [/event]

    # Find Camerin event
    [event]
        name=capture
        [filter]
            side=1
            x,y=2,1
        [/filter]

        [unit]
            side=1
            x,y=1,1

            # wmllint: recognize Camerin
            {CHARACTER_STATS_CAMERIN}
        [/unit]

        [message]
            speaker=Camerin
            message= _ "<i>Prepare to die, you foul orc!</i>"
        [/message]

        [message]
            speaker=unit
            message= _ "Hold it! I am no orc, I am a human!"
        [/message]

        [message]
            speaker=Camerin
            message= _ "A human! Amazing, I haven’t seen a human ever since the orcs attacked."
        [/message]

        [message]
            speaker=unit
            message= _ "How have you managed to survive all this time?"
        [/message]

        [message]
            speaker=Camerin
            message= _ "By frying every orc, troll or skeleton I come across. Duh! Those monsters desecrated my life’s work, now I shall not rest till I send every last one of them to hell! Oh, and just between me and you, it is actually good fun — more fun anyway than sitting on your backside studying all day..."
        [/message]

        [message]
            speaker=unit
            message= _ "... Uh, sure!"
        [/message]

        [message]
            speaker=Camerin
            message= _ "But silly me, where are my manners? Would you like to come inside for tea?"
        [/message]

        [message]
            speaker=unit
            message= _ "Um... err... well actually we are presently busy fighting our way through hordes of trolls and skeletons trying to find the dwarves... if there are any left."
        [/message]

        [message]
            speaker=Camerin
            message= _ "Hordes of trolls and skeletons! Where?! Let’s go burn ’em all!"
        [/message]

        [message]
            speaker=unit
            # wmllint: local spelling Er
            message= _ "Er... let’s go..."
        [/message]

        [message]
            speaker=unit
            message={WHISPER _"whisper^Is it safe to have this lunatic with us?"}
        [/message]

        {VARIABLE found_Camerin yes}

        # The following two events are absolutely useless if Camerin
        # was not found so we'll set them only when this happens using
        # event nesting.

        # Flavor event on Camerins first attack
        [event]
            name=attack
            [filter]
                id=Camerin
            [/filter]

            [message]
                speaker=Camerin
                message= _ "<i>Burn, you disgusting filth!</i>"
            [/message]
            [message]
                speaker=second_unit
                message= _ "Ahhh! Fire!"
            [/message]
        [/event]

        # And flavor event on his first kill
        [event]
            name=die
            [filter_second]
                id=Camerin
            [/filter_second]

            [message]
                speaker=Camerin
                message= _ "<i>Yeah! Die, scum, die!</i>"
            [/message]
        [/event]
    [/event]

    # Information for the player that he can't proceed without either
    # finding the dwarves or killing the enemies.
    [event]
        name=moveto
        [filter]
            side=1
            x=35,36,37,40,40,40
            y=1,1,1,12,13,14
        [/filter]

        [message]
            speaker=unit
            message= _ "This tunnel keeps on going..."
        [/message]

        [message]
            speaker=Tallin
            message= _ "I think we should finish searching this part of Knalga first before we go deeper into the caves."
        [/message]
    [/event]

    # Flavor event on first sighting of the undead
    [event]
        name=sighted
        [filter]
            race=undead
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            role=Supporter
            message= _ "Grim Gods of Darkness, what are those things!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "Skeletons!"
        [/message]

        [message]
            role=Supporter
            message= _ "Look at the axes they bear. At one time those skeletons must have been dwarves!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "Stand firm, men. The dwarven defenders of Knalga rise again. Now it remains to be seen whether or not they recognize us as friends."
        [/message]
    [/event]

    # Flavor event for the first time they attack
    [event]
        name=attack
        [filter]
            race=undead
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            role=Supporter
            message= _ "They are attacking us!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "Destroy them!"
        [/message]
    [/event]

    # Opening a pair of hidden doors - the north one
    [event]
        name=moveto
        [filter]
            side=1
            x=12,16
            y=7,5
        [/filter]

        # Check from which side do we open and use appropriate race in the dialogue.
        [if]
            [variable]
                name=unit.y
                equals=7
            [/variable]
            [then]
                [message]
                    speaker=unit
                    message= _ "Hey look, it’s an ancient door. It seems the trolls were too stupid to find how to open it."
                [/message]
                {VARIABLE trigger.x 16}
                {VARIABLE trigger.y 5}
            [/then]
            [else]
                [message]
                    speaker=unit
                    message= _ "Hey look, it’s an ancient door. It seems the skeletons were too stupid to find how to open it."
                [/message]
                {VARIABLE trigger.x 12}
                {VARIABLE trigger.y 7}
            [/else]
        [/if]

        [message]
            speaker=Tallin
            message= _ "Well, let’s see what’s behind it."
        [/message]

        [message]
            speaker=unit
            message= _ "All right. (<i>Grunt... strain...</i>) It’s not moving. It seems to be stuck."
        [/message]

        [message]
            speaker=Tallin
            message= _ "Well, just kick it down then."
        [/message]

        [message]
            speaker=unit
            message= _ "... Right."
        [/message]

        {QUAKE rumble.ogg}

        [if]
            [variable]
                name=unit.y
                equals=7
            [/variable]
            [then]
                [terrain]
                    x=13
                    y=7
                    layer=overlay
                    terrain=^Pr\o
                [/terrain]
            [/then]
            [else]
                [terrain]
                    x=15
                    y=6
                    layer=overlay
                    terrain=^Pr\o
                [/terrain]
            [/else]
        [/if]

        [redraw]
            side=1
        [/redraw]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "The old door crumbles away, revealing an old tunnel on the other side."
        [/message]

        # nested event, to open the second door
        [event]
            name=moveto
            [filter]
                side=1
                x=14,$trigger.x
                y=6,$trigger.y
            [/filter]

            [if]
                [variable]
                    name=unit.y
                    equals=6
                [/variable]
                [then]
                    [message]
                        speaker=unit
                        message= _ "On the end of the passage is another door. I try to open it."
                    [/message]
                [/then]
                [else]
                    [message]
                        speaker=unit
                        message= _ "Here is a similar door as the one before. I try to open it."
                    [/message]
                [/else]
            [/if]

            {QUAKE rumble.ogg}

            [terrain]
                x=13,15
                y=7,6
                layer=overlay
                terrain=^Pr\o
            [/terrain]

            [redraw]
                side=1
            [/redraw]

            {CLEAR_VARIABLE trigger}
        [/event]
    [/event]

    # And the south ones
    [event]
        name=moveto
        [filter]
            side=1
            x=15,17
            y=26,27
        [/filter]

        [if]
            [variable]
                name=unit.y
                equals=26
            [/variable]
            [then]
                [message]
                    speaker=unit
                    message= _ "Hey look, it’s an ancient door. It seems the trolls were too stupid to find how to open it."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=unit
                    message= _ "Hey look, it’s an ancient door. It seems the skeletons were too stupid to find how to open it."
                [/message]
            [/else]
        [/if]

        [message]
            speaker=Tallin
            message= _ "Well, let’s see what’s behind it."
        [/message]

        [message]
            speaker=unit
            message= _ "All right. (<i>Grunt... strain...</i>) It’s not moving. It seems to be stuck."
        [/message]

        [message]
            speaker=Tallin
            message= _ "Well, just kick it down then."
        [/message]

        [message]
            speaker=unit
            message= _ "... Right."
        [/message]

        {QUAKE rumble.ogg}

        [terrain]
            x=15,16,16,17
            y=27,26,27,26
            terrain=Uu
        [/terrain]

        [redraw]
            side=1
        [/redraw]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message= _ "A large section of wall crumbles away."
        [/message]
    [/event]

    # We're doomed (tm) routine on turn 9
    [event]
        name=turn 9

        [message]
            role=Supporter
            message= _ "Tallin, this situation is hopeless — there are endless monsters swarming from all directions!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "We are in a dire situation indeed — but just see — the trolls and the skeletons are also attacking each other. We must all stay together in one group; let each man support the man next to him. If our ranks are imposing enough the monsters may shy away from us in favor of easier prey."
        [/message]

        [message]
            role=Supporter
            message= _ "But still, Tallin, we will take losses, and for each one of us, there is no replacement — whereas for every monster we kill, it seems that two more come to take its place!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "Which is why we must make haste to find the dwarves. Dwarves are hardy creatures and they know their caves backwards and forwards — so I am sure at least some must have survived! Indeed, this is our only hope for otherwise, be it on the surface or be it down here, any way we turn we face certain destruction!"
        [/message]
    [/event]

    # When the eastern trolls are defeated the undead will get their villages (not many)
    # and focus on the player and the dwarves. The player is probably otherwise busy.
    [event]
        name=die
        [filter]
            side=6
            canrecruit=yes
        [/filter]
        [filter_second]
            race=undead
        [/filter_second]
        [gold]
            side=4
            amount=70
        [/gold]
        [modify_side]
            [filter_side]
                side=4
            [/filter_side]
            income=12
        [/modify_side]
        [allow_recruit]
            side=4
            type=Dwarvish Steelclad
        [/allow_recruit]
        [disallow_recruit]
            side=4
            type=Dwarvish Thunderer
        [/disallow_recruit]
    [/event]

    # Give gold to the allies in case their area is invaded
    [event]
        name=moveto
        [filter]
            side=2,3,5,6,7,8
            x=24-31
            y=21-27
        [/filter]

        [gold]
            side=4
            amount=220
        [/gold]
        [modify_side]
            [filter_side]
                side=4
            [/filter_side]
            income=12
        [/modify_side]
        [if]
            [variable]
                name=turn_number
                greater_than=30
            [/variable]
            [then]
                [allow_recruit]
                    side=4
                    type=Dwarvish Steelclad,Dwarvish Stalwart,Dwarvish Pathfinder
                [/allow_recruit]
                [disallow_recruit]
                    side=4
                    type=Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Scout
                [/disallow_recruit]
            [/then]
        [/if]
    [/event]

    # This unit should only defend this location and not join the counterattack
    [event]
        name=side 4 turn refresh
        first_time_only=no

        [object]
            silent=yes
            duration=turn end
            take_only_once=yes
            [filter]
                side=4
                x=31
                y=28
            [/filter]
            [effect]
                apply_to=movement_costs
                replace=yes
                [movement_costs]
                    cave={UNREACHABLE}
                    castle={UNREACHABLE}
                [/movement_costs]
            [/effect]
        [/object]
    [/event]

    # Micro AI, controlling a unit which is supporting the one above.
    [event]
        name=prestart
        [micro_ai]
            side=4
            ai_type=return_guardian
            action=add

            id=dwarvish_return_guard
            return_x,return_y=27,28
        [/micro_ai]
    [/event]

    # Micro AI, ccontrolling one unit next to the northern undead leader.
    # In cases the undead leader leaves his keep to attack a troll in the west,
    # this unit will follow him (due to positioning) and return afterwards
    [event]
        name=prestart
        [micro_ai]
            side=8
            ai_type=return_guardian
            action=add

            id=skeleton_return_guard
            return_x,return_y=24,2
        [/micro_ai]
    [/event]

    # Meeting the dwarves
    [event]
        name=sighted
        [filter]
            side=4
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=unit
            message= _ "Stand where ye be, you... Och! A human!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "Greetings from the people of Dwarven Doors, friend."
        [/message]

        [message]
            speaker=unit
            message= _ "Dwarven Doors? I thought ye surface humans had been enslaved or slain by the orcs years ago."
        [/message]

        [message]
            speaker=Tallin
            message= _ "Yes, we were enslaved, but we rose against Al’Tar and defeated his warband. In order to stay free, we seek help and equipment from our old allies, the dwarves."
        [/message]

        [message]
            speaker=unit
            message= _ "Och, the dwarves of Knalga are themselves in desperate straits — but we havena’ forgotten the old bonds. Be welcome to our keep. Aye, and have speech with our chieftain, the Lord Hamel."
        [/message]

        [message]
            speaker=Tallin
            message= _ "Very well."
        [/message]

        {VARIABLE found_dwarves yes}

        [show_objectives][/show_objectives]
    [/event]

    # Moving Tallin within 5 hexes of Hamel. End scenario without bonus.
    [event]
        name=moveto
        [filter]
            id=Tallin
            [filter_location]
                [filter]
                    id=Hamel
                [/filter]
                radius=5
                [filter_radius]
                    terrain=!,X*
                [/filter_radius]
            [/filter_location]
        [/filter]

        [message]
            speaker=Hamel
            message= _ "Well met, Tallin. My men have told me of your victory against Al’Tar."
        [/message]

        [message]
            speaker=Tallin
            message= _ "Thank you and well-met indeed, Lord Hamel. I must say, this place is interesting."
        [/message]

        [message]
            speaker=Hamel
            message= _ "This is how we get our food, me lad. Since we are a tad close to the surface here, some sunlight shines down through the cracks in the roof. If we baby the plants, we can usually get enough. They taste unco’ foul but that’s how we ha’ survived all these long years. But come, let us talk!"
        [/message]

        [message]
            role=Supporter
            message= _ "Whew, we did it!"
        [/message]

        [message]
            speaker=Camerin
            message= _ "Awww! Are we done already?"
        [/message]

        [endlevel]
            result=victory
            bonus=no
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    # All enemies defeated, choose appropriate dialog depending on whether the dwarves were found or not.
    [event]
        name=enemies defeated

        [if]
            [variable]
                name=found_dwarves
                boolean_equals=yes
            [/variable]
            [then]
                [message]
                    speaker=Tallin
                    message= _ "Good, we managed to clear the caves... for now, anyway. Now let’s get to the dwarven keep and dicker for better weapons."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Tallin
                    message= _ "Good, there are no more monsters lurking in these parts of the tunnels. I think I can hear the clamor of dwarves just ahead. Come on men, let’s go meet them."
                [/message]
            [/else]
        [/if]

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

    # Hamel got killed, the scenario is lost.
    [event]
        name=die
        [filter]
            id=Hamel
        [/filter]

        {INCIDENTAL_MUSIC sad.ogg}

        [role]
            type=Master Bowman,Royal Guard,Halberdier,Swordsman,Pikeman,Longbowman,Javelineer,Trapper,Bandit,Highwayman,Thug,Poacher,Spearman,Bowman,Peasant,Arch Mage
            [not]
                id=Tallin
            [/not]
            search_recall_list=no
            role=Messenger
        [/role]

        [message]
            role=Messenger
            message= _ "Tallin, we have just received the news that the dwarvish Lord Hamel has just been slain. We are too late!"
        [/message]

        [message]
            speaker=Tallin
            message= _ "No! Without the dwarvish weapons we have no hope!"
        [/message]

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

    # If we won and Camerin wasn't found add him to the players army
    [event]
        name=victory

        [if]
            [variable]
                name=found_Camerin
                boolean_equals=no
            [/variable]
            [then]
                [move_unit_fake]
                    type=Arch Mage
                    side=1
                    x=2,2,4,4,3,3, 6
                    y=1,2,3,4,5,10,11
                [/move_unit_fake]

                [unit]
                    side=1
                    x,y=6,11

                    # wmllint: recognize Camerin
                    {CHARACTER_STATS_CAMERIN}
                [/unit]

                [message]
                    speaker=Camerin
                    message= _ "Hey, what’s going on in here?"
                [/message]

                # Try to choose as Admirer, in order:
                # (1) A Thug or Bandit on side 1
                # (2) Otherwise, any unit other than Tallin, Camerin and Supporter on side 1
                # (3) If all else fails, Tallin

                [role]
                    type=Thug,Bandit
                    search_recall_list=no
                    role=Admirer
                    [else]
                        [role]
                            [not]
                                id=Tallin
                            [/not]
                            [not]
                                # unit can have only one role
                                role=Supporter
                            [/not]
                            [not]
                                id=Camerin
                            [/not]
                            side=1
                            search_recall_list=no
                            role=Admirer
                            [else]
                                [role]
                                    # Supporter and Camerin shouldn’t get Admirer role
                                    id=Tallin
                                    role=Admirer
                                [/role]
                            [/else]
                        [/role]
                    [/else]
                [/role]

                [message]
                    role=Admirer
                    message= _ "We are killing lots of trolls and skeletons."
                [/message]

                [message]
                    speaker=Camerin
                    message= _ "Really! Did you save any for me?"
                [/message]

                [message]
                    role=Admirer
                    message= _ "Uh, not really..."
                [/message]

                [message]
                    speaker=Camerin
                    message= _ "Awww!"
                [/message]

                [message]
                    role=Admirer
                    message= _ "But hey, if you want to join us, I am sure we will be fighting a lot more orcs, trolls and skeletons in the near future."
                [/message]

                [message]
                    speaker=Camerin
                    message= _ "Really! Oh yeah, I am in!"
                [/message]

                [message]
                    speaker=Tallin
                    message= _ "... That was rather odd. Who is this guy?"
                [/message]

                [message]
                    speaker=Hamel
                    message= _ "Oh, dinna’ mind him, that’d be Camerin. He used to be yer usual scholarly mage, and he moved awa’ up here to be alone and study. But then when the orcs invaded he went a little loony. My guess is that some roving orcs ransacked his place and burnt his notes or something. Whatever it was, he couldna’ take it and became fey. Ever since he has been roving these caves destroying any manner of monster that he comes across. They all give him a very wide berth by now. So just be polite, give him some room and you’ll find he is relatively harmless..."
                    [show_if]
                        [have_unit]
                            id=Hamel
                            [filter_vision]
                                side=1
                            [/filter_vision]
                        [/have_unit]
                    [/show_if]
                [/message]
            [/then]
        [/if]

        {CLEAR_VARIABLE found_Camerin,found_dwarves,trigger}
    [/event]

    {HERODEATH_TALLIN}
    {HERODEATH_CAMERIN}

    {SUPPORTER_DEATH_HANDLER}
[/scenario]
