#textdomain wesnoth-ei

#
# These events are shared between the two final scenarios
# placed in its own directory since we don't want to load it at top level
#

[event]
    name=attack end

    [filter]
        id=Dacyn
    [/filter]

    [filter_attack]
        range=ranged
    [/filter_attack]

    [filter_condition]
        [have_unit]
            id=Mal-Ravanal
        [/have_unit]
    [/filter_condition]

    [message]
        speaker=Mal-Ravanal
        message= _ "A-ha, what’s this? The white mage resorts to wielding black magic?"
    [/message]

    [event]
        name=new turn
        [event]
            name=attack

            [filter]
                id=Dacyn,Mal-Ravanal
            [/filter]

            [filter_second]
                id=Dacyn,Mal-Ravanal
            [/filter_second]

            [message]
                speaker=Mal-Ravanal
                message= _ "Ah, the feeling of my flesh burned away by your nauseating radiance... this takes me back to when I still thought of you as my friend."
            [/message]
            [message]
                speaker=Dacyn
                message= _ "I only did what I had to do. Your mad quest for power has corrupted you and turned you into a tormented creature of darkness! It is high time I ended your existence!"
            [/message]
        [/event]
    [/event]
[/event]

[event]
    name=attack

    [filter]
        id=Gweddry
    [/filter]

    [filter_second]
        [not]
            id=Mal-Ravanal
        [/not]
    [/filter_second]

    [message]
        speaker=Gweddry
        message= _ "For King and country!"
    [/message]
[/event]
[event]
    name=attack

    [filter]
        id=Gweddry,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Gweddry,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Gweddry
        message= _ "So much death, so much destruction... this has to end, now!"
    [/message]
[/event]

[event]
    name=attack

    [filter]
        id=Owaec
    [/filter]

    [filter_second]
        [not]
            id=Mal-Ravanal
        [/not]
    [/filter_second]

    [message]
        speaker=Owaec
        message= _ "I shall avenge my fallen people!"
    [/message]
[/event]
[event]
    name=attack

    [filter]
        id=Owaec,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Owaec,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Owaec
        message= _ "Mal-Ravanal, at last I face you. I will have my vengeance for the destruction you wrought on my people!"
    [/message]
[/event]

[event]
    name=attack

    [filter]
        id=Dolburras
    [/filter]

    [filter_second]
        [not]
            id=Mal-Ravanal
        [/not]
    [/filter_second]

    [message]
        speaker=Dolburras
        message= _ "Aye, I love the sound o’ bones crunching beneath me hammer!"
    [/message]
[/event]
[event]
    name=attack

    [filter]
        id=Dolburras,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Dolburras,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Dolburras
        #po: in regular English, "So you are the big one, aren't you? Well, the bigger they are"
        #po: there is a colloquial expression, "the bigger they are, the harder they fall"
        message= _ "Ooch, so you be the big ’un, aren’t ye? Well, the bigger they are..."
    [/message]
[/event]

[event]
    name=attack

    [filter]
        id=Addogin
    [/filter]

    [filter_second]
        [not]
            id=Mal-Ravanal
        [/not]
    [/filter_second]

    [message]
        speaker=Addogin
        message= _ "Never thought I’d be seeing this in my lifetime. The whole blasted apocalypse came early, didn’t it."
    [/message]
[/event]
[event]
    name=attack

    [filter]
        id=Addogin,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Addogin,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Addogin
        message= _ "Aww hell. If I live through this, I’m never pickin’ up a sword again."
    [/message]
[/event]

[event]
    name=attack

    [filter]
        id=Hahid al-Ali
    [/filter]

    [filter_second]
        [not]
            id=Mal-Ravanal
        [/not]
    [/filter_second]

    [message]
        speaker=Hahid al-Ali
        message= _ "How in the sands did I get caught up in all this mess? I’m an herbalist, not a warrior!"
    [/message]
[/event]
[event]
    name=attack

    [filter]
        id=Hahid al-Ali,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Hahid al-Ali,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Hahid al-Ali
        message= _ "No, no no, no, what am I even doing here!"
    [/message]
[/event]

[event]
    name=attack

    [filter]
        id=Terraent
    [/filter]

    [filter_second]
        [not]
            id=Mal-Ravanal
        [/not]
    [/filter_second]

    [message]
        speaker=Terraent
        message= _ "Ashes to ashes, dust to dust. The undead have no place in this bright world!"
    [/message]
[/event]
[event]
    name=attack

    [filter]
        id=Terraent,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Terraent,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Terraent
        message= _ "Foul lich, no longer shall you toy with me for your amusement! No longer shall I watch your armies slaughter the innocent! No longer shall your evil darken this world!"
    [/message]
