#textdomain wesnoth-did

[scenario]
    id=03_A_Haunting_in_Winter
    name= _ "A Haunting in Winter"
    map_data="{campaigns/Descent_Into_Darkness/maps/03_A_Haunting_in_Winter.map}"
    victory_when_enemies_defeated=no
    turns=unlimited
    next_scenario=04_Beginning_of_the_Revenge

    [time_area]
        x=15-16
        y=20-21
        {DEFAULT_SCHEDULE}
    [/time_area]
    {UNDERGROUND}

    {SCENARIO_MUSIC       the_deep_path.ogg}
    {EXTRA_SCENARIO_MUSIC underground.ogg}
    {EXTRA_SCENARIO_MUSIC nunc_dimittis.ogg}

    [story]
        [part]
            music=transience.ogg
            story=_ "Malin and Darken Volk spend the summer and fall traveling across the lower Northlands. They attack goblin villages and small orcish camps when they find them. Although Darken Volk is occasionally demanding and irritable, he proves to be an effective mentor. Malin’s power grows considerably under the necromancer’s tutelage."
            {STORYTXT_BACKGROUND travel.jpg}
        [/part]
        [part]
            story=_ "The colored patchwork of fall eventually fades to wintry snowfall drifting over barren lands. The nights grow longer as the sun disappears behind a seemingly perpetual mist of pallid clouds. Hounded by the elements, the two necromancers retreat into the hills to seek shelter. By a stroke of good fortune, they stumble across a mostly abandoned cave just as the winter sets in."
            {STORYTXT_BACKGROUND travel.jpg}
        [/part]
    [/story]

    {DID_TRACK {JOURNEY_03_NEW}}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        recruit=
        income=-2
        village_gold=0
        gold=0
        village_support=2
        team_name=good
        user_team_name= _ "Malin Keshar"
        {FLAG_VARIANT undead}

        # wmllint: recognize Malin Keshar
        {CHARACTER_STATS_MALIN_KESHAR}

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

    [side]
        side=2
        controller=ai
        no_leader=yes
        hidden=yes
        team_name=monsters
        [ai]
            aggression=1.0
            caution=0.0
            grouping=no
            simple_targeting=yes
            village_value=0
            [goal]
                name=target
                [criteria]
                    side=1
                [/criteria]
                value=100
            [/goal]
            [goal]
                name=target
                [criteria]
                    side=3
                [/criteria]
                value=-100
            [/goal]
        [/ai]
    [/side]

    [side]
        side=3
        controller=ai
        no_leader=yes
        hidden=yes
        team_name=good
    [/side]

#define OBJECTIVE_EXPLORE
    [objectives]
        side=1
        [objective]
            condition=win
            description= _ "Explore"
        [/objective]
        [objective]
            condition=lose
            description= _ "Death of Malin Keshar"
        [/objective]
        [gold_carryover]
            carryover_percentage=100
        [/gold_carryover]
    [/objectives]
#enddef

#define FULL_HEAL_RESTORE FILTER
    [heal_unit]
        [filter]
            {FILTER}
        [/filter]

        amount=full
        moves=full
        restore_statuses=yes
        restore_attacks=yes
    [/heal_unit]
#enddef

    [event]
        name=prestart

        {CLEAR_CORPSE_HORDE}

        [objectives]
            side=1
            [objective]
                condition=win
                description= _ "Defeat both young ogres"
            [/objective]
            [objective]
                condition=lose
                description= _ "Death of Malin Keshar"
            [/objective]
            [gold_carryover]
                carryover_percentage=100
            [/gold_carryover]
        [/objectives]

        [recall]
            id=Darken Volk
        [/recall]

        [unit]
            type=Young Ogre
            x,y=25,17
            side=2
            id=YOgre1
            hitpoints=13
            facing=sw
            ai_special=guardian
        [/unit]
        [unit]
            type=Young Ogre
            x,y=24,17
            side=2
            id=YOgre2
            hitpoints=16
            facing=ne
            ai_special=guardian
        [/unit]

        {PLACE_IMAGE "items/bow.png" 17 6}
        [unit]
            type=Young Ogre
            x,y=18,6
            side=2
            id=Ogre3
            ai_special=guardian
        [/unit]

        [unit]
