#textdomain wesnoth-sotbe
[scenario]
    id=back_home
    name= _ "Back Home"
    map_data="{campaigns/Son_Of_The_Black_Eye/maps/Back_Home.map}"
    {TURNS 45 40 35}

    {DEFAULT_SCHEDULE}

    next_scenario="Civil_War"
    {SCENARIO_MUSIC "knolls.ogg"}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Defeat All Enemy Leaders."
                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=200
        {BLACK_FLAG}
    [/side]

    [side]
        type=Orcish Warlord
        description="Al'Brock"
        user_description= _ "Al'Brock"
        side=2
        canrecruit=yes
        recruit= Wolf Rider, Orcish Grunt, Troll Whelp, Orcish Archer, Orcish Crossbowman, Orcish Warrior
        team_name=Kapoue
        allow_recall=yes
        no_leader=yes
        {GOLD 350 300 250}
        {INCOME 20 15 10}
    [/side]

    [side]
        type=Orcish Warlord
        description="Flar'Tar"
        user_description= _ "Flar'Tar"
        side=3
        canrecruit=yes
        recruit= Wolf Rider, Orcish Grunt, Troll Whelp, Orcish Archer, Orcish Crossbowman, Orcish Warrior
        allow_recall=yes
        team_name=Kapoue
        no_leader=yes
        {GOLD 350 300 250}
        {INCOME 20 15 10}
    [/side]

    [side]
        type=Troll
        description=Grüü
        user_description= _ "Grüü"
        side=4
        canrecruit=yes
        recruit=Troll Whelp
        team_name=Kapoue
        controller=human
        no_leader=yes
        {GOLD 200 175 150}
    [/side]

    [side]
        type=General
        description=General Telthys
        user_description= _ "General Telthys"
        recruit=Spearman,Bowman,Mage,Cavalryman, Swordsman, Pikeman, Longbowman
        side=5
        canrecruit=yes
        team_name=vilains
        {GOLD 250 300 350}
        {INCOME 15 20 25}
    [/side]

    [side]
        type=Elvish Champion
        description=Mkel
        user_description= _ "Mkel"
        recruit=Elvish Captain, Elvish Fighter, Elvish Archer, Elvish Marksman, Elvish Druid, Elvish Scout, Elvish Hero, Elvish Ranger
        side=6
        canrecruit=yes
        team_name=vilains
        {GOLD 250 300 350}
        {INCOME 15 20 25}
    [/side]

    [side]
        type=General
        description=General Fredrick
        user_description= _ "General Fredrick"
        recruit=Spearman,Bowman,Mage,Cavalryman, Swordsman, Pikeman, Longbowman
        side=7
        canrecruit=yes
        team_name=vilains
        {GOLD 250 300 350}
        {INCOME 15 20 25}
    [/side]

    [side]
        type=General
        description=General Georgy
        user_description= _ "General Georgy"
        recruit=Spearman,Bowman,Mage,Cavalryman, Swordsman, Pikeman, Longbowman
        side=8
        canrecruit=yes
        team_name=vilains
        {GOLD 250 300 350}
        {INCOME 15 20 25}
    [/side]

    [story]
        [part]
            story= _ "Having broken the dwarvish blockade, the horde continued on the mountain pass. Kapou'e began to recognize the lands about them and sure enough, they soon found themselves back in Kapoue's home country."
            background=sotbe.png
        [/part]
    [/story]

    [event]
        name=start

        [role]
            type=Orcish Warlord, Orcish Warrior, Saurian Ambusher, Orcish Grunt, Saurian Skirmisher, Orcish Crossbowman, Orcish Slayer, Orcish Assassin, Orcish Archer
            role=army
        [/role]

        [recall]
            role=army
        [/recall]

        [role]
            type=Orcish Warrior, Saurian Ambusher, Orcish Grunt, Saurian Skirmisher, Orcish Crossbowman, Orcish Slayer, Orcish Assassin, Orcish Archer,Orcish Warlord
            role=army2
        [/role]

        [recall]
            role=army2
        [/recall]

        [role]
            type=Orcish Grunt, Saurian Skirmisher, Orcish Crossbowman, Orcish Slayer, Orcish Assassin, Orcish Archer,Orcish Warlord, Orcish Warrior
            role=army3
        [/role]

        [recall]
            role=army3
        [/recall]

        [role]
            type=Orcish Crossbowman, Orcish Slayer, Orcish Assassin, Orcish Archer, Orcish Warlord, Orcish Warrior, Saurian Ambusher, Orcish Grunt,
            role=army4
        [/role]

        [recall]
            role=army4
        [/recall]

        [unit]
            type=Orcish Warlord
            description="Al'Brock"
            user_description= _ "Al'Brock"
            side=1
            x=3
            y=35
        [/unit]

        [unit]
            type=Orcish Warlord
            description="Flar'Tar"
            user_description= _ "Flar'Tar"
            side=1
            x=5
            y=35
        [/unit]

        {RECALL Grüü}
        {RECALL Inarix}

        {TROLLARMY 1}
        {TROLLARMY 2}
        {TROLLARMY 3}
        {TROLLARMY 4}
        {TROLLARMY 5}
        {TROLLARMY 6}
        {TROLLARMY 7}
        {TROLLARMY 8}
        {TROLLARMY 9}
        {TROLLARMY 10}

        {TROLLRECALL 1}
        {TROLLRECALL 2}
        {TROLLRECALL 3}
        {TROLLRECALL 4}
        {TROLLRECALL 5}
        {TROLLRECALL 6}
        {TROLLRECALL 7}
        {TROLLRECALL 8}
        {TROLLRECALL 9}
        {TROLLRECALL 10}

        [message]
            description="Kapou'e"
            message= _ "Well, look at this boys, we are home. I told you we would return one day."
        [/message]

        [message]
            role=army
            message= _ "Boy, have they ever built this place up."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Hearken, men. Our main objective is to rescue the shamans. It won't work to take the human-worms head-on while they sneak the shamans out the back door."
        [/message]

        [message]
            description="Flar'Tar"
            message= _ "What are you thinking, Chief?"
        [/message]

        [message]
            description="Kapou'e"
            message= _ "My men know the land well. Flar'Tar and Al'Brock, both of you take a scout and circle around to the Northeast and Southeast respectively. Grüü, you take your trolls and circle around to the Northwest. If all goes well we shall surround them."
        [/message]

        [message]
            description=Grüü
            message= _ "I like this plan, Chief!"
        [/message]

        [message]
            role=army
            message= _ "You always like his plans, Grüü."
        [/message]

        [message]
            description=Grüü
            message= _ "Of course. Squash elves, squash undead, squash dwarves, squash humans. Squash them all, Very good plan!"
        [/message]

        [message]
            role=army
            message= _ "Well, he has the right idea, anyway."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Good, everyone move out. I will begin the attack from here. I want everyone to be in position by first watch at the latest. Is that clear?"
        [/message]

        [message]
            description="Flar'Tar"
            message= _ "Yeah, sure."
        [/message]

        [message]
            description="Al'Brock"
            message= _ "Whatever."
        [/message]

        [kill]
            description="Flar'Tar"
        [/kill]

        [kill]
            description="Al'Brock"
        [/kill]

        {TROLLMOVE 1}
        {TROLLMOVE 2}
        {TROLLMOVE 3}
        {TROLLMOVE 4}
        {TROLLMOVE 5}
        {TROLLMOVE 6}
        {TROLLMOVE 7}
        {TROLLMOVE 8}
        {TROLLMOVE 9}
        {TROLLMOVE 10}

        [store_unit]
            [filter]
                description=Grüü
            [/filter]
            variable=moving
            kill=yes
        [/store_unit]

        [set_variable]
            name=moving.side
            value=4
        [/set_variable]
        [set_variable]
            name=moving.x
            value=5
        [/set_variable]
        [set_variable]
            name=moving.y
            value=4
        [/set_variable]
        [set_variable]
            name=moving.canrecruit
            value=1
        [/set_variable]
    [/event]

    [event]
        name=turn 4

        [move_unit_fake]
            type=Orcish Warlord
            x=27,28,28,27,26,25,25
            y=38,37,36,36,35,35,34
        [/move_unit_fake]

        [unit]
            type=Orcish Warlord
            description="Al'Brock"
            user_description= _ "Al'Brock"
            side=2
            canrecruit=yes
            x=25
            y=34
        [/unit]

        [terrain]
            x=24,24,24,25,25,25,26,26,26
            y=33,34,35,33,34,35,33,34,35
            terrain=Ce
        [/terrain]

        [terrain]
            x=25
            y=34
            terrain=Ke
        [/terrain]

        [message]
            description="Al'Brock"
            message= _ "I am in position, Chief."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Excellent. Now, where are the others?"
        [/message]

        [allow_recruit]
            side=2
            type=Wolf Rider, Orcish Grunt, Troll Whelp, Orcish Archer, Orcish Crossbowman, Orcish Warrior
        [/allow_recruit]
    [/event]

    [event]
        name=turn 5

        [move_unit_fake]
            type=Orcish Warlord
            x=30,29,28,27
            y=5,6,5,6
        [/move_unit_fake]

        [unit]
            type=Orcish Warlord
            description="Flar'Tar"
            user_description= _ "Flar'Tar"
            side=3
            canrecruit=yes
            x=27
            y=6
        [/unit]

        [terrain]
            x=27,27,27,26,26,26,28,28,28
            y=5,6,7,5,6,7,5,6,7
            terrain=Ce
        [/terrain]

        [terrain]
            x=27
            y=6
            terrain=Ke
        [/terrain]

        [message]
            description="Flar'Tar"
            message= _ "We made it."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Good, but where is Grüü?"
        [/message]

        [message]
            description="Flar'Tar"
            message= _ "Dumb trolls, you can never rely on them."
        [/message]

        [allow_recruit]
            side=3
            type=Wolf Rider, Orcish Grunt, Troll Whelp, Orcish Archer, Orcish Crossbowman, Orcish Warrior
        [/allow_recruit]
    [/event]

    [event]
        name=turn 7

        [move_unit_fake]
            type=Great Troll
            x=1,2,3,4,5,5
            y=1,1,2,2,3,4
        [/move_unit_fake]

        [unstore_unit]
            variable=moving
            find_vacant=yes
        [/unstore_unit]

        {CLEAR_VARIABLE moving}

        {TROLLARRIVE 1}
        {TROLLARRIVE 2}
        {TROLLARRIVE 3}
        {TROLLARRIVE 4}
        {TROLLARRIVE 5}
        {TROLLARRIVE 6}
        {TROLLARRIVE 7}
        {TROLLARRIVE 8}
        {TROLLARRIVE 9}
        {TROLLARRIVE 10}

        [terrain]
            x=5,5,5,4,4,4,6,6,6
            y=3,4,5,3,4,5,3,4,5
            terrain=Ce
        [/terrain]

        [terrain]
            x=5
            y=4
            terrain=Ke
        [/terrain]

        [message]
            description=Grüü
            message= _ "I'm here, chief!"
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Blood and stone, Grüü! You were supposed to be in position by first watch. It is now dawn!"
        [/message]

        [message]
            description=Grüü
            message= _ "Err, sorry, there were some humans in way. We squash, no problem."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Better late then never. Now it's time to kill! Let nobody escape and everyone keep an eye out for the shamans."
        [/message]

        [message]
            description="Flar'Tar"
            message= _ "Sounds simple enough."
        [/message]

        [allow_recruit]
            side=4
            type=Troll Whelp
        [/allow_recruit]

        [objectives]
            side=4
            [objective]
                description= _ "Defeat All Enemy Leaders."
                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]

    [event]
        name=die

        [filter]
            description=Mkel
        [/filter]

        [message]
            speaker=second_unit
            message= _ "Miserable elf, we want some answers!"
        [/message]

        [message]
            description=Mkel
            message= _ "Ugh!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "SPEAK!"
        [/message]

        [message]
            description=Mkel
            message= _ "....well, what do you want to know?"
        [/message]

        [message]
            speaker=second_unit
            message= _ "You can start by telling us who told you to strike at Borstep."
        [/message]

        [message]
            description=Mkel
            message= _ "Uh.... we have intelligence."
        [/message]

        [message]
            speaker=second_unit
            message= _ "Don't make me hurt you more."
        [/message]

        [message]
            description=Mkel
            message= _ "OK OK, Shan Taum the Smug told us that that's where the shamans were, and that it was a rally point and weapons depot for you orcs."
        [/message]

        [message]
            speaker=second_unit
            message= _ "Pah, do not think you can break the unity of the horde with your stupid lies!"
        [/message]

        [message]
            description=Mkel
            message= _ "No really, it's true. He is jealous of some young upstart called Kapou'e. He says all the shamans 'suck up' to him just because his father had a black eye or something like that."
        [/message]

        [message]
            speaker=second_unit
            message= _ "Refer to Black-Eye Karun with respect, tree-shagger. Now, where are the shamans?"
        [/message]

        [message]
            description=Mkel
            message= _ "They're.... the humans killed them."
        [/message]

        [message]
            speaker=second_unit
            message= _ "You lie!"
        [/message]

        [message]
            description=Mkel
            message= _ "I do not. Their bodies are frozen in the lake just over there."
        [/message]

        [message]
            description="Kapou'e"
            message= _ "You had better go check it out."
        [/message]

        [message]
            speaker=second_unit
            message= _ "OK, Chief."
        [/message]

        [message]
            speaker=narrator
            message= _ "A few minutes later..."
            image=wesnoth-icon.png
        [/message]

        [message]
            speaker=second_unit
            message= _ "Chief! It's true, the shamans have been murdered!"
        [/message]

        [message]
            description="Kapou'e"
            message= _ "WHAT! The human-worms and tree-shaggers have gone too far! BLOOD AND STEEL! I want every human and elf in this area slaughtered! Show no mercy or quarter!"
        [/message]

        [message]
            speaker=second_unit
            message= _ "What should I do with this one?"
        [/message]

        [message]
            description="Kapou'e"
            message= _ "Throw him in the lake. If he freezes to death, all the better."
        [/message]
    [/event]

    [event]
        name=victory

        [store_unit]
            [filter]
                description=Grüü
            [/filter]
            variable=moving2
            kill=yes
        [/store_unit]

        [set_variable]
            name=moving2.side
            value=1
        [/set_variable]
        [set_variable]
            name=moving2.canrecruit
            value=0
        [/set_variable]

        [unstore_unit]
            variable=moving2
        [/unstore_unit]

        {CLEAR_VARIABLE moving2}

        [store_unit]
            [filter]
                side=4
            [/filter]
            variable=changeside
            kill=yes
        [/store_unit]

        {FOREACH changeside i}
        {VARIABLE changeside[$i].side 1}
        [unstore_unit]
            variable=changeside[$i]
        [/unstore_unit]
        {NEXT i}
    [/event]

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