#textdomain wesnoth-low

[event]
    name=last breath
    [filter]
        id=Kalenz
    [/filter]
    [message]
        speaker=unit
        message= _ "I have been defeated!"
    [/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= _ "I am 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]
        speaker=unit
        message= _ "I'm sorry I failed you, Kalenz...beloved..."
    [/message]
    [message]
        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= _ "No! This is the end! We have been defeated!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

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

#TODO Spahr can be killed two times
[event]
    name=last breath
    [filter]
        id=Spahr
    [/filter]
    [message]
        speaker=unit
        message= _ "Aargh! I'm dying!"
    [/message]
[/event]

[event]
    name=last breath
    [filter]
        id=Shurm
    [/filter]
    [message]
        speaker=unit
        message= _ "Aargh! I'm gone!"
    [/message]
    [message]
        id=Kalenz
        message= _ "I told you so!"
    [/message]
    [message]
        speaker=second_unit
        message= _ "Know that you perished at the hands of the Kalenz's elves!"
    [/message]
[/event]

[event]
    name=last breath
    [filter]
        id=Galtrid
    [/filter]
    [message]
        id=Kalenz
        message= _ "No! It's all over!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

[event]
    name=last breath
    [filter]
        [filter_wml]
            upkeep="loyal"
        [/filter_wml]
    [/filter]
    [message]
        id=Kalenz
        message= _ "Farewell $unit.name. Your loyal service won't be forgotten."
    [/message]
[/event]

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