#textdomain wesnoth-trow
[scenario]
    id=Rise_of_Wesnoth
    name= _ "The Rise of Wesnoth"
    next_scenario=Epilogue
    victory_when_enemies_defeated=no
    map_data="{campaigns/The_Rise_Of_Wesnoth/maps/Rise_of_Wesnoth.map}"

    {TURNS 45 42 39}
    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC knalgan_theme.ogg}
    {EXTRA_SCENARIO_MUSIC vengeful.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}
    {EXTRA_SCENARIO_MUSIC the_city_falls.ogg}

    # No story
    {RISE_OF_WESNOTH_BIGMAP}

    {TROW_DEATHS}

    [side]
        id=Prince Haldric
        name= _ "Prince Haldric"
        side=1
        type=Noble Commander
        unrenamable=yes
        canrecruit=yes
        gold=200
        controller=human
        team_name=Haldric
        user_team_name=_"Refugees"
        #shroud=yes
        {FLAG_VARIANT loyalist}
    [/side]

    #2 is Jevyan
    #3 is the Sea Castle
    #4 is the Coast Orc
    #5 is the Island Orc
    #6 is the North Orc

    [side]
        type=Ancient Lich
        id=Lich-Lord Jevyan
        name= _ "Lich-Lord Jevyan"
        profile="portraits/jevyan.png"
        side=2
        canrecruit=yes
        recruit=Revenant,Deathblade,Bone Shooter,Skeleton,Skeleton Archer,Vampire Bat, Walking Corpse,Soulless,Vampire Bat,Ghoul,Necrophage
        {GOLD 160 180 210}
        user_team_name=_"Evil"
        team_name=orcs
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,fighter,archer
            passive_leader=yes
            {ATTACK_DEPTH 5 6 6}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.65
        [/ai]
        [ai]
            [protect_location]
                x=42
                y=40
                radius=8
                value=10
            [/protect_location]
        [/ai]
        {INCOME 4 6 8}
        {FLAG_VARIANT undead}
    [/side]

    {STARTING_VILLAGES 2 10}

    [side]
        type=Orcish Warlord
        id=Tan-Vragish
        name= _ "Tan-Vragish"
        side=3
        canrecruit=yes
        recruit=Naga Fighter,Vampire Bat
        {GOLD 130 150 180}
        team_name=orcs
        user_team_name=_"Evil"
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=fighter,fighter,scout
            {ATTACK_DEPTH 5 5 6}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
        {INCOME 1 2 4}
    [/side]

    {STARTING_VILLAGES 3 10}

    [side]
        type=Orcish Warlord
        id="Ut'Tan-Grorag"
        name= _ "Ut'Tan-Grorag"
        profile=portraits/orcs/transparent/grunt.png
        side=4
        canrecruit=yes
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Troll Whelp, Goblin Spearman
#endif

#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Orcish Warrior, Troll Whelp, Troll, Troll Rocklobber, Goblin Spearman
#endif

#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Troll Whelp, Troll, Troll Warrior, Troll Rocklobber, Goblin Spearman, Goblin Impaler
#endif
        {GOLD 170 190 220}
        team_name=orcs
        user_team_name=_"Evil"
        [ai]
            #{NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,fighter,archer,mixed fighter
            grouping=defensive
            {ATTACK_DEPTH 5 5 6}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.65
            grouping=offensive
        [/ai]
        {INCOME 2 4 8}
    [/side]

    {STARTING_VILLAGES 4 10}

    [side]
        type=Orcish Warlord
        id=Tan-Erinak
        name= _ "Tan-Erinak"
        profile=portraits/orcs/transparent/grunt-2.png
        side=5
        canrecruit=yes
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Troll Whelp, Goblin Spearman
#endif

#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Orcish Warrior, Troll Whelp, Troll, Troll Rocklobber, Goblin Spearman
#endif

#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Troll Whelp, Troll, Troll Warrior, Troll Rocklobber, Goblin Spearman, Goblin Impaler
#endif
        {GOLD 150 170 200}
        team_name=orcs
        user_team_name=_"Evil"
        [ai]
            #{NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,fighter,archer,mixed fighter
            grouping=defensive
            {ATTACK_DEPTH 5 5 6}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.65
            grouping=offensive
        [/ai]

        {INCOME 1 2 4}
    [/side]

    {STARTING_VILLAGES 5 10}

    [side]
        type=Orcish Warlord
        id=Tan-Prodash
        name= _ "Tan-Prodash"
        profile=portraits/orcs/transparent/grunt-3.png
        side=6
        canrecruit=yes