[/event]

[event]
    name=attack

    [filter]
        id=Gaennell
    [/filter]

    [filter_second]
        [not]
            id=Mal-Ravanal
        [/not]
    [/filter_second]

    [message]
        speaker=Gaennell
        message= _ "I remember when I used to raise creatures like you..."
    [/message]
[/event]
[event]
    name=attack

    [filter]
        id=Gaennell,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Gaennell,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Gaennell
        message= _ "I loyally served you, once. Look at what that got me. A whole lot of nothing."
    [/message]

    [message]
        speaker=Mal-Ravanal
        message= _ "I don’t even know who you are."
    [/message]
[/event]

# regular attack line is in S17
[event]
    name=attack

    [filter]
        id=Yannic,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Yannic,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Yannic
        message= _ "So you are the lich behind this madness! Enough is enough. Vengeance for Soradoc; vengeance for the Plains!"
    [/message]
[/event]

# regular attack line is in S17
[event]
    name=attack

    [filter]
        id=Konrad,Mal-Ravanal
    [/filter]

    [filter_second]
        id=Konrad,Mal-Ravanal
    [/filter_second]

    [message]
        speaker=Konrad
        message= _ "You are no savior of Man! Naught but a pile of bones, a dead mage too stubborn to fall. Wesnoth will suffer you no longer!"
    [/message]
[/event]

# hahid drinks a bunch of elixirs
[event]
    name=side 1 turn 2
    [fire_event]
        name=hahid_elixirs
    [/fire_event]
[/event]
[event]
    name=recall

    [filter]
        id=Hahid al-Ali
    [/filter]

    [fire_event]
        name=hahid_elixirs
    [/fire_event]
[/event]
[event]
    name=hahid_elixirs

    [filter_condition]
        [have_unit]
            id=Hahid al-Ali
        [/have_unit]
    [/filter_condition]

    [message]
        speaker=Hahid al-Ali
        message= _ "<i>*gulp*</i> Well, it’s now or never. I’d better not think too hard about the fortune in elixirs that I’m about to drink away."
    [/message]

    {STORE_UNIT_VAR (id=Hahid al-Ali) x hahid_x}
    {STORE_UNIT_VAR (id=Hahid al-Ali) y hahid_y}

    [message]
        speaker=Hahid al-Ali
        message= _ "Agility in swamp and shallow water..."
    [/message]
    {GIVE_WATER_BREATHING $hahid_x $hahid_y ()}
    [message]
        speaker=Hahid al-Ali
        message= _ "Resistance to fire and cold..."
    [/message]
    {GIVE_ELEMENTS $hahid_x $hahid_y ()}
    [message]
        speaker=Hahid al-Ali
        message= _ "Speed and defense..."
    [/message]
    {GIVE_HASTE $hahid_x $hahid_y ()}
    [message]
        speaker=Hahid al-Ali
        message= _ "And berserker fury. Oh sands, what am I doing..."
    [/message]
    {GIVE_FURY $hahid_x $hahid_y ()}

    {CLEAR_VARIABLE hahid_x}
    {CLEAR_VARIABLE hahid_y}

    [message]
        speaker=Hahid al-Ali
        message= _ "Ugh, I feel queasy..."
    [/message]
[/event]

