#textdomain wesnoth-nr

[scenario]
    id=06a_Old_Friend
    name= _ "Old Friend"
    map_data="{campaigns/Northern_Rebirth/maps/06a_Old_Friend.map}"
    turns=18
    next_scenario=07a_Settling_Disputes

    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC       breaking_the_chains.ogg}
    {EXTRA_SCENARIO_MUSIC knalgan_theme.ogg}
    {EXTRA_SCENARIO_MUSIC wanderer.ogg}

    # Scenario story, some parts have character portraits as background
    [story]
        [part]
            music=loyalists.ogg
            story= _ "The humans rested for many days while they were equipped with new arms and armor and trained by the dwarves."
        [/part]
        [part]
            story= _ "But the peace was not to last. Early one morning Tallin (sore from head to foot from his training) was startled awake by the blare of trumpets, the pounding of drums and the clash of steel as the humans and dwarves hurried to arm themselves."
        [/part]
        [part]
            story= _ "He sought out Hamel, who informed him that a massive host of orcs had arrived at the gates of the new Knalga."
        [/part]
        [part]
            story= _ "It was decided that Tallin’s men should sally forth to meet the orcs, while Hamel’s held open their retreat into the caves."
        [/part]
    [/story]

    {NR_TRACK {REVOLT_STAGE4}}

    # Players side
    # wmllint: validate-off
    [side]
        side=1
        controller=human
        recruit=Thug,Poacher,Spearman,Bowman,Footpad
        {GOLD 350 300 250}
        team_name=knalgans
        user_team_name= _ "Knalgans"

        # wmllint: recognize Tallin
        {CHARACTER_STATS_TALLIN}
    [/side]

    # Main enemy. Note the AI is set to be highly aggressive and target Tallin
    [side]
        side=2
        controller=ai
        recruit=Orcish Grunt,Orcish Archer,Wolf Rider,Orcish Assassin,Troll Whelp,Orcish Warrior,Orcish Crossbowman,Troll
        {GOLD 500 600 700}
        {INCOME 40 50 60}
        team_name=orcs
        user_team_name= _ "Orcs"
        {FLAG_VARIANT6 ragged}

        # wmllint: recognize Rakshas
        {CHARACTER_STATS_RAKSHAS}

        [ai]
            aggression=1.0
            caution=-1.0
            leader_value=50
            passive_leader=yes
        [/ai]

        # Place bad guy bodyguards
        {NOTRAIT_UNIT 2 "Orcish Warlord" 2 20} {GUARDIAN}
        {NOTRAIT_UNIT 2 "Orcish Warlord" 5 20} {GUARDIAN}
        {NOTRAIT_UNIT 2 "Orcish Warlord" 8 21} {GUARDIAN}
        {NOTRAIT_UNIT 2 "Orcish Warlord" 9 24} {GUARDIAN}
        {NOTRAIT_UNIT 2 "Orcish Warlord" 9 26} {GUARDIAN}
    [/side]
    # wmllint: validate-on

    # Sidekicks
    [side]
        side=3
        controller=ai
        recruit=Orcish Grunt,Orcish Archer,Wolf Rider,Orcish Assassin,Troll Whelp,Orcish Warrior,Orcish Crossbowman,Troll
        {GOLD 500 600 700}
        {INCOME 40 50 60}
        team_name=orcs
        user_team_name= _ "Orcs"
        {FLAG_VARIANT6 ragged}

        type=Orcish Warlord
        id=Drung
        name= _ "Drung"
        canrecruit=yes
        profile=portraits/orcs/grunt-4.png

        [ai]
            aggression=1.0
            caution=-1.0
            leader_value=50
        [/ai]
    [/side]

    [side]
        side=4
        controller=ai
        recruit=Orcish Grunt,Orcish Archer,Wolf Rider,Orcish Assassin,Troll Whelp,Orcish Warrior,Orcish Crossbowman,Troll
        {GOLD 500 600 700}
        {INCOME 40 50 60}
        team_name=orcs
        user_team_name= _ "Orcs"
        {FLAG_VARIANT6 ragged}

        type=Orcish Warlord
        id=Poul
        name= _ "Poul"
        canrecruit=yes
        profile=portraits/orcs/grunt-5.png

        [ai]
            aggression=1.0
            caution=-1.0
            leader_value=50
        [/ai]
    [/side]

    {STARTING_VILLAGES 1 4}

    [event]
        name=prestart

        [time_area]
            x=20-27,21-27,21-27,21-27,21-27,22-27,23,25-27,27
            y=1    ,2    ,3    ,4    ,5    ,6    ,7 ,7    ,8
            {UNDERGROUND}
        [/time_area]

        # Recall heroes and a supporter
        [recall]
            id=Camerin
        [/recall]

        [recall]
            id=Abhai
        [/recall]

        [recall]
            id=Krash
        [/recall]

        [recall]
            id=Elenia
        [/recall]

        [recall]
            id=Father Morvin
        [/recall]

        [recall]
            id=Sister Thera
        [/recall]

        {RECALL_SUPPORTER}

        # Change Tallin to be of Sergeant line
        # Check his level, and set new type to be a commander of the same level.
        {STORE_UNIT_VAR id=Tallin level old_tallin_level}

        [switch]
            variable=old_tallin_level

            [case]
                value=0,1
                {VARIABLE new_tallin_type Sergeant}
            [/case]

            [case]
                value=2
                {VARIABLE new_tallin_type Lieutenant}
            [/case]

            [else]
                {VARIABLE new_tallin_type General}
            [/else]
        [/switch]

        [transform_unit]
            id=Tallin
            transform_to=$new_tallin_type
        [/transform_unit]

        [heal_unit]
            [filter]
                id=Tallin
            [/filter]

            moves=full
        [/heal_unit]

        {CLEAR_VARIABLE old_tallin_level,new_tallin_type}
    [/event]

    # Do the talk
    [event]
        name=start

        [message]
            id=Rakshas
            message= _ "So I see you stinky-midgets and human-worms finally mustered up the courage to face me."
        [/message]

        [message]
            id=Tallin
            message= _ "Who are you, and what do you want?"
        [/message]

        [message]
            id=Rakshas
            message= _ "I am Emperor Rakshas and by the power of my sword, I lead the orcish people. I am here simply finishing the job Khazg Black-Tusk started years ago — the conquest of Knalga."
        [/message]

        [message]
            id=Tallin
            message= _ "Khazg tried and failed, and if you repeat his folly you will soon join him in the land of the dead!"
        [/message]

        [message]
            id=Rakshas
            # wmllint: local spelling Pah
            message= _ "Pah! I would like to see those cowardly dwarves try their treachery on me as they did on the Black-Tusk! In any case, those dwarves will soon be groveling at my feet and equipping my people with the finest weapons. With the dwarvish weapons, and the wealth of Knalga, nothing will be able to stop us. Even that little backwater that you humans call Wesnoth will be nothing but a burnt out, pillaged wreck before long."
        [/message]

        [message]
            id=Tallin
            message= _ "Boy, this guy sure has delusions of grandeur."
        [/message]

        [message]
            role=Supporter
            message= _ "I am not so sure it’s that simple, Tallin. Think back to those orcs at the Dwarven Doors, and those wolves on the way to the mines; they were both saying something about ‘The Master’."
        [/message]

        [message]
            id=Tallin
            message= _ "Yeah?"
        [/message]

        [message]
            role=Supporter
            message= _ "Well, unless I miss my guess, dreamy fellow would be him."
        [/message]

        [message]
            id=Tallin
            message= _ "Well, if that is so, then it’s time to end this menace once and for all! Fall on them, boys!"
        [/message]

        [objectives]
            side=1

            [objective]
                description= _ "Resist until the end of turns"
                condition=win
                show_turn_counter=yes
            [/objective]

            {ALTERNATIVE_OBJECTIVE ( _ "Defeat Rakshas, if you can...")}

            [objective]
                description= _ "Death of Tallin"
                condition=lose
            [/objective]

            [gold_carryover]
                carryover_percentage=100
            [/gold_carryover]
        [/objectives]
    [/event]

    # Turn 3, if we didn't employ Russian army tactics yet Tallin gets upset
    [event]
        name=turn 3

        [if]
            [have_unit]
                side=1
                [filter_location]
                    [not]
                        time_of_day_id=underground
                    [/not]
                [/filter_location]
                count=0-5
            [/have_unit]
            [then]
                # Five or less units are outside, Tallin calls for all out charge. "URRAAA!"
                [message]
                    id=Tallin
                    message= _ "Come on, why are we just sitting here in these caves?! Have you forgotten already all these orcs have done to us! Let us spill their foul blood on the ground!"
                [/message]
            [/then]
        [/if]
    [/event]

    # Player somehow breached bad boss cordon, things are going too well, which means we need to throw an army of wolfriders at him
    [event]
        name=moveto
        [filter]
            side=1
            x=1-9
            y=10-27
        [/filter]

        [message]
            id=Rakshas
            message= _ "So! Your forces are managing to advance upon me, are they? Very impressive, but it shall do you no good. KNIGHTS!!"
        [/message]

        # Place 36 Goblin Knights. Yes. Thirty-six.
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 15 17}
        {NOTRAIT_UNIT 2 "Goblin Knight" 11 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 11 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 11 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 11 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 11 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 11 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 11 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 7 16}
        {NOTRAIT_UNIT 2 "Goblin Knight" 26 22}
        {NOTRAIT_UNIT 2 "Goblin Knight" 26 22}
        {NOTRAIT_UNIT 2 "Goblin Knight" 26 22}
        {NOTRAIT_UNIT 2 "Goblin Knight" 26 22}
        {NOTRAIT_UNIT 2 "Goblin Knight" 26 22}
        {NOTRAIT_UNIT 2 "Goblin Knight" 25 26}
        {NOTRAIT_UNIT 2 "Goblin Knight" 25 26}
        {NOTRAIT_UNIT 2 "Goblin Knight" 25 26}
        {NOTRAIT_UNIT 2 "Goblin Knight" 25 26}
        {NOTRAIT_UNIT 2 "Goblin Knight" 25 26}

        [message]
            type=Goblin Knight
            message= _ "HAHAHA! GOT YOU, SUCKERS!"
        [/message]

        [message]
            id=Rakshas
            message= _ "CHARGE!!"
        [/message]

        [message]
            id=Tallin
            message= _ "Oh, hell! Form up, men, back to back! Don’t let them penetrate our ranks!"
        [/message]

        [message]
            id=Rakshas
            message= _ "That’s not all, my friends. GENERALS, CALL THE RESERVES!"
        [/message]

        [message]
            id=Drung
            message= _ "Oh yeah!"
        [/message]

        [message]
            id=Poul
            message= _ "HAHAHA!"
        [/message]

        [message]
            id=Drung
            message= _ "You are so dead, you human vermin!"
        [/message]

        [message]
            id=Poul
            message= _ "Oooooooh! Time to start the fun!"
        [/message]

        # And give bad guys 1500 gold each for a good measure. Yes,
        # Taurus is a sadist.
        [gold]
            side=2,3,4
            amount=1500
        [/gold]

        [message]
            role=Supporter
            message= _ "This doesn’t look good..."
        [/message]
    [/event]

    # Sidekick death event, 500g to player and 500 to each enemy
    [event]
        name=last breath
        [filter]
            id=Drung
        [/filter]

        [message]
            id=Drung
            message= _ "Argh! I have been slain!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "Killed him! Got his gold too. Let’s see, hmmm, about 500 gold pieces. Not bad."
        [/message]

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

        [message]
            id=Rakshas
            message= _ "They have killed one of my generals! REINFORCEMENTS!"
        [/message]

        [gold]
            side=2,3,4
            amount=500
        [/gold]
    [/event]

    # As above
    [event]
        name=last breath
        [filter]
            id=Poul
        [/filter]

        [message]
            id=Poul
            message= _ "My death will only make the Master’s punishment for you worse, you fools!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "Your death makes your Master’s punishment from us one step closer!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "But— my my, what’s in that big pouch? 300 gold! Not bad."
        [/message]

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

        [message]
            id=Rakshas
            message= _ "You vermin will pay for that! REINFORCEMENTS!"
        [/message]

        [gold]
            side=2,3,4
            amount=500
        [/gold]
    [/event]

    # A miracle happened. Bad boss died. Player won.
    [event]
        name=last breath
        [filter]
            id=Rakshas
        [/filter]

        [message]
            id=Rakshas
            message= _ "Ahhhh! Run for your life!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "What the... Hey, where do you think you are running off to, you coward!"
        [/message]

        [message]
            id=Tallin
            message= _ "Stop him!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "It’s too late! I am sorry, Tallin, he got away! We did not expect he would flee like a coward."
        [/message]

        [message]
            id=Tallin
            message= _ "Damn! We had the opportunity to end the war in one stroke there. Now we will have to go after him, assuming we can break this siege!"
        [/message]
    [/event]

    # Time over. Player didn't kill the bad guy but still survived, and that's also a victory.
    [event]
        name=time over

        [message]
            id=Tallin
            # wmllint: local spelling Geez
            message= _ "Geez, we have been fighting them for three whole days and nights now with no end in sight. Now the fourth night is approaching, what should we do?"
        [/message]

        [message]
            id=Father Morvin
            message= _ "It seems hopeless to continue on like this. The orcs’ numbers are unlimited and Rakshas is very well guarded. The only possible outcome to all this is more slaughter."
        [/message]

        [message]
            id=Sister Thera
            message= _ "I propose that we retreat into the caves and consult with the dwarves."
        [/message]

        [message]
            role=Supporter
            message= _ "I agree, Tallin, it is pointless to carry on."
        [/message]

        [message]
            id=Tallin
            message= _ "Very well. Everyone fall back!"
        [/message]

        [message]
            id=Camerin
            message= _ "Awwwww! Just when I was having the most fun!"
        [/message]

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

    # And load the standard death events.
    {HERODEATH_TALLIN}
    {HERODEATH_CAMERIN}
    {HERODEATH_KRASH}
    {HERODEATH_ELENIA}
    {HERODEATH_THERA_AND_MORVIN_NO_DIALOG}

    {SUPPORTER_DEATH_HANDLER}
[/scenario]