#ifdef EASY
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Troll Whelp, Goblin Spearman
#endif

#ifdef NORMAL
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Goblin Pillager, Goblin Knight, Orcish Slayer, Orcish Warrior, Troll Whelp, Troll, Troll Rocklobber, Goblin Spearman
#endif

#ifdef HARD
        recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Orcish Crossbowman, Orcish Warrior, Goblin Knight, Goblin Pillager, Orcish Slayer, Troll Whelp, Troll, Troll Warrior, Troll Rocklobber, Goblin Spearman, Goblin Impaler
#endif
        {GOLD 150 170 200}
        team_name=orcs
        user_team_name=_"Evil"
        [ai]
            {NO_SCOUTS}
            recruitment_ignore_bad_movement=yes
            recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,fighter,archer,mixed fighter
            {ATTACK_DEPTH 5 5 6}
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.75
            caution=0.0
            grouping=no
        [/ai]
        {INCOME 1 2 4}
    [/side]

    {STARTING_VILLAGES 6 10}

    {ANIMATED_CAMPFIRE 7 5}
    {ANIMATED_CAMPFIRE 15 21}
    {ANIMATED_CAMPFIRE 21 17}
    {ANIMATED_CAMPFIRE 24 29}
    {ANIMATED_CAMPFIRE 32 34}
    {ANIMATED_CAMPFIRE 41 24}
    {ANIMATED_CAMPFIRE 46 23}
    {ANIMATED_CAMPFIRE 45 29}

    [event]
        name=prestart

        {PLACE_IMAGE ("units/transport/transport-galleon.png~RC(magenta>blue)") 21 35}
        {PLACE_IMAGE ("units/transport/transport-galleon.png~RC(magenta>blue)") 21 37}
        {PLACE_IMAGE ("units/transport/transport-galleon.png~RC(magenta>blue)") 22 39}
        {PLACE_IMAGE ("units/transport/transport-galleon.png~RC(magenta>blue)") 23 44}

        [recall]
            id=Lady Jessene
        [/recall]
        [recall]
            id=Burin the Lost
        [/recall]
        [recall]
            id=Sir Ruddry
        [/recall]
        [recall]
            id=Sir Ladoc
        [/recall]
        [recall]
            id=Minister Edren
        [/recall]
        [recall]
            id=Commander Aethyr
        [/recall]

        #If I can scrounge up a decent scroll \/
        #[unit_overlay]
        #       id=Commander Aethyr
        #       image=items/book3.png
        #[/unit_overlay]

        #[remove_shroud]
        #   side=1
        #   x=1-50
        #   y=1-45
        #[/remove_shroud]

        {LIVING_INTEL (Dread Bat) (Familiar) ( _ "Familiar") "portraits/familiar.png" 2 40 39}
        # wmllint: recognize Familiar

        [set_variable]
            name=num_orcs_alive
            value=4
        [/set_variable]

        [objectives]
            side=1
            [objective]
                description= _ "Commander Aethyr sacrifices himself to Lich-Lord Jevyan and"
                condition=win
            [/objective]
            [objective]
                description= _ "Destroy Lich-Lord Jevyan and"
                condition=win
            [/objective]
            [objective]
                description= _ "Defeat all enemy leaders except for one"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Prince Haldric"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Lady Jessene"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Commander Aethyr by somebody other than Jevyan"
                condition=lose
            [/objective]
            [objective]
                description= _ "Fail to leave one enemy leader behind"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=start
        [message]
            speaker=narrator
            message= _ "Haldric approaches the place where Lich-Lord Jevyan has made landfall. The final confrontation looms before him."
            image=wesnoth-icon.png
        [/message]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "You cannot win. Give me the Ruby of Fire and I will go in peace."
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "This ends here, Jevyan. Even if I believed your words I couldn't give you the Ruby of Fire."
            image=portraits/haldric-mad.png
        [/message]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "Bah! Even if you have learned to conceal the power of the Ruby of Fire you will deliver it unto me in death!"
        [/message]
        [message]
            speaker=Lady Jessene
            message= _ "You're a fool, Jevyan. How do you think we secured our place here? We had to give the elves the Ruby of Fire. We just signed a treaty with the elves ensuring our place here."
        [/message]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "No! I don't believe it. Only a fool would give away an artifact of such power."
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "A fool, or a desperate band of refugees!"
            image=portraits/haldric-mad.png
        [/message]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "No. It can't be!"
        [/message]
        [message]
            speaker=Burin the Lost
            message= _ "Fool human, you shouldn't give such toys to elves! Bah! It matters little to me. I'm no wizard. All I got is my axe. Heh, heh. It's all I need - prepare to die, orcish scum!"
        [/message]
        [message]
            speaker=Minister Edren
            message= _ "Ha. Let all of the minions of Darkness be cast down!"
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "It matters little, because here you fall!"
            image=portraits/haldric-mad.png
        [/message]
        [message]
            speaker=Sir Ruddry
            message= _ "For all of the good people of Clearwater Port!"
        [/message]
        [message]
            speaker=Sir Ladoc
            message= _ "For the honor of Southbay!"
        [/message]
        [message]
            speaker=Commander Aethyr
            message= _ "We don't need some magic trinket to beat you! Prepare to meet your fate, you decrepit sack of bones! For the honor of all of the people of the west-north!"
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "Charge!"
            image=portraits/haldric-mad.png
        [/message]
        [message]
            speaker="Ut'Tan-Grorag"
            message= _ "I hate it when my prey gets chatty! Get them, it's a long boat ride back home!"
        [/message]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "We shall soon see if you have the Ruby of Fire!"
        [/message]
        [message]
            speaker=Familiar
            image="portraits/familiar.png"
            message= _ "Neep! Neep!"
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "(whispered) Commander, you remember the plan right?"
        [/message]
        [message]
            speaker=Commander Aethyr
            message= _ "(whispered) Yes, sir. I am ready."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            side=1
        [/filter]
        [message]
            speaker=Lady Jessene
            message= _ "He's raising our dead! Be careful!"
        [/message]
    [/event]

    [event]
        name=die
        first_time_only=no
        [filter]
            [not]
                id=Commander Aethyr
            [/not]
        [/filter]

        {RISE_UP_RISE_UP $x1 $y1}
    [/event]

    [event]
        name=attack
        [filter]
            id=Commander Aethyr
        [/filter]
        [message]
            speaker=Commander Aethyr
            message= _ "Feel my wrath, Jevyan, I'm coming for you! No piece of paper in my pocket is going to stop me from destroying you. For my family! For the people of Clearwater Port!"
        [/message]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "All life is finite; you will be made to serve along with the rest."
        [/message]
    [/event]

    [event]
        name=attack
        [filter]
            id=Burin the Lost
        [/filter]
        [message]
            speaker=Burin the Lost
            message= _ "Come on, stay still, just for a second..."
        [/message]
    [/event]

    [event]
        name=attack
        [filter]
            id=Lady Jessene
        [/filter]
        [message]
            speaker=Lady Jessene
            message= _ "For the Wesfolk!"
        [/message]
    [/event]

    [event]
        name=attack
        [filter]
            side=2,3,4,5,6
        [/filter]
        [filter_second]
            id=Commander Aethyr
        [/filter_second]
        [message]
            speaker=Lady Jessene
            message= _ "Be careful, Commander!"
        [/message]
    [/event]

    [event]
        name=attack
        [filter]
            id=Familiar
        [/filter]
        [message]
            speaker=Familiar
            image="portraits/familiar.png"
            message= _ "Neep! Neep!"
        [/message]
    [/event]

