#textdomain wesnoth-ei
#
#  These events are shared between the two final scenarios
#
[event]
    name=attack
    [filter]
        id=Dacyn # wmllint: recognize Dacyn
    [/filter]
    [filter_second]
        id=Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Dacyn
        message= _ "Your evil will darken the earth no longer!"
    [/message]
[/event]

[event]
    name=attack
    [filter]
        id=Terraent # wmllint: recognize Terraent
    [/filter]
    [filter_second]
        id=Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Terraent
        message= _ "I shall avenge the death of my comrades!"
    [/message]
[/event]

[event]
    name=attack
    [filter]
        id=Engineer # wmllint: recognize Engineer
    [/filter]
    [filter_second]
        id=Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Engineer
        message= _ "I’m gonna blow you up!"
    [/message]
[/event]

[event]
    name=attack
    [filter]
        id=Grug # wmllint: recognize Grug
    [/filter]
    [filter_second]
        id=Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Grug
        message= _ "Grug again dead make!"
    [/message]
[/event]

[event]
    name=attack
    [filter]
        id=Owaec # wmllint: recognize Owaec
    [/filter]
    [filter_second]
        id=Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Owaec
        message= _ "Taste the steel of the Horse Clans!"
    [/message]
[/event]

[event]
    name=attack
    [filter]
        id=Gweddry # wmllint: recognize Gweddry
    [/filter]
    [filter_second]
        id=Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Gweddry
        message= _ "This is for Wesnoth!"
    [/message]
[/event]

[event]
    name=last breath
    [filter]
        id=Mal-Ravanal     # wmllint: recognize Mal-Ravanal
    [/filter]

    [message]
        speaker=Mal-Ravanal
        message= _ "You are more powerful than I expected, but you cannot possibly defeat me."
    [/message]

    [if]
        [have_location]
            [and]
                x,y=$x1,$y1
                radius=3
            [/and]
            [filter]
                id=Dacyn
            [/filter]
        [/have_location]
        [then]           #Dacyn is close enough; Mal-Ravanal can't escape
            {DACYN_FAKE_ATTACK_ANIMATION_OBJECT}

            [delay]
                time=1
            [/delay]
            [animate_unit]
                [filter]
                    id=Mal-Ravanal
                [/filter]
                flag=failed_teleport
            [/animate_unit]

            [message]
                speaker=Dacyn
                message= _ "No. Your reign of terror ends today."
            [/message]

            [message]
                speaker=Mal-Ravanal
                message= _ "What?!... I... cannot... lose..."
            [/message]

            [delay]
                time=1
            [/delay]
            [animate_unit]
                [filter]
                    id=Mal-Ravanal
                [/filter]
                flag=death

                [animate]
                    [filter]
                        id=Dacyn
                    [/filter]
                    flag=fake_attack
                [/animate]
            [/animate_unit]

            [kill]
                id=Mal-Ravanal
            [/kill]
            [kill]
                race=undead
                animate=yes
            [/kill]

            [endlevel]
                result=victory
                carryover_report=no
                save=no
            [/endlevel]
        [/then]
        [else]     #Dacyn is too far away; Mal-Ravanal escapes
            [animate_unit]
                [filter]
                    id=Mal-Ravanal
                [/filter]
                flag=pre_teleport
            [/animate_unit]
            [kill]
                id=Mal-Ravanal
                animate=no
                fire_event=no
            [/kill]
            [message]
                speaker=Dacyn
                message= _ "I wasn’t able to prevent his escape from here. Now Wesnoth is doomed..."
            [/message]
            [endlevel]
                result=defeat
            [/endlevel]
        [/else]
    [/if]
[/event]
