#textdomain wesnoth-utbs

#! -- Creates warning about incoming orcs two turns before they show up
#! -- Creates orcs themselvs on random turnaround turn 8
#! -- Creates die event for orcish boss and reward for killing him
#! -- Internal variables : $orc_warning, $parchment_x, $parchment_y
#define ORC_PARTY
    [event]
        name=new turn
        first_time_only="no"
        {VARIABLE orc_warning $ambush_turn}
        {VARIABLE_OP orc_warning add -2}

        [if]
            [variable]
                name=turn_number
                equals=$orc_warning
            [/variable]
            [then]
                {FREE_UNIT (Desert Scout) (Elven Scout) ( _ "Wounded Elven Scout") 1 1 1}
                [message]
                    description=Elven Scout
                    message=_"Orcs... Not far behind me... From the hills..."
                [/message]
                [kill]
                    description=Elven Scout
                    animate=yes
                    fire_event=no
                [/kill]
            [/then]
        [/if]
        {CLEAR_VARIABLE orc_warning}
    [/event]

    [event]
        name=new turn
        first_time_only="no"
        [if]
            [variable]
                name=turn_number
                numerical_equals=$ambush_turn
            [/variable]
            [then]
                [unit]
#ifdef EASY
                    type=Orcish Leader
#else
                    type=Orcish Ruler
#endif
                    description=Ganthos
                    user_description= _ "Ganthos"
                    upkeep=free
                    canrecruit=yes
                    side=4
                    x=3
                    y=4
                [/unit]
#ifdef HARD
                {FREE_UNIT (Goblin Pillager) (Goblin Raider) ( _ "Goblin Raider") 4 2 4}
                {FREE_UNIT (Goblin Pillager) (Goblin Raider) ( _ "Goblin Raider") 4 3 3}
#else
                {FREE_UNIT (Wolf Rider) (Goblin Raider) ( _ "Goblin Raider") 4 2 4}
                {FREE_UNIT (Wolf Rider) (Goblin Raider) ( _ "Goblin Raider") 4 3 3}
#endif
#ifdef HARD
                {FREE_UNIT (Orcish Crossbowman) (Orc Raider) ( _ "Orc Raider") 4 1 5}
                {FREE_UNIT (Orcish Crossbowman) (Orc Raider) ( _ "Orc Raider") 4 3 2}
#else
                {FREE_UNIT (Orcish Archer) (Orc Raider) ( _ "Orc Raider") 4 1 5}
                {FREE_UNIT (Orcish Archer) (Orc Raider) ( _ "Orc Raider") 4 3 2}
#endif
#ifdef NORMAL
                {FREE_UNIT (Orcish Assassin) (Orc Raider) ( _ "Orc Raider") 4 2 5}
                {FREE_UNIT (Orcish Assassin) (Orc Raider) ( _ "Orc Raider") 4 4 2}
#endif
#ifdef HARD
                {FREE_UNIT (Orcish Slayer) (Orc Raider) ( _ "Orc Raider") 4 2 5}
                {FREE_UNIT (Orcish Slayer) (Orc Raider) ( _ "Orc Raider") 4 4 2}
#endif
#ifdef EASY
                {FREE_UNIT (Orcish Grunt) (Orc Raider) ( _ "Orc Raider") 4 3 6}
                {FREE_UNIT (Orcish Grunt) (Orc Raider) ( _ "Orc Raider") 4 5 3}
#else
                {FREE_UNIT (Orcish Warrior) (Orc Raider) ( _ "Orc Raider") 4 3 6}
                {FREE_UNIT (Orcish Warrior) (Orc Raider) ( _ "Orc Raider") 4 5 3}
#endif
                #give orcs an income, if they ever capture a keep to use it
                [modify_side]
                    side=4
#ifdef EASY
                    income=10
                    gold=75
#endif
#ifdef NORMAL
                    income=15
                    gold=100
#endif
#ifdef HARD
                    income=20
                    gold=125
#endif
                [/modify_side]
                [message]
                    description=Ganthos
                    message= _ "What's this on our borders? Stinkin' elves and more undead? We'll teach them a lesson they won't soon forget. Attack!"
                [/message]
                [message]
                    description=Kaleh
                    message= _ "If those raiders capture any of our encampments, I fear our people's fate will be just as bad as if it was captured by the undead."
                [/message]
                {CLEAR_VARIABLE ambush_turn}
            [/then]
        [/if]
    [/event]

    [event]
        name=die
        [filter]
            description=Ganthos
        [/filter]
        [if]
            [variable]
                name=second_unit.side
                equals=1
            [/variable]
            [then]
                [message]
                    description=Ganthos
                    message=_"You got me elf... But you won't be so lucky with the tribes of the hills... (cough)"
                [/message]
                [message]
                    description=Ganthos
                    message=_"I deeply regret... I won't be able to see that..."
                [/message]
            [/then]
            [else]
                [message]
                    description=Ganthos
                    messsage=_"Killed by a dead creep... (cough)"
                [/message]
            [/else]
        [/if]
        [item]
            x,y=$x1,$y1
            image="items/parchment.png"
        [/item]
        [message]
            description=Nym
            message=_"Look, he dropped something! I wonder what it is..."
        [/message]
        {VARIABLE parchment_x $x1}
        {VARIABLE parchment_y $y1}
        [event]
            name=moveto
            [filter]
                x=$parchment_x
                y=$parchment_y
            [/filter]
            [if]
                [variable]
                    name=unit.side
                    equals=1
                [/variable]
                [then]
                    [message]
                        description=unit
                        message=_"It's some sort of a map. I think I recognize some of those hills ahead on it."
                    [/message]
                    [message]
                        description=Nym
                        message=_"And these look like camps and patrol routes. A lot of camps and patrol routes. Kaleh, do you think we could sneak up between them?"
                    [/message]
                    [message]
                        description=Kaleh
                        message=_"Difficult, but worth a try I guess. But first we must try to survive this mess."
                    [/message]
                    [message]
                        description=Nym
                        message=_"Right, sorry. Damn creeps."
                    [/message]
                    {VARIABLE sneak_up 1}
                [/then]
                [else]
                    [message]
                        description=Nym
                        message=_"And now we'll never know what was on that parchment. Shame."
                    [/message]
                [/else]
            [/if]
            [removeitem]
                x=$parchment_x
                y=$parchment_y
            [/removeitem]
            {CLEAR_VARIABLE parchment_x}
            {CLEAR_VARIABLE parchment_y}
        [/event]
#ifdef EASY
        [if]
            [have_unit]
                race=orc
            [/have_unit]
            [then]
                [message]
                    race=orc
                    message=_"Chief has fallen! Flee!"
                [/message]
            [/then]
            [else]
                [if]
                    [have_unit]
                        race=goblin
                    [/have_unit]
                    [then]
                        [message]
                            race=goblin
                            message=_"Boss dead! Run!"
                        [/message]
                    [/then]
                [/if]
            [/else]
        [/if]
        [kill]
            race=orc,goblin
            animate=no
            fire_event=no
        [/kill]
#endif
    [/event]
#enddef
