#textdomain wesnoth-utbs

#! -- internal variables : $other_creep
#define CREEP_DEATH
    [event]
        name=die
        first_time_only=no
        [filter]
            description=Azkotep
            [or]
                description=Ystara
            [/or]
        [/filter]
        [if]
            [variable]
                name=unit.description
                equals=Azkotep
            [/variable]
            [then]
                {VARIABLE other_creep "Ystara"}
            [/then]
            [else]
                {VARIABLE other_creep "Azkotep"}
            [/else]
        [/if]
        [if]
            [have_unit]
                description=$other_creep
            [/have_unit]
            [then]
                [message]
                    description=$unit.description
                    message= _ "You think you have defeated me, don't you? Foolish boy, I shall assume a new form more powerful and horrible than you could ever imagine!"
                [/message]
                [message]
                    description=$other_creep
                    message= _ "How dare you interfere in our contest! I did not need your help. I shall teach you not to cross a lord of darkness."
                [/message]
                {CLEAR_VARIABLE other_creep}
            [/then]
        [/if]
        [if]
            [have_unit]
                description=Possessed Garak
            [/have_unit]
            [or]
                [variable]
                    name=turn_number
                    greater_than=11
                [/variable]
            [/or]
            [then]
                [message]
                    description=Kaleh
                    message= _ "Finally. It is over."
                [/message]
                [if]
                    [have_unit]
                        description=Possessed Garak
                    [/have_unit]
                    [then]
                        [message]
                            description=Possessed Garak
                            message= _ "See, I told you I was more powerful. This game is over, now I can leave this shell of a body."
                        [/message]
                        [kill]
                            description=Possessed Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        [unstore_unit]
                            variable=ElvishGarak
                            find_vacant=yes
                        [/unstore_unit]
                        [message]
                            description=Zhul
                            message= _ "He's...He's still breathing!"
                        [/message]
                        [message]
                            description=Garak
                            message= _ "Protect the boy for me Zhul, (cough) I go to a better place."
                        [/message]
                        [kill]
                            description=Garak
                            animate=yes
                            fire_event=no
                        [/kill]
                    [/then]
                    [else]
                        [message]
                            description=Nym
                            message=_"What about Garak?"
                        [/message]
                        [if]
                            [variable]
                                name=defiant_death
                                equals=0
                            [/variable]
                            [then]
                                [message]
                                    description=Kaleh
                                    message=_"I've asked and looked around, there is no sign of him or his body"
                                [/message]
                                [message]
                                    description=Zhul
                                    message=_"He's probably dead then, but he died as a warrior. Let's respect his wishes and remember him for that."
                                [/message]
                            [/then]
                            [else]
                                [message]
                                    description=Zhul
                                    message=_"He died as a hero. Remember that and tell the tale, for it's worth it."
                                [/message]
                            [/else]
                        [/if]
                    [/else]
                [/if]
                [message]
                    description=Kaleh
                    message= _ "From the sands he came, to the sands he will return. We remember and honor his sacrifice, and I vow that his death will not be in vain. "
                [/message]
                [message]
                    description=Zhul
                    message= _ "Goodbye old friend, may Eloh shine her light eternal upon you."
                [/message]
                [message]
                    description=Elyssa
                    message= _ "He was as brave and valiant a fighter as I have ever seen in my travels."
                [/message]
                [message]
                    description=Nym
                    message= _ "He was a bastard at times.... But...but why did he have to die? It...it just doesn't make sense. "
                [/message]
                [if]
                    [variable]
                        name=elven_camps
                        equals=12
                    [/variable]
                    [then]
                        [message]
                            description=Zhul
                            message= _ "Miraculously, all of our encampments survived the night."
                        [/message]
                        [message]
                            description=Nym
                            message= _ "Though we saved almost all our people this time, we won't always be so lucky. While elves who have fought with you in the past will gladly return, if the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                        [/message]
                        {VARIABLE scen3 1}
                    [/then]
                    [else]
                        [message]
                            description=Zhul
                            message= _ "Well, only $elven_camps encampments remain, but we will survive."
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "Yes, but at what cost?"
                        [/message]
                        [if]
                            [variable]
                                name=elven_camps
                                greater_than=8
                            [/variable]
                            [then]
                                [message]
                                    description=Nym
                                    message= _ "Though we saved almost all our people this time, we won't always be so lucky. While elves who have fought with you in the past will gladly return, as the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                                [/message]
                                {VARIABLE scen3 1}
                            [/then]
                            [else]
                                [if]
                                    [variable]
                                        name=elven_camps
                                        greater_than=6
                                    [/variable]
                                    [then]
                                        [message]
                                            description=Nym
                                            message= _ "We have suffered losses, but we we are not broken yet. We have saved most of our people tonight. But while elves who have fought with you in the past will gladly return, as the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                                        [/message]
                                        {VARIABLE scen3 2}
                                    [/then]
                                    [else]
                                        [message]
                                            description=Nym
                                            message= _ "We have suffered grievous losses, but we we are not broken yet. Long will this slaughter be remembered by our people. Where was Eloh during the darkness? And I'm afraid that while elves who have fought with you in the past will gladly return, as the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                                        [/message]
                                        {VARIABLE scen3 3}
                                    [/else]
                                [/if]
                            [/else]
                        [/if]
                    [/else]
                [/if]
                [message]
                    description=Kaleh
                    message= _ "All this death and destruction. What were those shades arguing over? Was this all just some sort of demented game?"
                [/message]
                [message]
                    description=Zhul
                    message= _ "The lords of the dead are powerful and twisted indeed. Only Eloh knows the truth of what happened tonight."
                [/message]
                [message]
                    description=Nym
                    message= _ "I don't want to be here tomorrow night to find out. The hills to the north are close. Let's be far away before another nightfall."
                [/message]
                {CLEAR_VARIABLE elven_camps}
                {CLEAR_VARIABLE defiant_death}
                {CLEAR_VARIABLE zur_challenged}
                {CLEAR_VARIABLE grak_challenged}
                {CLEAR_VARIABLE ElvishGarak}
                {CLEAR_VARIABLE other_creep}
                [endlevel]
                    result=victory
                    bonus=yes
                [/endlevel]
            [/then]
        [/if]
        [if]
            [not]
                [have_unit]
                    description=$other_creep
                [/have_unit]
            [/not]
            [variable]
                name=turn_number
                less_than=12
            [/variable]
            [then]
                [message]
                    description=Kaleh
                    message= _ "The undead lords are defeated at last."
                [/message]
                [message]
                    description=Ganthos
                    message= _ "There's too many of them and the night is almost gone. Pull back you wretches, pull back!"
                [/message]
                [message]
                    description=Nym
                    message= _ "I can see the first rays of Naia shining over the horizon. She never looked so beautiful. The undead forces have crumbled into dust and the remaining orcs are retreating with the dawn."
                [/message]
                [message]
                    description=Zhul
                    message= _ "That was a very brave thing you did, Kaleh, defeating both of those Undead Lords. It took great courage and strength. Because of your daring attack, we did not have to wait for the dawn to save us. You were our savior. And many fewer of our people died than would have if we had had to wait out the long night."
                [/message]
                [message]
                    description=Nym
                    message= _ "Though we saved almost all our people this time, we won't always be so lucky. While elves who have fought with you in the past will gladly return, if the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                [/message]
                [message]
                    speaker=Ystara
                    message= _ "You have triumphed for the moment, but think not that the dark lords can be so easily vanquished. We shall return, and shall rule long after your bones have crumbled to dust. This is our land, and none shall leave it unscathed."
                [/message]
                [message]
                    speaker=Azkotep
                    message= _ "You fought so hard to protect your precious people, young elf. No great deed should go unpunished."
                [/message]
                [if]
                    [have_unit]
                        description=Garak
                    [/have_unit]
                    [then]
                        [message]
                            speaker=Ystara
                            message= _ "A token to remember us by..."
                        [/message]
                        [message]
                            speaker=Garak
                            message= _ "Aaaauuugggghhhh!"
                        [/message]
                        [message]
                            speaker=Zhul
                            message= _ "He just collapsed!"
                        [/message]
                        [message]
                            description=Garak
                            message= _ "Protect the boy for me Zhul, (cough) I go to a better place."
                        [/message]
                        [kill]
                            description=Garak
                            animate=yes
                            fire_event=no
                        [/kill]
                    [/then]
                    [else]
                        [message]
                            speaker=Ystara
                            message=_"You will never see your champion again. And we will torment his soul for the rest of the eternity."
                        [/message]
                        [message]
                            speaker=Zhul
                            message=_"Don't listen to them, they are powerless in their defeat. Even if Garak fell in battle his soul went to a better place and they can't reach him there."
                        [/message]
                    [/else]
                [/if]
                [message]
                    description=Kaleh
                    message= _ "From the sands he came, to the sands he will return. We remember and honor his sacrifice, and I vow that his death will not be in vain. "
                [/message]
                [message]
                    description=Zhul
                    message= _ "Goodbye old friend, may Eloh shine her light eternal upon you."
                [/message]
                [message]
                    description=Elyssa
                    message= _ "He was as brave and valiant a fighter as I have ever seen in my travels."
                [/message]
                [message]
                    description=Nym
                    message= _ "He was a bastard at times.... But...but why did he have to die? It...it just doesn't make sense. "
                [/message]
                #! -- for compatibility with classic path
                {VARIABLE scen3 1}
                {CLEAR_VARIABLE elven_camps}
                {CLEAR_VARIABLE defiant_death}
                {CLEAR_VARIABLE zur_challenged}
                {CLEAR_VARIABLE grak_challenged}
                {CLEAR_VARIABLE ElvishGarak}
                {CLEAR_VARIABLE other_creep}
                [endlevel]
                    result=victory
                    bonus=yes
                [/endlevel]
            [/then]
        [/if]
    [/event]

    [event]
        name=die
        [filter]
            description=Possessed Garak
        [/filter]
        [kill]
            description=Possessed Garak
            animate=no
            fire_event=no
        [/kill]
        [if]
            [have_unit]
                description=Azkotep
            [/have_unit]
            [then]
                [message]
                    description=Azkotep
                    message= _ "Hah, now you have learned the flesh is always weaker than the powers of the undead."
                [/message]
            [/then]
            [else]
                [message]
                    description=Ystara
                    message= _ "My undead zombies shall always defeat the living."
                [/message]
            [/else]
        [/if]
        [message]
            description=Kaleh
            message= _ "Finally. It is over."
        [/message]
        [unstore_unit]
            variable=ElvishGarak
            find_vacant=yes
        [/unstore_unit]
        [message]
            description=Zhul
            message= _ "He's...He's still breathing!"
        [/message]
        [message]
            description=Garak
            message= _ "Protect the boy for me Zhul, (cough) I go to a better place."
        [/message]
        [kill]
            description=Garak
            animate=yes
            fire_event=no
        [/kill]
        [message]
            description=Kaleh
            message= _ "From the sands he came, to the sands he will return. We remember and honor his sacrifice, and I vow that his death will not be in vain. "
        [/message]
        [message]
            description=Zhul
            message= _ "Goodbye old friend, may Eloh shine her light eternal upon you."
        [/message]
        [message]
            description=Elyssa
            message= _ "He was as brave and valiant a fighter as I have ever seen in my travels."
        [/message]
        [message]
            description=Nym
            message= _ "He was a bastard at times.... But...but why did he have to die? It...it just doesn't make sense. "
        [/message]
        [if]
            [variable]
                name=elven_camps
                equals=12
            [/variable]
            [then]
                [message]
                    description=Zhul
                    message= _ "Miraculously, all of our encampments survived the night."
                [/message]
                [message]
                    description=Nym
                    message= _ "Though we saved almost all our people this time, we won't always be so lucky. While elves who have fought with you in the past will gladly return, if the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                [/message]
                {VARIABLE scen3 1}
            [/then]
            [else]
                [message]
                    description=Zhul
                    message= _ "Well, only $elven_camps encampments remain, but we will survive."
                [/message]
                [message]
                    description=Kaleh
                    message= _ "Yes, but at what cost?"
                [/message]
                [if]
                    [variable]
                        name=elven_camps
                        greater_than=8
                    [/variable]
                    [then]
                        [message]
                            description=Nym
                            message= _ "Though we saved almost all our people this time, we won't always be so lucky. While elves who have fought with you in the past will gladly return, as the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                        [/message]
                        {VARIABLE scen3 1}
                    [/then]
                    [else]
                        [if]
                            [variable]
                                name=elven_camps
                                greater_than=6
                            [/variable]
                            [then]
                                [message]
                                    description=Nym
                                    message= _ "We have suffered losses, but we we are not broken yet. We have saved most of our people tonight. But while elves who have fought with you in the past will gladly return, as the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                                [/message]
                                {VARIABLE scen3 2}
                            [/then]
                            [else]
                                [message]
                                    description=Nym
                                    message= _ "We have suffered grievous losses, but we we are not broken yet. Long will this slaughter be remembered by our people. Where was Eloh during the darkness? And I'm afraid that while elves who have fought with you in the past will gladly return, as the numbers of our people dwindle, it's going to become more and more costly to recruit new warriors. It would be wise to stockpile gold against this eventuality."
                                [/message]
                                {VARIABLE scen3 3}
                            [/else]
                        [/if]
                    [/else]
                [/if]
            [/else]
        [/if]
        [message]
            description=Kaleh
            message= _ "All this death and destruction. What were those shades arguing over? Was this all just some sort of demented game?"
        [/message]
        [message]
            description=Zhul
            message= _ "The lords of the dead are powerful and twisted indeed. Only Eloh knows the truth of what happened tonight."
        [/message]
        [message]
            description=Nym
            message= _ "I don't want to be here tomorrow night to find out. The hills to the north are close. Let's be far away before another nightfall."
        [/message]
        {CLEAR_VARIABLE elven_camps}
        {CLEAR_VARIABLE defiant_death}
        {CLEAR_VARIABLE zur_challenged}
        {CLEAR_VARIABLE grak_challenged}
        {CLEAR_VARIABLE ElvishGarak}
        [endlevel]
            result=victory
            bonus=yes
        [/endlevel]
    [/event]
#enddef
