#textdomain wesnoth-low
[scenario]
    id=06_Acquaintance_in_Need
    next_scenario=07_Elves_Last_Stand

    random_start_time=no
    allow_new_game=no
    force_lock_settings=yes

    experience_modifier=100
    name= _ "Acquaintance in Need"
    {LOW_MAP 06_Acquaintance_in_Need.map}
    {TURNS 35 30 25}

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC frantic.ogg wanderer.ogg}
    {EXTRA_SCENARIO_MUSIC knalgan_theme.ogg}
    {EXTRA_SCENARIO_MUSIC legends_of_the_north.ogg}
    {EXTRA_SCENARIO_MUSIC northerners.ogg}

    [story]
        [part]
            story= _ "To evade the saurians blocking the eastern approaches to Wesmere, Kalenz and his war-band moved to enter Wesmere Forest from a different direction..."
            delay=4000
            {LOW_BIGMAP}
            {FLIGHT_COMPLETE}
            {TREASURY_STAGE3}
        [/part]
    [/story]

#define PLAYER_GOLD
    {GOLD 700 600 500}
#enddef
#define MULTIPLAYER_GOLD
    {GOLD 250 225 200}
#enddef

    #### Kalenz's code ####
    [side]
        side=1
        {PLAYABLE}
        save_id=Kalenz
        disallow_shuffle=yes

        {KALENZ}
        x=17
        y=38

#ifndef MULTIPLAYER
        {PLAYER_GOLD}
        [unit]
            {LANDAR}
            x=22
            y=39
        [/unit]
        [unit]
            {CLEODIL}
            x=14
            y=39
        [/unit]
#else
        {MULTIPLAYER_GOLD}
