#textdomain wesnoth-Genesis
[scenario]
    id=04d_Black_Cauldron
    name= _ "Black Cauldron"
    map_data="{~add-ons/Genesis/episode1/maps/04d_Black_Cauldron.map}"
    next_scenario=03_Northlands
    victory_when_enemies_defeated=no
    turns=6
    {UNDERGROUND}
    {STORYTXT_BLACK_CAULDRON}

    {FAE_DEATHS}
    {SCENARIO_MUSIC underground.ogg}
    {EXTRA_SCENARIO_MUSIC siege_of_laurelmor.ogg}
    {EXTRA_SCENARIO_MUSIC knalgan_theme.ogg}
    {EXTRA_SCENARIO_MUSIC waves.ogg}
    {EXTRA_SCENARIO_MUSIC the_dangerous_symphony.ogg}

    [side]
        {PLAYER_FAE}
        side=1
        recruit=
        {GOLD 200 170 100}
        {INCOME 6 5 4}
        fog=yes
        shroud=yes
    [/side]
    [side]
        {ETHEA_ENEMY_SIDE}
        {AGGRESSIVE_SIDE}
        side=2
        type=Demon Stromguarde
        id=boss
        canrecruit=yes
    [/side]
    {STARTING_VILLAGES 2 6}
    [side]
        {ETHEA_ENEMY_SIDE}
        {AGGRESSIVE_SIDE}
        side=3
        no_leader=yes
    [/side]
    [side]
        side=4
        no_leader=yes
        {SPIRIT_ENEMY_SIDE}
        {AGGRESSIVE_SIDE}
    [/side]
    [side]
        side=5
        no_leader=yes
        controller=ai
        team_name=spirits
        hidden=yes
        color=black
        {AGGRESSIVE_SIDE}
    [/side]

    {PLACE_IMAGE items/bones.png 52 35}

#define GENERATE_FUNGUS
    [store_locations]
        variable=cave_hex
        terrain=Uu
        [filter_adjacent_location]
            terrain=Xu,Xuc,Xue,Xuce
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=cave_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..6
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hex[$i].x,$cave_hex[$i].y
                        terrain=Uu^Uf
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hex}
    [store_locations]
        variable=cave_hex
        terrain=Uu
    [/store_locations]
    [for]
        array=cave_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..15
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hex[$i].x,$cave_hex[$i].y
                        terrain=Uu^Uf
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hex}

    # we can do this for cave hills too, for a bit of visual variety
    [store_locations]
        variable=cave_hill_hex
        terrain=Uh
        [filter_adjacent_location]
            terrain=Xu,Xuc,Xue,Xuce
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=cave_hill_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..5
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hill_hex[$i].x,$cave_hill_hex[$i].y
                        terrain=Uh^Uf
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hill_hex}
    [store_locations]
        variable=cave_hill_hex
        terrain=Uh
        [filter_adjacent_location]
            terrain=Uu^Uf
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=cave_hill_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..2
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hill_hex[$i].x,$cave_hill_hex[$i].y
                        terrain=Uh^Uf
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hill_hex}
#enddef

#define GENERATE_CAVE_HILL
    [store_locations]
        variable=cave_hex
        terrain=Uu
        [filter_adjacent_location]
            terrain=Xu,Xuc,Xue,Xuce
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=cave_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..5
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hex[$i].x,$cave_hex[$i].y
                        terrain=Uh
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hex}
    [store_locations]
        variable=cave_hex
        terrain=Uu
        [not]
            [filter_adjacent_location]
                terrain=Xu,Xuc,Xue,Xuce,Wwg
            [/filter_adjacent_location]
        [/not]
    [/store_locations]
    [for]
        array=cave_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..15
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hex[$i].x,$cave_hex[$i].y
                        terrain=Uh
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hex}
    [store_locations]
        variable=cave_hex
        terrain=Uu
        [filter_adjacent_location]
            terrain=Wwg
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=cave_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..30
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hex[$i].x,$cave_hex[$i].y
                        terrain=Uh
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hex}
#enddef

