#textdomain wesnoth-l
[scenario]

    id=the_gray_woods
    name= _ "The Gray Woods"
    map_data="{campaigns/Liberty/maps/gray_woods.map}"
    {TURNS 50 44 42}

    next_scenario=the_hunters
    {SCENARIO_MUSIC "underground.ogg"}
    {VICTORY_AND_DEFEAT_MUSIC}
    victory_when_enemies_defeated=yes

    [story]
        [part]
            music="underground.ogg"
            show_title=yes
            background="maps/wesnoth-liberty.png"
            {L_DOT 279 360}
            {L_DOT 283 380}
            {L_CROSS 288 400}
        [/part]
    [/story]

    {SECOND_WATCH}
    {DAWN}
    {MORNING}
    {AFTERNOON}
    {DUSK}
    {FIRST_WATCH}

    [side]
        type=Bandit
        description=Baldras
        side=1
        canrecruit=yes
        controller=human
        recruit=Thug,Footpad,Poacher
        hitpoints=50
        {GOLD 300 200 150}
#ifdef EASY
        shroud=no
        fog=yes
        share_maps=yes
        share_view=yes
#endif
#ifdef NORMAL
        shroud=yes
        fog=yes
        share_maps=yes
        share_view=yes
#endif
#ifdef HARD
        shroud=yes
        fog=yes
        share_maps=yes
        share_view=no
#endif
        team_name=good_guys
    [/side]

    [side]
        type=Shadow Lord
        description=Helicrom
        user_description= _ "Helicrom"
        profile=portraits/p_helicrom.png
        facing=sw
        side=2
        canrecruit=yes
        recruit=Rogue Mage,Shadow Mage,Thief,Trapper,Huntsman,Outlaw,Fugitive
        {GOLD 450 350 300}
        controller=ai
        [ai]
            recruitment_pattern=mixed fighter,mixed fighter,fighter,mixed fighter,archer
        [/ai]
        shroud=yes
        fog=yes
        share_maps=yes
        share_view=yes
        team_name=good_guys

        [ai]
            village_value=0.5
            leader_value=1

            [protect_unit]
                side=1
                radius=8
                value=2.0
            [/protect_unit]
        [/ai]
    [/side]

    {STARTING_VILLAGES 2 9}

    [side]
        type=Necromancer
        description=Mal-Jarrof
        user_description= _ "Mal-Jarrof"
        side=3
        canrecruit=yes
        recruit=Skeleton,Skeleton Archer,Ghost,Walking Corpse,Ghoul
        controller=ai
        {GOLD 80 100 100}
        shroud=no
        fog=no
        team_name=evil_ones
    [/side]

    [side]
        type=Necromancer
        description=Mal-Jerod
        user_description= _ "Mal-Jerod"
        side=4
        canrecruit=yes
        recruit=Skeleton,Revenant,Skeleton Archer,Ghost,Walking Corpse
        controller=ai
        {GOLD 80 100 100}
        shroud=no
        fog=no
        team_name=evil_ones
    [/side]

    [side]
        type=Lich
        description=Sel-Mana
        user_description= _ "Sel-Mana"
        facing=sw
        side=5
        canrecruit=yes
        recruit=Skeleton,Dark Adept,Skeleton Archer,Soulless,Vampire Bat
        controller=ai
        {GOLD 80 100 100}
        shroud=no
        fog=no
        team_name=evil_ones
    [/side]
    #
    # Prestart events
    #
    [event]
        name=prestart

        # {SCATTER_IMAGE (terrain=Gs^Fp) 30 "scenery/pine1.png"}

        [objectives]
            side=1
            [objective]
                description= _ "Defeat the lich and its minions"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]

        #Initialize switch
        {VARIABLE Helicrom_dead 0}

        #
        # Give Helicrom some free underlings and the villages in his camp
        #
        {GENERIC_UNIT 2 (Rogue Mage) 13 6}
        {GENERIC_UNIT 2 (Shadow Mage) 11 7}

        #
        # Give the SE Lich some baddies to shake things up
        #
        {GENERIC_UNIT 5 Wraith 37 36}