#endif
    [/side]
    [event]
        name=prestart
        {RECALL_LOYALS}
    [/event]

    # wmllint: skip-side
    {MP_SIDE 2 (
        {PLAYABLE}
        save_id=Landar
        disallow_shuffle=yes
        {MULTIPLAYER_GOLD}

        no_leader=yes
        [unit]
            {LANDAR}
        [/unit]
    )}

    # wmllint: skip-side
    {MP_SIDE 3 (
        {PLAYABLE}
        save_id=Cleodil
        disallow_shuffle=yes
        {MULTIPLAYER_GOLD}

        no_leader=yes
        [unit]
            {CLEODIL}
        [/unit]
    )}

    #### Olurf's code ####
    [side]
        side=4
        persistent=yes
        save_id=Olurf

        allow_player=no
        controller=ai

        no_leader=yes
        [unit]
            {OLURF}
            x=20
            y=25
        [/unit]

        {GOLD 120 160 200}
        {INCOME 4 8 12}
        {PLAYER_TEAM}
        {FLAG_VARIANT knalgan}

        [ai]
            {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,fighter,mixed fighter"}
        [/ai]
    [/side]
    #### /Olurf's code ####

    [side]
        side=5

        allow_player=no
        controller=ai
        type=Orcish Warlord
        id=Urug-Tar
        name=_ "Urug-Tar"
        canrecruit=yes
        {GOLD 150 230 270}
        {INCOME 4 8 12}
        team_name=orcs
        user_team_name= _ "Enemies"
        {ORC_SETUP}
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Orcish Warrior
#endif
        [ai]
            {AI_NO_SCOUTS}
            {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter, archer, scout, fighter, fighter, archer, mixed fighter"}
            {AI_SIMPLE_ALWAYS_ASPECT grouping offensive}
            {AI_SIMPLE_ALWAYS_ASPECT aggression 0.75}
        [/ai]
    [/side]

    [side]
        side=6
        allow_player=no
        controller=ai
        type=Orcish Warlord
        id=Graur-Tan
        name=_ "Graur-Tan"
        canrecruit=yes
        {GOLD 150 270 300}
        {INCOME 4 8 12}
        team_name=orcs
        user_team_name= _ "Enemies"
        {ORC_SETUP}
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Goblin Pillager
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Goblin Pillager, Orcish Slayer
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Knight, Goblin Pillager, Orcish Slayer, Orcish Warrior
#endif
        [ai]
            {AI_NO_SCOUTS}
            {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "scout,fighter,fighter,archer,mixed fighter"}
        [/ai]
    [/side]

    [side]
        side=7
        allow_player=no
        controller=ai
        type=Troll Warrior
        id=Traur
        name=_ "Traur"
        canrecruit=yes
#ifdef EASY
        recruit=Troll Whelp
#endif
#ifdef NORMAL
        recruit=Troll Whelp, Troll
#endif
#ifdef HARD
        recruit=Troll Whelp, Troll, Troll Warrior
#endif
        {INCOME 4 8 12}
        {GOLD 152 175 210}
        team_name=orcs
        user_team_name= _ "Enemies"
        {TROLL_SETUP}
        [ai]
            {AI_NO_SCOUTS}
            {AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter"}
        [/ai]
    [/side]

    [event]
        name=prestart
        {RECALL_LOYALS}
    [/event]

    [event]
        name=prestart

        [objectives]
            side=0
            [objective]
                description= _ "Defeat all enemy leaders"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Landar"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Olurf"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Cleodil"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

            [note]
                description= _ "Try to save leveled dwarf units"
            [/note]
        [/objectives]
    [/event]

    [event]
        name=start

        [message]
            id=Kalenz
            message= _ "What’s this? It appears the orcs have surrounded a dwarvish enclave. And by the sound of the bellowing I hear, I think our old friend, Olurf, is here."
        [/message]
        [message]
            id=Olurf
            message= _ "You again? Maybe ye were not completely wrong when ye predicted the orcs would attack us. We ha’ been forced from our home and are now surrounded."
        [/message]
        [message]
            id=Cleodil
            message= _ "Let us give them aid — it’s clear they need it!"
        [/message]
        [message]
            id=Landar
            message= _ "Help them? They would not even let us pass through their land to avoid the trolls. You remember, Kalenz?"
        [/message]
        [message]
            id=Kalenz
            message= _ "Our enemy is the orcs, not the dwarves. Besides, the orcs are in our way. Olurf, we cannot let you have all the fun here!"
        [/message]
        [message]
            id=Olurf
            message= _ "For an elf, you think like a dwarf! I think I like you! " + {WHISPER _"whisper^—For an elf..."}
        [/message]

        {AI_CONTROLLER_ALLOW_LEADER_CONTROL 1 2}
    [/event]

    [event]
        name=scenario_end
        [filter_condition]
            [proceed_to_next_scenario]
            [/proceed_to_next_scenario]
        [/filter_condition]
        [message]
            id=Olurf
            message= _ "The orcs ha’ been defeated. My lord, we are in your debt."
        [/message]
        [message]
            id=Kalenz
            message= _ "We must put aside our differences and ally against the orcish menace. Olurf, join us!"
        [/message]
        [message]
            id=Olurf
            message= _ "Dwarves, ally with elves? I owe ye a debt, but my kin willna’ be happy at the thought."
        [/message]
        [message]
            id=Kalenz
            message= _ "There will be a big fight with the orcs in Wesmere very soon. If you can cover our flank to the north, I will pay you 400 gold."
        [/message]
        [message]
            id=Olurf
            message= _ "A proper contract for good money? That’s a different matter; I’m sure I can find some o’ my people willing to fight on those terms!"
        [/message]
        [message]
            id=Landar
            message= _ "What? Kalenz, are you out of your mind? Surely you will not throw away 400 gold on this scheming mercenary!"
        [/message]
        [message]
            id=Olurf
            message= _ "Where there’s a contract, our honor is involved. We will be there to cover your northern flank or else I will return your gold!"
        [/message]
        [message]
            id=Cleodil
            message=_ "I sense no falsity behind his speech, my lord."
        [/message]
        [message]
            id=Kalenz
            message= _ "I, too, believe him. Dwarves may be... rough... by our standards, but they are not liars. I think he knows that if he does not honor his contract, next time we will not be there to come to his aid."
        [/message]

#ifdef MULTIPLAYER
        [gold]
            side=1
            amount=-200
        [/gold]
        [gold]
            side=2
            amount=-200
        [/gold]
#else
        [gold]
            side=1
            amount=-400
        [/gold]
#endif
        [sound]
            name=gold.ogg
        [/sound]
    [/event]

    {DEFAULT_VICTORY 0.4}
    {campaigns/Legend_of_Wesmere/utils/deaths.cfg}
[/scenario]

#undef PLAYER_GOLD
#undef MULTIPLAYER_GOLD
