#textdomain wesnoth-utbs

#! --Turn 12
#! --The sun should rise, it won't needs dialogue
#! --If both bad guys alive -> kill Garak ->replace with zombie if champion not killed in a duel else just kill
#! --If one alive && his champion not killed in a duel -> kill garak, place fallen one -> else just kill
#! --If both died it will not be invoked
#! -- internal variables : $choice_flag, $i, $coords
#define POSSESION
    [event]
        name=turn 12

        {VARIABLE choice_flag 0}

        [if]
            [have_unit]
                description=Azkotep
            [/have_unit]
            [then]
                {VARIABLE_OP choice_flag add 1000}
            [/then]
        [/if]
        [if]
            [have_unit]
                description=Ystara
            [/have_unit]
            [then]
                {VARIABLE_OP choice_flag add 100}
            [/then]
        [/if]
        {VARIABLE_OP grak_challenged multiply 10}
        {VARIABLE_OP choice_flag add $grak_challenged}
        {VARIABLE_OP grak_challenged divide 10}
        {VARIABLE_OP zur_challenged multiply 1}
        {VARIABLE_OP choice_flag add $zur_challenged}

        [message]
            description=Nym
            message= _"Look, dawn is nigh, our salvation is almost at hand. Even the long dark can't last forever, and with the light of the sun the undead power wanes and their dark magics unravel."
        [/message]

        [if]
            [variable]
                name=choice_flag
                greater_than=99
            [/variable]
            [then]
                [if]
                    [variable]
                        name=choice_flag
                        equals=1111
                    [/variable]
                    [then]
                        [message]
                            description=Ystara
                            message= _ "No! This contest is not over yet, Azkotep. I shall show you a taste of my true power."
                        [/message]
                        [if]
                            [have_unit]
                                description=Garak
                            [/have_unit]
                            [then]
                                [store_locations]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=coords
                                [/store_locations]
                                [store_unit]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=ElvishGarak
                                    kill=no
                                [/store_unit]
                                [kill]
                                    description=Garak
                                    animate=yes
                                    fire_event=no
                                [/kill]
                            [/then]
                        [/if]
                        [kill]
                            description=Ystara
                            animate=yes
                            fire_event=no
                        [/kill]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 2 $coords.x $coords.y}
                        [message]
                            description=Zhul
                            message= _ "Eloh protect us, what has he done?"
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "I live again! I can feel!"
                        [/message]
                        [kill]
                            description=Possessed Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        [unstore_unit]
                            variable=ElvishGarak
                            x=$coords.x
                            y=$coords.y
                            find_vacant=yes
                        [/unstore_unit]
                        [message]
                            description=Garak
                            message=_"I will... not... yield... I defeated... your... champion... I... will... overcome... you..."
                        [/message]
                        [kill]
                            description=Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 2 $coords.x $coords.y}
                        [message]
                            description=Possessed Garak
                            message=_"No fool! Stop!"
                        [/message]
                        [kill]
                            description=Possessed Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        [unstore_unit]
                            variable=ElvishGarak
                            x=$coords.x
                            y=$coords.y
                            find_vacant=yes
                        [/unstore_unit]
                        [message]
                            description=Garak
                            message=_"The dark lord... is no more..."
                        [/message]

                        [message]
                            speaker=narrator
                            message=_"Garak collapses to the ground with own blade sticking from his chest."
                            image=wesnoth-icon.png
                        [/message]
                        [kill]
                            description=Garak
                            animate=yes
                            fire_event=no
                        [/kill]
                        [message]
                            description=Azkotep
                            message= _"No! How dare you! I shall have my vengeance upon you for spoiling this contest! Darkness shall reign until I have triumphed!"
                        [/message]
                        [message]
                            description=Nym
                            message= _ "Maybe I spoke too soon. Curse Uria, he has even blotted out the stars, all is darkness. Kaleh, our course is clear, we must destroy that abomination."
                        [/message]
                        [objectives]
                            summary= _ "New Objectives:"
                            show=yes
                            [objective]
                                description= _ "Defeat Azkotep"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "You Control Less Than 6 Villages"
                                condition=lose
                            [/objective]
                            [objective]
                                description= _ "Death of Kaleh, Nym or Zhul"
                                condition=lose
                            [/objective]
                        [/objectives]
                        {VARIABLE defiant_death 1}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=choice_flag
                        equals=1110
                    [/variable]
                    [then]
                        [message]
                            description=Azkotep
                            message= _ "No, I shall have my revenge. I shall show you that darkness is strongest just before dawn. Death and decay, grant me my vengeance!"
                        [/message]
                        [message]
                            description=Ystara
                            message= _ "In this I shall support you, the sun shall not rise until one of us is victorious."
                        [/message]

                        [if]
                            [have_unit]
                                description=Garak
                            [/have_unit]
                            [then]
                                [store_locations]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=coords
                                [/store_locations]
                                [store_unit]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=ElvishGarak
                                    kill=no
                                [/store_unit]
                                [kill]
                                    description=Garak
                                    animate=yes
                                    fire_event=no
                                [/kill]
                            [/then]
                        [/if]
                        [kill]
                            description=Azkotep
                            animate=yes
                            fire_event=no
                        [/kill]
                        [place_shroud]
                            x=1-60
                            y=1-60
                        [/place_shroud]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 2 21 24}
                        {VARIABLE i 0}
