#textdomain wesnoth-low

[event]
    name=last breath
    [filter]
        id=Kalenz
    [/filter]
    [message]
        speaker=unit
        message= _ "I am defeated. Now the orcs will destroy us!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

#define INIT_LANDAR
    [set_variable]
        name=landar_quaffed_potion
        value=false
    [/set_variable]
#enddef

#define LANDAR_QUAFFS_POTION
    [set_variable]
        name=landar_quaffed_potion
        value=true
    [/set_variable]
#enddef

[event]
    name=last breath
    [filter]
        id=Landar
    [/filter]
    [if]
        [variable]
            name=landar_quaffed_potion
            boolean_equals=true
        [/variable]
        [then]
            [message]
                speaker=unit
                message= _ "It is finished! I can finally rest!"
            [/message]
        [/then]
        [else]
            [message]
                speaker=unit
                message= _ "Farewell, Kalenz!"
            [/message]
        [/else]
    [/if]
    [message]
        id=Kalenz
        message= _ "Noooo! We cannot continue without Landar!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

[event]
    name=last breath
    [filter]
        id=Cleodil
    [/filter]
    [message]
        # There's an argument that Cleodil shouldn't reger to Kalenz as
        # "beloved", in the early scenarios, but I (ESR) think it is
        # poignant and appropriate that she reveal her feelings
        # as she dies.
        speaker=unit
        message= _ "I'm sorry I failed you, Kalenz...my beloved..."
    [/message]
    [message]
        # Ditto.  In the early scenarios, this is Kalenz reralizing
        # how much she meant to him just as he loses all hope.
        id=Kalenz
        message= _ "Nooo! Cleodil! Without you I cannot go on!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

[event]
    name=last breath
    [filter]
        id=Olurf
    [/filter]
    [message]
        speaker=unit
        message= _ "I go to join my sires in the Halls of Death"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

[event]
    name=last breath
    [filter]
        id=Uradredia
    [/filter]
    [message]
        id=Kalenz
        message= _ "Our cause is lost. With Uradredia gone, the North Elves will no longer fight!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

[event]
    name=last breath
    [filter]
        id=Galtrid
    [/filter]
    [message]
        id=Kalenz
        message= _ "I cannot fight the orcs alone! It's all over!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

[event]
    name=last breath
    [filter]
        [filter_wml]
            upkeep="loyal"
        [/filter_wml]
        #TODO make this macro work
        #{FILTER_LOYALS}
    [/filter]
    #TODO enable after the string frezze
    #[message]
    #    speaker=unit
    #    message= _ "This is a stub! My service ends here My Lord." #TODO ESR
    #[/message]
    [message]
        id=Kalenz
        message= _ "Farewell $unit.name. Your loyal service won't be forgotten."
    [/message]
    [scroll_to_unit]
        id=$unit.id
    [/scroll_to_unit]
[/event]

[event]
    name=time over
    [message]
        speaker=unit
        message= _ "Oh, no! We are too late..."
    [/message]
[/event]
