#textdomain wesnoth-sof
[scenario]
    name= _ "A Bargain is Struck"
    id=1_A_Bargain_is_Struck
    turns=24
    map_data="{@campaigns/Sceptre_of_Fire/maps/1_A_Bargain_is_Struck.map}"
    next_scenario=2_Closing_the_Gates

    {SCENARIO_MUSIC knolls.ogg}
    {EXTRA_SCENARIO_MUSIC loyalists.ogg}
    {EXTRA_SCENARIO_MUSIC breaking_the_chains.ogg}

    {DEFAULT_SCHEDULE}

    [side]
        type=Dwarvish Fighter
        id=Rugnur
        name= _ "Rugnur"
        side=1
        canrecruit=yes
        facing=sw
        profile=portraits/rugnur.png
        controller=human
        recruit=Dwarvish Fighter,Dwarvish Thunderer
        team_name=good
        user_team_name=_"Allies"
    [/side]

    {STARTING_VILLAGES 1 4}

    [side]
        type=Haldric II
        id=Haldric II
        name= _ "Haldric II"
        side=2
        canrecruit=yes
        profile=portraits/haldric-ii.png
        {RECRUIT (Swordsman,Longbowman,Dragoon,Cavalryman,Red Mage,Mage) (Swordsman,Longbowman,Cavalryman,Red Mage,Mage) (Swordsman,Longbowman,Cavalryman,Mage)}
        {GOLD 300 250 200}
        team_name=good
        user_team_name=_"Allies"
        [ai]
            turns=1-3
            recruitment_pattern=fighter,archer
            aggression=1.0
            caution=0.5
            leader_value=0
            village_value=0.0
        [/ai]

        [ai]
            turns=4-FOREVER
            recruitment_pattern=fighter,archer
            aggression=0.5
            caution=0.5
            leader_value=0
            village_value=0.0
            [protect_unit]
                type=Caravan
                radius=1
                value=7
            [/protect_unit]
            [avoid]
                x=0-32,17-32
                y=1-15,24-32
            [/avoid]
        [/ai]
    [/side]

    {STARTING_VILLAGES 2 5}

    [side]
        type=Elvish Captain
        id=Glildur
        name= _ "Glildur"
        side=3
        canrecruit=yes
        facing=sw
        {RECRUIT (Elvish Fighter,Elvish Scout,Elvish Archer) (Elvish Fighter,Elvish Scout,Elvish Archer,Elvish Shaman) (Elvish Fighter,Elvish Scout,Elvish Archer,Elvish Shaman)}
        {GOLD 175 225 250}
        [ai]
            grouping=offensive
            passive_leader=yes
        [/ai]
    [/side]

    {STARTING_VILLAGES 3 6}

    [story]
        [part]
            # wmllint: local spelling Ay
            story= _ "Ay, the Sceptre of Fire. The sceptre has a long, glorious, and fearful history. But I am not here to tell you how the jewel within it was brought over the ocean by Haldric the Great. Nor will I tell the story of Garard I, and the challenge he set, or that of Konrad, king of Wesnoth by virtue of the Sceptre."
        [/part]
        [part]
            story= _ "I am here to tell you of its making. Of its crafting, deep in the caverns of dwarfdom. And of the dwarves who made it; for they were great, they were. They are counted among the greatest of the heroes of ancient Knalga."
        [/part]
        [part]
            story= _ "Our story begins in a small border outpost in the southern hills of Knalga, with a young dwarf, named Rugnur, in charge of it. And with the second king of Wesnoth, Haldric II, riding up the road from the Ford of Abez with an army behind him..."
        [/part]
        [part]
            show_title=yes
            {TO_A_BARGAIN_IS_STRUCK}
        [/part]
    [/story]

    {SOF_DEATHS}

    [event]
        name=prestart

        # {SCATTER_IMAGE (terrain=Gg,Gs^Fp) 6 scenery/pine1.png}
        # {SCATTER_IMAGE (terrain=Gg) 3 scenery/snowbits.png}
        # {SCATTER_IMAGE (terrain=Wo) 1 scenery/icepack-1.png}

        [objectives]
            side=1
            [objective]
#ifdef HARD
                description= _ "Transport 5 caravans full of silver back to the dwarvish castle"
#else
                description= _ "Transport 4 caravans full of silver back to the dwarvish castle"
#endif
                condition=win
            [/objective]
            [objective]
                description= _ "Bring Alanin, who has the Ruby of Fire, to the dwarvish castle"
                condition=win
            [/objective]
            [objective]
                description= _ "<255,255,255>Alternative objective:
