beginoutdoorscript;

variables;
short leave_scen;
short buy_food;

body;

beginstate 0;
break;

beginstate 1;
break;

beginstate START_STATE;
break;

beginstate 10;
	reset_dialog();
	add_dialog_str(0,"Here lies the exit to Ashton Vale.  If you choose, you could leave the Vale and travel on to other places.",0);
	add_dialog_choice(0,"Stay in Ashton Vale.");
	add_dialog_choice(1,"Leave Ashton Vale.");
	leave_scen = run_dialog(1);
	if (leave_scen == 2){
end_scenario(0);
}
else{
message_dialog("You turn around.  You have things to do here before leaving.","");
block_entry(1);
}
break;

beginstate 11;
if(get_flag(1,0) == 250){
print_str_color("You see a farmhouse and fertile crops.",2);
}
else{
message_dialog("There is a small farmhouse here.  The people wave to you as you go by, diligently tilling their fields and doing other farmhand work.","Ashton Vale appears to be an area focussing primarily on its agriculture, and it's people like these who form the backbone of this rural area's economy.  More power to them.");
set_flag(1,0,250);
}
break;

beginstate 12;
if(get_flag(2,0) == 250)
end();
message_dialog("The city of Ashton is larger than you had previously imagined.  Indeed, the relative prosperity of its crops seems to have given it a breath of live not shared by most rural metropolises.","Perhaps you may just meed a comfortable piece of civilization to rest your laurels and heads on for an evening.");
set_flag(2,0,250);
break;

beginstate 13;
	reset_dialog();
	add_dialog_str(0,"There is a small farmer's market set up outside of town.  If you wanted to, you could purchase food here.",0);
	add_dialog_choice(0,"Buy some food.");
	add_dialog_choice(1,"Leave.");
	leave_scen = run_dialog(1);
	if (leave_scen == 2){
block_entry(1);
}
else{
block_entry(1);
begin_shop_mode("Farmer's Market","Various farmhouses from the area are peddling their goods here to potential buyers.  Because of this valley's abundance of food, you receive premium prices for vittles of the utmost freshness.",5,2,6);
}
break;

beginstate 14;
	message_dialog("Here lies a small suburb of Ashton, packed with medium and low quality houses.  The people here are friendly, but there's little in general to do here.  You soon become bored and leave.","");
block_entry(1);
break;

beginstate 15;
	if(get_flag(20,0) == 175){
		large_draw_pic_dialog(553,"As you approach the center of this large warren, you see what lies at the end of your path:");
		message_dialog("A large manor, presumably Kurojutsu's.  He must be far older than you had previously imagined if he has accumulated so much incredible wealth.","");
		set_flag(20,0,180);
	}
break;

beginstate 16;
	if(get_flag(66,0) == 0){
		place_out_spec_enc(0,24,31);
		place_out_spec_enc(1,27,31);
		place_out_spec_enc(2,27,35);
		place_out_spec_enc(3,27,38);
		set_flag(66,0,5);
		message_dialog("As you stare out across this large, spiraling tunnel, you hear the shuffling of undead waiting to sink their claws and fangs into your soft, supple flesh.","You will have to fight your way to the end of this path.");
	}
break;

beginstate 17;
	message_dialog("As you emerge from the tunnel you ended up in, you find yourself near Timerwing- a large, port city!  From here, you can go to any of the other four continents.","You came to Ashton Vale looking for a way off of Doston, and now you've found it.  It's time to leave.");
	large_draw_pic_dialog(557,"- THE END -");
	end_scenario(1);
break;

//
// ----
// One-time message
//
// beginstate 12;
// if(get_flag(0,0) == 250)
// end();
// message_dialog("","");
// set_flag(0,0,250);
// break;