#textdomain wesnoth-utbs

#define STORY_THE_MORNING_AFTER
    [story]
        [part]
            story= _ "Note: This campaign is probably not appropriate for beginners. It changes certain Wesnoth standards, such as the elves’ stats and the day/night cycle. This campaign emphasizes role-playing elements and tends to have longer scenarios with objectives that change in the middle. For these reasons, we strongly suggest that you occasionally save your game mid-scenario, so you won’t lose all your progress if you get stuck and have to start over."
        [/part]
        [part]
            story= _ "This is the chronicle of the journey of the Quenoth Elves from their homeland in the Great Southern Desert. I write this story so that our descendants may know of our travels, remember the sacrifices we made, and profit from the hard lessons we learned."
        [/part]
        [part]
            story= _ "Chapter 1: I, Kaleh, grew up amid the shifting sands, under our two suns Sela and Naia. It was a land of hot dry days and cold nights, of roaming horrors, where water was more valuable than gold. We had lived among the sands ever since the forests fell uncounted years ago. It was a hard and savage land, but we were tougher still, and we managed to survive settled around one of the rare oases. We had heavily fortified our village against marauders and were the largest encampment we knew of. My uncle, Tanuil, led us for many years, and trained us to be self-sufficient and strong against all enemies. A people struggling in an ocean of sand, we thought we were ready for anything. All that changed one fateful night, when the sky rained fire..."
        [/part]
        [part]
            story= _ "I remember that night as if it were yesterday. I was not prone to dreaming, but as I slept I had a strange vision. I didn’t have long to ponder it though, because I was woken in the dark by the sound of deafening crashes, splintering wood and shouting elves. That night the sky rained flaming rocks, boulders bigger than you could imagine. They smote the landscape like lightning bolts, setting fire to whatever could burn and crushing houses, walls, and elves. There was nowhere to hide, nowhere to go for protection. I was terribly afraid, and I thought that if I tried to flee I would be smashed, so I hid and prayed to Eloh. I had never prayed before as fervently as I did that night. I heard cries and screams outside, but I could not force myself to move. Eventually the thin yellow tendrils of a sickly dawn stole over the horizon, as if Naia herself were shocked by the devastation she saw."
        [/part]
    [/story]
#enddef

#define STORY_ACROSS_THE_HARSH_SANDS
    [story]
        [part]
            story= _ "Chapter 2: When I was fifteen I went on my first raid, against an orcish incursion to the west. A large band of orcs under some new banner had come out of the northern foothills and were rampaging across the sands, killing anything they could get their filthy hands on."
        [/part]
        [part]
            story= _ "Sneaking amongst the dunes we crept up to their camp and ambushed them at dawn. To a young boy the fighting was overwhelming: crashing blades, blood, battle cries, friend and foe struggling back and forth. The orcs rallied around their leader, their greater numbers countering our superior skill at combat. It was my father who finally fought his way to the foul orc leader and slew him on the bloodstained sand. The surviving orcs broke and fled from the battlefield, to be hunted down and slain as individuals and small groups by our trackers. It seemed a glorious victory, and I hardly noticed our elven brethren lying dead in the sand."
        [/part]
        [part]
            story= _ "I was giddy on the journey back home, my heart pumping with elation and pride. I had fought my first battle; now I was a man like my father. Then one night during the long dark a harsh wind came up, moaning and howling around our tents. By dawn it had only gotten worse; I wondered if some dark god was trying to avenge the massacre of the orcs. I’d seen sandstorms before, but I had never experienced one like this. I hid in my tent praying to Eloh as if my life depended on it. The air grew thick with sand, and everything grew dark and hazy..."
        [/part]
        [part]
            story= _ "The next thing I remember, someone was bending over me shaking me awake. I was half buried in sand, and I felt weak but alive. Our equipment was scattered across the dunes or buried in the sand. Looking around I only saw a few of my companions, who were digging in the sand, fervently hoping to find other survivors. I dug furiously at the sand with my bare hands and yelled until I was hoarse, but try as I might, I could not find my father. They told me he had been swallowed by the sand, but I would not be consoled. In one instant my world crumbled; I never looked at the sands quite the same way again. I learned that day that the desert can be fickle and fierce, and death is always lurking just over the horizon."
        [/part]
        [part]
            story= _ "Now I journeyed out again across the sands, but this time it was not just myself, but my entire people that I had to protect. They were depending on my judgment, and I was only too aware of the weight on my narrow shoulders. Thinking of the last time we had gone out in force, I made a silent prayer to my father to watch over us. There was nowhere to go but north."
        [/part]
    [/story]
#enddef

#define STORY_STIRRING_IN_THE_NIGHT
    [story]
        [part]
            story= _ "Chapter 3: As we continued north through the desert, the looming hills and mountains promised blessed relief from the seemingly never-ending sand. Soon we got to the end of the foothills, and we decided to rest there for the night. As tired as I was of marching across the sand, I felt strangely afraid. I had lived my entire life in the sands; they were my home, and the rocky hills and white glistening mountaintops seemed foreign and foreboding."
        [/part]

        [part]
            story= _ "I worried if I was doing the right thing, leading my people to strange lands. Despite Eloh’s promises, I was not as confident as Zhul was that it would all end well. Looking back I thought it strange that I was the one that Eloh showed herself to. I was never particularly devout, always worried more about day to day matters than the other-worldly ones. But who was I to question a god?"
        [/part]

        [part]
            story= _ "That night, as I slept, I dreamt again, for the first time since that first fateful night. Eloh came to me again, and this time she appeared in a vision as a beautiful glowing figure, as bright as the suns. She said <i>“Have courage, for though soon you shall go through a time of darkness, all your trials shall be richly rewarded in the end. You must go under the northern mountains, not over them. You will find the ruins of an ancient watch tower made of black obsidian in the desert by the edge of the hills. By that tower you will find the entrance to the tunnels you seek. Follow the smooth ancient tunnel down under the mountains and when you again see the sky and my suns, I shall contact you. But beware those who lurk in the darkness, they hide from my light, and must not be trusted. I have no power in the dark, so you are my hand of justice. Punish the non-believers. Go now, and fear not the dark.”</i> And again, just like before, I was woken up by a shout in the night."
        [/part]
    [/story]
#enddef

#define STORY_DESCENDING_INTO_DARKNESS
    [story]
        [part]
            story= _ "Chapter 4: We found the crumbling obsidian tower that Eloh had described, and we camped at the edge of the foothills before the mountains. I was still shocked by the loss of Garak and all the other elves who fell in the battle last night. There was so much death in this land, had it always been this way? As we traveled I pondered what this world might have been like back before the Great Fall and I remembered the tale that had been told to me many times since I was a child:"
        [/part]

        [part]
            story= _ "A long, long time ago was the golden age among elves. Our people lived in harmony with nature in lands filled with trees, trees as far as the eye could see. There was peace among elves and the other races such as humans and dwarves, and evil creatures were driven deep within the earth. The foul name of Uria was not yet known among our people, and our powers were so great that we raised another sun into the sky, so that the days were lengthened and dark hours were few. Happy indeed were our people during these long years, but it was not to last forever."
        [/part]

        [part]
            story= _ "Eventually peace and prosperity fostered corruption and decadence. Through her powers of deception and guile, Uria cultivated secret groups of followers, promising to fulfill their darkest desires. She bided her time, and slowly stretched her black hands out across the world. At first, petty arguments between humans, elves and dwarves erupted into conflicts, embroiling our people in the first wars they had fought for ages. Then orcs and other foul creatures came back into the world and raided our settlements, razing villages and massacring hundreds. Uria’s followers studied the necromantic arts and raised armies of undead. Our people had grown weak and soft in the time of peace and plenty and were ill-suited to cope with these new trials. Even nature herself seemed to quail under the onslaught: crops failed, the trees sickened and our forests began to die. Most disturbing was the way the nights lengthened, creating the long dark we suffer today. Many of our people despaired, and many embraced the oncoming darkness, worshiping Uria in hopes of saving themselves. Former friends fought over what few resources remained, and chaos threatened to overwhelm us all."
        [/part]

        [part]
            story= _ "In this time of troubles Eloh first appeared to a select number of us, those few that still doggedly fought to preserve our homeland and our heritage. She told us that the old days had ended, and only through strict discipline and strength could we survive in the new world. She led us out of the few remaining forests, which were being logged and burned by the orcs, into the open plains where we could roam freely. She taught us that alone we are weak, but together we could still strike fear into the hearts of our enemies. We learned that the only way to survive in this new harsh world was to always value the needs of the many over the wants of the individual. We must all work together, for without each other we are nothing. Even as the plains dried up into deserts we follow her will and walk in her path, remembering our ancestors and the sacrifices they made that we might live, and always striving to create a better world for our children."
        [/part]

        [part]
            story= _ "Had the golden age been just a story? What kind of world could I be able to create for future generations of our people? All I knew of the past were the ruins of great castles and tales of a time when life was more than just a struggle to survive. Life did not seem to have grown easier for my people in the last few generations—if anything the land had grown even more unforgiving. Was there anywhere left in this world that I could take my people which would be better than the land we were born into?"
        [/part]
    [/story]
