// Town 4: Camp
begintownscript;

variables;

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

body;

beginstate INIT_STATE;
	set_crime_tolerance(2);
	
	change_blocked(19,14,1);
	change_blocked(20,14,1);
	change_blocked(21,14,1);
	change_blocked(25,13,1);
	change_blocked(26,13,1);
	change_blocked(27,13,1);
	
	
	set_name(6,"Ethass");
	set_char_dialogue_pic(6,584,0);
	set_char_dialogue_pic(7,585,0); // Phaedra
	set_name(8,"Talas");
	set_char_dialogue_pic(8,582,0);
	set_name(9,"Ithik");
	set_level(9,60);
	set_name(10,"Machrone");
	set_name(11,"Silthokh");
	set_name(12,"Pithoss");
	set_char_dialogue_pic(12,580,0);
	set_name(13,"Legare");
	set_name(14,"Kass");
	set_char_dialogue_pic(14,583,0);
	
	set_name(19,"Bitey");
	set_name(20,"Hissy");
	set_name(21,"Snarly");
	
	if (get_flag(290,7))
		make_town_hostile();
	
	if (get_flag(4,0) == 0) {
		force_instant_terrain_redraw();
		reset_dialog();
		add_dialog_str(0,"You enter the camp that the expedition has set up, which is little more than a few pens and some small tents. Most of the followers must sleep in these pens on thin ground pads, little better than sleeping on rocks.",0);
		add_dialog_str(1,"A few of the more important people -- including you -- get tents. Yours should be nearby. And you can see to the north that three portable wooden buildings have been set up, one each for Pithoss, Kass, and Legare.",0);
		add_dialog_str(2,"You should probably speak to Pithoss or Kass. One of them will have instructions for you.",0);
		set_flag(4,0,run_dialog(1));
		}
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
if (get_crime_level() == 0)
	end();
if (get_flag(290,7) > 0)
	end();
	
	print_str_color("You have made the expedition angry with you.",1);
	make_town_hostile();
	set_flag(290,7,1);
break;

beginstate 10;
break;

beginstate 11;
	reset_dialog();
	add_dialog_str(0,"You come to Legare's door. What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Knock on it.");
	if (run_dialog(1) == 1)
		block_entry(1);
	else {
		message_dialog("He does not answer. Either he's not there or he doesn't want to talk to you.","");
		}
break;

beginstate 12;
	reset_dialog();
	add_dialog_str(0,"You come to Kass's door. What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Knock on it.");
	if (run_dialog(1) == 1)
		block_entry(1);
	else {
		message_dialog("He does not answer. Either he's not there or he doesn't want to talk to you.","");
		}
break;

beginstate 13;
	if (get_flag(4,2) == 0) {
		set_flag(4,2,1);
		message_dialog("You enter a tent containing Talas, Ithik, and Silthokh. They seem to be in the midst of a conversation, but it cuts off right as you enter.","Although they are lucky to have their own tent and not be stuck in a pen with the others, they do not have a lot of room. They will have to get very familiar with each other over the course of this journey.");
		}
break;

beginstate 14;
	if (get_flag(4,3) == 0) {
		set_flag(4,3,1);
		message_dialog("You enter a tent containing Phaedra and Ethass. They are playing a game of chess. Ethass sits at the board, and Phaedra calls out her moves. _Dervish to King's Nephil Three,_ she says as you enter. Then she looks up and smiles at you. _Hi there._","");
		}
break;

beginstate 15;
	reset_dialog();
	add_dialog_str(0,"You return to your tent. What do you do?",0);
	add_dialog_choice(0,"Enter.");
	add_dialog_choice(1,"Enter and rest.");
	if (run_dialog(1) == 2) {
		play_sound(-20);
		march_party(40,15);
		march_party(39,15);
		march_party(38,15);
		march_party(37,15);
		revive_party();
		}
break;