#textdomain wesnoth-Saving_Elensefar

[scenario]
    id=sea_voyage_fake2
    next_scenario=sea_voyage_04
    name= _ "Return to Elensefar"
    map_data="{~add-ons/Saving_Elensefar/maps/05-The_High_Seas.map}"
    theme=Cutscene_Minimal
    victory_when_enemies_defeated=no
    turns=-1

    {AFTERNOON}

    [lua]
        code = << wesnoth.dofile("~add-ons/Saving_Elensefar/utils/wml-tags.lua") >>
    [/lua]

    [story]
        [part]
            story= _ "And so Meneldur helped the Wesfolk build ships. They built three sturdy galleons, which was enough to hold all of them. That is how few of that once great race remained."
            background=data/campaigns/The_Rise_Of_Wesnoth/images/story/trow_intro_03.jpg
        [/part]
        [part]
            story= _ "The necromancers who were on the ships cast a spell of darkness and swiftness over the boat. The next thing Meneldur and his men knew, they had reached the delta of the Great River, where Elensefar was built."
            background=data/campaigns/The_Rise_Of_Wesnoth/images/story/trow_intro_03.jpg
        [/part]
    [/story]

    [side]
        side=1
        [leader]
            {MENELDUR}
            x,y=56,6
        [/leader]

        {HUMAN_SIDE}

        shroud=yes
    [/side]

    [event]
        name=prestart

        {CUE_ELVES}

        # update shroud data
        [set_shroud]
            side=1
            shroud_data=$shroud
        [/set_shroud]

        [foreach]
            array=islands
            [do]
                [switch]
                    variable=this_item.status
                    [case]
                        value=played
                        [capture_village]
                            side=1
                            x,y=$this_item.x,$this_item.y
                        [/capture_village]
                    [/case]
                    [case]
                        value=locked
                        [terrain]
                            x,y=$this_item.x,$this_item.y
                            terrain=Mv
                        [/terrain]
                    [/case]
                [/switch]
            [/do]
        [/foreach]

        [foreach]
            array=sunkenships
            [do]
                [item]
                    x,y=$this_item.x,$this_item.y
                    image="scenery/wreck.png"
                [/item]
            [/do]
        [/foreach]

        [item]
            x,y=57,3
            image="scenery/shipwreck-1.png"
        [/item]
        [item]
            x,y=52,9
            image="scenery/wreck-2.png"
        [/item]

        [redraw]
            side=1
        [/redraw]

        [hide_unit]
            side=1
        [/hide_unit]
    [/event]

    [event]
        name=side turn

        [scroll_to]
            x,y=7,13
        [/scroll_to]

        [move_unit_fake]
            x=7,56
            y=13,6
            side=1
            type=Black Galleon
        [/move_unit_fake]

        {SHIP_AND_DOCK 56 6}

        [delay]
            time=500
        [/delay]

        [unhide_unit]
        [/unhide_unit]

        {MOVE_UNIT (id=Meneldur) 58 6}
        [recall]
            id=Madru
            x,y=58,6
        [/recall]
        [recall]
            id="Black the Red"
            x,y=58,6
        [/recall]
        [recall]
            id=Ah-Reblak
            x,y=58,6
        [/recall]

        {SCROLL_TO 58 6}

        [delay]
            time=500
        [/delay]

        [message]
            id=Meneldur
            message= _ "Well, now we are near the port of Elensefar... It is time to retake Elensefar, as we aided Blackmore. So... does anyone have an idea as to how to attack the city?"
        [/message]

        [delay]
            time=500
        [/delay]

        [message]
            id="Black the Red"
            caption= _"Black the Red's Idea"
            message= _ "Here; this is my plan. On the northern side of the river, there is a cave where smugglers hide their goods. I know some bandits who won't alert anyone if we land there."
            image="story/saving_elensefar_1.jpg"
        [/message]

        [message]
            id=Meneldur
            message= _ "But they won't help us?"
        [/message]

        [message]
            id="Black the Red"
            message= _ "Uhm... no, probably not. But we would be rather secretive, they probably wouldn't notice us."
        [/message]

        [message]
            id=Meneldur
            message= _ "Madru, do you have any suggestions?"
        [/message]

        [message]
            id=Madru
            caption= _"Madru’s Suggestion"
            message= _ "Well, we could always land on the south beach. There is a harbor there, and a quick route from there to inside the city."
            image="story/saving_elensefar_2.jpg"
        [/message]

        [message]
            id=Meneldur
            message= _ "But won't they see us there?"
        [/message]

        [message]
            id=Madru
            message= _ "Yes, but what's wrong with a head on battle? I think we could defeat them."
        [/message]

        [message]
            id=Meneldur
            caption= _"Meneldur’s Plan"
            message= _ "Well, I think maybe we should land right in Elensefar itself. That way, we can go around most of the orcish defenses, which are probably guarding the bridges to the city."
            image="story/saving_elensefar_3.jpg"
        [/message]

        [message]
            id=Madru
            message= _ "That is a bold plan, but I'm not sure it will work. If you do not succeed immediately, you will have alerted the orcs to our presence without accomplishing anything."
        [/message]

        [delay]
            time=500
        [/delay]

        [message]
            id=Meneldur
            caption= _"A choice must be made"
            image="story/saving_elensefar_4.jpg"
            message= _ "Hm... you are right there. Which plan should we use?"
            [option]
                label= _ "I say we head north, as you proposed."
                [command]
                    {VARIABLE whichwaytogo north}
                [/command]
            [/option]
            [option]
                label= _ "Madru's plan to head south sounds the best."
                [command]
                    {VARIABLE whichwaytogo south}
                [/command]
            [/option]
            [option]
                label= _ "Both of your plans were good, but I will stick to my own, and land in the harbor."
                [command]
                    {VARIABLE whichwaytogo harbour}
                [/command]
            [/option]
        [/message]

        [delay]
            time=200
        [/delay]

        [message]
            id=Madru
            message= _"Very well. Get some rest. We'll sail tonight and attack at dawn."
        [/message]

        {SE_ENDLEVEL_CONTINUE_NO_SAVE}
    [/event]
[/scenario]
