#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]

#ifndef LANDAR_ENEMY
[event]
    name=last breath
    [filter]
        id=Landar
    [/filter]
#ifdef LANDAR_SPOILED
    [message]
        speaker=unit
        message= _ "It is finished! I can finally rest!"
    [/message]
#else
    [message]
        speaker=unit
        message= _ "Farewell, Kalenz!"
    [/message]
#endif
    [message]
        speaker=Kalenz
        message= _ "Nooo! We cannot continue without Landar!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]
#endif

[event]
    name=last breath
    [filter]
        id=Cleodil
    [/filter]
    [message]
        # There’s an argument that Cleodil shouldn’t refer 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 realizing
        # how much she meant to him just as he loses all hope.
        speaker=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]
    [message]
        # the same string is used for Galtrid's death event
        speaker=Kalenz
        message= _ "I cannot fight the orcs alone! It’s all over!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

[event]
    name=last breath
    [filter]
        id=Uradredia
    [/filter]
    [message]
        speaker=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]
        # the same string is used for Olurf's death event
        speaker=Kalenz
        message= _ "I cannot fight the orcs alone! It’s all over!"
    [/message]
    [endlevel]
        result=defeat
    [/endlevel]
[/event]

[event]
    name=last breath
    first_time_only=no
    [filter]
        [filter_wml]
            upkeep="loyal"
        [/filter_wml]
        [filter_side]
            [allied_with]
                [has_unit]
                    id = "Kalenz"
                [/has_unit]
            [/allied_with]
        [/filter_side]
        [not]
            # Check it's not someone who has their own last breath event
            id=Kalenz,Landar,Cleodil,Olurf,Uradredia,Galtrid
        [/not]
    [/filter]
    [message]
        speaker=unit
        message= _ "I grieve that I have failed you, my lord Kalenz..."
    [/message]
    [message]
        speaker=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]
