#textdomain wesnoth-Genesis

[scenario]
    id=11_Frozen_Skies
    name= _ "Frozen Skies"
    map_data="{~add-ons/Genesis/episode1/maps/11_Frozen_Skies.map}"
    victory_when_enemies_defeated=no
    disallow_recall=yes
    turns=25
    next_scenario=12_Siege_of_Fort_Helemoor
    {LIMBO}

    {SCENARIO_MUSIC into_the_shadows.ogg}
    {EXTRA_SCENARIO_MUSIC returning_in_time.ogg}
    {EXTRA_SCENARIO_MUSIC snowfall.ogg}
    {EXTRA_SCENARIO_MUSIC underground.ogg}

    [side]
        {PLAYER_FAE}
        side=1
        recruit=
        {GOLD 350 300 200}
        {INCOME 6 4 0}
        village_gold=0
        village_support=1
        income=-2
        fog=yes
        shroud=yes
    [/side]
    [side]
        side=2
        no_leader=yes
        hidden=yes
        controller=null
        team_name=fae
        color=black
        share_view=yes
    [/side]
    [side]
        {YUURE_SIDE}
        side=3
        hidden=yes
        fog=no
        shroud=no
        [ai]
            aggression=1
            caution=0
            grouping=false
            [goal]
                [criteria]
                    id=Yumi
                [/criteria]
                value=500
            [/goal]
        [/ai]
    [/side]
    [side]
        {MONSTER_SIDE}
        side=4
        hidden=yes
        [ai]
            aggression=1
            caution=0
            grouping=false
            [goal]
                [criteria]
                    id=Aryel
                [/criteria]
                value=200
            [/goal]
            [goal]
                [criteria]
                    side=6
                [/criteria]
                value=-1000
            [/goal]
            [avoid]
                x,y=55,13
                radius=10
            [/avoid]
        [/ai]
    [/side]
    [side]
        side=5
        no_leader=yes
        hidden=yes
        controller=ai
        team_name=merthiaal
        color=black
    [/side]
    [side]
        side=6
        no_leader=yes
        hidden=yes
        controller=ai
        team_name=fae
        color=black
    [/side]

#define REGENERATE_STARTING_TERRAIN
    [store_locations]
        variable=water_hex
        terrain=Woby
    [/store_locations]
    [for]
        array=water_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..4
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$water_hex[$i].x,$water_hex[$i].y
                        terrain=Aa^Fpa
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=2
                [/variable]
                [then]
                    [terrain]
                         x,y=$water_hex[$i].x,$water_hex[$i].y
                        terrain=Aa^Fma
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=3
                [/variable]
                [then]
                    [terrain]
                         x,y=$water_hex[$i].x,$water_hex[$i].y
                        terrain=Ai
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$water_hex[$i].x,$water_hex[$i].y
                        terrain=Aa
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE water_hex}
    [store_locations]
        variable=cave_wall
        terrain=Xu
    [/store_locations]
    [for]
        array=cave_wall
        [do]
            [set_variable]
                name=change_terrain
                rand=1..7
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    less_than=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_wall[$i].x,$cave_wall[$i].y
                        terrain=Aa^Fpa
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_wall[$i].x,$cave_wall[$i].y
                        terrain=Aa^Fma
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=5
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_wall[$i].x,$cave_wall[$i].y
                        terrain=Ai
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    greater_than=5
                [/variable]
                [then]
                    [terrain]
                         x,y=$cave_wall[$i].x,$cave_wall[$i].y
                        terrain=Aa
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE cave_wall}
#enddef

#define GENERATE_MOUNTAIN
    [store_locations]
        variable=ice_hex
        terrain=Ai,Ha
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..200
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ms
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=ice_hex
        terrain=Ai
        [filter_adjacent_location]
            terrain=Ms
            count=1,2
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..5
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    less_than=5
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ms
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
#enddef
#define GENERATE_HILL
    [store_locations]
        variable=ice_hex
        terrain=Ai
        [filter_adjacent_location]
            terrain=Ms
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..8
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    less_than=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ha
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=ice_hex
        terrain=Ai
    [/store_locations]
    [for]
        array=ice_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=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ha
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=ice_hex
        terrain=Ai
        [filter_adjacent_location]
            terrain=Ha
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=ice_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=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ha
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
#enddef

#define GENERATE_FOREST
    [store_locations]
        variable=ice_hex
        terrain=Ai
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..30
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    less_than=5
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa^Fpa
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=5
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa^Fma
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=ice_hex
        terrain=Ai
        [filter_adjacent_location]
            terrain=Aa^Fpa,Aa^Fma
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..20
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    less_than=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa^Fpa
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa^Fma
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=hill_hex
        terrain=Ha
    [/store_locations]
    [for]
        array=hill_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..15
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    less_than=3
                [/variable]
                [then]
                    [terrain]
                         x,y=$hill_hex[$i].x,$hill_hex[$i].y
                        terrain=Ha^Fpa
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=3
                [/variable]
                [then]
                    [terrain]
                         x,y=$hill_hex[$i].x,$hill_hex[$i].y
                        terrain=Ha^Fma
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE hill_hex}
    [store_locations]
        variable=hill_hex
        terrain=Ha
        [filter_adjacent_location]
            terrain=Aa^Fpa,Aa^Fma,Ha^Fpa,Ha^Fma
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=hill_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..7
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    less_than=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$hill_hex[$i].x,$hill_hex[$i].y
                        terrain=Ha^Fpa
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$hill_hex[$i].x,$hill_hex[$i].y
                        terrain=Ha^Fma
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE hill_hex}
#enddef

#define GENERATE_SNOW
    [store_locations]
        variable=ice_hex
        terrain=Ai
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..7
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=ice_hex
        terrain=Ai
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..21
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Spay
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=ice_hex
        terrain=Ai
        [filter_adjacent_location]
            terrain=Aa
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..3
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=ice_hex
        terrain=Ai
        [filter_adjacent_location]
            terrain=Spay
        [/filter_adjacent_location]
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..4
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Spay
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
#enddef
#define GENERATE_VILLAGE
    [store_locations]
        variable=ice_hex
        terrain=Ai
        [not]
            [filter_adjacent_location]
                terrain=Xu,Ai^V*a,Aa^V*a
            [/filter_adjacent_location]
        [/not]
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..400
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ai^Vea
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=2
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ai^Vha
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=3
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ai^Vca
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=4
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Ai^Vla
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=5
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa^Vea
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=6
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa^Vha
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=7
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa^Vca
                    [/terrain]
                [/then]
            [/if]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=8
                [/variable]
                [then]
                    [terrain]
                         x,y=$ice_hex[$i].x,$ice_hex[$i].y
                        terrain=Aa^Vla
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE ice_hex}
    [store_locations]
        variable=hill_hex
        terrain=Ha
        [not]
            [filter_adjacent_location]
                terrain=Ai^V*a,Aa^V*a,Ha^Vhha
            [/filter_adjacent_location]
        [/not]
    [/store_locations]
    [for]
        array=hill_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..100
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    numerical_equals=1
                [/variable]
                [then]
                    [terrain]
                         x,y=$hill_hex[$i].x,$hill_hex[$i].y
                        terrain=Ha^Vhha
                    [/terrain]
                [/then]
            [/if]
            {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE hill_hex}
