#textdomain wesnoth-Genesis
[scenario]
    id=04f_Glacial_Shrine
    name= _ "Glacial Shrine"
    map_data="{~add-ons/Genesis/episode1/maps/04f_Glacial_Shrine.map}"
    next_scenario=03_Northlands
    victory_when_enemies_defeated=no
    {TURNS 17 16 15}
    {DEFAULT_SCHEDULE_24H}

    {SCENARIO_MUSIC loyalists.ogg}
    {EXTRA_SCENARIO_MUSIC knolls.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}
    {FAE_DEATHS}

    [side]
        {PLAYER_FAE}
        side=1
        controller=human
        recruit=Spearman,Bowman,Horseman,Cavalryman
        {GOLD 150 120 60}
        shroud=yes
        fog=yes
    [/side]

    [side]
        type=General
        id=Humanleader4f
        generate_name=yes
        canrecruit=yes
        side=2
        recruit=
        gold=100
        shroud=yes
        fog=yes
        {DEFENSIVE_SIDE}
        {HUMAN_ALLY}
    [/side]

    [side]
        side=3
        {MONSTER_SIDE}
        {AGGRESSIVE_SIDE}
    [/side]

    [side]
        no_leader=yes
        side=4
        {SPIRIT_ENEMY_SIDE}
        {AGGRESSIVE_SIDE}
    [/side]