#ifdef HARD
        {GENERIC_UNIT 5 Shadow 36 36}
#endif

        [item]
            x,y=19,30
            image=items/altar-evil.png
        [/item]

        [item]
            x,y=8,19
            image=items/burial.png
        [/item]
        [item]
            x,y=37,39
            image=items/bonestack.png
        [/item]
        [item]
            x,y=35,31
            image=items/burial.png
        [/item]
        [item]
            x,y=33,35
            image=items/bones.png
        [/item]
    [/event]

    #
    # Create a goodie for you to find
    # This macro creates an moveto event that gives you an object

    {OBJ_HOLY_ANKH 19 30 ankh1}

    #
    # Starting conversation and actions
    #
    [event]
        name=start
        {MOVE_UNIT description=Baldras 7 4}
        [recall]
            description=Harper
        [/recall]
        [redraw]
            side=1
        [/redraw]
        [message]
            description=Baldras
            message= _ "The leader, I presume."
        [/message]
        [message]
            description=Helicrom
            message= _ "I am Helicrom, and you should not be so glib. I control dangerous men. My henchmen can slip unseen through any city, rob a man while he sleeps, or attack a caravan head-on. It's not noble work, but our pursuits require plenty of gold."
        [/message]
        [message]
            description=Baldras
            message= _ "Your pursuits?"
        [/message]
        [message]
            description=Helicrom
            message= _ "The former King's magic ministry kept a tight control on the training and employment of mages in Wesnoth. Those of us who dared to... depart from the curriculum, you might say, were dealt with harshly. We are outcasts because we seek to master shadow magic. Our secrecy and security are not cheap."
        [/message]
        [message]
            description=Baldras
            message= _ "I have heard of you. Necromancers. Barely-human scum, I say."
        [/message]
        [message]
            description=Helicrom
            message= _ "Wrong. Necromancers become slaves to their lich masters and eventually lose their humanity. We have proven that practicing the dark arts need not lead down that path to damnation. We remain human, and seek the mystical secret of balance between the ways of light and darkness. We dance between both ways, adhering to neither."
        [/message]
        [message]
            description=Baldras
            message= _ "I...see, I think. Why do you want to help us?"
        [/message]
        [message]
            description=Helicrom
            message= _ "We don't. You have sought us out. But, I do know of your situation and am willing to help. Any weakening of the Throne of Wesnoth, whether it be occupied by King or Queen, aids us."
        [/message]
        [message]
            description=Helicrom
            message= _ "Carcyn is always foggy as of late because these woods have recently become home to a lich and two of its underling necromancers. Our experiments may have actually aroused it from sleep... we're not exactly sure."
        [/message]
        [message]
            description=Baldras
            message= _ "So now you need to defend your rear as well as your front... I see your predicament. My men will wipe this land clean if you can help us defend our homeland."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            description=Sel-Mana
        [/filter]
        [if]
            [have_unit]
                side=3
                canrecruit=yes
            [/have_unit]

            [or]
                [have_unit]
                    side=4
                    canrecruit=yes
                [/have_unit]
            [/or]

            [then]
                [message]
                    description=Helicrom
                    message= _ "Finally that creature is dead, yet its foolish minions resist."
                [/message]
            [/then]

            [then]
                [message]
                    description=Baldras
                    message= _ "The lich is destroyed and its minions dead."
                [/message]
            [/then]
        [/if]
    [/event]

    [event]
        name=victory

        [if]
            [variable]
                name=Helicrom_dead
                numerical_equals=1
            [/variable]
            [then]
                [message]
                    speaker=narrator
                    message= _ "The defeat of the evil lich infesting the Gray Woods was a bittersweet victory. With Helicrom dead, the guild of shadow magic was thrown into disarray."
                    image="wesnoth-icon.png"
                [/message]
                [message]
                    speaker=narrator
                    message= _ "The remaining members were very grateful and offered Baldras a sizeable sum of gold for his help. It was not the help he was hoping for, but he knew it would have to be enough for the coming conflict."
                    image="wesnoth-icon.png"
                [/message]
                [sound]
                    name=gold.ogg
                [/sound]
                [gold]
                    side=1
                    amount=500
                [/gold]
                [set_variable]
                    name=Helicrom_status
                    value=1
                [/set_variable]
            [/then]

            [else]
                [message]
                    description=Helicrom
                    message= _ "With the undead driven out, we may live here in relative peace and pursue our studies. For this, Baldras, I am grateful."
                [/message]
                [message]
                    description=Baldras
                    message= _ "Studies? Peace? You mean to continue feeding on the lawful citizens of Wesnoth. There will be no peace for them."
                [/message]
                [message]
                    description=Helicrom
                    message= _ "No one here is in a position to be dispensing moral judgments. Regardless, you cannot overestimate the value of the service you have performed here today. I will help you to the utmost of my ability."
                [/message]
                [message]
                    description=Helicrom
                    message= _ "I was planning on giving you gold. Any good army is well financed, and with the lich gone we can now spare it."
                [/message]
                [message]
                    description=Helicrom
                    message= _ "But, I think it would help you more if I lent you some of my men to join you on your adventures. The Queen has been sending mages out here, and my men are itching for some payback."
                [/message]
                [message]
                    description=Helicrom
                    message= _ "On the other hand, if I keep the full force of my organization here, we might be able to regroup and join you on the battlefield when the time comes."
                [/message]
                [message]
                    description=Helicrom
                    message= _ "I leave it to you to decide."
                    [option]
                        message= _ "I will take the gold. How does 500 sound?"
                        [command]
                            [message]
                                description=Helicrom
                                message= _ "Agreed. Good luck and farewell to you, Master Baldras."
                            [/message]

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

                            [gold]
                                side=1
                                amount=500
                            [/gold]

                            [set_variable]
                                name=Helicrom_status
                                value=1
                            [/set_variable]
                        [/command]
                    [/option]

                    # Note: don't mess with the alignment in the next message key.
                    [option]
                        message= _ "Send your men with us. They will be valuable help as we prepare for the assault from the Wesnoth army garrison."
                        [command]
                            [message]
                                description=Helicrom
                                message= _ "Done. My finest mages and thieves are at your disposal. Use them well."
                            [/message]

                            [allow_recruit]
                                type=Thief,Rogue Mage,Shadow Mage
                            [/allow_recruit]

                            [set_variable]
                                name=Helicrom_status
                                value=2
                            [/set_variable]
                        [/command]
                    [/option]
                    [option]
                        message= _ "I wish you to join us in battle against the Queen's forces."
                        [command]
                            [message]
                                description=Helicrom
                                message= _ "Alright. I need time to clean up this forest and recall my men from the countryside. We will be ready to march in 7 days. All now hinges on you! Until then..."
                            [/message]

                            [set_variable]
                                name=Helicrom_status
                                value=3
                            [/set_variable]
                        [/command]
                    [/option]
                [/message]
            [/else]
        [/if]

        {CLEAR_VARIABLE Helicrom_dead}
    [/event]

    #
    # Loss conditions - turns run out
    #
    [event]
        name=time over
        [message]
            description=Baldras
            message= _ "We have spent too much time here. Surely the Queen's forces have returned to Dallben. Our mission is unfinished, but we must return to fight a suicide battle."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    {LIBERTY_DEATHS}

    #
    # Helicrom dies - you don't lose but your benefits are not so good.
    #
    [event]
        name=die
        [filter]
            description=Helicrom
        [/filter]
        [message]
            description=Helicrom
            message= _ "My men... have failed to protect me! I perish..."
        [/message]
        {VARIABLE Helicrom_dead 1}
    [/event]
[/scenario]
