#textdomain wesnoth-trow
[scenario]
    id=Cursed_Isle
    name= _ "Cursed Isle"
    map_data="{campaigns/The_Rise_Of_Wesnoth/maps/Cursed_Isle.map}"
    {TURNS 37 34 31}

    {DEFAULT_SCHEDULE}

    next_scenario=Elf_Lords
    victory_when_enemies_defeated=no
    bonus=yes

    [music]
        name="revelation.ogg"
    [/music]
    {VICTORY_AND_DEFEAT_MUSIC}

    {campaigns/The_Rise_Of_Wesnoth/utils/trow-deaths.cfg}

    [story]
        [part]
            background=story/the_great_continent.png
            show_title=yes
            {DOT 315 180}
            {DOT 290 180}
            {DOT 265 180}
            {DOT 240 180}
            {DOT 215 180}
            {DOT 190 180}
            {DOT 165 180}
            {DOT 145 170}
            {DOT 120 170}
            {CROSS 90 166}
        [/part]
    [/story]

    [side]
        type=Noble Commander
        description=Prince Haldric
        user_description= _ "Prince Haldric"
        unrenamable=yes
        side=1
        canrecruit=yes
        controller=human
        team_name=Haldric
        fog=yes
    [/side]

    [side]
        type=Spectre
        description=Isorfilad
        user_description= _ "Isorfilad"
        side=2
        canrecruit=yes
        {GOLD 130 190 250}
        {INCOME 2 4 8}
        team_name=Undead
#ifdef EASY
        recruit=Ghost,Ghoul,Vampire Bat
#else
        recruit=Ghost,Ghoul,Vampire Bat,Shadow,Necrophage
#endif
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            aggression=0.40
            recruitment_pattern=scout,scout,fighter
            {ATTACK_DEPTH 4 5 5}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
        [/ai]
        [ai]
            [protect_location]
                x=13
                y=16
                radius=10
                value=10
            [/protect_location]
        [/ai]
    [/side]

    {STARTING_VILLAGES 2 12}

    [side]
        type=Spectre
        description=Tinoldor
        user_description= _ "Tinoldor"
        side=3
        canrecruit=yes
        {GOLD 130 190 250}
        {INCOME 2 4 8}
        team_name=Undead
#ifdef EASY
        recruit=Ghost,Ghoul,Vampire Bat
#else
        recruit=Ghost,Ghoul,Vampire Bat,Wraith,Necrophage
#endif
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            aggression=0.40
            recruitment_pattern=scout,scout,fighter
            {ATTACK_DEPTH 4 5 5}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
        [/ai]
        [ai]
            [protect_location]
                x=13
                y=16
                radius=10
                value=10
            [/protect_location]
        [/ai]
    [/side]

    {STARTING_VILLAGES 3 12}

    {campaigns/The_Rise_Of_Wesnoth/utils/trow-nlmsg.cfg}

#define TEMP_LOOT X Y
    [event]
        name=moveto
        [filter]
            side=1
            x={X}
            y={Y}
        [/filter]

        {LOOT 50 1}
    [/event]
#enddef

#define TEMP_QUEEN X Y
    [event]
        # wmllint: recognize Lady Jessica
        name=moveto
        [filter]
            side=1
            x={X}
            y={Y}
        [/filter]
        [message]
            speaker=unit
            message= _ "She's... She's beautiful."
        [/message]

        {UNDEAD_INTEL (Vampire Lady) (Midnight Queen) ( _ "Midnight Queen") "unit_image" 2 ({X}) ({Y})}
        # wmllint: recognize Midnight Queen

        {LOYAL_UNDEAD_UNIT 3 (Blood Bat) ({X}) ({Y})}
        {LOYAL_UNDEAD_UNIT 2 (Blood Bat) ({X}) ({Y})}
        {LOYAL_UNDEAD_UNIT 3 (Blood Bat) ({X}) ({Y})}

#ifdef HARD
        {LOYAL_UNDEAD_UNIT 2 (Blood Bat) ({X}) ({Y})}
#endif

        [message]
            description=Midnight Queen
            message= _ "You will be made to serve... Come admire me. Feel my love."
        [/message]
        [message]
            description=Prince Haldric
            message= _ "She is so..."
        [/message]
        [message]
            description=Lady Jessica
            message= _ "Haldric, think with your brain!"
        [/message]
        [message]
            description=Prince Haldric
            message= _ "Get her before she ensorcels us all!"
            image=portraits/haldric-mad.png
        [/message]
        [objectives]
            side=1
            [objective]
                description= _ "Defeat the Vampire Queen"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Prince Haldric"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Lady Jessica"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]
        [set_variable]
            name=queen_awake
            value=1
        [/set_variable]
    [/event]

#enddef

#define TEMP_EMPTY X Y
    [event]
        name=moveto
        [filter]
            side=1
            x={X}
            y={Y}
        [/filter]
        [message]
            speaker=unit
            message= _ "The temple is quite empty."
        [/message]
    [/event]