#define GENERATE_MOUNTAIN
    [store_locations]
        variable=ice_hex
        terrain=Ai,Ha
        [not]
            [filter_adjacent_location]
                terrain=Xu
            [/filter_adjacent_location]
        [/not]
    [/store_locations]
    [for]
        array=ice_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=$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..4
            [/set_variable]
            [if]
                [variable]
                    name=change_terrain
                    less_than=4
                [/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..4
            [/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
        [not]
            [filter_adjacent_location]
                terrain=Xu
            [/filter_adjacent_location]
        [/not]
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..20
            [/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..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=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
        [not]
            [filter_adjacent_location]
                terrain=Xu
            [/filter_adjacent_location]
        [/not]
    [/store_locations]
    [for]
        array=ice_hex
        [do]
            [set_variable]
                name=change_terrain
                rand=1..40
            [/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..15
            [/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..6
            [/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
        [not]
            [filter_adjacent_location]
                terrain=Xu
            [/filter_adjacent_location]
        [/not]
    [/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=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=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}
#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

    {PLACE_IMAGE items/crystal-glyph-message.png 5 9}
    {PLACE_IMAGE items/crystal-glyph-message.png 11 5}
    {PLACE_IMAGE items/crystal-glyph-message.png 3 7}
    {PLACE_IMAGE items/crystal-glyph-message.png 9 3}
    {PLACE_IMAGE items/crystal-glyph-message.png 4 3}

    # generate some terrain
    [event]
        name=prestart
        {GENERATE_MOUNTAIN}
        {GENERATE_HILL}
        {GENERATE_FOREST}
        {GENERATE_SNOW}
        {GENERATE_VILLAGE}
        {GUARDIAN_NOID ("Iron Mauler") 2 31 20}
        {GUARDIAN_NOID ("Iron Mauler") 2 29 21}
        {GUARDIAN_NOID ("Iron Mauler") 2 28 22}
        {GUARDIAN_NOID ("Iron Mauler") 2 30 22}
        {GUARDIAN_NOID ("Iron Mauler") 2 32 21}
        [set_variable]
            name=turn_dmg
            value=0
        [/set_variable]
        [set_variable]
            name=num_found
            value=0
        [/set_variable]
        [if]
            [variable]
                name=black_cauldron
                numerical_equals=1
            [/variable]
            [then]
                [set_recruit]
                    side=1
                    recruit=Ghost,Skeleton,Skeleton Archer,Bowman,Spearman,Horseman,Cavalryman
                [/set_recruit]
            [/then]
        [/if]
    [/event]

    # let's do spawns a bit differently this time
    [event]
        name=new turn
        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..500
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..800
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..1000
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        less_than=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Wolf") 3 $hill_hex[$i].x $hill_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=20
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Great Wolf") 3 $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..600
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..900
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..1100
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=1
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Direwolf") 3 $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..2000
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..3000
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..3500
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=1
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Yeti") 3 $hill_hex[$i].x $hill_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hill_hex}
        [store_locations]
            variable=ice_hex
            terrain=Aa,Ai
            [not]
                x=35-53
                y=15-32
            [/not]
            [and]
                [not]
                    [filter_adjacent_location]
                        terrain=Xu
                    [/filter_adjacent_location]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=ice_hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..300
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..400
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..450
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=1
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Ghost") 4 $ice_hex[$i].x $ice_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE ice_hex}
    [/event]

    # turn on turn_dmg to invoke this event
    # for snowstorm
    [event]
        name=new turn
        first_time_only=no
        [if]
            [variable]
                name=turn_dmg
                numerical_not_equals=0
            [/variable]
            [then]
                [store_unit]
                    [filter]
                        side=1,2
                        [not]
                            id=Yumi
                        [/not]
                        [and]
                            [not]
                                race=undead
                            [/not]
                        [/and]
                    [/filter]
                    variable=frozen_unit
                [/store_unit]
                {PLAY_SOUND "gust.wav"}
            [/then]
        [/if]
        [for]
            array=frozen_unit
            [do]
                [if]
                    [variable]
                        name=frozen_unit[$i].hitpoints
                        greater_than=$turn_dmg
                    [/variable]

                    [then]
                        {VARIABLE_OP frozen_unit[$i].hitpoints sub $turn_dmg}
                    [/then]
                    [else]
                        {VARIABLE frozen_unit[$i].hitpoints 1}
                    [/else]
                [/if]
                [unstore_unit]
                    variable=frozen_unit[$i]
                    find_vacant=no
                    text= _ "CHILLED"
                    blue=255
                [/unstore_unit]
            [/do]
        [/for]
        {CLEAR_VARIABLE frozen_unit}
    [/event]

    [event]
        name=recruit
        first_time_only=no
        [filter]
            race=human
            side=1
        [/filter]
        [object]
            silent=yes
            [filter]
                x,y=$x1,$y1
            [/filter]
            [effect]
                apply_to=movement_costs
                replace=yes
                [movement_costs]
                    frozen=1
                [/movement_costs]
            [/effect]
            [effect]
                apply_to=defense
                replace=yes
                [defense]
                    frozen=70
                [/defense]
            [/effect]
        [/object]
    [/event]

    [event]
        name=start
        [if]
            [variable]
                name=black_cauldron
                numerical_equals=0
            [/variable]
            [then]
                {RECALL_YUMI_NOLOC}

                [objectives]
                    {OBJECTIVE_VICTORY  ( _ "Explore to the northwest")}
                    {OBJECTIVE_DEFEAT  ( _ "Death of Esther")}
                    {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
                    {OBJECTIVE_DEFEAT ( _ "Turns run out")}
                    {OBJECTIVE_CARRYOVER}
                    {OBJECTIVE_NOTE ( _ "Human recruits will be modified to gain bonus movement and defense on snow and ice.")}
                [/objectives]
            [/then]
            [else]
                {RECALL_YUMI_NOLOC}
                {RECALL_ARYEL_NOLOC}

                [objectives]
                    {OBJECTIVE_VICTORY  ( _ "Explore to the northwest")}
                    {OBJECTIVE_DEFEAT  ( _ "Death of Esther")}
                    {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
                    {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
                    {OBJECTIVE_DEFEAT ( _ "Turns run out")}
                    {OBJECTIVE_CARRYOVER}
                    {OBJECTIVE_NOTE ( _ "Human recruits will be modified to gain bonus movement and defense on snow and ice.")}
                [/objectives]
            [/else]
        [/if]

        [message]
            speaker=Humanleader4f
            message= _ "Welcome to Fort Helemoor, faeries. What brings you here?"
        [/message]
        [message]
            speaker=Esther
            message= _ "One of your men told us that there was some sort of temple a little ways away from here."
        [/message]
        [message]
            speaker=Humanleader4f
            message= _ "Ah, yes, that place. As far as our notes document, that place has been devoid of all life."
        [/message]
        [message]
            speaker=Esther
            message= _ "For how long?"
        [/message]
        [message]
            speaker=Humanleader4f
            message= _ "This fort has stood for several decades, but we have never ventured into the temple. Supposedly, my predecessor led an excursion there, but all they found were some indecipherable glyphs which were of no use to us. However, perhaps you may have better luck with them. If you wish to go, I can send some men with you to keep you safe. The wolves can be dangerous in large numbers."
        [/message]
        [message]
            speaker=Esther
            message= _ "Maybe. Why the interest in the temple now?"
        [/message]
        [message]
            speaker=Humanleader4f
            message= _ "Not now, in particular, but rarely do faeries such as yourselves come up here. It is a bit of an opportunity for my guards, I suppose. A little excursion now and then is healthy."
        [/message]
        [message]
            speaker=Esther
            message= _ "Alright. Let's get going, then."
        [/message]
    [/event]
    [event]
        name=sighted
        first_time_only=yes
        [filter]
            type=Yeti
        [/filter]

        [message]
            speaker=unit
            message= _ "Raawrrrgg!"
        [/message]
        [message]
            speaker=Esther
            message= _ "Oh dear."
        [/message]
        [if]
            [variable]
                name=black_cauldron
                numerical_equals=1
            [/variable]
            [then]
                [message]
                    speaker=Aryel
                    message= _ "Better stay clear of that thing."
                [/message]
            [/then]
        [/if]
    [/event]
    [event]
        name=sighted
        first_time_only=yes
        [filter]
            side=4
        [/filter]
        [message]
            speaker=Esther
            message= _ "More spirits, huh."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Looks like they're the ghosts of people who died out here... or got eaten by the wolves."
        [/message]
    [/event]
    [event]
        name=turn 5 end

        #ifndef HARD
            [set_variable]
                name=turn_dmg
                value=2
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_dmg
                value=3
            [/set_variable]
        #endif

        {COLOR_ADJUST 0 0 30}

        [message]
            speaker=Yumi
            message= _ "It's getting colder. Esther, I think a snowstorm is coming."
        [/message]
        [message]
            speaker=Esther
            message= _ "We should start moving faster."
        [/message]
    [/event]
    [event]
        name=turn 9 end

        #ifndef HARD
            [set_variable]
                name=turn_dmg
                value=4
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_dmg
                value=6
            [/set_variable]
        #endif

        {COLOR_ADJUST 0 0 60}

        [message]
            speaker=Yumi
            message= _ "Are you... okay? You look kind of pale."
        [/message]
        [message]
            speaker=Esther
            message= _ "(<i>shivers</i>) It's cold."
        [/message]
        [if]
            [variable]
                name=black_cauldron
                numerical_equals=1
            [/variable]
            [then]
                [message]
                    speaker=Aryel
                    message= _ "We'll need to get to that temple quickly before Esther freezes out here."
                [/message]
            [/then]
        [/if]
    [/event]
    [event]
        name=turn 13 end

        #ifndef HARD
            [set_variable]
                name=turn_dmg
                value=6
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_dmg
                value=8
            [/set_variable]
        #endif

        {COLOR_ADJUST 0 0 90}

        [message]
            speaker=Esther
            message= _ "W-we r-really need t-to hur-ry up."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x=4,9,11,3,5
            y=3,3,5,7,9
            [and]
                [not]
                    id=Esther,Aryel,Yumi
                [/not]
                [not]
                    race=undead
                [/not]
            [/and]
        [/filter]

        [message]
            speaker=unit
            message= _ "I can't make sense of this."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x,y=11,5
            id=Esther,Aryel,Yumi
        [/filter]

        [message]
            speaker=narrator
            message= _ "Of all the races to emerge following the rebirth after the War of the First Gods, the fae most closely resemble the Guardians of the new universe. While the Guardians are typically thought of as the most powerful entities in the universe, barring the Arcane Lord himself, the most powerful among the fae can reach levels of power similar to those of the Guardians. It is not known how the fae emerged nor where their power stems from."
        [/message]

        {VARIABLE_OP num_found add 1}
    [/event]
    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x,y=5,9
            id=Esther,Aryel,Yumi
        [/filter]

        [message]
            speaker=narrator
            message= _ "The demons are perhaps the most diverse and widespread race, although each subgroup of demons is generally significantly homogeneous. Among the demons, there exist powerful demon lords who possess powers apparently unrelated to those of normal demons, raising questions about the nature of demonkind itself."
        [/message]

        {VARIABLE_OP num_found add 1}
    [/event]
    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x,y=9,3
            id=Esther,Aryel,Yumi
        [/filter]

        [message]
            speaker=narrator
            message= _ "There exist ten worlds, each of which is presided over by a Guardian. It is unclear what, exactly, the Guardians are and what their role is in governing these worlds. Despite their name, the Guardians are often warlike and apathetic toward mortal races, with the exception of Xia'el, the Guardian of Earth, and Uria, the Guardian of Life. They are at odds with those like the Guardian of Water, Valdir, who revel only in bloodshed and chaos."
        [/message]

        {VARIABLE_OP num_found add 1}
    [/event]
    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x,y=3,7
            id=Esther,Aryel,Yumi
        [/filter]

        [message]
            speaker=narrator
            message= _ "Each of the ten worlds is associated with one of the ten aspects of the universe. Irdya's aspect is that of Earth, the shelter and promise of life, which fosters its growth and allows it to prosper. Closely related is the aspect of Life itself, which is connected to the world of Ethea. The two Guardians of these worlds, Xia'el and Uria, are purported to be the favorites of the Arcane Lord, Yarae."
        [/message]

        {VARIABLE_OP num_found add 1}
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x,y=4,3
            id=Esther,Aryel
        [/filter]
        [filter_condition]
            [variable]
                name=num_found
                numerical_not_equals=4
            [/variable]
        [/filter_condition]

        [message]
            speaker=unit
            message= _ "I can't seem to decipher this one, but the energies are similar to those on the other glyphs. Maybe we need to look at the others first."
        [/message]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            x,y=4,3
            id=Yumi
        [/filter]
        [filter_condition]
            [variable]
                name=num_found
                numerical_not_equals=4
            [/variable]
        [/filter_condition]

        [message]
            speaker=Yumi
            message= _ "This one doesn't make sense..."
        [/message]
    [/event]
    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x,y=4,3
            id=Esther,Aryel,Yumi
        [/filter]
        [filter_condition]
            [variable]
                name=num_found
                numerical_equals=4
            [/variable]
        [/filter_condition]

        [message]
            speaker=narrator
            message= _ "In the beginning, there existed only the First Gods."
        [/message]
        [message]
            speaker=narrator
            message= _ "Powerful and knowledgeable, they built a mighty society stretching across the entire universe to probe its secrets. Yet, despite their wisdom, the day came when a cataclysm ravaged their civilization, leaving almost nothing behind in its wake. Some surmise that this was a corruption in the universe itself. Other speculate that the First Gods themselves had a hand in their own demise."
        [/message]
        [message]
            speaker=narrator
            message= _ "On the precipice of annihilation, the remnants of the First Gods banded together created the new world. Among them, one is known to us as Yarae. Through his efforts, life was birthed in the new universe... ten worlds, each corresponding to an aspect of creation, and ten Guardians to govern them."
        [/message]
        [message]
            speaker=narrator
            message= _ "However, the Guardians do not possess the same power as the First Gods, who themselves could not avoid utter destruction. Our worlds are chaos and death, where each Guardian curries favor with Yarae in hopes that he will reveal to them the secret of creation - how to combine the elements and to create life itself. Yet in the end, he is merely a remnant of a band of false idols who could not save themselves."
        [/message]
        [message]
            speaker=narrator
            message= _ "Yarae is the demented king of a long dead civilization who the Guardians accept as lord due to reputation only. To stop the force that destroyed even his people, we must find something that will allow us to rise beyond the power of Yarae and the First Gods, that will allow us to dispel the encroaching void and prevent the destruction of our world."
        [/message]
        [message]
            speaker=narrator
            message= _ "But the other Guardians fail to realize this! They are too self-absorbed with their own agendas! They know only how to play with those petty little mortal races, to war with one another as sport. They are blind to the trepidation that awaits us, thinking Yarae has the power, the wisdom to save us... but these eyes that have peered into the depths of the void know that there is only one way to stop it. It's up to me."
        [/message]

        [if]
            [variable]
                name=black_cauldron
                numerical_equals=1
            [/variable]
            [then]
                [message]
                    speaker=Esther
                    message= _ "Whoa. The last few lines were really different."
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "Sounds like a bunch of rambling to me."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "Maybe, but what if it's true? What if our universe is really falling apart and we can't stop it?"
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "There's always talk about the 'corruption of the universe' or whatnot. Sure, it could be true, but what are we supposed to do about it?"
                [/message]
                [message]
                    speaker=Esther
                    message= _ "I guess there's too much that we don't know. Not yet, at least."
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "The Guardians tend to do their own thing. Even if we were to try to get involved, I doubt they'd let us help. Besides, it might just turn out to be a bunch of crap."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "But don't you think that whoever wrote this is somehow linked to the demons?"
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "Isn't that a stretch?"
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "I... think Esther's right."
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "Really."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "Well, the demons are after us for some reason. Not just any normal faerie, but specifically us. It's not impossible that we possess powers that the Guardians are interested in-"
                [/message]
                [message]
                    speaker=Aryel
                    message= _ "(<i>looks around</i>) Yes, yes. It's not impossible. But let's discuss this some other time, when there are less people around."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "Oops, yeah. And we should probably get out of here before we get snowed in too hard."
                [/message]

                [store_unit]
                    [filter]
                        id=Aryel
                    [/filter]
                    variable=aryel
                [/store_unit]

                #ifdef EASY
                {VARIABLE_OP aryel.experience add 125}
                [unstore_unit]
                    variable=aryel
                    find_vacant=no
                    text= _ "+125 XP"
                    red,green,blue=255,0,255
                [/unstore_unit]
                #endif
                #ifdef NORMAL
                {VARIABLE_OP aryel.experience add 110}
                [unstore_unit]
                    variable=aryel
                    find_vacant=no
                    text= _ "+110 XP"
                    red,green,blue=255,0,255
                [/unstore_unit]
                #endif
                #ifdef HARD
                {VARIABLE_OP aryel.experience add 55}
                [unstore_unit]
                    variable=aryel
                    find_vacant=no
                    text= _ "55 XP"
                    red,green,blue=255,0,255
                [/unstore_unit]
                #endif
            [/then]
            [else]
                [message]
                    speaker=Esther
                    message= _ "Whoa. The last few lines were really different."
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "They seemed creepy... talking about the void, how it was going to destroy our universe, how nobody was listening to them..."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "Doesn't it seem like whoever wrote that is linked to these demons?"
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "Maybe..."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "The demons are after us specifically, right? Us, not ordinary faerie. We probably possess something that they're looking for. So the combination of elements-"
                [/message]
                [message]
                    speaker=Yumi
                    message= _ "(<i>looks around</i>) Esther, there are lots of people around."
                [/message]
                [message]
                    speaker=Esther
                    message= _ "Oops, yeah. We can talk about this later. And we should probably get out of here before we get snowed in too hard."
                [/message]
            [/else]
        [/if]

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

        #ifdef EASY
        {VARIABLE_OP esther.experience add 125}
        {VARIABLE_OP yumi.experience add 125}

        [unstore_unit]
            variable=esther
            find_vacant=no
            text= _ "+125 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        [unstore_unit]
            variable=yumi
            find_vacant=no
            text= _ "+125 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        #endif
        #ifdef NORMAL
        {VARIABLE_OP esther.experience add 110}
        {VARIABLE_OP yumi.experience add 110}

        [unstore_unit]
            variable=esther
            find_vacant=no
            text= _ "+110 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        [unstore_unit]
            variable=yumi
            find_vacant=no
            text= _ "+110 XP"
            red,green,blue=255,0,255
        [/unstore_unit]
        #endif
        #ifdef HARD
        {VARIABLE_OP esther.experience add 55}
        {VARIABLE_OP yumi.experience add 55}

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

        {DELAY 500}

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

    # cleaning up some variables
    [event]
        name=victory

        {CLEAR_VARIABLE esther}
        {CLEAR_VARIABLE yumi}
        {CLEAR_VARIABLE aryel}
        {CLEAR_VARIABLE turn_dmg}
        {CLEAR_VARIABLE num_found}

        [set_variable]
            name=glacial_shrine
            value=1
        [/set_variable]
        [set_variable]
            name=prev_scenario
            value="Glacial Shrine"
        [/set_variable]
    [/event]

    [event]
        name=time over

        [message]
            speaker=Esther
            message= _ "(<i>teeth chattering</i>) Yumi... (<i>shivers</i>) it's... so cold..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>shudders</i>) We're going to freeze to death out here."
        [/message]

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

#undef GENERATE_MOUNTAIN
#undef GENERATE_HILL
#undef GENERATE_FOREST
#undef GENERATE_SNOW
#undef GENERATE_VILLAGE