#ifdef HARD
                        {FOREACH azkotep_casaulties i}
                        {VARIABLE azkotep_casaulties[$i].unit.side 2}
                        [unstore_unit]
                            variable=azkotep_casaulties[$i].unit
                            x=21
                            y=24
                            find_vacant=yes
                        [/unstore_unit]
                        {NEXT i}
#else
                        [while]
                            [not]
                                [variable]
                                    name=i
                                    equals=$killed_by_azkotep
                                [/variable]
                            [/not]
                            [do]
#ifdef MEDIUM
                                {RANDOM 0..100}
                                [if]
                                    [variable]
                                        name=random
                                        less_than=51
                                    [/variable]
                                    [then]
                                        {UNIT_ (Walking Corpse) () ("") 2 21 24}
                                    [/then]
                                    [else]
                                        {UNIT_ (Soulless) () ("") 2 21 24}
                                    [/else]
                                [/if]
#endif
#ifdef EASY
                                {UNIT_ (Walking Corpse) () ("") 2 21 24}
#endif
						{VARIABLE_OP i add 1}
                            [/do]
                        [/while]
#endif
                        [message]
                            description=Possessed Garak
                            message=_"Hahaha!..."
                        [/message]
                        [message]
                            description=Zhul
                            message= _ "Eloh protect us, what has he done?"
                        [/message]
                        [redraw]
                            side=1
                        [/redraw]
                        [message]
                            description=Possessed Garak
                            message= _ "I live again! I can feel!"
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "Garak?"
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "Hahahaha! Your puny friend is no more. With his body I shall crush you all. Arise again my minions and feast in the slaughter!"
                        [/message]
                        [message]
                            description=Nym
                            message= _ "Maybe I spoke too soon. Curse Uria, they have even blotted out the stars, all is darkness. Kaleh, our course is clear, we must destroy one of these abominations. Whether it be the thing that has taken our friend, or the spectral evil that remains, one of them must die for this battle to end. We have no choice."
                        [/message]
                        [message]
                            description=Zhul
                            message= _ "But to kill Garak? How can we?"
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "That thing is not Garak. This night has lasted long enough, and too many of our people have died. How many more would you sacrifice for Garak's sake? Just protecting our encampments isn't enough, darkness and chaos will overwhelm us if we can't end this battle soon. We must destroy one of those two evils, whatever the cost. I do not intend to let that...thing keep control of the body of our friend."
                        [/message]
                        [message]
                            description=Ystara
                            message= _ "The stench of death is in the air."
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "Yes, let us end this once and for all."
                        [/message]
                        [objectives]
                            summary= _ "New Objectives:"
                            show=yes
                            [objective]
                                description=_"Defeat Possessed Garak (or)"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "Defeat Ystara"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "You Control Less Than 6 Villages"
                                condition=lose
                            [/objective]
                            [objective]
                                description= _ "Death of Kaleh, Nym or Zhul"
                                condition=lose
                            [/objective]
                        [/objectives]
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=choice_flag
                        equals=1101
                    [/variable]
                    [or]
                        [variable]
                            name=choice_flag
                            equals=1100
                        [/variable]
                    [/or]
                    [then]
                        [message]
                            description=Ystara
                            message= _ "No, I shall have my revenge. I shall show you that darkness is strongest just before dawn. Death and decay, grant me my vengeance!"
                        [/message]
                        [message]
                            description=Azkotep
                            message= _ "In this I shall support you, the sun shall not rise until one of us is victorious."
                        [/message]
                        [if]
                            [have_unit]
                                description=Garak
                            [/have_unit]
                            [then]
                                [store_locations]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=coords
                                [/store_locations]
                                [store_unit]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=ElvishGarak
                                    kill=no
                                [/store_unit]
                                [kill]
                                    description=Garak
                                    animate=yes
                                    fire_event=no
                                [/kill]
                            [/then]
                        [/if]
                        [kill]
                            description=Ystara
                            animate=yes
                            fire_event=no
                        [/kill]
                        [redraw]
                            side=1
                        [/redraw]
                        [place_shroud]
                            x=1-60
                            y=1-60
                        [/place_shroud]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 3 23 6}
                        {VARIABLE i 0}