#ifdef EASY
            type=Naga Fighter
#else
            type=Naga Warrior
#endif
            x,y=15,2
            side=2
            id=Naga2
            ai_special=guardian
        [/unit]
        [unit]
#ifdef HARD
            type=Naga Warrior
#else
            type=Naga Fighter
#endif
            x,y=16,2
            side=2
            id=Naga1
            ai_special=guardian
        [/unit]

        [object]
            silent=yes
            duration=forever
            take_only_once=no
            [filter]
                id=Naga1
            [/filter]
            [effect]
                apply_to=movement_costs
                replace=yes
                [movement_costs]
                    flat={UNREACHABLE}
                    cave={UNREACHABLE}
                [/movement_costs]
            [/effect]
        [/object]
        [object]
            silent=yes
            duration=forever
            take_only_once=no
            [filter]
                id=Naga2
            [/filter]
            [effect]
                apply_to=movement_costs
                replace=yes
                [movement_costs]
                    flat={UNREACHABLE}
                    cave={UNREACHABLE}
                [/movement_costs]
            [/effect]
        [/object]

        {GENERIC_UNIT 2 (Troll Whelp) 2 15} {GUARDIAN}
        {GENERIC_UNIT 2 (Troll Whelp) 6 17} {GUARDIAN}
        {GENERIC_UNIT 2 (Troll Whelp) 6 19} {GUARDIAN}

#ifdef EASY
        {GENERIC_UNIT 2 (Troll) 4 17} {GUARDIAN}
#else
        {GENERIC_UNIT 2 (Troll Hero) 4 17} {GUARDIAN}
