// TOWN SPECIAL ENCOUNTERS
//    Town 21: Spider Cave

beginzonescript;

variables;

short im_hostile = 0;
short max_crime = 200;
short last_abil;
short counter = 0;
short adj1 = 0,adj2 = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,);
//	add_range_to_group(,,groupn);

	set_personality_name(420,"Spider");
	set_personality_name(421,"Spider");
	set_personality_name(422,"Spider");
	set_personality_name(423,"Spider");
	set_personality_name(424,"Spider");
	set_personality_name(425,"Spider");
	set_personality_name(426,"Spider");
	set_personality_name(427,"Spider");
	set_personality_name(428,"Spider");
	set_personality_name(429,"Little Spider");
	set_personality_name(430,"Spider");
	set_personality_name(431,"Spider");
	set_personality_name(432,"Spider");
	set_personality_name(433,"Spider");
	set_personality_name(434,"Spider");

	set_crime_tolerance(max_crime);

	break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
	if ((adj1 == 0) && (gf(21,11) > 0)) {
		adj1 = 1;
		kill_object(8530,1);
		kill_object(8531,1);
		}

	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2100 + get_ran(1,0,9),"Hi!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2100 + get_ran(1,0,9),"You're cute!");
	if ((get_ran(1,0,100) < 10) && (gf(21,7) < 2))
		give_char_text_bubble(2100 + get_ran(1,0,9),"I'm sad!");
	if ((get_ran(1,0,100) < 10) && (gf(21,7) >= 2))
		give_char_text_bubble(2100 + get_ran(1,0,9),"I'm happy!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2100 + get_ran(1,0,9),"Aranea are bad.");
	if ((get_ran(1,0,100) < 10) && (gf(21,7) < 2))
		give_char_text_bubble(2100 + get_ran(1,0,9),"They took our eggs.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2100 + get_ran(1,0,9),"It's a person!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2100 + get_ran(1,0,9),"We need more webs.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2100 + get_ran(1,0,9),"Look! A fly!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2119,"I'm a mayor!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2119,"Welcome, person!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(2119,"I have authority.");
	if ((get_ran(1,0,100) < 20) && (gf(21,7) < 2))
		give_char_text_bubble(2119,"They stole our eggs.");
	if ((get_ran(1,0,100) < 20) && (gf(21,7) >= 2))
		give_char_text_bubble(2119,"The rear tunnel is open.");

break;

beginstate 10;
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

beginstate 14;
break;

//	print_str("");
//	set_terrain_string_range("",1);
//	set_terrain_string_range("The sign says - .",1);

 