#define JEVGOLD
#ifdef EASY
    [gold]
        side=2
        amount=40
    [/gold]
#endif

#ifdef NORMAL
    [gold]
        side=2
        amount=80
    [/gold]
#endif

#ifdef HARD
    [gold]
        side=2
        amount=120
    [/gold]
#endif
#enddef

#define ORC_SURVIVORS
    [if]
        [variable]
            name=num_orcs_alive
            numerical_equals=1
        [/variable]

        [then]
            [if]
                [have_unit]
                    id=Lich-Lord Jevyan
                    side=2
                [/have_unit]

                [then]
                    [message]
                        speaker=Tan-Vragish
                        message= _ "The battle is going against us!"
                    [/message]
                    [message]
                        speaker="Ut'Tan-Grorag"
                        message= _ "Our forces are being routed! We should flee back to the Green Isle!"
                    [/message]
                    [message]
                        speaker=Tan-Erinak
                        message= _ "It goes poorly for us!"
                    [/message]
                    [message]
                        speaker=Tan-Prodash
                        message= _ "Defeated, by humans?"
                    [/message]
                    [message]
                        speaker=Lich-Lord Jevyan
                        message= _ "Fight on, you cowardly orcish worms!"
                    [/message]
                [/then]

                [else]
                    [message]
                        speaker=Tan-Vragish
                        message= _ "Da old bag of bones has been crushed, and our cause is lost. We know da elfses have da fire ruby. Retreat!"	# wmllint: no spellcheck
                    [/message]
                    [kill]
                        id=Tan-Vragish
                    [/kill]
                    [message]
                        speaker="Ut'Tan-Grorag"
                        message= _ "Da elfses have the fire ruby, we must flee. To da ships!"	# wmllint: no spellcheck
                    [/message]
                    [kill]
                        id="Ut'Tan-Grorag"
                    [/kill]
                    [message]
                        speaker=Tan-Erinak
                        message= _ "We have many kinsmen on the Green Isle- we will return for the Ruby of Fire!"
                    [/message]
                    [kill]
                        id=Tan-Erinak
                    [/kill]
                    [message]
                        speaker=Tan-Prodash
                        message= _ "We must get back to the Green Isle. The elfses have the Ruby of Fire and our assault has been stopped."	# wmllint: no spellcheck
                    [/message]
                    [kill]
                        id=Tan-Prodash
                    [/kill]
                    [endlevel]
                        result=victory
                        carryover_report=no
                        linger_mode=no
                        save=no
                    [/endlevel]
                [/else]
            [/if]
        [/then]
    [/if]

    [if]
        [variable]
            name=num_orcs_alive
            numerical_equals=0
        [/variable]
        [then]
            [message]
                speaker=Prince Haldric
                message= _ "The plan revolved around some orcs making it back to the Green Isle to tell their kin that the elves have the Ruby of Fire so we wouldn't have to bear the brunt of the next invasion."
            [/message]
            [message]
                speaker=Prince Haldric
                message= _ "What have we done?"
            [/message]
            [endlevel]
                result=defeat
            [/endlevel]
        [/then]
    [/if]
