// Townscript for town 0: Level -4

begintownscript;

variables;
int choice,tick1;

body;

beginstate INIT_STATE;
	if (get_flag(0,5) == 1)
			flip_terrain(33,7);

break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;

if (get_flag(0,0) == 0) {
		if (get_flag(200,0) <= 0) {
				tick1 = get_current_tick();
				set_flag(200,0,tick1);
				}
		if (get_current_tick() == get_flag(200,0) + 10) {
				message_dialog("The welcoming committee should have been here now, right? HIM said they would be. They aren't. Keep waiting.","");
				}

		if (get_current_tick() == get_flag(200,0) + 20) {
				message_dialog("Where are they? They are not here. The darkness is oppressive, must get out! Knives out, knives out! The welcoming committee, knives out!","We're scared, we must go out, welcoming committee has it's knives out, they come to kill us! Run away!");
				set_flag(0,0,1);
				}
		}

break;

beginstate 10;
	if (get_flag(0,0) == 0) {
			message_dialog("We can't go out; HIM said we should wait for the committee. They bring tea and biscuits.","");
			block_entry(1);
			}
break;

beginstate 11;
	if (get_flag(0,1) == 0) {
			message_dialog("_Hey, where are you going? I did not give permission for you to go away. The welcoming committee, especially sent out to get you, will not be able to find you this way. Come back, come back and wait._","");
			set_flag(0,1,1);
			}
break;

beginstate 12;
	if (get_flag(0,2) == 0) {
			message_dialog("The way up has caved in. Rest assured, the welcoming committee can't get to us now! Knives in, committee...","");
			set_flag(0,2,1);
			}
break;

beginstate 13;
	if (get_flag(0,3) == 0) {
			message_dialog("What is that? We see a room. The door is open. If there are people in there, knives out! But it looks empty. Knives in.","");
			set_flag(0,3,1);
			}
break;

beginstate 14;
	if (get_flag(0,4) == 0) {
			message_dialog("It is empty here. Nice chairs. Nice, broken chairs. Looking around, we see that none of the bookcases has survived it. Survived what. We don't know.","Where are we? What is this? A door! There is a door right in front of us!");
			set_flag(0,4,1);
			}
break;

beginstate 15;
	if (get_flag(0,5) == 0) {
			message_dialog("It is locked. It is locked and we will never get out! Knives out bash it bash it knives out!","");
			play_sound(159);
			flip_terrain(33,7);
			pause(5);
			message_dialog("_What are you doing down there, guests? The guests are not allowed to leave the guest chambers without permission from me. The welcoming committee is on its way with tea and biscuits. Please remain seated._","The door is open. Go to the stairs, the stairs!");
			set_flag(0,5,1);
			}
break;

beginstate 16;
	move_to_new_town(1,10,7);
break;

beginstate 17;
	if (get_flag(0,6) == 0) {
			message_dialog("A body. It's a body. It is here, knives out for when it comes for us! Wait, the body, it still had clothes on, tag with name.","It says _Conrad._ Rest in peace, Conrad. You go to light.");
			set_flag(0,6,1);
			}
break;