#textdomain wesnoth-ei
[scenario]
    id=09_Xenophobia
    name= _ "Xenophobia"
    map_data="{campaigns/Eastern_Invasion/maps/09_Xenophobia.map}"
    {TURNS 40 36 32}
    next_scenario=10_Lake_Vrug

    {NORTHERN_SCHEDULE}
    current_time=1

    {INTRO_AND_SCENARIO_MUSIC elvish-theme.ogg battle.ogg}
    {EXTRA_SCENARIO_MUSIC siege_of_laurelmor.ogg}
    {EXTRA_SCENARIO_MUSIC casualties_of_war.ogg}
    {EXTRA_SCENARIO_MUSIC vengeful.ogg}

    {EI_TRACK {JOURNEY_09_NEW} }

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        {GOLD 220 190 150}
        team_name=good
        user_team_name= _ "Wesnothians"
        {FLAG_VARIANT loyalist}

        # wmllint: recognize Gweddry
        {CHARACTER_STATS_GWEDDRY}
    [/side]
    # wmllint: validate-on

    {STARTING_VILLAGES 1 9}

    [side]
        type=Dwarvish Lord
        id=Pelathsil
        name= _ "Pelathsil"
        side=2
        canrecruit=yes
        controller=ai
        team_name=dwarf
        user_team_name= _ "Dwarves"
#ifdef EASY
        recruit=Dwarvish Thunderguard,Dwarvish Steelclad,Dwarvish Fighter,Dwarvish Scout,Dwarvish Thunderer,Dwarvish Ulfserker
#else
        recruit=Dwarvish Thunderguard,Dwarvish Steelclad,Dwarvish Berserker,Dwarvish Runesmith,Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Ulfserker
#endif
        {GOLD 170 230 320}
        {FLAG_VARIANT knalgan}

        [ai]
            aggression=0.4
            caution=0.2
            grouping=offensive
            recruitment_pattern=fighter,fighter,fighter,mixed fighter,mixed fighter
        [/ai]

        {LOYAL_UNIT 2 (Dwarvish Guardsman) 33 6} {GUARDIAN}
        {LOYAL_UNIT 2 (Dwarvish Guardsman) 40 7} {GUARDIAN}
    [/side]

    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 "Dwarvish Steelclad" 2}
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 "Dwarvish Thunderguard" 2}
#ifndef EASY
    {LIMIT_RECRUITS 2 "Dwarvish Runesmith" 1}
    {LIMIT_CONTEMPORANEOUS_RECRUITS 2 "Dwarvish Berserker" 1}
#endif

    {STARTING_VILLAGES 2 9}

    [side]
        type=Orcish Nightblade
        id=Bagork
        name= _ "Bagork"
        side=3
        canrecruit=yes
        controller=ai
        team_name=orc
        user_team_name= _ "Orcs"
        recruit=Orcish Grunt,Orcish Archer,Orcish Assassin,Wolf Rider
        {GOLD 160 210 260}
        [ai]
            aggression=0.8
            caution=0.0
            grouping=no
            recruitment_pattern=fighter,archer,scout,mixed fighter
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]

    {STARTING_VILLAGES 3 9}

    [side]
        type=Elvish Avenger
        id=Elandin
        name= _ "Elandin"
        side=4
        canrecruit=yes
        controller=ai
        team_name=elf
        user_team_name= _ "Elves"
#ifdef HARD
        recruit=Elvish Ranger,Elvish Rider,Elvish Scout,Elvish Fighter,Elvish Archer,Elvish Avenger
#else
        recruit=Elvish Ranger,Elvish Rider,Elvish Scout,Elvish Fighter,Elvish Archer
#endif
        {GOLD 170 230 300}
        [ai]
            aggression=0.4
            caution=0.2
            grouping=offensive
            recruitment_pattern=fighter,fighter,mixed fighter,archer,scout
        [/ai]
        {FLAG_VARIANT wood-elvish}
    [/side]

    {LIMIT_CONTEMPORANEOUS_RECRUITS 4 "Elvish Ranger" 2}
    {LIMIT_CONTEMPORANEOUS_RECRUITS 4 "Elvish Rider" 2}
#ifdef HARD
    {LIMIT_RECRUITS 4 "Elvish Avenger" 1}
#endif

    {STARTING_VILLAGES 4 9}

    [side]
        type=Orcish Warlord
        id=Prok-Bak
        name= _ "Prok-Bak"
        side=5
        canrecruit=yes
        controller=ai
        team_name=orc
        user_team_name= _ "Orcs"
#ifdef EASY
        recruit=Troll,Goblin Knight,Goblin Pillager,Orcish Warrior,Orcish Grunt,Troll Whelp,Orcish Archer,Wolf Rider
#else
        recruit=Troll,Goblin Knight,Goblin Pillager,Direwolf Rider,Orcish Warrior,Orcish Grunt,Troll Whelp,Orcish Archer,Wolf Rider