#enddef

    [event]
        name=die
        [filter]
            id=Tan-Vragish
        [/filter]

        {VARIABLE_OP num_orcs_alive add -1}

        {ORC_SURVIVORS}

        {JEVGOLD}
    [/event]

    [event]
        name=die
        [filter]
            id="Ut'Tan-Grorag"
        [/filter]

        {VARIABLE_OP num_orcs_alive add -1}

        {ORC_SURVIVORS}

        {JEVGOLD}
    [/event]

    [event]
        name=die
        [filter]
            id=Tan-Erinak
        [/filter]

        {VARIABLE_OP num_orcs_alive add -1}

        {ORC_SURVIVORS}

        {JEVGOLD}
    [/event]

    [event]
        name=die
        [filter]
            id=Tan-Prodash
        [/filter]

        {VARIABLE_OP num_orcs_alive add -1}

        {ORC_SURVIVORS}

        {JEVGOLD}
    [/event]

    [event]
        name=last breath
        [filter]
            id=Commander Aethyr
        [/filter]

        # wmllint: local spelling soo
        # The idea is that he's dying and cannot finish the word
        [filter_second]
            [not]
                id=Lich-Lord Jevyan
            [/not]
        [/filter_second]

        [message]
            speaker=Commander Aethyr
            message= _ "My love, my family, I'll be there soo-"
        [/message]

        [message]
            speaker=Prince Haldric
            message= _ "Aethyr! No! He was critical for convincing Jevyan that the elves have the Ruby of Fire."
            image=portraits/haldric-mad.png
        [/message]

        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Commander Aethyr
        [/filter]

        [filter_second]
            id=Lich-Lord Jevyan
        [/filter_second]

        [message]
            speaker=Commander Aethyr
            message= _ "Jevyan- I spit upon thee. Your end awaits. My love, my family, I'll be there soo-"
        [/message]

        [message]
            speaker=Lich-Lord Jevyan
            message= _ "Fool. You are no match for my power. What! What's this? A treaty. That's elf script."
        [/message]

        [message]
            speaker=Lich-Lord Jevyan
            message= _ "No. Why? You fools, you gave the Ruby of Fire to the elves. But that won't save you from me. I will destroy you, then I will deal with the elves."
        [/message]

        [message]
            speaker=Prince Haldric
            message= _ "We'll see about that. For the honor of Commander Aethyr, forward!"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Lich-Lord Jevyan
        [/filter]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "I am fallen before my plans have reached fruition. A curse upon you Haldric, may you and your descendants know nothing but strife!"
        [/message]

        [if]
            [have_unit]
                id=Commander Aethyr
                side=1
            [/have_unit]
            [then]
                [message]
                    speaker=Commander Aethyr
                    message= _ "You deny me my honorable death? Our foes are not yet convinced that the elves have the ruby."
                [/message]

                [endlevel]
                    result=defeat
                [/endlevel]
            [/then]
            [else]
                [if]
                    [variable]
                        name=num_orcs_alive
                        numerical_equals=1
                    [/variable]
                    [then]
                        [message]
                            speaker=Tan-Vragish
                            message= _ "Da old bag of bones has been crushed, and our cause is lost. We know da elfses have da fire ruby. Retreat!"	# wmllint: no spellcheck
                        [/message]
                        [kill]
                            id=Tan-Vragish
                        [/kill]
                        [message]
                            speaker="Ut'Tan-Grorag"
                            message= _ "Da old bag of bones has been crushed, and our cause is lost. We know da elfses have da fire ruby. Retreat!"	# wmllint: no spellcheck
                        [/message]
                        [kill]
                            id="Ut'Tan-Grorag"
                        [/kill]
                        [message]
                            speaker=Tan-Erinak
                            message= _ "Da old bag of bones has been crushed, and our cause is lost. We know da elfses have da fire ruby. Retreat!"	# wmllint: no spellcheck
                        [/message]
                        [kill]
                            id=Tan-Erinak
                        [/kill]
                        [message]
                            speaker=Tan-Prodash
                            message= _ "Da old bag of bones has been crushed, and our cause is lost. We know da elfses have da fire ruby. Retreat!"	# wmllint: no spellcheck
                        [/message]
                        [kill]
                            id=Tan-Prodash
                        [/kill]
                        [endlevel]
                            result=victory
                            carryover_report=no
                            linger_mode=no
                            save=no
                        [/endlevel]
                    [/then]
                    [else]
                        [message]
                            speaker=Tan-Vragish
                            message= _ "Da old bag 'o bones is gone, but you haven't beat us yet!"  # wmllint: no spellcheck
                        [/message]
                        [message]
                            speaker="Ut'Tan-Grorag"
                            message= _ "We took yer home, now we'll take yer lives!"
                        [/message]
                        [message]
                            speaker=Tan-Erinak
                            message= _ "The elfses have da fire ruby, and you have nothing!"    # wmllint: no spellcheck
                        [/message]
                        [message]
                            speaker=Tan-Prodash
                            message= _ "We will suck the marrow from your bones human!"
                        [/message]
                    [/else]
                [/if]
            [/else]
        [/if]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=20-26
            y=22-28
        [/filter]

        [move_unit_fake]
            type=Cuttle Fish
            side=2
            x=20,21,22
            y=23,23,23
        [/move_unit_fake]

        [unit]
            id=Squiddy
            name= _ "Squiddy"
            type=Cuttle Fish
            side=2
            x=22
            y=23
            moves=0
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            # Omitting {IS_LOYAL} deliberately
        [/unit]

        [message]
            speaker=unit
            message= _ "Ack. One of those monsters is destroying the bridge."
        [/message]

        [scroll_to_unit]
            id=Squiddy
            x=22
            y=23
        [/scroll_to_unit]

        [sound]
            name=explosion.ogg
        [/sound]
        [delay]
            time=200
        [/delay]
        [sound]
            name=explosion.ogg
        [/sound]
        [delay]
            time=500
        [/delay]
        [sound]
            name=fire.wav
        [/sound]

        [terrain]
            x=23
            y=22
            terrain=Ww
        [/terrain]
        [terrain]
            x=23
            y=23
            terrain=Ww
        [/terrain]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=40-46
            y=17-23
        [/filter]

        [move_unit_fake]
            type=Cuttle Fish
            side=2
            x=41,42,43
            y=17,17,17
        [/move_unit_fake]

        [unit]
            id=Inky
            name= _ "Inky"
            type=Cuttle Fish
            side=2
            x=43
            y=17
            moves=0
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            # Omitting {IS_LOYAL} deliberately
        [/unit]

        [message]
            speaker=unit
            message= _ "The bridge!"
        [/message]

        [scroll_to_unit]
            id=Inky
            x=43
            y=17
        [/scroll_to_unit]

        [sound]
            name=explosion.ogg
        [/sound]
        [delay]
            time=200
        [/delay]
        [sound]
            name=explosion.ogg
        [/sound]
        [delay]
            time=500
        [/delay]
        [sound]
            name=fire.wav
        [/sound]

        [terrain]
            x=43
            y=17
            terrain=Ww
        [/terrain]
        [terrain]
            x=43
            y=18
            terrain=Ww
        [/terrain]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=37-43
            y=29-35
        [/filter]

        [move_unit_fake]
            type=Cuttle Fish
            side=2
            x=39,40,41,42
            y=30,29,30,30
        [/move_unit_fake]

        [unit]
            id=Beaky
            name= _ "Beaky"
            type=Cuttle Fish
            side=2
            x=42
            y=30
            moves=0
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            # Omitting {IS_LOYAL} deliberately
        [/unit]

        [message]
            speaker=unit
            message= _ "Our advance is thwarted, that monster has destroyed the bridge!"
        [/message]

        [scroll_to_unit]
            id=Beaky
            x=41
            y=31
        [/scroll_to_unit]

        [sound]
            name=explosion.ogg
        [/sound]
        [delay]
            time=200
        [/delay]
        [sound]
            name=explosion.ogg
        [/sound]
        [delay]
            time=500
        [/delay]
        [sound]
            name=fire.wav
        [/sound]

        [terrain]
            x=42
            y=30
            terrain=Ww
        [/terrain]
        [terrain]
            x=41
            y=31
            terrain=Ww
        [/terrain]
    [/event]

    [event]
        name=turn 10
        [move_unit_fake]
            type=Naga Warrior
            side=2
            x=1,2,3,4,5,6
            y=32,31,32,32,33,32
        [/move_unit_fake]

        {NAMED_LOYAL_UNIT 2 (Naga Warrior) 6 32 (Abraxas) ( _ "Abraxas")}
        # wmllint: recognize Abraxas

        [scroll_to_unit]
            id=Abraxas
        [/scroll_to_unit]

        [message]
            speaker=Abraxas
            message= _ "It's the Haldric! Jevyan, you never said you came to destroy this monster. We will help you."
        [/message]

        {LOYAL_UNIT 3 (Naga Fighter) 5 32}
        {LOYAL_UNIT 2 (Naga Fighter) 5 33}