#enddef

#define STORY_A_SUBTERRANEAN_STRUGGLE
    [story]
        [part]
            story= _ "Chapter 5: We plunged into the darkness, shepherding long lines of our people along the cramped passageway deeper and deeper beneath the roots of the mountains. We had brought along palm torches, and we had scavenged other torches from the orcs, so we had enough light sources, at least for the moment. Even so, the guttering torches shed little light, and shadows flickered everywhere. The walls were damp and clammy, the air seemed stale and the sound of our footsteps echoed up and down the passageway."
        [/part]

        [part]
            story= _ "This seemed as alien an environment as we could ever imagine. We were a people of the open sands, and even during the long dark we could look up and orient ourselves by the stars glittering brightly in the deep sky. I knew logically that we could not go over those frozen mountains, and we could not go back, but I shivered at the thought of miles and miles of rock above me, and felt the weight of the mountain pressing down on me. The passage twisted and turned, and soon I lost all sense of direction, but since there were no side-passages, we had little choice but to keep going forward."
        [/part]

        [part]
            story= _ "Looking back, I think the bravest thing that my people ever did was to follow me into the darkness solely on the promises of Eloh and their faith in my leadership. I had no idea how long we would be trapped underground, or even which way we should go. I but hoped Eloh would guide us somehow. Nym said that people whispered that I could lead them through anything, and it was true that when we left I had hardly imagined that we would fight outlaws, undead, orcs and goblins. My previous life seemed as a dream of years past, even though it had only been ten days since our village was demolished."
        [/part]

        [part]
            story= _ "What lurked in the darkness? Who were the unbelievers that Eloh had so cryptically referred to? My heart beat loudly in my chest, everything seemed amplified down here. I felt a strong suspicion that this was not a place that my people were meant to be. I strode onwards grimly; considering everything we had gone through so far, Uria be damned if I was going to be frightened now."
        [/part]
    [/story]
#enddef

#define STORY_IN_THE_TUNNELS_OF_THE_TROLLS
    [story]
        [part]
            story= _ "Chapter 6: The dwarf Grimnir led us through a maze of twisting passages speaking scarcely a word. Finally, after what seemed like hours of marching, he stopped. He motioned us to be very quiet and we crept forward; all I could hear was the soft patter of feet and my heavy breathing. Even that little noise seemed to echo off the cramped walls of our rough-hewn passage. I was suddenly aware of the sheer mass of rock and earth above us and for a moment I despaired of ever seeing the sun again. Then I grabbed my sword with fresh determination and vowed to see this mission through."
        [/part]
    [/story]
#enddef

#define STORY_IN_THE_DOMAIN_OF_THE_DWARVES
    [story]
        [part]
            story= _ "Chapter 6: The troll Zurg led us through a maze of twisting passages speaking scarcely a word. Finally after what seemed like hours of marching he stopped. He motioned us to be very quiet and we crept forward; all I could hear was the soft patter of feet and my heavy breathing. Even that little noise seemed to echo off the cramped walls of our rough-hewn passage. I was suddenly aware of the sheer mass of rock and earth above us and for a moment I despaired of ever seeing the sun again. Then I grabbed my sword with fresh determination and vowed to see this mission through."
        [/part]
    [/story]
#enddef

#define STORY_DEALING_WITH_DWARVES
    [story]
        [part]
            story= _ "Chapter 7: We returned quickly and found the rest of our people, safely hidden a few miles back from the fighting. Seeing Grimnir with us, a troop of dwarves silently appeared out of adjoining secret passages. Once we had assured the rest of the elves that they were friends, Grimnir led us silently and quickly through a maze of secret tunnels towards the dwarves’ home."
        [/part]

        [part]
            story= _ "I do not know how long we tramped through those tiny dark passages; time seemed to flow differently down there, deep under the earth. But when we finally got to our destination, what I saw was breathtaking. We entered into a large cavern, where the dwarves had built a huge city out of stone. Protected by stone walls and gates that were bigger than I had ever seen, the place seemed virtually impregnable. As we entered I marveled at their stonework and I saw that the place was crawling with dwarves. It was bigger than any village I had ever seen."
        [/part]

        [part]
            story= _ "The dwarves led us through to the far side of the city, where they let us stay in several auxiliary caverns, which normally served as store rooms. The accommodations were a bit cramped, but for the first time since I had plunged into the earth, I felt safe."
        [/part]

        [part]
            story= _ "The dwarf king was away cleaning up after the recent battle, and would not be back for several days. I happily spent what little time I had learning as much as I could about these strange people. I was very impressed by their craftsmanship; they made weapons and armor of a quality I had never seen before. We were also quite the curiosity to the dwarves; I have no idea when they had last seen an elf. While some seemed suspicious or frightened of us, the dwarves overall were very polite and met our every need. Finally the summons came to meet with the dwarven king..."
        [/part]
    [/story]
#enddef

#define STORY_TALKING_WITH_TROLLS
    [story]
        [part]
            story= _ "Chapter 7: We returned quickly and found the rest of our people, safely hidden a few miles back from the fighting. Once we had assured the rest of the elves that the trolls were our allies, Zurg led us silently and quickly away from the front lines through a maze of secret tunnels."
        [/part]

        [part]
            story= _ "I do not know how long we tramped through those tiny dark passages; time seemed to flow differently down there, deep under the earth. But finally we stepped out into a large cavern. Dominating the cavern were the remains of what must have originally been a dwarf city. The large stone walls were riddled with giant holes and the iron gates had been blasted asunder. As we entered through the gates, we saw dead dwarves and other more grisly signs of recent battle. All around us were many trolls, working hard to repair the walls and other defenses. Zurg led us through the chaos to several side caverns which had until recently been used as storerooms. There was sufficient space for us to bed down and stay out of the way, and the dwarves had left behind plenty of provisions."
        [/part]

        [part]
            story= _ "Zurg told us that they had just captured this city from the dwarves, and that the Great Leader had moved here to set up his base of operations. They were clearly worried about a dwarf counterattack. Luckily the trolls were quite skilled at stonework and the walls were quickly repaired. The trolls didn’t talk much, but seemed very intelligent and not the mere bloodthirsty savages they had been purported to be. Overall they actually seemed quite peaceful, except when provoked. I learned that the leadership was balanced between the warriors and the shamans. The troll’s military leader was chosen and advised by a council of their shamans."
        [/part]

        [part]
            story= _ "I wish I could have spent more time learning about these misunderstood creatures, but we could not tarry long. Even protected by the trolls, caught in the middle of this great war, I feared for the safety of my people. And so after waiting a few days, I was able to get an audience with the Great Leader."
        [/part]
    [/story]
#enddef

#define STORY_BLOOD_IS_THICKER_THAN_WATER
    [story]
        [part]
            story= _ "Chapter 9: Nym and Esanoo led us north, across the sands and through the dunes, towards the human encampment where the merfolk were being held. I asked Nym where Esanoo had come from, but she wouldn’t answer, she just said that I had to see for myself."
        [/part]
        [part]
            story= _ "Just then we crested over the last dune and I indeed saw what she meant. Sparkling blue covered the entire horizon. I fell to my knees in awe, I had never seen so much water in one place. I cannot write down in words the shock and amazement I felt. To have grown up in a land where water was as precious as gold, and then see miles and miles of it. It was only then that I understood where the merfolk truly came from. I’d been to some strange places, high up in the mountains, deep down under thousands of tons of rock, but this world of water was the most alien of them all."
        [/part]
        [part]
            story= _ "Which brings me to the other alien concept I was trying to comprehend: our goddess Eloh. What was her plan? Why did she want me to surrender to the humans? Do the humans worship her as well? The humans seem so brutish and vile, that I can’t imagine them worshiping the same god as us. I thought Eloh was just our god, I don’t remember Zhul mentioning any other races worshiping her after the Great Fall, though perhaps things had changed in the intervening years. Her commands don’t make any sense; she doesn’t seem at all like the goddess Zhul told me about. And what was Esanoo talking about? How did his master know about ‘Yechnagoth’ and ‘Zhangor’? If Eloh won’t help me, then I desperately need some answers. I pray to whatever gods may be left that I’m not leading my people into a trap..."
        [/part]
    [/story]
#enddef

