#textdomain wesnoth-Genesis

[scenario]
    id=03a_Mirror_Lake
    map_data="{~add-ons/Genesis/episode2/maps/03a_Mirror_Lake.map}"
    name= _ "Mirror Lake"
    turns=-1
    victory_when_enemies_defeated=no
    next_scenario=02_Ethea

    {MIDDAY}

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

    [side]
        type=Amberlight Fae
        name= _ "Esther"
        id=Esther
        canrecruit=yes
        side=1
        controller=human
        recruit=
        gold=0
        income=-2
        shroud=yes
        fog=yes
        team_name=fae
        user_team_name= _ "team_name^Fae"
    [/side]

    [side]
        side=2
        no_leader=yes
        controller=ai
        color=blue
        fog=no
        shroud=no
        recruit=
        gold=0
        income=-2
        team_name=demons
        hidden=yes
    [/side]

    [event]
        name=preload
        first_time_only=no

        [lua]
            code = << wesnoth.dofile('~add-ons/Genesis/episode2/lua/scenarios/03a_Mirror_Lake.lua') >>
        [/lua]
    [/event]

    {PLACE_IMAGE items/crystal-glyph-message.png 4 27}
    {PLACE_IMAGE items/crystal-glyph-message.png 42 2}
    {PLACE_IMAGE items/crystal-glyph-message.png 37 26}
    {PLACE_IMAGE items/crystal-glyph.png 23 17}

    [event]
        name=prestart

        {RECALL_YUMI_NOLOC}
        {RECALL_ARYEL_NOLOC}

        [set_recruit]
            side=1
            recruit=
        [/set_recruit]
#ifdef EASY
        {VARIABLE puzzle_exp 20}
#endif
#ifdef NORMAL
        {VARIABLE puzzle_exp 15}
#endif
#ifdef HARD
        {VARIABLE puzzle_exp 10}
#endif
        [init_puzzles][/init_puzzles]
    [/event]

    [event]
        name=start

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Explore")}
        [/objectives]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [if]
            [have_unit]
                side=2,3
                [filter_vision]
                    side=1
                [/filter_vision]
            [/have_unit]
            [then][/then]
            [else]
                {MODIFY_UNIT (x,y=$x1,$y1) moves 6}
                {MODIFY_UNIT (x,y=$x1,$y1) attacks_left 1}
            [/else]
        [/if]
    [/event]

    ######### WATER PUZZLE ###########
    # fire onto blood makes iron, then quench with water into dark steel
    # easy puzzle exp

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=4
            y=27
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [if]
            [variable]
                name=lake.water_puzzle
                less_than=4
            [/variable]
            [then]
                [message]
                    speaker=narrator
                    message= _ "Fire quenching blood to dessicated iron,
Smothered by black water, drowned in the darkened depths,
Into a rigid plate of obsidian steel."
                [/message]
            [/then]
        [/if]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=7,26
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [water_puzzle_hex][/water_puzzle_hex]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=3,29
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [water_puzzle_fire_hex][/water_puzzle_fire_hex]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=2,26
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [water_puzzle_water_hex][/water_puzzle_water_hex]
    [/event]
    ######### FIRE PUZZLE ###########
    # tree into pit, then lava into pit, then brick covering to make "empty space"

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=42
            y=2
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [if]
            [variable]
                name=lake.fire_puzzle
                less_than=6
            [/variable]
            [then]
                [message]
                    speaker=narrator
                    message= _ "Ravaged lumber pitched into black fire,
Lit aflame and charred to ashen cinders,
A sandy seal scorched into blackened stone."
                [/message]
            [/then]
        [/if]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=47,2
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [fire_puzzle_hex][/fire_puzzle_hex]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=44,2
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [fire_puzzle_tree_hex][/fire_puzzle_tree_hex]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=48,2
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [fire_puzzle_lava_hex][/fire_puzzle_lava_hex]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=45,5
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [fire_puzzle_brick_hex][/fire_puzzle_brick_hex]
    [/event]
    ######### ICE PUZZLE ###########
    # grid onto ice, then metal onto ice to form the metal keep
    # easy puzzle exp

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=37
            y=26
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [if]
            [variable]
                name=lake.ice_puzzle
                less_than=4
            [/variable]
            [then]
                [message]
                    speaker=narrator
                    message= _ "Pane of crystal water amid deep sea,
