//Outdoor Script for x = 4  y = 1

beginoutdoorscript;

variables;

int choice;

body;

beginstate INIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
if (get_flag(141,9) == 0) {
		message_dialog("This is some sort of a subterranean cavern. You feel homely here. It reminds you of Avernum.","You start to walk. You wonder what you'll find at the end of the road.");
		set_flag(141,9,1);
		}
	
if (get_flag(8,10) == 1) {
		if (get_flag(141,11) == 0) {
				message_dialog("You look around the cavern you entered. These underground caverns may well be what was mentioned in the book you found in Thralni's old castle. Now you must find the gates.","");
				set_flag(141,11,1);
				end();
				}
		}

if (get_flag(8,10) == 0) {
		message_dialog("You don't know what might be here. Given the fact that you came here through the fort of the biggest enemy of Riverrod, you suspect these caverns aren't very safe.","It may be better to return when you found some clue, or reason to come here.");
		block_entry(1);
		}
break;

beginstate 11;
	if (get_skill_total(16) < 8) {
		message_dialog("There is a small patch of unusual mushrooms here. You don't recognize the variety.","");
		end();
		}
	if (get_flag(141,0) == 250)
		end();
	if (reward_give(218) > 0) {
		message_dialog("You find a small patch of toadstools. You recognize them as a variety useful in alchemy. You pick a few.","");
		set_flag(141,0,250);
		}
break;

beginstate 12;
	if (get_skill_total(16) < 8) {
		message_dialog("There is a small patch of unusual mushrooms here. You don't recognize the variety.","");
		end();
		}
	if (get_flag(141,1) == 250)
		end();
	if (reward_give(218) > 0) {
		message_dialog("You find a small patch of toadstools. You recognize them as a variety useful in alchemy. You pick a few.","");
		set_flag(141,1,250);
		}
break;

beginstate 13;
	if (get_skill_total(16) < 10) {
		message_dialog("There is a small patch of unusual mushrooms here. You don't recognize the variety.","");
		end();
		}
	if (get_flag(141,2) == 250)
		end();
	if (reward_give(219) > 0) {
		message_dialog("You find a small patch of strange fungus, growing in the gravel in this corridor. You pull some of it up, and immediately recognize the distinctive human shape. It's mandrake!","");
		set_flag(141,2,250);
		}
break;

beginstate 14;
	message_dialog("This group of Senarti patrols the roads down here. Unfortunately for you, they found you during their patrol, and now they are going to attack you.","");
break;

beginstate 15;
	message_dialog("You meet a small group of Senarti guarding the entrance to a cave. You suspect this cave is important, because they wouldn't be guarding it with a Senarti mage if it weren't that special.","You start to wonder what might be so special about that cave. You'll find out soon enough. That is, if you manage to win this battle.");
break;

beginstate 16;
if (get_flag(141,3) == 1)
		end();
	message_dialog("This is the place the Senarti get their food from. This rather large subterranean lake is filled with small big eyed fish.","They look disgusting.");
	set_flag(141,3,1);
break;

beginstate 17;
if (get_flag(141,10) == 1) 
		end();
	message_dialog("You can't do anything else but stand here and be amazed by what the Senarti made here. They apparently made some sort of underground city.","For as far as you can see, the Senarti will be harder to wipe out than any other race you saw until now. Is it really worth the trouble?");
	set_flag(141,10,1);
break;


beginstate 18;
	message_dialog("When you try to enter the small city, immediately guards run to you, and several arrows land just inches from your feet. You gather they don't want you here.","You don't want to fight that whole city. It would be foolish to do so. You back away. The guards don't seem relieved, as you had expected. They seem as if they are unhappy about this. They probably wanted to kill you right away.");
	block_entry(1);
break;

beginstate 19;
if (get_flag(141,11) == 1) 
		end();
	message_dialog("In front of you lies a small hill with an opening in the middle. Its guarded by a Senarti mage and some Senarti warriors. It looks important.","The fact that a hill is guarded by a mage, often means that the hill is either a research center, or some holy place. You hope its the former, as no demons will be present then. At least, you hope so.");
	set_flag(141,11,1);
break;

beginstate 20;
if (get_flag(141,13) == 1) 
		end();
	message_dialog("This seems to be what lies at the end of the tunnel. It is a massive gate. It will be very well guarded. You might have to prepare yourself well before barging in, for what you have seen of the Senarti, they can fight.","");
	set_flag(141,13,1);
break;