begintownscript;

variables;
short bmessage,stagx;

body;

beginstate 0;

	if(get_flag(15,0) == 1){
		message_dialog("You enter the cave.  Whereas you were mildly curious when greeted with the smell of trash, you are now quite surprised to see light inside.","Well...  Plus the fact that the smell of trash is getting worse.");
		message_dialog("Suddenly, you realize what you're dealing with.  You had heard rumors of these creatures, but had long believed them to be extinct or fairy tales.","Here you stand, however, at the entrance to a goblin lair.");
		set_flag(15,0,2);
	}

	if(get_flag(60,0) > 0){
		while(stagx <= 11){
			set_terrain(stagx,23,137);

			stagx = (stagx + 1);
		}
		set_floor(10,23,89);
	}

break;

beginstate 1;
break;

beginstate START_STATE;
break;

beginstate 10;

	if(get_flag(60,0) == 0){
		if(has_special_item(40) > 0){
			reset_dialog();
			add_dialog_str(0,"There is a set of stalagmites here.  Beyond them, you can see the glint of something that might be valuable.",0);
			add_dialog_str(1,"If you wanted, you could use some of the explosives you took in the Troglodyte Caverns to remove the stalagmites.",0);
			add_dialog_choice(0,"Leave them alone.");
			add_dialog_choice(1,"Blow 'em to smithereens!");
			bmessage = run_dialog(0);
			if(bmessage == 1){
				end();
			}
			stagx = 9;
			while(stagx <= 11){
				set_terrain(stagx,23,137);

				stagx = (stagx + 1);
			}
			set_floor(10,23,89);
			put_boom_on_space(10,23,0,0);
			put_boom_on_space(10,23,0,0);
			put_boom_on_space(10,23,0,0);
			put_boom_on_space(10,23,0,0);
			force_instant_terrain_redraw();
			run_animation_sound(152);
			set_flag(60,0,1);
			end();
		}
		else{
			message_dialog("There is a set of stalagmites here.  Unfortunately, you have no way to remove them.","");
		}
	}

break;