Etched by crosshatching girders,
Dense metal grown into a steel fortress."
                [/message]
            [/then]
        [/if]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=34,28
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [ice_puzzle_hex][/ice_puzzle_hex]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=40,28
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [ice_puzzle_grid_hex][/ice_puzzle_grid_hex]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=35,32
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [ice_puzzle_metal_hex][/ice_puzzle_metal_hex]
    [/event]

    ######### VOID SPAWNING ###########
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x,y=23,17
        [/filter]
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [fire_event]
            name=crystal text
        [/fire_event]
        [message]
            speaker=Esther
            [option]
                message= _ "Let's do this."

                [command]
                    [place_shroud]
                        side=1
                        x=0-50
                        y=0-40
                    [/place_shroud]
                    [redraw]
                        side=1
                        clear_shroud=yes
                    [/redraw]
                    [replace_schedule]
                        {AFTERNOON}
                    [/replace_schedule]
                    [message]
                        speaker=Aryel
                        message= _ "Hmm."
                    [/message]
                    [replace_schedule]
                        {DUSK}
                    [/replace_schedule]
                    [terrain]
                        [and]
                            terrain=Gs^Fdw
                        [/and]
                        terrain=Aa^Fda
                    [/terrain]
                    [terrain]
                        [and]
                            terrain=Gd^Fdw
                        [/and]
                        terrain=Ai^Fda
                    [/terrain]
                    [terrain]
                        [and]
                            terrain=Gs^Fmw
                        [/and]
                        terrain=Aa^Fma
                    [/terrain]
                    [terrain]
                        [and]
                            terrain=Gd^Fmw
                        [/and]
                        terrain=Ai^Fma
                    [/terrain]
                    [terrain]
                        [and]
                            terrain=Gs^*
                        [/and]
                        terrain=Aa^Fpa
                    [/terrain]
                    [terrain]
                        [and]
                            terrain=Gd^*
                        [/and]
                        terrain=Ai^Fpa
                    [/terrain]
                    [redraw][/redraw]
                    {DELAY 1000}
                    [replace_schedule]
                        {FIRST_WATCH}
                    [/replace_schedule]
                    [terrain]
                        [and]
                            terrain=Gs,Gg,Re
                        [/and]
                        terrain=Aa
                    [/terrain]
                    [terrain]
                        [and]
                            terrain=Gd,Rd,Ds
                        [/and]
                        terrain=Ai
                    [/terrain]
                    [redraw][/redraw]
                    [message]
                        speaker=Aryel
                        message= _ "Spooky."
                    [/message]
                    [terrain]
                        [not]
                            terrain=Ai,Ai^*,Aa,Aa^*,Ww,Wo,Woby,Wog,Xu
                        [/not]
                        terrain=Ww
                    [/terrain]
                    [redraw][/redraw]
                    [replace_schedule]
                        {MIDNIGHT}
                    [/replace_schedule]
                    {DELAY 1000}
                    {PLAY_SOUND "magic-faeriefire.ogg"}
                    {DELAY 1000}
                    {PLAY_SOUND "gate-fall.ogg"}
                    [terrain]
                        [and]
                            terrain=Xu
                        [/and]
                        terrain=Fypd
                    [/terrain]
                    [redraw][/redraw]
                    {REMOVE_IMAGE 23 17}

                    {DELAY 1500}

                    [message]
                        speaker=Aryel
                        message= _ "... okay. So now what?"
                    [/message]

                    {DELAY 1500}

                    [unit]
                        type=Fire Faerie Fake
                        side=2
                        x,y=17,15
                        animate=yes
                        generate_name=no
                        id=enemy1
                    [/unit]

                    [message]
                        speaker=enemy1
                        message= _ "..."
                    [/message]

                    [unit]
                        type=Forest Nymph Fake
                        side=2
                        x,y=23,22
                        animate=yes
                        generate_name=no
                        id=enemy2
                    [/unit]

                    [message]
                        speaker=enemy2
                        message= _ "..."
                    [/message]

                    [message]
                        speaker=Esther
                        message= _ "Hmm. This is a bit different this time, isn't it?"
                    [/message]

                    [unit]
                        type=Night Nymph Fake
                        side=2
                        x,y=29,14
                        animate=yes
                        generate_name=no
                        id=enemy3
                    [/unit]

                    [message]
                        speaker=enemy3
                        message= _ "..."
                    [/message]

                    [message]
                        speaker=Yumi
                        message= _ "..."
                    [/message]

                    [message]
                        speaker=Aryel
                        message= _ "... faeries? Or..."
                    [/message]

                    [message]
                        speaker=Yumi
                        message= _ "They're fake."
                    [/message]

                    [message]
                        speaker=Aryel
                        message= _ "Of course they are. So, what exactly are we supposed to do? Just fight?"
                    [/message]

                    [message]
                        speaker=Yumi
                        message= _ "(nods)"
                    [/message]

                    [message]
                        speaker=Aryel
                        message= _ "Well, I can do that."
                    [/message]

                    [message]
                        speaker=Esther
                        message= _ "And you said you were scared."
                    [/message]

                    [message]
                        speaker=Aryel
                        message= _ "Just a bit spooked! But you know me. I'm not afraid of a little brawl now and then."
                    [/message]

                    [message]
                        speaker=Esther
                        message= _ "Then let's get to it."
                    [/message]

                    {VARIABLE lake.scenario_stage 1}
                    [set_menu_item]
                        id=recruit_manifestation
                        description= _ "Recruit Manifestation"
                        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=Yumi
                                [/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=6
                                [/variable]
                                [then]
                                    [message]
                                        speaker=narrator
                                        message= _ "You do not have enough gold!"
                                    [/message]
                                [/then]
                                [else]
                                    [unit]
                                        side=1
                                        type=Manifestation
                                        x,y=$x1,$y1
                                        moves,attacks_left=0,0
                                        animate=yes
                                        upkeep=free
                                        [modifications]
                                            {TRAIT_LOYAL}
                                        [/modifications]
                                    [/unit]
                                    {VARIABLE_OP side1gold sub 6}
                                    [modify_side]
                                        side=1
                                        gold=$side1gold
                                    [/modify_side]
                                    {CLEAR_VARIABLE side1gold}
                                [/else]
                            [/if]
                        [/command]
                    [/set_menu_item]
                    [objectives]
                        {OBJECTIVE_VICTORY  ( _ "Survive")}
                    [/objectives]
                [/command]
            [/option]
            [option]
                message= _ "Not yet."
            [/option]
        [/message]
    [/event]

    [event]
        name=crystal text

        [message]
            speaker=Aryel
            message= _ "What is this random crystal doing here?"
        [/message]
        [message]
            speaker=Esther
            message= _ "Not sure. Usually it's you or Yumi figuring this stuff out-"
        [/message]
        [message]
            speaker=Yumi
            message= _ "It's a fake looking glass."
        [/message]
        [message]
            speaker=Aryel
            message= _ "... what do you mean by that? A fake looking glass? You mean like a portal to a different reality, or, like... the other way?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(shakes head)"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Both."
        [/message]
        [message]
            speaker=Aryel
            message= _ "So that means you can use it."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(nods) But, they will be waiting."
        [/message]
        [message]
            speaker=Aryel
            message= _ "The dream demons?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "... oookay, the dream demons. On the one hand, if we go after them, we could learn more about who's commanding them to corrupt the Urdemons and how they're doing it. On the other hand, it's more fighting that might not get us anything."
        [/message]
        [message]
            speaker=Esther
            message= _ "Not that you'd mind that."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Against normal enemies, maybe. But those things are freaky, Esther. You never know what kind of weird abilities they have and you can't even be sure that you've killed them since they reappear all the time. Besides, how do you even kill a dream?"
        [/message]
        [message]
            speaker=Esther
            message= _ "Don't ask me, that's a question for Yumi."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(shrugs)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Riiight. Anyway, should we use this thing or not?"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            type=Fire Faerie Fake,Forest Nymph Fake,Night Nymph Fake
        [/filter]

        {DELAY 1000}

        [message]
            speaker=Aryel
            message= _ "Well?"
        [/message]

        {DELAY 1000}

        [animate_unit]
            [filter]
                id=Yumi
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]

        {DELAY 750}

        [kill]
            x,y=$x1,$y1
        [/kill]

        {PLAY_SOUND wail-sml.wav}

        [unit]
            x,y=$x1,$y1
            type=Demon Morphling
            side=2
            animate=yes
            generate_name=no
            hitpoints=16
        [/unit]

        [message]
            speaker=Aryel
            message= _ "What is that?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "A mirror."
        [/message]
        [message]
            speaker=Esther
            message= _ "You mean like she has the power to reflect things?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "No, I think Yumi means that thing is a mirror. I'm not sure what that entails, though. Like, what, she's a piece of our reality or something?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(tilts head)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Sort of. Okay. We'll have to think about what that means, I guess."
        [/message]
    [/event]

    [event]
        name=last breath
        first_time_only=no
        [filter]
            type=Fire Faerie Fake,Forest Nymph Fake,Night Nymph Fake
        [/filter]

        [kill]
            x,y=$x1,$y1
        [/kill]
        [set_variable]
            name=rand_hp
            rand=19..30
        [/set_variable]
        [unit]
            x,y=$x1,$y1
            type=Demon Morphling
            side=2
            animate=yes
            generate_name=no
            hitpoints=$rand_hp
        [/unit]
        {CLEAR_VARIABLE rand_hp}
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=lake.scenario_stage
                numerical_equals=1
            [/variable]
        [/filter_condition]

        [store_locations]
            variable=hex
            terrain=Wo,Wog,Woby
        [/store_locations]
        [for]
            array=hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..750
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..1500
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..1800
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        less_than=3
                    [/variable]
                    [then]
                        {SPAWN_NOID_NONAME ("Fire Faerie Fake","Forest Nymph Fake","Night Nymph Fake") 2 $hex[$i].x $hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hex}

        {VARIABLE_OP lake.counter add 1}
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=lake.counter
                numerical_equals=12
            [/variable]
        [/filter_condition]

        {SPAWN_NOID_NONAME ("Demon Shardling") 2 37 7}
        {SPAWN_NOID_NONAME ("Demon Shardling") 2 11 6}
        {SPAWN_NOID_NONAME ("Demon Shardling") 2 13 28}
        {SPAWN_NOID_NONAME ("Demon Shardling") 2 39 28}
    [/event]

    [event]
        name=sighted
        [filter]
            type=Demon Shardling
        [/filter]

        [message]
            speaker=Aryel
            message= _ "Oh boy. So, let me guess, these things are 'bigger mirrors than the ones we've been fighting' or something?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(nods)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Okay then."
        [/message]
    [/event]
    [event]
        name=die
        [filter]
            type=Demon Shardling
        [/filter]
        [filter_condition]
            [not]
                [have_unit]
                    type=Demon Shardling
                [/have_unit]
            [/not]
        [/filter_condition]

        [fire_event]
            name=end scene
        [/fire_event]
    [/event]

    [event]
        name=end scene

        {CLEAR_VARIABLE lake}
        [clear_menu_item]
            id=recruit_manifestation
        [/clear_menu_item]
        [endlevel]
            result=victory
            bonus=no
            {NEW_GOLD_CARRYOVER 100}
            replay_save=yes
            carryover_report=no
            linger_mode=no
            next_scenario=02_Ethea
        [/endlevel]
    [/event]

    [event]
        name=victory

    [/event]
[/scenario]


#textdomain wesnoth-Genesis

[scenario]
    id=03b_The_Bells_of_Aerlyn
    map_data="{~add-ons/Genesis/episode2/maps/03b_The_Bells_of_Aerlyn.map}"
    name= _ "The Bells of Aerlyn"
    turns=-1
    victory_when_enemies_defeated=no
    next_scenario=02_Ethea

    {AFTERNOON}

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

    [side]
        type=Amberlight Fae
        name= _ "Esther"
        id=Esther
        canrecruit=yes
        side=1
        controller=human
        recruit=
        gold=0
        income=-2
        fog=yes
        team_name=fae
        user_team_name= _ "team_name^Fae"
    [/side]

    [side]
        side=2
        no_leader=yes
        controller=ai
        color=yellow
        fog=no
        shroud=no
        recruit=
        gold=0
        income=-2
        team_name=demons
        user_team_name= _ "team_name^Demons"
        [ai]
            aggression=1
            caution=0
            grouping=false
        [/ai]
    [/side]

    [side]
        side=3
        no_leader=yes
        controller=ai
        color=black
        fog=no
        shroud=no
        recruit=
        gold=0
        income=-2
        team_name=demons
        hidden=yes
    [/side]

    {PLACE_IMAGE items-new/wind-chimes.png 10 6}
    {PLACE_IMAGE items-new/wind-chimes.png 12 9}
    {PLACE_IMAGE items-new/wind-chimes.png 7 9}

    [event]
        name=prestart

        {RECALL_YUMI_NOLOC}
        {RECALL_ARYEL_NOLOC}

        [set_recruit]
            side=1
            recruit=
        [/set_recruit]
        {SPAWN_NOID_NONAME ("GNS_Monolith") 3 13 10}
        {SPAWN_NOID_NONAME ("GNS_Monolith") 3 6 9}
        {SPAWN_NOID_NONAME ("GNS_Monolith") 3 11 7}

        [unit]
            type=Demon Warrior
            id=boss1
            x,y=6,14
            canrecruit=yes
            random_traits=no
            generate_name=yes
            side=2
        [/unit]
        [unit]
            type=Demon Stormbringer
            id=boss2
            x,y=23,5
            canrecruit=yes
            random_traits=no
            generate_name=yes
            side=2
        [/unit]

        {VARIABLE void_struck 0}
    [/event]

