#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

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC elvish-theme.ogg knalgan_theme.ogg}
    {EXTRA_SCENARIO_MUSIC northerners.ogg}
    {EXTRA_SCENARIO_MUSIC elf-land.ogg}
    {EXTRA_SCENARIO_MUSIC loyalists.ogg}

    {campaigns/Eastern_Invasion/utils/deaths.cfg}

    [story]
        [part]
            show_title=yes
            {TO_XENOPHOBIA}
        [/part]
    [/story]

    [side]
        type=Lieutenant
        id=Gweddry
        name= _ "Gweddry"
        side=1
        canrecruit=yes
        controller=human
        team_name=wesnothians
        user_team_name=_"Wesnothians"
        {GOLD 250 200 200}
        {FLAG_VARIANT loyalist}
    [/side]

    {STARTING_VILLAGES 1 9}

    [side]
        type=Dwarvish Lord
        id=Pelathsil
        name= _ "Pelathsil"
        side=2
        canrecruit=yes
        controller=ai
#ifdef EASY
        recruit=Dwarvish Thunderguard,Dwarvish Steelclad,Dwarvish Fighter,Dwarvish Scout
#else
        recruit=Dwarvish Thunderguard,Dwarvish Steelclad,Dwarvish Fighter,Dwarvish Berserker,Dwarvish Pathfinder
#endif
        {GOLD 150 200 300}
        {FLAG_VARIANT knalgan}
    [/side]

    {STARTING_VILLAGES 2 9}

    [side]
        type=Orcish Warlord
        id=Prok-Bak
        name= _ "Prok-Bak"
        side=3
        canrecruit=yes
        controller=ai
#ifdef EASY
        recruit=Troll,Wolf Rider,Goblin Knight,Goblin Pillager,Orcish Warrior
#else
        recruit=Troll,Wolf Rider,Goblin Knight,Goblin Pillager,Direwolf Rider,Orcish Warrior
#endif
        {GOLD 160 235 310}
        [ai]
            grouping=no
        [/ai]
        {FLAG_VARIANT ragged}
    [/side]

    {STARTING_VILLAGES 3 9}

    [side]
        type=Elvish Marshal
        id=Elandin
        name= _ "Elandin"
        side=4
        canrecruit=yes
        controller=ai
#ifdef EASY
        recruit=Elvish Ranger,Elvish Rider,Elvish Druid
#else
        recruit=Elvish Ranger,Elvish Rider,Elvish Druid,Elvish Avenger
#endif
        {GOLD 170 230 300}
        [ai]
            grouping=defensive
        [/ai]
        {FLAG_VARIANT long}
    [/side]

#ifndef EASY
    {LIMIT_CONTEMPORANEOUS_RECRUITS 4 "Elvish Avenger" 1}
#endif

    {STARTING_VILLAGES 4 9}

    [event]
        name=prestart

        # {SCATTER_IMAGE (terrain=Gg) 4 scenery/snowbits.png}
        # {SCATTER_IMAGE (terrain=Gg) 12 scenery/pine1.png}

        [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]
        [message]
            speaker=Dacyn
            message= _ "Hail, dwarves! Will you help us get by these foul orcs? We need to get further along this path."
        [/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=Prok-Bak
            # 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 may be able to bypass them."
        [/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=Pelathsil
        [/filter]
        [message]
            speaker=Pelathsil
            message= _ "Argh! I’m dead! Well, dwarves are still the best!"
        [/message]
        [gold]
            side=3
            amount=50
        [/gold]
        [gold]
            side=4
            amount=50
        [/gold]
    [/event]
    [event]
        name=last breath
        [filter]
            id=Prok-Bak
        [/filter]
        [message]
            speaker=Prok-Bak
            message= _ "I die? Orcs rule all!"
        [/message]
        [gold]
            side=2
            amount=50
        [/gold]
        [gold]
            side=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]
        [gold]
            side=2
            amount=50
        [/gold]
        [gold]
            side=3
            amount=50
        [/gold]
    [/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
        [/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
        [/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]

    {PICKUPPABLE_ITEM holy_amulet 20 12 side=1 items/ankh-necklace.png
    _"Wearing this amulet will cause every blow you deal to inflict <i>arcane</i> damage!"
    _"holy amulet^Take it"
    _"holy amulet^Leave it"
    _"I am not suited to using this item! Let another take it." (
        [object]
            name= _ "Holy Amulet"
            image=items/ankh-necklace.png
            duration=forever

            [effect]
                apply_to=attack
                range=melee
                set_type=arcane
            [/effect]
            [effect]
                apply_to=attack
                range=ranged
                set_type=arcane
            [/effect]
        [/object]
    )}

    [event]
        name=enemies defeated

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

    {FOREIGN_DEFEAT}
[/scenario]