#ifdef HARD
                        {FOREACH ystara_casaulties i}
                        {VARIABLE ystara_casaulties[$i].side 3}
                        [unstore_unit]
                            variable=ystara_casaulties[$i].unit
                            x=23
                            y=6
                            find_vacant=yes
                        [/unstore_unit]
                        {NEXT i}
#else
                        [while]
                            [not]
                                [variable]
                                    name=i
                                    equals=$killed_by_ystara
                                [/variable]
                            [/not]
                            [do]
#ifdef MEDIUM
                                {RANDOM 0..100}
                                [if]
                                    [variable]
                                        name=random
                                        less_than=51
                                    [/variable]
                                    [then]
                                        {UNIT_ (Walking Corpse) () ("") 3 23 6}
                                    [/then]
                                    [else]
                                        {UNIT_ (Soulless) () ("") 3 23 6}
                                    [/else]
                                [/if]
#endif
#ifdef EASY
                                {UNIT_ (Walking Corpse) () ("") 3 23 6}
#endif
						{VARIABLE_OP i add 1}
                            [/do]
                        [/while]
#endif
                        [message]
                            description=Possessed Garak
                            message=_"Hahaha!.."
                        [/message]
                        [message]
                            description=Zhul
                            message= _ "Eloh protect us, what has she done?"
                        [/message]
                        [redraw]
                            side=1
                        [/redraw]
                        [message]
                            description=Possessed Garak
                            message= _ "I live again! I can feel!"
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "Garak?"
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "Hahahaha! Your puny friend is no more. With his body I shall crush you all. Arise again my minions and feast in the slaughter!"
                        [/message]
                        [message]
                            description=Nym
                            message= _ "Maybe I spoke too soon. Curse Uria, they have even blotted out the stars, all is darkness. Kaleh, our course is clear, we must destroy one of these abominations. Whether it be the thing that has taken our friend, or the spectral evil that remains, one of them must die for this battle to end. We have no choice."
                        [/message]
                        [message]
                            description=Zhul
                            message= _ "But to kill Garak? How can we?"
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "That thing is not Garak. This night has lasted long enough, and too many of our people have died. How many more would you sacrifice for Garak's sake? Just protecting our encampments isn't enough, darkness and chaos will overwhelm us if we can't end this battle soon. We must destroy one of those two evils, whatever the cost. I do not intend to let that...thing keep control of the body of our friend."
                        [/message]
                        [message]
                            description=Azkotep
                            message= _ "The stench of death is in the air."
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "Yes, let us end this once and for all."
                        [/message]
                        [objectives]
                            summary= _ "New Objectives:"
                            show=yes
                            [objective]
                                description=_"Defeat Possessed Garak (or)"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "Defeat Azkotep"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "You Control Less Than 6 Villages"
                                condition=lose
                            [/objective]
                            [objective]
                                description= _ "Death of Kaleh, Nym or Zhul"
                                condition=lose
                            [/objective]
                        [/objectives]
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=choice_flag
                        equals=1010
                    [/variable]
                    [or]
                        [variable]
                            name=choice_flag
                            equals=1011
                        [/variable]
                    [/or]
                    [then]
                        [message]
                            description=Ystara
                            message= _ "No! This contest is not over yet, Azkotep. I shall show you a taste of my true power."
                        [/message]
                        [if]
                            [have_unit]
                                description=Garak
                            [/have_unit]
                            [then]
                                [store_locations]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=coords
                                [/store_locations]
                                [store_unit]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=ElvishGarak
                                    kill=no
                                [/store_unit]
                                [kill]
                                    description=Garak
                                    animate=yes
                                    fire_event=no
                                [/kill]
                            [/then]
                        [/if]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 2 $coords.x $coords.y}
                        [message]
                            description=Zhul
                            message= _ "Eloh protect us, what has she done?"
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "I live again! I can feel!"
                        [/message]
                        [kill]
                            description=Possessed Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        [unstore_unit]
                            variable=ElvishGarak
                            x=$coords.x
                            y=$coords.y
                            find_vacant=yes
                        [/unstore_unit]
                        [message]
                            description=Garak
                            message=_"I will... not... yield... I defeated... your... champion... I... will... overcome... you..."
                        [/message]
                        [kill]
                            description=Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 2 $coords.x $coords.y}
                        [message]
                            description=Possessed Garak
                            message=_"No fool! Stop!"
                        [/message]
                        [kill]
                            description=Possessed Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        [unstore_unit]
                            variable=ElvishGarak
                            x=$coords.x
                            y=$coords.y
                            find_vacant=yes
                        [/unstore_unit]
                        [message]
                            description=Garak
                            message=_"The dark lord... is no more..."
                        [/message]

                        [message]
                            speaker=narrator
                            message=_"Garak colapses to the ground with own blade sticking form his chest."
                            image=wesnoth-icon.png
                        [/message]
                        [kill]
                            description=Garak
                            animate=yes
                            fire_event=no
                        [/kill]
                        [message]
                            description=Azkotep
                            message= _"No! How dare you! I shall have my vengeance upon you for spoiling this contest! Darkness shall reign until I have triumphed!"
                        [/message]
                        [message]
                            description=Nym
                            message= _ "Maybe I spoke too soon. Curse Uria, he has even blotted out the stars, all is darkness. Kaleh, our course is clear, we must destroy that abomination."
                        [/message]
                        [objectives]
                            summary= _ "New Objectives:"
                            show=yes
                            [objective]
                                description= _ "Defeat Azkotep"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "You Control Less Than 6 Villages"
                                condition=lose
                            [/objective]
                            [objective]
                                description= _ "Death of Kaleh, Nym or Zhul"
                                condition=lose
                            [/objective]
                        [/objectives]
                        {VARIABLE defiant_death 1}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=choice_flag
                        equals=1001
                    [/variable]
                    [or]
                        [variable]
                            name=choice_flag
                            equals=1000
                        [/variable]
                    [/or]
                    [then]
                        [if]
                            [have_unit]
                                description=Garak
                            [/have_unit]
                            [then]
                                [store_locations]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=coords
                                [/store_locations]
                                [store_unit]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=ElvishGarak
                                    kill=no
                                [/store_unit]
                                [kill]
                                    description=Garak
                                    animate=yes
                                    fire_event=no
                                [/kill]
                            [/then]
                        [/if]
                        [place_shroud]
                            x=1-60
                            y=1-60
                        [/place_shroud]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 3 23 6}
                        {VARIABLE i 0}