# initial spawns

    [event]
        name=new turn
        first_time_only=no
        [store_locations]
            variable=lava_chasm
            terrain=Ql
        [/store_locations]
        [for]
            array=lava_chasm
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..56
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..84
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..98
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        less_than=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Winged Demon") 2 $lava_chasm[$i].x $lava_chasm[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Zephyr") 2 $lava_chasm[$i].x $lava_chasm[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=4
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Windlasher") 2 $lava_chasm[$i].x $lava_chasm[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE lava_chasm}
        [store_locations]
            variable=lava_hex
            terrain=Qlf,Qlf^*
        [/store_locations]
        [for]
            array=lava_hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..110
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..165
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..187
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        less_than=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Winged Demon") 2 $lava_hex[$i].x $lava_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Zephyr") 2 $lava_hex[$i].x $lava_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=4
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Windlasher") 2 $lava_hex[$i].x $lava_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE lava_hex}
        [store_locations]
            variable=ice_hex
            terrain=Brym
        [/store_locations]
        [for]
            array=ice_hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..40
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..60
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..70
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        less_than=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon") 2 $ice_hex[$i].x $ice_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Grunt") 2 $ice_hex[$i].x $ice_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=4
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Sword Dancer") 2 $ice_hex[$i].x $ice_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE ice_hex}
        [store_locations]
            variable=ice_hex
            terrain=Spay
        [/store_locations]
        [for]
            array=ice_hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..55
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..77
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..88
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        less_than=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon") 2 $ice_hex[$i].x $ice_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Grunt") 2 $ice_hex[$i].x $ice_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=4
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Sword Dancer") 2 $ice_hex[$i].x $ice_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE ice_hex}
        [store_locations]
            variable=void_hex
            terrain=Qxua
        [/store_locations]
        [for]
            array=void_hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..174
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..261
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..319
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        less_than=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Void Shambler") 2 $void_hex[$i].x $void_hex[$i].y}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=3
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Void Stalker") 2 $void_hex[$i].x $void_hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE void_hex}
    [/event]

    [event]
        name=start

        [unit]
            type=Halfling Piercer
            x,y=37,26
            id=Midara_piercer
            name= _ "Midara"
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_RESILIENT}
            [/modifications]
            animate=yes
            gender=female
            random_traits=no
            find_vacant=yes
            side=1
        [/unit]
        [unit]
            type=Halfling Distortionist
            x,y=37,26
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_RESILIENT}
            [/modifications]
            animate=yes
            generate_name=yes
            random_traits=no
            random_gender=yes
            find_vacant=yes
            side=1
        [/unit]
        [unit]
            type=Halfling Spearer
            x,y=37,26
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_RESILIENT}
            [/modifications]
            animate=yes
            generate_name=yes
            random_traits=no
            random_gender=yes
            find_vacant=yes
            side=1
        [/unit]
        [unit]
            type=Halfling Spearer
            x,y=37,26
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_RESILIENT}
            [/modifications]
            animate=yes
            generate_name=yes
            random_traits=no
            random_gender=yes
            find_vacant=yes
            side=1
        [/unit]
        [unit]
            type=Halfling Spearer
            x,y=37,28
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_RESILIENT}
            [/modifications]
            animate=yes
            generate_name=yes
            random_traits=no
            random_gender=yes
            find_vacant=yes
            side=1
        [/unit]
        [unit]
            type=Halfling Distortionist
            x,y=38,27
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_RESILIENT}
            [/modifications]
            animate=yes
            generate_name=yes
            random_traits=no
            random_gender=yes
            find_vacant=yes
            side=1
        [/unit]
        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Explore")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Esther")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
        [/objectives]
    [/event]

    ######### BONUS ###########
    [event]
        name=moveto
        first_time_only=yes
        [filter]
            x,y=4,26
            id=Yumi
        [/filter]
        [filter_condition]
            [have_location]
                time_of_day=chaotic
            [/have_location]
        [/filter_condition]

        {VARIABLE_OP yumi_spell_params.yumi_max_mana add 1}
        {FLOAT_TEXT ("Yumi") "00ffff" "+1 max mana"}
    [/event]

    ######### BOSS FIGHT ###########

    [event]
        name=sighted
        first_time_only=yes
        [filter]
            type=GNS_Monolith
        [/filter]

        [fire_event]
            name=void spawning
        [/fire_event]

        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x,y=12,9
            radius=3
            multiturn=yes
        [/lift_fog]
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x,y=7,9
            radius=3
            multiturn=yes
        [/lift_fog]
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x,y=10,6
            radius=3
            multiturn=yes
        [/lift_fog]

        {SCROLL_TO 10 8}
        {DELAY 500}

        [unit]
            animate=yes
            side=3
            x,y=5,9
            type=Demon Void Devourer
            generate_name=no
            random_traits=no
            find_vacant=yes
            [status]
                uncovered=yes
            [/status]
        [/unit]
        [unit]
            animate=yes
            side=3
            x,y=14,10
            type=Demon Void Devourer
            generate_name=no
            random_traits=no
            find_vacant=yes
            [status]
                uncovered=yes
            [/status]
        [/unit]
        [unit]
            animate=yes
            side=3
            x,y=12,6
            type=Demon Void Devourer
            generate_name=no
            random_traits=no
            find_vacant=yes
            [status]
                uncovered=yes
            [/status]
        [/unit]

    [/event]

    [event]
        name=turn 15

        [fire_event]
            name=void spawning
        [/fire_event]
    [/event]

    [event]
        name=void spawning

        [message]
            speaker=Aryel
            message= _ "Wait a second. Do you sense that?"
        [/message]
        {TURN_UNIT5 "Esther"}
        [message]
            speaker=Esther
            message= _ "Sense what?"
        [/message]
        {DELAY 1500}
        [replace_schedule]
            {DUSK_NO_SOUND}
        [/replace_schedule]
        {DELAY 800}
        [replace_schedule]
            {FIRST_WATCH}
        [/replace_schedule]
        {DELAY 600}
        [replace_schedule]
            {MIDNIGHT}
        [/replace_schedule]
        {DELAY 400}
        {COLOR_ADJUST -10 -10 -10}
        {DELAY 200}
        {COLOR_ADJUST -20 -20 -20}
        {DELAY 100}
        {COLOR_ADJUST -30 -30 -30}
        {DELAY 750}
        {SCROLL_TO 22 6}
        {DELAY 750}
        {PLAY_SOUND "wail.wav"}
        {DELAY 1000}
        {PLAY_SOUND "wail.wav"}
        {DELAY 500}
        {QUAKE_FIXED "rumble.ogg"}
        [terrain]
            [and]
                terrain=Ql
            [/and]
            terrain=Qxua
        [/terrain]
        [redraw][/redraw]
        {DELAY 500}
        {QUAKE "rumble.ogg"}
        [terrain]
            [and]
                terrain=Qlf,Qlf^*
            [/and]
            terrain=Qxua
        [/terrain]
        [redraw][/redraw]
        {DELAY 1000}
        {SCROLL_TO 7 16}
        {DELAY 750}
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 500}
        {QUAKE "rumble.ogg"}
        [terrain]
            [and]
                terrain=Brym
            [/and]
            terrain=Qxua
        [/terrain]
        [redraw][/redraw]
        {DELAY 500}
        {QUAKE "rumble.ogg"}
        [terrain]
            [and]
                terrain=Spay
            [/and]
            terrain=Qxua
        [/terrain]
        [redraw][/redraw]

        {DELAY 1500}

        [store_unit]
            [filter]
                side=2
            [/filter]
            variable=swap_unit
        [/store_unit]
        [for]
            array=swap_unit
            [do]
                [switch]
                    variable=swap_unit[$i].level
                    [case]
                        value=1

                        [unit]
                            side=3
                            overwrite=yes
                            find_vacant=no
                            type=Demon Void Shambler
                            generate_name=no
                            random_traits=no
                            x,y=$swap_unit[$i].x,$swap_unit[$i].y
                        [/unit]
                    [/case]
                    [case]
                        value=2

                        [unit]
                            side=3
                            overwrite=yes
                            find_vacant=no
                            type=Demon Void Stalker
                            generate_name=no
                            random_traits=no
                            x,y=$swap_unit[$i].x,$swap_unit[$i].y
                        [/unit]
                    [/case]
                    [case]
                        value=3

                        [unit]
                            side=3
                            overwrite=yes
                            find_vacant=no
                            type=Demon Void Devourer
                            generate_name=no
                            random_traits=no
                            x,y=$swap_unit[$i].x,$swap_unit[$i].y
                        [/unit]
                    [/case]
                [/switch]
            [/do]
        [/for]
        {CLEAR_VARIABLE swap_unit}
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=void_struck
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [heal_unit]
            [filter]
                type=GNS_Monolith
            [/filter]
            amount=full
            animate=yes
        [/heal_unit]
    [/event]

    [event]
        name=attacker hits
        first_time_only=yes
        [filter_attack]
            name=void assault
        [/filter_attack]

        {VARIABLE_OP void_struck add 1}
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=void_struck
                numerical_equals=1
            [/variable]
        [/filter_condition]

        [harm_unit]
            [filter]
                x,y=13,10
            [/filter]
            amount=250
            animate=no
            kill=no
        [/harm_unit]
        [if]
            [have_unit]
                x,y=13,10
            [/have_unit]
            [then]
                {FLOAT_TEXT_LOC "13" "10" "ff0000" "250"}
            [/then]
        [/if]

        [harm_unit]
            [filter]
                x,y=6,9
            [/filter]
            amount=250
            animate=no
            kill=no
        [/harm_unit]
        [if]
            [have_unit]
                x,y=6,9
            [/have_unit]
            [then]
                {FLOAT_TEXT_LOC "6" "9" "ff0000" "250"}
            [/then]
        [/if]

        [harm_unit]
            [filter]
                x,y=11,7
            [/filter]
            amount=250
            animate=no
            kill=no
        [/harm_unit]
        [if]
            [have_unit]
                x,y=11,7
            [/have_unit]
            [then]
                {FLOAT_TEXT_LOC "11" "7" "ff0000" "250"}
            [/then]
        [/if]
    [/event]

    [event]
        name=die
        first_time_only=no
        [filter]
            type=GNS_Monolith
        [/filter]

        [if]
            [not]
                [have_unit]
                    type=GNS_Monolith
                [/have_unit]
            [/not]
            [then]