#endif
        [remove_shroud]
            x=13-16,12,12
            y=11-21,13-14,17-19
        [/remove_shroud]

        {MODIFY_UNIT (id=Darken Volk) max_moves 0}
        {MODIFY_UNIT (id=Darken Volk) moves 0}
        {MODIFY_UNIT (id=Darken Volk) side 3}
    [/event]

    [event]
        name=start

        [message]
            speaker=Darken Volk
            message= _ "I sense many lifeforms in this cavern, but none are very powerful. Most likely they are merely nothing more than beasts. Still, we may be able to use them to continue your training."
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "Better than nothing. Which way do these creatures lie?"
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "East."
        [/message]

        [move_unit]
            id=Malin Keshar
            to_x,to_y=20,13
        [/move_unit]
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]
        [scroll_to]
            x,y=24,17
        [/scroll_to]

        [message]
            speaker=YOgre1
            message= _ "Me kill you!"
        [/message]

        [harm_unit]
            [filter]
                id=YOgre2
            [/filter]
            [filter_second]
                id=YOgre1
            [/filter_second]
            [primary_attack]
                name=cleaver
            [/primary_attack]
            [secondary_attack]
                name=cleaver
            [/secondary_attack]
            animate=yes
            slowed=yes
            amount=6
        [/harm_unit]

        [message]
            speaker=YOgre2
            message= _ "No, me kill you!"
        [/message]

        [harm_unit]
            [filter]
                id=YOgre1
            [/filter]
            [filter_second]
                id=YOgre2
            [/filter_second]
            [primary_attack]
                name=cleaver
            [/primary_attack]
            [secondary_attack]
                name=cleaver
            [/secondary_attack]
            animate=yes
            slowed=yes
            amount=5
        [/harm_unit]

        [message]
            speaker=YOgre1
            message= _ "No, me kill— I see human!"
        [/message]

        [message]
            speaker=YOgre2
            message= _ "Human! We smash human!"
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "Simple-minded, obtuse creatures."
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "This should be an easy task for you. Once you have slain them both, we shall turn them into skeletons."
        [/message]
    [/event]

    # First area (two young ogres)
    [event]
        name=last breath
        [filter]
            id=YOgre1
        [/filter]

        [message]
            speaker=YOgre1
            # po: this line is just a death scream
            message= _ "Arrghhaaugghhh..." # wmllint: no spellcheck
        [/message]

        {PLACE_IMAGE "items/bones.png" $x1 $y1}

        {VARIABLE loc1.x $x1}
        {VARIABLE loc1.y $y1}
    [/event]
    [event]
        name=last breath
        [filter]
            id=YOgre2
        [/filter]

        [message]
            speaker=YOgre2
            message= _ "Me... die..."
        [/message]

        {PLACE_IMAGE "items/bones.png" $x1 $y1}

        {VARIABLE loc2.x $x1}
        {VARIABLE loc2.y $y1}
    [/event]

    [event]
        name=die
        first_time_only=no

        [filter]
            id=YOgre1,YOgre2
        [/filter]

        [if]
            [not]
                [have_unit]
                    id=YOgre1,YOgre2
                [/have_unit]
            [/not]
            [then]
                # this is necessary to stop the units from blocking their hexes
                [kill]
                    id=YOgre1,YOgre2
                [/kill]
                [fire_event]
                    name=cutscene1
                [/fire_event]
            [/then]
        [/if]
    [/event]
    [event]
        name=cutscene1

        {FULL_HEAL_RESTORE (id=Malin Keshar)}

        [message]
            speaker=Malin Keshar
            message= _ "The ogres are dead."
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "Good... I have already showed you how to raise a skeleton before, but perhaps it would be best if we... went over it once again. Other than for ghouls, flesh and blood are useless for undead creatures. First, let out the blood and innards and dispose of them."
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "Very well."
        [/message]

        [move_unit]
            id=Malin Keshar
            to_x,to_y=$loc1.x,$loc1.y
        [/move_unit]

        [sound]
            name=axe.ogg
        [/sound]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Malin Keshar
            message= _ "What a mess."
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "The ghouls will take care of it once we have the resources to keep them here. Next, strip away the flesh. A little remaining is fine; too much will hamper your skeletons’ movement."
        [/message]

        [delay]
            time=350
        [/delay]

        [sound]
            name=axe.ogg
        [/sound]

        [delay]
            time=500
        [/delay]

        [sound]
            name=axe.ogg
        [/sound]

        [delay]
            time=750
        [/delay]

        [message]
            speaker=Malin Keshar
            message= _ "And then?"
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "Bind the strings of energy to the bone. Skeletons are no more than puppets. Novices will directly control their movement with strands of dark magic, but you should have no need for such crude methods. Instead, impart your will upon the skeleton, spread the threads over the bones, then let loose the twine from your hand. If your will is strong enough, the skeleton will be able to move on its own."
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "I will try."
        [/message]

        [animate_unit]
            [filter]
                id=Malin Keshar
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]

        [delay]
            time=400
        [/delay]

        {REMOVE_IMAGE $loc1.x $loc1.y}

        [unit]
            type=Skeleton
            x,y=$loc1.x,$loc1.y
            passable=yes
            side=1
            animate=yes
        [/unit]

        [message]
            speaker=Darken Volk
            message= _ "Do it again."
        [/message]

        [delay]
            time=750
        [/delay]

        [animate_unit]
            [filter]
                id=Malin Keshar
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]

        [delay]
            time=400
        [/delay]

        {REMOVE_IMAGE $loc2.x $loc2.y}

        [unit]
            type=Skeleton
            x,y=$loc2.x,$loc2.y
            passable=yes
            side=1
            animate=yes
        [/unit]

        [terrain]
            x=19,20,20
            y=9,9,8
            terrain=Ur
        [/terrain]
        [redraw][/redraw]

        {CLEAR_VARIABLE loc1}
        {CLEAR_VARIABLE loc2}

        [message]
            speaker=Darken Volk
            message= _ "Good, good. Now head north. I sense another young ogre there."
        [/message]

        {OBJECTIVE_EXPLORE}
    [/event]

    [event]
        name=sighted
        [filter]
            id=Ogre3
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=Malin Keshar
            message= _ "I can turn this one into a skeleton as well."
        [/message]
    [/event]

    # Second mini area (third young ogre)
    [event]
        name=die
        first_time_only=yes
        [filter]
            id=Ogre3
        [/filter]

        {FULL_HEAL_RESTORE (side=1)}

        {PLACE_IMAGE "items/bones.png" $x1 $y1}

        [kill]
            id=Ogre3
        [/kill]

        [remove_shroud]
            x,y=17,6
            radius=1
        [/remove_shroud]

        [scroll_to]
            x,y=17,6
        [/scroll_to]

        [delay]
            time=1000
        [/delay]

        [message]
            speaker=Darken Volk
            message= _ "The ogre seems to have looted a bow. Use it to create a Skeleton Archer."
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "Very well."
        [/message]

        [animate_unit]
            [filter]
                id=Malin Keshar
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]

        [delay]
            time=400
        [/delay]

        [unit]
            type=Skeleton Archer
            x,y=$x1,$y1
            side=1
            animate=yes
            passable=yes
        [/unit]

        {REMOVE_IMAGE $x1 $y1}
        {REMOVE_IMAGE 17 6}

        [message]
            speaker=Darken Volk
            message= _ "It seems that raising skeletons is already a trivial matter for you now. You are indeed... talented."
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "Perhaps, but I will need more than a few skeletons to fight the orcs."
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "They will come in time, when you learn to control more of them at once. For now, continue exploring these caves. We may yet find something else of use."
        [/message]

        [terrain]
            x=24,25,24,21,21
            y=10,10,11,3,4
            terrain=Rb
        [/terrain]
        [terrain]
            x=25,22
            y=11,3
            terrain=Uu
        [/terrain]
        [redraw][/redraw]

        {GENERIC_UNIT 2 (Giant Scorpion) 26 8}
        {GENERIC_UNIT 2 (Giant Scorpion) 28 10}
        {GENERIC_UNIT 2 (Giant Scorpion) 28 3}
        {GENERIC_UNIT 2 (Giant Scorpion) 25 4}
        {GENERIC_UNIT 2 (Giant Scorpion) 23 6}

        {MODIFY_UNIT (type=Giant Scorpion) max_moves 3}

        {OBJECTIVE_EXPLORE}
    [/event]

    # Third area (scorpions)
    [event]
        name=sighted
        [filter]
            type=Giant Scorpion
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=Malin Keshar
            message= _ "This cave is infested with giant scorpions!"
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "Annoying pests, no more than that. Killing them, however, may provide some useful experience to your skeletons."
        [/message]
    [/event]

    # Fourth area (nagas and ghosts)
    [event]
        name=sighted
        [filter]
            race=naga
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [remove_shroud]
            x,y=16,2
            radius=3
        [/remove_shroud]

        [message]
            speaker=Naga1
            # po: Hsss is just a hissing sound that nagas make. The extra s's in spy and must are also intended to be the same sound.
            message= _ "Hssss, I ssspy human vermin... I mussst kill." # wmllint: no spellcheck
        [/message]

        [message]
            speaker=Naga2
            # po: The extra s's in slay are also intended to mimic a hissing sound.
            message= _ "We will ssslay him..." # wmllint: no spellcheck
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "I do not think I will be the one dying here."
        [/message]

        [objectives]
            side=1
            [objective]
                condition=win
                description= _ "Defeat both nagas"
            [/objective]
            [objective]
                condition=lose
                description= _ "Death of Malin Keshar"
            [/objective]
            [gold_carryover]
                carryover_percentage=100
            [/gold_carryover]
        [/objectives]
    [/event]
    [event]
        name=last breath
        [filter]
            id=Naga1
        [/filter]

        [message]
            speaker=Naga1
            # po: this line is also just a death scream
            message= _ "Hsssss..." # wmllint: no spellcheck
        [/message]

        {PLACE_IMAGE "items/bones.png" $x1 $y1}

        {VARIABLE loc1.x $x1}
        {VARIABLE loc1.y $y1}
    [/event]
    [event]
        name=last breath
        [filter]
            id=Naga2
        [/filter]

        [message]
            speaker=Naga2
            # po: again, drawn out s's are just to mimic hissing
            message= _ "Evil... dark... magicssssss..." # wmllint: no spellcheck
        [/message]

        {PLACE_IMAGE "items/bones.png" $x1 $y1}

        {VARIABLE loc2.x $x1}
        {VARIABLE loc2.y $y1}
    [/event]

    [event]
        name=die
        first_time_only=no

        [filter]
            id=Naga1,Naga2
        [/filter]

        [if]
            [not]
                [have_unit]
                    id=Naga1,Naga2
                [/have_unit]
            [/not]
            [then]
                # this is necessary to stop the units from blocking their hexes
                [kill]
                    id=Naga1,Naga2
                [/kill]
                [fire_event]
                    name=cutscene2
                [/fire_event]
            [/then]
        [/if]
    [/event]

    [event]
        name=cutscene2

        [message]
            speaker=Darken Volk
            message= _ "Since you have mastered reanimating skeletons, I will now teach you to control spirits. The souls of the recently deceased do not stray far from their bodies. You should be able to sense them still."
        [/message]

        [move_unit]
            id=Malin Keshar
            to_x,to_y=$loc1.x,$loc1.y
        [/move_unit]

        [delay]
            time=300
        [/delay]

        [sound]
            name=wail-sml.wav
        [/sound]

        [delay]
            time=750
        [/delay]

        [sound]
            name=wail.wav
        [/sound]

        [delay]
            time=500
        [/delay]

        [message]
            speaker=Malin Keshar
            message= _ "I feel them."
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "Controlling spirits can be somewhat hazardous even for experienced necromancers. When imprisoning a soul, use all your might to retain control over it. You must exert your will over its own, or the spirit will break free and destroy you."
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "I... I will do my best."
        [/message]

        [animate_unit]
            [filter]
                id=Malin Keshar
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]

        [delay]
            time=400
        [/delay]

        [unit]
            type=Ghost
            x,y=$loc1.x,$loc1.y
            side=1
            animate=yes
            passable=yes
            id=S3_Rebel_Soul
        [/unit]

        [message]
            speaker=Malin Keshar
            message= _ "I... think I did it—"
        [/message]

        {MODIFY_UNIT (id=S3_Rebel_Soul) side 2}
        [delay]
            time=400
        [/delay]
        {MODIFY_UNIT (id=S3_Rebel_Soul) side 1}
        [delay]
            time=400
        [/delay]
        {MODIFY_UNIT (id=S3_Rebel_Soul) side 2}
        [delay]
            time=400
        [/delay]
        {MODIFY_UNIT (id=S3_Rebel_Soul) side 1}
        [delay]
            time=400
        [/delay]
        {MODIFY_UNIT (id=S3_Rebel_Soul) side 2}
        [delay]
            time=400
        [/delay]

        [message]
            speaker=S3_Rebel_Soul
            # po: more s's indicating hissing
            message=_ "Freedom! Your sssorceries sssshall not sshackle me any longer, Malin the Damned!" # wmllint: no spellcheck
        [/message]

        [message]
            speaker=Darken Volk
            message=_ "You blithering fool! How did you let your will be overcome by a half-sentient creature that can hardly come up with a single coherent sentence?! Let your will slip further and you shall join other young necromancers who have died at the hands of their own servants."
        [/message]

        [message]
            speaker=Malin Keshar
            message=_ "My will is strong, but he still does not return to me. What should I do?"
        [/message]

        [message]
            speaker=Darken Volk
            message=_ "Subdue the rebel! When you have sapped it of its energies, exert your power over it and do not lose focus."
        [/message]
    [/event]

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

        [message]
            speaker=Darken Volk
            message=_ "Seize control back while it is weakened!"
        [/message]

        [scroll_to]
            x,y=$x1,$y1
        [/scroll_to]

        {MODIFY_UNIT (id=S3_Rebel_Soul) side 1}
        [delay]
            time=400
        [/delay]
        {MODIFY_UNIT (id=S3_Rebel_Soul) side 2}
        [delay]
            time=400
        [/delay]
        {MODIFY_UNIT (id=S3_Rebel_Soul) side 1}
        [delay]
            time=400
        [/delay]
        {MODIFY_UNIT (id=S3_Rebel_Soul) side 2}
        [delay]
            time=400
        [/delay]
        {MODIFY_UNIT (id=S3_Rebel_Soul) side 1}
        [delay]
            time=400
        [/delay]

        [message]
            speaker=Malin Keshar
            message= _ "I think I’ve got it under control again. That was a close call. Let me try the other one now."
        [/message]

        [animate_unit]
            [filter]
                id=Malin Keshar
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]

        [delay]
            time=400
        [/delay]

        [unit]
            type=Ghost
            x,y=$loc2.x,$loc2.y
            side=1
            animate=yes
            passable=yes
        [/unit]

        [delay]
            time=500
        [/delay]

        [message]
            speaker=Darken Volk
            message= _ "No mishaps this time, but you will need to practice more."
        [/message]

        {CLEAR_VARIABLE loc1}
        {CLEAR_VARIABLE loc2}

        [terrain]
            x=11,12
            y=3,3
            terrain=Re
        [/terrain]
        [terrain]
            x=11,12
            y=4,4
            terrain=Uu
        [/terrain]
        [redraw][/redraw]

        {FULL_HEAL_RESTORE (side=1)}

        {GENERIC_UNIT 2 (Giant Scorpion) 5 5}
        {GENERIC_UNIT 2 (Giant Scorpion) 8 3}
        {GENERIC_UNIT 2 (Giant Scorpion) 9 8}
        {GENERIC_UNIT 2 (Giant Scorpion) 8 8}

        {MODIFY_UNIT (type=Giant Scorpion) max_moves 4}

        {OBJECTIVE_EXPLORE}
    [/event]

    # Fifth area (scorpions/trolls)
    [event]
        name=enter hex
        [filter]
            side=1
            x,y=5-9,6-7
        [/filter]

        [message]
            speaker=Malin Keshar
            message= _ "Rail tracks and mines... dwarves used to live here, but there do not seem to be any guards. I wonder where they went?"
        [/message]
    [/event]

    [event]
        name=sighted
        [filter]
            race=troll
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=Malin Keshar
            message= _ "Trolls! I suppose I should have expected this."
        [/message]

        [message]
            speaker=Darken Volk
            message= _ "Threats to your skeletons, but no more than fodder for your ghosts. Eliminate them all."
        [/message]

        [modify_unit]
            [filter]
                race=troll
            [/filter]
            [effect]
                apply_to=status
                remove=guardian
            [/effect]
        [/modify_unit]

        [objectives]
            side=1
            [objective]
                condition=win
                description= _ "Defeat the trolls"
            [/objective]
            [objective]
                condition=lose
                description= _ "Death of Malin Keshar"
            [/objective]
            [gold_carryover]
                carryover_percentage=100
            [/gold_carryover]
        [/objectives]
    [/event]

    [event]
        name=die
        first_time_only=no
        [filter]
            race=troll
        [/filter]

        {VARIABLE loc1.x $x1}
        {VARIABLE loc1.y $y1}

        [fire_event]
            name=create ghost
        [/fire_event]

        [if]
            [not]
                [have_unit]
                    race=troll
                [/have_unit]
            [/not]
            [then]
                [message]
                    speaker=Malin Keshar
                    message= _ "The trolls are defeated."
                [/message]
                [endlevel]
                    result=victory
                    bonus=no
                    {NEW_GOLD_CARRYOVER 100}
                [/endlevel]
            [/then]
        [/if]
    [/event]

    [event]
        name=create ghost
        first_time_only=yes

        [message]
            speaker=Malin Keshar
            message= _ "<i>If I act quickly, I can enslave another ghost to help me fight off the rest of these trolls.</i>"
        [/message]

        [kill]
            x,y=$loc1.x,$loc1.y
        [/kill]

        [animate_unit]
            [filter]
                id=Malin Keshar
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]

        [delay]
            time=400
        [/delay]

        [unit]
            type=Ghost
            x,y=$loc1.x,$loc1.y
            side=1
            animate=yes
        [/unit]

        [message]
            speaker=Darken Volk
            message= _ "<i>The boy learns quickly. He should be of great use after all.</i>"
        [/message]

        {CLEAR_VARIABLE loc1}
    [/event]

    [event]
        name=victory

        [message]
            speaker=Darken Volk
            message= _ "You have done well enough so far, but I still have much more to teach you. Come, we have work to do."
        [/message]

        {MODIFY_UNIT (id=Darken Volk) max_moves 6}
        {MODIFY_UNIT (id=Darken Volk) moves 6}
        {MODIFY_UNIT (id=Darken Volk) side 1}
    [/event]

    {HERODEATH_MALIN}
    {HERODEATH_VOLK}
[/scenario]

#undef OBJECTIVE_EXPLORE
#undef FULL_HEAL_RESTORE
