// TOWN SCRIPT
//    Town 20: Shattered Fort


// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

begintownscript;

variables;

int i,j,k,r1,choice;

body;

beginstate INIT_STATE;

break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
	if (has_special_item(37) == 0)
	message_dialog("You start to turn the wheel, but you soon find that you can't move it more than a few inches. You soon find out why ... there's a small gold padlock blocking the mechanism.You try to pick the lock. Then you try to break it off.","After an hour of effort, you have to give up. The lock must be enchanted. It's too strong for you to open it, and you don't have the key.");

	else 
	set_state_continue(11);
break;

beginstate 11;	
	message_dialog("You start to turn the wheel, only to find that the mechanism is blocked by a small gold padlock. Fortunately, you have the key to the mechanism.","You turn the wheel around three times, as it turns, you hear the sound of stone scraping against stone to the west. As you leave, the padlock springs back onto the wheel, under its own power, and locks itself.");
	set_terrain(13,7,0);
	set_terrain(4,42,55);	
break;

beginstate 12;
			message_dialog("You turn the wheel. As far as you can tell, nothing happens.","");
break;
	

