#textdomain wesnoth-aoi

# Warning: If you are not a native and literate English speaker, do
# not try to modify the storyline text.  It is deliberately written
# in a somewhat archaic and poetic form of English, and some previous
# attempts to "fix" it inflicted damage that was difficult to undo.

[scenario]
    name=_ "Wasteland"
    id=03_Wasteland
    map_data="{campaigns/An_Orcish_Incursion/maps/03_Wasteland.map}"
    turns=24
    next_scenario=04_Valley_of_Trolls

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC revelation.ogg elvish-theme.ogg}
    {EXTRA_SCENARIO_MUSIC casualties_of_war.ogg}
    {EXTRA_SCENARIO_MUSIC nunc_dimittis.ogg}

    [side]
        type="Elvish Lord"
        id=Erlornas
        canrecruit=yes
        profile=portraits/erlornas.png
        side=1
        controller=human
        team_name=Elves
        user_team_name=_ "Elves"
        {INCOME 12 9 9}
        recruit="Elvish Scout,Elvish Fighter,Elvish Archer,Elvish Shaman"
        {FLAG_VARIANT long}
    [/side]

    [side]
        type="Orcish Warlord"
        id=Gnargha
        canrecruit=yes
        name=_ "Gnargha"

        side=2
        {GOLD 100 120 160}
        {INCOME 8 12 12}
        team_name=Orcs
        user_team_name=_ "Orcs"
        controller=ai
        fog=no
        shroud=no
        recruit="Orcish Archer, Orcish Crossbowman, Orcish Grunt, Orcish Warrior, Wolf Rider"
        [ai]
            grouping=offensive
            attack_depth=5
        [/ai]
        {FLAG_VARIANT ragged}
    [/side]

    [story]
        [part]
            background=an-orcish-incursion-map.png
            story= _ "As they fared further north the green forest thinned around them, slowly fading into a barren and fallow country. The signs were obvious and unmistakable — tree stumps, an occasional half-rotten tree felled long ago, and dead wood around them in scarce grass. This had been forest once, like the woods they called home. It had been murdered."
        [/part]
        [part]
            background=an-orcish-incursion-map.png
            story= _ "There was no trail to be found here; wind and rain had erased the spoor. Fortunately, there was no need of a trail; smoke on the horizon betrayed the presence of their enemies."
        [/part]
        [part]
            background=an-orcish-incursion-map.png
            story= _ "Erlornas was near-certain they would find orcs there. No clan of dwarves would break their ancient treaties with the elves in this way; humans were never so... methodical in their destruction, and did not travel in sufficiently large numbers in a north country they found too cold and damp for comfort. The great question remained — would he find Rualsha?"
        [/part]
        [part]
            background=an-orcish-incursion-map.png
            story= _ "Perhaps, but not here. The tribe this camp housed was too small to impress fear on other orcs. Come next morning, the elves were prepared for battle."
        [/part]
        [part]
            show_title="yes"
            {TO_WASTELAND}
        [/part]
    [/story]

    [event]
        name=prestart

        [objectives]
#ifdef EASY
            note=_ "Hint:
There are no villages in this scenario — you must use healers instead. Use hit-and-run tactics to weaken enemy units who cannot heal themselves."
#endif
            [objective]
                description=_ "Defeat Gnargha"
                condition=win
            [/objective]
            [objective]
                description=_ "Death of Erlornas"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

        {VARIABLE orcs_recruited 0}
        {VARIABLE camp_gold 300}
        {VARIABLE_OP modulo_factor rand "2..4"}
    [/event]

    [event]
        name=recruit
        [filter]
            side=2
        [/filter]
        first_time_only=no

        {VARIABLE temporary $orcs_recruited}
        {VARIABLE_OP temporary modulo $modulo_factor}

        [if]
            [variable]
                name=temporary
                equals=0
            [/variable]
            [then]
                [disallow_recruit]
                    side=2
                    type="Orcish Archer, Orcish Grunt, Wolf Rider"
                [/disallow_recruit]
                [allow_recruit]
                    side=2
                    type="Orcish Crossbowman, Orcish Warrior"
                [/allow_recruit]
                {VARIABLE_OP modulo_factor rand "2..4"}
            [/then]
            [else]
                [disallow_recruit]
                    side=2
                    type="Orcish Crossbowman, Orcish Warrior"
                [/disallow_recruit]
                [allow_recruit]
                    side=2
                    type="Orcish Archer, Orcish Grunt, Wolf Rider"
                [/allow_recruit]
            [/else]
        [/if]

        {VARIABLE_OP camp_gold sub $unit.cost}
        {VARIABLE_OP orcs_recruited add 1}
        {CLEAR_VARIABLE temporary}
    [/event]

    [event]
        name=start

        [role]
            race=elf
            [not]
                canrecruit=yes
            [/not]
            role=Adviser
        [/role]

        [recall]
            role=Adviser
        [/recall]

        [message]
            role=Adviser
            message=_ "Lord... I’m... I am filled with grief. This senseless destruction is... overwhelming."
        [/message]
        [message]
            id=Erlornas
            message=_ "Yes. And this is the threat we were blind to but are now facing. This tribe is small, yet we must drive them back to the north. They must have no footholds south of the hills."
        [/message]
        [message]
            id=Gnargha
            message=_ "Elves!? This means Urugha failed and his spirit will suffer greatly for his weakness. So be it!"
        [/message]
        [message]
            id=Gnargha
            message=_ "Rise up, grunts! We have a great fight upon us! Let your rage flow freely! Let your blades slay all! First one to draw blood will feast by my fire this night!"
        [/message]
        [message]
            id=Erlornas
            message=_ "Aim true, men, with wit and courage the day will be ours. And spare no-one, there can be no orc south of the hills, else we’ll never have peace again."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Gnargha
        [/filter]

        [message]
            id=Gnargha
            message=_ "You won... elf... But it changes... nothing... (<i>cough</i>)"
        [/message]
        [message]
            id=Gnargha
            message=_ "We found the way... Now... we will come in numbers... (<i>cough</i>) you can’t imagine..."
        [/message]
        [message]
            id=Gnargha
            message=_ "(<i>Cough</i>) I’ll be waiting... among the dead..."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            id=Gnargha
        [/filter]
        [message]
            speaker=narrator
            message=_ "The orcish chieftain finally fell, overcome by his wounds. The elves found themselves in a half-ruined camp littered with the bodies of both sides, there was no hale orc in sight, nor did any of the wounded beg mercy. The elves took no prisoners."
            image=wesnoth-icon.png
        [/message]

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

    [event]
        name=victory

        [role]
            race=elf
            [not]
                canrecruit=yes
            [/not]
            role=Adviser
        [/role]

        [message]
            role=Adviser
            message=_ "It’s done, lord. No-one escaped. No-one tried to escape. I’m... disturbed."
        [/message]
        [message]
            id=Erlornas
            message=_ "Good. But their disregard for self-preservation is astounding. As is their ferocity when defending what they claim as their own. Have the scouts found others this side of the hills?"
        [/message]
        [message]
            role=Adviser
            message=_ "No, lord. But trolls were spotted in the hills ahead. Do we really need to cross them to the north?"
        [/message]
        [message]
            id=Erlornas
            message=_ "Yes. The council has spoken to me through a dream-sending. They are troubled. Reinforcements have been sent after us, but we need to press on. Tell the men to rest, we’ll move out at dawn."
        [/message]
        [if]
            [variable]
                name=camp_gold
                greater_than=100
            [/variable]
            [then]
                [message]
                    role=Adviser
                    message=_ "What about the loot lord? We found supplies worth over a hundred gold in the camp."
                [/message]
                [message]
                    id=Erlornas
                    message=_ "Distribute some among the men, save the rest for the road. This country is a wasteland now; we won’t find much forage on the march."
                [/message]
            [/then]
        [/if]
        [if]
            [variable]
                name=camp_gold
                greater_than=50
            [/variable]
            [variable]
                name=camp_gold
                less_than_equal_to=100
            [/variable]
            [then]
                [message]
                    role=Adviser
                    message=_ "We found some supplies when searching the camp, but nothing much. What is to be done with them?"
                [/message]
                [message]
                    id=Erlornas
                    message=_ "Save it for the march north. There is little to be found in this barren country."
                [/message]
            [/then]
        [/if]
        [if]
            [variable]
                name=camp_gold
                greater_than=0
            [/variable]
            [then]
                [gold]
                    side=1
                    amount=$camp_gold
                [/gold]
            [/then]
        [/if]
        {CLEAR_VARIABLE camp_gold}
        {CLEAR_VARIABLE orcs_recruited}
        {CLEAR_VARIABLE modulo_factor}
    [/event]

    [event]
        name=die
        [filter]
            id=Erlornas
        [/filter]

        [message]
            speaker=narrator
            message=_ "Lord Erlornas never saw the blade that felled him. He died on the spot, with not a chance to issue last commands or farewells. Without him his wardens soon fell into confusion, and losing heart withdrew from the battle."
            image=wesnoth-icon.png
        [/message]
        [message]
            speaker=narrator
            message=_ "When reinforcements finally arrived, elves managed to dislodge the orcish tribe. But the threat from the north remained unresolved and loomed large over their future."
            image=wesnoth-icon.png
        [/message]
    [/event]

    [event]
        name=time over

        [role]
            race=elf
            [not]
                canrecruit=yes
            [/not]
            role=Adviser
        [/role]

        [message]
            role=Adviser
            message=_ "We can’t carry on Lord, the men are too tired. We have to fall back."
        [/message]
        [message]
            id=Erlornas
            message=_ "Damn it. Sound the retreat, we’ll try again when reinforcements arrive."
        [/message]
        [message]
            speaker=narrator
            message=_ "The expected relief caught up with them a few days later. The following morning they took the field against a far larger host of orcs. The battle ended in a draw; the war raged on for years..."
            image=wesnoth-icon.png
        [/message]
    [/event]
[/scenario]