#define STORY_OUT_OF_THE_FRYING_PAN
    [story]
        [part]
            story= _ "Chapter 8: I set out with a lightened heart and quickened step; we were going back up and I was sure that soon this underground gauntlet would be over. With the help of our new allies, I felt much more confident than I had before. Oh, to feel the wind in my hair and the sun on my face. But for now we had many more miles to travel and in the monotony of the marching I let my mind wander to larger matters."
        [/part]

        [part]
            story= _ "What kind of home had Eloh prepared for us on the other side of the mountains? Was there anywhere in the world that hadn’t been plagued with war and destruction? I grew up in a land of ‘kill or be killed’. Outlaws, ogres and other monsters preyed on the weak and helpless. Orcs and goblins raided any settlements they could find, and my people struggled to protect what little they had. And through it all crazed necromancers and undead spirits haunted the sands, feeding on the few survivors."
        [/part]

        [part]
            story= _ "At first I thought that if we could just leave the desert, we could find a peaceful place away from all the bloodshed and death. But even underground the last remnants of the trolls and dwarves continue to fight a bloody struggle to the death. Is this what our world has become? And why did Eloh tell me to ‘kill the unbelievers’? If we had attacked both the dwarves and the trolls we would not have made it even this far. Everywhere I look I see remains of once great empires. If we destroyed the last of these peoples, what would be left around us but a howling emptiness?"
        [/part]

        [part]
            story= _ "And yet, here in the dark, Eloh says she is powerless. Here she cannot help us, we must fend for ourselves. Though she is our god, I cannot just lie back and depend on her to always save us. These are my people too, and I have a responsibility to them as their leader. I must make my own decisions as I see best. And as Zhul told me when I was but a child, Eloh forgives all our sins. If I err in my judgment she will surely understand. Eloh may be our guide, but I am our leader and I will do what I must to protect my people during our journey."
        [/part]

        [part]
            story= _ "And so, bolstered with a new resolve, I continued the march up out of the darkness and towards a new land."
        [/part]
    [/story]
#enddef

#define STORY_SPEAKING_WITH_THE_FISHES
    [story]
        [part]
            story= _ "Chapter 10: The merfolk helped us pilot our ships far into the ocean. Some of the younger elves were actually quite adept at climbing the rigging and steering the ships. Myself, I mostly stayed in the captain’s quarters and tried to avoid getting seasick. The sea reminded me of being out in the vast desert, with only the stars at night to guide my way. But without the merfolk’s help we would have been hopelessly lost."
        [/part]

        [part]
            story= _ "That afternoon three of the merfolk sat in a circle and performed their ritual to determine the location of their master. Apparently it was a success, for they steered us straight towards the setting sun."
        [/part]

        [part]
            story= _ "The next morning we reached our destination. It wasn’t even an island, just a sandbar sticking out above the water. We lowered down a longboat and the merfolk pulled us to shore, none of us being very skilled with the oars."
        [/part]

        [part]
            story= _ "In the water around the sand bar were a large number of merfolk guards. Standing alone on top of the sand was one of the oldest merfolk I have ever seen. She beckoned to us and we approached..."
        [/part]
    [/story]
#enddef

#define STORY_BATTLE_FOR_ZOCTHANOL_ISLAND
    [story]
        [part]
            # wmllint: local spelling pre-dawn
            story= _ "Chapter 11: Our boats slipped softly through the water, shrouded in the pre-dawn darkness. At this moment the merfolk would be launching their diversionary attack, but the fact that we had not encountered any resistance was still eerily disturbing. Ahead of us, the large island loomed, dark and menacing."
        [/part]

        [part]
            story= _ "In the end, almost all of my people decided to join in this final battle. I was surprised. They had gone through so much, and yet they still had faith in me. Looking around at them, I could not help noticing how many familiar faces were missing. Barely a fourth of those who set out with us on our journey had survived. If I had known it would be this bad would I have ever left in the first place? I thought Eloh was protecting us and guiding our steps, but in truth it was all me. For better or for worse I have no one to blame but myself."
        [/part]

        [part]
            story= _ "But Zhul is right, if we had come all this way just for a chance to help the merfolk defeat Yechnagoth then our journey was not in vain. We were searching for a new home, safe from all the horrors and death of the desert, but now this struggle seems more important. Could these islands possibly become a home for my people? It is a prospect too wonderful to dare to hope for. But in the end that is not what is driving me. All I care about is vengeance upon her that did this to us. Garak, Keratur, Tanstafaal, all those poor souls we left behind in our village and the many who have marked our path with their blood, they all shall be avenged."
        [/part]

        [part]
            story= _ "This conflict is greater than just us. These lands were once places of beauty and hope. The great empires may be gone, but still people struggle to survive. As grim as it all seems, there is still some beauty and light left, hidden away. I will not let it all be swallowed by a second darkness. I do not care what happens to me, but I pray to Eloh (if she is even listening) that if I die, then I die making these lands a better place. Please may this not all be in vain..."
        [/part]
    [/story]
#enddef

#define STORY_THE_FINAL_CONFRONTATION
    [story]
        [part]
            story= _ "Chapter 12: True strength is not measured in might or knowledge, but in what you can do for those you love."
        [/part]
    [/story]
#enddef


#textdomain wesnoth-utbs
# Special terrains I use in the UTBS maps

# custom lava overlay placed on top of normal lava to allow units to walk on it

[terrain_type]
    symbol_image=unwalkable/lava
    id=lava_overlay
    editor_name= _ "Lava"
    string=^Yl
    aliasof=Ut,Qt
    submerge=0.4
    unit_height_adjust=-4
    editor_group=utbs
    hide_help=yes
[/terrain_type]

# custom water for flood terrain-graphics transitions

[terrain_type]
    symbol_image=water/coast-grey-tile
    id=gray_utbs_water
    name= _ "Shallow Water"
    editor_name= _ "Flood Water"
    string=Wwgz
    aliasof=Wst
    submerge=0.4
    editor_group=utbs
    hide_help=yes
[/terrain_type]

# human ship terrain (alias of village so it can be captured); note that the
# ship images are placed as an [item]

[terrain_type]
    symbol_image=water/coast-tile
    id=human_ship
    name= _ "Human Ship"
    string=^Wyc
    aliasof=Vt
    mvt_alias=Mt
    heals=0
    gives_income=yes
    editor_group=utbs
    hide_help=yes
[/terrain_type]

# phantom castle
[terrain_type]
    symbol_image=darkcastle
    id=phantom_castle
    editor_name= _ "Phantom Castle"
    string=Cyd
    aliasof=Ct
    recruit_onto=yes
    no_overlay=yes
    editor_group=utbs
[/terrain_type]

# phantom keep
[terrain_type]
    symbol_image=dark-keep-throne
    id=phantom_keep
    editor_name= _ "Phantom Keep"
    string=Kyd
    aliasof=Ct
    recruit_onto=yes
    recruit_from=yes
    no_overlay=yes
    editor_group=utbs
[/terrain_type]


#textdomain wesnoth-utbs
# A supplementary terrain-graphics file

{DISABLE_BASE_TRANSITIONS (Cyd,Kyd)}

{TERRAIN_BASE      Cyd                                darkcastle}
{TERRAIN_BASE      Kyd                                darkcastle}
{OVERLAY           Kyd                                dark-keep-throne}

{WALL_TRANSITION3  (Cyd,Kyd)  Ql*    Qx*              unwalkable/dcastle-lava-chasm}

{NEW:WALL2         (Cyd,Kyd)  X*     (!,Cyd,Kyd,X*)   castle/dwarven-castle-wall}
{NEW:WALL2         (Cyd,Kyd)  Ql*    (!,Cyd,Kyd,Ql*)  unwalkable/dcastle-lava}
{NEW:WALL2         (Cyd,Kyd)  Qx*    (!,Cyd,Kyd,Qx*)  unwalkable/dcastle-chasm}

{NEW:WALL          (Cyd,Kyd)  (!,Cyd,Kyd,X*)          castle/dwarven-castle}

{DISABLE_WALL_TRANSITIONS Kyd}

############################################################################
# This makes gray shallow water transition on top of the floor terrains, which
# otherwise would have a hard edge.
# It uses custom terrain Wwgz code in place of standard gray Wwg
############################################################################

# these are the terrains that look more 'flooded' without their usual banked transitions
#define UTBS_WOOD_FLOOR
Iwr,Ior,Icn,R*,Ias*,Uu* #enddef

{NEW:WATER_342_180         Wwgz water/water 17 DURATION=125 RANDOM_START=125}
{NEW:DISABLE_GENERIC_CORNER_TRANSITION ({UTBS_WOOD_FLOOR},Xo*) Wwgz}
{NEW:DISABLE_TRANSITION Wwgz {UTBS_WOOD_FLOOR}  FLAG=non_submerged}
{NEW:WATER_342_180_OVERLAY Wwgz                       water/overlay-gray     -280}
{NEW:WATER_342_180_OVERLAY_TRANSITION     Wwgz (!,Wog,Wwg,Wwrg,Wwgz,!,W*,Sm) -281 water/overlay-gray     0.20}

# the wood-water transitions still have a faint hex-tooth edge, but this isn't enough to fix that without modifying the other side
# {NEW:TRANSITION            Iwr,Ior,Icn              Wwgz        -501               interior/wood-regular FLAG=transition2 IPF="~O(0.1)"}

