#textdomain wesnoth-sotbe
[scenario]
    id=Clash_of_armies
    name= _ "Clash of Armies"
    map_data="{campaigns/Son_Of_The_Black_Eye/maps/Clash_Of_Armies.map}"
    turns=24

    {SECOND_WATCH}
    {DAWN}
    {MORNING}
    {AFTERNOON}
    {DUSK}
    {FIRST_WATCH}

    next_scenario=Giving_Some_Back

    {SCENARIO_MUSIC "battle.ogg"}
    {EXTRA_SCENARIO_MUSIC "the_city_falls.ogg"}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Defend Prestim successfully for four days"
                condition=win
            [/objective]
            [objective]
                description= _ "Destruction of a tower of Prestim"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Kapou'e"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Grüü"
                condition=lose
            [/objective]

            note={NO_EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
        [/objectives]
    [/event]

    [side]
        type=Orcish Leader
        id="Kapou'e"
        name= _ "Kapou'e"
        side=1
        canrecruit=yes
        controller=human
        recruit= Wolf Rider, Orcish Grunt, Troll Whelp, Orcish Archer
        team_name=Kapoue
        user_team_name=_ "Kapou'e"
        gold=200
        {BLACK_FLAG}
    [/side]

    {STARTING_VILLAGES 1 10}
    {STARTING_VILLAGES_AREA 1 5 5 4}
    {STARTING_VILLAGES_AREA 1 35 5 4}

    [side]
        type=Elvish Champion
        id=Thelarion
        name= _ "Thelarion"
        side=2
        canrecruit=yes
        facing=sw
        [ai]
            aggression=1.0
            recruitment_pattern=scout, scout, fighter, fighter, fighter, healer, archer
            grouping=no
            [target]
                type="Watch Tower"
                value=50
            [/target]
            recruitment_ignore_bad_combat=yes
            recruitment_ignore_bad_movement=yes
            village_value=0.0
            leader_value=50.0
        [/ai]
        recruit=Elvish Captain, Elvish Fighter, Elvish Archer, Elvish Marksman, Elvish Druid, Elvish Scout
        team_name=villains
        user_team_name=_"Villains"
        {GOLD 200 200 250}
    [/side]

    {STARTING_VILLAGES 2 10}

    [side]
        type=Dwarvish Steelclad
        id=Darstang
        name= _ "Darstang"
        side=3
        canrecruit=yes
        [ai]
            recruitment_pattern=scout, scout, scout, fighter, fighter, mixed fighter, mixed fighter
            aggression=1.0
            caution=0.0
            villages_per_scout=0
            grouping=no
            [target]
                type="Watch Tower"
                value=50
            [/target]
            recruitment_ignore_bad_combat=yes
            recruitment_ignore_bad_movement=yes
            village_value=20
        [/ai]
        recruit=Dwarvish Fighter, Dwarvish Thunderer, Dwarvish Scout, Bandit, Gryphon Rider
        user_team_name=_"Villains"
        team_name=villains
        {GOLD 200 250 300}
    [/side]

    {STARTING_VILLAGES 3 11}

#ifdef EASY
    {LIMIT_CONTEMPORANEOUS_RECRUITS 3 "Gryphon Rider" 3}
#endif

    [side]
        type=General
        id="Earl Lanbec'h"
        name= _ "Earl Lanbec'h"
        profile=portraits/lanbech.png
        side=4
        canrecruit=yes
        facing=sw
        [ai]
            aggression=1.0
            recruitment_pattern=fighter, archer, mixed fighter
            grouping=no
            [target]
                type="Watch Tower"
                value=50
            [/target]
            recruitment_ignore_bad_combat=yes
            recruitment_ignore_bad_movement=yes
            leader_value=50.0
            village_value=0.0
        [/ai]
        recruit=Swordsman, Red Mage, Pikeman, Heavy Infantryman, Fencer, Bowman
        team_name=villains
        user_team_name=_"Villains"
        {GOLD 200 400 600}
    [/side]

    {STARTING_VILLAGES 4 8}
    {STARTING_VILLAGES_AREA 4 19 31 6}

    [side]
        side=5
        [ai]
            aggression=1.0
            caution=0.25
            village_value=10
        [/ai]
        team_name=villains
        user_team_name=_"Villains"
        no_leader=yes
    [/side]

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

    [event]
        name=prestart

        [kill]
            type=Watch Tower
            fire_event=no
        [/kill]
        {NAMED_UNIT 1 (Watch Tower) 30 5 (Eastern Tower) (_"Eastern Tower") (upkeep=free)}
        {NAMED_UNIT 1 (Watch Tower) 10 4 (Western Tower) (_"Western Tower") (upkeep=free)}
        {NAMED_UNIT 1 (Watch Tower) 19 5 (Southern Tower) (_"Southern Tower") (upkeep=free)}
        [role]
            type=Orcish Warlord,Troll Warrior,Orcish Warrior,Saurian Ambusher,Troll,Orcish Grunt,Saurian Skirmisher,Troll Whelp
            role=cannonfodder
        [/role]
        [recall]
            role=cannonfodder
            x=18
            y=11
        [/recall]

        [role]
            role=cannonfodder2
            type=Orcish Crossbowman,Orcish Slayer,Orcish Archer,Orcish Assassin
        [/role]
        [recall]
            role=cannonfodder2
            x=20
            y=11
        [/recall]

        {RENAME_IF_DEAD thelarion_dead Thelarion (_"Telamir")}
        {RENAME_IF_DEAD darstang_dead Darstang (_"Angthur")}
    [/event]

    [event]
        name=start

        [recall]
            id=Grüü
        [/recall]
        [recall]
            id=Jetto
        [/recall]
        [recall]
            id=Inarix
        [/recall]
        [recall]
            id=Plonk
        [/recall]

        [message]
            role=cannonfodder
            message= _ "So here we are, and they are preparing to assault."
        [/message]

        [message]
            speaker="Grüü"
            message= _ "Prestim's walls are rock-hard, they'll waste themselves on them."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "I'm not that sure. Every fortress has its own weakness. Prestim's walls are built on three towers. If one of them is destroyed, a breach will allow humans to enter Prestim... which would be the end for us."
        [/message]

        [message]
            role=cannonfodder
            message= _ "We've received messengers from the Council, saying that they are gathering tribes into the Great Horde."
        [/message]

        [message]
            speaker="Grüü"
            message= _ "Great! When do they arrive?"
        [/message]

        [message]
            role=cannonfodder
            message= _ "In four days. I fear it will be too late."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Fool! We can hold that long."
        [/message]

        [message]
            role=cannonfodder
            message= _ "How?"
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Most of their forces will cross the river by the ford where the bridge previously stood. If we can hold that ford, we can hold the fortress."
        [/message]

        [message]
            role=cannonfodder
            message= _ "And if we fail?"
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Then, they will assault Prestim at five troops to our one. We'll just have to do the best we can."
        [/message]

        [message]
            role=cannonfodder
            message= _ "Great."
        [/message]

        [message]
            speaker="narrator"
            message= _ "Then, the battle for Prestim began."
            image=wesnoth-icon.png
        [/message]
    [/event]

    [event]
        name=turn 2

        [unit]
            side=5
            type=Merman Warrior
            id=Plouf
            name= _ "Plouf"
            x=2
            y=16
            random_traits=yes
        [/unit]

        {GENERIC_UNIT 5 (Merman Fighter) 1 15}
        {GENERIC_UNIT 5 (Merman Fighter) 1 16}
        {GENERIC_UNIT 5 (Merman Fighter) 1 17}

        [message]
            speaker="Plouf"
            message= _ "We arrive to honor our alliance, Earl Lanbec'h."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "Curses! They have fish-men on their side."
        [/message]
    [/event]

    [event]
        name=turn 3,turn 4,turn 5,turn 6,turn 9,turn 11
        first_time_only=no

        {GENERIC_UNIT 5 (Merman Fighter) 1 15}
        {GENERIC_UNIT 5 (Merman Fighter) 1 16}
#ifndef EASY
        {GENERIC_UNIT 5 (Merman Fighter) 1 17}
#endif
    [/event]

#ifdef __UNUSED__
    [event]
        name=turn 12
        [unit]
            side=4
            type=Duelist
            id="J'rem"
            name= _ "J'rem"
            x=16
            y=12
            random_traits=yes
        [/unit]
        [message]
            speaker="J'rem"
            message= _ "We arrive to honor our alliance, Earl Lanbec'h."
        [/message]
        [message]
            speaker="Earl Lanbec'h"
            message= _ "Reinforcements, at last. We don't have much time, the Orcish hordes are on their way. To the attack!"
        [/message]
    [/event]
#endif

    [event]
        name=time over

        {UNIT 1 "Orcish Grunt" 38 1 role=greathordeprops}
        {UNIT 1 "Orcish Grunt" 38 1 role=greathordeprops}
        {UNIT 1 "Orcish Grunt" 38 1 role=greathordeprops}
        {UNIT 1 "Orcish Archer" 38 1 role=greathordeprops}
        {UNIT 1 "Orcish Archer" 38 1 role=greathordeprops}
        {UNIT 1 "Orcish Archer" 38 1 role=greathordeprops}
        {UNIT 1 "Wolf Rider" 38 1 role=greathordeprops}
        {UNIT 1 "Wolf Rider" 38 1 role=greathordeprops}
        {UNIT 1 "Wolf Rider" 38 1 role=greathordeprops}
        {UNIT 1 "Wolf Rider" 38 1 role=greathordeprops}
        {UNIT 1 "Wolf Rider" 38 1 role=greathordeprops}
        {ORCISH_SHAMAN 38 1 Pirk _"Pirk"}
        {OLD_ORCISH_SHAMAN 38 1 Gork _"Gork"}
        {NOVICE_ORCISH_SHAMAN 38 1 Vraurk _"Vraurk"}

        [message]
            speaker="Gork"
            message= _ "Here we are! Hold on Prestim, we arrive to push them to the river!"
        [/message]

        [message]
            speaker="Earl Lanbec'h"
            message= _ "They are too numerous now, RETREAT!"
        [/message]

        [kill]
            side=5
            animate=no
        [/kill]
        [kill]
            side=2
            animate=no
        [/kill]
        [kill]
            side=3
            animate=no
        [/kill]
        [kill]
            side=4
            animate=no
        [/kill]

        [message]
            speaker="Kapou'e"
            message= _ "The Great Horde at last! I was beginning to think they would never come."
        [/message]

        [message]
            speaker="Gork"
            message= _ "Your defense of Prestim was heroic, facing such opposition surely undermined the morale of humans. Now they are retreating to their fortresses and will not venture out anytime soon."
        [/message]

        [message]
            speaker="Pirk"
            message= _ "It is now time to show them who we are and to lead the Great Horde in pursuit. We will not rest until we destroy Earl Lanbec'h. Smite, stab, slay!"
        [/message]

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

    [event]
        name=die
        [filter]
            type=Watch Tower
        [/filter]
        [message]
            speaker="Kapou'e"
            message= _ "No! The walls of Prestim are destroyed, we are done!"
        [/message]
        {DEFEAT}
    [/event]

    {campaigns/Son_Of_The_Black_Eye/utils/deaths.cfg}
[/scenario]