#ifdef EASY
                [add_exp]
                    [filter]
                        id=Aryel
                    [/filter]
                    experience=40
                [/add_exp]
                [add_exp]
                    [filter]
                        id=Esther
                    [/filter]
                    experience=40
                [/add_exp]
                [add_exp]
                    [filter]
                        id=Yumi
                    [/filter]
                    experience=40
                [/add_exp]
#endif
#ifdef NORMAL
                [add_exp]
                    [filter]
                        id=Aryel
                    [/filter]
                    experience=30
                [/add_exp]
                [add_exp]
                    [filter]
                        id=Esther
                    [/filter]
                    experience=30
                [/add_exp]
                [add_exp]
                    [filter]
                        id=Yumi
                    [/filter]
                    experience=30
                [/add_exp]
#endif
#ifdef HARD
                [add_exp]
                    [filter]
                        id=Aryel
                    [/filter]
                    experience=20
                [/add_exp]
                [add_exp]
                    [filter]
                        id=Esther
                    [/filter]
                    experience=20
                [/add_exp]
                [add_exp]
                    [filter]
                        id=Yumi
                    [/filter]
                    experience=20
                [/add_exp]
#endif

                [endlevel]
                    result=victory
                    bonus=no
                    {NEW_GOLD_CARRYOVER 100}
                    replay_save=yes
                    carryover_report=no
                    linger_mode=no
                    next_scenario=02_Ethea
                [/endlevel]
            [/then]
        [/if]
    [/event]

    [event]
        name=victory

        {VARIABLE ethea.prev_scenario "The Bells of Aerlyn"}
        {CLEAR_VARIABLE void_struck}
    [/event]
[/scenario]


#textdomain wesnoth-Genesis

[scenario]
    id=03d_Echo_Caverns
    map_data="{~add-ons/Genesis/episode2/maps/03d_Echo_Caverns.map}"
    name= _ "Echo Caverns"
    turns=-1
    victory_when_enemies_defeated=no
    next_scenario=02_Ethea

    {UNDERGROUND}

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

    [side]
        type=Amberlight Fae
        name= _ "Esther"
        id=Esther
        canrecruit=yes
        side=1
        controller=human
        recruit=
        gold=0
        income=-2
        shroud=yes
        fog=yes
        team_name=fae
        user_team_name= _ "team_name^Fae"
    [/side]

    [side]
        side=2
        no_leader=yes
        controller=ai
        color=black
        fog=no
        shroud=no
        recruit=
        gold=0
        income=-2
        team_name=fae
        hidden=yes
    [/side]

    [side]
        side=3
        no_leader=yes
        controller=ai
        color=blue
        fog=no
        shroud=no
        recruit=
        gold=0
        income=-2
        team_name=misc
        hidden=yes
    [/side]

    [event]
        name=preload
        first_time_only=no

		[lua]
            code = << wesnoth.dofile('~add-ons/Genesis/episode2/lua/scenarios/03d_Echo_Caverns.lua') >>
		[/lua]
    [/event]

    {PLACE_IMAGE items/crystal-glyph-message.png 36 9}
    {PLACE_IMAGE items/crystal-glyph-message.png 15 2}

    {PLACE_IMAGE items/crystal-glyph-message.png 40 11}
    {PLACE_IMAGE items/crystal-glyph-message.png 32 17}

    {PLACE_IMAGE items/crystal-glyph-light.png 13 3}
    {PLACE_IMAGE items/crystal-glyph-message-dark-1.png 2 6}
    {PLACE_IMAGE items/crystal-glyph-message.png 18 10}

    {PLACE_IMAGE items/crystal-glyph-light.png 9 20}
    {PLACE_IMAGE items/crystal-glyph-message.png 27 23}

    {PLACE_IMAGE items/crystal-glyph-light.png 20 27}

    {PLACE_IMAGE items/crystal-glyph-message.png 12 28}
    {PLACE_IMAGE items/crystal-glyph-message-dark-1.png 8 32}
    {PLACE_IMAGE items/crystal-glyph-light.png 19 31}
    {PLACE_IMAGE items/crystal-glyph-light.png 8 37}

    {PLACE_IMAGE items/crystal-glyph-light-1.png 28 29}

    [event]
        name=prestart

        {RECALL_YUMI_NOLOC}
        {RECALL_ARYEL_NOLOC}

        {SPAWN_NOID_NONAME ("GNS_Mirror") 3 14 11}
        {SPAWN_NOID_NONAME ("GNS_Ice_Shard") 3 41 18}
        {SPAWN_NOID_NONAME ("GNS_Dreamcatcher") 3 12 34}
        {SPAWN_NOID_NONAME ("GNS_Dreamcatcher") 3 14 32}
        {SPAWN_NOID_NONAME ("GNS_Dreamcatcher") 3 16 34}

        [set_recruit]
            side=1
            recruit=
        [/set_recruit]
#ifdef EASY
        {VARIABLE puzzle_exp 30}
#endif
#ifdef NORMAL
        {VARIABLE puzzle_exp 25}
#endif
#ifdef HARD
        {VARIABLE puzzle_exp 20}
