#textdomain wesnoth-trow
[scenario]
    id=20_Return_of_the_Fleet
    name= _ "Return of the Fleet"
    next_scenario=21_The_Plan
    bonus=yes
    map_data="{campaigns/The_Rise_Of_Wesnoth/maps/20_Return_of_the_Fleet.map}"

    {TURNS 45 42 39}
    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC vengeful.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}
    {EXTRA_SCENARIO_MUSIC loyalists.ogg}
    {EXTRA_SCENARIO_MUSIC northerners.ogg}

    # No story
    {RETURN_OF_THE_FLEET_BIGMAP}

    {TROW_DEATHS}

    [side]
        id=Prince Haldric
        name= _ "Prince Haldric"
        side=1
        type=Noble Commander
        unrenamable=yes
        canrecruit=yes
        gold=200
        controller=human
        team_name=Haldric
        user_team_name=_"Refugees"
        {FLAG_VARIANT loyalist}
    [/side]

    {STARTING_VILLAGES 1 5}

    [side]
        type=Draug
        id=General Heravan
        name= _ "General Heravan"
        side=2
        canrecruit=yes
        {GOLD 130 170 210}
        team_name=orcs
        user_team_name=_"Orcs"
#ifdef EASY
        recruit=Skeleton,Skeleton Archer, Vampire Bat
#endif

#ifdef NORMAL
        recruit=Revenant,Deathblade,Bone Shooter,Skeleton,Skeleton Archer, Vampire Bat
#endif

#ifdef HARD
        recruit=Revenant,Deathblade,Bone Shooter,Skeleton,Skeleton Archer, Vampire Bat, Chocobone
#endif

        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            passive_leader=yes
            recruitment_pattern=scout,fighter,archer
            aggression=0.4
            {ATTACK_DEPTH 5 5 6}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.7
        [/ai]
        {INCOME 2 4 8}
    [/side]

    {STARTING_VILLAGES 2 10}

    [side]
        type=Orcish Warlord
        id=Tan-Halg
        name= _ "Tan-Halg"
        side=3
        canrecruit=yes
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Troll Whelp, Goblin Spearman
#endif

#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Orcish Warrior, Troll Whelp, Troll, Troll Rocklobber, Goblin Spearman
#endif

#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Troll Whelp, Troll, Troll Warrior, Troll Rocklobber, Goblin Spearman, Goblin Impaler
#endif
        {GOLD 170 210 250}
        team_name=orcs
        user_team_name=_"Orcs"
        [ai]
            #{NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
            {ATTACK_DEPTH 5 5 6}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
        {INCOME 2 4 8}
    [/side]

    {STARTING_VILLAGES 3 10}

    [side]
        type=Orcish Warlord
        id=Tan-Rinak
        name= _ "Tan-Rinak"
        profile=portraits/orcs/transparent/grunt.png
        side=4
        canrecruit=yes
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Troll Whelp, Goblin Spearman
#endif

#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Orcish Warrior, Troll Whelp, Troll, Troll Rocklobber, Goblin Spearman
#endif

