#textdomain wesnoth-did

[scenario]
    id=01_Saving_Parthyn
    name= _ "Saving Parthyn"
    map_file=01_Saving_Parthyn.map
    turns=13
    next_scenario=02_Peaceful_Valley
    victory_when_enemies_defeated=no

    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC       northerners.ogg}
    {EXTRA_SCENARIO_MUSIC loyalists.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}

    [story]
        [part]
            music=elvish-theme.ogg
            #                          **THIS TEXT CONTAINS SPOILERS**
            # po: Comments about dialogue style and characterization:
            # po: Drogan: although he is the captain of Parthyn's guard, he shows signs of recklessness and inflexibility; he's stiff and stubborn, which causes him to butt heads with Malin
            # po:           often, we see that Drogan says something to Malin (e.g. banishing him) without a clearly good reason why, and that's because of his ego and confidence in his own righteousness
            # po:           Drogan speaks with a country accent, using things like "ta" instead of "to", "ya" instead of "you", "thar" instead of "there", and some incorrect grammatical constructs like "them orcs" instead of "the orcs"
            # po: Darken Volk: he talks a little more formally than Malin, and has quite a few ellipses in his speech. These are at points where he's not speaking exactly what he's thinking in his head because in reality,
            # po:           he's trying to manipulate Malin for his own gain. His mode of speech is a little more formal.
            # po: Dela: little more of a minor character, she's what you might expect from a sister. She isn't wholly against Malin until he kills Drogan, but she also doesn't really want to do much with a necromancer either.
            # po:           She tries to be understanding, but falls short in the end because of her prejudice against dark magic. Note: Dela also speaks with a country accent like Drogan, but not as heavily so.
            # po:           More "country accent" words: "s'ppose" instead of suppose, "’em" instead of them, dropping the g at the end of a word for ’ (bickering -> bickerin’), "’bout" instead of "about", "’im" instead of him
            # po:           "woulda" -> would have, "o’" -> of, "gotta" -> have to
            # po: Malin: rash and impulsive, he cares a lot about his home, but doesn't see that power itself can be a corrupting force (though he does not seek power just for the sake of it, it is for another purpose which is
            # po:           to drive off the orcs). He's a little more informal in his speech, meaning more contractions and colloquialisms, stemming from his "country accent" (which is not as strong as Drogan's or Dela's due to his time on Alduin).
            # po: Things to be careful about while editing: there are some poems in S8 and S11, please be mindful when making wording changes there. Some commas are added for readability even though they may not be grammatically correct.
            # po:
            # po: If the target language has a specialized term for a fortified town, like Latin "oppidum", use it for Parthyn.
            story= _ "Malin Keshar was born ten years after the death of Haldric IV. He grew up in the northern border town of Parthyn, the second child and eldest son of the city’s baron. Every summer, by the time the mountainous paths and high passes shed their wintry gowns of snow, orcs descended from the northern hills to ravage the settlements at the frontier. Every year, Malin’s father led the townsfolk to repel the raids and force the orcs to retreat back to the north."
            {STORYTXT_BACKGROUND_BIGMAP_DID}
        [/part]
        [part]
            story= _ "When Malin was ten, a passing mage sensed strong magical abilities in the boy and suggested he be sent to the Isle of Alduin for training in the magical arts. Malin studied there for eight years, learning all manner of magic from basic control over the elements, to the mystic arts and scrying, to alchemy and simple medicine."
            {STORYTXT_BACKGROUND_BIGMAP_DID}
        [/part]
        [part]
            story= _ "Although his life on Alduin was luxurious and peaceful, Malin found the teachings of the scholarly mages to be too philosophical for his tastes. His thoughts turned back to Parthyn, where more practical magics were necessary to drive off the orcs. Malin began to research these magics on his own, but his lack of patience and general indiscretion eventually led to several confrontations with his teachers and other students. Believing Malin to be too reckless, the mages expelled him from Alduin."
            {STORYTXT_BACKGROUND_BIGMAP_DID}
        [/part]
        [part]
            story= _ "When Malin returned to Parthyn, orcs had already begun to attack the city. Although he tried his best to fight them off, the raids were far more relentless and the town guard was far weaker than he had remembered. One night, a particularly powerful band of orcs overran the city walls and Malin could only watch as his father was cut down by one of the savage orcish warriors."
            {STORYTXT_BACKGROUND_BIGMAP_DID}
        [/part]
        [part]
            story= _ "Shaken by the loss of their commander, the human defense began to falter. The orcs roared in anticipation of victory, but before they could overrun the city, skeleton warriors poured out of the woods to their rear. The undead cut down orc after orc, swords and axes hacking through flesh and bone with ruthless efficiency. The soldiers watched in half amazement, half fear as the orcs dropped and the skeletons turned toward them, empty eyes bleeding with fetid magic. All was dreadfully still as the blood and carnage settled in the rank darkness."
            {STORYTXT_BACKGROUND_BIGMAP_DID}
        [/part]
        [part]
            story= _ "The silence was broken by the irregular shuffle of a man emerging from the trees. He stood before them, a hunched figure with a rasping voice reminiscent of crackling bones. <i>“I am Darken Volk. While I know you do not love my kind, I think it is vital that we put aside our differences. The orcish menace grows in the north and they will soon return in even greater force. You cannot hope to defend against them without my... help. For now, I ask only to refresh myself in your town.”</i>"
            {STORYTXT_BACKGROUND_BIGMAP_DID}
        [/part]
        # Drogan uses 'I' here because he thinks of himself in charge when technically, Dela or Malin should be (as the children of the Baron)
        # He also does this later when he tells them to be quiet and to stop bickering
        [part]
            story= _ "Drogan, the captain of the guard, replied, <i>“Nay, ye surely know that tha law says tha penalty fer necromancy be death. But, since you’ve saved our town, I’ll let ya rest here fer up ta three days. After, I’m banishin’ ya from Parthyn. Should ye return, we’ll attack ya on sight.”</i>"
            {STORYTXT_BACKGROUND_BIGMAP_DID}
        [/part]
        [part]
            story= _ "Malin, troubled by his father’s death and the strength of the orcish assault, argued to no avail that Darken Volk be allowed to stay. After a couple days, the necromancer left Parthyn without incident."
            {STORYTXT_BACKGROUND_BIGMAP_DID}
        [/part]
    [/story]

    {DID_TRACK {JOURNEY_01_NEW}}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        recruit=Walking Corpse
        {GOLD 90 70 50}
        team_name=town guard
        user_team_name= _ "Defenders"
        {FLAG_VARIANT undead}
        color=darkblue

        # wmllint: recognize Malin Keshar
        {CHARACTER_STATS_MALIN_KESHAR}

        facing=nw

        # Starting units for Malin
        {LOYAL_UNIT 1 (Spearman) 28 11}
        {LOYAL_UNIT 1 (Bowman)   26 15}
        {LOYAL_UNIT 1 (Spearman) 23 12}
    [/side]
    # wmllint: validate-on

    [side]
        side=2
        controller=ai
        recruit=Orcish Grunt,Orcish Archer,Wolf Rider,Orcish Crossbowman
        {GOLD 70 105 140}
        {INCOME 2 4 6}
        team_name=orcs
        user_team_name= _ "Orcs"
        {FLAG_VARIANT6 ragged}
        color=white

        type=Orcish Warrior
        id=Kreg'a'shar Trr
        name= _ "Kreg’a’shar Trr"
        canrecruit=yes

        facing=se

        [ai]
            aggression=0.8
            leader_value=3
            grouping=offensive
            caution=0.1
            recruitment_pattern=fighter,archer,scout
        [/ai]
    [/side]

    [side]
        side=3
        controller=ai
        recruit=Peasant,Woodsman,Spearman
        {GOLD 40 30 20}
        team_name=town guard
        user_team_name= _ "Defenders"
        {FLAG_VARIANT loyalist}
        color=green

        type=Sergeant
        id=Drogan
        name= _ "Drogan"
        experience=17
        profile=portraits/drogan.webp
        canrecruit=yes
        unrenamable=yes

        facing=ne

        # Starting units for Drogan
        {LOYAL_UNIT 3 (Swordsman) 15 17} {GUARDIAN}
        {UNIT 3 (Spearman) 9 16 ()}
        {UNIT 3 (Spearman) 7 13 ()}

        [unit]
            # wmllint: recognize Dela Keshar
            {CHARACTER_STATS_DELA_KESHAR}
            ai_special=guardian
            x,y=4,17
        [/unit]

        [ai]
            village_value=0
            caution=0.5
            [goal]
                name=protect_unit
                [criteria]
                    id=Malin Keshar
                [/criteria]
                value=4
            [/goal]

            # Don't block Malins keep
            [avoid]
                x=21
                y=14
            [/avoid]
        [/ai]
    [/side]

    {STARTING_VILLAGES 3 15}
    {STARTING_VILLAGES 2 5}
    {STARTING_VILLAGES 1 5}

    # Signpost to mark area defended
    {PLACE_IMAGE scenery/signpost.png 17 16}
    {PLACE_IMAGE items/book2.png 20 17}
    {PLACE_IMAGE scenery/white-monolith.png 30 15}
    {PLACE_IMAGE scenery/wreck.png 31 9}

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                condition=win
                description= _ "Defend the river fort for two nights"
            [/objective]
            [objective]
                {ALTERNATIVE_OBJECTIVE_CAPTION}
                condition=win
                description= _ "Kill the orcish leader"
            [/objective]
            [objective]
                condition=lose
                description= _ "Orcs reach the outskirts of Parthyn"
            [/objective]
            [objective]
                condition=lose
                description= _ "Death of Malin Keshar"
            [/objective]
            [objective]
                condition=lose
                description= _ "Death of Dela Keshar"
            [/objective]
            [objective]
                condition=lose
                description= _ "Death of Drogan"
            [/objective]

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

        {VARIABLE malin_used_necromancy no}
        {VARIABLE monolith 0}
    [/event]

    [event]
        name=start

        [message]
            speaker=Dela Keshar
            message= _ "You really think it was a good idea to send out a raidin’ party right after the orcs just attacked us? Father isn’t even here with us any more..."
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "Nor is Darken Volk. We are truly defenseless."
        [/message]

        [message]
            speaker=Dela Keshar
            message= _ "Not like we even need him. No way we’re trusting a necromancer."
        [/message]

        [message]
            speaker=Drogan
            message= _ "Quit bickerin’, you two. With most o’ them orcs dead now, their camps will be lots weaker. Our raiders will clear ’em out and leave us a quiet summer."
        [/message]

        [scroll_to]
            x,y=14,2
        [/scroll_to]

        [delay]
            time=1000
        [/delay]

        [message]
            speaker=Malin Keshar
            message= _ "So much for quiet, Drogan. Orcs amass north of the river!"
        [/message]

        [message]
            speaker=Drogan
            message= _ "What? Curses! Why be thar still so many o’ ’em?"
        [/message]

        [message]
            speaker=Dela Keshar
            message= _ "Well ya sent out a bunch of our soldiers before we even started ta fix the city walls..."
        [/message]

        [message]
            speaker=Drogan
            message= _ "Quiet, you. Malin, you’ve got ta hold tha river fort or they’ll overrun us. Tha raidin’ party should be back in two days ta help us fight ’em off. Fer now, I’ll send tha remaining guards to help ya."
        [/message]
    [/event]

    # In-scenario events
    [event]
        name=recruit
        first_time_only=yes
        [filter]
            type=Walking Corpse
        [/filter]

        [message]
            speaker=Drogan
            message= _ "What in blazes is that... that thing? Has tha necromancer returned already? His timin’ couldn’t be any worse..."
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "No, Drogan. I raised this corpse with the skills Darken Volk taught me before he left. I have no love for it, but we need to take action, or we’ll never be able to repel the orcs!"
        [/message]

        [message]
            speaker=Drogan
            message= _ "I’m ’shamed of ya, Malin. Even if it’d ensure our survival, nothin’ good ever comes of necromancy. The moment ya use it, you’ve already sold yer soul ta black magic!"
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "What?! I am hardly evil, Drogan!"
        [/message]

        [message]
            speaker=Drogan
            message= _ "Ya say that, but you’ve been very quiet ’bout why tha mages sent you home from Alduin. I’m beginning ta think you were already dabblin’ in this witchcraft even before ya met that necromancer!"
        [/message]

        [message]
            speaker=Malin Keshar
            message= _ "No! No... it was something stupid, something silly... it does not matter now! I’ll not stand by and allow the orcs to destroy my home while I have the power to prevent it!"
        [/message]

        {VARIABLE malin_used_necromancy yes}
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x,y=17,16
        [/filter]

        [message]
            speaker=narrator
            message= _ "Welcome to Parthyn"
            image=scenery/signpost.png
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x,y=20,17
            id=Malin Keshar
        [/filter]
        [message]
            speaker=narrator
            message= _ "Ignorance is the parent of fear."
        [/message]

        {GIVE_MALIN_EXPERIENCE 4}
    [/event]

    [event]
        name=moveto
        [filter]
            x,y=30,15
            id=Malin Keshar
        [/filter]
        [message]
            speaker=narrator
            message= _ "A monolith of pale stone, luminous and bright, but cold and brittle to the touch."
        [/message]

        {VARIABLE_OP monolith add 1}
        [progress_achievement]
            content_for=descent_into_darkness
            id="did_monolith"
            amount=1
            limit=$monolith
        [/progress_achievement]

        {GIVE_MALIN_EXPERIENCE 8}
    [/event]

    [event]
        name=moveto
        [filter]
            x,y=31,9
            side=1
        [/filter]

        [sound]
            name=zombie-hit-1.ogg
        [/sound]
        [delay]
            time=500
        [/delay]
        [unit]
            side=1
            x,y=31,9
            type=Soulless
            name= _ "Sushi"
            variation=swimmer
            animate=yes
        [/unit]

        # leaving a dead fish was something done by the mafia as a warning to the recipient, basically saying "you're going to sleep with the fishes"
        [message]
            speaker=Malin Keshar
            message= _ "Someone left a dead fish here."
        [/message]
    [/event]

    # Defeat Conditions
    [event]
        name=moveto
        [filter]
            side=2
            x=0-17
            y=13-20
        [/filter]

        [message]
            speaker=Malin Keshar
            message= _ "The orcs have broken through. Parthyn is open to attack!"
        [/message]

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

    # This shouldn't happen, but just in case
    [event]
        name=last breath
        [filter]
            id=Drogan
        [/filter]

        [message]
            speaker=unit
            message= _ "Who will be left to defend Parthyn?"
        [/message]

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

    [event]
        name=last breath
        [filter]
            id=Dela Keshar
        [/filter]

        [message]
            speaker=unit
            message= _ "I’m... dying..."
        [/message]

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

    # Victory Conditions
    [event]
        name=time over

        [unit]
            type=Swordsman
            x,y=5,17
            side=3
            id=Soldier
        [/unit]
        [unit]
            type=Longbowman
            x,y=6,17
            side=3
        [/unit]
        [unit]
            type=Javelineer
            x,y=6,18
            side=3
        [/unit]

        [message]
            speaker=Soldier
            message= _ "We’re back from the raid, Drogan. Seems like we made it just in time!"
        [/message]
        [message]
            speaker=Kreg'a'shar Trr
            message= _ "More humans! We’ll need more fighters to squash ’em all. Grunts, retreat!"
        [/message]

        [kill]
            side=2
        [/kill]

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

    # This is very unlikely, but just in case...
    [event]
        name=enemies defeated

        [message]
            speaker=Malin Keshar
            message= _ "The orcs are dead!"
        [/message]

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

    [event]
        name=victory

        [kill]
            side=2
            animate=no
            fire_event=no
        [/kill]

        [if]
            [variable]
                name=malin_used_necromancy
                boolean_equals=yes
            [/variable]
            [then]
                [message]
                    speaker=Drogan
                    message= _ "By all rights, Malin, I should have ya kill’d on tha spot. I can’t believe ya let that necromancer corrupt you. I s’ppose part o’ this is my fault since I let ’im into Parthyn, but still... Since I showed ’im mercy, I’ll show ya the same. I’m banishin’ you from Parthyn."
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "Fine words, Drogan. Would you rather have let the orcs overrun the town?"
                [/message]

                [message]
                    speaker=Drogan
                    # po: ’least is short for at least
                    message= _ "Aye, better that than ta even dabble in dark magic. We woulda rebuilt this place like always. Even if I died, ’least it woulda been with dignity. Too bad tha mages didn’t teach ya more sense."
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "I only did it to protect what I care about! Is this really what I deserve for saving your hides?"
                [/message]

                [message]
                    speaker=Drogan
                    message= _ "Yes, yes it is. Nobody’ll support ya on yer crazy path to depravity."
                [/message]

                [message]
                    side=1
                    race=human
                    [not]
                        id=Malin Keshar,Dela Keshar,Drogan
                    [/not]
                    # po: Hint, that the loyal units stay behind
                    message= _ "We should all be glad to see you gone, necromancer. I detest having fought by your side."
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "Dela? Sister?"
                [/message]

                [message]
                    speaker=Dela Keshar
                    message= _ "Well..."
                [/message]

                [message]
                    speaker=Drogan
                    message= _ "Ya can’t support ’im on this one, Dela."
                [/message]

                [message]
                    speaker=Dela Keshar
                    message= _ "I... guess you’re right. You’ve decided your magic is more important than us, Malin. I can’t help you."
                [/message]

                [message]
                    speaker=Drogan
                    message= _ "Begone, Malin. I’ve no wish to see yer face around here ever again."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Drogan
                    message= _ "Bravely done holdin’ off them orcs by yerself, Malin. But we’re not outta trouble yet. The raidin’ party reports that more warlords be gatherin’ their armies in the hills, just a few days north o’ tha Great River. I don’t know if we can fight ’em all off."
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "Then we must seek help. It has not been long since Darken Volk’s departure. Perhaps I can find him and ask him to aid us."
                [/message]

                [message]
                    speaker=Drogan
                    message= _ "I’ll pretend like I didn’t hear that."
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "Then what would you have us do, Drogan? Let the orcs overrun Parthyn? Abandon our families to those savages?"
                [/message]

                [message]
                    speaker=Drogan
                    message= _ "Yes. Leave Parthyn fer now and rebuild later, like we always do."
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "Or we can drive off the orcs altogether and make sure they never attack us again. Surely I cannot be the only one who sees that what Drogan says is madness!"
                [/message]

                [message]
                    speaker=Drogan
                    message= _ "If ya go out on a quest to seek depravity, none o’ us will support ya."
                [/message]

                [message]
                    side=1
                    race=human
                    [not]
                        id=Malin Keshar,Dela Keshar,Drogan
                    [/not]
                    # po: Hint, that the loyal units stay behind
                    message= _ "Better to die than to ally ourselves with a necromancer."
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "Dela? Sister?"
                [/message]

                [message]
                    speaker=Dela Keshar
                    message= _ "I hope that you’ll stay with us, Malin. Be reasonable."
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "Be reasonable? I am the only one who sees reason here. If no one will help me, I will go by myself."
                [/message]

                [message]
                    speaker=Dela Keshar
                    message= _ "Malin, seekin’ out the help of a necromancer is just... just foolhardy! We need ya here to help protect the town!"
                [/message]

                [message]
                    speaker=Malin Keshar
                    message= _ "You will eventually see that I am right, Dela. I am resolved."
                [/message]
            [/else]
        [/if]

        [modify_unit]
            [filter]
                side=1
                race=human
                [not]
                    id=Malin Keshar
                [/not]
            [/filter]
            side=3
        [/modify_unit]
    [/event]

    {HERODEATH_MALIN}
[/scenario]