#define GENERATE_CAVE_PATH
    [store_locations]
        variable=cave_hex
        terrain=Uu
        [not]
            [filter_adjacent_location]
                terrain=Ur
            [/filter_adjacent_location]
        [/not]
    [/store_locations]
    [for]
        array=cave_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..10
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hex[$i].x,$cave_hex[$i].y
                        terrain=Ur
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hex}
    [store_locations]
        variable=cave_hex
        terrain=Uu
        [filter_adjacent_location]
            terrain=Ur
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=cave_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..2
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_hex[$i].x,$cave_hex[$i].y
                        terrain=Ur
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_hex}
#enddef

    # ghost spawns

    {RESPAWN_POINT ("Ghost") 4 4 12 12}
    {RESPAWN_POINT ("Ghost") 4 20 12 12}
    {RESPAWN_POINT ("Ghost") 4 26 15 12}
    {RESPAWN_POINT ("Ghost") 4 15 13 12}
    {RESPAWN_POINT ("Ghost") 4 21 19 12}
    {RESPAWN_POINT ("Ghost") 4 5 15 12}
    {RESPAWN_POINT ("Ghost") 4 4 20 12}
    {RESPAWN_POINT ("Ghost") 4 12 10 12}

    #ifdef HARD
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 52 21 18}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 47 19 18}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 40 15 18}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 40 20 18}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 44 21 18}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 45 23 18}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 43 24 18}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 50 18 18}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 41 16 18}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 51 15 32}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 53 15 32}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 44 14 32}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 42 14 32}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 56 18 32}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 48 16 32}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 49 17 32}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 55 18 32}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 54 58 14 17 28}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 46 50 12 16 28}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 57 61 14 19 28}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 38 40 21 23 28}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 42 45 24 25 28}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 37 39 25 27 28}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 56 60 9 13 28}
    #endif
    #ifdef NORMAL
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 52 21 24}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 47 19 24}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 40 15 24}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 40 20 24}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 44 21 24}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 45 23 24}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 43 24 24}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 50 18 24}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 41 16 24}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 51 15 40}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 53 15 40}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 44 14 40}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 42 14 40}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 56 18 40}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 48 16 40}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 49 17 40}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 55 18 40}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 54 58 14 17 38}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 46 50 12 16 38}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 57 61 14 19 38}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 38 40 21 23 38}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 42 45 24 25 38}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 37 39 25 27 38}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 56 60 9 13 38}
    #endif
    #ifdef EASY
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 52 21 30}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 47 19 30}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 40 15 30}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 40 20 30}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 44 21 30}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 45 23 30}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 43 24 30}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 50 18 30}
        {RESPAWN_POINT ("Demon","Red Demon,Imp") 3 41 16 30}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 51 15 44}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 53 15 44}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 44 14 44}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 42 14 44}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 56 18 44}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 48 16 44}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 49 17 44}
        {RESPAWN_POINT ("Demon Sword Dancer","Demon Grunt","Fire Demon") 3 55 18 44}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 54 58 14 17 42}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 46 50 12 16 42}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 57 61 14 19 42}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 38 40 21 23 42}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 42 45 24 25 42}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 37 39 25 27 42}
        {RESPAWN_POINT_RANDOM ("Demon Zephyr") 2 56 60 9 13 42}
    #endif

    # generate some terrain and do some housekeeping
    [event]
        name=prestart
        {GENERATE_CAVE_HILL}
        {GENERATE_FUNGUS}
        {GENERATE_CAVE_PATH}
        {RECALL_YUMI_NOLOC}

        [set_variable]
            name=have_aryel
            value=0
        [/set_variable]
        [set_variable]
            name=lose_ghost
            value=0
        [/set_variable]
        [set_variable]
            name=volcano
            value=0
        [/set_variable]
        [set_recruit]
            side=1
            recruit=
        [/set_recruit]

        {SPAWN ("Demon Grunt") 2 55 9}
        {SPAWN ("Demon Grunt") 2 61 12}
        {SPAWN ("Demon Sword Dancer") 2 57 12}
        {SPAWN ("Fire Demon") 2 59 9}
        {SPAWN ("Ghost") 4 15 13}
    [/event]

    [event]
        name=start
        [message]
            speaker=Yumi
            message= _ "(shivers)"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Esther, there are demons here."
        [/message]
        [message]
            speaker=Esther
            message= _ "Then we should get moving and find Aryel before they do. Can you sense where she is?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Somewhere to the south, I think."
        [/message]
        {DELAY 250}
        [move_unit]
            id=Yumi
            to_x,to_y=8,7
        [/move_unit]
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]
        {DELAY 250}
        [message]
            speaker=Esther
            message= _ "That way? Alright."
        [/message]
        [move_unit]
            id=Esther
            to_x,to_y=8,6
        [/move_unit]
        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Find Aryel")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Esther")}
            {OBJECTIVE_DEFEAT  ( _ "Turns run out")}
            {OBJECTIVE_CARRYOVER}
        [/objectives]
    [/event]

    [event]
        name=sighted
        first_time_only=yes
        [filter]
            side=2,3
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=unit
            message= _ "There they are! Seize them!"
        [/message]
        [message]
            speaker=Esther
            message= _ "Run!"
        [/message]
    [/event]

    [event]
        name=sighted
        first_time_only=yes
        [filter]
            side=4
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=Esther
            message= _ "Undead?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Aryel likes necromancy..."
        [/message]
        [message]
            speaker=Esther
            message= _ "I know that. That's not what surprised me. What's strange is that they seem hostile. Aryel wouldn't attack us..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Maybe she lost control. (bites lip) Maybe she... got hurt."
        [/message]
        [message]
            speaker=Esther
            message= _ "More reason to find her as soon as we can."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x,y=13,18
            side=1
        [/filter]

        [message]
            speaker=Yumi
            message= _ "Umm, hello? Aryel, are you there?"
        [/message]

        {DELAY 1000}

        [unit]
            side=1
            type=Blood Fae
            variation=BF1
            canrecruit=yes
            x,y=13,18
            name= _ "Aryel"
            id=Aryel
            unrenamable=yes
            # profile=portraits/aryel.png
            animate=yes
            experience=37
        [/unit]

        [message]
            speaker=Aryel
            message= _ "Shush! Do you intend to draw all those spirits over here?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "I thought you were controlling them..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "I was until the demons came here. Something about their energy breaks my hold on them. Annoying pests."
        [/message]
        [message]
            speaker=Esther
            message= _ "Aryel, listen, the demons-"
        [/message]
        [message]
            speaker=Aryel
            message= _ "I already know. Irdya's being invaded. It's another war."
        [/message]
        [message]
            speaker=Esther
            message= _ "It's not exactly all out war yet. I guess they're trying to keep it small for now so Xia'el doesn't have a reason to wipe them out."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Right, like that matters. Thinking a Guardian is going to do anything but sit on their butt and watch us die."
        [/message]
        [message]
            speaker=Esther
            message= _ "She'd help us if we really needed it."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Uh huh. Then where is she? You know the demons are specifically targeting us. We're already in trouble."
        [/message]
        [if]
            [variable]
                name=white_city
                numerical_equals=1
            [/variable]
            [then]
                [message]
                    speaker=Esther
                    message= _ "Let's say you're right and we can't afford to wait around. In that case, there's a crypt in Caerleon that Yumi said you could open. We were planning to go there."
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "That place? Yes, we could go there, but I don't know what you're expecting. (turns to Yumi)"
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "..."
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "Yumi? Hello? Wake up, daydreamer."
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "Uhm... I don't know. I thought I sensed something inside of it."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Esther
                    message= _ "Let's say you're right and we can't afford to wait around. We need to come up with a plan. Do something."
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "Hmm. Well, the first thing that comes to mind is the crypt in Caerleon. There's definitely some powerful magic inside of it, though I'm not exactly sure what it's for."
                [/message]
            [/else]
        [/if]
        [message]
            speaker=Esther
            message= _ "I suppose it wouldn't hurt to pay a visit, would it?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "We could go, but it was locked up a long time ago. Xia'el helped me do it, actually. Apparently she didn't want the humans messing with stuff obviously beyond their grasp. I shoved the key down somewhere deep in these caves."
        [/message]
        [message]
            speaker=Esther
            message= _ "Then let's go get it. Think you can summon up some help?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Maybe, but I can't guarantee that I'll be able to maintain control with the demons around. We might have to brute force our way through them."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Not like you mind..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Of course not. Actually, it would be my pleasure."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(rolls eyes)"
        [/message]

        [modify_side]
            side=1
            {UNDEAD_RECRUITS}
        [/modify_side]

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

        # recruiting code for this scenario
        [set_menu_item]
            id=recruit_ghost
            description= _ "Recruit Ghost"
            image="attacks/wail.png~SCALE(18,18)"
            [show_if]
                [variable]
                    name=side_number
                    numerical_equals=1
                [/variable]
            [/show_if]
            [filter_location]
                [not]
                    [filter][/filter]
                [/not]
                [filter_adjacent_location]
                    [filter]
                        side=1
                        id=Aryel
                    [/filter]
                [/filter_adjacent_location]
            [/filter_location]
            [command]
                [store_gold]
                    [filter_side]
                        side=1
                    [/filter_side]
                    variable=side1gold
                [/store_gold]
                [if]
                    [variable]
                        name=side1gold
                        less_than=20
                    [/variable]
                    [then]
                        {MESSAGE_NOT_ENOUGH_GOLD}
                    [/then]
                    [else]
                        [unit]
                            side=1
                            type=Ghost
                            x,y=$x1,$y1
                            moves,attacks_left=0,0
                            animate=yes
                        [/unit]
                        {VARIABLE_OP side1gold sub 20}
                        [modify_side]
                            side=1
                            gold=$side1gold
                        [/modify_side]
                        {CLEAR_VARIABLE side1gold}
                    [/else]
                [/if]
            [/command]
        [/set_menu_item]

        [remove_shroud]
            side=1
            x=52,51,51,52,50,53
            y=29,30,29,28,30,29
        [/remove_shroud]

        {SCROLL_TO 51 30}

        {DELAY 1000}

        [modify_turns]
            value=50
        [/modify_turns]
        [modify_unit]
            [filter]
                id=Yumi,Esther,Aryel
            [/filter]
            moves=6
            attacks_left=1
        [/modify_unit]
        {SCROLL_TO 18 13}

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Proceed southeast to locate the key to the crypt of Caerleon")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Esther")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_DEFEAT  ( _ "Turns run out")}
            {OBJECTIVE_NOTE ( _ "You may recruit ghosts by right-clicking a hex next to Aryel.")}
            {OBJECTIVE_NOTE ( _ "Every turn, you have a chance to lose control of ghosts.")}
        [/objectives]
    [/event]

    # side 5 spawns
    #ifdef HARD
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 12 32 12 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 7 34 12 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 14 33 12 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 28 35 12 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 26 39 12 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 27 32 12 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith,Shadow") 5 22 44 15 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith,Shadow") 5 4 37 15 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith,Shadow") 5 27 44 15 ("have_aryel")}
    #endif
    #ifdef NORMAL
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 12 32 18 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 7 34 18 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 14 33 18 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 28 35 18 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 26 39 18 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 27 32 18 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 22 44 18 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith,Shadow") 5 4 37 20 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith,Shadow") 5 27 44 20 ("have_aryel")}
    #endif
    #ifdef EASY
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 12 32 21 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 7 34 21 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 14 33 21 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 28 35 21 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 26 39 21 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 27 32 21 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith") 5 22 44 21 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith,Shadow") 5 4 37 24 ("have_aryel")}
        {RESPAWN_POINT_CONDITIONAL ("Wraith,Shadow") 5 27 44 24 ("have_aryel")}
    #endif

    # lose ghosts event
    [event]
        name=new turn
        first_time_only=no
        [store_unit]
            [filter]
                type=Ghost
                side=1
            [/filter]
            variable=ghosts
        [/store_unit]
        [for]
            array=ghosts
            [do]
                [set_variable]
                    name=change_side
                    rand=1..30
                [/set_variable]
                [if]
                    [variable]
                        name=change_side
                        numerical_equals=1
                    [/variable]
                    [then]
                        [set_variable]
                            name=ghosts[$i].side
                            value=4
                        [/set_variable]
                        [unstore_unit]
                            variable=ghosts[$i]
                            find_vacant=no
                        [/unstore_unit]
                        # only do this once
                        [if]
                            [variable]
                                name=lose_ghost
                                numerical_equals=0
                            [/variable]
                            [then]
                                [message]
                                    speaker=Aryel
                                    message= _ "Damn it. Stupid demon magic."
                                [/message]
                                [set_variable]
                                    name=lose_ghost
                                    value=1
                                [/set_variable]
                            [/then]
                        [/if]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_side}
            [/do]
        [/for]
        {CLEAR_VARIABLE ghosts}
    [/event]

    [event]
        name=last breath
        first_time_only=yes
        [filter]
            side=2,3
        [/filter]
        [filter_second]
            id=Aryel
        [/filter_second]
        [message]
            speaker=Aryel
            message= _ "Mmmmm, you feel that? Savor your last breaths before I send you back to hell with everyone else."
        [/message]

        [kill]
            id=unit
            animate=yes
        [/kill]

        [message]
            speaker=Esther
            message= _ "Getting kind of excited, aren't you?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Can you blame me? It's been years since I got to let loose."
        [/message]
    [/event]

    [event]
        name=turn 9

        [message]
            speaker=Esther
            message= _ "So... Aryel, remind me when you moved down here into this rat dump again. Why'd you even come here?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "That wasn't really so long ago. I just came back up here to keep an eye on those humans. They've been more troublesome lately."
        [/message]
        [message]
            speaker=Esther
            message= _ "You sure it wasn't to get away from people?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Hah. There was some of that in it too. I'm not really a social butterfly, like you."
        [/message]
        [message]
            speaker=Esther
            message= _ "It's not that bad. All you have to do is talk a bit. Act as normal as possible."
        [/message]
        [message]
            speaker=Aryel
            message= _ "And you've always been miss goody goody sunshine. Must be easy for you."
        [/message]
        [message]
            speaker=Esther
            message= _ "Come on. You, of all people, should know better than to judge me like that."
        [/message]
        [message]
            speaker=Aryel
            message= _ "(smirks) Yeah, yeah. Just teasing."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Wait, what is Esther really like?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Don't ask silly questions! What you see is what you get."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(frowns)"
        [/message]
        [message]
            speaker=Esther
            message= _ "Just be content with the way things are."
        [/message]
    [/event]

    [event]
        name=turn 12

        [message]
            speaker=Yumi
            message= _ "(whispers) Aryel?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yes?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(whispers) Is Esther scary?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Wha-? What kind of question is that?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(whispers) Shhh!"
        [/message]
        [message]
            speaker=Aryel
            message= _ "(whispers) I don't get it. Don't you think you can trust her?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(whispers) I... it's not that..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "(whispers) You're so dumb sometimes, you know that? Of all people, why wouldn't you trust Esther?"
        [/message]
        [message]
            speaker=Esther
            message= _ "Is something going on that I should be aware about?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "N-no. W-we were just, you know... uhh..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "This brat, how do you deal with her..."
        [/message]
        [message]
            speaker=Esther
            message= _ "Haha, just be patient. Give her some room and she might open up in time."
        [/message]
    [/event]

    [event]
        name=turn 19

        [message]
            speaker=Aryel
            message= _ "Esther, do you still remember what happened the last time the demons invaded?"
        [/message]
        [message]
            speaker=Esther
            message= _ "What, when the Valdemons started running amuck when Shardia and Valdir had another one of their feuds?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yeah. I'm pretty sure Xia'el stepped in to help us then, right?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "... what are you two talking about?"
        [/message]
        [message]
            speaker=Esther
            message= _ "I keep forgetting how young you are. There are other worlds besides our own, like how the Guardian of Life Uria is from Ethea. The Valdemons are from Norsula, the world of Water and Fire. They're a particularly bloodthirsty lot and they're always fighting against Shardia's subjects, but sometimes they invade other worlds too. Last time, Xia'el took care of business rather quickly."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Why would the demons attack us? Or each other?"
        [/message]
        [message]
            speaker=Esther
            message= _ "Power. The more land and peoples they can conquer, the more power is available to them. A lot of the time, they fight under the orders of a strong demon lord or even a Guardian. You have to understand, most of the Guardians positively hate each other and don't mind letting their subjects fight."
        [/message]
        [message]
            speaker=Aryel
            message= _ "You're giving them too much credit. They're a bunch of egotistical tyrants who couldn't give a crap about anything but themselves. Well, not Xia'el, but she's got a different problem. She doesn't do anything useful. She's too passive."
        [/message]
        [message]
            speaker=Yumi
            message= _ "So that's why we're being ditched now..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Exactly. The only puzzling thing is why the Urdemons are suddenly involved this time, since they're usually on our side. Of all the Guardians, Uria and Xia'el are the chummiest."
        [/message]
        [message]
            speaker=Esther
            message= _ "Who knows! I've never met Uria, personally. And Xia'el only a couple times. She seemed kind of scatterbrained, to be honest."
        [/message]
        [message]
            speaker=Aryel
            message= _ "You said it. I guess it's better than living under that brute Valdir though. But that means we've really got to fend for ourselves."
        [/message]
        [message]
            speaker=Esther
            message= _ "Pretty much."
        [/message]
    [/event]

    [event]
        name=enter_hex
        first_time_only=yes
        [filter]
            x=15-21
            y=25-30
            side=1
        [/filter]
        [filter_condition]
            [variable]
                name=have_aryel
                numerical_equals=1
            [/variable]
        [/filter_condition]
        [message]
            speaker=Esther
            message= _ "Uhh, which way?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "The path east leads to our intended destination. The path south leads through the chasm. I've never been there myself, but it might be worth checking out if we have the time."
        [/message]
    [/event]

    [event]
        name=sighted
        first_time_only=yes
        [filter]
            side=5
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=Esther
            message= _ "Those spirits look pretty dangerous."
        [/message]
        [message]
            speaker=Aryel
            message= _ "I never had any control over the ones from the chasms. They're not that hard to kill, but certainly stronger than your average ghost."
        [/message]
    [/event]

    # reach the volcano peak
    [event]
        name=moveto
        first_time_only=no
        [filter]
            x,y=12,41
            id=Esther,Yumi,Aryel
        [/filter]

        # this gets set to 1 if we complete the event, so you can't get the bonuses over and over
        [filter_condition]
            [variable]
                name=have_aryel
                numerical_equals=1
            [/variable]
            [variable]
                name=volcano
                numerical_equals=0
            [/variable]
        [/filter_condition]

        # everyone should be nearby
        [if]
            [have_unit]
                id=Aryel
                [filter_location]
                    x,y=12,41
                    radius=6
                [/filter_location]
            [/have_unit]
            [and]
                [have_unit]
                    id=Esther
                    [filter_location]
                        x,y=12,41
                        radius=6
                    [/filter_location]
                [/have_unit]
            [/and]
            [and]
                [have_unit]
                    id=Yumi
                    [filter_location]
                        x,y=12,41
                        radius=6
                    [/filter_location]
                [/have_unit]
            [/and]
            [then]
                [move_unit]
                    id=Esther
                    to_x,to_y=11,42
                [/move_unit]
                [move_unit]
                    id=Yumi
                    to_x,to_y=12,42
                [/move_unit]
                [move_unit]
                    id=Aryel
                    to_x,to_y=13,42
                [/move_unit]
                [message]
                    speaker=Aryel
                    message= _ "Try touching the lava."
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "But-"
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "Don't be a chicken. Just do it."
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "Well, uhm..."
                [/message]

                {DELAY 1000}

                [move_unit]
                    id=Yumi
                    to_x,to_y=12,41
                [/move_unit]

                [message]
                    speaker=Yumi
                    message= _ "It stings a little. Almost like iron."
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "Just stay there for a moment. Esther, you come too."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "What exactly is supposed to happen?"
                [/message]

                {WHITE_SCREEN}
                {DELAY 500}
                {UNWHITE_SCREEN}

                [object]
                    [filter]
                        id=Esther
                    [/filter]
                    [effect]
                        apply_to=resistance
                        [resistance]
                            blade=-10
                            impact=-10
                            pierce=-10
                        [/resistance]
                    [/effect]
                    silent=yes
                    duration=forever
                [/object]
                [object]
                    [filter]
                        id=Yumi
                    [/filter]
                    [effect]
                        apply_to=resistance
                        [resistance]
                            blade=-10
                            impact=-10
                            pierce=-10
                        [/resistance]
                    [/effect]
                    silent=yes
                    duration=forever
                [/object]
                [object]
                    [filter]
                        id=Aryel
                    [/filter]
                    [effect]
                        apply_to=resistance
                        [resistance]
                            blade=-10
                            impact=-10
                            pierce=-10
                        [/resistance]
                    [/effect]
                    silent=yes
                    duration=forever
                [/object]

                [message]
                    speaker=Aryel
                    message= _ "It doesn't hurt any more, right?"
                [/message]
                [message]
                    speaker=Esther
                    message= _ "Whoa. What did you do?"
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "Negated our natural weakness to cold iron. Physical attacks shouldn't hurt as much now."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "That's so helpful! It's amazing that you can do that!"
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "Yeah, amazing."
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "You jealous? (smirks)"
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "(sticks tongue out)"
                [/message]
                [set_variable]
                    name=volcano
                    value=1
                [/set_variable]
            [/then]
            [else]
                [if]
                    [have_unit]
                        id=Yumi
                        x,y=12,41
                    [/have_unit]
                    [then]
                        [message]
                            speaker=Yumi
                            message= _ "Esther? Aryel? I think I found something."
                        [/message]
                    [/then]
                    [else]
                        [message]
                            speaker=unit
                            message= _ "You two should check this out."
                        [/message]
                    [/else]
                [/if]
            [/else]
        [/if]
    [/event]

    [event]
        name=sighted
        first_time_only=yes
        [filter]
            id=boss
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [message]
            speaker=boss
            message= _ "Faerie like you have no business challenging a demon!"
        [/message]
        [message]
            speaker=Esther
            message= _ "Faerie like us are not as docile as you think. We're not afraid of you."
        [/message]
        [message]
            speaker=boss
            message= _ "So be it! My blood boils for the glory of battle!"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Your blood boils? Let me show you what happens when your blood really boils."
        [/message]

        {DELAY 500}
        {PLAY_SOUND "fire.wav"}
        {DELAY 250}
        [harm_unit]
            [filter]
                id=boss
            [/filter]
            [filter_second]
                id=Aryel
            [/filter_second]
            [primary_attack]
                name=blood boil
            [/primary_attack]
            [secondary_attack]
                name=blood boil
            [/secondary_attack]
            animate=yes
            amount=11
        [/harm_unit]

        [message]
            speaker=boss
            message= _ "Aaargh! Insignificant wretch! Prepare to die!"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(whispers) Aryel, you're just making him angry..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Who cares? There's no need to be scared of a little fighting. In fact, this is the perfect time to see how strong these demons really are."
        [/message]
    [/event]
    [event]
        name=last breath
        [filter]
            id=boss
        [/filter]
        [message]
            speaker=boss
            message= _ "I... shall return."
        [/message]

        [kill]
            id=boss
            animate=no
        [/kill]

        [message]
            speaker=Yumi
            message= _ "That was scary..."
        [/message]
        [message]
            speaker=Esther
            message= _ "He seemed fairly strong, at least more so than the small fry we've been fighting up until now."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Hmph. Still wasn't on the level of real demon lords."
        [/message]
        [message]
            speaker=Esther
            message= _ "Well, do you really want to fight a demon lord?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "It'd be interesting, at least."
        [/message]
        [message]
            speaker=Yumi
            message= _ "She's crazy, Esther, I told you!"
        [/message]
        [message]
            speaker=Aryel
            message= _ "So what? You're not planning to tell me you're normal, are you?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(pouts)"
        [/message]
        [message]
            speaker=Esther
            message= _ "(sighs) You two. We still have to get that key and get out of here, so save it for later."
        [/message]
    [/event]

    [event]
        name=turn 25

        [message]
            speaker=Esther
            message= _ "Geez, sometimes I wonder how you two can handle so much darkness. It really gets to you after a while."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Maybe it gets to you, but some of us enjoy it. I, for one, bet Yumi doesn't like it when you force her to get up at dawn. Right, Yumi?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "... uh huh..."
        [/message]
        [message]
            speaker=Esther
            message= _ "If you like the dark so much, go live on Yrathid. Sheesh."
        [/message]
        [message]
            speaker=Yumi
            message= _ "The world of darkness?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yup. And, no thanks. Merthiaal isn't as nice as Xia'el. Actually, she's honestly pretty creepy most of the time."
        [/message]
        [message]
            speaker=Esther
            message= _ "Not unlike both of you. Maybe she just has self image issues, like Yumi."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(sulks)"
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x=51,52
            y=30,29
            side=1
            [not]
                id=Aryel
            [/not]
        [/filter]
        [filter_condition]
            [variable]
                name=destroy_wall_one
                numerical_not_equals=1
            [/variable]
        [/filter_condition]
        [message]
            speaker=Yumi
            message= _ "There's something behind this wall."
        [/message]
        [message]
            speaker=Esther
            message= _ "Looks like we need Aryel to get through."
        [/message]
        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Move Aryel to the lit hexes")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Esther")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_DEFEAT  ( _ "Turns run out")}
            {OBJECTIVE_CARRYOVER}
        [/objectives]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x=51,52
            y=30,29
            id=Aryel
        [/filter]
        [message]
            speaker=Aryel
            message= _ "It takes some skill to notice that this wall blocks off a hidden path. It's not the easiest thing to open either, so give me a moment."
        [/message]

        {DELAY 750}

        [terrain]
            x=51,52
            y=30,29
            terrain=Uu
        [/terrain]
        [redraw]
            clear_shroud=yes
        [/redraw]

        [terrain]
            x=51,52
            y=31,30
            terrain=Uu
        [/terrain]
        {DELAY 250}

        [message]
            speaker=Aryel
            message= _ "There. Follow me."
        [/message]
        [set_variable]
            name=destroy_wall_one
            value=1
        [/set_variable]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x,y=52,35
            side=1
        [/filter]
        [message]
            speaker=narrator
            message= _ "Here lies Wodahs Retsam. She never found the way out."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x=59,60,58
            y=35,34,34
            side=1
            [not]
                id=Aryel
            [/not]
        [/filter]
        [filter_condition]
            [variable]
                name=destroy_wall_two
                numerical_not_equals=1
            [/variable]
        [/filter_condition]
        [message]
            speaker=Esther
            message= _ "Aryel, it seems that we need you again."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x=59,60,58
            y=35,34,34
            id=Aryel
        [/filter]
        [message]
            speaker=Aryel
            message= _ "Stand back."
        [/message]

        {DELAY 250}
        [terrain]
            x=60,59,58
            y=35,36,35
            terrain=Uue
        [/terrain]
        [redraw][/redraw]

        [set_variable]
            name=destroy_wall_two
            value=1
        [/set_variable]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            side=1
            [filter_location]
                x,y=59,41
                radius=5
            [/filter_location]
        [/filter]

        [remove_shroud]
            side=1
            x,y=59,47
            radius=10
        [/remove_shroud]
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x,y=59,47
            radius=10
            multiturn=yes
        [/lift_fog]

        [scroll_to]
            x,y=59,47
        [/scroll_to]

        {DELAY 2000}

        [message]
            speaker=Esther
            message= _ "Whoa."
        [/message]
        [message]
            speaker=Aryel
            message= _ "You like it? I found this place a while ago and thought it'd be a good hideout. Had to make a few modifications so that the trees could grow, of course."
        [/message]
        [message]
            speaker=Esther
            message= _ "What was it originally?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "A shrine to Xia'el. If you get closer to the center, you can see the light coming down in the form of her symbol. The energies here used to be stronger, but they've faded with time. I guess it's because she doesn't bless this place with her presence any more."
        [/message]
        [message]
            speaker=Esther
            message= _ "And I thought Yumi was supposed to be the sarcastic one. 'Bless this place with her presence'. You have quite the sense of humor."
        [/message]
        [message]
            speaker=Yumi
            message= _ "... I don't get it."
        [/message]
        [message]
            speaker=Esther
            message= _ "Xia'el hasn't shown up in several decades, dear. She really leaves us to figure things out by ourselves. I guess in an ironic sort of way, she really would be blessing us if she decided to appear all of a sudden."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yeah. The best place to live is probably Ethea, since Uria usually keeps a tighter grip on her subjects. Remember that if you're ever left on your own, Yumi."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I... don't want to think about that."
        [/message]
        [message]
            speaker=Esther
            message= _ "Yeah, no need to talk like that. Let's get that key and get out of here."
        [/message]

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Move Aryel to the center of the chamber")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Esther")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_DEFEAT  ( _ "Turns run out")}
            {OBJECTIVE_CARRYOVER}
        [/objectives]
    [/event]

    # we don't need any conditions since if Aryel moves here, you win
    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x,y=59,47
            side=1
            [not]
                id=Aryel
            [/not]
        [/filter]
        [message]
            speaker=unit
            message= _ "Aryel should be the one to look at this."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x,y=59,47
            id=Aryel
        [/filter]

        [message]
            speaker=Yumi
            message= _ "... where's the key you were talking about?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Silly girl. It's not a physical key. As if I would leave such a thing lying around for anyone else to use."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(sulks)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Well, that's all taken care of. I do wonder what's inside that crypt. I never really explored thoroughly enough before."
        [/message]
        [message]
            speaker=Esther
            message= _ "You don't seem like you're scared."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Not really, I'm not. It's just that dealing with powerful magics draws unwanted attention. And lately, we've been getting enough of that."
        [/message]
        [message]
            speaker=Esther
            message= _ "But, you are okay with opening it."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Like I said, I'm also not scared. There's no need to be. Right, Yumi?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(looks away)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Hmph. Well, it's up to us, I guess. Shall we give it a shot, or do we sit on our butts and wait for Xia'el to miraculously do something for once?"
        [/message]
        [message]
            speaker=Esther
            message= _ "We might as well act on our own. We can't rely on anyone else right now. Besides, dabbling in dangerous magic is kind of something we're built to do."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Fine. Then let's get out of here before more demons come."
        [/message]

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

    # cleaning up some variables
    [event]
        name=victory

        {CLEAR_VARIABLE volcano}
        {CLEAR_VARIABLE destroy_wall_one}
        {CLEAR_VARIABLE destroy_wall_two}
        {CLEAR_VARIABLE have_aryel}
        {CLEAR_VARIABLE lose_ghost}
        [clear_menu_item]
            id=recruit_ghost
        [/clear_menu_item]
        [set_variable]
            name=black_cauldron
            value=1
        [/set_variable]
        [set_variable]
            name=white_city
            value=2
        [/set_variable]
        [set_variable]
            name=prev_scenario
            value="Black Cauldron"
        [/set_variable]
    [/event]

    [event]
        name=turn 47

        [message]
            speaker=Yumi
            message= _ "(shudders) The demons are coming again. Strong ones. Really strong ones."
        [/message]
        [message]
            speaker=Aryel
            message= _ "I can feel it too. We'd better hurry up."
        [/message]
    [/event]

    [event]
        name=time over

        [store_unit]
            [filter]
                id=Yumi
            [/filter]
            variable=yumi
        [/store_unit]
        [store_unit]
            [filter]
                id=Esther
            [/filter]
            variable=esther
        [/store_unit]
        [store_unit]
            [filter]
                id=Aryel
            [/filter]
            variable=aryel
        [/store_unit]
        [message]
            speaker=Yumi
            message= _ "Uhh, Esther? I sense something. Something really bad."
        [/message]
        [message]
            speaker=Esther
            message= _ "What is it-"
        [/message]

        {FLASH_RED_EXTREME ({DELAY 500})}

        {SPAWN_ID ("Demon Stromguarde") 2 $yumi.x $yumi.y ("boss1") ("male")}
        {SPAWN_ID ("Demon Stromguarde") 2 $yumi.x $yumi.y ("boss2") ("male")}
        {SPAWN_ID ("Demon Stromguarde") 2 $yumi.x $yumi.y ("boss3") ("male")}
        {SPAWN_ID ("Demon Stromguarde") 2 $esther.x $esther.y ("boss4") ("male")}
        {SPAWN_ID ("Demon Stromguarde") 2 $esther.x $esther.y ("boss5") ("male")}
        {SPAWN_ID ("Demon Stromguarde") 2 $esther.x $esther.y ("boss6") ("male")}
        {SPAWN_ID ("Demon Stromguarde") 2 $aryel.x $aryel.y ("boss7") ("male")}
        {SPAWN_ID ("Demon Stromguarde") 2 $aryel.x $aryel.y ("boss8") ("male")}
        {SPAWN_ID ("Demon Stromguarde") 2 $aryel.x $aryel.y ("boss9") ("male")}

        {CLEAR_VARIABLE yumi}
        {CLEAR_VARIABLE esther}
        {CLEAR_VARIABLE aryel}

        [message]
            speaker=boss1
            message= _ "Meet your makers, heathens!"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Ugh, we're totally doomed now."
        [/message]

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