#
# mal-ravanal death cutscene
#
[event]
    name=last breath # fakeout death

    [filter]
        id=Mal-Ravanal
    [/filter]

    {REPLACE_SCENARIO_MUSIC silence.ogg}
    [message]
        speaker=Mal-Ravanal
        message= _ "What?! How could this happen?!"
    [/message]
    [sound]
        name=lightning.ogg
    [/sound]

    {COLOR_ADJUST  127   64  127}
    [delay]
        time=150
    [/delay]

    {COLOR_ADJUST -127 -191 -127}
    [delay]
        time=150
    [/delay]

    {COLOR_ADJUST  255  100  100}
    [delay]
        time=150
    [/delay]

    {COLOR_ADJUST -255 -255 -255}
    [delay]
        time=150
    [/delay]

    {COLOR_ADJUST  255    0    0}
    [delay]
        time=150
    [/delay]

    {COLOR_ADJUST 0 0 0}
    [sound]
        name=melee-fire.ogg
    [/sound]

    {KILL id=Mal-Ravanal ANIMATE=yes}
    [remove_item]
        image=terror_aura
    [/remove_item]
    [remove_object]
        object_id=terrified
    [/remove_object]

    #-------------------------
    # MAL-RAVANAL TAUNTS THE HEROES
    #-------------------------
    [music]
        name=journeys_end_faststart.ogg
        immediate=yes
        append=no
    [/music]
    [delay]
        time=4000
    [/delay]

    {FIND_NEARBY_NOT_DACYN_PREFER_HEROES $x1 $y1 99}
    [message]
        speaker=$found_unit.id
        message= _ "Is it over? We’ve won?"
    [/message]
    [delay]
        time=3000
    [/delay]

    {REPLACE_SCENARIO_MUSIC silence.ogg}
    [sound]
        name=wail.wav
    [/sound]

    {NAMED_UNIT 2 (Dark Shape) $x1 $y1 Mal-Ravanal (_"Mal-Ravanal") ()} {FACING sw} {ANIMATE}
    [message]
        speaker=Mal-Ravanal
        message= _ "A-ha haha! You really thought you had a chance there, didn’t you?"
    [/message]
    [message]
        speaker=Mal-Ravanal
        message= _ "Well, coming to the battlefield myself has been entertaining, but that’s enough for now."
    [/message]
    [message]
        speaker=Dacyn
        message= _ "You escaped me once before-"
    [/message]
    {REPLACE_SCENARIO_MUSIC heroes_rite.ogg}

    #-------------------------
    # DACYN CONFRONTS MAL-RAVANAL
    #-------------------------
    # I'm pretty sure all locations work on both 18A and 18B
    {PUT_TO_RECALL_LIST (x,y=24,3)} # if any unit is in the way, silently move it away
    {MOVE_UNIT id=Mal-Ravanal 24 3}

    {RAVANAL_LIGHTNING_SELF}
    [screen_fade]
        red,green,blue=0,0,0
        alpha=255
        duration=0
    [/screen_fade]

    {PUT_TO_RECALL_LIST (
        [not]
            id=Mal-Ravanal
        [/not]
    )} # remove all units
    [redraw]
    [/redraw]

    {MODIFY_UNIT id=Dacyn facing ne}
    {SCROLL_TO 30 1}
    [screen_fade]
        red,green,blue=0,0,0
        alpha=0
        duration=500
    [/screen_fade]

    [recall]
        id,x,y,show=Dacyn,22,4,no
    [/recall]
    {LIGHT_SHIELD_EFFECT_OBJECT_ID Dacyn}
    [animate_unit]
        [filter]
            id=Dacyn
        [/filter]

        flag=reappear
    [/animate_unit]

    [message]
        speaker=Dacyn
        message= _ "-but NEVER AGAIN!!!"
    [/message]

    #-------------------------
    # DACYN OPENS THE PORTAL
    #-------------------------
    {MODIFY_UNIT id=Dacyn facing ne}
    {DACYN_ATTACK}
    {MODIFY_TERRAIN Qxua 24 2}
    [message]
        speaker=Mal-Ravanal
        message= _ "Wha- what is this?!"
    [/message]

    {DACYN_ATTACK}
    {MODIFY_TERRAIN Qxua 25 3}
    [message]
        speaker=Mal-Ravanal
        message= _ "Do you even know where that gate you’re opening leads to?"
    [/message]

    {DACYN_ATTACK}
    {MODIFY_TERRAIN Qxua 25 4}

    {DACYN_ATTACK}
    {MODIFY_TERRAIN Qxua 24 4}
    [message]
        speaker=Mal-Ravanal
        message= _ "..."
    [/message]

    {DACYN_ATTACK}
    {MODIFY_TERRAIN Qxua 23 4}
    [message]
        speaker=Mal-Ravanal
        message= _ "...you think you’re better than me, don’t you? You must think of yourself as some kind of hero."
    [/message]

    {DACYN_ATTACK}
    {MODIFY_TERRAIN Qxua 23 3}
    [message]
        speaker=Mal-Ravanal
        message= _ "You think that a stiff old codger like yourself has what it takes to use that amulet to destroy me? I doubt you even know what you’re doing."
    [/message]

    {DACYN_ATTACK}
    {MODIFY_TERRAIN Qxua 24 3}
    [message]
        speaker=Mal-Ravanal
        message= _ "..."
    [/message]
    [message]
        speaker=Mal-Ravanal
        message= _ "Ha. Ah-ha, haha. Have it your way. I’ll be seeing you soon."
    [/message]

    #-------------------------
    # MAL-RAVANAL DIES
    #-------------------------
    {DACYN_ATTACK}

    [screen_fade]
        red,green,blue=100,0,0
        alpha=255
        duration=0
    [/screen_fade]

    {KILL id=Mal-Ravanal}
    [sound]
        name=lich_die_wail.ogg
    [/sound]

    {MODIFY_TERRAIN Ds    24 2}
    {MODIFY_TERRAIN Ds    25 3}
    {MODIFY_TERRAIN Ds    25 4}
    {MODIFY_TERRAIN Ds    24 4}
    {MODIFY_TERRAIN Ds    23 4}
    {MODIFY_TERRAIN Ds    23 3}
    {MODIFY_TERRAIN Dd^Dc 24 3}
    [redraw]
    [/redraw]
    [delay]
        time=2000
    [/delay]

    #-------------------------
    # DACYN BLEEDS OUT
    #-------------------------
    {MODIFY_UNIT id=Dacyn hitpoints 25}
    [screen_fade]
        red,green,blue=0,0,0
        alpha=0
        duration=2000
    [/screen_fade]

    [delay]
        time=1000
    [/delay]

    [message]
        speaker=Dacyn
        message= _ "It is done."
    [/message]
    [delay]
        time=1000
    [/delay]

    # take a few steps away
    {MOVE_UNIT id=Dacyn 22 6}
    [delay]
        time=500
    [/delay]

    # first injury
    [harm_unit]
        [filter]
            id=Dacyn
        [/filter]

        amount,animate=4,yes
    [/harm_unit]
    {PLACE_IMAGE scenery/blood-1.png 22 6}
    [delay]
        time=750
    [/delay]

    # a little further
    {MOVE_UNIT id=Dacyn 21 7}
    [delay]
        time=500
    [/delay]

    # second injury
    [harm_unit]
        [filter]
            id=Dacyn
        [/filter]

        amount,animate=7,yes
    [/harm_unit]
    {PLACE_IMAGE scenery/blood-2.png 21 7}
    [delay]
        time=1500
    [/delay]

    # one last step...
    {MOVE_UNIT id=Dacyn 20 8}
    [delay]
        time=500
    [/delay]

    # third injury; fade to black
    [sound]
        name=human-old-die-1.ogg
    [/sound]

    [harm_unit]
        [filter]
            id=Dacyn
        [/filter]

        amount,animate=13,no
    [/harm_unit]
    {PLACE_IMAGE scenery/blood-3.png 21 7}
    [screen_fade]
        red,green,blue=0,0,0
        alpha=125
        duration=300
    [/screen_fade]

    [screen_fade]
        red,green,blue=0,0,0
        alpha=255
        duration=150
    [/screen_fade]

    #-------------------------
    # DACYN'S RECKONING
    #-------------------------
    {FADE_TO_BLACK} # this hides only terrain
    [replace_schedule] # so that the Shadow is visible
        {DEFAULT_SCHEDULE_DUSK}
    [/replace_schedule]
    [change_theme]
        theme=Cutscene_Minimal
    [/change_theme]

    {TELEPORT_UNIT id=Dacyn 10 10} # an easy number to work with. Terrain doesn't matter any more
    {SCROLL_TO 5 10}

    {NAMED_UNIT 2 (Ghost)  8  7 "ghost1" "" ()} {FACING se}
    {NAMED_UNIT 2 (Ghost) 15  9 "ghost2" "" ()} {FACING sw}
    {NAMED_UNIT 2 (Ghost) 14 12 "ghost3" "" ()} {FACING nw}
    {NAMED_UNIT 2 (Ghost) 12 13 "ghost4" "" ()} {FACING nw}
    {NAMED_UNIT 2 (Ghost)  8 12 "ghost5" "" ()} {FACING ne}
    {NAMED_UNIT 2 (Ghost)  5 10 "ghost6" "" ()} {FACING se}

    {NAMED_UNIT 2 (Wraith)  7 10 "spirit"  (_"Fallen Soul") ()} {FACING se}
    {NAMED_UNIT 2 (Shadow) 13 10 "spirit2" (_"Fallen Soul") ()} {FACING sw}

    [delay]
        time=5000
    [/delay]

    # fade back in
    [screen_fade]
        red,green,blue=0,0,0
        alpha=0
        duration=2000
    [/screen_fade]

    [message]
        speaker=spirit
        message= _ "Well done! Who else but Dacyn the Magnificent could have defeated such a rival? You truly are the greatest of heroes."
    [/message]
    [message]
        speaker=spirit2
        message= _ "Now, embrace our power! You shall live on as the champion of Irdya!"
    [/message]
    [message]
        speaker=Dacyn
        message= _ "Wha- where am I? What’s happening to me?"
    [/message]
    [message]
        speaker=spirit
        message= _ "The mage called Dacyn is dying! It is time for you to be reborn!"
    [/message]
    [message]
        speaker=Dacyn
        message= _ "-I... -I am no lich! I am no harbinger of darkness, unlike Ravan!"
    [/message]
    [message]
        speaker=spirit2
        message= _ "The wielder of the red stone shall become intertwined with the darkness between worlds, whether they will it or not. You sought this Amulet of your own will, O Magnificent Dacyn!"
    [/message]
    [message]
        speaker=Dacyn
        message= _ "I... I needed this power! I had to safeguard Irdya!"
    [/message]
    [message]
        speaker=spirit
        message= _ "And now you can, for all eternity! Leave your mortal coil behind. Live on as an undying spirit of mighty power, and do unto this world as you will!"
    [/message]
    [message]
        speaker=Dacyn
        message= _ "I... but... I could never choose to-"
    [/message]

    [delay]
        time=2000
    [/delay]

    [sound]
        name=wail.wav
    [/sound]

    [message]
        speaker=spirit
        message= _ "You misunderstand. This is no choice of yours.