#enddef

#define GENERATE_TEXTURE
    [store_locations]
        variable=floor_hex
        terrain=A*,H*
        [and]
            [filter_adjacent_location]
                terrain=*^F*
            [/filter_adjacent_location]
        [/and]
    [/store_locations]
    [for]
        array=floor_hex
        [do]
        [set_variable]
            name=change_terrain
            rand=1..25
        [/set_variable]
        [if]
            [variable]
                name=change_terrain
                numerical_equals=1
            [/variable]
            [then]
                [terrain]
                    x,y=$floor_hex[$i].x,$floor_hex[$i].y
                    layer=overlay
                    terrain=^Em
                [/terrain]
            [/then]
        [/if]
        {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE floor_hex}
    [store_locations]
        variable=floor_hex
        terrain=A*,H*
        [and]
            [filter_adjacent_location]
                terrain=*^F*
                count=3-6
            [/filter_adjacent_location]
        [/and]
    [/store_locations]
    [for]
        array=floor_hex
        [do]
        [set_variable]
            name=change_terrain
            rand=1..200
        [/set_variable]
        [if]
            [variable]
                name=change_terrain
                numerical_equals=1
            [/variable]
            [then]
                [terrain]
                    x,y=$floor_hex[$i].x,$floor_hex[$i].y
                    layer=overlay
                    terrain=^Emf
                [/terrain]
            [/then]
        [/if]
        {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE floor_hex}
    [store_locations]
        variable=floor_hex
        terrain=A*,H*,S*
    [/store_locations]
    [for]
        array=floor_hex
        [do]
        [set_variable]
            name=change_terrain
            rand=1..25
        [/set_variable]
        [if]
            [variable]
                name=change_terrain
                numerical_equals=1
            [/variable]
            [then]
                [terrain]
                    x,y=$floor_hex[$i].x,$floor_hex[$i].y
                    layer=overlay
                    terrain=^Es
                [/terrain]
            [/then]
        [/if]
        {CLEAR_VARIABLE change_terrain}
        [/do]
    [/for]
    {CLEAR_VARIABLE floor_hex}