#undef GENERATE_CAVE_HILL
#undef GENERATE_FUNGUS
#undef GENERATE_CAVE_PATH


#textdomain wesnoth-Genesis
[scenario]
    id=04e_The_White_City
    name= _ "The White City"
    map_data="{~add-ons/Genesis/episode1/maps/04e_The_White_City.map}"
    next_scenario=03_Northlands
    victory_when_enemies_defeated=no
    theme=Cutscene
    turns=-1
    {DEFAULT_SCHEDULE_24H}
    {STORYTXT_WHITE_CITY}

    {SCENARIO_MUSIC wanderer.ogg}
    {EXTRA_SCENARIO_MUSIC silvan_sanctuary.ogg}

    [side]
        {PLAYER_FAE}
        {NO_GOLD_SIDE}
        side=1
        recruit=
    [/side]

    [side]
        side=2
        no_leader=yes
        {HUMAN_ALLY}
    [/side]

    [event]
        name=prestart

        [label]
            x,y=7,19
            text = _ "Colosseum"
        [/label]
        [label]
            x,y=36,20
            text = _ "Marketplace"
        [/label]
        [label]
            x,y=2,1
            text = _ "Upper District"
        [/label]
        [label]
            x,y=3,9
            text = _ "Temple"
        [/label]
        [label]
            x,y=38,2
            text = _ "Crypt"
        [/label]
        [set_recruit]
            side=1
            recruit=
        [/set_recruit]
        [set_variable]
            name=bought_peach
            value=0
        [/set_variable]
    [/event]

    {SPAWN_POINT ("Royal Guard") 2 20 35}
    {SPAWN_POINT ("Royal Guard") 2 22 35}
    {SPAWN_POINT ("Master Bowman") 2 31 29}
    {SPAWN_POINT ("Master Bowman") 2 37 29}
    {SPAWN_POINT ("Master Bowman") 2 8 29}
    {SPAWN_POINT ("Master Bowman") 2 12 29}
    {SPAWN_POINT ("Master Bowman") 2 17 31}
    {SPAWN_POINT ("Master Bowman") 2 19 31}
    {SPAWN_POINT ("Master Bowman") 2 23 31}
    {SPAWN_POINT ("Master Bowman") 2 25 31}
    {SPAWN_POINT ("Master at Arms") 2 10 22}
    {SPAWN_POINT ("Peasant") 2 34 21}
    {SPAWN_POINT ("Peasant") 2 38 21}
    {SPAWN_POINT ("Peasant") 2 33 19}
    {SPAWN_POINT ("Peasant") 2 37 19}
    {SPAWN_POINT ("White Mage") 2 1 10}
    {SPAWN_POINT ("Royal Guard") 2 17 8}
    {SPAWN_POINT ("Royal Guard") 2 18 8}
    {SPAWN_POINT ("Royal Guard") 2 19 8}
    {SPAWN_POINT ("Royal Guard") 2 37 2}
    {SPAWN_POINT ("Royal Guard") 2 38 2}
    {SPAWN_POINT ("Royal Guard") 2 39 2}

    [event]
        name=start

        {RECALL_YUMI_NOLOC}
        [message]
            speaker=Yumi
            message= _ "(looks up)"
        [/message]
        [message]
            speaker=Esther
            message= _ "Impressed? It's pretty grand for a human settlement."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(shrugs)"
        [/message]
        [message]
            speaker=Esther
            message= _ "No? Oh well. Let's go in and see what we can find."
        [/message]

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Explore")}
            {OBJECTIVE_NOTE ( _ "Move next to other units to trigger events.")}
        [/objectives]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            id=Esther
        [/filter]
        {MODIFY_UNIT (id=Esther) moves 10}
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            id=Yumi
        [/filter]
        {MODIFY_UNIT (id=Yumi) moves 10}
    [/event]