@Defeat Glildur
`(early finish bonus)"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Rugnur"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Haldric II"
                condition=lose
            [/objective]
            [objective]
                description= _ "Capture (death) of a caravan"
                condition=lose
            [/objective]
            [objective]
                description= _ "Time runs out"
                condition=lose
            [/objective]

            note={NEW_GOLD_CARRYOVER_NOTE_40}	# wmllint: ignore
        [/objectives]

#ifdef HARD
        [terrain]
            terrain=Ha
            x,y=12,3
        [/terrain]
#endif

#ifdef EASY
#else
        [terrain]
            terrain=Aa^Fpa
            x,y=1,4
        [/terrain]
        [terrain]
            terrain=Aa^Fpa
            x,y=3,8
        [/terrain]
#endif

        [capture_village]
            side=1
            x=1-31
            y=1-10
        [/capture_village]
    [/event]

    [event]
        name=start
        [message]
            speaker=Rugnur
            message= _ "Humans, halt! Who dares bring an army into the dwarvish hills?"
        [/message]
        [message]
            speaker=Haldric II
            message= _ "We come to make a bargain with you."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "Well, state your business and be done with it. And if we don't like what you say, you leave!"
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Have you heard of the Ruby of Fire?"
        [/message]
        [message]
            speaker=Rugnur
            message= _ "Yes... your first king brought it from over the sea, right? You own it."
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Correct. However, we have a problem with it."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "What sort of problem?"
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Some form of magical aura makes those around the stone act... strangely. I noticed it with my father. The longer he stayed near the stone, the more arrogant, almost evil, he became."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "So, what do you want me to do? I don't see how this relates to us dwarves."
        [/message]
        [message]
            speaker=Haldric II
            message= _ "When the elves came to Weldyn, about ten years ago, they spoke of a mage named Crelanu, and of his advice about the ruby. He said that the radiance of the stone could be contained, and that doing so would stop the stone's effect."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "And what... you want us to do this, contain the radiance of the stone? By making an artifact of some kind?"
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Exactly. I want you to craft it into a mighty artifact, that will leverage the stone's power, but contain it also."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "Well... I think we can make a deal, but I'm not sure. I'll have to ask the tribal leaders."
        [/message]
        [message]
            speaker=Haldric II
            message= _ "If you are not authorized to make a deal, send out someone who is, and I will bargain with him."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "They would refuse to come. You must come into the caves, and go to the city in person, or send a representative."
        [/message]
        [message]
            speaker=Haldric II
            message= _ "I can always take my offer to another tribe more friendly to its potential patrons. You are not the only smiths in the Northlands!"
        [/message]
        [message]
            speaker=Rugnur
            message= _ "Uh, no, wait! Lets talk business - how much will you pay us to do this for you?"
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Five thousand pieces of silver."
        [/message]
        [message]
            speaker=Rugnur
            # wmllint: local spelling playtoy
            message= _ "You said you wanted a powerful magical artifact, not a child's playtoy! So... twenty thousand, minimum. The crafting of this will take us many years, you must pay us well."
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Ten thousand."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "Nothing below fifteen!"
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Then no deal. I'll gather my things and go to another dwarvish clan now."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "Fine then - ten thousand... now, what exactly do you want us to make the stone into?"
        [/message]
        [message]
            speaker=Haldric II
            message= _ "I want you to make it into a sceptre, a sceptre of fire."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "I'll see what I can do. But I will need five thousand silver in advance, to pay for the materials."
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Very well. I have the silver here, ready to ship, and I will send someone over with the stone itself. He will stay with you as you make the sceptre, and make sure you are going to get it done on time. I expect it done before my reign as king is ended."
        [/message]
        [unit]
            x,y=6,26
            type=Dragoon
            side=1
            id=Alanin
            name= _ "Alanin"
            {IS_HERO}
            profile=portraits/alanin.png
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_RESILIENT}
            [/modifications]
        [/unit]
        [message]
            speaker=Alanin
            message= _ "Thats right. I'll be coming over along with the silver."
        [/message]
        [message]
            speaker=Glildur
            message= _ "Hey! You can't do that - this road is an elvish road. We're not letting you transport gold and jewels on it without paying a toll."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "What are you talking about?! This road has always been open to all."
        [/message]
        [message]
            speaker=Glildur
            message= _ "Yes, we have allowed people to use it, but it is our road."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "Not true! This is dwarvish land; if anything, it's our road!"
        [/message]
        [message]
            speaker=Glildur
            message= _ "Nevertheless, if you try to move your caravans here you have to pay the toll, or face our wrath!"
        [/message]
        [message]
            speaker=Haldric II
            message= _ "We Wesnothians and you elves have a treaty! Do you really mean to break it in defense of a road that is not even yours?!"
        [/message]
        [message]
            speaker=Glildur
            message= _ "I was never among those who agreed to that treaty. Not all of us Elves are as low as Kalenz, or make deals with those who betrayed us."
        [/message]
        [message]
            speaker=Haldric II
            message= _ "Ah, I see - you are one of the rebels. Our treaty with the elves does not apply to you, so I have no problem with slaying you if you stand in our way. Rugnur, we will proceed with the shipment."
        [/message]
        [message]
            speaker=Rugnur
            message= _ "Very well. Glildur, if the high elvish council has made an alliance with the men, I would advise you to follow it, but not doing so is your choice."
        [/message]
        [set_variable]
            name=incominggold
            value=5000
        [/set_variable]
        [unit]
            x,y=6,29
            type=Caravan
            side=1
        [/unit]
        [unit]
            x,y=6,29
            type=Caravan
            side=1
        [/unit]
        [unit]
            x,y=6,29
            type=Caravan
            side=1
        [/unit]
        [unit]
            x,y=6,29
            type=Caravan
            side=1
        [/unit]
#ifdef HARD
        [unit]
            x,y=6,29
            type=Caravan
            side=1
        [/unit]
#endif
    [/event]

    # Alanin reaches the dwarvish citadel

    [event]
        name=moveto
        [filter]
            id=Alanin

            [filter_location]
                terrain=Kud,Cud
            [/filter_location]
        [/filter]
        [message]
            speaker=Alanin
            message= _ "Here's the stone, for you dwarves! Now, if you'll excuse me, I think I'll be taking refuge in this castle here... I don't much like fighting."
        [/message]
        [set_variable]
            name=havestone
            value=yes
        [/set_variable]
        [store_unit]
            [filter]
                x,y=$x1,$y1
            [/filter]
            variable=changealanin
            kill=yes
        [/store_unit]
        [if]
            [variable]
                name=incominggold
                equals=0
            [/variable]
            [then]
                [message]
                    speaker=Haldric II
                    message= _ "All the gold is there too. Proceed with the task, Rugnur!"
                [/message]
                [unstore_unit]
                    variable=changealanin
                [/unstore_unit]
                [endlevel]
                    result=victory
                    bonus=no
                    {NEW_GOLD_CARRYOVER 40}
                [/endlevel]
            [/then]
        [/if]
    [/event]

    # Caravan reaches the dwarvish citadel

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=26-30
            y=3-6
            side=1
            type=Caravan
        [/filter]
        [set_variable]
            name=incominggold
#ifdef HARD
            add=-1000
#else
            add=-1250
#endif
        [/set_variable]
        [if]
            [variable]
                name=incominggold
                greater_than=0
            [/variable]
            [then]
                [message]
                    speaker=unit
                    message= _ "Cargo unloaded."
                [/message]
                [if]
                    [variable]
                        name=havestone
                        equals=yes
                    [/variable]
                    [then]
                        [message]
                            speaker=Haldric II
                            message= _ "You only need $incominggold more, then you can begin work."
                        [/message]
                    [/then]
                    [else]
                        [message]
                            speaker=Haldric II
                            message= _ "You only need $incominggold more, and the stone, then you can begin work."
                        [/message]
                    [/else]
                [/if]
            [/then]
            [else]
                [if]
                    [variable]
                        name=havestone
                        equals=yes
                    [/variable]
                    [then]
                        [message]
                            speaker=Rugnur
                            message= _ "That's the last caravan! We will commence work immediately."
                        [/message]
                        [unstore_unit]
                            variable=changealanin
                        [/unstore_unit]
                        [endlevel]
                            result=victory
                            bonus=no
                            {NEW_GOLD_CARRYOVER 40}
                        [/endlevel]
                    [/then]
                    [else]
                        [message]
                            speaker=Rugnur
                            message= _ "We have all of the silver, now all we need is the stone."
                        [/message]
                    [/else]
                [/if]
            [/else]
        [/if]
        [kill]
            x,y=$x1,$y1
        [/kill]
    [/event]

    [event]
        name=turn 10
        [message]
            speaker=Glildur
            message= _ "Ha! Our reinforcements have arrived. There is no way you can withstand our combined strength!"
        [/message]
        [message]
            speaker=Rugnur
            message= _ "We cannot match you above ground, but in the caves we may still defeat you."
        [/message]
        [message]
            speaker=Glildur
            message=_ "We will see about that - if you ever get underground, which I doubt. Ha!"
        [/message]
        [gold]
            side=3
            amount=500
        [/gold]
        [message]
            speaker=Haldric II
            message= _ "Elvish reinforcements! Where did these come from? I thought the elvish resistance to the treaty was smaller than this. Hurry up and move those caravans!"
        [/message]
    [/event]

    # Tie-ins to the Legend of Wesmere.  The elves are xenophobes from
    # Landar's faction.
    [event]
        name=attack
        first_time_only=yes

        [filter]
            side=3
        [/filter]
        [filter_second]
            side=2
        [/filter_second]

        [message]
            speaker=unit
            # wmllint: local spelling Landar
            message=_ "Die, humans, in the name of Landar!"
        [/message]
        [message]
            speaker=second_unit
            message=_ "Landar? Who is this 'Landar' you speak of?"
        [/message]
    [/event]

    [event]
        name=attack
        first_time_only=yes

        [filter]
            side=3
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=unit
            message=_ "Die, dwarvish scum, in the name of Landar!"
        [/message]
        [message]
            speaker=second_unit
            message=_ "Yer precious Landar can kiss my axe."
        [/message]
    [/event]

    [event]
        name=enemies defeated

        [if]
            [variable]
                name=havestone
                equals=yes
            [/variable]

            [then]
                [unstore_unit]
                    variable=changealanin
                    find_vacant=yes
                [/unstore_unit]
            [/then]
        [/if]

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

    [event]
        name=die
        [filter]
            side=1
            type=Caravan
        [/filter]
        [message]
            speaker=Haldric II
            message= _ "You just let a caravan, with MY money loaded in it, get captured! If I can't trust you to keep my property secure, the deal's off."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
[/scenario]
