#textdomain wesnoth-sotbe
[scenario]
    id="Civil_War"
    name= _ "Civil War"
    map_data="{campaigns/Son_Of_The_Black_Eye/maps/Civil_War.map}"

    {TURNS 40 35 30}

    victory_when_enemies_defeated="no"

    {SCENARIO_MUSIC "wanderer.ogg"}
    {EXTRA_SCENARIO_MUSIC "knolls.ogg"}

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

    next_scenario="Coward"

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                condition=win
                description=_ "Defeat all rebel leaders and..."
            [/objective]
            [objective]
                condition=win
                description=_ "Move Kapou'e to the signpost at the southwest"
            [/objective]
            [objective]
                condition=lose
                description=_ "Death of Kapou'e"
            [/objective]
            [objective]
                condition=lose
                description= _ "Death of Grüü"
            [/objective]
            [objective]
                description= _ "Death of Al'Brock"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Flar'Tar"
                condition=lose
            [/objective]
            [objective]
                condition=lose
                description=_ "Turns run out"
            [/objective]

            note= _ "The Great Horde: upkeep cost of every unit decreased by one." + "
"+{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=400
        {BLACK_FLAG}
    [/side]

    {STARTING_VILLAGES 1 6}

    [side]
        type=Orcish Warlord
        id=Braga
        name= _ "Braga"
        side=2
        canrecruit=yes
        profile=portraits/orcs/transparent/warlord.png
        recruit=Goblin Pillager,Orcish Grunt,Orcish Slayer,Orcish Archer
        {GOLD 200 300 400}
        team_name=rebels
        user_team_name=_"Rebels"
        [ai]
            aggression=0.8
            caution=0.5
            village_value=0.1
        [/ai]
    [/side]

    {STARTING_VILLAGES 2 10}

    [side]
        type=Orcish Warlord
        id=Meato
        name= _ "Meato"
        side=3
        canrecruit=yes
        profile=portraits/orcs/transparent/grunt-2.png
        recruit=Goblin Knight,Orcish Warrior,Troll,Wolf Rider
        {GOLD 200 300 400}
        team_name=rebels
        user_team_name=_"Rebels"
        [ai]
            aggression=0.8
            caution=0.5
            village_value=0.1
        [/ai]
    [/side]

    {STARTING_VILLAGES 3 10}

    [side]
        type=Orcish Warlord
        id=Ragvan
        name= _ "Ragvan"
        side=4
        canrecruit=yes
        profile=portraits/orcs/transparent/grunt-2.png
        recruit=Goblin Pillager,Orcish Warrior,Orcish Assassin,Orcish Crossbowman
        {GOLD 200 300 400}
        team_name=rebels
        user_team_name=_"Rebels"
        [ai]
            aggression=0.8
            caution=0.5
            village_value=0.1
        [/ai]
    [/side]

    {STARTING_VILLAGES 4 10}

    [side]
        type=Orcish Warlord
        id=Kergai
        name= _ "Kergai"
        side=5
        canrecruit=yes
        profile=portraits/orcs/transparent/warlord.png
        recruit=Troll Rocklobber,Orcish Warrior,Orcish Slayer,Goblin Impaler
        {GOLD 200 300 400}
        team_name=rebels
        user_team_name=_"Rebels"
        [ai]
            aggression=0.8
            caution=0.5
            village_value=0.1
        [/ai]
    [/side]

    {STARTING_VILLAGES 5 10}

    [story]
        [part]
            story= _ "Infuriated by the murder of the shamans, the orcish horde massacred the humans and their allies. In their rage, they scoured the snow for hours looking for any survivors. Only when their rage was spent did the full implications of the shamans' deaths begin to sink in."
            background=farnorth.png
        [/part]

        [part]
            story= _ "With the Council broken, there was now nothing left to hold the orcish forces together. And if the orcish forces began to fight amongst themselves as they so often did, then the humans would eradicate them with ease."
            background=farnorth.png
        [/part]

        [part]
            story= _ "Kapou'e vowed that this would not happen. Events had the smell of a treacherous plot aimed at destroying the unity of the orcs. Furthermore, if the tree-shagger was to be trusted, then Shan Taum the Smug was behind it all. What an orc expected to gain from destroying his own race was beyond Kapou'e, but he decided to march to Bitok personally and confront the traitor. Bitok being on the far side of orcish territory, this would also give him a good chance to clobber the orcs together again - the old fashioned way."
            background=farnorth.png
        [/part]

        [part]
            story= _ "Furthermore, the troops who had been led by Kapou'e this far had grown to respect him as a wise and capable leader, and they proclaimed their loyalty to him. Delighted, Kapou'e sent detachments off in different directions to bring in the other tribes, by force if necessary. Al'Brock was sent west, along the route that Kapou'e had used to flee the human forces almost a year before. Flar'Tar was sent directly south to rally the tribes along the Mountains of Haag and the eastern Mourned Hills. Kapou'e himself made a direct southwest beeline towards Bitok. They were all to meet in Dorset that spring to repel the human attack that seemed certain to come."
            background=farnorth.png
        [/part]

        [part]
            story= _ "Having thus made his plans, Kapou'e set out for Bitok to get to the root of this treachery."
            background=farnorth.png
        [/part]

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

    {GOT_THE_GREAT_HORDE 1}

    [event]
        name=start

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

        [message]
            speaker="Kapou'e"
            message= _ "If we are going to make it to Bitok, and then back to Dorset before spring we have to get a move on. Break camp as soon as possible. Destroy all opposition in your path, I want this area to be firmly under my control by the time we are through here."
        [/message]

        [message]
            speaker=Braga
            message= _ "Black-Eye! We won't submit to an upstart like you!"
        [/message]

        [message]
            speaker=Meato
            message= _ "Turn around and go back to where you came from or you'll find your head on a pike! Right?"
        [/message]

        [message]
            speaker=Ragvan
            message= _ "Right!"
        [/message]

        [message]
            speaker=Kergai
            message= _ "Right!"
        [/message]

        [message]
            speaker="Kapou'e"
            #po: "whupping" is not a typo for "whipping"; it ia a Southern
            #po: American dialect word meaning "a severe beating".
            # wmllint: local spelling whupping
            message= _ "It's been a chilly winter. How about we warm ourselves up a bit by giving these traitors a good whupping, boys?"
        [/message]

        [message]
            speaker=Grüü
            message= _ "Yeah!"
        [/message]

        {HIGHLIGHT_IMAGE 1 18 scenery/signpost.png ()}
    [/event]

    # Commented out since it just doesn't work out very well
    #    [event]
    #        name=attack
    #
    #        [filter_second]
    #            side=1
    #        [/filter_second]
    #
    #        [message]
    #            speaker=unit
    #            message= _ "(whispered) Psst, Black-Eye! Shan Taum paid our chiefs to stick around here and guard Bitok. But they pay us poor!"
    #        [/message]
    #
    #        [message]
    #            speaker="Kapou'e"
    #            message= _ "And how is that my problem?"
    #        [/message]
    #
    #        [message]
    #            speaker=unit
    #            message= _ "(whispered) Well, Black-Eye, as long as they're in charge you'll have to fight us all...but I'm sure none of us would bother you if you'd 'remove' just our chiefs."
    #        [/message]
    #
    #        [message]
    #            side=$unit.side
    #            canrecruit=yes
    #            message= _ "What are you doing! I haven't let you keep your head so you could chat with the enemy! Get back to the fight!"
    #        [/message]
    #
    #        [message]
    #            speaker=unit
    #            message= _ "Uh oh...yes chief, right away!"
    #        [/message]
    #
    #        [message]
    #            speaker=unit
    #            message= _ "(whispered) Sorry!"
    #        [/message]
    #    [/event]
    #
    #    [event]
    #        name=attack_end
    #
    #        [filter_second]
    #            side=1
    #        [/filter_second]
    #
    #        [message]
    #            speaker=second_unit
    #            message= _ "Chief, maybe we should do what he said and just try to assassinate their leaders instead?"
    #        [/message]
    #
    #        [message]
    #            speaker="Kapou'e"
    #            message= _ "Sure, why not. If we get the chance."
    #        [/message]
    #    [/event]

    [event]
        name=die

        [filter]
            type=Orcish Archer,Orcish Assassin
        [/filter]

        [filter_second]
            id=Grüü
        [/filter_second]

        [message]
            speaker=Grüü
            message= _ "Little orcs fun to squash too! Chief doesn't let me too often."
        [/message]

        [message]
            speaker="Kapou'e"
            message= _ "You can have as many as you want now, Grüü."
        [/message]
    [/event]

    [event]
        name=die
        first_time_only=no

        [filter]
            id=Braga

            [or]
                id=Meato
            [/or]

            [or]
                id=Ragvan
            [/or]

            [or]
                id=Kergai
            [/or]
        [/filter]

        [switch]
            variable=unit.side

            [case]
                value=2

                [message]
                    speaker=second_unit
                    message= _ "This rabble won't be a problem anymore."
                [/message]
            [/case]

            [case]
                value=3

                [message]
                    speaker=second_unit
                    message= _ "Got this tribe under control."
                [/message]
            [/case]

            [case]
                value=4

                [message]
                    speaker=second_unit
                    message= _ "This is what you get for deserting the Son of the Black-Eye."
                [/message]
            [/case]

            [case]
                value=5

                [message]
                    speaker=second_unit
                    message= _ "This trash's gone."
                [/message]
            [/case]
        [/switch]

        [kill]
            x,y=$x1,$y1
            animate=no
            fire_event=no
        [/kill]

        [if]
            [not]
                [have_unit]
                    id=Braga

                    [or]
                        id=Meato
                    [/or]

                    [or]
                        id=Ragvan
                    [/or]

                    [or]
                        id=Kergai
                    [/or]
                [/have_unit]
            [/not]

            [then]
                [message]
                    speaker=Grüü
                    # wmllint: local spelling Heehee
                    message= _ "Heehee, we wiped them out good."
                [/message]

                [message]
                    speaker="Kapou'e"
                    message= _ "Now let's get going, we have an appointment with Shan Taum."
                [/message]

                [objectives]
                    side=1
                    [objective]
                        condition=win
                        description=_ "Move Kapou'e to the signpost at the southwest"
                    [/objective]
                    [objective]
                        condition=lose
                        description=_ "Death of Kapou'e"
                    [/objective]
                    [objective]
                        condition=lose
                        description= _ "Death of Grüü"
                    [/objective]
                    [objective]
                        condition=lose
                        description=_ "Turns run out"
                    [/objective]

                    note= _ "The Great Horde: upkeep cost of every unit decreased by one." + "
