// Town 3: East Riverbank
begintownscript;

variables;

short choice,i,j,k;
string dlgstr;

body;

beginstate INIT_STATE;
	set_crime_tolerance(2);
	
if (get_flag(3,1) == 0)
	set_terrain(6,16,0);

if (get_flag(3,1) == 1) {
	set_flag(3,1,2);
	create_boat(1,3,6,15,0);
	}

if (get_flag(3,0) != 0)
	end();
	
	set_flag(3,0,1);
	change_outdoor_location(0,0,18,9);
	activate_hidden_group(1);
	i = 0;
	while (i <= 6) {
		j = 12;
		while (j <= 17) {
			set_height(i,j,i + 1);
			set_floor(i,j,0);
			set_terrain(i,j,110);
			j = j + 1;
			}
		i = i + 1;
		}
	force_instant_terrain_redraw();
	
	message_dialog("As you hurry out of the dry river, with the army right behind you, you pass Legare, Kass, and Pithoss standing at the edge of the water looking down. You stop short and turn to watch them.","");
	
	text_bubble_on_char(6,"Must I, Goddess?");
	march_party(11,15);
	force_view_center(11,15);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	march_party(11,16);
	force_view_center(11,16);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 4);
	
	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"Very well. Thy will be done.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(6,"");
	set_character_pose(6,1);
	run_animation_sound(65);
	
	set_character_pose(6,0);
	force_instant_terrain_redraw();
	
	message_dialog("As you watch, the river begins to flow normally again, over the heads of the entire army of Gnass, still in the middle of the river.","You step closer to get a better look.");
	
	i = 0;
	while (i <= 6) {
		j = 12;
		while (j <= 17) {
			set_floor(i,j,23);
			set_terrain(i,j,0);
			j = j + 1;
			}
		i = i + 1;
		}
	march_party(10,16);
	force_view_center(10,16);
	run_animation_sound(100);
	
	march_party(9,16);
	force_view_center(9,16);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	i = 2;
	while (i <= 8) {
		j = 12;
		while (j <= 17) {
			k = 0;
			while (k <= i - 2) {
				set_height(k,j,i);
				k = k + 1;
				}
			j = j + 1;
			}
		force_instant_terrain_redraw();
		run_animation_sound(100);
		pause(get_flag(290,0) * 2);
		i = i + 1;
		}
	
	set_floor(6,12,25);
	set_floor(6,13,25);
	set_floor(6,14,25);
	set_floor(6,15,25);
	set_floor(6,16,25);
	set_floor(6,17,25);
	force_instant_terrain_redraw();
		
	message_dialog("Everyone stands silent for a moment. Pithoss runs his fingers along his two-tined spear. Kass shifts his weight from one foot to another. Legare stands, eyes closed, hands outstretched, mouthing words silently.","Finally, he opens his eyes and turns.");
	
	set_character_facing(6,6);
	text_bubble_on_char(8,"They are all dead?");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(6,"Yes. By the power of the Goddess.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(6,"");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 2);
	
	message_dialog("Kass turns to you. _We have instructed the others to set up camp in a location nearby to the north. We will go there now. Take a look around, and come find us soon. We will have more instructions for you._","");
	
	erase_char(6);
	erase_char(7);
	erase_char(8);
	force_instant_terrain_redraw();
	
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
break;