# reach the gate
    [event]
        name=moveto
        [filter]
            x=19-23
            y=36
            side=1
        [/filter]
        [message]
            speaker=spawn_20_35
            message= _ "Welcome to Caerleon, faeries. What brings you here?"
        [/message]
        [message]
            speaker=Esther
            message= _ "Just looking around. We might go buy some food from the marketplace."
        [/message]
        [message]
            speaker=spawn_22_35
            message= _ "Very well. Abide by the law of the city while you are inside. No magic is permitted without a license and fighting is strictly forbidden except within the Colosseum."
        [/message]
        [message]
            speaker=Esther
            message= _ "Yes, of course."
        [/message]
        [move_unit]
            id=spawn_20_35
            to_x,to_y=19,36
        [/move_unit]
        [move_unit]
            id=spawn_22_35
            to_x,to_y=23,36
        [/move_unit]
        [terrain]
            x=20,22
            y=34,34
            terrain=Brym^Sy|
        [/terrain]
    [/event]

# if you get to the colosseum
    [event]
        name=moveto
        [filter]
            x=9-11,11
            y=23,22
            side=1
        [/filter]
        [message]
            speaker=spawn_10_22
            message= _ "Sorry ladies, the Colosseum is closed today. Come back some other time to place bets or watch a fight!"
        [/message]
    [/event]