#ifdef NORMAL
        {LOYAL_UNIT 3 (Naga Fighter) 4 31}
        {LOYAL_UNIT 2 (Naga Fighter) 4 34}
#endif
#ifdef HARD

        {LOYAL_UNIT 3 (Naga Fighter) 4 31}
        {LOYAL_UNIT 2 (Naga Fighter) 4 34}
        {LOYAL_UNIT 3 (Naga Fighter) 3 31}
        {LOYAL_UNIT 2 (Naga Fighter) 3 35}
#endif

        [allow_recruit]
            type=Naga Fighter
            side=3
        [/allow_recruit]
    [/event]

#define DEEP_WALKERS
    {VARIABLE_OP yy1 random 25..40}
    [message]
        speaker=Lich-Lord Jevyan
        message= _ "Come in from the deep my loyal soldiers!"
    [/message]

    [scroll_to]
        x=1
        y=$yy1
    [/scroll_to]

    [delay]
        time=500
    [/delay]

#ifdef EASY
    {LOYAL_UNDEAD_UNIT 2 (Skeleton) 1 $yy1}
#endif
#ifdef NORMAL
    {LOYAL_UNDEAD_UNIT 2 (Skeleton Archer) 1 $yy1}
    {LOYAL_UNDEAD_UNIT 2 (Skeleton) 1 $yy1}