{NEW:WATER_342_180_TRANSITION Wwgz ({UTBS_WOOD_FLOOR}) -282 "~CS(10,-5,-10)" water/water 17}

# Disables the generic land-water transition from floor to water
[terrain_graphics]
    map="
2
, .
1"
    [tile]
        pos=1
        type=Wwgz
        set_no_flag=beach-@R0-@R5,beach-@R0-@R1
    [/tile]
    [tile]
        pos=2
        type={UTBS_WOOD_FLOOR}
        set_no_flag=beach-@R2-@R3,beach-@R3-@R2
    [/tile]

    rotations=tr,r,br,bl,l,tl
[/terrain_graphics]

# Disables the floor's transition onto water
[terrain_graphics]
    map="
2
, .
1"
    [tile]
        pos=1
        type={UTBS_WOOD_FLOOR}
        set_flag=transition-@R0
    [/tile]
    [tile]
        pos=2
        type=Wwgz
    [/tile]

    rotations=n,ne,se,s,sw,nw
[/terrain_graphics]
############################################################################
############################################################################

#undef UTBS_WOOD_FLOOR

#ifndef EDITOR
# The ruined desert castles in this campaign were ravaged by meteors
{OVERLAY_RANDOM      Cdr                           embellishments/stones-small}
#endif


#textdomain wesnoth-l
# This version forked from 1.2, 2/10/2007, and prepared for mainline by ESR
[textdomain]
    name="wesnoth-l"
[/textdomain]

# wmlscope: set export=no
[campaign]
    id=Liberty
    name= _ "Liberty"
    abbrev= _ "Liberty"
    rank=50
    year="501 YW"
    first_scenario=01_The_Raid
    define=CAMPAIGN_LIBERTY
    icon="units/human-outlaws/fugitive.png~RC(magenta>red)"
    background="data/campaigns/The_Rise_Of_Wesnoth/images/story/trow_intro_02.jpg"

    {CAMPAIGN_DIFFICULTY EASY   "units/human-peasants/peasant.png~RC(magenta>red)" ( _ "Peasant") ( _ "Easy")}
    {CAMPAIGN_DIFFICULTY NORMAL "units/human-outlaws/outlaw.png~RC(magenta>red)" ( _ "Outlaw") ( _ "Normal")} {DEFAULT_DIFFICULTY}
    {CAMPAIGN_DIFFICULTY HARD   "units/human-outlaws/fugitive.png~RC(magenta>red)" ( _ "Fugitive") ( _ "Challenging")}

    #po: "marchlander" is archaic English for an inhabitant of a border region, not to be confused with "marshlander"
    # wmllint: local spelling marchlanders
    description= _ "As the shadow of civil war deepens across Wesnoth, a band of hardy marchlanders revolts against the governance of the new queen. To win their way to freedom, they must learn to use shadows and deception to rout the trained blades of the Wesnothian army.

" + _"(Novice level, 7 scenarios.)"

    [about]
        title = _ "Original Campaign Design"
        [entry]
            name = "Scott Klempner"
        [/entry]
    [/about]
    [about]
        title = _ "Latest Rewrite"
        [entry]
            name = "nemaara"
        [/entry]
    [/about]
    [about]
        title = _ "Campaign Maintenance"
        [entry]
            name = "Lari Nieminen (zookeeper)"
        [/entry]
        [entry]
            name = "Eric S. Raymond (ESR)"
            comment = "Original prose-doctoring and preparation for mainline"
        [/entry]
    [/about]
    [about]
        title = _ "Artwork and Graphics Design"
        [entry]
            name = "Brendan Sellner"
        [/entry]
        [entry]
            name = "Kathrin Polikeit (Kitty)"
            comment = "portraits"
        [/entry]
        [entry]
            name = "Shadow"
        [/entry]
        [entry]
            name = "Blarumyrran"
            comment = "story images, Rogue Mage line sprites"
        [/entry]
        [entry]
            name = "Sonny T Yamada (SkyOne)"
            comment = "Sprite animations (defense and attack) of Rogue Mage line"
        [/entry]
    [/about]
[/campaign]

#ifdef CAMPAIGN_LIBERTY

[binary_path]
    path=data/campaigns/Liberty
[/binary_path]

{campaigns/Liberty/utils}
{campaigns/Liberty/scenarios}

[units]
    {campaigns/Liberty/units}
[/units]

#endif

# wmllint: directory spelling Grey Relana Helicrom Fal Khag


#textdomain wesnoth-l
[scenario]
    id=01_The_Raid
    name= _ "The Raid"
    map_file=01_The_Raid.map
    {TURNS 19 17 15}

    next_scenario=02_Civil_Disobedience

    {INTRO_AND_SCENARIO_MUSIC "transience.ogg" "nunc_dimittis.ogg"}
    {EXTRA_SCENARIO_MUSIC "knolls.ogg"}

    [label]
        x,y=11,1
        text= _ "Dallben"
    [/label]

    [story]
        [part]
            #po: Baldras is an old man from the country and both speaks and writes with many grammatical errors due to his relative lack of education
            #po: He is also a little bit rude and grumpy, so languages with ruder or more informal variants of words should use those where appropriate
            story= _ "From the journal of Baldras, 21 Scatterseed, 501 YW

Months... seven months it’s been since the Crown did send a single guard here to help us. This Garard II be a pompous stinker, even worser than his pa! Us of these border towns Delwyn and Dallben already be poor and needy, yet alls ‘His Majesty’ can think of is tax, tax, tax, takin’ all our hard earned gold from us. Then he uses our gold to provoke more wars with more orcs just for personal glory and more land for them grubby nobles to lord over."
            background=story/frontier.jpg
        [/part]
        [part]
            story= _ "To abbadon with the Crown! We got no armies and we don’t even got real weapons, but we of the Western Marches make do just fine with our slings and clubs. In all Annuvin Province, there won’t be nobody besting us in these swamps. We’re self-reliant out here. We gots our own trade routes and pacts of mutual defense. No need for them Wesnothians. Not a single bit."
            background=story/frontier.jpg
        [/part]
        [part]
            #po: Some languages, including Norwegian and Old English, don't have a single word for "uncle", dividing it into
            #po: mother's-brother vs. father's-brother. Baldras is Harper's mother's brother.
            #po: In some human societies, including the Navaho and Akan, this would give him a special responsibility for the boy.
            #po: Erwen is Baldras' younger sister, so languages with a special word for that should use it
            story= _ "The sun were out today, but it were raining too. Weird mix of brightness and woe. Reminds me of the day Harper’s pa died in that orc raid. Since my sis Erwen passed when he were young, poor lad had nobody but me. Never wanted no kid of my own but... he’s mine to take care of now. Fine lad, that one, just a bit careless like his pa. I needs to keep a good eye on him now, with all them orcs running round here of late."
            background=story/frontier.jpg
        [/part]
    [/story]

    {LIBERTY_BIGMAP {JOURNEY_01_NEW} }

    {DEFAULT_SCHEDULE_DUSK}

    [side]
        type=Bandit_Peasant
        id=Baldras
        name= _ "Baldras"
        profile=portraits/baldras.png
        side=1
        color=blue
        canrecruit=yes
        recruit=
        controller=human
        unrenamable=yes
        experience=25
        gold=0
        [modifications]
            [object]
                duration=forever
                [effect]
                    apply_to=attack
                    name=mace-spiked
                    #textdomain wesnoth-units
                    set_description= _ "mace"
                    set_icon=attacks/mace.png
                    #textdomain wesnoth-l
                [/effect]
            [/object]
            {TRAIT_STRONG}
        [/modifications]
    [/side]

    {STARTING_VILLAGES 1 4}

    [side]
        type=Goblin Pillager
        id=Fal Khag
        name= _ "Fal Khag"
        side=2
        color=orange
        controller=ai
        canrecruit=yes
        facing=sw
        team_name=orcs
        user_team_name=_"Orcs"
        gold=25
        {FLAG_VARIANT6 ragged}
        defeat_condition=no_units_left
    [/side]

    [event]
        name=prestart

        [micro_ai]
            side=2
            ai_type=messenger_escort
            action=add

            [filter]
                id=Fal Khag
            [/filter]
            waypoint_x,waypoint_y=11,1
        [/micro_ai]

        [objectives]
            side=1
            [objective]
                description= _ "Defeat all of the Goblin marauders"
                condition=win
            [/objective]
            [objective]
                description= _ "Goblins reach the village of Dallben"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=100
            [/gold_carryover]
        [/objectives]

        #sign to mark the village location
        {PLACE_IMAGE scenery/signpost.png  11 3}

        #eye candy
        {PLACE_IMAGE items/scarecrow.png 2 3}
        {PLACE_IMAGE items/straw-bale1.png 8 2}
        {PLACE_IMAGE items/straw-bale2.png 9 3}
        {PLACE_IMAGE items/leather-pack.png 1 10}

        {SET_VILLAGE 10 1 1}
        {SET_VILLAGE 12 1 1}