#endif
        {GOLD 200 245 290}
        {INCOME 2 3 4}
        [ai]
            aggression=0.7
            caution=0.0
            grouping=no
            recruitment_pattern=fighter,fighter,fighter,fighter,scout,scout,archer
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]

    {LIMIT_CONTEMPORANEOUS_RECRUITS 5 "Troll" 1}
    {LIMIT_CONTEMPORANEOUS_RECRUITS 5 "Goblin Pillager" 2}
    {LIMIT_CONTEMPORANEOUS_RECRUITS 5 "Goblin Knight" 1}
    {LIMIT_CONTEMPORANEOUS_RECRUITS 5 "Orcish Warrior" 1}
#ifndef EASY
    {LIMIT_RECRUITS 5 "Direwolf Rider" 1}
#endif

    {STARTING_VILLAGES 5 9}

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Defeat all enemy leaders"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Gweddry"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Dacyn"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Owaec"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

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

    [event]
        name=start
        [recall]
            id=Dacyn
        [/recall]
        [recall]
            id=Owaec
        [/recall]
        [recall]
            id=Grug
        [/recall]
        [recall]
            id=Terraent
        [/recall]
        [message]
            speaker=Dacyn
            message= _ "Hail, dwarves! Will you help us get by these foul orcs? We are headed farther north."
        [/message]
        [message]
            speaker=Prok-Bak
            message= _ "You human! Call us foul, will you?!"
        [/message]
        [message]
            speaker=Pelathsil
            message= _ "Why should we help you? You’re not a dwarf!"
        [/message]
        [message]
            speaker=Gweddry
            message= _ "Your people helped us in the past, in the tunnels in the south. Will you not help us now?"
        [/message]
        [message]
            speaker=Pelathsil
            message= _ "Impossible! I canna’ believe any of my kin would ha’ helped a human!"
        [/message]
        [message]
            speaker=Elandin
            message= _ "Indeed. Why should any of us help those not of our people?"
        [/message]
        [message]
            speaker=Owaec
            message= _ "Will you but let us pass, so that we may fight the orcs on our own?"
        [/message]
        [message]
            speaker=Elandin
            message= _ "I am afraid that is... impossible."
        [/message]
        [message]
            speaker=Bagork
            # wmllint: local spelling kill'em
            message= _ "Orcs, kill’em all! Humans, elves or dwarves, it don’t matter!"
        [/message]
        [message]
            speaker=Elandin
            message= _ "These orcs will die. But so will you, human. You have trespassed on elvish land."
        [/message]
        [message]
            speaker=Pelathsil
            message= _ "Oh, elvish land is it now? Die, ye elf-dog! And you too, human!"
        [/message]
        [message]
            speaker=Dacyn
            message= _ "These people won’t listen to reason, they are all blinded by their beliefs in their own supposed superiority. We probably will have to fight them, although we can let them fight each other first."
        [/message]
        [message]
            speaker=Gweddry
            message= _ "True. As much as I dislike killing anything but orcs and undead, it seems we will have to kill these elves, and these dwarves, before they do the same to us."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Bagork
        [/filter]
        [message]
            speaker=Bagork
            message= _ "I will kill all of you!"
        [/message]
        [gold]
            side=2,4
            amount=50
        [/gold]
    [/event]

    [event]
        name=die
        [filter]
            id=Bagork
        [/filter]
        [message]
            speaker=second_unit
            message= _ "Not very likely."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Prok-Bak
        [/filter]
        [message]
            speaker=Prok-Bak
            message= _ "I die? Orcs rule all!"
        [/message]
        [gold]
            side=2,4
            amount=50
        [/gold]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Elandin
        [/filter]
        [filter_second]
            side=1
        [/filter_second]
        [message]
            speaker=Elandin
            message= _ "It seems these humans are more powerful than I thought. Ugh."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Elandin
        [/filter]
        [filter_second]
            side=2
        [/filter_second]
        [message]
            speaker=Elandin
            message= _ "Cursed dwarves! Perhaps we should have allied with the humans..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Elandin
        [/filter]
        [filter_second]
            side=3,5
        [/filter_second]
        [message]
            speaker=Elandin
            message= _ "Foul orcs! Perhaps we should have allied with the humans..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Pelathsil
        [/filter]
        [filter_second]
            side=1
        [/filter_second]
        [message]
            speaker=Pelathsil
            message= _ "It seems yon humans are mightier than I kenned..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Pelathsil
        [/filter]
        [filter_second]
            side=3,5
        [/filter_second]
        [message]
            speaker=Pelathsil
            message= _ "Foul orcs! Perhaps we should ha’ allied wi’ the humans..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Pelathsil
        [/filter]
        [filter_second]
            side=4
        [/filter_second]
        [message]
            speaker=Pelathsil
            message= _ "Cursed elves! Perhaps we should have allied wi’ the humans..."
        [/message]
    [/event]

    {HOLY_AMULET 10 2}

    [event]
        name=enemies defeated

        [message]
            speaker=Dacyn
            message= _ "Let us forge onward toward Lake Vrug."
        [/message]

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

    {FOREIGN_DEFEAT}

    {HERODEATH_GWEDDRY}
    {HERODEATH_DACYN}
    {HERODEATH_OWAEC}
    {HERODEATH_GRUG}
[/scenario]
