// Town 10: Small Camp
begintownscript;

variables;

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

body;

beginstate INIT_STATE;
	set_crime_tolerance(2);
	force_instant_terrain_redraw();
	
if (get_flag(10,0) == 0) {
	reset_dialog();
	add_dialog_str(0,"You travel with the expedition to Nakhtha. There Talas figures out how to open the gates, and Kass tells you that you ought to proceed south in your boat.",0);
	add_dialog_str(1,"Legare's information indicates that the next city past Nakhtha was called Thassaka, and it was the largest city in this region, much larger than Vasskolis or Nakhtha. He thinks there's some chance that it's still intact.",0);
	add_dialog_str(2,"Kass instructed you to check it out, and either way, report back to Nakhtha when you've determined the situation.",0);
	add_dialog_str(3,"You made camp in a nook in the stalagmites just south of Nakhtha and rested for a long while. Now it's time to get up and find this Thassaka.",0);
	change_outdoor_location(0,2,16,42);
	create_boat(3,10,18,17,0);
	set_flag(10,0,run_dialog(1));
	toggle_quest(2,1);
	}
	
if (get_flag(11,4) == 0)
	if (get_flag(11,1) == 1) {
		i = 6;
		while (i <= 27) {
			change_blocked(14,i,1);
			change_blocked(15,i,1);
			change_blocked(16,i,1);
			i = i + 1;
			}
		activate_hidden_group(1);
		if (get_flag(10,1) == 0) {
			set_flag(10,1,1);
			message_dialog("You see the trio of leaders on the beach: Legare, Kass, and Pithoss. They will want to know about your arrival.","");
			}
		}
	
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
if (get_flag(11,1) == 0)
	end();
if (get_flag(11,4) == 1)
	end();
	
	block_entry(1);
	
	set_flag(11,4,1);
	
	message_dialog("You approach the three sliths with your news.","");
	
	text_bubble_on_char(7,"... faith is wavering. We must act.");
	
	i = 0;
	while (char_ok(i) == 0)
		{i = i + 1; }
	
	while (char_loc_y(i) > 23) {
		march_party(char_loc_x(i),char_loc_y(i) - 1);
		force_view_center(char_loc_x(i),char_loc_y(i));
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		}
	while (char_loc_y(i) < 15) {
		march_party(char_loc_x(i),char_loc_y(i) + 1);
		force_view_center(char_loc_x(i),char_loc_y(i));
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		}
		
	if (char_loc_y(i) == 19)
		march_party(16,char_loc_y(i));
	if (char_loc_y(i) > 19)
		march_party(16,char_loc_y(i) - 1);
	if (char_loc_y(i) < 19)
		march_party(16,char_loc_y(i) + 1);
	force_view_center(16,char_loc_y(i));
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
		
	if (char_loc_y(i) == 19)
		march_party(15,char_loc_y(i));
	if (char_loc_y(i) > 19)
		march_party(15,char_loc_y(i) - 1);
	if (char_loc_y(i) < 19)
		march_party(15,char_loc_y(i) + 1);
	force_view_center(15,char_loc_y(i));
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
		
	if (char_loc_y(i) == 19)
		march_party(14,char_loc_y(i));
	if (char_loc_y(i) > 19)
		march_party(14,char_loc_y(i) - 1);
	if (char_loc_y(i) < 19)
		march_party(14,char_loc_y(i) + 1);
	force_view_center(14,char_loc_y(i));
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
		
	if (char_loc_y(i) == 19)
		march_party(13,char_loc_y(i));
	if (char_loc_y(i) > 19)
		march_party(13,char_loc_y(i) - 1);
	if (char_loc_y(i) < 19)
		march_party(13,char_loc_y(i) + 1);
	force_view_center(13,char_loc_y(i));
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	text_bubble_on_char(7,"");
	if (party_size() > 1)
		text_bubble_on_char(7,"Hello, adventurers.");
	else
		text_bubble_on_char(7,"Hello, adventurer.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 2);
	
	set_character_facing(6,6);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 3);
	
	text_bubble_on_char(7,"");
	text_bubble_on_char(7,"You have been to Thassaka.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 2);
	
	text_bubble_on_char(7,"");
	force_instant_terrain_redraw();
	
	reset_dialog();
	add_dialog_str(0,"You describe what you found there. Kass looks very hopeful. Legare's expression remains unchanged, however.",0);
	add_dialog_str(1,"_Good,_ Kass says. _We have just begun to move the expedition from Nakhtha. We will bring them to Thassaka very soon. In the meantime, you should rest._",0);
	add_dialog_str(2,"You make your way back to your camp where you slept the first time you were here.",0);
	run_dialog(1);
	
	march_party(12,18);
	force_view_center(12,18);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	j = 17;
	while (j >= 14) {
		march_party(12,j);
		force_view_center(12,j);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		j = j - 1;
		}
	
	relocate_character(6,11,19);
	relocate_character(7,9,18);
	relocate_character(8,9,20);
	march_party(11,13);
	force_view_center(11,13);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(6,12,19);
	relocate_character(7,10,18);
	relocate_character(8,10,20);
	march_party(10,12);
	force_view_center(10,12);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(6,13,19);
	relocate_character(7,11,18);
	relocate_character(8,11,20);
	march_party(9,11);
	force_view_center(9,11);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	j = 8;
	while (j >= 5) {
		relocate_character(6,22 - j,19);
		relocate_character(7,20 - j,18);
		relocate_character(8,20 - j,20);
		march_party(j,11);
		force_view_center(j,11);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		j = j - 1;
		}
	
	erase_char(6);
	erase_char(7);
	erase_char(8);
	force_view_center(28,30);
	force_instant_terrain_redraw();
	
	march_party(4,12);
	march_party(3,12);
	march_party(3,11);
	march_party(3,10);
	march_party(3,9);
	
	message_dialog("You drift to sleep. If you dream at all, you can't remember when you wake.","You can't tell how long it has been, but you feel rested. It's time to get moving again.");
	
	toggle_quest(2,0);
	
	force_view_center(3,9);
	force_instant_terrain_redraw();
	
break;