# shops
    [event]
        name=moveto
        [filter]
            x=33,34,35,33-35
            y=21,20,21,22
            side=1
        [/filter]
        [filter_condition]
            [variable]
                name=bought_peach
                numerical_equals=0
            [/variable]
        [/filter_condition]
        [message]
            speaker=spawn_34_21
            message= _ "Fresh fruits and vegetables! Come and get them while they last!"
        [/message]
        [message]
            speaker=Esther
            message= _ "Hey, Yumi, some of these look pretty good. Want me to get you a peach?"
        [/message]
        [message]
            speaker=Yumi

            [option]
                message= _ "Uhhh sure."

                [command]
                    [message]
                        speaker=spawn_34_21
                        message= _ "One for each of you? That'll be 2 gold pieces."
                    [/message]
                    [store_gold]
                        [filter_side]
                            side=1
                        [/filter_side]
                        variable=side1gold
                    [/store_gold]
                    {VARIABLE_OP side1gold sub 2}
                    [modify_side]
                        side=1
                        gold=$side1gold
                    [/modify_side]
                    {CLEAR_VARIABLE side1gold}
                    [message]
                        speaker=Esther
                        message= _ "Thanks."
                    [/message]
                    [message]
                        speaker=Yumi
                        message= _ "Mmm... yummy... "
                    [/message]

                    [store_unit]
                        [filter]
                            id=Esther
                        [/filter]
                        variable=esther
                    [/store_unit]

                    {VARIABLE_OP esther.max_hitpoints add 1}
                    {VARIABLE_OP esther.hitpoints add 1}

                    [unstore_unit]
                        variable=esther
                        find_vacant=no
                    [/unstore_unit]

                    {CLEAR_VARIABLE esther}
                    [store_unit]
                        [filter]
                            id=Yumi
                        [/filter]
                        variable=yumi
                    [/store_unit]

                    {VARIABLE_OP yumi.max_hitpoints add 1}
                    {VARIABLE_OP yumi.hitpoints add 1}

                    [unstore_unit]
                        variable=yumi
                        find_vacant=no
                    [/unstore_unit]

                    {CLEAR_VARIABLE yumi}
                    [set_variable]
                        name=bought_peach
                        value=1
                    [/set_variable]
                [/command]
            [/option]

            [option]
                message= _ "Maybe some other time."

                [command]
                    [message]
                        speaker=Esther
                        message= _ "Okay."
                    [/message]
                [/command]
            [/option]
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x=32,33,34,32-34
            y=19,20,19,18
            side=1
        [/filter]
        [filter_condition]
            [variable]
                name=bought_cloak
                numerical_equals=0
            [/variable]
        [/filter_condition]
        [message]
            speaker=spawn_33_19
            message= _ "Hello ladies. Could I interest you in some of my fine cloaks or dresses?"
        [/message]
        [message]
            speaker=Esther
            message= _ "I'm okay. Yumi, what about you? You want one?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(shakes head)"
        [/message]
        [message]
            speaker=Esther
            message= _ "Hmm, alright. Not today, sorry."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x=36,37,38,36-38
            y=19,20,19,18
            side=1
        [/filter]
        [message]
            speaker=spawn_37_19
            message= _ "Need to get somewhere fast? Buy a horse here!"
        [/message]
        [message]
            speaker=Esther
            message= _ "Maybe some other time."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x=37,38,39,37-39
            y=21,20,21,22
            side=1
        [/filter]
        [message]
            speaker=spawn_38_21
            message= _ "Weapons and armor! Only the finest steel and leather, all at the most affordable prices!"
        [/message]
        [message]
            speaker=Esther
            message= _ "Ehhh, that kind of stuff isn't really my thing."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x=2-4,3
            y=8-9,10
            side=1
        [/filter]

        [if]
            [have_unit]
                x=2-4,3
                y=8-9,10
                id=Esther
            [/have_unit]
            [then]
                [message]
                    speaker=Esther
                    message= _ "Whoa, what's up with this water?"
                [/message]
                [message]
                    speaker=spawn_1_10
                    message= _ "The water is blessed by the priests within the temple. Many of the citizens in the upper district come here to drink it. It is good for your soul."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "Hey, Yumi! You should come here and check this out!"
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Yumi
                    message= _ "(sips)"
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "This tastes good..."
                [/message]
                [message]
                    speaker=spawn_1_10
                    message= _ "This is blessed water, young faerie. May it bring you strength and good health."
                [/message]
            [/else]
        [/if]
    [/event]

    [event]
        name=moveto
        [filter]
            x=16,20,17-19
            y=8,8,9
            side=1
        [/filter]
        [message]
            speaker=spawn_18_8
            message= _ "Halt! You do not have the proper authority to enter the Pantheon and the king is not seeing visitors at this time."
        [/message]
    [/event]
    [event]
        name=moveto
        [filter]
            x=37-39,36,40
            y=3,2,2
            side=1
        [/filter]

        [message]
            speaker=spawn_38_2
            message= _ "Halt! This crypt is infested with powerful magics! The mage council has closed it off to regular civilians- oh wait. You girls are faeries, huh. What can I do for you?"
        [/message]
        [message]
            speaker=Esther
            message= _ "We want to know what's inside there."
        [/message]
        [message]
            speaker=spawn_38_2
            message= _ "I do not know. I am told this crypt has been sealed since before Caerleon itself was built. The mage council divined that there were powerful enchantments inside, but were unable to open these doors."
        [/message]
        [message]
            speaker=Esther
            message= _ "Would it be okay if we tried to open it?"
        [/message]
        [message]
            speaker=spawn_38_2
            message= _ "I do not have the proper authority to grant that request, but I can pass along your appeal to the mage council. What is it that you seek inside?"
        [/message]
        [message]
            speaker=Esther
            message= _ "If you must know, the magics that your magi sensed are of faerie work. Naturally, we came here to investigate."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(raises eyebrows)"
        [/message]
        [message]
            speaker=Esther
            message= _ "(whispers) Shhh!"
        [/message]
        [message]
            speaker=spawn_38_2
            message= _ "Well, that sounds reasonable... but we must have your word that you will not do anything that could jeopardize the order of our city."
        [/message]
        [message]
            speaker=Esther
            message= _ "Of course."
        [/message]
        [message]
            speaker=spawn_38_2
            message= _ "Good. I will inform the magi of your request, so please return in a few days and you may then be allowed to open the crypt. You may have a look from the outside for now, if you like."
        [/message]
        [message]
            speaker=Esther
            message= _ "Well, hmm. It doesn't seem like I even know how to break the enchantments on the doors. That's really sealed up nice and tight. Yumi?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(shakes head)"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(whispers) There's a little bit of Aryel's magic in the seal. The rest isn't faerie magic, it's demon sorcery."
        [/message]
        [message]
            speaker=Esther
            message= _ "(whispers) All the more reason to investigate this crypt. We really need to find Aryel, then. If she's been through here, she might have some idea of what's inside."
        [/message]
        [message]
            speaker=Esther
            message= _ "Sorry about that, we'll be back later."
        [/message]

        [endlevel]
            result=victory
            bonus=no
            {NEW_GOLD_CARRYOVER 100}
            carryover_report=no
            linger_mode=no
            next_scenario=03_Northlands
        [/endlevel]
    [/event]

    # cleaning up some variables
    [event]
        name=victory

        {CLEAR_VARIABLE bought_peach}
        {CLEAR_VARIABLE bought_cloak}
        [set_variable]
            name=white_city
            value=1
        [/set_variable]
        [set_variable]
            name=prev_scenario
            value="White City"
        [/set_variable]
    [/event]
[/scenario]