#endif
        {MODIFY_UNIT (id=Esther) vision 3}
        {MODIFY_UNIT (id=Aryel) vision 3}
        {MODIFY_UNIT (id=Yumi) vision 3}

		[init_puzzles][/init_puzzles]
    [/event]

    [event]
        name=start

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Explore")}
        [/objectives]
    [/event]

    ######### MESSAGES ###########

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=36
            y=9
        [/filter]
        [message]
            speaker=narrator
            message= _ "'Yukiria, Yukiria, Yukiria!' They cry for me, hapless voices possessed by Guardians, but sounding of meager demons."
        [/message]
        [message]
            speaker=narrator
            message= _ "'Yukiria, stop this nonsense. These dreamwalkers of yours have no business tormenting and twisting my subjects into your unwilling slaves!' In different forms, mirrored words, they have accused me many times over. Uria, Shardia, Xia'el, Luceith'el..."
        [/message]
        [message]
            speaker=narrator
            message= _ "I have always echoed the same reply. Though I am the only Guardian capable of entering the pool of dreams, it is not my domain. I do not choose to set the nightmares on you - they do it of their own will. How about you stop complaining and try to make use of them when they do materialize, like Valdir did? He, at least, seems to be resourceful."
        [/message]
        [message]
            speaker=narrator
            message= _ "Of course, Uria would never even consider that. The blue ones are nothing more than abominations to her, after all. Creatures that exist only as thoughts, without flesh, without blood... it is incomprehensible to the Queen of Life, of course, but I suppose Uria and her two lackeys should not be of my concern. While Uria and Xia'el support Shardia in her endless war with Valdir, the unending stream of souls ripples from Ird to Vyx, from Being to Void. In waging this timeless battle, the Guardian of Life has forsaken her namesake and pandered to me, the Mistress of Death."
        [/message]
        [message]
            speaker=narrator
            message= _ "I suppose I must thank her for her foolishness, but she will get no sympathy from me."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=15
            y=2
        [/filter]
        [message]
            speaker=narrator
            message= _ "Valdir came to me with a proposition today. How unusual. He, the prideful Beast of Blood, actually seeking the help of another? Last we spoke, he was busying shaming Shardia for doing the same, claiming that her alliance with Uria was providing her an undue edge in their little feud. How mundane. Valdir, Shardia, Uria... it seems as if the other Guardians concern themselves only with the terrestrial, the carnal... war... and power. They are no better than the demons that they lord over."
        [/message]
        [message]
            speaker=narrator
            message= _ "Still, Valdir's offer is tempting. A teleportation network? What he purposes it to is not really of my concern, but its creation in of itself could be a stimulating exercise. I had an idea - it would be a path through Yuure, the realm of dreams. Vyx is out of the question, for no soul, demon, faerie, or Guardian, can pass through unmarred. But Yuure... in dreams, time and space have no meaning. The fabric of reality is torn by the shears of thought. It would be... a deconstruction of the matter into the mind, then reconstruction of the thought back into the physical. Yuure would be the bridge."
        [/message]
        [message]
            speaker=narrator
            message= _ "It would, of course, be somewhat undermining Xia'el's power to generate portals between the terres firma, but that is of little concern to me. Unlike Valdir or Uria, she hardly has the power to fight me."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=13
            y=3
        [/filter]
        [message]
            speaker=narrator
            message= _ "Light and darkness, Ird and Vyx, souls of the Tree of Life drifting through a sea of nothingness. Souls born of the Tree, Ird, are possessed of form, physical energy - that which we call Life, or Being. Though she is its Guardian, Uria seems to understand very little about the nature of her own power. Pity, but truly, she is as much a brute as Valdir is. Art and mysticism are lost upon her... all she wishes to do is fight. Pity. Her essence is possessed of so much wasted potential."
        [/message]
        [message]
            speaker=narrator
            message= _ "'Jealous'... yes, that is what she called me. Envious that among us, she is the one bound most strongly to Ird... I admit, it sparks much more ire than it would normally, since for all her power, she has the disposition of nothing more than an oaf. She does not deserve what she has been bequeathed. I fail to understand why Yarae favors her so."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=2
            y=6
        [/filter]
        [message]
            speaker=narrator
            message= _ "Vyx... nothingness, oblivion, Void. For a being of Ird, it is something wholly incomprehensible - mere contact would be utter annihilation for demons, faerie, and Guardians alike. Vyx is the darkness that is beyond the element Darkness, an absolute antithesis of creation. Even Merthiaal fears Vyx, perhaps more so than the rest of us... though I suspect that has more to do with her being merely a weak child. She is but a hair stronger than most demon lords, and I suspect a couple of Valdir's lackeys would even be able to best her in a straight fight. I could almost pity her, if she were not so pathetic."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=9
            y=20
        [/filter]
        [message]
            speaker=narrator
            message= _ "Xia'el came here to Siaria today. Unannounced, of course, as always, but at the very least she is much less of an irritation than Uria is. This time, however, she posed me an interesting question. 'Yuki, why is it that some demons are able to survive exposure to the Void and others are destroyed immediately?'"
        [/message]
        [message]
            speaker=narrator
            message= _ "Besides her ridiculous shortening of my name, there was something about her question that was a bit suspicious. I am obviously aware of the growing spears of Vyx piercing through the veil of Ird on various worlds. That she is aware of it is not surprising. However, in the first place, demons that are capable of subsisting through the Void are extremely rare. I have never seen one myself. That she should raise this question means that she has encountered them, perhaps in... unpleasant... circumstances."
        [/message]
        [message]
            speaker=narrator
            message= _ "The way she asked her question also suggested that she was not only referring to demons, but what else could she have seen? Humans? They definitely would be the first to perish to Vyx. Faerie? If there is one thing Xia'el certainly knows more than me about, it would be them. She must have discovered something else... something that she wishes to keep secret for now. It goes without saying that Xia'el is hardly secretive in general, so this must be fairly important."
        [/message]
        [message]
            speaker=narrator
            message= _ "Regardless, my response was the typical one. 'A demon does not truly survive when passing through Vyx. The physical form may, but the mind is always destroyed. What determines if the form remains depends on the creature's affinity to Ird. Normal demons are wholly possessed of the Tree's energies and are hapless against anything Void. Special ones, such as those from Yuure, stand a better chance.'

She seemed satisfied with my answer for the moment, but I'm sure she'll be back later."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=27
            y=23
        [/filter]
        [message]
            speaker=narrator
            message= _ "Uria is unbelievably annoying. How can anyone stand her?"
        [/message]
    [/event]

    ######### ICE SHARD PUZZLE ###########
    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=40
            y=11
        [/filter]
        [message]
            speaker=narrator
            message= _ "Whispers echoing through mirrored reality,
A hush frozen still between crystal facets.
Brittle panes reflecting brittle impressions,
Shattered by a smattering of oblivion."
        [/message]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=32
            y=17
        [/filter]
        [message]
            speaker=narrator
            message= _ "Sparkling shards of scattered ice,
Faux visages reflected between-
The physical embraces perception and waits,
Bridging feeling and form."
        [/message]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=41
            y=18
        [/filter]
		[filter_condition]
			[variable]
				name=echo.ice_shard
				numerical_equals=2
			[/variable]
		[/filter_condition]

        # Add a cutscene
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
            type=fire
        [/filter_attack]
        [filter_second]
            type=GNS_Ice_Shard
        [/filter_second]
        [kill]
            x,y=41,18
        [/kill]
        [unit]
            x,y=41,18
            side=3
            type=GNS_Ice_Shard
            variation=iceshard_red
            animate=no
        [/unit]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
            type=cold
        [/filter_attack]
        [filter_second]
            type=GNS_Ice_Shard
        [/filter_second]
        [if]
            [have_unit]
                x,y=41,18
                type=GNS_Ice_Shard
                variation=iceshard_dark
            [/have_unit]
            [then]
				{PLAY_SOUND "magic-faeriefire.ogg"}
				[kill]
					x,y=41,18
				[/kill]
				{VARIABLE_OP yumi_spell_params.yumi_max_mana add 1}
				{FLOAT_TEXT ("Yumi") "00ffff" "+1 max mana"}
				{VARIABLE_OP aryel_spell_params.aryel_max_mana add 1}
				{FLOAT_TEXT ("Aryel") "00ffff" "+1 max mana"}
				{PLACE_IMAGE items/crystal-shard.png 42 17}
				{PLACE_IMAGE items/crystal-shard.png 40 17}
				{PLACE_IMAGE items/crystal-shard.png 40 18}
				{PLACE_IMAGE units/fae/yumi-silhouette.png 41 18}
				{VARIABLE_OP echo.ice_shard add 1}
            [/then]
            [else]
                [kill]
                    x,y=41,18
                [/kill]
                [unit]
                    x,y=41,18
                    side=3
                    type=GNS_Ice_Shard
                    variation=iceshard_violet
                    animate=no
                [/unit]
            [/else]
        [/if]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
            name=malefic whisper
        [/filter_attack]
        [filter_second]
            type=GNS_Ice_Shard
        [/filter_second]
        [kill]
            x,y=41,18
        [/kill]
        [unit]
            x,y=41,18
            side=3
            type=GNS_Ice_Shard
            variation=iceshard_dark
            animate=no
        [/unit]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
            type=arcane
            [not]
                name=malefic whisper
            [/not]
        [/filter_attack]
        [filter_second]
            type=GNS_Ice_Shard
        [/filter_second]
        [kill]
            x,y=41,18
        [/kill]
        [unit]
            x,y=41,18
            side=3
            type=GNS_Ice_Shard
            variation=iceshard_light
            animate=no
        [/unit]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			type=impact
        [/filter_attack]
        [filter_second]
            type=GNS_Ice_Shard
        [/filter_second]
        [kill]
            x,y=41,18
        [/kill]
        [unit]
            x,y=41,18
            side=3
            type=GNS_Ice_Shard
            variation=iceshard_light
            animate=no
        [/unit]
        {PLAY_SOUND "magic-dark-miss.ogg"}
    [/event]
	[event]
        name=new turn
        first_time_only=yes
		[filter_condition]
			[variable]
				name=echo.ice_shard
				numerical_equals=1
			[/variable]
			[and]
				[have_unit]
					id=Yumi
					x,y=41,18
				[/have_unit]
			[/and]
		[/filter_condition]

		{VARIABLE_OP yumi_spell_params.yumi_max_mana add 1}
		{FLOAT_TEXT ("Yumi") "00ffff" "+1 max mana"}
		{REMOVE_IMAGE 41 18}
		{PLACE_IMAGE items/crystal-glyph-message-dark.png 41 18}
		{REMOVE_IMAGE 42 17}
		{REMOVE_IMAGE 40 17}
		{REMOVE_IMAGE 40 18}
		{VARIABLE_OP echo.ice_shard add 1}
    [/event]

    ######### MIRROR PUZZLE ###########

    [event]
        name=moveto
        first_time_only=no
        [filter]
            x=18
            y=10
        [/filter]
        [message]
            speaker=narrator
            message= _ "Mirror echo, reflecting hidden forms,