#define DALLBEN_PEASANT TYPE X Y ID_STRING NAME_STRING
    [unit]
        type={TYPE}
        id={ID_STRING}
        name={NAME_STRING}  # wmllint: ignore
        x,y={X},{Y}
        side=1
        random_traits=yes
    [/unit]
#enddef

#define GOBLIN_RAIDER TYPE X Y NAME_STRING
    [unit]
        side=2
        type={TYPE}
        x,y={X},{Y}
        name={NAME_STRING}  # wmllint: ignore
        random_traits=yes
        facing=sw
    [/unit]
#enddef

        {GOBLIN_RAIDER (Wolf Rider) 21 29 ( _ "Gatrakh")}
        {GOBLIN_RAIDER (Goblin Pillager) 19 29 ( _ "Thurg")}

#ifdef EASY
        {GOBLIN_RAIDER (Wolf Rider) 19 30 ( _ "Krung")}
        {GOBLIN_RAIDER (Wolf Rider) 20 29 ( _ "Gorokh")}
#endif

#ifdef NORMAL
        {GOBLIN_RAIDER (Goblin Pillager) 19 30 ( _ "Krung")}
        {GOBLIN_RAIDER (Wolf Rider) 20 29 ( _ "Gorokh")}
#endif

#ifdef HARD
        {GOBLIN_RAIDER (Goblin Pillager) 19 30 ( _ "Krung")}
        {GOBLIN_RAIDER (Goblin Pillager) 20 29 ( _ "Gorokh")}
#endif

#undef GOBLIN_RAIDER

        # now store the good guys so they are invisible during the
        # goblin conversation
        [store_unit]
            variable=goodguys_store
            kill=yes
            [filter]
                side=1
            [/filter]
        [/store_unit]
    [/event]

    # Starting conversation and actions
    [event]
        name=start

        [message]
            speaker=Fal Khag
            message= _ "I long to burn human cities, but that weaselly witch thinks we’re only good enough for these puny villages. These hapless clods barely have anything, but at least the witch’s gold is good."
        [/message]
        [message]
            speaker=Fal Khag
            message= _ "Ride, you worms! Let’s finish our raid before their hunters return."
        [/message]

        #Put the leader back and make some other good guys
        [unstore_unit]
            variable=goodguys_store
        [/unstore_unit]
        {CLEAR_VARIABLE goodguys_store}

        {DALLBEN_PEASANT Footpad_Peasant 8 29 Jalak ( _ "Jalak")}
        {DALLBEN_PEASANT Footpad_Peasant 7 29 Delurin ( _ "Delurin")}
        {DALLBEN_PEASANT Footpad_Peasant 7 27 Red ( _ "Red")}
        {DALLBEN_PEASANT Bandit_Peasant 5 29 Ordo ( _ "Ordo")}
        {DALLBEN_PEASANT Bandit_Peasant 6 30 Novus ( _ "Novus")}
        {DALLBEN_PEASANT Thug_Peasant 7 30 Teneor ( _ "Teneor")}
        {DALLBEN_PEASANT Poacher_Peasant 5 28 Kembe ( _ "Kembe")}
        {DALLBEN_PEASANT Poacher_Peasant 5 30 Treagh ( _ "Treagh")}
        # wmllint: recognize Red
        # wmllint: recognize Kembe

        [unit]
            type=Footpad_Peasant
            id=Harper
            name= _ "Harper"
            profile=portraits/harper.png
            x,y=8,30
            side=1
            random_traits=no
            [modifications]
                [object]
                    duration=forever
                    [effect]
                        apply_to=attack
                        name=mace-spiked
                        #textdomain wesnoth-units
                        set_description= _ "club"
                        set_icon=attacks/club.png
                        #textdomain wesnoth-l
                    [/effect]
                [/object]
                {TRAIT_LOYAL_HERO}
                {TRAIT_RESILIENT}
                {TRAIT_DEXTROUS}
            [/modifications]
            unrenamable=yes
        [/unit]

        [message]
            speaker=Red
            # po: Other country folk also have accents
            message= _ "Look, goblin riders approach! You was right, they was going to raid Dallben while we was gone."
        [/message]
        [message]
            speaker=Baldras
            message= _ "We gots to stop them or they’ll burn down the whole village. Damn these goblins and damn the Crown. We always be havin’ to fight for ourselves."
        [/message]
        [message]
            speaker=Harper
            # po: Harper has a bit of an accent, but not as much as Baldras.
            # po: He's a bit of a reckless kid as Baldras alludes to, but he's much more polite
            message= _ "Uncle, we got no time to talk! Them riders are heading full speed straight for Dallben. We’ll need to chase them down through those woods, and fast, or we won’t be able to catch up."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Do it. Hold them beasts back till us old-timers get there to finish ‘em off."
        [/message]
        [message]
            speaker=Baldras
            message= _ "And Harper... don’t be getting reckless on me today. Your old man died like that, charging into a pack of goblins by ‘imself. I won’t lose ya the same way."
        [/message]
        [message]
            speaker=Harper
            message= _ "I know, I know, no need to worry so much. All right, let’s go!"
        [/message]
    [/event]

    #
    # Victory
    #
    [event]
        name=enemies defeated

        {CLEAR_VARIABLE town_guards_awakened}

        [message]
            speaker=Harper
            message= _ "These orc raids keep getting harder and harder to hold off. Feels like every new day’s just another chance for us to lose everything..."
        [/message]
        [message]
            speaker=Baldras
            message= _ "That Garard II stopped sendin’ patrols out here a while back. Stinker probably sent his troops on some new war against them orcs. Don’t really matter. Technically Annuvin be under the charge of Elensefar, but you don’t see ‘em coming to help us either."
        [/message]
        [message]
            speaker=Harper
            message= _ "Then why do we got to pay taxes to the King? Maybe Elensefar doesn’t help us, but at least they don’t take our gold."
        [/message]
        [message]
            speaker=Baldras
            message= _ "We don’t got no choice, lad. If I don’t gives them what they want, they’ll make trouble for everyone in Dallben."
        [/message]
        [message]
            speaker=Harper
            message= _ "But we can’t keep doing this forever, Uncle. If we stay like this, those orcs will eventually overrun us. What should we do?"
        [/message]
        [message]
            speaker=Baldras
            message= _ "I don’t know, Harper. I just don’t know. Alls I can say is we’re on our own out here."
        [/message]

        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 100}
        [/endlevel]
    [/event]

    [event]
        name=attack
        [filter]
            side=2
        [/filter]

        [message]
            speaker=Fal Khag
            message= _ "Time to feast on these puny pinkskins."
        [/message]

        [message]
            speaker=Harper
            message= _ "Hey! Who ya calling puny?"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Fal Khag
        [/filter]

        [message]
            speaker=Fal Khag
            message= _ "I was... too weak..?"
        [/message]

        [message]
            speaker=Harper
            message= _ "Silly goblin."
        [/message]
    [/event]

    # Small buff for Harper

    [event]
        name=moveto
        [filter]
            id=Harper
            x,y=1,10
        [/filter]

        [message]
            speaker=Harper
            message= _ "Hey, someone left their pack here. I could use it to carry some more rocks."
        [/message]

        [sound]
            name=sling.ogg
        [/sound]

        [object]
            id=harper_buff
            take_only_once=yes
            silent=yes
            duration=forever
            [filter]
                x,y=1,10
            [/filter]
            [effect]
                apply_to=attack
                range=ranged
                increase_damage=1
            [/effect]
        [/object]

        {REMOVE_IMAGE 1 10}
    [/event]

    [event]
        name=moveto
        [filter]
            x,y=2,3
        [/filter]

        [message]
            speaker=unit
            message= _ "Spooky."
        [/message]

        [store_unit]
            [filter]
                x,y=2,3
            [/filter]
            variable=stored_unit
        [/store_unit]

        {VARIABLE_OP stored_unit.experience add 2}

        [unstore_unit]
            variable=stored_unit
        [/unstore_unit]

        {CLEAR_VARIABLE stored_unit}
    [/event]

    # Orcs near the villlage

    [event]
        name=moveto
        [filter]
            side=2

            [filter_location]
                x,y=11,2
                radius=12
            [/filter_location]
        [/filter]
        [filter_condition]
            [variable]
                name=town_guards_awakened
                not_equals=yes
            [/variable]
        [/filter_condition]

        [message]
            speaker=Harper
            message= _ "They’re getting close to Dallben! What should we do?"
        [/message]
        [message]
            speaker=Baldras
            message= _ "There be a couple guards in the village. Might be able to slow them wolves down if they gets closer."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            [filter_location]
                x,y=11,2
                radius=9
            [/filter_location]
        [/filter]

        {DALLBEN_PEASANT Thug_Peasant 12 2 Remald ( _ "Remald")}
        {DALLBEN_PEASANT Thug_Peasant 10 2 Wolmas ( _ "Wolmas")}
        # wmllint: recognize Remald
        # wmllint: recognize Wolmas