The stone bleeds your flesh. The darkness consumes your soul. Rebirth into undeath is the only path forward to escape the Maw, else ye embrace oblivion."
    [/message]
    {MODIFY_UNIT id=Dacyn name (_"Mak-Dak’an")}
    [message]
        speaker=Dacyn
        message= _ "..."
    [/message]
    [delay]
        time=2000
    [/delay]

    {MODIFY_UNIT id=Dacyn name (_"Dacyn")}
    [message]
        speaker=Dacyn
        message= _ "No."
    [/message]
    [delay]
        time=2000
    [/delay]

    [message]
        speaker=Dacyn
        message= _ "No. For too long, I have allowed my pride to overrule my wisdom. I have been arrogant. I have been the fool in this story. I believed I and only I was destined for greatness. But I can see it clearly now. I have been no different than my dear friend Ravan. We have been the same all along."
    [/message]
    [message]
        speaker=Dacyn
        message= _ "But no longer. My will is my own."
    [/message]
    [message]
        speaker=Dacyn
        message= _ "I will not be tempted by undeath. I will pass unto the Land of the Dead, and if I am to be damned there then so be it."
    [/message]
    [message]
        speaker=Dacyn
        message= _ "My story ends here."
    [/message]
    [delay]
        time=1000
    [/delay]

    [sound]
        name=lich-hit-1.ogg
    [/sound]

    [message]
        speaker=spirit2
        message= _ "So be it."
    [/message]
    [message]
        speaker=spirit
        message= _ "<i>THE MAW OPENS ITS JAWS.</i>"
    [/message]
    {MOVE_UNIT (x,y= 8, 7)  9  8}
    {MOVE_UNIT (x,y=15, 9) 14  9}
    {MOVE_UNIT (x,y=14,12) 13 12}
    {MOVE_UNIT (x,y=12,13) 11 13}
    {MOVE_UNIT (x,y= 8,12)  9 12}
    {MOVE_UNIT (x,y= 5,10)  6  9}
    {MOVE_UNIT (x,y= 7,10)  8 10}
    {MOVE_UNIT (x,y=13,10) 12  9}
    [sound]
        name=lich-hit-2.ogg
    [/sound]

    [message]
        speaker=spirit2
        message= _ "<i>DARKNESS CONSUMES THE SOUL.</i>"
    [/message]
    {MOVE_UNIT (x,y= 9, 8)  9  9}
    {MOVE_UNIT (x,y=14, 9) 13 10}
    {MOVE_UNIT (x,y=13,12) 12 11}
    {MOVE_UNIT (x,y=11,13) 11 12}
    {MOVE_UNIT (x,y= 9,12) 10 11}
    {MOVE_UNIT (x,y= 6, 9)  7 10}
    {MOVE_UNIT (x,y= 8,10)  9 11}
    {MOVE_UNIT (x,y=12, 9) 11 10}

    {MODIFY_UNIT id=Dacyn facing nw}
    {DACYN_LIGHTNING}
    {MODIFY_UNIT id=Dacyn facing ne}
    {DACYN_LIGHTNING}
    {DACYN_LIGHTNING_SELF}

    [screen_fade]
        red,green,blue=255,255,255
        alpha=255
        duration=1500
    [/screen_fade]

    [delay]
        time=2000
    [/delay]

    [endlevel]
        result=victory
        bonus=no
        carryover_report=no
        linger_mode=no
    [/endlevel]
[/event]
