#textdomain wesnoth-thot

[scenario]
    id=05_Invaders
    name= _ "Invaders"
    map_data="{campaigns/The_Hammer_of_Thursagan/maps/05_Invaders.map}"
    turns=40
    next_scenario=06_High_Pass
    victory_when_enemies_defeated=yes

    {DEFAULT_SCHEDULE}

    # This scenario is the Attack of the Fuzzy-Wuzzies. The player
    # will be seriously outnumbered, but careful defensive
    # maneuvering and use of veterans can save the day.

    {SCENARIO_MUSIC       the_dangerous_symphony.ogg}
    {EXTRA_SCENARIO_MUSIC the_city_falls.ogg}
    {EXTRA_SCENARIO_MUSIC vengeful.ogg}

    [story]
        [part]
            {THOT_BIGMAP}
            music=revelation.ogg
            story= _ "The Alliance’s road ended at the troll bridge. East of it lay only the wildlands."
        [/part]
    [/story]

    {THOT_TRACK {JOURNEY_STAGE5}}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        recruit="Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Guardsman, Dwarvish Scout"
        {GOLD 200 175 150}
        team_name=northern_alliance
        user_team_name= _ "Alliance"
        {FLAG_VARIANT knalgan}

        # wmllint: recognize Aiglondur
        {CHARACTER_STATS_AIGLONDUR}

        facing=ne
    [/side]
    # wmllint: validate-on

    [side]
        side=2
        controller=ai
        recruit=Orcish Archer, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Spearman
        {GOLD 220 260 300}
        team_name=orcs
        user_team_name= _ "Orcs"

        type=Orcish Warlord
        id=Tan-Malgar
        name= _ "Tan-Malgar"
        profile=portraits/orcs/grunt-2.png
        canrecruit=yes

        facing=sw

        [ai]
            {NO_SCOUTS}
            recruitment_pattern=scout,fighter,fighter,archer
            {ATTACK_DEPTH 4 5 5}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
    [/side]

    [side]
        side=3
        controller=ai
#ifdef EASY
        recruit=Orcish Archer, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Spearman
#endif
#ifdef NORMAL
        recruit=Orcish Archer, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Pillager, Goblin Spearman
#endif
#ifdef HARD
        recruit=Orcish Archer, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Goblin Spearman, Goblin Impaler
#endif
        {GOLD 180 220 260}
        {INCOME 4 8 12}
        team_name=orcs
        user_team_name= _ "Orcs"

        type=Orcish Warlord
        id=Tan-Grolak
        name= _ "Tan-Grolak"
        profile=portraits/orcs/grunt-3.png
        canrecruit=yes

        facing=sw

        [ai]
            {NO_SCOUTS}
#ifdef EASY
            recruitment_pattern=scout,fighter,fighter,archer
#endif
#ifdef NORMAL
            recruitment_pattern=scout,fighter,fighter,archer
#endif
#ifdef HARD
            recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
#endif
            {ATTACK_DEPTH 4 5 5}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
    [/side]

    [side]
        side=4
        controller=ai
        recruit=Orcish Archer, Orcish Grunt, Wolf Rider, Orcish Warrior, Goblin Spearman
        {GOLD 180 220 260}
        team_name=orcs
        user_team_name= _ "Orcs"

        type=Orcish Warlord
        id=Tan-Uthkar
        name= _ "Tan-Uthkar"
        profile=portraits/orcs/warlord.png
        canrecruit=yes

        facing=nw

        [ai]
            {NO_SCOUTS}
            recruitment_pattern=scout,fighter,fighter,archer
            {ATTACK_DEPTH 4 5 5}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
    [/side]

    # The bandit indigenes
    [side]
        side=5
        user_team_name= _ "Villagers"
        no_leader=yes
        hidden=yes
        {FLAG_VARIANT6 ragged}

        [ai]
            grouping=offensive
            village_value=4
        [/ai]
    [/side]

    [label]
        x,y=22,21
        text= _ "Ruined Castle"
    [/label]

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Defeat the orcish leaders"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Aiglondur"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Angarthing"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

        [recall]
            id=Angarthing
        [/recall]

        [role]
            type=Dwarvish Lord,Dwarvish Dragonguard,Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Fighter,Dwarvish Thunderer
            [not]
                id=Aiglondur
            [/not]
            role=scout
            [auto_recall][/auto_recall]
            [else]
                [unit]
                    side=1
                    type=Dwarvish Fighter
                    placement=leader
                    role=scout
                [/unit]
            [/else]
        [/role]

        {MODIFY_UNIT (side=1) facing ne}
    [/event]

    [event]
        name=start

        [message]
            speaker=Aiglondur
            message= _ "Stay alert, everyone, and keep together. This is bandit country — more than likely where Gothras and his gang came from."
        [/message]

        [message]
            role=scout
            # po: 'muckle' = Scottish/archaic English meaning 'great' or 'large'
            message= _ "Nae sign o’ bandits I can see, captain — but there are three muckle hosts of orcs off to our east."
        [/message]

        [message]
            speaker=Aiglondur
            message= _ "What’s this? Large orcish war-bands so close to the Alliance’s border? That can only mean trouble."
        [/message]

        [message]
            speaker=Tan-Malgar
            message= _ "Well, boys, we were planning to invade the Northern Alliance anyway... These dwarves should make a tasty appetizer."
        [/message]

        [message]
            speaker=Tan-Grolak
            message= _ "Yeah, boss. Anything to get away from those masked ones..."
        [/message]

        [message]
            speaker=Tan-Malgar
            message= _ "Be silent. We are orc warriors; we do not flee foes."
        [/message]

        [message]
            speaker=Tan-Uthkar
            message= _ "But, given a choice, we fight the weaker foe first."
        [/message]
    [/event]

    [event]
        name=indigs_sighted
        [filter]
            side=1
        [/filter]

        [message]
            speaker=unit
            message= _ "The villagers are attacking us!"
        [/message]

        [message]
            speaker=Aiglondur
            message= _ "Aye, it’s still bandit country, right enough."
        [/message]
    [/event]

    [event]
        name=capture
        first_time_only=no
        [filter]
            [not]
                side=5
            [/not]
        [/filter]
        [filter_condition]
            [variable]
                name=owner_side
                equals=0
            [/variable]
            [or]
                [variable]
                    name=owner_side
                    equals=5
                [/variable]
            [/or]
        [/filter_condition]

        # Compute the number of indigs that will pop up
        [if]
            [variable]
                name=unit.side
                numerical_equals=1
            [/variable]
            [then]
                # The bandit villagers hate dwarves...
                {VARIABLE_OP indigs rand "0..2"}
            [/then]
            [else]
                # ...but they hate orcs much worse.
                {VARIABLE_OP indigs rand "2..5"}
            [/else]
        [/if]

        [spawn_units]
            x,y=$x1,$y1
            count=$indigs
            types=Footpad,Thief,Thug
            side=5
            [then]
                [fire_event]
                    name=indigs_sighted
                    [primary_unit]
                        x,y=$x1,$y1
                    [/primary_unit]
                [/fire_event]
                # Show the bandits in the status table so the player can tell which enemies play first.
                [if]
                    {VARIABLE_CONDITIONAL indigs greater_than 0}
                    [then]
                        [modify_side]
                            side=5
                            hidden=no
                        [/modify_side]
                    [/then]
                [/if]
            [/then]
        [/spawn_units]

        {CLEAR_VARIABLE indigs}
    [/event]

    [event]
        name=enemies defeated

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

    {HERODEATH_AIGLONDUR}
    {HERODEATH_ANGARTHING}
[/scenario]
