#textdomain wesnoth-trow
[scenario]
    #The Calgary Flames won game 1 when I started this, and they just won game 3, hence, Fire Wizards
    id=Sewer
    name= _ "Sewer of Southbay"
    next_scenario=Southbay_in_Winter
    victory_when_enemies_defeated=no
    map_data="{campaigns/The_Rise_Of_Wesnoth/maps/Sewer.map}"

    {TURNS 39 36 33}
    {UNDERGROUND}

    {SCENARIO_MUSIC underground.ogg}
    {EXTRA_SCENARIO_MUSIC knalgan_theme.ogg}

    # No story part
    {SEWER_OF_SOUTHBAY_BIGMAP}

    {TROW_DEATHS}

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

    [side]
        type=Arch Mage
        id=Daellyn the Red
        name= _ "Daellyn the Red"
        profile="portraits/archmage.png"
        side=2
        canrecruit=yes
        recruit=Red Mage,Giant Scorpion,Vampire Bat,Blood Bat
        {GOLD 160 220 280}
        {INCOME 4 8 12}
        team_name=wizards
        user_team_name=_"Red Wizards"
        [ai]
            {NO_SCOUTS}
            recruitment_pattern=mixed fighter,fighter,scout,fighter
            aggression=0.75
            recruitment_ignore_bad_movement=yes
            recruitment_ignore_bad_combat=yes
            {ATTACK_DEPTH 4 5 5}
        [/ai]
    [/side]

    [side]
        type=Arch Mage
        id=Tinry the Red
        name= _"Tinry the Red"
        profile="portraits/archmage.png~FL(horiz)"
        side=3
        canrecruit=yes
        recruit=Red Mage,Giant Scorpion,Vampire Bat,Blood Bat
        {GOLD 160 220 280}
        {INCOME 4 8 12}
        team_name=wizards
        user_team_name=_"Red Wizards"
        [ai]
            {NO_SCOUTS}
            recruitment_pattern=mixed fighter,fighter,scout,fighter
            aggression=0.75
            recruitment_ignore_bad_movement=yes
            recruitment_ignore_bad_combat=yes
            {ATTACK_DEPTH 4 5 5}
        [/ai]
    [/side]

    [event]
        name=prestart

        {PLACE_IMAGE (scenery/signpost.png) 1 8}
        {PLACE_IMAGE (scenery/signpost.png) 12 9}
        #{PLACE_IMAGE (misc/foot-left-nw.png) 1 7}

        {PLACE_IMAGE (scenery/rubble.png) 17 15}
        {PLACE_IMAGE (scenery/rubble.png) 18 14}
        {PLACE_IMAGE (scenery/rubble.png) 19 14}

        [recall]
            id=Lady Jessene
        [/recall]
        [recall]
            id=Burin the Lost
        [/recall]
        [recall]
            id=Minister Edren
        [/recall]

        {GUARD_UNIT (Giant Spider) () ( _ "Spider") 2 2 6}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 3 3 5}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 2 24 18}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 3 20 15}
#ifdef NORMAL
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 2 12 7}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 3 16 8}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 2 29 20}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 3 14 8}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 2 2 5}
#endif

#ifdef HARD
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 2 12 7}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 3 16 8}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 2 29 20}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 3 14 8}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 2 2 5}
        {GUARD_UNIT (Giant Scorpion) () ( _ "Scorpion") 3 3 7}
#endif

        [objectives]
            side=1
            [objective]
                description= _ "Prince Haldric exits the sewer"
                condition=win
            [/objective]
            [objective]
                description= _ "Defeat all enemy leaders and Prince Haldric exits the sewer"+"
