// townscript for town 39: Under hidden house

begintownscript;

variables;

int i,j,choice;

body;

beginstate INIT_STATE;
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
reset_dialog();
add_dialog_str(0,"You find a ladder. It seems to lead to a trapdoor. Do you want to climb up?",0);
add_dialog_choice(0,"Climb up");
add_dialog_choice(1,"Leave");
choice = run_dialog(0);

	if (choice == 1)
			move_to_new_town(24,7,11);

break;

beginstate 11;
reset_dialog();
add_dialog_str(0,"The book on this pedestal is, to your surprise, quite new. The ink on the paper isn't older than just a few months.",0);
add_dialog_choice(0,"Read the book");
add_dialog_choice(1,"Leave it");
choice = run_dialog(0);

	if (choice == 1) {
			message_dialog("You flip through the book until you find something interesting. Its not much. The book is probably a sort of diary. However, when you reach the end of the book (the ink here is even newer) you come across this bit of text:","_Again, I'm not safe and must flee. However, luckily, I have already begun preparing my next place to stay. You come there via a portal. Its there where the rivers meet._");
			message_dialog("_To come to the portal, you have to walk around the mountain, until you see two, old, crumbling rock pillars. There is the entrance._","_Walk along the passage until you get to the end and search for secret passages. The portal is in a small hut._ The text ends here.");
			set_flag(39,0,1);
			set_town_visibility(2,1);
			}

break;

beginstate 12;
if (get_flag(39,1) == 1)
		end();
	message_dialog("This was an old library. The bookshelves are empty and dusty. Webs give the room a finishing touch.","");
	set_flag(39,1,1);
break;

beginstate 13;
if (get_flag(39,2) == 1)
		end();
	message_dialog("When you walk past the wall, you see all kinds of cracks and broken stones lying along the wall. You wonder what made it cracked.","");
	set_flag(39,2,1);
break;

beginstate 14;
if (get_flag(39,3) == 1)
		end();
	message_dialog("This looks like an old bedroom. You wonder why somebody would make his bedroom here, when you saw yourself that there are bedrooms upstairs as well.","");
	set_flag(39,3,1);
break;