#ifdef HARD
                        {FOREACH ystara_casaulties i}
                        {VARIABLE ystara_casaulties[$i].unit.side 3}
                        [unstore_unit]
                            variable=ystara_casaulties[$i].unit
                            x=23
                            y=6
                            find_vacant=yes
                        [/unstore_unit]
                        {NEXT i}
#else
                        [while]
                            [not]
                                [variable]
                                    name=i
                                    equals=$killed_by_ystara
                                [/variable]
                            [/not]
                            [do]
#ifdef MEDIUM
                                {RANDOM 0..100}
                                [if]
                                    [variable]
                                        name=random
                                        less_than=51
                                    [/variable]
                                    [then]
                                        {UNIT_ (Walking Corpse) () ("") 3 23 6}
                                    [/then]
                                    [else]
                                        {UNIT_ (Soulless) () ("") 3 23 6}
                                    [/else]
                                [/if]
#endif
#ifdef EASY
                                {UNIT_ (Walking Corpse) () ("") 3 23 6}
#endif
						{VARIABLE_OP i add 1}
                            [/do]
                        [/while]
#endif
                        [message]
                            description=Possessed Garak
                            message=_"Hahaha!.."
                        [/message]
                        [message]
                            description=Zhul
                            message= _ "Eloh protect us, what is happening?"
                        [/message]
                        [redraw]
                            side=1
                        [/redraw]
                        [message]
                            description=Possessed Garak
                            message= _ "I live again! I can feel!"
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "Garak?"
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "Hahahaha! Your puny friend is no more. With his body I shall crush you all. Arise again my minions and feast in the slaughter!"
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "I told you, I will be back you fools! Now I shall have my vengeance upon you all. Darkness shall reign until I have triumphed!"
                        [/message]
                        [message]
                            description=Azkotep
                            message= _ "In this I shall support you, the sun shall not rise until one of us is victorious."
                        [/message]
                        [message]
                            description=Nym
                            message= _ "Maybe I spoke too soon. Curse Uria, they have even blotted out the stars, all is darkness. Kaleh, our course is clear, we must destroy one of these abominations. Whether it be the thing that has taken our friend, or the spectral evil that remains, one of them must die for this battle to end. We have no choice."
                        [/message]
                        [message]
                            description=Zhul
                            message= _ "But to kill Garak? How can we?"
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "That thing is not Garak. This night has lasted long enough, and too many of our people have died. How many more would you sacrifice for Garak's sake? Just protecting our encampments isn't enough, darkness and chaos will overwhelm us if we can't end this battle soon. We must destroy one of those two evils, whatever the cost. I do not intend to let that...thing keep control of the body of our friend."
                        [/message]
                        [message]
                            description=Azkotep
                            message= _ "The stench of death is in the air."
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "Yes, let us end this once and for all."
                        [/message]
                        [objectives]
                            summary= _ "New Objectives:"
                            show=yes
                            [objective]
                                description=_"Defeat Possessed Garak (or)"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "Defeat Azkotep"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "You Control Less Than 6 Villages"
                                condition=lose
                            [/objective]
                            [objective]
                                description= _ "Death of Kaleh, Nym or Zhul"
                                condition=lose
                            [/objective]
                        [/objectives]
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=choice_flag
                        equals=101
                    [/variable]
                    [or]
                        [variable]
                            name=choice_flag
                            equals=111
                        [/variable]
                    [/or]
                    [then]
                        [message]
                            description=Azkotep
                            message= _ "No, I shall have my revenge. I shall show you that darkness is strongest just before dawn. Death and decay, grant me my vengeance!"
                        [/message]
                        [if]
                            [have_unit]
                                description=Garak
                            [/have_unit]
                            [then]
                                [store_locations]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=coords
                                [/store_locations]
                                [store_unit]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=ElvishGarak
                                    kill=no
                                [/store_unit]
                                [kill]
                                    description=Garak
                                    animate=yes
                                    fire_event=no
                                [/kill]
                            [/then]
                        [/if]
                        [kill]
                            description=Azkotep
                            animate=yes
                            fire_event=no
                        [/kill]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 2 $coords.x $coords.y}
                        [message]
                            description=Zhul
                            message= _ "Eloh protect us, what is happening?"
                        [/message]

                        [message]
                            description=Possessed Garak
                            message= _ "I live again! I can feel!"
                        [/message]
                        [kill]
                            description=Possessed Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        [unstore_unit]
                            variable=ElvishGarak
                            x=$coords.x
                            y=$coords.y
                            find_vacant=yes
                        [/unstore_unit]
                        [message]
                            description=Garak
                            message=_"I will... not... yield... I defeated... your... champion... I... will... overcome... you..."
                        [/message]
                        [kill]
                            description=Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 2 $coords.x $coords.y}
                        [message]
                            description=Possessed Garak
                            message=_"No fool! Stop!"
                        [/message]
                        [kill]
                            description=Possessed Garak
                            animate=no
                            fire_event=no
                        [/kill]
                        [unstore_unit]
                            variable=ElvishGarak
                            x=$coords.x
                            y=$coords.y
                            find_vacant=yes
                        [/unstore_unit]
                        [message]
                            description=Garak
                            message=_"The dark lord... is no more..."
                        [/message]
                        [message]
                            speaker=narrator
                            message=_"Garak colapses to the ground with own blade sticking form his chest."
                            image=wesnoth-icon.png
                        [/message]
                        [kill]
                            description=Garak
                            animate=yes
                            fire_event=no
                        [/kill]
                        [message]
                            description=Ystara
                            message= _"No! How dare you! I shall have my vengeance upon you for spoiling this contest! Darkness shall reign until I have triumphed!"
                        [/message]
                        [message]
                            description=Nym
                            message= _ "Maybe I spoke too soon. Curse Uria, she has even blotted out the stars, all is darkness. Kaleh, our course is clear, we must destroy that abomination."
                        [/message]
                        [objectives]
                            summary= _ "New Objectives:"
                            show=yes
                            [objective]
                                description= _ "Defeat Ystara"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "You Control Less Than 6 Villages"
                                condition=lose
                            [/objective]
                            [objective]
                                description= _ "Death of Kaleh, Nym or Zhul"
                                condition=lose
                            [/objective]
                        [/objectives]
                        {VARIABLE defiant_death 1}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=choice_flag
                        equals=110
                    [/variable]
                    [or]
                        [variable]
                            name=choice_flag
                            equals=100
                        [/variable]
                    [/or]
                    [then]
                        [if]
                            [have_unit]
                                description=Garak
                            [/have_unit]
                            [then]
                                [store_locations]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=coords
                                [/store_locations]
                                [store_unit]
                                    [filter]
                                        description=Garak
                                    [/filter]
                                    variable=ElvishGarak
                                    kill=no
                                [/store_unit]
                                [kill]
                                    description=Garak
                                    animate=yes
                                    fire_event=no
                                [/kill]
                            [/then]
                        [/if]
                        [place_shroud]
                            x=1-60
                            y=1-60
                        [/place_shroud]
                        {UNIT_ (Corrupted Elf) (Possessed Garak) ( _ "Possessed Garak") 2 21 24}
                        {VARIABLE i 0}