#enddef

    [event]
        name=prestart

        {PLACE_IMAGE (scenery/temple1.png) 11 13}
        {PLACE_IMAGE (scenery/temple1.png) 10 17}
        {PLACE_IMAGE (scenery/temple1.png) 9 15}

        {OBJ_POTION_HOLY 29 24 (holy_water1)}

        [set_variable]
            name=queen_awake
            value=0
        [/set_variable]
        [recall]
            description=Lady Jessica
        [/recall]

        [recall]
            description=Burin the Lost
        [/recall]

        [recall]
            description=Sir Ruddry
        [/recall]

        [recall]
            description=Sir Ladoc
        [/recall]

        [recall]
            description=Minister Edmond
        [/recall]

        {RANDOM 1..3}
        [if]
            [variable]
                name=random
                numerical_equals=1
            [/variable]
            [then]
                {TEMP_LOOT 11 13}
#ifdef EASY
                {TEMP_LOOT 10 17}
#else
                {TEMP_EMPTY 10 17}
#endif
                {TEMP_QUEEN 9 15}
            [/then]
        [/if]
        [if]
            [variable]
                name=random
                numerical_equals=2
            [/variable]
            [then]
                {TEMP_LOOT 10 17}
#ifdef EASY
                {TEMP_LOOT 9 15}
#else
                {TEMP_EMPTY 9 15}
#endif
                {TEMP_QUEEN 11 13}
            [/then]
        [/if]
        [if]
            [variable]
                name=random
                numerical_equals=3
            [/variable]
            [then]
                {TEMP_LOOT 9 15}
#ifdef EASY
                {TEMP_LOOT 11 13}
#else
                {TEMP_EMPTY 11 13}
#endif
                {TEMP_QUEEN 10 17}
            [/then]
        [/if]

        {CLEAR_VARIABLE random}

#ifdef EASY
        {OBJ_POTION_HOLY 28 26 (holy_water2)}
#endif

        [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 Jessica"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=start
        [message]
            speaker=narrator
            message= _ "After a short trip by sea, Haldric arrives on the elves' cursed Isle of Tears. A fog hangs in the air."
            image=wesnoth-icon.png
        [/message]

        [message]
            description=Burin the Lost
            message= _ "I said no more ships. Double crossing humans! Ahh, I've been with you this far. Who'd have thought, a nautical dwarf."
        [/message]

        [message]
            description=Prince Haldric
            message= _ "I expect we'll be facing more undead. Be careful."
        [/message]

        [message]
            description=Lady Jessica
            message= _ "These will be the long dead. Not like the undead that my people used, and they are elf-dead. Be careful indeed."
        [/message]

        [message]
            description=Minister Edmond
            message= _ "All soldiers of darkness will meet the same fate by my hand."
        [/message]
    [/event]

    [event]
        name=victory
        [message]
            description=Prince Haldric
            message= _ "Those elves are finally at rest. I hope that the curses they laid upon us hold no weight."
        [/message]

        [message]
            description=Lady Jessica
            message= _ "Haldric, you're too paranoid."
        [/message]

        {VARIABLE_OP num_done add 1}

        [set_variable]
            name=cursed_isle
            value=1
        [/set_variable]

        [set_variable]
            name=last_done
            value="Isle"
        [/set_variable]
    [/event]

    [event]
        name=die
        [filter]
            description=Isorfilad
        [/filter]
        [message]
            description=Isorfilad
            message= _ "A curse upon all of your kin that visit this isle."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            description=Tinoldor
        [/filter]
        [message]
            description=Tinoldor
            message= _ "I wish a blight upon you and yours. May you never see peace."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            description=Midnight Queen
        [/filter]
        [message]
            description=Midnight Queen
            message= _ "My soul will haunt this place until the end of time! A curse upon you!"
        [/message]
        [set_variable]
            name=queen_awake
            value=0
        [/set_variable]
        [message]
            description=Prince Haldric
            message= _ "Without their queen the undead are simply fading away!"
        [/message]
        [endlevel]
            result=victory
            bonus=yes
            {CLEAR_VARIABLE queen_awake}
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            team=Undead
        [/filter]
        [filter_second]
            description=Minister Edmond
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "Back, back to the grave with you!"
        [/message]
    [/event]

    [event]
        name=enemies defeated
        [if]
            [variable]
                name=queen_awake
                numerical_equals=1
            [/variable]
            [then]
                [message]
                    description=Lady Jessica
                    message= _ "We still have to defeat that vampire queen!"
                [/message]
                [objectives]
                    side=1
                    [objective]
                        description= _ "Defeat the Vampire Queen"
                        condition=win
                    [/objective]
                    [objective]
                        description= _ "Death of Prince Haldric"
                        condition=lose
                    [/objective]
                    [objective]
                        description= _ "Death of Lady Jessica"
                        condition=lose
                    [/objective]
                    [objective]
                        description= _ "Turns run out"
                        condition=lose
                    [/objective]
                [/objectives]
            [/then]
            [else]
                [endlevel]
                    result=victory
                    bonus=yes
                    {CLEAR_VARIABLE queen_awake}
                [/endlevel]
            [/else]
        [/if]
    [/event]

    [event]
        name=time over
        [message]
            description=Prince Haldric
            message= _ "No! The ship that was supposed to pick us up sees that there's still fighting. It's not stopping. We're trapped."
        [/message]
    [/event]
[/scenario]
