#textdomain wesnoth-thot
[scenario]
    name=_"Forbidden Forest"
    id="09_Forbidden_Forest"
    next_scenario="10_The_Siege_of_Kal_Kartha"
    victory_when_enemies_defeated=no

    map_data="{@campaigns/The_Hammer_of_Thursagan/maps/forbidden_forest.map}"

    {DEFAULT_SCHEDULE}
    {DEFAULT_MUSIC_PLAYLIST}

    {TURNS 40 34 28}	# BALANCE

    [side]
        type="Dwarvish Fighter"
        description="Aiglondur"
        user_description= _ "Aiglondur"
        canrecruit="1"
        side="1"
        controller="human"
        team_name="northern_alliance"
        fog=yes
        shroud=no
        recruit=Dwarvish Fighter,Dwarvish Thunderer,Mage
        {GOLD 150 120 80}	# BALANCE
    [/side]

    {@campaigns/The_Hammer_of_Thursagan/utils/herodeaths.cfg}
    {@campaigns/The_Hammer_of_Thursagan/utils/macros.cfg}

    # Set up the Staff of Righteous Flame.
    # Tell the AIs not to step on it so we don't have to deal
    # with the case where a forest unit picks it up.
#define AVOID_TEMPLE
    [avoid]
        x,y=22,16
    [/avoid]
#enddef
    {OBJ_STAFF_OF_RIGHTEOUS_FLAME 22 16}
    {SET_RIGHTEOUS_FLAME_EVENT}

    [side]
        type="Elvish High Lord"
        description=Telcherion
        user_description= _ "Telcherion"
        side=2
        canrecruit=yes
        controller=ai
        recruit=Elvish Scout,Elvish Rider,Elvish Lord,Elvish Archer,Elvish Ranger
        {GOLD 96 120 144}	# BALANCE
        [ai]
            grouping=offensive
            passive_leader=yes
            recruitment_ignore_bad_movement=yes
            recruitment_ignore_bad_combat=yes
            recruitment_pattern=scout,fighter,mixed fighter,archer
            {AVOID_TEMPLE}
        [/ai]
        team_name=forest
    [/side]

    {STARTING_VILLAGES 2 9}

    [side]
        type="Elvish Lady"
        description=Iluvarda
        user_description= _ "Iluvarda"
        side=3
        canrecruit=yes
        controller=ai
        recruit=Elvish Fighter,Elvish Hero,Elvish Archer,Elvish Ranger,Elvish Sorceress
        {GOLD 96 120 144}	# BALANCE
        [ai]
            grouping=offensive
            passive_leader=yes
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=fighter,archer,mixed fighter,mixed fighter
            {AVOID_TEMPLE}
        [/ai]
        team_name=forest
    [/side]

    {STARTING_VILLAGES 3 9}

    [side]
        type=Ancient Wose
        description=Burumardir-Athelorand
        user_description= _ "Burumardir-Athelorand"
        side=4
        canrecruit=yes
        recruit=Wose,Elder Wose
        {GOLD 90 120 150}	# BALANCE
        {INCOME 10 5 3}		# BALANCE
        [ai]
            {NO_SCOUTS}
            grouping=offensive
            passive_leader=yes
            recruitment_pattern=fighter
            recruitment_ignore_bad_movement=yes
            recruitment_ignore_bad_combat=yes
            {AVOID_TEMPLE}
        [/ai]
        team_name=forest
    [/side]

    [event]
        name="start"
        {PLACE_IMAGE "scenery/signpost.png" 40 17}

        [recall]
            description="Angarthing"
        [/recall]

        [recall]
            description="Ratheln"
        [/recall]

        [recall]
            description="Darchas"
        [/recall]

        [recall]
            description="Lorinne"
        [/recall]

        {CONDITIONAL_MAGE_RECRUITING}

        [delay]
            time=500	# Force pause so unit move won't be optimized away
        [/delay]
        [sound]
            name=horse-canter.wav
        [/sound]
        [move_unit_fake]
            type=Elvish Scout
            side=2
            x=12,11,10, 9, 8, 7, 6
            y=17,18,17,17,16,17,16
        [/move_unit_fake]

        [unit]
            type=Elvish Scout
            description=Elurin
            user_description= _ "Elurin"
            profile=portraits/elurin.png
            side=2
            x,y=5,17
            facing=sw	# Flip Elurin around so he's facing the dwarves.
        [/unit]

        [message]
            speaker="Elurin"
            message=_"Who disturbs our forest?"
        [/message]

        [message]
            speaker="Aiglondur"
            message=_"A delegation of the Northern Alliance, seeking the road through to Kal Kartha."
        [/message]

        [message]
            speaker="Elurin"
            message=_"We allow few outsiders in our forest paths, and no dwarves since the masked ones began to trouble our eastern margins.  No axe-bearers shall come near our trees.  Return whence you came!"
        [/message]

        [message]
            speaker="Aiglondur"
            message=_"No. We have our duty.  We must pass."
        [/message]

        [message]
            speaker="Elurin"
            message=_"You shall not pass here."
        [/message]

        [message]
            speaker="Aiglondur"
            message=_"Winter comes on our heels, and your forest straddles the only gap in these mountains.  You leave us no choice but to fight you."
        [/message]

        [message]
            speaker="Elurin"
            message=_"So be it, then.  Yours will not be the first bones to nourish the earth of our forest."
        [/message]

        [kill]
            description=Elurin
        [/kill]

        [sound]
            name=horse-canter.wav
        [/sound]
        [move_unit_fake]
            type=Elvish Scout
            side=2
            x= 6, 7, 8, 9,10,11,12
            y=16,17,16,17,17,18,17
        [/move_unit_fake]

        [objectives]
            side="1"
            silent="no"
            [objective]
                description=_"Move both Aiglondur and Angarthing to the eastern signpost"
                condition="win"
            [/objective]
            [objective]
                description=_"Death of Aiglondur"
                condition="lose"
            [/objective]
            [objective]
                description=_"Death of Angarthing"
                condition="lose"
            [/objective]
            [objective]
                description=_"Time runs out"
                condition="lose"
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            description=Aiglondur
            x,y=40,17
        [/filter]

        [message]
            description="Aiglondur"
            message=_"Rally on me, everyone.  We have better things to do than brawl with elves."
        [/message]

        [if]
            [variable]
                name=angarthing_passed
                equals=yes
            [/variable]
            [then]
                [endlevel]
                    result=victory
                [/endlevel]
            [/then]
            [else]
                [set_variable]
                    name=aiglondur_passed
                    value=yes
                [/set_variable]
            [/else]
        [/if]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            description=Angarthing
            x,y=40,17
        [/filter]

        [message]
            speaker="Angarthing"
            message=_"Kal Kartha should be only another day's march east of here."
        [/message]

        [if]
            [variable]
                name=aiglondur_passed
                equals=yes
            [/variable]
            [then]
                [endlevel]
                    result=victory
                [/endlevel]
            [/then]
            [else]
                [set_variable]
                    name=angarthing_passed
                    value=yes
                [/set_variable]
            [/else]
        [/if]
    [/event]
[/scenario]