"+{EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
                [/objectives]
            [/then]
        [/if]

        #        [if]
        #            [have_unit]
        #                side=$unit.side
        #
        #                [not]
        #                    canrecruit=yes
        #                [/not]
        #            [/have_unit]
        #
        #            [then]
        #                [role]
        #                    side=$unit.side
        #                    type=Orcish Warlord,Orcish Warrior,Orcish Slurbow,Orcish Crossbowman,Orcish Slayer,Orcish Grunt,Orcish Archer,Orcish Assassin
        #                    role=new_leader
        #                [/role]
        #
        #                [store_unit]
        #                    [filter]
        #                        side=$unit.side
        #                        role=new_leader
        #                    [/filter]
        #
        #                    kill=yes
        #                    variable=stored_new_leader
        #                [/store_unit]
        #
        #                {VARIABLE stored_new_leader.canrecruit yes}
        #
        #                [unstore_unit]
        #                    variable=stored_new_leader
        #                [/unstore_unit]
        #
        #                {CLEAR_VARIABLE stored_new_leader}
        #
        #                [modify_side]
        #                    side=$unit.side
        #                    team_name=Kapoue
        #                    user_team_name=_ "Kapou'e"
        #                [/modify_side]
        #
        #                [if]
        #                    [have_unit]
        #                        id=Braga
        #
        #                        [or]
        #                            id=Meato
        #                        [/or]
        #
        #                        [or]
        #                            id=Ragvan
        #                        [/or]
        #
        #                        [or]
        #                            id=Kergai
        #                        [/or]
        #                    [/have_unit]
        #
        #                    [then]
        #                        [switch]
        #                            variable=unit.side
        #
        #                            [case]
        #                                value=2
        #
        #                                [message]
        #                                    side=2
        #                                    role=new_leader
        #                                    message= _ "Freedom! Don't worry about our tribe anymore, Kapou'e."
        #                                [/message]
        #                            [/case]
        #
        #                            [case]
        #                                value=3
        #
        #                                [message]
        #                                    side=3
        #                                    role=new_leader
        #                                    message= _ "Thank you, Son of the Black-Eye!"
        #                                [/message]
        #                            [/case]
        #
        #                            [case]
        #                                value=4
        #
        #                                [message]
        #                                    side=4
        #                                    role=new_leader
        #                                    message= _ "The chief is gone at last!"
        #                                [/message]
        #                            [/case]
        #
        #                            [case]
        #                                value=5
        #
        #                                [message]
        #                                    side=5
        #                                    role=new_leader
        #                                    message= _ "Finally! We'll fight at your side now!"
        #                                [/message]
        #                            [/case]
        #                        [/switch]
        #                    [/then]
        #                [/if]
        #            [/then]
        #        [/if]
    [/event]

    [event]
        name=moveto
        first_time_only=no

        [filter]
            x,y=1,18
            id="Kapou'e"
        [/filter]

        [if]
            [have_unit]
                side=2,3,4,5
                canrecruit=yes
            [/have_unit]

            [then]
                [allow_undo]
                [/allow_undo]
            [/then]

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

        #        [if]
        #            [not]
        #                [have_unit]
        #                    id=Braga
        #
        #                    [or]
        #                        id=Meato
        #                    [/or]
        #
        #                    [or]
        #                        id=Ragvan
        #                    [/or]
        #
        #                    [or]
        #                        id=Kergai
        #                    [/or]
        #                [/have_unit]
        #            [/not]
        #
        #            [then]
        #                [if]
        #                    [have_unit]
        #                        side=2,3,4,5
        #                        canrecruit=yes
        #                    [/have_unit]
        #
        #                    [then]
        #                        [message]
        #                            side=2,3,4,5
        #                            canrecruit=yes
        #                            message= _ "Thanks to you, Kapou'e, our imbecile leaders are gone!"
        #                        [/message]
        #
        #                        [message]
        #                            speaker="Kapou'e"
        #                            message= _ "Good for you. Now let's get going, we have an appointment with Shan Taum."
        #                        [/message]
        #
        #                        [message]
        #                            side=2,3,4,5
        #                            canrecruit=yes
        #                            message= _ "Actually...we won't be coming."
        #                        [/message]
        #
        #                        [message]
        #                            speaker=Grüü
        #                            message= _ "You don't turn your back on Chief! You come or we squash!"
        #                        [/message]
        #
        #                        [message]
        #                            side=2,3,4,5
        #                            canrecruit=yes
        #                            message= _ "But we don't want to fight anymore! In fact, we prefer farming to war. Maybe burn a village every now and then, but no big fighting."
        #                        [/message]
        #
        #                        [message]
        #                            speaker=Grüü
        #                            message= _ "Haha, Grüü never heard anything funnier! Farming orcs must have been hit in the head too hard."
        #                        [/message]
        #
        #                        [message]
        #                            speaker="Kapou'e"
        #                            # wmllint: local spelling un-orcs
        #                            message= _ "As much as I'd like to, we don't have time to stay and 're-educate' these un-orcs. So go jump in a lake if you want for all I care, just make sure I never see your pathetic faces again."
        #                        [/message]
        #                    [/then]
        #
        #                    [else]
        #                        [message]
        #                            speaker=Grüü
        #                            message= _ "Heehee, we wiped them out good."
        #                        [/message]
        #
        #                        [message]
        #                            speaker="Kapou'e"
        #                            message= _ "Now let's get going, we have an appointment with Shan Taum."
        #                        [/message]
        #                    [/else]
        #                [/if]
        #
        #                [endlevel]
        #                    result=victory
        #                    bonus=yes
        #                    {NEW_GOLD_CARRYOVER 40}
        #                [/endlevel]
        #            [/then]
        #        [/if]
    [/event]

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