Facade - face and flesh, boiled away to reveal blood,
The mocking essence of Life.
Cruel crimson, clouded claret,
Clarion cries dripping from open veins...
She answers, extricating Life from its sinewy chains,
Leaving nothing but black water."
        [/message]
    [/event]

    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
            type=fire
			[not]
				name=blood boil
			[/not]
        [/filter_attack]
        [filter_second]
            type=GNS_Mirror
        [/filter_second]
		[filter_condition]
			[variable]
				name=echo.mirror
				numerical_equals=0
			[/variable]
		[/filter_condition]
        [terrain]
            x=12,13,14,14,15
			y=11-12,10,12,9-12,11
			terrain=Qlf
        [/terrain]
		[redraw][/redraw]
        [kill]
            x,y=14,11
        [/kill]
        [unit]
            x,y=14,11
            side=3
            type=GNS_Mirror
            animate=no
        [/unit]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			name=blood boil
        [/filter_attack]
        [filter_second]
            type=GNS_Mirror
        [/filter_second]
		[filter_condition]
			[variable]
				name=echo.mirror
				numerical_equals=0
			[/variable]
		[/filter_condition]
        [terrain]
            x=12,13,14,14,15
			y=11-12,10,12,9-12,11
			terrain=Wwb
        [/terrain]
		[redraw][/redraw]
        [kill]
            x,y=14,11
        [/kill]
        [unit]
            x,y=14,11
            side=3
            type=GNS_Mirror
            animate=no
        [/unit]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			name=faerie fire
        [/filter_attack]
        [filter_second]
            type=GNS_Mirror
        [/filter_second]
		[filter_condition]
			[variable]
				name=echo.mirror
				numerical_equals=0
			[/variable]
		[/filter_condition]
        [terrain]
			x=12,13,14,14,15
			y=11-12,10,12,9-12,11
			terrain=Qxyi
        [/terrain]
		[redraw][/redraw]
        [kill]
            x,y=14,11
        [/kill]
        [unit]
            x,y=14,11
            side=3
            type=GNS_Mirror
            animate=no
        [/unit]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			name=void assault
        [/filter_attack]
        [filter_second]
            type=GNS_Mirror
        [/filter_second]
		[filter_condition]
			[variable]
				name=echo.mirror
				numerical_equals=0
			[/variable]
		[/filter_condition]
        [terrain]
			x=12,13,14,14,15
			y=11-12,10,12,9-12,11
			terrain=Qxu
        [/terrain]
		[redraw][/redraw]
        [kill]
            x,y=14,11
        [/kill]
        [unit]
            x,y=14,11
            side=3
            type=GNS_Mirror
            animate=no
        [/unit]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			name=malefic whisper,faerie touch
        [/filter_attack]
        [filter_second]
            type=GNS_Mirror
        [/filter_second]
		[filter_condition]
			[variable]
				name=echo.mirror
				numerical_equals=0
			[/variable]
		[/filter_condition]
        [kill]
            x,y=14,11
        [/kill]
        [unit]
            x,y=14,11
            side=3
            type=GNS_Mirror
            animate=no
        [/unit]
        {PLAY_SOUND "magic-dark-miss.ogg"}
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			name=eviscerate
        [/filter_attack]
        [filter_second]
            type=GNS_Mirror
        [/filter_second]
		[filter_condition]
			[variable]
				name=echo.mirror
				numerical_equals=0
			[/variable]
		[/filter_condition]
        [if]
            [have_location]
                x,y=14,10
                terrain=Wwb
            [/have_location]
            [then]
				{PLAY_SOUND "magic-faeriefire.ogg"}
				{VARIABLE_OP aryel_spell_params.aryel_max_mana add 1}
				{FLOAT_TEXT ("Aryel") "00ffff" "+1 max mana"}
				[terrain]
					x=12,13,14,14,15
					y=11-12,10,12,9-12,11
					terrain=Wwby
				[/terrain]
				[redraw][/redraw]
				[kill]
					x,y=14,11
				[/kill]
				[unit]
					x,y=14,11
					side=3
					type=GNS_Mirror
					animate=no
				[/unit]
				{VARIABLE_OP echo.mirror add 1}
            [/then]
            [else]
				[terrain]
					x=12,13,14,14,15
					y=11-12,10,12,9-12,11
					terrain=Ss
				[/terrain]
				[redraw][/redraw]
				[kill]
					x,y=14,11
				[/kill]
				[unit]
					x,y=14,11
					side=3
					type=GNS_Mirror
					animate=no
				[/unit]
            [/else]
        [/if]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_second]
            type=GNS_Mirror
        [/filter_second]
		[filter_condition]
			[variable]
				name=echo.mirror
				numerical_equals=1
			[/variable]
		[/filter_condition]
        [kill]
            x,y=14,11
        [/kill]
        [unit]
            x,y=14,11
            side=3
            type=GNS_Mirror
            animate=no
        [/unit]
        {PLAY_SOUND "magic-dark-miss.ogg"}
    [/event]
	[event]
		name=firebolt spell
        first_time_only=yes

        [message]
            speaker=Esther
            message= _ "asdf"
        [/message]
	[/event]
	[event]
		name=firebolt spell
        first_time_only=no
		[firebolt_mirror][/firebolt_mirror]
	[/event]

	[event]
		name=new turn
		first_time_only=no
		[heal_unit]
			[filter]
				type=GNS_Mirror,GNS_Ice_Shard,GNS_Dreamcatcher,Fake Nightmare,Fake Dreamwalker
			[/filter]
			amount=full
		[/heal_unit]
	[/event]

    ######### DREAMWEAVER PUZZLE ###########

    [event]
        name=attack end
        first_time_only=no
        [filter_second]
            type=Fake Nightmare
        [/filter_second]
		[heal_unit]
			[filter]
				type=Fake Nightmare
			[/filter]
			amount=full
		[/heal_unit]
		[fire_event]
			name=nightmare text
		[/fire_event]
    [/event]
	[event]
		name=nightmare text

        [message]
            speaker=Aryel
            message= _ "I don't think attacking that thing is going to work."
        [/message]
	[/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			[not]
				name=dreamweave
			[/not]
        [/filter_attack]
        [filter_second]
            type=GNS_Dreamcatcher
        [/filter_second]
        [kill]
            x,y=$y2,$y2
        [/kill]
        [unit]
            x,y=$y2,$y2
            side=3
            type=GNS_Dreamcatcher
            animate=no
        [/unit]
        {PLAY_SOUND "magic-dark-miss.ogg"}
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			name=dreamweave
        [/filter_attack]
        [filter_second]
            type=GNS_Dreamcatcher
			x,y=12,34
        [/filter_second]
        [kill]
            x,y=$y2,$y2
        [/kill]
		{PLACE_IMAGE items-new/dreamcatcher1 12 34}

		[if]
			[not]
				[have_unit]
					type=GNS_Dreamcatcher
				[/have_unit]
			[/not]
			[then]
				{PLAY_SOUND "magic-dark.ogg"}
				[terrain]
					x=12,13,14,15,16
					y=34,34,32-34,33,33-34
					terrain=Fyp
				[/terrain]
				[redraw][/redraw]
				{VARIABLE_OP echo.nightmare add 1}
			[/then]
		[/if]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			name=dreamweave
        [/filter_attack]
        [filter_second]
            type=GNS_Dreamcatcher
			x,y=14,32
        [/filter_second]
        [kill]
            x,y=$y2,$y2
        [/kill]
		{PLACE_IMAGE items-new/dreamcatcher2 14 32}

		[if]
			[not]
				[have_unit]
					type=GNS_Dreamcatcher
				[/have_unit]
			[/not]
			[then]
				{PLAY_SOUND "magic-dark.ogg"}
				[terrain]
					x=12,13,14,15,16
					y=34,34,32-34,33,33-34
					terrain=Fyp
				[/terrain]
				[redraw][/redraw]
				{VARIABLE_OP echo.nightmare add 1}
			[/then]
		[/if]
    [/event]
    [event]
        name=attacker_hits
        first_time_only=no
        [filter_attack]
			name=dreamweave
        [/filter_attack]
        [filter_second]
            type=GNS_Dreamcatcher
			x,y=16,34
        [/filter_second]
        [kill]
            x,y=$y2,$y2
        [/kill]
		{PLACE_IMAGE items-new/dreamcatcher3 16 34}

		[if]
			[not]
				[have_unit]
					type=GNS_Dreamcatcher
				[/have_unit]
			[/not]
			[then]
				{PLAY_SOUND "magic-dark.ogg"}
				[terrain]
					x=12,13,14,15,16
					y=34,34,32-34,33,33-34
					terrain=Fyp
				[/terrain]
				[redraw][/redraw]
				{VARIABLE_OP echo.nightmare add 1}
			[/then]
		[/if]
    [/event]
	[event]
        name=new turn
        first_time_only=yes
		[filter_condition]
			[variable]
				name=echo.nightmare
				numerical_equals=1
			[/variable]
			[and]
				[have_unit]
					id=Fake Nightmare
					terrain=Fyp
				[/have_unit]
			[/and]
		[/filter_condition]

		{VARIABLE_OP yumi_spell_params.yumi_max_mana add 1}
		{FLOAT_TEXT ("Yumi") "00ffff" "+1 max mana"}
		{PLACE_IMAGE items/crystal-glyph-message-dark.png 14 33}
		{REMOVE_IMAGE 12 34}
		{REMOVE_IMAGE 14 32}
		{REMOVE_IMAGE 16 34}
		{VARIABLE_OP echo.nightmare add 1}
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x=14-17
            y=13-16
        [/filter]

        [message]
            speaker=Aryel
            message= _ "Should we go to the shrine now?"
        [/message]
        [message]
            speaker=Esther
            [option]
                message= _ "Let's go!"

                [command]
                    [endlevel]
                        result=victory
                        bonus=yes
                        {NEW_GOLD_CARRYOVER 100}
                        replay_save=no
                        carryover_report=no
                        linger_mode=no
                        next_scenario=03g_Amberlight_Shrine
                    [/endlevel]
                [/command]
            [/option]
            [option]
                message= _ "Let's wait a bit."
            [/option]
        [/message]
    [/event]

    [event]
        name=victory

        {MODIFY_UNIT (id=Esther) vision 6}
        {MODIFY_UNIT (id=Aryel) vision 6}
        {MODIFY_UNIT (id=Yumi) vision 6}
    [/event]
[/scenario]


#textdomain wesnoth-Genesis

[movetype]
	name=duskfae
	flies=true
	{FAE_MOVE}
	[defense]
		deep_water=50
		shallow_water=50
		reef=50
		swamp_water=50
		flat=50
		sand=50
		forest=30
		hills=50
		mountains=40
		village=40
		castle=40
		cave=50
		frozen=50
		fungus=50
		unwalkable=30
	[/defense]
	[resistance]
		blade=130
		pierce=130
		impact=130
		fire=110
		cold=30
		arcane=30
	[/resistance]
[/movetype]
[movetype]
	name=amberlightfae
	flies=true
	{FAE_MOVE}
	[defense]
		deep_water=60
		shallow_water=60
		reef=60
		swamp_water=60
		flat=50
		sand=50
		forest=30
		hills=50
		mountains=40
		village=40
		castle=40
		cave=50
		frozen=60
		fungus=60
		unwalkable=70
	[/defense]
	[resistance]
		blade=120
		pierce=120
		impact=120
		fire=30
		cold=110
		arcane=50
	[/resistance]
[/movetype]
[movetype]
    name=crimsonfae
    flies=true
    {FAE_MOVE}
    [defense]
        deep_water=60
        shallow_water=60
        reef=60
        swamp_water=60
        flat=50
        sand=60
        forest=30
        hills=50
        mountains=40
        village=40
        castle=40
        cave=50
        frozen=60
        fungus=50
        unwalkable=50
    [/defense]
    [resistance]
        blade=120
        pierce=120
        impact=120
        fire=70
        cold=90
        arcane=50
    [/resistance]
[/movetype]
{~add-ons/Genesis/episode2/units/fae}
{~add-ons/Genesis/episode2/units/faeries}


#textdomain wesnoth-Genesis

[movetype]
    name=fakefly
    flies=true
[/movetype]

{~add-ons/Genesis/episode2/units/undead}
{~add-ons/Genesis/episode2/units/fake}


#textdomain wesnoth-Genesis

#define AMLA_AMBERLIGHTFAE
   {AMLA_OPTION_FIRE_MELEE}
   {AMLA_OPTION_BLAST_RANGE}
   {AMLA_OPTION_TEMPEST_RANGE}
   {AMLA_DEFAULT}
#enddef
#define AMLA_OPTION_FIRE_MELEE
    [advancement]
        max_times=-1
        description=_"increased physical strength"
        image=attacks/touch-faerie.png
        id=amla_melee_firefae
        strict_amla=yes
        [effect]
            apply_to=attack
            range=melee
            increase_damage=1
            heal_full=yes
        [/effect]
        [effect]
            apply_to=max_experience
            increase=30%
        [/effect]
    [/advancement]
#enddef
#define AMLA_OPTION_BLAST_RANGE
    [advancement]
        max_times=-1
        description=_"stronger fire magic"
        image=attacks/fireball.png
        id=amla_blast_firefae
        strict_amla=yes
        [effect]
            apply_to=attack
            name=infernal blast
            increase_damage=1
            heal_full=yes
        [/effect]
        [effect]
            apply_to=max_experience
            increase=30%
        [/effect]
    [/advancement]
#enddef
#define AMLA_OPTION_TEMPEST_RANGE
    [advancement]
        max_times=-1
        description=_"stronger storm magic"
        image=attacks/lightning.png
        id=amla_tempest_firefae
        strict_amla=yes
        [effect]
            apply_to=attack
            name=tempest
            increase_damage=3
            heal_full=yes
        [/effect]
        [effect]
            apply_to=max_experience
            increase=30%
        [/effect]
    [/advancement]
#enddef
#define ESTHER_ADVANCEMENT HP_INCREMENT XP_INCREMENT EFFECT_WML VARIATION_NAME
    [advancement]
        max_times=-1
        always_display=yes
        [effect]
            apply_to=hitpoints
            increase_total={HP_INCREMENT}
            increase={HP_INCREMENT}
        [/effect]
        [effect]
            apply_to=max_experience
            increase={XP_INCREMENT}
        [/effect]
        [effect]
            apply_to=variation
            name={VARIATION_NAME}
        [/effect]
        {EFFECT_WML}
    [/advancement]
#enddef

#################### strong special abilities ###########################
#define AMBERLIGHT_STORM_SHIELD VARIANT_NAME
    {ESTHER_ADVANCEMENT 1 150 (
        id=amberlight_storm_shield
        description= _ "returns damage upon being attacked"
        image=attacks/heater-shield.png
        [effect]
            apply_to=new_ability
            [abilities]
                {ABILITY_STORM_SHIELD}
            [/abilities]
        [/effect]
    ) {VARIANT_NAME}}
#enddef
#define AMBERLIGHT_FIRE_SHIELD VARIANT_NAME
    {ESTHER_ADVANCEMENT 4 150 (
        id=amberlight_fire_shield
        description= _ "returns fire damage upon being attacked and gains health"
        image=attacks/heater-shield.png
        [effect]
            apply_to=new_ability
            [abilities]
                {ABILITY_FIRE_SHIELD}
            [/abilities]
        [/effect]
        [effect]
            apply_to=attack
            range=melee
            increase_damage=2
        [/effect]
        [effect]
            apply_to=attack
            name=infernal blast
            increase_damage=2
        [/effect]
    ) {VARIANT_NAME}}
#enddef
#########################################################################
############################ ULTIMATES ##########################
#define ESTHER_HELIOSPHERE VARIANT_NAME
    {ESTHER_ADVANCEMENT 8 0 (
        id=esther_heliosphere
        description= _ "nearby units gain fire and cold resistance"
        image=units/fae/esther.png
        [effect]
            apply_to=new_ability
            [abilities]
                {ABILITY_HELIOSPHERE}
            [/abilities]
        [/effect]
        [effect]
            apply_to=max_experience
            increase=-100%
        [/effect]
        [effect]
            apply_to=max_experience
            increase=69
        [/effect]
    ) {VARIANT_NAME}}
#enddef
#define ESTHER_PYROKINESIS VARIANT_NAME
    {ESTHER_ADVANCEMENT 4 0 (
        id=esther_pyrokinesis
        description= _ "gains damage from adjacent allies"
        image=units/fae/esther.png
        [effect]
            apply_to=new_ability
            [abilities]
                {ABILITY_PYROKINESIS}
            [/abilities]
        [/effect]
		[effect]
            apply_to=attack
            name=infernal blast
            increase_damage=2
        [/effect]
		[effect]
            apply_to=attack
            name=storm
            increase_damage=2
        [/effect]
        [effect]
            apply_to=max_experience
            increase=-100%
        [/effect]
        [effect]
            apply_to=max_experience
            increase=69
        [/effect]
    ) {VARIANT_NAME}}
#enddef
#########################################################################
#define ESTHER_INCINERATE VARIANT_NAME
    {ESTHER_ADVANCEMENT 3 110 (
        id=esther_incinerate
        description= _ "gains bonus damage on offense and bonus fire resistance"
        image=attacks/fireball.png
        [effect]
            apply_to=attack
            name=infernal blast
            [set_specials]
                {WEAPON_SPECIAL_MAGICAL}
                {WEAPON_SPECIAL_INCINERATE}
            [/set_specials]
        [/effect]
        [effect]
            apply_to=resistance
            [resistance]
                fire=-20
            [/resistance]
        [/effect]
    ) {VARIANT_NAME}}
#enddef

############## basic advancements #################
#define AMBERLIGHT_MELEE_BONUS VARIANT_NAME
    {ESTHER_ADVANCEMENT 4 55 (
        id=amberlight_melee
        description= _ "stronger in melee combat"
        image=attacks/touch-faerie.png
        [effect]
            apply_to=attack
            range=melee
            increase_damage=1
        [/effect]
    ) {VARIANT_NAME}}
#enddef
#define AMBERLIGHT_BLAST_BONUS VARIANT_NAME
    {ESTHER_ADVANCEMENT 2 55 (
        id=amberlight_blast
        description= _ "stronger fire magic"
        image=attacks/fireball.png
        [effect]
            apply_to=attack
            name=infernal blast
            increase_damage=1
        [/effect]
    ) {VARIANT_NAME}}
#enddef
#define AMBERLIGHT_TEMPEST_BONUS VARIANT_NAME
    {ESTHER_ADVANCEMENT 2 55 (
        id=amberlight_tempest
        description= _ "stronger storm magic"
        image=attacks/lightning.png
        [effect]
            apply_to=attack
            name=storm
            increase_damage=3
        [/effect]
    ) {VARIANT_NAME}}
#enddef
####################################################
################### better dmg bonuses #############
#define ESTHER_MELEE_DAMAGE VARIANT_NAME
    {ESTHER_ADVANCEMENT 4 80 (
        id=esther_melee_damage
        description= _ "stronger in melee combat"
        image=attacks/touch-faerie.png
        [effect]
            apply_to=attack
            range=melee
            increase_damage=2
        [/effect]
    ) {VARIANT_NAME}}
#enddef
#define ESTHER_RANGE_DAMAGE VARIANT_NAME
    {ESTHER_ADVANCEMENT 2 80 (
        id=esther_range_damage
        description= _ "increased range damage"
        image=attacks/fireball.png
        [effect]
            apply_to=attack
            name=infernal blast
            increase_damage=1
        [/effect]
        [effect]
            apply_to=attack
            name=tempest
            increase_damage=3
        [/effect]
    ) {VARIANT_NAME}}
#enddef
#define ESTHER_HEALTH VARIANT_NAME
    {ESTHER_ADVANCEMENT 5 110 (
        id=esther_range_damage
        description= _ "gains health and resistances"
        image=attacks/heater-shield.png
        [effect]
            apply_to=resistance
            [resistance]
                blade=-10
                pierce=-10
                impact=-10
            [/resistance]
        [/effect]
    ) {VARIANT_NAME}}
#enddef
####################################################
#define FAE_LIGHTNING DIRECTION_NUMBER
    [attack_anim]
        [filter_attack]
            name=tempest
        [/filter_attack]

        {LIGHTNING_BOLT {DIRECTION_NUMBER} }

        start_time=-300
        {SOUND:HIT_AND_MISS lightning.ogg lightning-miss.ogg -300}
        [frame]
            image="units/fae/esther.png:[100*2,200,100,50]"
        [/frame]
    [/attack_anim]
#enddef
#define ESTHER_BASE
    id=Amberlight Fae
    race=fae
    gender=female
    name= _ "Amberlight Fae"
    image="units/fae/esther.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    halo=halo/elven/shyde-stationary-halo[1~6].png:150
    movement_type=amberlightfae
    movement=6
    alignment=lawful
    advances_to=null
    cost=60
    usage=mixed fighter
    description= _ "There is no information available about this class of beings at this time."
    die_sound={SOUND_LIST:ELF_FEMALE_HIT}
    [abilities]
        {ABILITY_KINDLE}
    [/abilities]
    [attack]
        name=immolation
        description=_"immolation"
        icon=attacks/touch-faerie.png
        type=fire
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
            {WEAPON_SPECIAL_IMMOLATE}
        [/specials]
        range=melee
        damage=9
        number=3
    [/attack]
    [attack]
        name=infernal blast
        description=_"infernal blast"
        type=fire
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
            {WEAPON_SPECIAL_BLAZE}
        [/specials]
        damage=9
        number=3
        range=ranged
        icon=attacks/fireball.png
    [/attack]
    [attack]
        name=tempest
        description=_"tempest"
        type=fire
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
            {WEAPON_SPECIAL_OBLITERATE}
        [/specials]
        damage=23
        number=1
        range=ranged
        icon=attacks/lightning.png
    [/attack]
    {IMMOLATE}
    {FIRE_SHIELD}
    {STORM_SHIELD}

    {DEFENSE_ANIM "units/fae/esther.png" "units/fae/esther.png" {SOUND_LIST:ELF_FEMALE_HIT} }
    [attack_anim]
        [filter_attack]
            name=infernal blast
        [/filter_attack]
        {MISSILE_FRAME_FIREBALL}

        start_time=-450
        {SOUND:HIT_AND_MISS fire.wav fire.wav -450}
        [frame]
            image="units/fae/esther.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=immolation
        [/filter_attack]
        start_time=-240

        [frame]
            image="units/fae/esther.png:520"
        [/frame]

        {SOUND:HIT_AND_MISS melee-fire.ogg {SOUND_LIST:MISS} -450}
    [/attack_anim]
    {FAE_LIGHTNING 1}
    {FAE_LIGHTNING 2}
    {FAE_LIGHTNING 3}
#enddef
[unit_type]
    {ESTHER_BASE}
    hitpoints=47
    experience=50
    level=3
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF3
        inherit=no
        level=3
        hitpoints=47
        experience=50
        name= _ "Amberlight Fae"
        {AMBERLIGHT_BLAST_BONUS AF3BLAST}
        {AMBERLIGHT_MELEE_BONUS AF3MELEE}
        {AMBERLIGHT_TEMPEST_BONUS AF3TEMPEST}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF3BLAST
        inherit=no
        level=3
        hitpoints=47
        experience=90
        name= _ "Amberlight Fae"
        {AMBERLIGHT_MELEE_BONUS AF4}
        {AMBERLIGHT_TEMPEST_BONUS AF4}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF3MELEE
        inherit=no
        level=3
        hitpoints=47
        experience=90
        name= _ "Amberlight Fae"
        {AMBERLIGHT_BLAST_BONUS AF4}
        {AMBERLIGHT_TEMPEST_BONUS AF4}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF3TEMPEST
        inherit=no
        level=3
        hitpoints=47
        experience=90
        name= _ "Amberlight Fae"
        {AMBERLIGHT_BLAST_BONUS AF4}
        {AMBERLIGHT_MELEE_BONUS AF4}
    [/variation]

    ######################## level 4 #########################
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4
        inherit=no
        level=4
        hitpoints=47
        experience=130
        name= _ "Ember Naiad"
        {ESTHER_MELEE_DAMAGE AF4DMG}
        {ESTHER_RANGE_DAMAGE AF4DMG}
        {ESTHER_INCINERATE AF4SPECIAL}
    [/variation]

    ###################### level4-2 ############################
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4DMG
        inherit=no
        level=4
        hitpoints=47
        experience=170
        name= _ "Ember Naiad"
        {AMBERLIGHT_FIRE_SHIELD AF4NOINC}
        {AMBERLIGHT_STORM_SHIELD AF4NOINC}
        {ESTHER_INCINERATE AF4NOSHIELD}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4SPECIAL
        inherit=no
        level=4
        hitpoints=47
        experience=170
        name= _ "Ember Naiad"
        {AMBERLIGHT_FIRE_SHIELD AF4SHIELD}
        {AMBERLIGHT_STORM_SHIELD AF4SHIELD}
        {ESTHER_MELEE_DAMAGE AF4NOSHIELD}
        {ESTHER_RANGE_DAMAGE AF4NOSHIELD}
    [/variation]

    ###################### level4-3 ############################
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4NOINC
        inherit=no
        level=4
        hitpoints=47
        experience=210
        name= _ "Ember Naiad"

        {ESTHER_INCINERATE AF4FINAL}
        {ESTHER_MELEE_DAMAGE AF4FINALNOINC}
        {ESTHER_RANGE_DAMAGE AF4FINALNOINC}
        {ESTHER_HEALTH AF4FINALNOINC}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4SHIELD
        inherit=no
        level=4
        hitpoints=47
        experience=210
        name= _ "Ember Naiad"

        {ESTHER_MELEE_DAMAGE AF4FINAL}
        {ESTHER_RANGE_DAMAGE AF4FINAL}
        {ESTHER_HEALTH AF4FINAL}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4NOSHIELD
        inherit=no
        level=4
        hitpoints=47
        experience=210
        name= _ "Ember Naiad"

        {AMBERLIGHT_FIRE_SHIELD AF4FINAL}
        {AMBERLIGHT_STORM_SHIELD AF4FINAL}
        {ESTHER_HEALTH AF4FINALNOSHIELD}
    [/variation]
    ###################### level4-4 ############################
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4FINAL
        inherit=no
        level=4
        hitpoints=47
        experience=250
        name= _ "Ember Naiad"
        {ESTHER_MELEE_DAMAGE AF5}
        {ESTHER_RANGE_DAMAGE AF5}
        {ESTHER_HEALTH AF5}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4FINALNOINC
        inherit=no
        level=4
        hitpoints=47
        experience=250
        name= _ "Ember Naiad"
        {ESTHER_INCINERATE AF5}
        {ESTHER_MELEE_DAMAGE AF5}
        {ESTHER_RANGE_DAMAGE AF5}
        {ESTHER_HEALTH AF5}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF4FINALNOSHIELD
        inherit=no
        level=4
        hitpoints=47
        experience=250
        name= _ "Ember Naiad"
        {AMBERLIGHT_FIRE_SHIELD AF5}
        {AMBERLIGHT_STORM_SHIELD AF5}
        {ESTHER_MELEE_DAMAGE AF5}
        {ESTHER_RANGE_DAMAGE AF5}
        {ESTHER_HEALTH AF5}
    [/variation]

    ###################### level 5 ############################
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF5
        inherit=no
        level=5
        hitpoints=47
        experience=330
        name= _ "Pyre Warden"
        {ESTHER_HELIOSPHERE AF5FINAL}
        {ESTHER_PYROKINESIS AF5FINAL}
    [/variation]
    [variation]
        {ESTHER_BASE}
        hide_help=yes
        variation_id=AF5FINAL
        inherit=no
        level=5
        hitpoints=47
        experience=250
        name= _ "Pyre Warden"
        {AMLA_AMBERLIGHTFAE}
    [/variation]
[/unit_type]