#ifdef EASY
        {DALLBEN_PEASANT Thug_Peasant 11 4 Jasken ( _ "Jasken")}
#endif

        {IF_VAR unit.side equals 1 (
            [then]
                [message]
                    speaker=Wolmas
                    message= _ "What’s happening here? Why be you running like mad, $unit.name|?"
                [/message]
                [message]
                    speaker=unit
                    message= _ "Goblin riders be on the hunt, headed right for Dallben. We gots to stop them!"
                [/message]
            [/then]

            [else]
                [message]
                    speaker=Wolmas
                    message= _ "Look! Goblin riders be on the hunt, headed right for Dallben!"
                [/message]
                [message]
                    speaker=Remald
                    message= _ "We gots to stop them!"
                [/message]
            [/else]
        )}

        {VARIABLE town_guards_awakened yes}
    [/event]

    #
    # Loss conditions - the orcs reach the village
    #
    [event]
        name=moveto
        [filter]
            side=2
            x=9-13
            y=1-2
        [/filter]
        [message]
            speaker=Harper
            message= _ "The goblins reached the village! Now there’ll be nothing left after they raid our homes..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    {LIBERTY_DEATHS}
[/scenario]

#undef GOBLIN_RAIDER
#undef DALLBEN_PEASANT


#textdomain wesnoth-l
[scenario]
    id=02_Civil_Disobedience
    name= _ "Civil Disobedience"
    next_scenario=03_A_Strategy_of_Hope
    map_file=02_Civil_Disobedience.map
    {TURNS 14 13 12}
    {DEFAULT_SCHEDULE_AFTERNOON}

    {INTRO_AND_SCENARIO_MUSIC "revelation.ogg" "loyalists.ogg"}
    {EXTRA_SCENARIO_MUSIC "battle.ogg"}
    {EXTRA_SCENARIO_MUSIC "siege_of_laurelmor.ogg"}

    [label]
        x,y=31,13
        text= _ "Baldras’ farm"
    [/label]

    [story]
        [part]
            story= _ "Baldras’ journal, 6 Deeproot, 501 YW:

Me and Harper visited Erwen’s grave today. I helped the lad pick her a bunch of flowers — we even found some of her favorite, blue lillies. Harper don’t remember her much, but he still thinks lots about her. Lad reminds me so much of his ma often times, real bright and brassy, even if he don’t got her sense or wits. I’m just hoping he be learning more with time."
            background=story/frontier.jpg
        [/part]
        [part]
            story= _ "Speaking of sense, I gots me a bad feeling in my gut about today. I’d better ready our hunting troop when I get back to the village, just in case..."
            background=story/frontier.jpg
        [/part]
    [/story]

    {LIBERTY_BIGMAP {JOURNEY_02_NEW} }

    [side]
        type=Bandit_Peasant
        id=Baldras
        name= _ "Baldras"
        side=1
        color=blue
        canrecruit=yes
        controller=human
        {GOLD 170 140 110}
        team_name=good_guys
        user_team_name=_"Rebels"
        recruit=Footpad_Peasant,Poacher_Peasant,Thug_Peasant
    [/side]

    {STARTING_VILLAGES 1 12}

    [side]
        type=Cavalier
        id=Tarwen
        name= _ "Tarwen"
        side=2
        color=red
        canrecruit=yes
        controller=ai
        gold=0
        team_name=bad_guys
        user_team_name=_"Weldyn"
        [ai]
            [goal]
                name=protect_location
                [criteria]
                    x,y=26,7
                [/criteria]
                protect_radius=11
                value=10
            [/goal]
            passive_leader=yes
        [/ai]
        {FLAG_VARIANT loyalist}
    [/side]

    #The peasants - no leader or keep, but they help you as allies
    #by getting trampled on the first turn
    [side]
        side=3
        color=lightblue
        no_leader=yes
        controller=ai
        team_name=good_guys
        user_team_name=_"Rebels"
    [/side]

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Kill the Wesnoth army captain, Tarwen"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]

        {PLACE_IMAGE items/scarecrow.png 29 13}
        {PLACE_IMAGE "items/scarecrow.png~FL(horiz)" 18 1}

        {PLACE_IMAGE items/straw-bale1.png 32 14}
        {PLACE_IMAGE items/straw-bale2.png 33 6}
        {PLACE_IMAGE "items/straw-bale1.png~FL(horiz)" 15 5}
        {PLACE_IMAGE items/grain-sheaf.png 19 12}

        {PLACE_IMAGE "scenery/oak-leaning.png" 27 9}
        {PLACE_IMAGE "scenery/well.png" 22 7}

        {PLACE_IMAGE "items/mace.png" 31 14}

        {GENERIC_UNIT 3 Peasant 17 4}
        {GENERIC_UNIT 3 Peasant 22 3}
        {GENERIC_UNIT 3 Peasant 25 6}
        {GENERIC_UNIT 3 Peasant 26 8}
        {GENERIC_UNIT 3 Peasant 23 13}

        {MODIFY_UNIT type=Peasant facing sw}
    [/event]

    #
    # Starting conversation and actions
    #
    [event]
        name=start

        [recall]
            id=Harper
        [/recall]
        [message]
            speaker=Harper
            message= _ "Look, riders approach."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Stand fast, nephew."
        [/message]

        {MOVE_UNIT id=Tarwen 4 10}

        [capture_village]
            x=2-11
            y=6-11
            side=2
        [/capture_village]

        [message]
            speaker=Tarwen
            message= _ "By order of the Queen, the magistrate of this town is to travel with us to Elensefar for vetting."
        [/message]
        [message]
            speaker=Baldras
            message= _ "The Crown did long since abandon our village. You Wesnothians be too busy countin’ the gold from our taxes to be sending aid against them orcs. Nobody here be leaving to nowhere."
        [/message]
        [message]
            speaker=Tarwen
            message= _ "Insolent peasant. Try not my patience, else I shall be forced to drag thy deceased corpse back with me to the city."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Try it then, stinker."
        [/message]
        [message]
            speaker=Tarwen
            message= _ "As you wish."
        [/message]

        {GENERIC_UNIT 2 Cavalryman 15 7}
        {MOVE_UNIT x,y=15,7 20 6}

        {GENERIC_UNIT 2 Cavalryman 15 7}
        {MOVE_UNIT x,y=15,7 20 8}

        {GENERIC_UNIT 2 Cavalryman 15 7}
        {MOVE_UNIT x,y=15,7 22 8}

        {GENERIC_UNIT 2 Cavalryman 15 7}
        {MOVE_UNIT x,y=15,7 22 6}

#ifdef NORMAL
        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 19 5}

        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 18 9}
#endif
#ifdef HARD
        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 19 5}

        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 18 9}

        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 18 6}
