// TOWN SPECIAL ENCOUNTERS
//    Town 58: Halls of Chaos

beginzonescript;

variables;

short im_hostile = 0;
short max_crime = 200;
short last_abil;
short counter = 0;
short set_ter = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

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


	set_crime_tolerance(max_crime);

	break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
	if (gf(58,22) == 0) {
		set_terrain(0,14,9,229);
		set_terrain(0,18,9,229);
		}
		else {
			set_terrain(0,14,9,230);
			set_terrain(0,18,9,230);
			}
	if (gf(58,23) == 0) {
		set_terrain(0,55,38,230);
		set_terrain(0,55,42,230);
		}
		else {
			set_terrain(0,55,38,229);
			set_terrain(0,55,42,229);
			}
			
	sf(58,20,0);
	if ((gf(58,22) == 1) && (gf(58,23) == 0))
		sf(58,20,1);
	sf(58,21,0);
	if ((gf(58,22) == 0) && (gf(58,23) == 1))
		sf(58,21,1);
	
	if (gf(58,5) > 0)
		set_terrain(0,17,40,0);
	if (gf(58,6) > 0)
		set_terrain(0,11,9,0);
	if (gf(58,7) > 0)
		set_terrain(0,52,8,0);
		
	if ((gf(58,25) > 1) && (gf(58,11) == 0)) {
		sf(58,11,1);
		ok_dlog(55,2);
		}
	if ((gf(58,26) > 1) && (gf(58,12) == 0)) {
		sf(58,12,1);
		ok_dlog(57,2);
		}
	if ((gf(58,27) > 1) && (gf(58,13) == 0)) {
		sf(58,13,1);
		ok_dlog(59,2);
		}
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);

