begintownscript;
variables;
short choice;
short i,erase,march,steps;
short tick,counter = 0;

body;
beginstate init_state;

i = 0;
while(char_ok(i) == 0){
	i = i + 1;
	}
if(get_flag(9,12) == 0){
	revive_party();
	activate_hidden_group(4);
	if(get_flag(255,2) == 0)
		put_item_on_spot(12,51,459);
	else
		put_item_on_spot(12,51,458);
}
else{
	put_stain_on_space(30,49,1);
	put_stain_on_space(30,51,1);
	put_stain_on_space(30,53,2);
	put_stain_on_space(30,54,1);
	put_stain_on_space(31,50,2);
	put_stain_on_space(31,52,3);
	put_stain_on_space(32,51,3);
	put_stain_on_space(33,50,2);
	put_stain_on_space(33,53,2);
	put_stain_on_space(33,54,2);
	put_stain_on_space(34,49,3);
	put_stain_on_space(35,49,2);
	put_stain_on_space(35,51,2);
	put_stain_on_space(32,56,1);
	put_stain_on_space(32,58,1);
	put_stain_on_space(32,60,1);
	put_stain_on_space(34,61,1);
	put_stain_on_space(35,53,3);
	put_stain_on_space(36,53,1);
	put_stain_on_space(37,61,1);
	put_stain_on_space(38,71,1);
	set_terrain(32,52,137);
	set_terrain(31,53,269);
	set_terrain(32,50,269);	
	set_terrain(35,53,269);
	set_terrain(33,54,269);
	set_terrain(35,49,269);
}
break;

beginstate start_state;
tick = tick + 1;
if((tick % 4) == 0)
	swap_terrain(39,24,384,388);
if((tick % 3) == 0)
	swap_terrain(30,31,384,388);

if((tick % 4) == 0)
	swap_terrain(54,42,384,388);
if((tick % 5) == 0)
	swap_terrain(58,42,384,388);
if((tick % 3) == 0)
	swap_terrain(61,36,384,388);
if((tick % 3) == 0)
	swap_terrain(49,36,384,388);

