beginoutdoorscript;

variables;
short choice;

body;

beginstate INIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
if (get_flag(20,5) == 0) {
	set_town_visibility(3,1);
	set_flag(20,5,1);
	message_dialog("You couldn't see it from the distance, but tucked into a corner here is a small staircase leading underground.","");
}
break;

beginstate 11;
reset_dialog();
if (get_flag(4,5) == 0) {
	add_dialog_str(0,"This way leads back home.  But with your sister in the hands of bandits, can you leave her to her fate?",0);
} else {
	add_dialog_str(0,"This way leads back home.  Do you want to abandon your travel plans and return home to rest?",0);
}
add_dialog_choice(0,"Go home");
add_dialog_choice(1,"Stay");
choice = run_dialog(1);
if (choice == 1) {
	if (get_flag(4,5)) {
		message_dialog("After a journey that seems longer than it did the other way, you get home, to welcome rest and safety.","You didn't do what you planned, but at least you survived, and you can travel another time.");
	}
	end_scenario(get_flag(4,5));
} else {
block_entry(1);
}
break;

beginstate 12;
if (get_flag(4,5) == 0) {
	message_dialog("This way leads to Redby.  But you don't want to go there with your sister in the hands of bandits.","");
} else {
	reset_dialog();
	add_dialog_str(0,"This way leads to Redby.  Do you want to continue on your interrupted journey?",0);
	add_dialog_choice(0, "Leave");
	add_dialog_choice(1, "Stay");
	choice = run_dialog(1);
	if (choice == 1) {
		message_dialog("The rest of the journey is uneventful.  When you get to Redby, you find that the story of your adventure is worth several ales when you tell it there.","But more importantly, you survived.");
		end_scenario(1);
	}
}
block_entry(1);
break;