#endif
        [message]
            speaker=Tarwen
            message= _ "Guard the gate."
        [/message]

        {GENERIC_UNIT 2 Spearman 14 6}
        {MOVE_UNIT x,y=14,6 16 6}

        {GENERIC_UNIT 2 Spearman 14 7}
        {MOVE_UNIT x,y=14,7 16 7}

        {MOVE_UNIT id=Tarwen 8 8}

        [message]
            speaker=Harper
            message= _ "Uncle, since when did we have a queen?"
        [/message]
        [message]
            speaker=Baldras
            message= _ "Since a few years back, I thinks, but weren’t never her giving out no orders..."
        [/message]
        [message]
            speaker=Baldras
            message= _ "It don’t really matter right now. Harper, get yerself out o’ here. This be no kind of battle for you."
        [/message]
        [message]
            speaker=Harper
            message= _ "I can fight!"
        [/message]
        [message]
            speaker=Baldras
            message= _ "Harper, do what I says to ya."
        [/message]
        [message]
            speaker=Harper
            message= _ "We’re in this together. Death to the Wesnothians!"
        [/message]
        [message]
            speaker=Baldras
            message= _ "Impulsive lad..."
        [/message]
    [/event]

    [event]
        name=attack
        [filter_second]
            side=3
        [/filter_second]

        # this is from Monty Python and the Holy Grail :)
        [message]
            speaker=second_unit
            message= _ "Help, help! I’m being repressed!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            side=3
        [/filter]

        [message]
            speaker=Harper
            message= _ "They just killed an innocent man! Murderers!"
        [/message]

        [message]
            speaker=Tarwen
            message= _ "Cry thine eyes out for me, peasant."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            id=Baldras
            x,y=31,14
        [/filter]

        [message]
            speaker=Baldras
            message= _ "I oughta bring out the good mace to fight off these thugs."
        [/message]

        [sound]
            name=mace.ogg
        [/sound]

        [object]
            id=baldras_buff
            take_only_once=yes
            silent=yes
            duration=forever
            [filter]
                x,y=31,14
            [/filter]
            [effect]
                apply_to=attack
                range=melee
                increase_damage=1
            [/effect]
        [/object]

        {REMOVE_IMAGE 31 14}
    [/event]

    #
    #Special event - when you attack Tarwen, he stops being passive (surprise!)
    #
    [event]
        name=attack
        [filter_second]
            id=Tarwen
        [/filter_second]

        [modify_side]
            [filter_side]
                side=2
            [/filter_side]

            [ai]
                passive_leader=no
            [/ai]
        [/modify_side]

        [message]
            speaker=Tarwen
            message= _ "Back, back ye curs!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            side=2
        [/filter]

        [message]
            speaker=Harper
            message= _ "Take that, you bullies!"
        [/message]
    [/event]
    #
    # Victory
    #
    [event]
        name=die
        [filter]
            id=Tarwen
        [/filter]

        [message]
            speaker=second_unit
            message= _ "Get out of my village!"
        [/message]

        [kill]
            side=2
        [/kill]
    [/event]

    [event]
        name=enemies defeated

        [role]
            type=Huntsman_Peasant,Ranger,Fugitive_Peasant,Highwayman_Peasant,Outlaw_Peasant,Trapper_Peasant,Bandit_Peasant,Footpad_Peasant,Poacher_Peasant,Thug_Peasant
            [not]
                id=Harper,Baldras
            [/not]
            role=Advisor
        [/role]

        [message]
            role=Advisor
            message= _ "We beat their leader, but a couple of them riders escaped. What should we do?"
        [/message]

        [message]
            speaker=Baldras
            message= _ "Somethin’ be very wrong here. That Garard weren’t never no hero or nothing, but his men never would’ve attacked us. The Queen must’ve did something to him."
        [/message]

        [message]
            speaker=Harper
            #wmllint: local spelling ol'
            message= _ "We’ve got to tell the people of Delwyn about this. Ol’ magistrate Relana will have some ideas."
        [/message]

        [message]
            role=Advisor
            message= _ "That’s true. Whenever there’s been troubles, we’ve always looked to her for help."
        [/message]

        [message]
            speaker=Baldras
            message= _ "Fine. We’ll go to Delwyn, see what Relana gots to say. With them riders so eagerly attackin’ us today, I’m thinking Delwyn will be under threat too."
        [/message]

        [message]
            speaker=Harper
            message= _ "So we’ll have to fight them Wesnothians again?"
        [/message]

        [message]
            speaker=Baldras
            message= _ "Alls I can say for certain is we’ve made ourselves enemies of the Crown. They’ll be hunting us now."
        [/message]

        [message]
            speaker=Harper
            message= _ "Then we’re outlaws."
        [/message]

        [message]
            speaker=Baldras
            message= _ "Aye, outlaws."
        [/message]

        [store_unit]
            [filter]
                side=1

                [filter_wml]
                    [abilities]
                        [outlaw_type_hack]
                        [/outlaw_type_hack]
                    [/abilities]
                [/filter_wml]
            [/filter]

            kill=yes
            variable=stored_peasants
        [/store_unit]

        [foreach]
            array=stored_peasants
            [do]
                [unit]
                    side=1
                    type=$this_item.abilities.outlaw_type_hack.id
                    id=$this_item.id
                    name=$this_item.name
                    x,y=$this_item.x,$this_item.y
                    hitpoints=$this_item.hitpoints
                    moves=$this_item.moves
                    experience=$this_item.experience
                    gender=$this_item.gender
                    facing=$this_item.facing
                    profile=$this_item.profile
                    unrenamable=$this_item.unrenamable
                    canrecruit=$this_item.canrecruit
                    random_traits=$this_item.random_traits
                    role=$this_item.role

                    [insert_tag]
                        name=modifications
                        variable=this_item.modifications
                    [/insert_tag]
                [/unit]
            [/do]
        [/foreach]

        [modify_side]
            side=1
            color=black
        [/modify_side]

        {CLEAR_VARIABLE stored_peasants}

        [disallow_recruit]
            side=1
            type=Thug_Peasant,Footpad_Peasant,Poacher_Peasant
        [/disallow_recruit]
        [allow_recruit]
            side=1
            type=Thug,Footpad,Poacher
        [/allow_recruit]
        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    #
    # Loss conditions - turns run out
    #
    [event]
        name=time over

        [unit]
            type=Knight
            side=2
            x,y=4,11
            id=Reinforcement Knight
            generate_name=yes
            animate=yes
            facing=ne
        [/unit]
        {GENERIC_UNIT 2 (Knight)       3 12} {FACING ne}
        {GENERIC_UNIT 2 (Lancer)       4 12} {FACING ne}
        {GENERIC_UNIT 2 (Lancer)       3 13} {FACING ne}
        {GENERIC_UNIT 2 (Knight) 4 13} {FACING ne}
        {GENERIC_UNIT 2 (Dragoon) 3 14} {FACING ne}
        {GENERIC_UNIT 2 (Dragoon) 4 14} {FACING ne}

        [message]
            speaker=Reinforcement Knight
            message= _ "At your order, Captain."
        [/message]
        [message]
            speaker=Tarwen
            message= _ "Slay them all."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Curses! Their reinforcements has arrived. We gots no chance to fight ‘em off now..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    {LIBERTY_DEATHS}
[/scenario]


#textdomain wesnoth-l
[scenario]
    id=03_A_Strategy_of_Hope
    name= _ "A Strategy of Hope"
    next_scenario=04_Unlawful_Orders
    victory_when_enemies_defeated=yes
    map_file=03_Strategy_of_Hope.map
    {TURNS 26 24 22}
    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC underground.ogg knolls.ogg}
    {EXTRA_SCENARIO_MUSIC "northerners.ogg"}
    {EXTRA_SCENARIO_MUSIC "knalgan_theme.ogg"}

    [story]
        [part]
            story= _ "Baldras’ journal, 10 Deeproot, 501 YW:

Been a strange few days. Had to leave Dallben real quick. We grabbed whatever we could in just a day, some food, some clothes, sis’s lucky bracelet... and made off for Delwyn as quick as these old bones would let me. It be a three day journey there for me, but I sended Harper ahead for Relana first. Said we’d meet her in the usual hiding spot in the swamp."
            background=story/frontier.jpg
        [/part]
        [part]
            story= _ "This whole mess be utter stupidness. Of all the things to be driving us from our home, how did it ended up being those accursed Wesnothians? Blasted Crown. Don’t matter whoever’s the one giving out them orders, those stinkers in Weldyn always be making trouble for us countryfolk."
            background=story/frontier.jpg
        [/part]
        [part]
            story= _ "I’m too old for all this. Them orc raids already be plenty for me to deal with. I don’t be keen on fighting no war with Wesnoth. But... I guess, I don’t really got no choice either. Harper’s still too young to be leading anyone, and it don’t seem like anyone else in the village be suitable."
            background=story/frontier.jpg
        [/part]
        [part]
            story= _ "In times like these... I still wish Erwen was here with us. Little sis were always the better of us two. She always knew how to keep her temper and her wits about her. What would she say to me now? Probably something like, “Quit yapping ya old dog and focus on what you’re doing. We’ve got to be getting them people to safety.” Cheeky kid, that one. But, she’d be right, I has me a responsibility to our people. Got a lot of trouble ahead of us..."
            background=story/frontier.jpg
        [/part]
    [/story]

    {LIBERTY_BIGMAP {JOURNEY_03_NEW} }

    [side]
        type=Bandit
        id=Baldras
        side=1
        color=black
        canrecruit=yes
        controller=human
        recruit=Thug,Footpad,Poacher
        {GOLD 160 140 120}
        team_name=good_guys
        user_team_name=_"Rebels"
    [/side]

    {STARTING_VILLAGES_AREA 1 25 8 8}

    [side]
        type=Highwayman_Peasant
        gender=female
        id=Relana
        name= _ "Relana"
        profile=portraits/relana.png
        facing=se
        side=2
        color=lightblue
        canrecruit=yes
        controller=ai
        [ai]
            #This should get them to attack the saurians
            [goal]
                name=protect_location
                [criteria]
                    x,y=7,6
                [/criteria]
                protect_radius=10
                value=7
            [/goal]
        [/ai]
        recruit=Outlaw_Peasant,Trapper_Peasant,Poacher_Peasant,Huntsman_Peasant,Thug_Peasant
        {GOLD 125 100 75}
        team_name=good_guys
        user_team_name=_"Rebels"
    [/side]

    {STARTING_VILLAGES_AREA 2 13 22 15}

    [side]
        type=Orcish Warrior
        id="Urk Delek"
        name= _ "Urk Delek"
        profile=portraits/orcs/grunt-3.png
        facing=sw
        side=3
        color=orange
        canrecruit=yes
        controller=ai
        recruit=Orcish Grunt,Wolf Rider,Orcish Archer,Troll Whelp
        [ai]
            time_of_day=dawn,morning,afternoon
            caution=0.5
            aggression=0.5
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            caution=0.0
            aggression=1.0
        [/ai]
        {GOLD 80 100 120}
        team_name=bad_guys
        user_team_name=_"Orcs"
        {FLAG_VARIANT6 ragged}
    [/side]

    {STARTING_VILLAGES_AREA 3 33 25 6}

    [side]
        type=Saurian Oracle
        id=Thhsthss
        name= _ "Thhsthss"
        side=4
        color=orange
        canrecruit=yes
        controller=ai
        recruit=Saurian Skirmisher,Saurian Ambusher,Saurian Augur
        [ai]
            recruitment_pattern=scout,healer,scout
            #they want to kill the leader
            leader_value=5
        [/ai]
        [village]
            x,y=4,1
        [/village]
        {GOLD 60 80 100}
        team_name=bad_guys
        user_team_name=_"Orcs"
    [/side]

    [side]
        side=5
        controller=ai
        no_leader=yes
        hidden=yes
        team_name=monsters
        color=brown
    [/side]

    {STARTING_VILLAGES_AREA 4 7 6 6}

    #
    # Prestart actions
    #
    [event]
        name=prestart

        {PLACE_IMAGE items/ornate2.png 5 28}
        {PLACE_IMAGE scenery/well.png 5 29}

        [objectives]
            side=1
            [objective]
                description= _ "Defeat both enemy leaders"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Relana"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]
    [/event]

    [event]
        name=start

        {MOVE_UNIT id=Baldras 24 13}

        [recall]
            id=Harper
            x,y=21,13
        [/recall]
        [recall]
            role=Advisor
            x,y=25,14
        [/recall]

        # This makes sure Baldras' portrait doesn't cover up Relana's sprite
        [scroll_to_unit]
            id=Baldras
        [/scroll_to_unit]

        [message]
            speaker=Relana
            message= _ "Baldras! Ya made it! Lil Harper here told me all about what happened."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Aye, Relana. It were one o’ the Queen’s patrol, strange as it do sound. Turns out they was itchin’ to attack us soon as I wasn’t willing to leave with ‘em."
        [/message]
        [message]
            speaker=Harper
            message= _ "But we fought those ugly scoundrels off!"
        [/message]
        [message]
            speaker=Relana
            message= _ "Queen’s patrol, ya say? They sent them a messenger our way a couple days ago, demanding our allegiance to some ‘Asheviere’. Weren’t that Garard’s young bride or something? Why’s she the one in charge now?"
        [/message]
        [message]
            speaker=Baldras
            message= _ "I don’t know, but some of them riders escaped us. Bet they’ll report back to their local garrison, tell them we’re a bunch o’ traitors."
        [/message]
        [message]
            role=Advisor
            message= _ "Then they’ll be comin’ back in force."
        [/message]
        [message]
            speaker=Relana
            message= _ "We needs more information. We should consult ourselves with Elensefar. Lord Maddock surely gots to know more than us."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Elensefar? Why him?"
        [/message]
        [message]
            speaker=Relana
            message= _ "Well all Annuvin be ruled by Elensefar, right? We don’t gots to heed anything Wesnoth says. Lord Maddock’s technically the one we answer to."
        [/message]
        [message]
            speaker=Baldras
            message= _ "It don’t matter. Weldyn be doing whatever it likes while Maddock says nothing. He knows, but he don’t care."
        [/message]
        [message]
            speaker=Relana
            message= _ "But we still need that knowledge, Baldras. We can’t be coming up with any great plan without no information. We both knows that if Weldyn brings one o’ their armies here, there be no way we can fight them off."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Perhaps, but — hold there. Did ya hear that? Sounded like some wolf howl."
        [/message]
        [message]
            speaker=Relana
            message= _ "Somethin’ smells like lizard too. We’re not alone here."
        [/message]
        [message]
            speaker=Harper
            message= _ "Finally, some action!"
        [/message]

        {INCIDENTAL_MUSIC casualties_of_war.ogg}

        {MOVE_UNIT (id=Urk Delek) 33 25}
        [message]
            speaker="Urk Delek"
            message= _ "Blasted humans and blasted Fal Khag! Stupid goblin was only supposed to scout that puny village, not fight it by himself. Then those damned humans rejected our help and look where that got them."
        [/message]
        [message]
            speaker="Urk Delek"
            message= _ "“Don’t know why the Queen hired some stinkin’ orcs, we don’t need you here.” Yeah, well now they’re dead like a bunch of beasts."
        [/message]
        {MOVE_UNIT id=Thhsthss 7 6}
        [message]
            speaker="Thhsthss"
            # wmllint: local spellings uss usss promissed ordersss
            message= _ "Your ordersss mean nothing to usss, orc. You promissed uss gold."
        [/message]
        [message]
            speaker="Urk Delek"
            message= _ "Shut your trap, lizard. You’ll get your gold as soon as my wolves get their meat."
        [/message]
    [/event]

    [event]
        name=turn 19

        [message]
            speaker=Baldras
            message= _ "We gots to be headin’ for Elensefar soon before them Wesnothians come back."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x,y=34,5
        [/filter]

        [message]
            speaker=unit
            # po: fishperson is the same as merfolk
            message= _ "Looks like some fishperson used to live here."
        [/message]

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

        [unit]
            type=Walking Corpse
            id=Dead Fish
            variation=swimmer
            side=5
            x,y=35,6
            animate=yes
        [/unit]

        [message]
            speaker=Harper
            message= _ "Looks like they still do. Ick."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            id=Dead Fish
        [/filter]

        [message]
            speaker=Harper
            message= _ "Ewww, I think it be smelling even worse now. Least it’s stopped moving."
        [/message]

        [store_unit]
            [filter]
                x,y=$x2,$y2
            [/filter]
            variable=stored_unit
        [/store_unit]

        {VARIABLE_OP stored_unit.experience add 6}

        [unstore_unit]
            variable=stored_unit
        [/unstore_unit]

        {CLEAR_VARIABLE stored_unit}
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x,y=13-22,24-29
        [/filter]

        [message]
            speaker=Baldras
            message= _ "I don’t likes me the look of that water."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x,y=17,27
            [not]
                id=Baldras
            [/not]
        [/filter]

        [sound]
            name=water-blast.wav
        [/sound]

        [unit]
            type=Tentacle of the Deep
            side=5
            x,y=17,29
            animate=yes
        [/unit]
        [unit]
            type=Tentacle of the Deep
            side=5
            x,y=18,25
            animate=yes
        [/unit]

        [message]
            speaker=unit
            message= _ "Ahh! Help, it’s a tentacle monster!"
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            id=Harper
            x,y=5,28
        [/filter]

        [message]
            speaker=Harper
            message= _ "That’s some fresh tasty water. Mmm!"
        [/message]

        [object]
            id=harper_buff_water
            take_only_once=yes
            silent=yes
            duration=forever
            [filter]
                x,y=5,28
            [/filter]
            [effect]
                apply_to=hitpoints
                increase_total=1
                increase=1
            [/effect]
        [/object]
    [/event]

    #
    # Victory
    #

    [event]
        name=last breath
        [filter]
            id=Urk Delek
        [/filter]

        [message]
            speaker=Urk Delek
            message= _ "Blasted pinkskins..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Thhsthss
        [/filter]

        [message]
            speaker=Thhsthss
            # wmllint: local spellings Thissss
            message= _ "Thissss was not part of the deal..."
        [/message]
    [/event]

    [event]
        name=enemies defeated

        [message]
            speaker=Baldras
            message= _ "Something be very wrong here. These orcs has weapons with Army forge-markings."
        [/message]
        [message]
            speaker=Relana
            message= _ "Aye, and the gold in their pouches looks new from mint. Could just be plunder, but..."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Don’t seem like it. I be thinking these orcs were hired to scout us. But for what? Of all the alliances to be making, why would Weldyn be hiring orcs?"
        [/message]
        [message]
            speaker=Relana
            message= _ "I thinks your mission to Lord Maddock just became even more urgent. We needs to know the Queen’s motives."
        [/message]
        [message]
            speaker=Baldras
            message= _ "I don’t like leaving our people here alone, but I sees your point. If we wait, more will be coming."
        [/message]
        [message]
            speaker=Relana
            message= _ "For now, I can stay here and perhaps talk them Wesnothians out of attacking us directly, but I don’t thinks it will work forever. To survive this, we needs to act quick, Baldras."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Then we’ll go to Elensefar as fast as we can. Luck be with ya, Relana."
        [/message]

        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    #
    # Loss conditions - turns run out
    #
    [event]
        name=time over

        [message]
            speaker=Baldras
            message= _ "We gots no more time to be spending here nor to be traveling to Elensefar... them Wesnothians probably already be mobilizing against us. We’ve got to head back to Dallben!"
        [/message]

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message=_ "Baldras and Relana returned to their villages to find them destroyed, with any survivors borne away to unknown fates. It was a bitter doom, and as Wesnoth descended into chaos, they would live to see worse."
        [/message]

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

    {LIBERTY_DEATHS}
[/scenario]