#endif
#ifdef HARD
    {LOYAL_UNDEAD_UNIT 2 (Revenant) 1 $yy1}
    {LOYAL_UNDEAD_UNIT 2 (Skeleton Archer) 1 $yy1}
#endif

    {CLEAR_VARIABLE yy1}
#enddef

#define FROM_THE_EARTH
    {VARIABLE_OP xx1 random 23..50}
    {VARIABLE_OP yy1 random 24..45}

    [message]
        speaker=Lich-Lord Jevyan
        message= _ "Rise, rise from the ground!"
    [/message]

    [scroll_to]
        x=$xx1
        y=$yy1
    [/scroll_to]

    [delay]
        time=500
    [/delay]

#ifdef EASY
    {LOYAL_UNDEAD_UNIT 2 (Walking Corpse) $xx1 $yy1}
#endif
#ifdef NORMAL
    {LOYAL_UNDEAD_UNIT 2 (Walking Corpse) $xx1 $yy1}
    {LOYAL_UNDEAD_UNIT 2 (Walking Corpse) $xx1 $yy1}
#endif
#ifdef HARD
    {LOYAL_UNDEAD_UNIT 2 (Walking Corpse) $xx1 $yy1}
    {LOYAL_UNDEAD_UNIT 2 (Walking Corpse) $xx1 $yy1}
    {LOYAL_UNDEAD_UNIT 2 (Walking Corpse) $xx1 $yy1}