#ifdef HARD
                        {FOREACH azkotep_casaulties i}
                        {VARIABLE azkotep_casaulties[$i].unit.side 2}
                        [unstore_unit]
                            variable=azkotep_casaulties[$i].unit
                            x=21
                            y=24
                            find_vacant=yes
                        [/unstore_unit]
                        {NEXT i}
#else
                        [while]
                            [not]
                                [variable]
                                    name=i
                                    equals=$killed_by_azkotep
                                [/variable]
                            [/not]
                            [do]
#ifdef MEDIUM
                                {RANDOM 0..100}
                                [if]
                                    [variable]
                                        name=random
                                        less_than=51
                                    [/variable]
                                    [then]
                                        {UNIT_ (Walking Corpse) () ("") 2 21 24}
                                    [/then]
                                    [else]
                                        {UNIT_ (Soulless) () ("") 2 21 24}
                                    [/else]
                                [/if]
#endif
#ifdef EASY
                                {UNIT_ (Walking Corpse) () ("") 2 21 24}
#endif
						{VARIABLE_OP i add 1}
                            [/do]
                        [/while]
#endif
                        [message]
                            description=Possessed Garak
                            message=_"Hahaha!.."
                        [/message]
                        [message]
                            description=Zhul
                            message= _ "Eloh protect us, what is happening?"
                        [/message]
                        [redraw]
                            side=1
                        [/redraw]
                        [message]
                            description=Possessed Garak
                            message= _ "I live again! I can feel!"
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "Garak?"
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "Hahahaha! Your puny friend is no more. With his body I shall crush you all. Arise again my minions and feast in the slaughter!"
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "I told you, I will be back you fools! Now I shall have my vengeance upon you all. Darkness shall reign until I have triumphed!"
                        [/message]
                        [message]
                            description=Ystara
                            message= _ "In this I shall support you, the sun shall not rise until one of us is victorious."
                        [/message]
                        [message]
                            description=Nym
                            message= _ "Maybe I spoke too soon. Curse Uria, they have even blotted out the stars, all is darkness. Kaleh, our course is clear, we must destroy one of these abominations. Whether it be the thing that has taken our friend, or the spectral evil that remains, one of them must die for this battle to end. We have no choice."
                        [/message]
                        [message]
                            description=Zhul
                            message= _ "But to kill Garak? How can we?"
                        [/message]
                        [message]
                            description=Kaleh
                            message= _ "That thing is not Garak. This night has lasted long enough, and too many of our people have died. How many more would you sacrifice for Garak's sake? Just protecting our encampments isn't enough, darkness and chaos will overwhelm us if we can't end this battle soon. We must destroy one of those two evils, whatever the cost. I do not intend to let that...thing keep control of the body of our friend."
                        [/message]
                        [message]
                            description=Ystara
                            message= _ "The stench of death is in the air."
                        [/message]
                        [message]
                            description=Possessed Garak
                            message= _ "Yes, let us end this once and for all."
                        [/message]
                        [objectives]
                            summary= _ "New Objectives:"
                            show=yes
                            [objective]
                                description=_"Defeat Possessed Garak (or)"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "Defeat Ystara"
                                condition=win
                            [/objective]
                            [objective]
                                description= _ "You Control Less Than 6 Villages"
                                condition=lose
                            [/objective]
                            [objective]
                                description= _ "Death of Kaleh, Nym or Zhul"
                                condition=lose
                            [/objective]
                        [/objectives]
                    [/then]
                [/if]
            [/then]
        [/if]
        {CLEAR_VARIABLE choice_flag}
        {CLEAR_VARIABLE i}
        {CLEAR_VARIABLE coords}
        {CLEAR_VARIABLE azkotep_casaulties}
        {CLEAR_VARIABLE ystara_casaulties}
        {CLEAR_VARIABLE killed_by_azkotep}
        {CLEAR_VARIABLE killed_by_ystara}
    [/event]
#enddef
