//Townscript for town3: level -1

begintownscript;

variables;
int choice;

body;

beginstate INIT_STATE;
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
	move_to_new_town(2,37,36);
break;

beginstate 11;
	move_to_new_town(2,41,13);
break;

beginstate 12;
	move_to_new_town(4,5,16);
break;

beginstate 13;
if (get_flag(3,0) == 0) {
		message_dialog("This room has been collapsing for quite some time, and it is apparent that it has been left in a hurry, like just about the rest of this complex. Looking around we see shelves, most of them broken, some not, though.","");
		set_flag(3,0,1);
		}
break;

beginstate 14;
reset_dialog();
add_dialog_str(0,"These smallish shelves have remained intact, and a couple of scrolls are strewn about on them. Most of them are about accounts, work in progress and personnel matters. One is not. It's about HIM. Should we read it?",0);
add_dialog_choice(0,"Read it");
add_dialog_choice(1,"Leave it");
choice = run_dialog(1);

if (choice == 1) {
		message_dialog("The scroll is in bad condition, but we can still read it without too much trouble. According to this, HIM is an acronym for Human Intelligence Machine. Its purpose was one of a great mind to control the facility.","However, during some tests, it appeared that something got damaged in HIM's mind, and since then it had started to malfunction. It is not said what went wrong or what was wrong.");
		message_dialog("When we turn around the scroll, though, we notice something has been writtin on the back:","_HIM's chamber has been locked down for now. People with high enough authorization can find the key in the chief's office, Oleg Solysis._");
		if (get_flag(1,8) == 0) {
				award_party_xp(25,20);
				set_flag(1,8,1);
				}
		}

break;

beginstate 15;
	play_sound(34);
	print_str("We hear a click.");
break;

beginstate 16;
	if (get_flag(3,1) == 0) {
			message_dialog("We enter a grey and dusty room. Walls have started to collapse a long time ago. Looking around, we soon spot empty beds. That is, one bed is still left untouched. Did its owner ever make it out of this place?","In the same room a paper is lying. Something has been scribbled on it.");
			set_flag(3,1,1);
			}
break;

beginstate 17;
	if (get_flag(3,2) == 0) {
			message_dialog("I don't know why we bother, nothing's ever good enough for us it seems. Maybe we could just sit and wait until we die, because it seems we will. There is another cave-in here. Will we ever get the hell out of here?","");
			set_flag(3,2,1);
			}
break;

beginstate 18;
	if (get_flag(3,3) == 0) {
			message_dialog("Another cave-in. At the end, there is a slope upwards, and if we are right, there is light. The surface is in our grasp, and yet we can't reach it, like a cat, tied to a stick...","");
			set_flag(3,3,1);
			}
break;

beginstate 19;
	if (get_flag(3,4) == 0) {
			reset_dialog();
			add_dialog_str(0,"_Wait._",0);
			add_dialog_str(1,"_Not so fast._",0);
			add_dialog_str(2,"_I must say you surprise me. You managed to come all the way here, you are actually going to reach the great halls of the HMC. Fine. If you have your message, come and bring it to me. I am here to hear what you have to say._",0);
			add_dialog_str(3,"_And don't mind the click. It means... nothing._",0);
			add_dialog_choice(0,"We're coming");
			choice = run_dialog(1);
			set_flag(3,4,1);
			}
break;