#endif

    {CLEAR_VARIABLE xx1}
    {CLEAR_VARIABLE yy1}

#enddef

    [event]
        name=last breath
        [filter]
            id=Familiar
        [/filter]
        [message]
            speaker=Familiar
            image="portraits/familiar.png"
            message= _ "Neep! SPLAT!"	# wmllint: no spellcheck
        [/message]
        [message]
            speaker=second_unit
            message= _ "Ahh... That almost makes it all worth while!"
        [/message]
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "You'll pay for that!"
        [/message]
        {JEVGOLD}
        {DEEP_WALKERS}
        {FROM_THE_EARTH}
        [message]
            speaker=Lich-Lord Jevyan
            message= _ "Strike down these fools."
        [/message]
    [/event]

    [event]
        name=new turn
        first_time_only=no

        [if]
            [have_unit]
                id=Lich-Lord Jevyan
                side=2
            [/have_unit]

            [then]
#ifdef EASY
                {VARIABLE_OP opt random 1..24}
#endif
#ifdef NORMAL
                {VARIABLE_OP opt random 1..18}
#endif
#ifdef HARD
                {VARIABLE_OP opt random 1..12}
#endif

                [if]
                    [variable]
                        name=opt
                        numerical_equals=1
                    [/variable]

                    [then]
                        {DEEP_WALKERS}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=opt
                        numerical_equals=2
                    [/variable]
                    [then]
                        {FROM_THE_EARTH}
                    [/then]
                [/if]
                [if]
                    [variable]
                        name=opt
                        numerical_equals=3
                    [/variable]
                    [then]
                        {FROM_THE_EARTH}
                    [/then]
                [/if]

                {CLEAR_VARIABLE opt}
            [/then]
        [/if]
    [/event]

    [event]
        name=victory

        {PLACE_IMAGE (terrain/water/coast.png) 22 39}

        [move_unit_fake]
            type=Transport Galleon
            side=1
            x=22,21,20,19,18,18,18,18,18,17,16,15,14
            y=39,39,38,39,39,40,41,42,43,44,44,45,45
        [/move_unit_fake]
        [message]
            speaker=Lady Jessene
            message= _ "We did it! We won!"
        [/message]
        [message]
            speaker=Prince Haldric
            message= _ "Jevyan is destroyed, but at a terrible price. Let's put Commander Aethyr to rest and discuss what is to come in the following days."
        [/message]
    [/event]

    [event]
        name=time over
        [message]
            speaker=Prince Haldric
            message= _ "Our strength is waning, and our foes grow stronger by the hour. The battle is lost!"
        [/message]
    [/event]
[/scenario]
