// OUTDOOR SECTION SCRIPT
//    Section: X = 0, Y = 2: Near Nakhtha

beginoutdoorscript;

variables;

int choice,dummy;

body;

beginstate INIT_STATE;
// This state called whenever this section is loaded into memory.
break;

beginstate START_STATE;
// Starting state of the section, called every turn the party 
// stands inside this section until you change the state.
if (get_flag(202,3) == 1)
	set_terrain(46,24,458);
break;

beginstate 10;
if (get_flag(7,6) == 0) {
	block_entry(1);
	message_dialog("A very large group of bandit sliths sits here, guarding this passage. When you approach, they begin growling fiercely and holding their weapons in a threatening manner.","You back off. As long as they're not willing to back down, you will be badly outnumbered and not able to stand a chance in a fight.");
	}
break;

beginstate 11;
	message_dialog("A very large group of bandit sliths sits here, guarding this passage. When you approach, they begin to flee in fear! They must know that you cleaned out the town of Nakhtha.","You let them run away. There are too many of them to fight anyway.");
	outdoor_enc_result(3);
	set_flag(202,4,1);
break;

beginstate 12;
if (get_flag(202,0) == 0) {
	set_flag(202,0,1);
	message_dialog("The land in front of you is a deep, inky black, a tangible dark cover. It smells indistinctly of sulfur and volcanic minerals, and your skin tingles with the feeling of magic.","Something dark and terrible lives beyond here. You hold your weapons at the ready.");
	}
break;

beginstate 13;
if ((get_flag(11,1) == 1) && (get_flag(202,1) == 0)) {
	set_flag(202,1,1);
	message_dialog("As you come back towards Nakhtha to tell Legare about your reception in Thassaka, you see a few boats heading from Nakhtha to the beach on which you camped a short while ago. Legare, Kass, and Pithoss, must be on that beach to the west.","");
	}
break;

beginstate 14;
if (get_flag(202,2) == 0) {
	set_flag(202,2,1);
	message_dialog("Before you are several menacing totems. The land slopes up sharply here, and you have no doubt that you will find more barbarian sliths this way.","");
	}
break;

beginstate 15;
if (get_skill_total(16) < 15) {
	message_dialog("The ground here is lumpy. Odd.","(Your Nature Lore isn't high enough for you to know what this means.)");
	end();
	}
	
if (get_terrain(46,24) == 396) {
	reset_dialog();
	add_dialog_str(0,"The ground here is lumpy and turned over. Your Nature Lore detects that someone must have buried something here. What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Dig.");
	if (run_dialog(1) == 2) {
		reset_dialog();
		add_dialog_str(0,"You find some lockpicks! They look special and shiny. Someone must've buried them here at some point.",0);
		if (reward_give(301) == 1) { // Enchanted Lockpicks
			set_flag(202,3,1);
			set_terrain(46,24,458);
			add_dialog_str(1,"You pack away your discovery.",0);
			}
		else
			add_dialog_str(1,"Unfortunately, you can't carry what you've found, so you leave it buried there.",0);
		run_dialog(1);
		}
	}
break;