#enddef

    [event]
        name=prestart

        {RECALL_ARYEL_NOLOC}
        {RECALL_YUMI_NOLOC}
        [move_unit]
            id=Yumi
            to_x,to_y=55,13
        [/move_unit]
        [move_unit]
            id=Aryel
            to_x,to_y=51,12
        [/move_unit]
        [store_unit]
            [filter]
                id=Esther
            [/filter]
            variable=esther
        [/store_unit]
        [kill]
            id=Esther
        [/kill]
        [set_variable]
            name=spirit_spawns
            value=1
        [/set_variable]
        [set_variable]
            name=monster_spawns
            value=0
        [/set_variable]
        [set_variable]
            name=blue_spawns
            value=0
        [/set_variable]
        [set_variable]
            name=turn_counter
            numerical_equals=0
        [/set_variable]
        [set_variable]
            name=turn_counter1
            numerical_equals=0
        [/set_variable]
        [set_variable]
            name=turn_counter2
            numerical_equals=0
        [/set_variable]

        [store_unit]
            [filter]
                id=Yumi
            [/filter]
            variable=yumi
        [/store_unit]
        [kill]
            id=Yumi
        [/kill]

        [set_variable]
            name=yumi.side
            value=2
        [/set_variable]

        [unstore_unit]
            variable=yumi
        [/unstore_unit]

        {CLEAR_VARIABLE yumi}

        [hide_unit]
            [filter]
            [/filter]
        [/hide_unit]

        {COLOR_ADJUST -255 -255 -255}
    [/event]

    [event]
        name=start

        {COLOR_ADJUST -255 -255 -255}
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "(<i>blinks</i>) Yumi?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "<i>Why the hell is it so dark</i>?"
        [/message]
        {DELAY 350}
        [unhide_unit]
            id=Aryel
        [/unhide_unit]
        {DELAY 350}
        [message]
            speaker=Aryel
            message= _ "Hello?"
        [/message]
        {DELAY 750}
        {COLOR_ADJUST -215 -215 -215}
        {DELAY 100}
        {COLOR_ADJUST -145 -145 -145}
        {DELAY 100}
        {COLOR_ADJUST -95 -95 -95}
        {DELAY 100}
        {COLOR_ADJUST -75 -75 -75}
        {DELAY 100}
        {COLOR_ADJUST -60 -60 -60}
        {DELAY 100}
        {COLOR_ADJUST -50 -50 -50}
        {DELAY 500}
        [unhide_unit]
            id=Yumi
        [/unhide_unit]
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "Yuuuuumi?"
        [/message]
        {DELAY 750}
        [move_unit]
            id=Aryel
            to_x,to_y=54,13
        [/move_unit]
        [redraw]
            clear_shroud=yes
        [/redraw]
        {DELAY 750}
        [message]
            speaker=Yumi
            message= _ "(<i>stares blankly</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "You paying attention?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>eyes glow</i>)"
        [/message]
        {DELAY 250}
        {REPEAT 3 ({PLAY_SOUND "wail.wav"})}
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "Oh boy."
        [/message]
        {SPAWN_ID ("Phantasm1","Phantasm2") 3 58 11 ("Phantom1") ("male")}
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "Uh."
        [/message]
        {SPAWN_ID ("Phantasm1","Phantasm2") 3 55 16 ("Phantom2") ("male")}
        {REPEAT 2 ({PLAY_SOUND "wail.wav"})}
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "Yumi?"
        [/message]
        {SPAWN_ID ("Phantasm1","Phantasm2") 3 52 11 ("Phantom3") ("male")}
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "<i>My god, what is she even dreaming about?</i>"
        [/message]
        {REPEAT 2 ({PLAY_SOUND "wail.wav"})}
        [message]
            speaker=Aryel
            message= _ "Damn it, Yumi, wake up."
        [/message]
        {DELAY 100}
        {REPEAT 2 ({PLAY_SOUND "wail.wav"})}
        {DELAY 400}
        [move_unit]
            id=Phantom1
            to_x,to_y=57,12
        [/move_unit]
        {DELAY 100}
        [move_unit]
            id=Phantom2
            to_x,to_y=55,15
        [/move_unit]
        {DELAY 100}
        [move_unit]
            id=Phantom3
            to_x,to_y=53,12
        [/move_unit]
        {DELAY 250}
        {REPEAT 2 ({PLAY_SOUND "wail.wav"})}
        [message]
            speaker=Aryel
            message= _ "Y-Yumi? Uhh..."
        [/message]
        {DELAY 100}
        [move_unit]
            id=Phantom1
            to_x,to_y=56,12
        [/move_unit]
        {DELAY 100}
        [move_unit]
            id=Phantom2
            to_x,to_y=55,14
        [/move_unit]
        {DELAY 100}
        [move_unit]
            id=Phantom3
            to_x,to_y=54,12
        [/move_unit]
        {DELAY 250}
        {REPEAT 3 ({PLAY_SOUND "wail.wav"})}
        {DELAY 250}
        [harm_unit]
            [filter]
                id=Yumi
            [/filter]
            [filter_second]
                id=Phantom1
            [/filter_second]
            [primary_attack]
                range=melee
            [/primary_attack]
            [secondary_attack]
                range=melee
            [/secondary_attack]
            animate=yes
            amount=0
        [/harm_unit]
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "Stop!"
        [/message]
        {DELAY 150}
        {REPEAT 2 ({PLAY_SOUND "wail.wav"})}
        [harm_unit]
            [filter]
                id=Yumi
            [/filter]
            [filter_second]
                id=Phantom2
            [/filter_second]
            [primary_attack]
                range=melee
            [/primary_attack]
            [secondary_attack]
                range=melee
            [/secondary_attack]
            animate=yes
            amount=0
        [/harm_unit]
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "Get away from her!"
        [/message]
        {FLASH_RED_EXTREME ({DELAY 500})}
        {COLOR_ADJUST -13 -13 -13}
        {COLOR_ADJUST -26 -26 -26}
        {COLOR_ADJUST -38 -38 -38}
        {COLOR_ADJUST -50 -50 -50}
        [kill]
            id=Phantom1
        [/kill]
        [kill]
            id=Phantom2
        [/kill]
        [kill]
            id=Phantom3
        [/kill]
        {DELAY 750}
        [message]
            speaker=Aryel
            message= _ "(<i>sighs</i>)"
        [/message]

        [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]

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Defend Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_FULL_CARRYOVER}
            {OBJECTIVE_NOTE ( _ "You may recruit ghosts by right clicking on a hex next to Aryel.")}
        [/objectives]
    [/event]

    #ifdef HARD
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 5 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 5 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 5 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 5 ("spirit_spawns")}
    #endif
    #ifdef NORMAL
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 7 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 7 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 7 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 7 ("spirit_spawns")}
    #endif
    #ifdef EASY
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 8 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 8 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 8 ("spirit_spawns")}
    {ADVANCED_RESPAWN ("Phantasm1","Phantasm2") 3 55 13 7 8 ("spirit_spawns")}
    #endif

    [event]
        name=turn 2
        {GENERATE_MOUNTAIN}
        {GENERATE_MOUNTAIN}
    [/event]
    [event]
        name=turn 3
        {GENERATE_HILL}
        {GENERATE_HILL}
    [/event]
    [event]
        name=turn 4
        {GENERATE_FOREST}
        {GENERATE_SNOW}
    [/event]
    [event]
        name=turn 5
        {GENERATE_VILLAGE}
    [/event]

    [event]
        name=side 5 turn 3

        [store_unit]
            [filter]
                side=1,3
            [/filter]
            variable=placeholder
            kill=yes
        [/store_unit]
        {COLOR_ADJUST 33 33 33}
        {DELAY 100}
        {COLOR_ADJUST 67 67 67}
        {DELAY 100}
        {COLOR_ADJUST 100 100 100}
        {DELAY 100}
        {COLOR_ADJUST 133 133 133}
        {DELAY 250}
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x,y=55,13
            radius=6
            multiturn=no
        [/lift_fog]
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]

        [unit]
            type=Guardian of Darkness
            id=Merthiaal
            name= _ "Merthiaal"
            x,y=59,11
            side=5
            random_traits=no
            facing=sw
        [/unit]
        {DELAY 250}
        [message]
            speaker=Yumi
            message= _ "(<i>gasps</i>)"
        [/message]
        {DELAY 100}
        {MODIFY_UNIT (id=Yumi) facing ne}
        {DELAY 250}
        [message]
            speaker=Merthiaal
            message= _ "<i>Relax. Don't be afraid. You know who I am, don't you?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>N-no...</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>You're lying to me.</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>shakes head slowly</i>)"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>You know much more than you let on. You've seen the void.</i>"
        [/message]
        {DELAY 1250}
        [message]
            speaker=Merthiaal
            message= _ "<i>Well?</i>"
        [/message]
        {DELAY 750}
        [message]
            speaker=Merthiaal
            message= _ "<i>Answer me.</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>winces in pain</i>)"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>Don't give me that look. I know that you know.</i>"
        [/message]
        {DELAY 750}
        {MODIFY_UNIT (id=Yumi) facing sw}
        {DELAY 400}
        [message]
            speaker=Merthiaal
            message= _ "<i>Look at me.</i>"
        [/message]
        {DELAY 750}
        [move_unit]
            id=Merthiaal
            to_x,to_y=58,11
        [/move_unit]
        [message]
            speaker=Merthiaal
            message= _ "<i>It doesn't have to be like this.</i>"
        [/message]
        {DELAY 500}
        [move_unit]
            id=Merthiaal
            to_x,to_y=57,12
        [/move_unit]
        [message]
            speaker=Merthiaal
            message= _ "<i>I'm only asking you about what you know. I don't want to hurt you. Just tell me.</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>shakes head</i>)"
        [/message]
        {DELAY 350}
        [move_unit]
            id=Merthiaal
            to_x,to_y=56,12
        [/move_unit]
        [message]
            speaker=Merthiaal
            message= _ "(<i>eyes glowing</i>) <i>You don't want to make this difficult for me.</i>"
        [/message]
        {DELAY 350}
        [harm_unit]
            [filter]
                id=Yumi
            [/filter]
            animate=yes
            amount=0
        [/harm_unit]
        [message]
            speaker=Merthiaal
            message= _ "<i>Look at me.</i>"
        [/message]
        {DELAY 1250}
        {MODIFY_UNIT (id=Yumi) facing ne}
        {DELAY 250}
        [message]
            speaker=Merthiaal
            message= _ "<i>Good girl. Now hold still.</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "(<i>eyes glow</i>)"
        [/message]
        {COLOR_ADJUST 167 167 167}
        {DELAY 100}
        {COLOR_ADJUST 200 200 200}
        {DELAY 100}
        {COLOR_ADJUST 233 233 233}
        {DELAY 100}
        {COLOR_ADJUST 255 255 255}
        [message]
            speaker=Yumi
            message= _ "(<i>gasps</i>)"
        [/message]
        {DELAY 250}
        [harm_unit]
            [filter]
                id=Yumi
            [/filter]
            animate=yes
            amount=0
        [/harm_unit]
        {DELAY 400}
        [harm_unit]
            [filter]
                id=Yumi
            [/filter]
            animate=yes
            amount=0
        [/harm_unit]
        {DELAY 100}
        [harm_unit]
            [filter]
                id=Yumi
            [/filter]
            animate=yes
            amount=0
        [/harm_unit]
        {DELAY 50}
        [harm_unit]
            [filter]
                id=Yumi
            [/filter]
            animate=yes
            amount=0
        [/harm_unit]
        [message]
            speaker=Yumi
            message= _ "(<i>whimpers</i>)"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>Shhh... shhh... it'll be okay. It's going to be okay. You don't need to be afrai-</i>"
        [/message]
        [kill]
            id=Merthiaal
        [/kill]
        {COLOR_ADJUST 233 233 233}
        {DELAY 100}
        {COLOR_ADJUST 200 200 200}
        {DELAY 100}
        {COLOR_ADJUST 167 167 167}
        [for]
            array=placeholder
            [do]
                [unstore_unit]
                    variable=placeholder[$i]
                [/unstore_unit]
            [/do]
        [/for]
        {CLEAR_VARIABLE placeholder}
        {COLOR_ADJUST 133 133 133}
        {DELAY 100}
        {COLOR_ADJUST 100 100 100}
        {DELAY 100}
        {COLOR_ADJUST 67 67 67}
        {DELAY 100}
        {COLOR_ADJUST 33 33 33}
        {DELAY 100}
        {COLOR_ADJUST 0 0 0}
        {COLOR_ADJUST -13 -13 -13}
        {COLOR_ADJUST -26 -26 -26}
        {COLOR_ADJUST -38 -38 -38}
        {COLOR_ADJUST -50 -50 -50}
    [/event]

    [event]
        name=turn 5
        [message]
            speaker=Aryel
            message= _ "(<i>stares at Yumi</i>) <i>She seems a little more agitated. I wonder what she's thinking about.</i>"
        [/message]
    [/event]

    [event]
        name=side 5 turn 6

        [store_unit]
            [filter]
                side=1,3
            [/filter]
            variable=placeholder
            kill=yes
        [/store_unit]
        {COLOR_ADJUST 33 33 33}
        {DELAY 100}
        {COLOR_ADJUST 67 67 67}
        {DELAY 100}
        {COLOR_ADJUST 100 100 100}
        {DELAY 100}
        {COLOR_ADJUST 133 133 133}
        {DELAY 250}
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x,y=55,13
            radius=6
            multiturn=no
        [/lift_fog]
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]
        [unit]
            type=Guardian of Darkness
            id=Merthiaal
            name= _ "Merthiaal"
            x,y=56,12
            side=5
            random_traits=no
            facing=sw
        [/unit]
        {MODIFY_UNIT (id=Yumi) facing ne}
        {DELAY 250}
        [message]
            speaker=Merthiaal
            message= _ "<i>The force was a bit stronger than I expected. Are you hurt?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>covers face</i>)"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>Don't be like that. I was just testing something. You can hear it, can't you? It's near. The void.</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>closes eyes</i>)"
        [/message]
        {DELAY 400}
        {PLAY_SOUND "voices.ogg"}
        {DELAY 1500}
        [message]
            speaker=Yumi
            message= _ "<i>I-I...</i>"
        [/message]
        {PLAY_SOUND "voices.ogg"}
        {PLAY_SOUND "wail.wav"}
        {DELAY 250}
        {PLAY_SOUND "wail.wav"}
        {PLAY_SOUND "voices.ogg"}
        {DELAY 100}
        {PLAY_SOUND "voices.ogg"}
        {DELAY 750}
        [message]
            speaker=Yumi
            message= _ "(<i>breathes slowly</i>)"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>Your friends can't protect you from it.</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>But you can't either...</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>Nobody can. Not at this moment. It is relentless.</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>You know what I want to do, right? You, of all people should know. You know what my plan is.</i>"
        [/message]
        {DELAY 1250}
        [message]
            speaker=Merthiaal
            message= _ "<i>Please tell me you understand.</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>Why should you care what I think..?</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "(<i>snaps</i>) <i>You already know the answer to that. If you would talk more, it would make this conversation go more easily.</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>mutters</i>) <i>Sorry.</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "(<i>rubs temples</i>) <i>I don't get it. You know that I'm right. I'm the only one with the guts to do what has to be done to stop it. Why do you still try to fight me?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>whispers</i>) <i>I-I'm n-not.</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>Is it out of loyalty to your friends?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>I-i-it's-</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>Are you afraid of creatures of darkness?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>N-no-</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>... or have you already given up?</i>"
        [/message]
        {DELAY 400}
        [kill]
            id=Merthiaal
        [/kill]
        {DELAY 250}
        {COLOR_ADJUST 133 133 133}
        {DELAY 100}
        {COLOR_ADJUST 100 100 100}
        {DELAY 100}
        {COLOR_ADJUST 67 67 67}
        {DELAY 100}
        {COLOR_ADJUST 33 33 33}
        {DELAY 100}

        [for]
            array=placeholder
            [do]
                [unstore_unit]
                    variable=placeholder[$i]
                [/unstore_unit]
            [/do]
        [/for]
        {CLEAR_VARIABLE placeholder}

        {COLOR_ADJUST 0 0 0}
        {COLOR_ADJUST -13 -13 -13}
        {COLOR_ADJUST -26 -26 -26}
        {COLOR_ADJUST -38 -38 -38}
        {COLOR_ADJUST -50 -50 -50}
    [/event]
    [event]
        name=turn 8
        [message]
            speaker=Aryel
            message= _ "Damn it Yumi, just wake up. Please wake up."
        [/message]
    [/event]
    [event]
        name=side 5 turn 10

        [store_unit]
            [filter]
                side=1,3
            [/filter]
            variable=placeholder
            kill=yes
        [/store_unit]
        {COLOR_ADJUST 33 33 33}
        {DELAY 100}
        {COLOR_ADJUST 67 67 67}
        {DELAY 100}
        {COLOR_ADJUST 100 100 100}
        {DELAY 100}
        {COLOR_ADJUST 133 133 133}
        {DELAY 250}
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x,y=55,13
            radius=6
            multiturn=no
        [/lift_fog]
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]
        [sound_source]
            id=s11dark1
            x=55
            y=13
            sounds="dark-2.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
        [sound_source]
            id=s11dark2
            x=55
            y=13
            sounds="voices.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
        [unit]
            type=Guardian of Darkness
            id=Merthiaal
            name= _ "Merthiaal"
            x,y=56,12
            side=5
            random_traits=no
            facing=sw
        [/unit]
        {MODIFY_UNIT (id=Yumi) facing ne}
        {DELAY 250}
        [message]
            speaker=Merthiaal
            message= _ "<i>Do you trust them? Your friends.</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>They're... my friends...</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>Of course they are, dear.</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>How much do they mean to you? How much do you mean to them?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>Well-</i>"
        [/message]
        {DELAY 250}
        [sound_source]
            id=s11dark3
            x=55
            y=13
            sounds="dark-1.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
        {DELAY 250}
        [message]
            speaker=Yumi
            message= _ "(<i>holds head</i>)"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>They... care for me...</i>"
        [/message]
        [sound_source]
            id=s11dark4
            x=55
            y=13
            sounds="dark-3.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
        {DELAY 500}
        [message]
            speaker=Merthiaal
            message= _ "<i>Is something the matter?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>breathes deeply</i>) <i>N-no.</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>No?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>voice steadies</i>) <i>No.</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>You seem unsettled.</i>"
        [/message]
        {DELAY 500}
        [sound_source]
            id=s11dark5
            x=55
            y=13
            sounds="voices.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
        [sound_source]
            id=s11dark6
            x=55
            y=13
            sounds="dark-1.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
        [sound_source]
            id=s11dark7
            x=55
            y=13
            sounds="voices.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
        {DELAY 250}
        [message]
            speaker=Yumi
            message= _ "<i>I'm not.</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "(<i>frowns</i>) <i>If you say so.</i>"
        [/message]
        [sound_source]
            id=s11dark8
            x=55
            y=13
            sounds="dark-3.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
        {DELAY 250}
        [message]
            speaker=Merthiaal
            message= _ "<i>Others might not see it this way, but you know I'm doing the right thing. I'm trying to act before it's too late. Before we are all-</i>"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "(<i>looks up</i>)"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "(<i>eyes widen</i>)"
        [/message]
        [message]
            speaker=Merthiaal
            message= _ "<i>I must go. I have a... visitor.</i>"
        [/message]
        [kill]
            id=Merthiaal
        [/kill]
        {DELAY 500}
        {MODIFY_UNIT (id=Yumi) facing sw}
        [message]
            speaker=Yumi
            message= _ "(<i>bites lip</i>)"
        [/message]
        {DELAY 750}
        {MODIFY_UNIT (id=Yumi) facing ne}
        [message]
            speaker=Yumi
            message= _ "<i>But I...</i>"
        [/message]
        {DELAY 700}
        {MODIFY_UNIT (id=Yumi) facing sw}
        {DELAY 1250}

        [remove_sound_source]
            id=s11dark4
        [/remove_sound_source]
        [remove_sound_source]
            id=s11dark5
        [/remove_sound_source]
        [remove_sound_source]
            id=s11dark6
        [/remove_sound_source]
        [remove_sound_source]
            id=s11dark7
        [/remove_sound_source]
        [remove_sound_source]
            id=s11dark8
        [/remove_sound_source]
        {COLOR_ADJUST 133 133 133}
        {DELAY 100}
        {COLOR_ADJUST 100 100 100}
        {DELAY 100}
        {COLOR_ADJUST 67 67 67}
        {DELAY 100}
        {COLOR_ADJUST 33 33 33}
        {DELAY 100}
        [remove_sound_source]
            id=s11dark2
        [/remove_sound_source]
        [remove_sound_source]
            id=s11dark3
        [/remove_sound_source]

        [for]
            array=placeholder
            [do]
                [unstore_unit]
                    variable=placeholder[$i]
                [/unstore_unit]
            [/do]
        [/for]
        {CLEAR_VARIABLE placeholder}

        {COLOR_ADJUST 0 0 0}
        {COLOR_ADJUST -13 -13 -13}
        {COLOR_ADJUST -26 -26 -26}
        [remove_sound_source]
            id=s11dark1
        [/remove_sound_source]
        {COLOR_ADJUST -38 -38 -38}
        {COLOR_ADJUST -50 -50 -50}
        [set_variable]
            name=spirit_spawns
            value=0
        [/set_variable]
        [set_variable]
            name=monster_spawns
            value=1
        [/set_variable]
    [/event]
    [event]
        name=turn 11

        [fade_out_music][/fade_out_music]
        {REPLACE_SCENARIO_MUSIC "silence.ogg"}
        [message]
            speaker=Aryel
            message= _ "Yumi?"
        [/message]
        {DELAY 500}
        [move_unit]
            id=Aryel
            to_x,to_y=54,13
        [/move_unit]
        [redraw]
            clear_shroud=yes
        [/redraw]
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "<i>I swear I saw her move...</i>"
        [/message]
        {DELAY 500}
        {COLOR_ADJUST -50 -50 -50}
        {DELAY 50}
        {COLOR_ADJUST -75 -75 -75}
        {DELAY 50}
        {COLOR_ADJUST -100 -100 -100}
        {DELAY 50}
        {COLOR_ADJUST -125 -125 -125}
        {DELAY 50}
        {COLOR_ADJUST -150 -150 -150}
        {DELAY 50}
        {COLOR_ADJUST -175 -175 -175}
        [store_unit]
            [filter]
                side=1
                [not]
                    id=Aryel
                [/not]
            [/filter]
            variable=placeholder
            kill=yes
        [/store_unit]
        {DELAY 50}
        {COLOR_ADJUST -200 -200 -200}
        {DELAY 50}
        {COLOR_ADJUST -225 -225 -225}
        {DELAY 50}
        {COLOR_ADJUST -250 -250 -250}
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "Ugh, what is it now?"
        [/message]
        {DELAY 750}
        [kill]
            side=3
        [/kill]
        {DELAY 250}
        [move_unit]
            id=Yumi
            to_x,to_y=48,16
        [/move_unit]
        [message]
            speaker=Aryel
            message= _ "Wait!"
        [/message]
        [move_unit]
            id=Aryel
            to_x,to_y=49,16
        [/move_unit]
        [redraw]
            clear_shroud=yes
        [/redraw]
        {DELAY 1250}
        [message]
            speaker=Aryel
            message= _ "(<i>reaches forward</i>) Uh..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>gasps</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yu-"
        [/message]

        {COLOR_ADJUST -225 -225 -225}
        {COLOR_ADJUST -200 -200 -200}
        {COLOR_ADJUST -175 -175 -175}
        {COLOR_ADJUST -150 -150 -150}
        {COLOR_ADJUST -125 -125 -125}
        {COLOR_ADJUST -100 -100 -100}
        {COLOR_ADJUST -75 -75 -75}
        {COLOR_ADJUST -50 -50 -50}
        {COLOR_ADJUST -25 -25 -25}
        {WHITE_SCREEN}
        {REGENERATE_STARTING_TERRAIN}
        {GENERATE_TEXTURE}

        [terrain]
            x,y=55,13
            terrain=Aa^Fet
        [/terrain]
        [redraw][/redraw]
        {DELAY 250}

        [set_variable]
            name=x_loc
            rand=20..40
        [/set_variable]

        [set_variable]
            name=y_loc
            rand=10..30
        [/set_variable]

        [modify_unit]
            [filter]
                id=Yumi
            [/filter]
            side=6
            x,y=$x_loc,$y_loc
        [/modify_unit]
        [micro_ai]
            side=6
            ai_type=coward
            action=add
            id=Yumi
            [filter_second]
                side=1
            [/filter_second]
            distance=7
        [/micro_ai]
        [micro_ai]
            side=4
            ai_type=big_animals
            action=add
            [filter]
                side=4
            [/filter]

            [avoid_unit]
                id=Yumi
            [/avoid_unit]
        [/micro_ai]
        [modify_side]
            side=4
            hidden=no
        [/modify_side]

        {CLEAR_VARIABLE x_loc}
        {CLEAR_VARIABLE y_loc}
        [replace_schedule]
            {DEFAULT_SCHEDULE_24H}
        [/replace_schedule]

        {DELAY 250}
        {UNWHITE_SCREEN}

        [message]
            speaker=Aryel
            message= _ "-mi?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "... great. Now where did she go?"
        [/message]
        {DELAY 750}
        {TURN_UNIT5 "Aryel"}
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "(<i>sighs</i>) This kid..."
        [/message]

        [for]
            array=placeholder
            [do]
                [unstore_unit]
                    variable=placeholder[$i]
                [/unstore_unit]
            [/do]
        [/for]
        {CLEAR_VARIABLE placeholder}

        [set_variable]
            name=find_yumi
            value=1
        [/set_variable]
        [set_variable]
            name=turn_counter2
            value=1
        [/set_variable]

        {REPLACE_SCENARIO_MUSIC wanderer.ogg}
        {APPEND_MUSIC wind3.ogg}
        {APPEND_MUSIC greyskiesv2.ogg}

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Find Yumi and move Aryel next to her")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_FULL_CARRYOVER}
            {OBJECTIVE_NOTE ( _ "You may recruit ghosts by right clicking on a hex next to Aryel.")}
            {OBJECTIVE_NOTE ( _ "Yumi will flee if you get too close.")}
        [/objectives]
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=turn_counter2
                greater_than=0
            [/variable]
        [/filter_condition]
        {VARIABLE_OP turn_counter2 add 1}
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=monster_spawns
                numerical_equals=1
            [/variable]
        [/filter_condition]
        [store_unit]
            [filter]
                side=4
            [/filter]
            variable=monsterunits
        [/store_unit]
        [if]
            [variable]
                name=monsterunits.length
                greater_than=15
            [/variable]
            [then]
            [/then]
            [else]
                [fire_event]
                    name=spawnmonsters
                [/fire_event]
            [/else]
        [/if]
        {CLEAR_VARIABLE monsterunits}
    [/event]

    [event]
        name=spawnmonsters
        first_time_only=no
        [store_locations]
            variable=hill_hex
            terrain=Ha,Ha^Fpa,Ha^Fma
            [not]
                x=35-53
                y=15-32
            [/not]
        [/store_locations]
        [for]
            array=hill_hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..450
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..750
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..900
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        less_than=4
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Wolf") 4 $hill_hex[$i].x $hill_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=20
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Great Wolf") 4 $hill_hex[$i].x $hill_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hill_hex}
        [store_locations]
            variable=hill_hex
            terrain=Ms
            [not]
                x=35-53
                y=15-32
            [/not]
        [/store_locations]
        [for]
            array=hill_hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..450
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..600
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..700
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=1
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Direwolf") 4 $hill_hex[$i].x $hill_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hill_hex}
        [store_locations]
            variable=hill_hex
            terrain=Ms
            [not]
                x=35-53
                y=15-32
            [/not]
        [/store_locations]
        [for]
            array=hill_hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..5000
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..8000
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..9000
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=1
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Yeti") 4 $hill_hex[$i].x $hill_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hill_hex}
    [/event]

    [event]
        name=new turn
        first_time_only=yes
        [filter_condition]
            [variable]
                name=turn_counter2
                numerical_equals=4
            [/variable]
        [/filter_condition]
        [message]
            speaker=Aryel
            message= _ "Stop running! Can't you see? It's me! Your friend."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Come on..."
        [/message]
    [/event]
    [event]
        name=new turn
        first_time_only=yes
        [filter_condition]
            [variable]
                name=turn_counter2
                numerical_equals=7
            [/variable]
            [and]
                [variable]
                    name=find_yumi
                    numerical_equals=1
                [/variable]
            [/and]
        [/filter_condition]
        [message]
            speaker=Aryel
            message= _ "Do you really think I'm going to attack you or something?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Since when have I ever done anything to... well..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Okay, so I might be a bit brash sometimes, but you know I'm not going to actually hurt you."
        [/message]
        [message]
            speaker=Aryel
            message= _ "(<i>whispers</i>) You just worry me."
        [/message]
    [/event]
    [event]
        name=new turn
        first_time_only=yes
        [filter_condition]
            [variable]
                name=turn_counter2
                numerical_equals=10
            [/variable]
            [and]
                [variable]
                    name=find_yumi
                    numerical_equals=1
                [/variable]
            [/and]
        [/filter_condition]
        [message]
            speaker=Aryel
            message= _ "Yumi, please..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "We're friends, right?"
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            id=Aryel
            [filter_adjacent]
                id=Yumi
            [/filter_adjacent]
        [/filter]
        [filter_condition]
            [variable]
                name=find_yumi
                numerical_equals=1
            [/variable]
        [/filter_condition]

        [set_variable]
            name=find_yumi
            value=2
        [/set_variable]

        [message]
            speaker=Aryel
            message= _ "Stop running, will you?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>squirms</i>)"
        [/message]
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            [filter_second]
                id=Yumi
            [/filter_second]
            [primary_attack]
                range=ranged
            [/primary_attack]
            [secondary_attack]
                name=faerie fire
            [/secondary_attack]
            animate=yes
            amount=0
        [/harm_unit]
        [message]
            speaker=Aryel
            message= _ "Ow! Yumi, seriously! Stop struggling!"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>blinks rapidly</i>)"
        [/message]
        {DELAY 1000}
        [message]
            speaker=Yumi
            message= _ "(<i>eyes flutter</i>)"
        [/message]
        {DELAY 500}
        [modify_unit]
            [filter]
                id=Yumi
            [/filter]
            side=1
        [/modify_unit]
        {DELAY 500}
        [message]
            speaker=Yumi
            message= _ "(<i>gasps</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Have you come to your senses yet?"
        [/message]
        {DELAY 1000}
        [message]
            speaker=Aryel
            message= _ "Are you even going to say anything?"
        [/message]
        {DELAY 1000}
        [message]
            speaker=Aryel
            message= _ "Yumi, you haven't spoken in <i>weeks</i>. Like it or not, you are going to tal-"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>whispers</i>) S-sorry..."
        [/message]
        {DELAY 1500}
        [message]
            speaker=Aryel
            message= _ "(<i>shakes head slowly</i>) You're unbelievable."
        [/message]
        {DELAY 1000}
        [message]
            speaker=Aryel
            message= _ "Are you willing to talk to me yet?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "I can't."
        [/message]
        [message]
            speaker=Aryel
            message= _ "What do you mean you can't?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "I just can't."
        [/message]
        {DELAY 1500}
        [message]
            speaker=Yumi
            message= _ "(<i>pouts</i>) Are you mad at me?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "(<i>sighs</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "I don't even..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "... just..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "... nevermind."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I'm sorry..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Maybe you should just leave me..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Don't say stupid things like that."
        [/message]
        [message]
            speaker=Yumi
            message= _ "But-"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Like it or not, we're not leaving you behind. Don't even think about it."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I'm just a burden..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "You're not."
        [/message]
        [message]
            speaker=Yumi
            message= _ "But you- you..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "I don't hate you, if that's what you're trying to say. And I'm not mad either."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>tilts head</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "... just very frustrated. Ugh. It doesn't matter. Don't worry about it."
        [/message]
        {DELAY 1250}
        [message]
            speaker=Aryel
            message= _ "Come on, let's go back to camp where everyone else is."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Which way?"
        [/message]
        {DELAY 250}
        {TURN_UNIT3 "Aryel"}
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "... I hate everything."
        [/message]
        {DELAY 500}
        {REPEAT 3 ({PLAY_SOUND "gust.wav"})}
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "And a snowstorm is coming. Wonderful. Looks like we're lost."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Can I give up now?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "No. Let's just head back to where we were before. At least we'll have some shelter from the trees. No arguments, okay?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Okay..."
        [/message]

        [set_variable]
            name=turn_counter2
            value=0
        [/set_variable]
        [set_variable]
            name=turn_counter
            value=1
        [/set_variable]

        [set_variable]
            name=added_turns
            value=10
        [/set_variable]

        {VARIABLE_OP added_turns sub 25}
        {VARIABLE_OP added_turns add $turn_number}

        [if]
            [variable]
                name=added_turns
                less_than=3
            [/variable]
            [then]
                [set_variable]
                    name=added_turns
                    value=3
                [/set_variable]
            [/then]
        [/if]
        [modify_turns]
            add=$added_turns
        [/modify_turns]
        {CLEAR_VARIABLE added_turns}

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Move Yumi and Aryel near the starting location (55,13)")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_FULL_CARRYOVER}
            {OBJECTIVE_NOTE ( _ "You may recruit ghosts by right clicking on a hex next to Aryel.")}
        [/objectives]
    [/event]
    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=turn_counter
                greater_than=0
            [/variable]
        [/filter_condition]
        {VARIABLE_OP turn_counter add 1}

        [if]
            [variable]
                name=turn_counter
                less_than=10
            [/variable]
            [then]
                [set_variable]
                    name=color_adjust1
                    value=-22
                [/set_variable]
                [set_variable]
                    name=color_adjust2
                    value=-18
                [/set_variable]
                {VARIABLE_OP color_adjust1 mult $turn_counter}
                {VARIABLE_OP color_adjust2 mult $turn_counter}
                {PLAY_SOUND "gust.wav"}
                [color_adjust]
                    red=$color_adjust1
                    green=$color_adjust1
                    blue=$color_adjust2
                [/color_adjust]
                {CLEAR_VARIABLE color_adjust1}
                {CLEAR_VARIABLE color_adjust2}
            [/then]
        [/if]
    [/event]

    #ifdef HARD
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 2 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 1 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 2 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 1 ("blue_spawns")}
    #endif
    #ifdef NORMAL
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 3 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 3 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 3 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 3 ("blue_spawns")}
    #endif
    #ifdef EASY
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 4 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 4 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 4 ("blue_spawns")}
    {ADVANCED_RESPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 13 7 4 ("blue_spawns")}
    #endif

    [event]
        name=moveto
        first_time_only=no
        [filter]
            id=Yumi,Aryel
            [filter_location]
                x,y=55,13
                radius=7
            [/filter_location]
        [/filter]
        [filter_condition]
            [variable]
                name=find_yumi
                numerical_equals=2
            [/variable]
            [and]
                [have_unit]
                    id=Yumi
                    [filter_location]
                        x,y=55,13
                        radius=7
                    [/filter_location]
                [/have_unit]
            [/and]
            [and]
                [have_unit]
                    id=Aryel
                    [filter_location]
                        x,y=55,13
                        radius=7
                    [/filter_location]
                [/have_unit]
            [/and]
        [/filter_condition]
        [set_variable]
            name=find_yumi
            value=3
        [/set_variable]
        [set_variable]
            name=turn_counter1
            value=1
        [/set_variable]
        [set_variable]
            name=blue_spawns
            value=1
        [/set_variable]
        [set_variable]
            name=monster_spawns
            value=0
        [/set_variable]
        [store_unit]
            [filter]
                side=4
            [/filter]
            variable=monsters
            kill=yes
        [/store_unit]
        {CLEAR_VARIABLE monsters}

        [modify_side]
            side=3
            color=blue
        [/modify_side]
        [message]
            speaker=Aryel
            message= _ "Whew. Okay. I guess we can just hang out here for a bit while the snowstorm passes."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>shivers</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yes? What is it?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "I feel something."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Like..."
        [/message]

        {DELAY 500}
        {SPAWN ("Demon Nightmare","Demon Dreamweaver") 3 58 11}
        {DELAY 500}
        {SPAWN ("Demon Nightmare","Demon Dreamweaver") 3 55 16}
        {DELAY 500}
        {SPAWN ("Demon Nightmare","Demon Dreamweaver") 3 52 11}
        [redraw][/redraw]
        [scroll_to]
            x,y=55,13
        [/scroll_to]
        {DELAY 900}
        [message]
            speaker=Aryel
            message= _ "Oh. Not this again..."
        [/message]

        [modify_turns]
            value=-1
        [/modify_turns]

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Survive")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_FULL_CARRYOVER}
            {OBJECTIVE_NOTE ( _ "You may recruit ghosts by right clicking on a hex next to Aryel.")}
            {OBJECTIVE_NOTE ( _ "Avoid moving outside of the starting region (7 unit radius around 55,13)")}
        [/objectives]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            id=Yumi,Aryel
            [not]
                [filter_location]
                    x,y=55,13
                    radius=7
                [/filter_location]
            [/not]
        [/filter]
        [filter_condition]
            [variable]
                name=turn_counter1
                greater_than=0
            [/variable]
        [/filter_condition]
        {PLAY_SOUND "gust.wav"}
        [harm_unit]
            [filter]
                x,y=$x1,$y1
            [/filter]
            amount=5
            animate=yes
            kill=no
        [/harm_unit]
        [modify_unit]
            [filter]
                x,y=$x1,$y1
            [/filter]
            attacks_left=0
            moves=0
            [status]
                slowed=yes
            [/status]
        [/modify_unit]
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [store_unit]
            [filter]
                side=3
            [/filter]
            variable=bluedemons
        [/store_unit]
        [filter_condition]
            [variable]
                name=blue_spawns
                greater_than=0
            [/variable]
        [/filter_condition]
        [for]
            array=bluedemons
            [do]
                [set_variable]
                    name=kill_unit
                    rand=1..6
                [/set_variable]
                [if]
                    [variable]
                        name=kill_unit
                        numerical_equals=1
                    [/variable]
                    [then]
                        [kill]
                            x,y=$bluedemons[$i].x,$bluedemons[$i].y
                        [/kill]
                    [/then]
                [/if]
                {CLEAR_VARIABLE kill_unit}
            [/do]
        [/for]
        {CLEAR_VARIABLE bluedemons}
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=turn_counter1
                greater_than=0
            [/variable]
        [/filter_condition]
        {VARIABLE_OP turn_counter1 add 1}
    [/event]
    [event]
        name=new turn
        first_time_only=yes
        [filter_condition]
            [variable]
                name=turn_counter1
                numerical_equals=3
            [/variable]
        [/filter_condition]
        [message]
            speaker=Yumi
            message= _ "(<i>holds head</i>)"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>looks up</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "What is it?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "I thought I felt someone coming, but they're gone now."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Your voice is hoarse."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>shrugs</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "And you look kind of pale."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>eyes shift away</i>) I'm just... tired."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Are you okay? Please be honest with me, Yumi."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I'm fine."
        [/message]
        [message]
            speaker=Aryel
            message= _ "... <i>like anyone would believe that.</i>"
        [/message]
    [/event]
    [event]
        name=new turn
        first_time_only=yes
        [filter_condition]
            [variable]
                name=turn_counter1
                numerical_equals=7
            [/variable]
        [/filter_condition]
        {PLAY_SOUND "fire.wav"}
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "Did you hear that?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Isn't that-"
        [/message]
        {PLAY_SOUND "fire.wav"}
        [store_unit]
            [filter]
                side=3
            [/filter]
            variable=bluedemons
        [/store_unit]
        [for]
            array=bluedemons
            [do]
                [set_variable]
                    name=kill_unit
                    rand=1..3
                [/set_variable]
                [if]
                    [variable]
                        name=kill_unit
                        numerical_equals=1
                    [/variable]
                    [then]
                        [kill]
                            x,y=$bluedemons[$i].x,$bluedemons[$i].y
                        [/kill]
                    [/then]
                [/if]
                {CLEAR_VARIABLE kill_unit}
            [/do]
        [/for]
        {CLEAR_VARIABLE bluedemons}
        {DELAY 1000}
        {PLAY_SOUND "fire.wav"}
        [store_unit]
            [filter]
                side=3
            [/filter]
            variable=bluedemons
        [/store_unit]
        [for]
            array=bluedemons
            [do]
                [set_variable]
                    name=kill_unit
                    rand=1..3
                [/set_variable]
                [if]
                    [variable]
                        name=kill_unit
                        numerical_equals=1
                    [/variable]
                    [then]
                        [kill]
                            x,y=$bluedemons[$i].x,$bluedemons[$i].y
                        [/kill]
                    [/then]
                [/if]
                {CLEAR_VARIABLE kill_unit}
            [/do]
        [/for]
        {CLEAR_VARIABLE bluedemons}
        {DELAY 500}
        {PLAY_SOUND "fire.wav"}
        [store_unit]
            [filter]
                side=3
            [/filter]
            variable=bluedemons
            kill=yes
        [/store_unit]
        {CLEAR_VARIABLE bluedemons}

        [set_variable]
            name=esther.hitpoints
            rand=4..9
        [/set_variable]
        {DELAY 500}
        [unstore_unit]
            variable=esther
            find_vacant=yes
            animate=yes
            x,y=61,18
        [/unstore_unit]
        [redraw]
            clear_shroud=yes
        [/redraw]
        {MODIFY_UNIT (id=Yumi) facing se}
        {MODIFY_UNIT (id=Aryel) facing se}
        [scroll_to]
            x,y=61,18
        [/scroll_to]
        {DELAY 750}
        [message]
            speaker=Aryel
            message= _ "Oh my god."
        [/message]
        [message]
            speaker=Esther
            message= _ "(<i>shivering</i>) I-I've been l-looking e-everywhere for y-you t-two."
        [/message]
        [move_unit]
            id=Esther
            to_x,to_y=57,16
        [/move_unit]
        {DELAY 250}
        [move_unit]
            id=Aryel
            to_x,to_y=57,16
        [/move_unit]
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "Esther! You're freezing to death! Why in the world would you fly through that storm just to find us?"
        [/message]
        [message]
            speaker=Esther
            message= _ "(<i>teeth chatter</i>)"
        [/message]
        {DELAY 500}
        [move_unit]
            id=Yumi
            to_x,to_y=57,16
        [/move_unit]
        {DELAY 500}
        [message]
            speaker=Yumi
            message= _ "(<i>bites lip</i>)"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>This is all my fault...</i>"
        [/message]
        [message]
            speaker=Esther
            message= _ "I-I... needed to make s-sure that-"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Shush. J-just... (<i>sighs</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Let's make a fire and warm you up."
        [/message]
        [message]
            speaker=Esther
            message= _ "O-okay."
        [/message]
        [message]
            speaker=Aryel
            message= _ "(<i>turns</i>) And don't you feel guilty about this. You hear me?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>looks away</i>)"
        [/message]

        [store_unit]
            [filter]
                id=Esther
            [/filter]
            variable=esther
        [/store_unit]
        [store_unit]
            [filter]
                id=Yumi
            [/filter]
            variable=yumi
        [/store_unit]
        [store_unit]
            [filter]
                id=Aryel
            [/filter]
            variable=aryel
        [/store_unit]

        #ifdef EASY
        {VARIABLE_OP esther.experience add 150}
        {VARIABLE_OP yumi.experience add 150}
        {VARIABLE_OP aryel.experience add 150}

        [unstore_unit]
            variable=esther
            find_vacant=no
            text= _ "+150 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        [unstore_unit]
            variable=yumi
            find_vacant=no
            text= _ "+150 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        [unstore_unit]
            variable=aryel
            find_vacant=no
            text= _ "+150 XP"
            red,green,blue=255,0,255
        [/unstore_unit]

        {CLEAR_VARIABLE esther}
        {CLEAR_VARIABLE yumi}
        {CLEAR_VARIABLE aryel}
        #endif
        #ifdef NORMAL
        {VARIABLE_OP esther.experience add 100}
        {VARIABLE_OP yumi.experience add 100}
        {VARIABLE_OP aryel.experience add 100}

        [unstore_unit]
            variable=esther
            find_vacant=no
            text= _ "+100 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        [unstore_unit]
            variable=yumi
            find_vacant=no
            text= _ "+100 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        [unstore_unit]
            variable=aryel
            find_vacant=no
            text= _ "+100 XP"
            red,green,blue=255,0,255
        [/unstore_unit]

        {CLEAR_VARIABLE esther}
        {CLEAR_VARIABLE yumi}
        {CLEAR_VARIABLE aryel}
        #endif
        #ifdef HARD
        {VARIABLE_OP esther.experience add 25}
        {VARIABLE_OP yumi.experience add 25}
        {VARIABLE_OP aryel.experience add 25}

        [unstore_unit]
            variable=esther
            find_vacant=no
            text= _ "+25 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        [unstore_unit]
            variable=yumi
            find_vacant=no
            text= _ "+25 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        [unstore_unit]
            variable=aryel
            find_vacant=no
            text= _ "+25 XP"
            red,green,blue=255,0,255
        [/unstore_unit]

        {CLEAR_VARIABLE esther}
        {CLEAR_VARIABLE yumi}
        {CLEAR_VARIABLE aryel}
        #endif

        {DELAY 500}

        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 100}
            next_scenario=12_Siege_of_Fort_Helemoor
        [/endlevel]
    [/event]

    [event]
        name=victory
        [clear_menu_item]
            id=recruit_ghost
        [/clear_menu_item]
        {CLEAR_VARIABLE esther}
        {CLEAR_VARIABLE new_terrain}
        {CLEAR_VARIABLE spirit_spawns}
        {CLEAR_VARIABLE monster_spawns}
        {CLEAR_VARIABLE blue_spawns}
        {CLEAR_VARIABLE find_yumi}
        {CLEAR_VARIABLE turn_counter}
        {CLEAR_VARIABLE turn_counter1}
        {CLEAR_VARIABLE turn_counter2}
    [/event]
    [event]
        name=last breath
        [filter]
            id=Yumi
        [/filter]
        [message]
            speaker=Yumi
            message= _ "(<i>gasps</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi!"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
    [event]
        name=last breath
        [filter]
            id=Aryel
        [/filter]
        [message]
            speaker=Aryel
            message= _ "I-I-... (<i>chokes</i>)"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
    [event]
        name=time over
        [if]
            [variable]
                name=find_yumi
                numerical_equals=1
            [/variable]
            [then]
                [kill]
                    id=Yumi
                [/kill]
                [message]
                    speaker=Aryel
                    message= _ "Well that's just great. Now she's disappeared. Ugh."
                [/message]
                [endlevel]
                    result=defeat
                [/endlevel]
            [/then]
            [else]
                {PLAY_SOUND "gust.wav"}
                [message]
                    speaker=Aryel
                    message= _ "We're going to freeze to death out here..."
                [/message]
                [endlevel]
                    result=defeat
                [/endlevel]
            [/else]
        [/if]

    [/event]
[/scenario]

#undef GENERATE_HILL
#undef GENERATE_FOREST
#undef GENERATE_VILLAGE
#undef GENERATE_MOUNTAIN
#undef GENERATE_SNOW
#undef GENERATE_TEXTURE
#undef REGENERATE_STARTING_TERRAIN