// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(93,0) == 0;
	question = "special";
	text1 = "This is a dome made of thick, granite slabs. The door outside identified it as a prison of some sort.";
	text2 = "It is deathly quiet, and there is dust on the floor. Nobody has been in here for a few weeks at least.";
	action = SET_SDF 93 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(93,1) == 0;
	question = "special";
	text1 = "The prison's cells are in the lower level. This prison must be here to hold prisoners or monsters of exceptional significance. It is very secure.";
	text2 = "It is also quiet and sealed up, and the smell of rotting flesh is heavy in the air. There has been a security breach.";
	action = SET_SDF 93 1 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(93,2) == 0;
	question = "special";
	text1 = "You hear rustling in the woods nearby. You can see humanoid figures running in the shadows. They have sighted you. For a moment, everything is still and silent. You are sure whoever it was is out there, deciding what to do.";
	text2 = "They soon decide. Isolated Avernite soldiers are too tempting a target. They start stalking you through the woods.";
	action = SET_SDF 93 2 1;
	code =
		activate_hidden_group(1);
		set_name(10056,"Horde Scout");
		set_name(10057,"Horde Scout");
		set_name(10058,"Horde Scout");
		set_name(10059,"Horde Scout");
		set_level(10506,20);
		set_level(10507,20);
		set_level(10508,20);
		set_level(10509,20);
	break;
	
begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(93,3) == 0;
	question = "special";
	text1 = "You walk down the road through the western expanse of Cotra. There were quite a few shops and settlements outside the west gate. Now that Cotra is being evacuated, most of them have been left to crumble.";
	action = SET_SDF 93 3 1;


begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Two guards have been assigned to this isolated building to act as guards for the alchemist within. They seem to regard the posting as a death sentence. And not unreasonably so.";

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This road is patrolled by several soldiers, who are watching the west gate of Cotra.";
	text2 = "They greet you and caution you to avoid Cotra. They say that the city is about to be destroyed. They don't know exactly how it will happen, but they make it clear that it'll be dangerous.";
	text3 = "They greet you and tell you that they will be leaving soon. Now that Cotra has been destroyed, there is little here to guard.";
	code =
		if (gf(94,1) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";



//

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "Cotra does have a skilled alchemist. It's not surprising, given how many alchemical herbs are found in the swamps to the north.";
	text2 = "This building is positioned a good distance from town, probably to protect others from the smell. Not that it matters, now that Cotra has been abandoned.";
	text3 = "The alchemist himself is a stoic fellow, wrinkled and with a full head of gray hair. Most of his conversation seems to take place with himself. After a bit of grumbling, he says, _I'm Orbus. I have potions. Premade or to order._";
	text5 = "Orbus looks at you with bloodshot eyes. He grunts and grumbles a bit. _No more customers. Just army now. Don't like it. Sign of the times. Nothing to be done._";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "What are you doing out here?";
	text1 = "_Making potions. What I always do. People don't like the stink. People just complain. They need potions. Army needs potions. Army keeps Orbus here._";
	text2 = "_Didn't ask me if I wanted to stay. Didn't ask if I didn't want to stay either. I just stayed. They give me orders. I fill them._";

begintalknode 12;
	state = 11;
	nextstate = 12;
	condition = gf(94,1) == 0;
	question = "What will happen to Cotra?";
	text1 = "_They will destroy it. Some Empire alchemist. Has lots of tricks. He'll do it for them. New techniques. Don't trust that._";

begintalknode 13;
	state = 12;
	nextstate = -1;
	condition = gf(94,8) == 1 && gf(106,1) == 0;
	question = "I am looking for that alchemist.";
	text1 = "_Saw him. With a patrol. Heading west. Young fellow. Full of himself. He didn't come back. Probably chitrach food._";

begintalknode 14;
	state = 11;
	nextstate = -1;
	condition = gf(94,1) > 0;
	question = "Why are you still here now that Cotra is gone?";
	text1 = "_Nobody made me move. Workshop is here. Potions are needed. Orbus stays. Nobody makes him not stay._";

begintalknode 15;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Can you tell me anything else about the area?";
	text1 = "_Lots of sliths to the north. They keep their distance._";
	text2 = "_They're getting closer now, though, now that Cotra is abandoned. Closer every day._";
	text3 = "_And there are chitrachs to the west. Swarms of them. Soldiers don't have time to stop them. They'll be eating my herbs before we know it._";
	code =
		if (gf(94,1) == 0)
			rs(2);
	break;

begintalknode 16;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Can I buy a potion?";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Orbus's Alchemy",
		  "Orbus barely talks, is distinctly unfriendly, and he has an odor. At least he is a skilled alchemist. He will only sell his wares to soldiers.",
		  66,4,0);	
	break;
	

