#textdomain wesnoth-sotbe
#define GRUNT_DEFENDER X Y
    [unit]
        type=Orcish Grunt
        x={X}
        y={Y}
        side=5
        random_traits=yes
        generate_description=yes
    [/unit]
#enddef

#define ARCHER_DEFENDER X Y
    [unit]
        type=Orcish Archer
        x={X}
        y={Y}
        side=5
        random_traits=yes
        generate_description=yes
    [/unit]
#enddef

[scenario]
    id="Black_Flag"
    name= _ "Black Flag"
    map_data="{campaigns/Son_Of_The_Black_Eye/maps/Black_Flag.map}"
    {TURNS 30 25 20}

    {DEFAULT_SCHEDULE}

    next_scenario="Desert_Of_Death"
    {SCENARIO_MUSIC "vengeful.ogg"}
    {VICTORY_AND_DEFEAT_MUSIC}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Defeat Slowhand and Harman"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kapou'e"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Grüü"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

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

    [side]
        type=General
        description=Slowhand
        user_description= _ "Slowhand"
        side=2
        team_name=Humans
        canrecruit=yes
        recruit=Swordsman,Fencer,Mage,Heavy Infantryman,Bowman
        [ai]
            recruitment_pattern=fighter,fighter,archer,mixed fighter
            aggression=0
            village_value=10.0
            leader_value=50.0
        [/ai]
        {GOLD 110 130 150}
        {INCOME 5 8 12}
    [/side]

    [side]
        type=Transport Galleon
        description=Transport Galleon
        user_description=_ "Transport Galleon"
        side=3
        no_leader=yes
        team_name=Humans
        [ai]
            aggression=1.0
        [/ai]
        gold=0
    [/side]

    [side]
        type=General
        description=Harman
        user_description= _ "Harman"
        side=4
        team_name=Humans
        canrecruit=yes
        recruit=Swordsman,Fencer,Mage,Heavy Infantryman,Bowman
        [ai]
            recruitment_pattern=fighter,fighter,archer,mixed fighter
            aggression=0
            village_value=10.0
            leader_value=50.0
        [/ai]
        {GOLD 80 100 150}
        {INCOME 5 8 12}
    [/side]

    [side]
        type=Orcish Warrior
        description=Affman
        side=5
        team_name=Kapoue
        no_leader=yes
    [/side]

    [story]
        [part]
            background=sotbe2.png
            show_title=yes
            {DOT 217 156}
            {DOT 220 183}
            {DOT 232 207}
            {DOT 242 222}
            {DOT 243 250}
            {DOT 235 272}
            {DOT 227 292}
            {DOT 215 314}
            {CROSS 204 333}
        [/part]
    [/story]

    [event]
        name=prestart

        [teleport]
            [filter]
                description="Kapou'e"
            [/filter]
            x=25
            y=1
        [/teleport]
    [/event]

    [event]
        name=start

        {GRUNT_DEFENDER 16 12}
        {ARCHER_DEFENDER 17 12}
        {GRUNT_DEFENDER 20 9}
        {ARCHER_DEFENDER 28 13}
        {GRUNT_DEFENDER 32 23}
        {ARCHER_DEFENDER 31 25}

        [unit]
            type=Orcish Warrior
            side=5
            description=Affman
            x=27
            y=20
            random_traits=yes
            user_description= _ "Affman"
        [/unit]

        [recall]
            description=Pirk
            x=26
            y=1
        [/recall]
        [recall]
            description=Gork
            x=27
            y=1
        [/recall]
        [recall]
            description=Vraurk
            x=28
            y=1
        [/recall]

        [recall]
            description=Grüü
        [/recall]

        [teleport]
            [filter]
                description=Grüü
            [/filter]
            x=25
            y=2
        [/teleport]
        {WATCH_TOWER 21 14 Northern_Tower}
        {WATCH_TOWER 12 19 Western_Tower}
        {WATCH_TOWER 20 21 Eastern_Tower}
        {PIRATE_GALLEON 12 28}
        {PIRATE_GALLEON 3 22}
        {PIRATE_GALLEON 10 26}
        {PIRATE_GALLEON 6 25}
        [unit]
            side=3
            id=Transport
            description="Transport Galleon"
            user_description= _ "Transport Galleon"
            type=Transport Galleon
            name= _ "Transport"
            ai_special=guardian
            x=2
            y=28
        [/unit]
        [unit]
            side=2
            id=Transport
            description="Landing Galleon"
            user_description= _ "Landing Galleon"
            type=Transport Galleon
            ai_special=guardian
            x=7
            y=9
        [/unit]

        [message]
            description="Kapou'e"
            message= _ "So, here is Tirigaz. But what in the world is going on?"
        [/message]
        [message]
            description="Pirk"
            message= _ "Looks like humans have attacked here too. You were right, Kapou'e, the humans have declared all-out war on us."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Listen, if we are going to meet with the rest of the Great Council, we have to repel this attack. You shamans hide here in the forest until we defeat them. It will be faster and easier for us if we don't have to worry about protecting you."
        [/message]
        [message]
            description="Gork"
            message= _ "This is a wise choice. Good luck, son of the Black-Eye."
        [/message]
        [message]
            description="Slowhand"
            message= _ "Haha! Our plan is going well, let's surround them on land while our allies attack them from sea!"
        [/message]
        [store_unit]
            [filter]
                description=Pirk
            [/filter]
            variable=Pirk_store
            kill=yes
        [/store_unit]
        [store_unit]
            [filter]
                description=Gork
            [/filter]
            variable=Gork_store
            kill=yes
        [/store_unit]
        [store_unit]
            [filter]
                description=Vraurk
            [/filter]
            variable=Vraurk_store
            kill=yes
        [/store_unit]
    [/event]

    [event]
        name=turn 2
        {MOVE_TRANSPORT_GALEON 2 28 9 30 3,4,5,6,7,8,9 28,28,28,28,29,29,30}

        [message]
            description=Affman
            message= _ "Look, a party of our kind approaches from the North."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Greetings from Kapou'e, Son of the Black-Eye Karun."
        [/message]

        [message]
            description=Affman
            message= _ "Son of the great Black-Eye Karun?! You do us honor, Chief."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Do not grovel, just tell me what's going on here."
        [/message]

        [message]
            description=Affman
            message= _ "I don't really know, one day all was calm and peaceful and the next a fleet of human ships showed up and began spewing out human-worms. We tried to hold them off as best we could, but they captured the Northern keep. And then human reinforcements arrived from their settlements to the South."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Are the shamans safe?"
        [/message]

        [message]
            description=Affman
            message= _ "When we realized that there was no way we could hold the humans off, we sent them East to a place near the Mourned Hills along with most of our women and children. The rest of us remained here to buy them some time."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Wise decision. We have actually come to speak to the shamans, but while we are here we must help our brothers in need. Grüü, help hold them while I run to the keep and organize our forces to counterattack. We can't defeat them by sea without naval forces, but we can destroy the foothold they have gained on the land."
        [/message]
        [message]
            description="Grüü"
            message= _ "I love this strategy, Chief!"
        [/message]
    [/event]

    [event]
        name=turn 3
        {MOVE_TRANSPORT_GALEON 9 30 15 30 10,11,12,13,14,15 30,30,30,30,30,30}
    [/event]

    [event]
        name=turn 4
        {MOVE_TRANSPORT_GALEON 15 30 20 30 16,17,18,19,20 30,30,30,30,30}
    [/event]

    [event]
        name=turn 5
        {MOVE_TRANSPORT_GALEON 20 30 25 30 20,21,22,23,24,25 30,30,30,30,30,30}
    [/event]

    [event]
        name=turn 6
        {MOVE_TRANSPORT_GALEON 25 30 27 25 26,27,27,27,27,27 29,29,28,27,26,25}

        [unit]
            description="J'rem"
            type=Fencer
            x=26
            y=24
            side=3
            user_description= _ "J'rem"
            random_traits=yes
        [/unit]
        [unit]
            type=Fencer
            x=27
            y=24
            side=3
            generate_description=yes
            random_traits=yes
        [/unit]
        [unit]
            type=Swordsman
            x=26
            y=25
            side=3
            generate_description=yes
            random_traits=yes
        [/unit]
        [unit]
            type=Mage
            x=28
            y=24
            side=3
            generate_description=yes
            random_traits=yes
        [/unit]
        [unit]
            type=Cavalryman
            x=28
            y=25
            side=3
            generate_description=yes
            random_traits=yes
        [/unit]
        [unit]
            type=Cavalryman
            x=28
            y=25
            side=3
            generate_description=yes
            random_traits=yes
        [/unit]
        [unit]
            type=Cavalryman
            x=28
            y=25
            side=3
            generate_description=yes
            random_traits=yes
        [/unit]
        [message]
            description="J'rem"
            message= _ "Pillage! Let's plunder these orcs!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            description=Slowhand
        [/filter]
        [message]
            speaker=unit
            message= _ "Aaaargh! I die!"
        [/message]
        [message]
            description="Kapou'e"
            message= _ "Finally, you pay for what you did to my orc brothers!"
        [/message]
    [/event]

    [event]
        name=victory

        [message]
            description="Kapou'e"
            message= _ "We are victorious at last. Someone go tell the shamans that they can come out now."
        [/message]

        [unstore_unit]
            variable=Pirk_store
            find_vacant=yes
        [/unstore_unit]
        [unstore_unit]
            variable=Gork_store
            find_vacant=yes
        [/unstore_unit]
        [unstore_unit]
            variable=Vraurk_store
            find_vacant=yes
        [/unstore_unit]

        {CLEAR_VARIABLE Pirk_store}
        {CLEAR_VARIABLE Gork_store}
        {CLEAR_VARIABLE Vraurk_store}

        [message]
            description=Gork
            message= _ "Congratulations on your victory, Kapou'e. You do honor to the memory of your father."
        [/message]
        [message]
            description="Kapou'e"
            message= _ "Thanks, but I have news. Since the forces here were certain they were going to be defeated, they sent the shamans to the Mourned Hills. If we want to meet them, we must go after them."
        [/message]
        [message]
            description=Pirk
            message= _ "Oh, great. That means we have to cross the Desert of Death which is full of poisonous giant scorpions and outlaws. And bypassing it would take ages! Not to mention after this desert, we'll have to cross the Silent Forest!"
        [/message]
        [message]
            description=Grüü
            message= _ "Well, we have no choice ... I've never tasted scorpions but I am sure they are good. This journey promises to be fun."
        [/message]
        [kill]
            description=Eastern_Tower
        [/kill]
        [kill]
            description=Northern_Tower
        [/kill]
        [kill]
            description=Western_Tower
        [/kill]
    [/event]

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