#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Troll Whelp, Troll, Troll Warrior, Troll Rocklobber, Goblin Spearman, Goblin Impaler
#endif
        {GOLD 170 210 250}
        team_name=orcs
        user_team_name=_"Orcs"
        [ai]
            #{NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=scout,fighter,fighter,mixed fighter,archer
            {ATTACK_DEPTH 5 5 6}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
        {INCOME 2 4 8}
    [/side]

    {STARTING_VILLAGES 4 10}

    {ANIMATED_CAMPFIRE 8 8}
    {ANIMATED_CAMPFIRE 10 2}
    {ANIMATED_CAMPFIRE 17 8}
    {ANIMATED_CAMPFIRE 39 6}
    {ANIMATED_CAMPFIRE 29 8}
    {ANIMATED_CAMPFIRE 26 11}

    [event]
        name=prestart

        {PLACE_IMAGE ("units/transport/transport-galleon.png~RC(magenta>red)") 10 27}
        {PLACE_IMAGE ("units/transport/transport-galleon.png~RC(magenta>red)") 7 30}
        {PLACE_IMAGE ("units/transport/transport-galleon.png~RC(magenta>red)") 6 33}
        {PLACE_IMAGE ("units/transport/transport-galleon.png~RC(magenta>red)") 5 36}

        {PLACE_IMAGE (scenery/signpost.png) 10 34}

        [recall]
            id=Burin the Lost
        [/recall]
        [recall]
            id=Sir Ruddry
        [/recall]
        [recall]
            id=Sir Ladoc
        [/recall]
        [recall]
            id=Minister Edren
        [/recall]
        [recall]
            id=Commander Aethyr
        [/recall]

        [objectives]
            side=1
            [objective]
                description= _ "Defeat all enemy leaders"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Prince Haldric"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Lady Jessene"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Aethyr"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]
    [/event]

    [event]
        name=start
        [message]
            speaker=narrator
            message= _ "Haldric reaches the site where the fleet is due to return. Several ships have already docked. The orcs are on the frontier."
            image=wesnoth-icon.png
        [/message]
        [message]
            speaker=Commander Aethyr
            message= _ "Sir, some ships have landed... They look like they’ve been damaged by the voyage. Hmm, it seems that most of the ships are staying at sea."
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "They’ve undoubtedly spotted the smoke from the orcish fires. We have to defeat these monsters before everybody starves at sea, or before Jevyan launches an attack with his fleet."
            image=portraits/haldric-annoyed.png
        [/message]
        [message]
            speaker=Commander Aethyr
            message= _ "Yes sir! The rest of the refugees have fled south, to our initial landing site. But if we fail here they’ll doubtless be slaughtered."
        [/message]
        [message]
            speaker=Burin the Lost
            message= _ "Well, that settles it. Enough talking, time to fight!"
        [/message]
        [message]
            speaker=Commander Aethyr
            message= _ "For the glory of the men of the Green Isle!"
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "No, for the glory of all of the people of the west-north! Charge!"
            image=portraits/haldric-mad.png
        [/message]
        [message]
            speaker=Tan-Rinak
            message= _ "Bah! Puny human-worm, we will stomp you under our heels!"
        [/message]
        [message]
            speaker=General Heravan
            message= _ "—And raise your dead to serve us forever!"
        [/message]
    [/event]

    [event]
        name=turn 5

        [move_unit_fake]
            type=Familiar
            side=2
            x=29,28,28
            y=1,1,2
        [/move_unit_fake]

        {LIVING_INTEL (Familiar) (Familiar) ( _ "Familiar") "portraits/familiar.png" 2 28 2}
        # wmllint: recognize Familiar

        [move_unit_fake]
            type=Ancient Lich
            side=2
            x=25,25,25
            y=1,2,2
        [/move_unit_fake]

        {UNDEAD_INTEL (Ancient Lich) (Lich-Lord Jevyan) ( _ "Lich-Lord Jevyan") "portraits/jevyan.png" 2 25 2}
        # wmllint: recognize Lich-Lord Jevyan

        [message]
            speaker=Lich-Lord Jevyan
            message= _ "Give up, boy! You can’t defeat me— Hmm, what’s this? You’ve learned to conceal the power of the Ruby of Fire. It makes little difference, your undead corpse will lay it at my feet."
        [/message]
        [message]
            speaker=Prince Haldric
            # wmllint: local spelling un-life
            message= _ "We’ll see about that. The Fool Prince of Southbay was wrong to start this war, but you’re the real monster! You sacrificed your own people to preserve your immortal un-life."
            image=portraits/haldric-mad.png
        [/message]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "Enough of this. A curse of darkness upon you, young prince."
        [/message]

        [kill]
            id=Lich-Lord Jevyan
        [/kill]

        [move_unit_fake]
            type=Ancient Lich
            side=2
            x=25,25,25
            y=2,2,1
        [/move_unit_fake]

        {LOYAL_UNDEAD_UNIT 4 (Chocobone) 1 18}
        {LOYAL_UNDEAD_UNIT 4 (Chocobone) 1 19}
        {LOYAL_UNDEAD_UNIT 4 (Chocobone) 1 20}
#ifdef NORMAL
        {LOYAL_UNDEAD_UNIT 3 (Chocobone) 1 21}
#endif

#ifdef HARD
        {LOYAL_UNDEAD_UNIT 3 (Chocobone) 1 21}
        {LOYAL_UNDEAD_UNIT 3 (Chocobone) 1 22}