begintalknode 17;
	state = 10;
	nextstate = 13;
	condition = 1;
	question = "I'd like you to make a potion for me.";
	text1 = "He mumbles a bit. You manage to make out a little of what he says. _I make quality elixirs and potions. Each takes graymold. You'll need something else too. Let me see your herbs. I'll tell you what I can make._";

begintalknode 18;
	state = 13;
	nextstate = -1;
	condition = num_of_item(292) > 0 && num_of_item(289) > 0;
	question = "I want healing elixir. (Give graymold and healing herbs.)";
	text1 = "Orbus takes the herbs, chops them up, and gets to boiling them down. He sprinkles in some other ingredients, being careful to make sure you don't see what he is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, he pours a thick fluid into a gourd and seals it with a cork. With a final mumble, he hands you the potion.";
	action = REUSABLE;
	code = 
		take_item(289);
		take_item(292);
		reward_give(226);
	break;

begintalknode 19;
	state = 13;
	nextstate = -1;
	condition = num_of_item(292) > 0 && num_of_item(289) > 0;
	question = "I want curing elixir. (Give graymold and healing herbs.)";
	text1 = "Orbus takes the herbs, chops them up, and gets to boiling them down. He sprinkles in some other ingredients, being careful to make sure you don't see what he is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, he pours a thick fluid into a gourd and seals it with a cork. With a final mumble, he hands you the potion.";
	action = REUSABLE;
	code = 
		take_item(289);
		take_item(292);
		reward_give(227);
	break;
	
begintalknode 20;
	state = 13;
	nextstate = -1;
	condition = num_of_item(292) > 0 && num_of_item(290) > 0;
	question = "I want armor elixir. (Give graymold and spiritual herbs.)";
	text1 = "Orbus takes the herbs, chops them up, and gets to boiling them down. He sprinkles in some other ingredients, being careful to make sure you don't see what he is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, he pours a thick fluid into a gourd and seals it with a cork. With a final mumble, he hands you the potion.";
	action = REUSABLE;
	code = 
		take_item(290);
		take_item(292);
		reward_give(230);
	break;

begintalknode 21;
	state = 13;
	nextstate = -1;
	condition = num_of_item(292) > 0 && num_of_item(290) > 0 && num_of_item(291) > 0;
	question = "I want energy elixir. (Give graymold, energetic and spiritual herbs.)";
	text1 = "Orbus takes the herbs, chops them up, and gets to boiling them down. He sprinkles in some other ingredients, being careful to make sure you don't see what he is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, he pours a thick fluid into a gourd and seals it with a cork. With a final mumble, he hands you the potion.";
	action = REUSABLE;
	code = 
		take_item(290);
		take_item(291);
		take_item(292);
		reward_give(229);
	break;

begintalknode 22;
	state = 13;
	nextstate = -1;
	condition = num_of_item(292) > 0 && num_of_item(293) > 0;
	question = "I want a powerful protective potion. (Give graymold and mandrake root.)";
	text1 = "Orbus takes the herbs, chops them up, and gets to boiling them down. He sprinkles in some other ingredients, being careful to make sure you don't see what he is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, he pours a thick fluid into a gourd and seals it with a cork. With a final mumble, he hands you the potion.";
	action = REUSABLE;
	code = 
		take_item(293);
		take_item(292);
		reward_give(237);
	break;

begintalknode 23;
	state = 13;
	nextstate = 10;
	condition = 1;
	question = "I don't need anything.";
	text1 = "He turns to a bubbling pot, mumbling something about how he hates having his time wasted.";

begintalknode 24;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "I don't need anything else.";
	text1 = "He doesn't respond. He just continues to work, muttering as he goes.";
	action = END_TALK;
	
//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 37;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 38;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 39;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 40;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 41;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 42;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 43;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 44;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 57;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 58;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 59;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 60;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 61;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 62;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 63;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 64;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

		
begintalknode 295;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Sage Asterios's elaborate network of casks works exactly as intended. The flame reaches the final cache of firedust. A massive series of explosions shakes Cotra.";
	text2 = "Fire shoots up through cracks in the floor. Sections of the cave floor glow red and melt. The shockwave alone is enough to shatter your bones.";
	text3 = "And then, one by one, the walls of Cotra collapse. Soon, there is nothing left of them but long stacks of rubble.";
	text4 = "The city of Cotra, survivor of many wars, is gone forever. Only wreckage marks its passing.";
	
////

begintalknode 299;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		