"+{EARLY_FINISH_BONUS_CAPTION}
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Prince Haldric"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Lady Jessene"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]

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

    [event]
        name=start
        [message]
            speaker=narrator
            message= _ "In the last leg of their journey to Southbay, Haldric and his companions find themselves in the Sewers of Southbay."
            image=wesnoth-icon.png
        [/message]
        [message]
            speaker=Burin the Lost
            message= _ "Only a human could take such a lovely cave and fill it with refuse. Humans. Hey, is that a pair of boots?"
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "We should be cautious down here. This isn't an old maid's drain pipe, this is the sewer of Southbay. It is said that the city diverted an underground river for its own use, and let their own effluent run down the old river bed."
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "This is the far end of that river bed. Legend has it- -"
        [/message]
        [message]
            speaker=Tinry the Red
            message= _ "That a King banished a pair of twin Magi and their devoted followers down here after the Wesfolk war!"
        [/message]
        [message]
            speaker=Daellyn the Red
            message= _ "Can you feel it, brother? This one bears the Ruby of Fire. After all our time searching, it has come to us!"
        [/message]
        [message]
            speaker=Tinry the Red
            message= _ "The brothers Red will finally ascend to power. We must have it. Get them!"
        [/message]
    [/event]

    [event]
        name=time over
        [message]
            speaker=Prince Haldric
            message= _ "Nooo! The wizards are flooding the sewer. We're doomed!"
            image=portraits/haldric-mad.png
        [/message]
    [/event]

    [event]
        name=turn 3
        [message]
            speaker=Lady Jessene
            message= _ "Haldric, I feel a strong foreboding. Have you noticed that anything that happens to be strong in the ways of magic can sense that ruby? Elilmaldur-Rithrandil felt it, and so did Lich-Lord Caror, now these two."
        [/message]

        [message]
            speaker=Prince Haldric
            message= _ "We retrieved the Lich-Lord's book, and I can literally feel the power of the ruby, even with it in my pack. Let's work out what it does, before we decide what to do with it."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            id=Tinry the Red
        [/filter]

        [if]
            [variable]
                name=wiz_dead
                equals=yes
            [/variable]

            [then]
                [message]
                    speaker=second_unit
                    message= _ "Hmm. He seems to have had a map, and some gold!"
                [/message]

                {LOOT 50 1}

                [remove_shroud]
                    side=1
                    x=1-20,21-26,27-30,27-34,25-35,17-25, 9-16, 2- 9, 2- 3, 4- 6,6- 9,
                    y=5- 8, 6- 8, 8-10,11-17,19-22,15-17,15-16,13-18,19-20,11-12,9-10,
                [/remove_shroud]
            [/then]

            [else]
                [set_variable]
                    name=wiz_dead
                    value=yes
                [/set_variable]

                [message]
                    speaker=Daellyn the Red
                    message= _ "Brother!"
                [/message]

                [gold]
                    side=2
                    amount=120
                [/gold]
            [/else]
        [/if]
    [/event]

    [event]
        name=die
        [filter]
            id=Daellyn the Red
        [/filter]

        [if]
            [variable]
                name=wiz_dead
                equals=yes
            [/variable]

            [then]
                [message]
                    speaker=second_unit
                    message= _ "Hmm. He seems to have had a map."
                [/message]

                [remove_shroud]
                    side=1
                    x=1-20,21-26,27-30,27-34,25-35,17-25, 9-16, 2- 9, 2- 3, 4- 6,6- 9,
                    y=5- 8, 6- 8, 8-10,11-17,19-22,15-17,15-16,13-18,19-20,11-12,9-10,
                    #	x=1-35
                    #	y=1-25
                [/remove_shroud]
            [/then]

            [else]
                [set_variable]
                    name=wiz_dead
                    value=yes
                [/set_variable]

                [message]
                    speaker=Tinry the Red
                    message= _ "Brother!"
                [/message]

                [gold]
                    side=3
                    amount=120
                [/gold]
            [/else]
        [/if]
    [/event]

    [event]
        name=moveto
        [filter]
            x=17-22
            y=13-17
            side=1
        [/filter]

        [message]
            speaker=unit
            message= _ "Argh, the stream bed is blocked! Only a pint of goo is getting through. We'll have to go around."
        [/message]
    [/event]

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

        [redraw]
        [/redraw]

        [message]
            speaker=narrator
            message= _ "To Southbay"
            image=scenery/signpost.png
        [/message]

        [allow_undo]
        [/allow_undo]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x=1,1
            y=7,8
        [/filter]
        [if]
            [have_unit]
                id=Prince Haldric
                x=1,1
                y=7,8
            [/have_unit]
            [then]
                [if]
                    [variable]
                        name=wiz_dead
                        equals=yes
                    [/variable]

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

                    [else]
                        [endlevel]
                            bonus=no
                            result=victory
                            {NEW_GOLD_CARRYOVER 40}
                        [/endlevel]
                    [/else]
                [/if]
            [/then]
            [else]
                [message]
                    speaker=narrator
                    message= _ "It's not very Heroic if Prince Haldric isn't the one to lead his band from the Sewers of Southbay."
                    image=wesnoth-icon.png
                [/message]
                [allow_undo]
                [/allow_undo]
            [/else]
        [/if]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=12
            y=9
        [/filter]
        [message]
            speaker=narrator
            message= _ "Danger Ahead!"
            image=wesnoth-icon.png
        [/message]

        [message]
            speaker=unit
            message= _ "Ahead, so far it's been danger everywhere."
        [/message]

        [allow_undo]
        [/allow_undo]
    [/event]

    [event]
        name=victory
        [message]
            speaker=Prince Haldric
            message= _ "Finally, on to Southbay!"
        [/message]

        {CLEAR_VARIABLE wiz_dead}
    [/event]
[/scenario]