#endif

        [message]
            speaker=Familiar
            message= _ "<i>Clack</i>! <i>Clack!</i>"
        [/message]

        [kill]
            id=Familiar
        [/kill]

        [move_unit_fake]
            type=Familiar
            side=2
            x=28,28,29
            y=2,1,1
        [/move_unit_fake]

        [modify_side]
            side=1
            fog=yes
        [/modify_side]

        [redraw]
            side=1
        [/redraw]

        [scroll_to_unit]
            id=Prince Haldric
        [/scroll_to_unit]
    [/event]

    [event]
        name=time over
        [message]
            speaker=Commander Aethyr
            message= _ "I see masts on the horizon. Jevyan’s fleet is here! It’s all over."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=10
            y=34
        [/filter]

        [redraw]
        [/redraw]

        [message]
            speaker=narrator
            message= _ "Please Disembark in an Orderly Fashion and Proceed South"
            image=scenery/signpost.png
        [/message]
        [message]
            speaker=unit
            message= _ "Hmm, they left off the ‘or the orcs will eat you’ part."
        [/message]

        [allow_undo]
        [/allow_undo]
    [/event]

    [event]
        name=turn 7

        [move_unit_fake]
            type=$jessica_store.type
            side=1
            x=16,15,14,14
            y=40,40,39,38
        [/move_unit_fake]

        [unstore_unit]
            variable=jessica_store
            find_vacant=yes
            x,y=14,38
        [/unstore_unit]

        {CLEAR_VARIABLE jessica_store}
        # wmllint: recognize Lady Jessene

        [message]
            speaker=Lady Jessene
            message= _ "I’m back, things went well! Haldric, I sure hope you know what you’re doing."
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "Umm, we’ll talk about it later. I’m just a little busy at the moment. I’m glad you made it back in one piece."
        [/message]
        [message]
            speaker=Lady Jessene
            message= _ "Yes, it looks like you could use all of the help you can get."
        [/message]
    [/event]

    [event]
        name=enemies defeated
        [message]
            speaker=Prince Haldric
            message= _ "We’ve defeated Jevyan’s forces. The ships must disembark their passengers quickly—"
        [/message]
        [message]
            speaker=Lady Jessene
            message= _ "Haldric, what’s going on? What’s the plan?"
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "We’re going to confront Jevyan and destroy him."
        [/message]
        [message]
            speaker=Lady Jessene
            message= _ "That will be easier said than done. Even if we defeat him, the other Lich-Lords will follow. It’s because of that ruby. If I were paranoid I’d say that our dear old ‘tree-friend’ might have known as much."
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "We should discuss this in private. Here, come with me."
        [/message]

        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    [event]
        name=moveto

        [filter]
            side=1

            [filter_location]
                x,y=11,17
                radius=10
            [/filter_location]
        [/filter]

        #No campaign is complete without a cuttlefish
        {LOYAL_UNIT 3 (Cuttle Fish) 11 17}
#ifdef NORMAL
        {LOYAL_UNIT 3 (Cuttle Fish) 11 18}
#endif

#ifdef HARD
        {LOYAL_UNIT 3 (Cuttle Fish) 11 18}
        {LOYAL_UNIT 3 (Cuttle Fish) 12 16}
#endif

        {CLEAR_FOG 1 12 17 2}

        [message]
            type=Cuttle Fish
            message= _ "<i>Slurp, click, click, click!</i>"
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "I don’t know what that is, but it doesn’t sound friendly."
        [/message]

        {UNCLEAR_FOG}
    [/event]

    [event]
        name=moveto

        [filter]
            side=1

            [filter_location]
                x,y=34,15
                radius=10
            [/filter_location]
        [/filter]

        # wmllint: recognize Flixta
        {NAMED_LOYAL_UNIT 4 (Saurian Flanker) 34 14 (Flixta) ( _ "Flixta")}
        {LOYAL_UNIT 4 (Saurian Oracle) 34 16}
        {LOYAL_UNIT 4 (Saurian Soothsayer) 33 16}
#ifdef NORMAL
        {LOYAL_UNIT 4 (Saurian Skirmisher) 35 15}
        {LOYAL_UNIT 4 (Saurian Skirmisher) 33 15}
#endif

#ifdef HARD
        {LOYAL_UNIT 4 (Saurian Skirmisher) 35 15}
        {LOYAL_UNIT 4 (Saurian Skirmisher) 34 16}
        {LOYAL_UNIT 4 (Saurian Skirmisher) 33 15}
#endif

        {CLEAR_FOG 1 34 15 2}

        [message]
            speaker=Flixta
            message= _ "You again! You will sssuffer for your attack against my people! Shek’kahan, our Naga friendsss— You’ll pay! We have new friends now."   # wmllint: no spellcheck
        [/message]

        {UNCLEAR_FOG}

        [allow_recruit]
            type=Saurian Skirmisher
            side=3,4
        [/allow_recruit]

#ifdef HARD
        [allow_recruit]
            type=Saurian Skirmisher,Saurian Ambusher
            side=3,4
        [/allow_recruit]
#endif
    [/event]

    [event]
        name=last breath

        [filter]
            id=Commander Aethyr
        [/filter]

        [message]
            speaker=Commander Aethyr
            message= _ "Oh, to join my family again! Do not mourn my passing."
        [/message]

        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Tan-Halg
        [/filter]

        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=Tan-Halg
            message= _ "My people are like a rock slide, you can run, but we will crush you... Ahhck!"
        [/message]

        [gold]
            side=4
            amount=80
        [/gold]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Tan-Rinak
        [/filter]

        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=Tan-Rinak
            message= _ "I— I die?"
        [/message]

        [gold]
            side=3
            amount=80
        [/gold]
    [/event]
[/scenario]
