#textdomain wesnoth-dm
#define MEMOIRS_VICTORY_POSITION X Y BONUS_VALUE
    [item]
        x={X}
        y={Y}
        image=scenery/signpost.png
    [/item]
    [event]
        name=moveto
        [filter]
            id=Delfador
            x={X}
            y={Y}
        [/filter]
        [endlevel]
            result=victory
            bonus={BONUS_VALUE}
        [/endlevel]
    [/event]
#enddef

#define MEMOIRS_SECRET_PASSAGE X Y TO_X TO_Y
    [item]
        x={X}
        y={Y}
        image=scenery/mine-abandoned.png
    [/item]
    [event]
        name=moveto
        [filter]
            x={X}
            y={Y}
            side=1
        [/filter]
        [message]
            speaker=unit
            message=_"A secret passage... I wonder where it leads..."
        [/message]
        # move the player automatically the first time they find the passage
        [teleport]
            [filter]
                x={X}
                y={Y}
            [/filter]
            x={TO_X}
            y={TO_Y}
        [/teleport]
        [capture_village]
            side=1
            x={TO_X}
            y={TO_Y}
        [/capture_village]
        [scroll_to_unit]
            x={TO_X}
            y={TO_Y}
        [/scroll_to_unit]
        # now make the secret passage for real
        [tunnel]
            [filter]
            [/filter]
            [source]
                x={X}
                y={Y}
            [/source]
            [target]
                x={TO_X}
                y={TO_Y}
            [/target]
        [/tunnel]
    [/event]
#enddef

### earthquake effect stolen from "The Lost General"
#define MEMOIRS_TREMOR
    [redraw][/redraw]
    [scroll]
        x=5
        y=0
    [/scroll]
    [delay]
        time=25
    [/delay]
    [scroll]
        x=-10
        y=0
    [/scroll]
    [delay]
        time=25
    [/delay]
    [scroll]
        x=5
        y=5
    [/scroll]
    [delay]
        time=25
    [/delay]
    [scroll]
        x=0
        y=-10
    [/scroll]
    [delay]
        time=25
    [/delay]
    [scroll]
        x=0
        y=5
    [/scroll]
#enddef

#define DELFADOR_LIGHTNING
    {FLASH_LIGHTNING ()}
#enddef

# In Clash at the Manor (21) and Face of the Enemy (22), the elves are pretending to be orcs
[resource]
    id=memoirs_elves_use_orcish_weapons

    [event]
        name=prestart
        [object]
            silent=yes
            duration=scenario
            [filter]
                id=Kalenz
            [/filter]
            [effect]
                apply_to=attack
                name=sword
                #textdomain wesnoth-units
                set_description=_"greatsword"
                #textdomain wesnoth-dm
                set_icon=attacks/greatsword-orcish.png
            [/effect]
        [/object]
    [/event]

    [event]
        name=recruit,recall
        first_time_only=no
        [filter]
            race=elf
            [not]
                type_adv_tree=Elvish Shaman
            [/not]
        [/filter]
        [object]
            silent=yes
            duration=scenario
            [effect]
                [filter]
                    [not]
                        type=Elvish Hero, Elvish Champion, Elvish Marshal
                    [/not]
                [/filter]
                apply_to=attack
                name=sword
                set_icon=attacks/sword-orcish.png
            [/effect]
            [effect]
                [filter]
                    type=Elvish Hero, Elvish Champion, Elvish Marshal
                [/filter]
                apply_to=attack
                name=sword
                #textdomain wesnoth-units
                set_description=_"greatsword"
                #textdomain wesnoth-dm
                set_icon=attacks/greatsword-orcish.png
            [/effect]
            [effect]
                [filter]
                    [not]
                        type_adv_tree=Elvish Marksman
                    [/not]
                [/filter]
                apply_to=attack
                name=bow
                set_icon=attacks/bow-orcish.png
            [/effect]
            [effect]
                [filter]
                    type_adv_tree=Elvish Marksman
                [/filter]
                apply_to=attack
                name=longbow
                #textdomain wesnoth-units
                set_description=_"bow"
                #textdomain wesnoth-dm
                set_icon=attacks/bow-orcish.png
            [/effect]
        [/object]
    [/event]
[/resource]