if((get_flag(9,3) == 1) && (num_chars_in_group(1) == 0)){
	set_flag(9,3,2);
	reset_dialog();
	add_dialog_str(0,"The last of the strange beasts dies. This place is apparently more than a tower basement to have all this machinery, you can't think of any explanation than a magical laboratory.",0);
	add_dialog_str(1,"But what the hell were those creatures? They must have been living down here for hundreds of years, and apparently they feed off the magical energy of the machinery.",0);
	add_dialog_str(2,"You turn to look at one of the machines in question. The center console occasionally sends a beam of energy flickering up through the ceiling. There is enough power for the machinery to run- kind of- now that those creatures are gone.",0);
	add_dialog_str(3,"You stare at the flashing beam of energy, but can't think of any practical use it could be put to.",0);
	add_dialog_str(4,"You feel exhausted from your fight with those creatures- not the physical tiredness you'd been already feeling, but a deep malaise that seems to drain your soul.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
}
if((get_flag(9,4) == 1) && (num_chars_in_group(2) == 0)){
	set_flag(9,4,2);
	reset_dialog();
	add_dialog_str(0,"The last of those terrible creatures dies, with it goes the pall that had fallen over the room.",0);
	add_dialog_str(1,"The machinery that's still functioning puts out a brighter and steadier beam, and the center console now has enough power to beam energy up through the ceiling.",0);
	add_dialog_str(2,"Again, you aren't sure what good this will do you, but it might be an accomplishment. Plus the less of those creatures that are around to harass the group the better-- not that that's your most pressing concern.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
}
if((get_flag(9,18) == 5) && (get_flag(9,19) == 0)){
	set_flag(9,19,1);
	reset_dialog();
	add_dialog_str(0,"Having examined the scene of the slaughter you are left with even more questions. How did the Beast get in here? Why didn't you awake during the fighting? Why was the most defenseless man, the one who was asleep, not the first killed?",0);
	add_dialog_str(1,"Even more importantly, where is the sixth body? All are accounted for, save Fabian. You have searched the room thoroughly, but his body is nowhere. Drag marks lead up the stairs to the south, giving you a possible explanation.",0);
	add_dialog_str(2,"You need to find Fabian, wherever he is. But right now your stomache is growling. The horrible sight you've beheld hasn't kept your hungry body from needing nourishment.",0);
	add_dialog_str(3,"You reach into your pocket and find a half eaten piece of hardtack that wasn't there before-- the others expeditions must have been successful in finding food. You take bite as you head out, you'll have to eat on the run.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
}	 
break;

beginstate exit_state;
break;

beginstate 10;
if(get_flag(9,0) == 0){
	block_entry(1);
	set_flag(9,0,1);
	reset_dialog();
	add_dialog_str(0,"You step into the ruined cellar. Furniture is smashed and strewn about the room, and the roof and walls are beginning to collapse. Still, it's in much better shape than the above ground sections of the tower.",0);
	add_dialog_str(1,"The others have arrived before you, and all huddle around a bonfire that burns merrily in the center of the room. You and Fabian stumble over to join them.",0);
	add_dialog_str(2,"When Sergeant Burden sees you she looks relieved, _So w-we all made it._ She trails off when she realizes what she just said. _Well-- anyways come w-warm yourself. Y-you look terrible._ Her teeth chatter as she speaks.",0);
	add_dialog_str(3,"You stumble over to the fire, stripping off your sweat-dampened clothes as you do. You collapse by the fire, and lay there unmoving for what seems hours.",0);
	add_dialog_str(4,"Your limbs feel numb. Out in the cold it seemed natural enough, but now that you're in here you realise how odd it is. You've been sitting here for how long, yet you don't feel a bit warmer.",0);
	add_dialog_str(5,"You complain of this aloud, to which Sergeant Burden responds by pointing at your legs. You look down, dreading what you'll find.",0);
	add_dialog_str(6,"Your skin is a sickly greyish blue, ending in black stubs at your toes. You stare silently, then tumble backwards to lie on the stone floor, all hope is gone.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);

	reset_dialog();
	add_dialog_str(0,"You aren't sure how long you lay there, feeling the cold air soaking up your life-force, and always the blackness creeping up your limbs. The fire does nothing to warm you, it can't compete with the freezing air or your deadened nerves.",0);
	add_dialog_str(1,"Sergeant Burden's weary voice comes to you as if from miles away, _We-- we can't just lay here and die. Orrin-- gave us this chance. We-- we can't just die here without fighting._",0);
	add_dialog_str(2,"Nobody responds, everybody else is as bone weary as you are, and they are probably just as frostbitten as well. Burden, too, lays exhausted.",0);
	add_dialog_str(3,"Suddenly, by sheer force of will, she pulls herself to her feet. _What the hell are we doing? Is this how we repay him, giving up? We need food, we need medicine-- get off your asses and find it. If we die here so be it, but don't just give up._",0);
	add_dialog_str(4,"You slowly rise to your feet, pulled there by her words as a puppeteer pulls a marionette. You are surprised to see your numb limbs still support you, all strength isn't gone form them, even if feeling is.",0);
	add_dialog_str(5,"The others, save Ainsley, all do the same. Moving unfeeling limbs experimentally, trying with little success to put on boots with fingers made of lead. Burden looks on grimmly.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	erase = 6;
	while(erase <= 11){
		erase_char(erase);
		erase = erase + 1;
	}
	activate_hidden_group(1);
	set_char_dialogue_pic(44,305,0);
	set_char_dialogue_pic(34,1957,0);
	set_char_dialogue_pic(33,1907,0);
	set_char_dialogue_pic(28,1959,0);
	set_char_dialogue_pic(27,306,0);
	set_char_dialogue_pic(43,303,0);
	relocate_character(i,33,54);
}
break;

beginstate 11;
block_entry(1);
if(get_flag(9,12) > 0)
	set_state_continue(30);
if(get_flag(9,1) == 0)
	set_state_continue(21);
if((get_flag(9,1) > 0) && (get_flag(9,9) == 0))
	set_state_continue(22);
if(get_flag(9,9) > 0)
	message_dialog("Your orders were to scout the northern corridors, your fellows can handle this direction.","");
break;

beginstate 20;
if(get_flag(9,12) > 0)
	set_state_continue(30);
if(get_flag(9,1) == 0)
	set_state_continue(21);
if((get_flag(9,1) > 0) && (get_flag(9,9) == 0))
	set_state_continue(22);
break;

beginstate 21;
	block_entry(1);
	message_dialog("Sergeant Burden calls out, _Hold on, Vincent. We need to organize first, else we'll expend our strength unnecessarily._","");
break;

beginstate 22;
reset_dialog();
add_dialog_str(0,"Sergeant Burden gathers you all for some last second instructions. _OK, we all know what the plan is: Scout, gather any supplies, and get back here before our strength completely gives out._",0);
add_dialog_str(1,"_Perhaps when we gather back we will have some food and medicine, or something to work with. It's a risk-- there is a great chance that someone will collapse somewhere by himself and nobody will be strong enough to bring him back._",0);
add_dialog_str(2,"_Splitting the group up might be a mad scheme, but desperate times call for desperate measures. So don't do anything stupid and prove that I was wrong to do this, just get any supplies and get out._",0);
add_dialog_str(3,"She hesistates for a moment, then reaches into her pack. _Here, Vincent, take this,_ She says as she hands you a folded packet. _It's some medical supplies from our first aid kit. You should have them. You're the one that's to be alone._",0);
add_dialog_str(3,"_Rendezvous back here at the fire. That is all, you are dismissed._ Each team files out down it's corridor, leaving you with the north passage as instructed. No point in waiting around.",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);
set_flag(9,9,1);
reward_give(485);
reward_give(485);
reward_give(471);
reward_give(472);
erase_char(27);
erase_char(28);
erase_char(43);
erase_char(44);
break;

beginstate 30;
block_entry(1);
message_dialog("There is nothing for you in the rest of these research facilities. You alone were left alive, you alone survived the bloodbath behind you, you think you know your purpose-- to kill the creature that did this. You turn back.","");
end();
break;


beginstate 12;
if(get_flag(9,3) == 0){
	set_flag(9,3,1);
	activate_hidden_group(2);
	reset_dialog();
	add_dialog_str(0,"Erasmus had said this tower was abandoned hundreds of years ago, and all you've seen here as supported this. This makes what you see in this room all the more surprising.",0);
	add_dialog_str(1,"The dim light of dying lasers flicker and refract around the room. Somehow a few of the power sources here have survived, and are still functioning, if at a bit less than 100%",0);
	add_dialog_str(2,"What is shocking and disturbing about this scene isn't, however, that the machinery is hundreds of years old. Rather, it is the strange black creatures that crowd around the center console.",0);
	add_dialog_str(3,"The creatures are like nothing you've seen before. They are twisted and misshapen, with strange and seemingly useless appendages branching off from everywhere.",0);
	add_dialog_str(4,"Their arms branch off into a series of long, delicate tentacles, with which they grasp the machinery. You aren't sure what they are doing, but from the light pulsing through them you'd say they are somehow absorbing its energy.",0);
	add_dialog_str(5,"Whatever it is, they don't like being interupted. The hulking beasts turn their frightening gazes upon you and begin advancing. For their awkward appearance they exhibit surprising speed and dexterity.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
}
break;

beginstate 13;
	message_dialog("A pile of smashed up furniture is stacked here, ready to be fed to the fire. Scrap wood, that's one thing this place has plenty of at least-- for the first time a source of fuel isn't your biggest concern.","");
break;

beginstate 14;
block_entry(1);
message_dialog("This collapsed stairway once led to somewhere in the tower above. Now it is completely ruined, nothing can come in or out of here except moonlight and cold mountain air.","");
break;

beginstate 15;
if(get_flag(9,4) == 0){
	set_flag(9,4,1);
	activate_hidden_group(3);
	reset_dialog();
	add_dialog_str(0,"It seems that the only thing in this tower that hasn't succumbed to time is the machinery here. It is surprisingly durable, probably moreso than the walls themselves.",0);
	add_dialog_str(1,"And just as at the other magical machinery, a crowd of the strange black creatures has gathered here too.",0);
	add_dialog_str(2,"They reach out with dark tendrils towards the machinery, and a blue-whight glow gathers at the tips and spreads back towards their bodies. You are reminded of a group of diners sharing a soda.",0);
	add_dialog_str(3,"The creatures abruptly cease their 'drinking' when they see you. You remember the drained feeling you had after your last encounter with these creatures, definitely not looking forward to another showdown.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
}
break;

beginstate 16;
if(get_flag(9,6) > 0){
		reset_dialog();
		add_dialog_str(0,"An old control panel sits in the corner of this room. There is a large network of arrows and lights that map out powerflow in the complex.",0);
		add_dialog_str(1,"It's hard to make out the details, since the buttons are mostly smashed and the diagram is faded and hard to read. You press a few buttons experimentally, but nothing happens.",0);
		add_dialog_str(2,"The one switch that does seem to be working is a large lever on the far right of the panel, labeled _Em--gen-y G-te O---ri-e: Of-_",0);
		add_dialog_str(3,"You already hit this switch, not any point in doing so again.",0);
		add_dialog_choice(0,"OK");
		choice = run_dialog(1);
}
if(get_flag(9,6) == 0){
		reset_dialog();
		add_dialog_str(0,"An old control panel sits in the corner of this room. There is a large network of arrows and lights that map out powerflow in the complex.",0);
		add_dialog_str(1,"It's hard to make out the details, since the buttons are mostly smashed and the diagram is faded and hard to read. You press a few buttons experimentally, but nothing happens.",0);
		add_dialog_str(2,"The one switch that does seem to be working is a large lever on the far right of the panel, labeled _Em--gen-y G-te O---ri-e: Enac--d_",0);
		add_dialog_str(3,"At least it is the only switch not snapped off, making it the only control you could actually use. The question is whether you want to.",0);
		add_dialog_choice(0,"Flip it.");
		add_dialog_choice(1,"Leave.");
		choice = run_dialog(1);
		if(choice == 2)
			end();
		if(get_flag(9,3) == 2){
			set_flag(9,6,1);
			flip_terrain(6,17);
			play_sound(99);
			message_dialog("The console in the center of the room sends a spurt of energy into the air, resulting in the sound of rattling machinery coughing and rattling out of their dormancy.","");
		}
		else
			message_dialog("The console in the center of the room sends a spurt of energy into the air. You wait with bated breath, but nothing happens.","Either the machinery just doesn't work, or the energy source isn't strong enough. Neither of the two would be easy to fix.");
}
break;

beginstate 17;
if(get_flag(9,7) > 0){
		reset_dialog();
		add_dialog_str(0,"An old control panel sits in the corner of this room. There is a large network of arrows and lights that map out powerflow in the complex.",0);
		add_dialog_str(1,"It's hard to make out the details, since the buttons are mostly smashed and the diagram is faded and hard to read. You press a few buttons experimentally, but nothing happens.",0);
		add_dialog_str(2,"The one switch that does seem to be working is a large lever on the far right of the panel, labeled _Em--gen-y G-te O---ri-e: Of-_",0);
		add_dialog_str(3,"You already hit this switch, not any point in doing so again.",0);
		add_dialog_choice(0,"OK");
		choice = run_dialog(1);
}
if(get_flag(9,7) == 0){
		reset_dialog();
		add_dialog_str(0,"An old control panel sits in the corner of this room. There is a large network of arrows and lights that map out powerflow in the complex.",0);
		add_dialog_str(1,"It's hard to make out the details, since the buttons are mostly smashed and the diagram is faded and hard to read. You press a few buttons experimentally, but nothing happens.",0);
		add_dialog_str(2,"The one switch that does seem to be working is a large lever on the far right of the panel, labeled _Em--gen-y G-te O---ri-e: Enac--d_",0);
		add_dialog_str(3,"At least it is the only switch not snapped off, making it the only control you could actually use. The question is whether you want to.",0);
		add_dialog_choice(0,"Flip it.");
		add_dialog_choice(1,"Leave.");
		choice = run_dialog(1);
		if(choice == 2)
			end();
		if(get_flag(9,4) == 2){
			set_flag(9,7,1);
			flip_terrain(6,20);
			play_sound(99);
			message_dialog("The console in the center of the room sends a spurt of energy into the air, resulting in the sound of rattling machinery coughing and rattling out of their dormancy.","");
		}
		else
			message_dialog("The console in the center of the room sends a spurt of energy into the air. You wait with bated breath, but nothing happens.","Either the machinery just doesn't work, or the energy source isn't strong enough. Neither of the two would be easy to fix.");
}
break;

beginstate 18;
if(get_flag(9,8) == 0){
	reset_dialog();
	add_dialog_str(0,"You find a bundle of papers wrapped in twine. In the back of this desk they somehow survied the collapse of the surrounding building, the elements, and the years.",0);
	add_dialog_str(1,"The papers are mostly letters between an apprentice mage and various contacts, relatives, and love interests.",0);
	add_dialog_str(2,"The letters to relatives and love interests you find fairly uninteresting, but some letters addressed to what seems to be an old mentor catch your eye.",0);
	add_dialog_choice(0,"Take them.");
	add_dialog_choice(1,"No time. Put them aside.");
	choice = run_dialog(1);
	if(choice == 2)
		end();
	reward_give(457);
	set_flag(9,8,1);
}
break;

beginstate 19;
reset_dialog();
add_dialog_str(0,"This book is blank. Not destroyed like most of this tower is, or left unreadable by age and decay as is expected of hundred year old paper. The pages are simply blank, as though erased without a mark left behind.",0);
add_dialog_str(1,"For obvious reasons this makes it less than useful. However, when you lift the large tome from the pedestal you find a small black journal beneath.",0);
add_dialog_str(2,"You blow off some dust and crack open the cover. The owner was a wizard by the name of Gavriel, who worked in the research facilities of this tower.",0);
add_dialog_choice(0,"Open it.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Radiane 23 of the Year 618",0);
add_dialog_str(1,"Of late it feels like the staff is in a great tug of war. On one side stands Dr. Hidal and his team, on the other side stands Wizard Lyonel, each pulling for a greater portion of the budget from Director Jamison.",0);
add_dialog_str(2,"Our landlords above have actually taken some notice of us, and have recognized the great potential of Cryoprev by making it standard issue for all miners and soldiers. A huge success for our team, and Dr. Hidal in particular.",0);
add_dialog_str(3,"So for now, at least, the matter seems settled. Project 131 is getting increased funding and staffing, as Cryoprev fever seems to be spreading through the facilities. Everybody feels we are on the verge of something great.",0);
add_dialog_str(4,"Lyonel is the lone exception; he continues to work tirelessly on his 'Disruptors.' The man is undoubtedly a genius and his passion is admirable. A pity both projects can't continue.",0);
add_dialog_str(5,"At least now I won't have to see him walking those monstrosities through the facilities. All his talk about inverted fields and electromagnetic sensitivity do nothing to change the fact that his creations give people the willies.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
set_flag(15,3,1);
reset_dialog();
add_dialog_str(0,"Empire 10 of the Year 618",0);
add_dialog_str(1,"Deaths and lost limbs have decreased among the miners by 75% since Cryoprev was introduced as standard issue. The directors above are ecstatic; with winter coming this is great news.",0);
add_dialog_str(2,"It's kind of hard to believe that it even works. The function of Cryoprev is that it massively accelerates the metabolism, burning all fat, food and energy reserves into almost pure heat.",0);
add_dialog_str(3,"With a steady supply of nutrtion, even the most frostbitten miner can recover.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
set_flag(15,2,1);
reset_dialog();
add_dialog_str(0,"Icefall 10 of the Year 618",0);
add_dialog_str(1,"If there is anything an alchemist learns first it's that accelerating a reaction isn't necessarily a good thing. Our research on glowing nettle has been insufficient, and now it seems our overzealousness is coming back to haunt us.....",0);
add_dialog_str(2,"But I get ahead of myself. Some startling and disturbing events have transpired since I last wrote. We originally learned the Cryoprev recipe from a native tribe, and immediately saw its potential for treatment of freeze and frostbite victims.",0);
add_dialog_str(3,"While it did a remarkable job of preventing frostbite and hypothermia, it had relatively little value in treating symptoms that had already developed. Add a catalyst, and bam-- you've got Croprev.",0);
add_dialog_str(4,"Glowing nettle is hardly just any catalyst, and we weren't fool enough to mix it into a brew without caution. The amounts were carefully observed and calculated.",0);
add_dialog_str(5,"But alas, we just didn't know enough! In light of the recent deaths, Cryoprev has been pulled from all clinics and all doses recalled. The team is working overtime to figure out what went wrong, but it looks grim.",0);
add_dialog_str(6,"We walk the hallways like zombies, I haven't slept in days. We even convinced Lyonel to put aside his Disruptors to aid us, fate knows we need some fresh perspective.",0);
add_dialog_str(7,"I am going to get some sleep now, before I collapse.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Icefall 22 of the Year 618",0);
add_dialog_str(1,"Project 131 has been put on ice for now. Despite Dr. Hidal's pleas, the Director has made his decision. Hidal was crushed, and has lost a great deal of respect around here, but Cryoprev just wasn't salvagable.",0);
add_dialog_str(2,"All spare labor and resources have been shifted to Lyonel's project. He has accepted graciously the aid of those who once scorned his work. Now that I've set aside my revulsion for the creatures, these Disruptors have become strangely fascinating.",0);
add_dialog_str(3,"A biological creature capable of absorbing, indeed LIVING, off of magical energy-- the idea is as practcal as it is novel.",0);
add_dialog_str(4,"While we were all working on developing Cryoprev, Lyonel has been working tirelessly with these creatures. He moved his quarters to be adjacent to his work area, and ever since he's practically lived in the lab.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Empire 1 of the Year 619",0);
add_dialog_str(1,"Big news. Due to the declining yield of the mines, and the Cryoprev incidents, the mines have been deemed unprofitable. Without the mines to protect, the Empire no longer needs a presence in the Rim, and Amon Sul serves no purpose.",0);
add_dialog_str(2,"We in the research facilities, however; have evolved into our own entity seperate from the opperation above. Most of our researchers have elected to stay behind to work independently.",0);
add_dialog_str(3,"This means that we will no longer receive any Imperial funding. But every cloud has a silver lining, and although we've lost the majority of our funds, we no longer have to fritter away our time on mining projects.",0);
add_dialog_str(4,"All our efforts have been turned towards the Disruptor project. The creatures have come a long way in terms of stability, strength and intelligence, but I still can't look at them without shivering.",0);
add_dialog_str(5,"Lyonel has been raving about their sensitivity to magical and electric forces, but we hadn't come up with a good way to test it until just yesterday. We put a disruptor, a wizard, and our machinery for detecing magic fields.",0);
add_dialog_str(6,"The wizard, Bernard, prepared a small spell. Sure enough the Disruptor detected the nearly imperceptible energy gathering around Bernard before the machinery could. Astounding!",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Frost 3 of the Year 619",0);
add_dialog_str(1,"After a flurry of activity these last months, the Disruptor project nears completion. The creatures' sensitivity and absorption abilities have become phenomenal.",0);
add_dialog_str(2,"The only thing that holds the project back is Lyonel's insistence on trying to engender higher intelligence in the creatures. So far the best we've attained is the ability to solve simple puzzles, and recognize patterns.",0);
add_dialog_str(3,"Disappointing, but Lyonel insists they are only a few tweaks away from sentience. When you look in their small, glassy eyes you can't help but feel on some level that they're already there. They seem to stare into your very mind.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Frost 29 of the Year 619",0);
add_dialog_str(0,"We are almost ready to go public with our Disruptor project, which has brought up some controversial questions. Firstly, and most important to an all wizard research team, is 'What if this technology fell into the wrong hands?'",0);
add_dialog_str(1,"The creatures are completely impervious to magic, and can detect a caster from miles away. Wizards would be completely helpless against a Disruptor, and hiding from one would mean giving up casting magic forever.",0);
add_dialog_str(2,"The disturbing question was first spoken aloud a few days ago. Although now that it's come to the surface I realize that this is, in some part, what was so repulsive about the creatures from the start.",0);
add_dialog_str(3,"The 'mage hunter' idea has us all on edge, and has caused heated debate. Lyonel wants to carry on, but general oppinion is beginning to turn against him. Everybody is at each other's throats.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Evermoon 13 of the Year 619",0);
add_dialog_str(1,"A dozen wizards left in disgust yesterday; this Disruptor issue is tearing us apart. They'd been threatening to depart for weeks, in an attempt to convince Lyonel to abandon the project.",0);
add_dialog_str(2,"I don't know what this means for our facilities as a whole. The departure of some of Lyonel's most outspoken opponents hasn't improved the mood here at all. Nobody has done any work in a month.",0);
add_dialog_str(3,"We can't even look at a Disruptor without cringing. The creatures have been placed in stasis for now.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Evermoon 21 of the Year 619",0);
add_dialog_str(0,"This is it, the end of our dream. Director Jamison has decreed the facilities are to be shut down, and even more importantly Wizard Lyonel, who holds more power than anyone here, has finally assented.",0);
add_dialog_str(1,"All our notes, logs, and reports are to be wiped-- stricken from the record like they never existed. Wizards have already started departing, one at a time at first, but gradually growing to a steady flow.",0);
add_dialog_str(2,"Lyonel hasn't taken it well. The duty has fallen to him to destroy the Disruptors once and for all. I had my doubts whether he could even do it, burn the years of work, but I believe now that he will do what needs to be done.",0);
add_dialog_str(3,"Personally, I await with anticipation the day I have scheduled to leave. Anything to get away from those horrible creatures' gaze. They are out of sight in their stasis cells, but as long as I remain here they won't be out of mind.",0);
add_dialog_choice(0,"The jounral ends here.");
choice = run_dialog(1);
	end();
break;

beginstate 23;
if(get_flag(9,10) > 0)
end();
set_flag(9,10,1);
if(get_flag(255,2) == 0)
	message_dialog("For a magical item storage room in what appears to be a highly sophisticated facility, these rooms' contents have been quite disappointing. The anteroom you now step into is ringed with faded runes, no doubt to protect its contents.","A longsword rests on the table in the middle of the room. It emits a strange glow-- somehow this sword escaped all the magic draining creatures that infest this place!");

else
	message_dialog("For a magical item storage room in what appears to be a highly sophisticated facility, this room's contents are quite disappointing. The anteroom you now step into is ringed with faded runes, no doubt to protect its once precious contents.","Now all you see is an ordinary sword. You're no magic buff, but you can tell an enchanted blade from junk, this is the latter. It seems that those tentacled creatures somehow drained all these items.");
break;

beginstate 24;
reset_dialog();
add_dialog_str(0,"A lever protrudes from the ground here, another relic of this age old tower that has somehow survived the wear and tear of the years. The sign over the lever reads: _Stor-ge Ac-es-_",0);
add_dialog_str(1,"You don't really expect it to work, but that doesn't mean you can't pull it anyhow. What do you do?",0);
add_dialog_choice(0,"Pull it.");
add_dialog_choice(1,"Leave.");
choice = run_dialog(1);
if(choice == 2)
	end();
play_sound(99);
flip_terrain(9,58);
flip_terrain(12,58);
flip_terrain(15,58);
flip_terrain(4,40);
break;

beginstate 25;
reset_dialog();
add_dialog_str(0,"A faded tome sits upon this pedestal. You flip through it, hoping to find a plethora of interesting recipes and ingredient uses that one could only find in a high tech laboratory. You find--- mostly unreadable pages.",0);
add_dialog_str(1,"One page catches your eye, for the sole reason that it can actually be read. It is a theoretical recipe that would put the Karao blossoms' magical potency to healing purposes.",0);
add_dialog_str(2,"The disturbing word here is 'theoretical.' Apparently the researchers' superiors weren't confident enough in his recipe to grant him the valuable Karao blossoms, which were being put to some other use deemed more important.",0);
add_dialog_str(3,"Theoretical or not, a recipe is a recipe. You scribble it down, hoping this researcher didn't accidentally make a laxative, hair shedding formula, or some other undesirable.",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);
set_flag(240,5,1);
break;

beginstate 26;
reset_dialog();
add_dialog_str(0,"This tome is a journal and research log kept by a man by the name of Lyonel, who apparently was an important researcher here.",0);
add_dialog_str(1,"The words are written in scratchy, spidery handwriting, and to make matters worse the pages are old and faded. It is, however, still legible with some effort. Everything seems intact, just not necessarily clear.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Evermoon 30 of the Year 616",0);
add_dialog_str(1,"I observed an interesting phenomenon in the laboratory this evening. I was invited down to observe a demonstration of a field inversion, a rather novel practice that was basically stumbled on during an antimagic field mishap.",0);
add_dialog_str(2,"A normal magic field, as we know, is a heavy concentration of magical energy in an area. So heavy that it takes on a physical presence, whether in the form of heat, electricity, or just raw magical force.",0);
add_dialog_str(3,"An inverted field, however; is not the presnece of magical energy, but rather the complete absence of it. Energy in the area is drawn to the low concentration to fill the gap.",0);
add_dialog_str(4,"Apparently some misinformed wizard attempted to create an antimagic field by draining all the magic from an area, rather than simply disrupting spells by putting 'static' energy in an area.",0);
add_dialog_str(5,"The result was an inverted field, which earned the poor chap a nasty headache. The demonstration I saw was more stable than that first accident, but still unimpressive since the field quickly drained the source maintaining it and collapsed.",0);
add_dialog_str(6,"However, the theory is that a sustained inverted field would draw an unlimited source of energy, significantly greater energy than was put into the system to begin with. It seems a solid enough idea to me.",0);
add_dialog_str(7,"Unfortunately theory and reality don't seem to be seeing eye to eye here.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Rememberance 2 of the Year 617",0);
add_dialog_str(1,"The researchers working on the inverted fields seem no closer to putting it to any useful purpose. They established a field inversion, and then linked it to some machinery in an attempt to keep the field at a permanent level of zero energy.",0);
add_dialog_str(2,"Well technically it worked. The field pulled in energy, which the machinery consumed just as quickly, creating a constant state of zero energy in the field.",0);
add_dialog_str(3,"Unfortunately, it would take a few centuries of draining to recoup the energy required to establish the field, and another few centuries to gather enough energy to do anything useful with it.",0);
add_dialog_str(4,"Relying on free energy in the air just isn't efficient, the concentration isn't high enough to do anything. When the same machine was placed near a field generator or fed by a researcher, it powered the attached piston easily.",0);
add_dialog_str(5,"Unfortunately doing that is just moving energy from one piece of machinery to another, not actually harnessing new energy. Proposed ideas for batteries, wands, and other items don't seem any more promising.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Rememberance 14 of the Year 617",0);
add_dialog_str(1,"I'm still between projects, so I've been floating around the facilities the last few weeks. Today I floated into Wizard Torvald's lab, one of our most respected biologists, and brought up the inverted fields to him.",0);
add_dialog_str(2,"We started discussing various ways it could prove useful, since the researchers' dreams of a perpetual motion machine or mobile power generator was proving to be just that-- a dream.",0);
add_dialog_str(3,"We came up with some interesting ideas, but most weren't practical. It wasn't until Torvald mentioned in passing the concept of a creature that radiated inverted fields that things really got ineresting.",0);
add_dialog_str(4,"I asked him if it were possible, a creature that lived in such a volatile field, constantly absorbing energy from its surroundings. He said he couldn't see why not. This certainly bears thinking about, I can feel a great idea forming already.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Rememberance 16 of the Year 617",0);
add_dialog_str(1,"After another enlightening conversation with Torvald, I made up my mind to pursue our idea. Even a discouraging conversation with Wizard Andrews, the head of the team researching field inversions, has not dissuaded me.",0);
add_dialog_str(2,"I will pursue this idea even if I must do so on my own, since Andrews remains intent on the perpetual motion idea. I checked out every biology tome in the library and have been studying them tirelessly.",0);
add_dialog_str(3,"I am too excited to sleep, taking a break to write this entry is the only rest I will afford myself. I must put the pen down now, Beckett's _Chemotrophs and Cellular Respiration_ calls to me.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Leafloss 5 of the Year 617",0);
add_dialog_str(1,"I believe that I finally have the design for the inversion-powered creature. With the help of Torvald I have the creature's cellular structure mapped out.",0);
add_dialog_str(2,"The frame and shape the creature will take is that of a human, only slightly altered for some new organs specifically designed to be able to establish and hold an inverted field. I'm going to construct it tomorrow, hopefully all goes well.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Icefall 4 of the Year 617",0);
add_dialog_str(1,"I finally have a living Disruptor, as I have dubbed my creation. It only took a few dozen tries, but it's done. I am looking at the batch of disruptors floating in their nourishment cells even as I write this-- magnificent!",0);
add_dialog_str(2,"Tomorrow I wil disconnect one from the power feed that is sustaining them. If I was truly successful it will be able to live off energy absorbed from external sources, like machinery or even spells.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Icefall 5 of the Year 617",0);
add_dialog_str(1,"Failure. The first disruptor I removed from it's tank died in a matter of minutes, once cut off from its power source.",0);
add_dialog_str(2,"For later specimens I brought large generators from which they could draw energy. The result was even worse, ranging from bursting into flames to simply collapsing. The uneven energy flow is too much, even a small spike in power will kill one.",0);
add_dialog_str(3,"I lost the entire batch this way, and now I'm back to the drawing board. This design is flawed, and I can't sleep until I fix it.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Icefall 23 of the Year 617",0);
add_dialog_str(1,"Batteries! In retrospect the idea is so obvious, but for days it eluded me. After failed attempt after failed attempt, I have struck on the solution.",0);
add_dialog_str(2,"The disruptors need battery cells to store energy, so that they can live away from a source of magic for extended times. Also it can serve as a capacitor to keep spikes in energy from destroying the creature.",0);
add_dialog_str(3,"I'll have to start all over from the ground up, since the humanoid body type doesn't allow any room for the large battery-organs I have in mind. I have a lot of work ahead.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
set_flag(15,3,1);
reset_dialog();
add_dialog_str(0,"Evermoon 34 of the Year 617",0);
add_dialog_str(1,"It worked! My hand shakes as I write this, I am so excited. My disruptor will win no beauty contest, but it is completely functional, and will survive independent of its nourishment cell!",0);
add_dialog_str(2,"I need to celebrate, I need to tell Torvald. No time for writing.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Rememberance 12 of the Year 618",0);
add_dialog_str(1,"Last week I showed my findings to Director Jamison and some other select researchers. The disruptor knocked him off his feet.",0);
add_dialog_str(2,"He assigned some researchers to my project, and granted me the use of Lab 3 for use in my work. Finally I have some decent equipment and some manpower to perform more menial tasks. A great triumph, but there is more to be done.",0);
add_dialog_str(3,"And I swear, if another person asks me why my disruptors must be 'so disfigured' or some such nonsense, I'll snap.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Radiane 3 of the Year 618",0);
add_dialog_str(1,"Director Jamison hasn't been by the lab in weeks, it seems everybody is much more interested in the Cryoprev project than those 'hideous' disruptors.",0);
add_dialog_str(2,"Three of my staff have been reassigned to the Cryoprev project already. Despite all the work we've done, we go unappreciated. I will have a conference with Jamison tomorrow.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Radiane 22 of the Year 618",0);
add_dialog_str(1,"Cryoprev, that's all I hear when I walk the hallways. The drug was used to treat some miners that were rescued after days in the cold, and they all recovered. Now the stuff is the greatest thing since sliced bread apparently.",0);
add_dialog_str(1,"Jamison as much as told me yesterday that, in light of Cryoprev's amazing potential, I'd be on my own again as everybody is being reassigned. I begged him to let me keep my lab, and he eventually conceded.",0);
add_dialog_str(2,"After all I've done, all my success, all my hard work, this is what I'm reduced to-- begging for lab space.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	set_state_continue(40);
reset_dialog();
add_dialog_str(0,"Empire 4 of the Year 618",0);
add_dialog_str(1,"The recent adversity has only strengthened my resolve to succeed. My ideas are sound, the disruptors will be a success.",0);
add_dialog_str(2,"I've moved my quarters to be adjacent to my lab, and I have hardly even took the brief time to leave the lab to sleep, I've just put my head down and grabbed brief rests here and there.",0);
add_dialog_str(3,"This will be my last entry for a while, my schedule does not allow for it.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	set_state_continue(40);
set_flag(15,2,1);
reset_dialog();
add_dialog_str(0,"Icefall 22 of the Year 617",0);
add_dialog_str(1,"I'd heard reports that something had gone wrong above, something to do with the Cryoprev, but hadn't paid it any more heed than any other news that somehow reaches me here in my isolated lab.",0);
add_dialog_str(2,"But apparently it was quite serious. Jamison called me to my office to pitch my disruptor idea again, apparently he was actually ready to scrap the Cryoprev project.",0);
add_dialog_str(3,"Either I'm a great salesman or he simply had no alternative, because I now have half the facility working for me. They have a lot of catching up to do, the disruptors have progressed by leaps and bounds these last months.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	set_state_continue(40);
reset_dialog();
add_dialog_str(0,"Empire 1 of the Year 619",0);
add_dialog_str(1,"Just when my research team was finally getting used to working together, and actually knowledgable enough about the subject matter to be of use, something goes and disrupts everything.",0);
add_dialog_str(2,"Finally we've gotten beyond the stage where everybody is amazed by the disruptors' most insignificant accomplishments-- I guess they all assumed I was twiddling my thumbs while they were working on Cryoprev-- anyway, I digress.",0);
add_dialog_str(3,"The mines above us have closed, and the Empire has departed. It seems most of the researchers are going to remain behind, and this means that just about everybody once assigned to mining projects is now working for me.",0);
add_dialog_str(4,"Oh well, more 'Oooohs' and 'Aaahhhs' over a creature that can absorb a fireball. Maybe in a month the newcomers will be doing something useful as well.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	set_state_continue(40);
reset_dialog();
add_dialog_str(0,"Leafloss 15 of the Year 619",0);
add_dialog_str(1,"The disruptors' absorption and magical sensitivity has reached the point where I honestly believe no improvement to be possible. I've left the others in charge of any more advances in this area, and am myself looking into more important matters.",0);
add_dialog_str(2,"Specifically- intelligence. The creatures' brain structure is not particularly developed, but I think with training and a little more biological engineering higher intelligence is possible.",0);
add_dialog_str(3,"This means I've spent a lot of time with my 'children' as I've started to think of them, pitting them against various puzzles.",0);
add_dialog_str(4,"They can solve problems and obey the orders we feed them via magic waves, but they can't communicate back, or display any reasoning or feelings.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	set_state_continue(40);
reset_dialog();
add_dialog_str(0,"Frost 32 of the Year 619",0);
add_dialog_str(1,"We are so close. Without thinking I mentioned last week about going public with our findings, and since then the place has been abuzz with it. Now, however, one more roadblock has appeared, this one seemed so trivial.",0);
add_dialog_str(2,"The issue of how much danger the disruptors pose to use, as wizards, arose. I assured everybody that they are completely loyal, but then the issue of 'But WHO are they loyal to' arose.",0);
add_dialog_str(3,"I have tried to put these fears to rest, but they keep surfacing.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	end();
reset_dialog();
add_dialog_str(0,"Evermoon 14 of the Year 619",0);
add_dialog_str(1,"Things have reached a breaking point, everyone is weary of one another, and even more weary of the disruptors. I had to agree to place them in stasis for now, or I'd be facing open rebellion.",0);
add_dialog_str(2,"I refuse to give up. Others can come or go as they please, I will stay regardless.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	set_state_continue(40);
reset_dialog();
add_dialog_str(0,"Evermoon 17 of the Year 619",0);
add_dialog_str(1,"My hands are still shaking, I can hardly believe what just happened.",0);
add_dialog_str(2,"I was administering the logic tests to a specimen as usual, just for the sake of escaping from the conflict and returning to my routine of the last few months.",0);
add_dialog_str(3,"I was allowing my thoughts to wander, I wasn't at all focused. Then, suddenly, I realised that I was still conducting the logic tests- I hadn't been sending the instructions via our wave emitter, but I was conducting them nonetheless.",0);
add_dialog_str(4,"That wasn't the odd thing, though. It was that the disruptor was still answering the questions, how it knew the commands I don't know, but I jumped up and left immediately. I can hardly write I'm so jittery.",0);
add_dialog_str(5,"I should have foreseen it. The creatures are so intuned to energy waves, magical or electric, that they can sense brain waves. I don't know how accurately they can do it, or if the perceived 'mind reading' was really just my imagination.",0);
add_dialog_str(6,"No, I have to call off the project. I won't tell anybody why, it'd cause a panic, I'll tell Director Jamison that I agree with the others and the project is off. It wasn't my imagination, I'm sure it happened.",0);
add_dialog_choice(0,"Read On.");
add_dialog_choice(1,"No time. Put it aside.");
choice = run_dialog(1);
if(choice == 2)
	set_state_continue(40);
reset_dialog();
add_dialog_str(0,"Evermoon 30 of the Year 619",0);
add_dialog_str(1,"Everybody has departed. I am alone here, alone with the disruptors. I have been struggling to decide what to do since that day in the lab.",0);
add_dialog_str(2,"After all I've done-- all the work, sacrifice, sleepless nights-- how can I destroy the creatures I started thinking of as my 'children'? I can't, but I have to. That is my dilemna.",0);
add_dialog_str(3,"There is nothing for it but to destroy them. I am going to the stasis cells to see them one last time, to see the creations that I did too good a job at. That I made so good they're dangerous. But I will destroy them.",0);
add_dialog_choice(0,"The journal ends here.");
choice = run_dialog(1);
	set_state_continue(40);
break;

beginstate 27;
if(get_flag(9,22) == 0){
	reset_dialog();
	add_dialog_str(0,"You walk down the aisle, rows of machinery and strange glass cases flank you on either side.",0);
	add_dialog_str(1,"Broken glass from smashed cases litters the floor. Bits of bone and fur are strewn on top of the thin layer of snow that has fallen through a crack in the ceiling.",0);
	add_dialog_str(2,"From the far end of the room comes a faint pulsing light, the only machinery still working here. You stagger towards it, feeling your strength fade with each passing second, and the ever spreading blackness creeping up your legs.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	set_flag(9,22,1);
}
break;

beginstate 28;
if(get_flag(9,11) > 0)
	end();
reset_dialog();
add_dialog_str(0,"This alone, of all the cases that line the room, has survived. A vial is suspended within, floating in a blue watery substance that glows from the energy flowing through it from the nearby machinery.",0);
add_dialog_str(1,"The plaque on the lid of the case reads: _Cryoprev Batch 19: For use in preventing and treating frostbite and hypothermia: RECALLED_",0);
add_dialog_str(2,"You stare into the bubbling contents of the case, this is obviously a batch of medicine, and from the plaque you'd gather that it would be exactly what the group is looking for right now.",0);
add_dialog_str(3,"A strong blow could smash this case-- even in your present state you could muster the strenght to break it. Do you?",0);
add_dialog_choice(0,"Open it.");
add_dialog_choice(1,"Leave.");
choice = run_dialog(1);
if(choice == 2)
	end();
set_terrain(6,1,137);
play_sound(70);
change_spec_item(0,1);
reset_dialog();
add_dialog_str(0,"You step back, and swing your sword at the case with all your might. The glass was thick, but it was still just glass. With a tinkling smash you send glass spraying through the room.",0);
add_dialog_str(1,"The gelatinous liquid within spills out, leaving a small vial and a hypodermic syringe behind. You reach in with trembling hands to pull them out.",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);

reset_dialog();
add_dialog_str(0,"You hold the vial up to your eyes, trying to read the label in the dark.",0);
add_dialog_str(1,"_Cryoprev: For the treatment of frostbite and hypothermia._",0);
add_dialog_str(2,"_Directions: Cryoprev is intended for injection into the afflicted limb or area. Do NOT inject Cryoprev in the chest or neck. For proper absorption Cryoprev is not to be swallowed, or applied in any way save directly into the bloodstream.",0);
add_dialog_str(3,"_Warnings: Cryoprev accelerates the metabolism of energy reserves into heat, for this reason significantly underweight patients are not to use Cryoprev. Patients diagnosed with high blood pressure should not....",0);
add_dialog_str(4,"_Side Effects: Not to be taken on an empty stomache..... not to be...... may result in....",0);
add_dialog_str(5,"Your vision blurs as you try to read the label, your legs are numb, your head is fuzzy, so cold- so cold...",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);
play_sound(29);
set_character_pose(i,14);
force_instant_terrain_redraw();
reset_dialog();
add_dialog_str(0,"What happened? Why are you on the ground? You must have fallen, your legs can no longer hold you, even your mind seems numb. You just want to sleep. You'll never be able to stand again, to reach the fire and the others...",0);
add_dialog_str(1,"Slowly a thought floats to the surface of your cold-numbed brain. The vial-- the medicine. What did the label say? _For the treatment of frostbite and...._",0);
add_dialog_str(2,"_Directly into the bloodstream...._ With fumbling hands you take out the syringe, and punch it through the top of the vial. You nearly drop it in the process, but somehow you manage to extract a dose of the Cryoprev.",0);
if(get_flag(15,2) == 1){
	add_dialog_str(3,"You don't remember reading exactly what it was that went wrong with this drug-- it was supposed to be a miracle worker but instead it wound up recalled.",0);
	add_dialog_str(4,"_For injection into the afflicted limb..._ Whatever the reason for the recall, it can't be worse than the inevitable death you face now. You roll back the leg of your pants, and cringe at the swollen and blackened limb.",0);
	add_dialog_str(5,"You plunge the needle into your deadened calf, but feel nothing.",0);
}
else{
	add_dialog_str(3,"_For injection into the afflicted limb..._ You aren't fool enough to use an unknown drug, but what choice do you have? You face inevitable death, no side effect can be worse than that.",0);
	add_dialog_str(4,"You roll back the leg of your pants, and cringe at the swollen and blackened limb. You plunge the needle into your deadened calf, but feel nothing.",0);
}
add_dialog_choice(0,"OK");
choice = run_dialog(1);
pause(15);
reset_dialog();
add_dialog_str(0,"How long you lay there you don't know. The only feeling you have is of the cold air, and the dripping of liquid from the smashed Cryoprev case.",0);
add_dialog_str(1,"Then you feel something strange-- heat. Your right leg tingles with warmth-- tingles? You grab your leg, and miracles of miracles, you can feel the pressure of your hand!",0);
add_dialog_str(2,"Your hands shake with excitement as you draw another dose into the syringe, and again plunge it into deadened muscle, this time your left leg.",0);
add_dialog_str(3,"You stagger to your feet. You are weak, you are hungry, you are near to collapse, but you are actually-- warm. No drug can give you energy you don't have, but the Cryoprev has given you use of your stubborn legs again.",0);
add_dialog_str(4,"You need to get this to your friends, before you collapse from exhaustion again.",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);
set_character_pose(i,0);
force_instant_terrain_redraw();
set_flag(9,11,1);
erase_char(33);
erase_char(34);
set_flag(254,0,0);
set_flag(254,1,0);
inc_flag(254,2,-2);
set_flag(254,3,0);
activate_hidden_group(4);
break;

beginstate 29;
if((get_flag(9,11) > 0) && (get_flag(9,12) == 0)){
	block_entry(1);
	set_flag(9,12,1);
	reset_dialog();
	add_dialog_str(0,"You stumble into your campsite to find that your comrades have already returned from their excursions, and now are sprawled around the fire munching on hardtack.",0);
	add_dialog_str(1,"Fabian is the first to spot you. _Vincent! We were starting to think you'd never-- Vincent?_ You see concerned faces gathered around you, but their words are just a buzz. Your head is spinning, the room and the blurred faces spin with it.",0);
	add_dialog_str(2,"Somebody shouts as your legs collapse, sending you crumpling to the ground. In your foggy stupor only one thing occurs to you as you fall, don't break the Cryoprev.",0);
	add_dialog_str(3,"You stammer out an explanation of your discovery, your mouth working independently of your brain. You feel yourself laid down on a mat, you feel the heat of the fire.",0);
	add_dialog_str(4,"You don't feel the prick of the needles, but from the words of the people hovering over you, you know they must be sliding into your skin. _His arms-- they're nearly black!..... Careful with.... Hold his...._",0);
	add_dialog_str(5,"And then the blackness of unconsciousness slides over you, and the muffled, hardly coherent voices fade altogether.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	relocate_character(i,55,48);
	force_view_center(55,48);
	set_character_pose(i,14);
	force_instant_terrain_redraw();
	pause(25);
	reset_dialog();
	add_dialog_str(0,"You fall into a deep dreamless sleep. How long you lay there you don't know, but eventually you must push away the comfort of the darkness and awake.",0);
	add_dialog_str(1,"You awake in a dim room, lighted only by the sunlight that filters through the slivers in the roof. You lay for a while with your eyes closed, trying to feel and assess each square inch of your body.",0);
	add_dialog_str(2,"Amazing that you're still alive, let alone feeling so-- healthy. You feel warm, you feel, fresh, you feel like you could run a mile! You also feel... uneasy. You snap open your eyes and climb to your feet, wondering why the room is so silent.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	play_sound(20);
	erase = 6;
	while(erase <= 11){
		erase_char(erase);
		erase = erase + 1;
	}
	put_stain_on_space(30,49,1);
	put_stain_on_space(30,51,1);
	put_stain_on_space(30,53,2);
	put_stain_on_space(30,54,1);
	put_stain_on_space(31,50,2);
	put_stain_on_space(31,52,3);
	put_stain_on_space(32,51,3);
	put_stain_on_space(33,50,2);
	put_stain_on_space(33,53,2);
	put_stain_on_space(33,54,2);
	put_stain_on_space(34,49,3);
	put_stain_on_space(35,49,2);
	put_stain_on_space(35,51,2);
	put_stain_on_space(32,56,1);
	put_stain_on_space(32,58,1);
	put_stain_on_space(32,60,1);
	put_stain_on_space(34,61,1);
	put_stain_on_space(35,53,3);
	put_stain_on_space(36,53,1);
	put_stain_on_space(37,61,1);
	put_stain_on_space(38,71,1);
	set_terrain(32,52,137);
	set_terrain(31,53,269);
	set_terrain(32,50,269);	
	set_terrain(35,53,269);
	set_terrain(33,54,269);
	set_terrain(35,49,269);
	set_character_pose(i,0);
	force_instant_terrain_redraw();
	pause(5);
	reset_dialog();
	add_dialog_str(0,"You scramble to you feet in the darkness, almost slipping on a slick spot on the floor. You bend down and run your finger through it, when you hold it to your face you can identify it easily-- blood.",0);
	add_dialog_str(1,"By this time your eyes have adjusted to the darkness, allowing you your first look at the scene around you. The charnel house around you.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	pause(5);

	relocate_character(i,34,52);
	force_view_center(34,52);
	force_instant_terrain_redraw();
	pause(8);

	reset_dialog();
	add_dialog_str(0,"Blood is splattered all across the floor. Mangled bodies lie about the room. And somehow, you are lying right in the middle of it all, and don't even remember any fight.",0);
	add_dialog_str(1,"You allow your eyes to roam over the lurid scene, hardly blinking in your attempt to take in everything, to somehow understand what happened here.",0);
	add_dialog_str(2,"You remember nothing, just the deep sleep. Then, suddenly, a cacophany of screaming voices fills your head. Sounds of fighting, then suddenly a great pain in your leg. Fabian shouts.... then nothing.",0);
	add_dialog_str(3,"You inspect your leg where the remembered pain was, and find a large scar running down your right thigh. A bite mark? There is little doubt what did this, but when? How? Why were you left alive?",0);
	add_dialog_str(4,"The elation you felt at being restored to health is long gone, replaced by a stony, silent, melancholy. You don't weep, you don't mourn for your friends, you don't feel regret or sorrow.",0);
	add_dialog_str(5,"You stand covered in dried blood, but don't even care enough to wash it off. You lick your dried lips and the metalic taste fills your mouth.",0);
	add_dialog_str(6,"A thought floats up from the foggy depths of your mind, telling you you're in shock. You ignore it, all that is left is a slow, burning hatred. You cross over to one of the bodies in unfeeling silence.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	set_flag(254,5,0);
	set_ticks_forward(5800 - get_current_tick());
	change_spec_item(0,-1);
	revive_party();
	}
break;

beginstate 31;
//burden
if(get_flag(9,12) == 0){
	block_entry(1);
	end();
}
	reset_dialog();
	add_dialog_str(0,"Seargent Burden lies here in a pool of her own blood. Her neck is turned at an awkward angle, and her body has been savaged, seemingly by large teeth and claws.",0);
	add_dialog_str(1,"Your leader, your party's beacon, lies dead. She never lost hope, and perhaps she was right-- afterall, Cryoprev could have saved the rest as it did you. She rose to the occasion and kept you all going through adversity. But for what?",0);
	if(get_flag(9,13) == 0)
		add_dialog_str(2,"In her hand is the vial of Cryoprev, the elixir that could have saved you all-- would have saved you all had it not been for the Beast. It's empty now, but you pocket it anyhow.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
if(get_flag(9,13) == 0){
	set_flag(9,13,1);
	inc_flag(9,18,1);
	change_spec_item(0,1);
}
break;

beginstate 32;
//adrianna
if(get_flag(9,12) == 0){
	block_entry(1);
	end();
}
	reset_dialog();
	add_dialog_str(0,"Adrianna's clothes are ripped and tattered, as is the flesh beneath them. Her mouth and eyes are open in a wordless scream, frozen that way forever.",0);
	add_dialog_str(1,"She got what she came here for, a shot at the Beast, but she didn't get her revenge. Perhaps nobody can stand up to the thing, but you'll try. You too are hunting for revenge, now.",0);
	if(get_flag(9,14) == 0)
		add_dialog_str(2,"You shut here eyes carefully.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
if(get_flag(9,14) == 0){
	set_flag(9,14,1);
	inc_flag(9,18,1);
}
break;

beginstate 33;
//Jamie//
if(get_flag(9,12) == 0){
	block_entry(1);
	end();
}
if(get_flag(9,15) == 0){
	set_flag(9,15,1);
	inc_flag(9,18,1);
}
	reset_dialog();
	add_dialog_str(0,"Jamie lies where he fell, hurled there by some great force. His bow lies beneath him, broken by the force of his fall.",0);
	add_dialog_str(1,"A peasant in a soldier's world, the man most familiar with this land but least familiar with the task your came here for. He died like a soldier, even if he hadn't lived as one until this week.",0);
	add_dialog_str(2,"He is no longer here to fight for Manibor and it's inhabitants, but you can finish the Beast in his stead.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
break;

beginstate 34;
//ainsley//
if(get_flag(9,12) == 0){
	block_entry(1);
	end();
}
if(get_flag(9,16) == 0){
	set_flag(9,16,1);
	inc_flag(9,18,1);
}
	reset_dialog();
	add_dialog_str(0,"Captain Ainsley lies on the floor, his body mutilated and his face almost unrecognizable. You only pick him out because of his distinctive officer's armor.",0);
	add_dialog_str(1,"He wanted you to carry on, to finish what you came here for even if he was to weak to help. That was who Ainsley was, duty first, self second.",0);
	add_dialog_str(2,"Did the Cryoprev help him recover so he could face down his foe, or did he die in his feverish sleep? You will never know. He wouldn't have cared whether he died with 'honor', that wasn't what he was about. But none can deny he lived honorably.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
break;

beginstate 35;
//evrey//
if(get_flag(9,12) == 0){
	block_entry(1);
	end();
}
if(get_flag(9,17) == 0){
	set_flag(9,17,1);
	inc_flag(9,18,1);
}
	message_dialog("Private Evrey lies on the ground on his back. You roll him over to reveal that his plate armor has been ripped open, and a grizzly would covers most his chest.","Blood and smashed furniture tell you how this man went down- fighting. He was a strong and resolved man, and even though he was no veteran he kept his head in a situation that would drive most mad.");
break;

beginstate 36;
if((get_flag(9,19) > 0) && (get_flag(9,20) == 0)){
	set_flag(9,20,1);
	reset_dialog();
	add_dialog_str(0,"You follow the dried bloodstains up the stairs. Whoever made them was either dragging himself, or being dragged, and you're willing to bet either way it was Fabian.",0);
	add_dialog_str(1,"If the Beast was dragging him then Fabian was either dead, or is dead by now. If he was alive, then why would he leave the cellars voluntarily?",0);
	add_dialog_str(2,"You don't think this is going to have a happy ending, but you have to at least try to find his body before you can be at ease.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
}
if((get_flag(9,19) == 0) && (get_flag(9,12) > 0)){
	block_entry(1);
	message_dialog("As repulsive as the slaughter behind you is, you will have to bite the bullet and look through it, if only to find out the truth of what happened to your friends. You don't expect any clear answers, but where else could you look?","");
	end();
}
break;

beginstate 37;
if((get_flag(9,12) > 0) && (get_flag(9,21) == 0)){
	set_flag(9,21,1);
	reset_dialog();
	add_dialog_str(0,"The heavy doors ahead of you hang open. At first you stand in shock, marveling that any creature, even the Beast could somehow smash these massive doors. Then you realise something strange-- the doors aren't broken.",0);
	add_dialog_str(1,"Something unbarred the doors from the inside, which means one of two things-- either one of your fellows opened the door and let the Beast in- doubtful- or the Beast entered elsewhere in the cellars.",0);
	add_dialog_str(2,"Did the Beast open the door on its way out, dragging Fabian behind? Or did Fabian stumble out under his own power, bleeding all the way? If it was the second, why would he do that?",0);
	add_dialog_str(3,"Maybe he thought you were dead and that he alone survived. Maybe he was driven mad by wounds and horror. You can't know until you find him.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
}
break;

beginstate 38;
if(get_flag(9,12) == 0){
	block_entry(1);
	message_dialog("The heavy oaken doors double doors above you have been pulled shut, and barred from the inside with two, thick, crossed metal bars.","You find it difficult to believe that anything, even the Beast, could get through this. It would take nothing less than a herculean force to break it down.");
	end();
}
move_to_new_town(8,47,35);
break;

beginstate 40;
if(get_flag(15,0) == 0){
	activate_hidden_group(19);
	message_dialog("You were so absorbed in your reading that you were beginning to forget about your frozen limbs, and weary muscles. Indeed you were so engrossed in Lyonel's tale that you hadn't notice the creature approaching behind you until the last moment.","");
	set_flag(15,0,1);
}
break;