#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}
    {TURNS 40 34 28}	# BALANCE

    {SCENARIO_MUSIC "elvish-theme.ogg"}	# No story part
    {EXTRA_SCENARIO_MUSIC "traveling_minstrels.ogg"}
    {EXTRA_SCENARIO_MUSIC "frantic.ogg"}

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

    [side]
        type="Dwarvish Fighter"
        id="Aiglondur"
        name= _ "Aiglondur"
        canrecruit="1"
        side="1"
        controller="human"
        team_name="northern_alliance"
        user_team_name=_"Alliance"
        {FLAG_VARIANT knalgan}
        fog=yes
        shroud=no
        recruit="Dwarvish Fighter,Dwarvish Thunderer"
        {GOLD 150 120 80}	# BALANCE
    [/side]

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

    # This tells the elves not to venture onto the plains
#define AVOID_LEAVING_FOREST
    [avoid]
        x,y=3-4,6
    [/avoid]
    [avoid]
        x,y=3-4,7
    [/avoid]
    [avoid]
        x,y=1-3,8-9
    [/avoid]
    [avoid]
        x,y=1-5,10-11
    [/avoid]
    [avoid]
        x,y=1-2,12-14
    [/avoid]
    [avoid]
        x,y=1-3,15
    [/avoid]
    [avoid]
        x,y=1-4,16-18
    [/avoid]
    [avoid]
        x,y=1-3,19-21
    [/avoid]
    [avoid]
        x,y=1-2,22-23
    [/avoid]
    [avoid]
        x,y=1,24
    [/avoid]
    [avoid]
        x,y=1-2,25-27
    [/avoid]
    [avoid]
        x,y=1-2,32-33
    [/avoid]

    [avoid]
        x,y=35-40,1
    [/avoid]
    [avoid]
        x,y=36-40,2
    [/avoid]
    [avoid]
        x,y=39-40,3-4
    [/avoid]
    [avoid]
        x,y=40,5-6
    [/avoid]
    [avoid]
        x,y=39-40,7-10
    [/avoid]
    [avoid]
        x,y=40,11-12
    [/avoid]
    [avoid]
        x,y=39-40,13
    [/avoid]
    [avoid]
        x,y=38-40,14
    [/avoid]
    [avoid]
        x,y=39-40,15-19
    [/avoid]
#enddef
    # 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"
        id=Telcherion
        name= _ "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}
            {AVOID_LEAVING_FOREST}
        [/ai]
        team_name=forest
        user_team_name=_"Forest"
    [/side]

    {STARTING_VILLAGES 2 9}

    [side]
        type="Elvish Enchantress"
        id=Iluvarda
        name= _ "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}
            {AVOID_LEAVING_FOREST}
        [/ai]
        team_name=forest
        user_team_name=_"Forest"
    [/side]

    {STARTING_VILLAGES 3 9}

    [side]
        type=Ancient Wose
        id=Burumardir-Athelorand
        name= _ "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
        user_team_name=_"Forest"
    [/side]

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

        [recall]
            id="Angarthing"
        [/recall]

        [recall]
            id="Ratheln"
        [/recall]

        [recall]
            id="Darchas"
        [/recall]

        [recall]
            id="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
            id=Elurin
            name= _ "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]
            id=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]

            note={EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
        [/objectives]
    [/event]

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

        [message]
            speaker="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
                    bonus=yes
                    {NEW_GOLD_CARRYOVER 40}
                [/endlevel]
            [/then]
            [else]
                [set_variable]
                    name=aiglondur_passed
                    value=yes
                [/set_variable]
            [/else]
        [/if]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            id=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
                    bonus=yes
                    {NEW_GOLD_CARRYOVER 40}
                [/endlevel]
            [/then]
            [else]
                [set_variable]
                    name=angarthing_passed
                    value=yes
                [/set_variable]
            [/else]
        [/if]
    [/event]
[/scenario]
