begintownscript;

variables;
short choice;

body;

beginstate 0; //INIT_STATE

	//just arriving...
	if(get_flag(3,0) == 0) {
		//scatter the passed-out party
		relocate_character(0,13,16);
		relocate_character(1,14,13);
		relocate_character(2,16,13);
		relocate_character(3,18,17);
		force_view_center(13,16);
		set_character_pose(1000,14);
		force_instant_terrain_redraw();
		pause(15);
		
		reset_dialog();
		add_dialog_str(0,"Slowly, you regain consciousness. You're in a grassy field. You can hear birds chirping happily, as if none of this had ever happened.",0);
		add_dialog_str(1,"For just a moment, you consider the possibility that you didn't make it.",0);
		run_dialog(1);
		set_character_pose(1000,0);
		force_instant_terrain_redraw();
		
		//move the party to the proper location outdoors
		change_outdoor_location(0,0,17,23);
		set_flag(3,0,1);
		
		//Set up the variable town entry appropriately...
		// 1. If you banished Ethalia, go to the ruin.
		if(get_flag(2,9) == 1)
			set_flag(10,1,4);
		// 2. If you banished the demon, go to the alternate lab.
		else
			set_flag(10,1,5);
		}

break;

beginstate 1; //EXIT_STATE

	message_dialog("You wander around aimlessly, until you spot a road to the east. Soon, you see the lab building where all of this started, off to the south.","");

break;

beginstate 2; //START_STATE
	//Checking for the lead pc each turn... not necessary here
	//pc_counter = 0;
	//while(char_ok(pc_counter) == 0) {
	//	pc_counter = pc_counter + 1;
	//	}
	//lead_char = pc_counter;
break;