begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = 1;
	question = "Alexander";
	text1 = "As you approach the bar, its keeper formally nods to you.  _Greetings._";
	text2 = "_I would personally like to welcome you to the Zephirium Inn.  If there is any way in which I can serve you, let me know._";

begintalknode 2;
	state = 1;
	nextstate = -1;
	question = "May I speak with your manager?";
	text1 = "He seems uneasy, but answers your question courteously nevertheless.";
	text2 = "_Certainly you may.  Manager Dryfus may be found east of the reception area, and is always eager to respond to the complements and criticims of his patrons._";

begintalknode 3;
	state = 1;
	nextstate = -1;
	question = "What do you have on tap?";
	text1 = "_We encourage you to take advantage of our hospitality and enjoy our beverages responsibly._";
	code = 
		begin_shop_mode("Zephirium Inn","The bartender here has a seemingly inexhaustable supply of high-quality alcohol.  The prices aren't too poor either.",9,2,-1);
break;

begintalknode 4;
	state = 1;
	nextstate = 2;
	question = "How much does a room cost?";
	text1 = "_A room costs 15 gold for one evening.  Will you be staying the night?_";

begintalknode 5;
	state = 2;
	nextstate = 1;
	question = "No, not tonight.";
	text1 = "_Very well.  Is there another way in which I can assist you?_";

begintalknode 6;
	state = 2;
	nextstate = -1;
	condition = coins_amount() >= 15;
	question = "Yes. (Pay 15 coins.)";
	text1 = "_I shall call an assistant to take you to your room._";
	text2 = "He walks into the room nearby, and another well-clad man leads you to your room.  The accommodations are generous, and the slumber is comfortable and clean.";
	action = INN 15 26 23;

begintalknode 7;
	state = 1;
	nextstate = -1;
	question = "What's your name?";
	text1 = "_My name is Alexander.  You need not call me by my given name, however.  Ma”tre 'd works as well._";

begintalknode 8;
	state = 1;
	nextstate = 3;
	condition = get_flag(64,0) < 2;
	question = "Have you heard any good rumors?";
	text1 = "He leans in.  _I have, sir.  Are you more interested about fantastic things, or nuances of the North Canopy government?_";
	text2 = "That's interesting, he doesn't seem to know who you are.  Or else he certainly wouldn't have dared offering you information on your government.";

begintalknode 9;
	state = 3;
	nextstate = -1;
	question = "Let's hear about the magic stuff.";
	text1 = "_Well, this one will shock you a bit.  I heard that there are tigers southwest of Schwertschrein.  Okay, nothing new, you say- but there's more.  They're intelligent!_";
	text2 = "_Also, Goblins are supposed to be extinct, right?  That priest sitting over there can tell you otherwise, or so he claims.  I doubt their claims; however, because the goblins in their story shoot out ice and fire._";
	text3 = "_That's all I know._";
	code = 
		set_flag(62,0,1);
break;

begintalknode 10;
	state = 3;
	nextstate = 4;
	condition = get_flag(64,0) < 2;
	question = "What do you know about the rulers of North Canopy?";
	text1 = "_Well, I heard that there's a secret entrance into Schwertschrein.  If you search around their walls to the northwest, you'll find it.  I've never tried, though._";
	text2 = "That's strange...  You never knew about this.  Maybe if you were to try to enter Schwertschrein that way, you would have a more covert entrance.";
	text3 = "_This one's even more bizarre.  A soldier guarding the labs in Schwertschrein started babbling on about how he saw the scientists growing a human being._";
	text4 = "_Fortress Grenze is supposed to be protecting us from Sud Canopy, but apparently, it's one step away from rebellion!  Leader isn't doing anything because he can't show any signs of weakness, though.  Maybe he'll send in the Specialists._";
	text5 = "_Fortress Grenze is supposed to be protecting us from Sud Canopy, but apparently, it's one step away from rebellion!  Leader isn't doing anything because he can't show any signs of weakness, though.  Maybe he'll send in the Specialist._";
	code = 
		set_flag(64,0,1);
		if(get_flag(3,0) < 2){
			set_flag(3,0,2);
		}
		else{
			remove_string(2);
		}

		if(party_size() > 1)
			remove_string(5);
		if(party_size() == 1)
			remove_string(4);
break;

begintalknode 11;
	state = 4;
	nextstate = 5;
	question = "You shouldn't be spreading those kind of rumors.";
	text1 = "He scowls at you and begins staring down his nose at you.";
	text2 = "_Oh, and what do you plan on doing about it?_";

begintalknode 12;
	state = 4;
	nextstate = 1;
	question = "Thanks for the info.";
	text1 = "He nods.  _And thank you for your patronage._";

begintalknode 13;
	state = 5;
	nextstate = 6;
	question = "(Tell him who you are.)";
	text1 = "You tell him that you are the Specialists of whom he spoke.  His eyes bulge open and his jaw sinks.  His face is deathly pale.  _You're...  The Specialists?_  He pauses.  _Oh...  Hell.  I simply KNEW that you looked familiar..._";
	text2 = "You tell him that you are the Specialist of whom he spoke.  His eyes bulge open and his jaw sinks.  His face is deathly pale.  _You're...  The Specialist?_  He pauses.  _Oh...  Hell.  I simply KNEW that you looked familiar..._";
	text3 = "_I-I'm sorry...  I had no idea th..._  He stops.  Then, he pulls a large sack of coins from his jacket.";
	text4 = "_These are tips I've received.  Please, take these and don't say a thing to my manager._";
	code = 
		set_flag(64,0,2);

		if(party_size() > 1)
			remove_string(2);
		if(party_size() == 1)
			remove_string(1);
break;

begintalknode 14;
	state = 6;
	nextstate = -1;
	question = "Keep your money.  You had better PRAY that nobody hears of this.";
	text1 = "He begins twitching in his place, but he also realizes that he has no power to stop you.";
	action = END_TALK;

begintalknode 15;
	state = 1;
	nextstate = 5;
	condition = get_flag(64,0) == 1;
	question = "You shouldn't be spreading those kind of rumors.";
	text1 = "He scowls at you and begins staring down his nose at you.";
	text2 = "_Oh, and what do you plan on doing about it?_";

begintalknode 16;
	state = 1;
	nextstate = -1;
	condition = get_flag(64,0) == 2;
	question = "Hey Alex, I think you should probably hand over your tip money...";
	text1 = "Joyously, he hands you the large bag filled with coins.  He seems happy to be rid of them.";
	text2 = "Although all things considered, if your accepting this money means that you don't tell his manager about his crime, it probably is better for him to have given them away.";
	action = END_TALK;
	code = 
		set_flag(64,0,3);
		change_coins(1000);
break;

begintalknode 17;
	state = 6;
	nextstate = -1;
	question = "(Take the money.)";
	text1 = "Joyously, he lets you take the large bag filled with coins.  He seems happy to be rid of them.";
	text2 = "Although all things considered, if your accepting this money means that you don't tell his manager about his crime, it probably is better for him to have given them away.";
	action = END_TALK;
	code = 
		set_flag(64,0,3);
		change_coins(1000);
break;

begintalknode 20;
	state = -1;
	nextstate = 7;
	question = "Dryfus";
	text1 = "An aged wizard is sitting at the desk here, lambently stroking his beard.  He smiles as you walk in and curtly bows thereafter.  He must recognize you.";
	text2 = "_It is always a pleasure to be host to Leader's Specialists.  You people are the reasons why this nation stays in one piece._";
	text3 = "_It is always a pleasure to be host to Leader's Specialist.  You, son, are the reason why this nation stays in one piece._";
	text4 = "_My name is Dryfus, and I own the Zephirium Inn.  How may I be of service?_";
	text5 = "Dryfus is still here, willing to talk with you.";
	action = INTRO;
	code = 
		if(party_size() > 1)
			remove_string(3);
		if(party_size() == 1)
			remove_string(2);
break;

begintalknode 21;
	state = 7;
	nextstate = 8;
	condition = get_flag(64,0) >= 1 && get_flag(65,0) == 0;
	question = "Alexander, your barkeep, has been spreading seditious rumors about North Canopy.";
	text1 = "He seems surprised.  Not immediately hostile, but suspicious all the same.";
	text2 = "_I would not say that I doubt you, but what kind of rumors is he spreading?_";

begintalknode 22;
	state = 8;
	nextstate = -1;
	question = "Umm, I forgot.  I'll ask him again and come back to you.";
	text1 = "He nods, somewhat flustered.  _Very well.  You do that._";
	action = END_TALK;

begintalknode 23;
	state = 8;
	nextstate = 7;
	question = "(Describe the rumors.)";
	text1 = "You tell him the things that Alexander has been saying about North Canopy.  He looks astonished.";
	text2 = "_I cannot believe it!  What gall.  I assure you, I will deal with this._  He walks out of the room with his personal retinue.";
	text3 = "He returns five minutes later.  _It is done.  Alexander has been sent to prison in Schwertschrein, and we will soon be hiring a new bartender.  You may visit him there if you like._";
	text4 = "Out of his robes comes a large bag with gold coins therein.  _Take it.  It is a payment for helping your nation deal with traitors.  And whenever you need a room to rest your head, just ask me._";
	code = 
		set_flag(65,0,1);
		if(get_flag(64,0) < 3){
			change_coins(1500);
		}
		else{
			change_coins(500);
		}
		erase_char(12);

break;

begintalknode 24;
	state = 7;
	nextstate = -1;
	condition = get_flag(65,0) > 0;
	question = "I would like a room for the evening.";
	text1 = "He nods.  _I understand.  You must work hard.  For you, the room will be free.  Sleep well._";
	text2 = "His retinue leads you to a room where you are able to sleep comfortably.";
	action = INN 0 26 23;

begintalknode 25;
	state = 7;
	nextstate = -1;
	question = "How are things at the Zephirium Inn?";
	text1 = "He nods contentedly.  _Not that I would worry you if things were poor, but I am proud to say that everything has been going smoothly._";
	text2 = "_When I die, this place will have only gotten richer and better.  It is a source of pride for me.  Thank you for asking._";

begintalknode 26;
	state = 7;
	nextstate = -1;
	question = "Can you assist me in any way?";
	text1 = "He shakes his head.  _I am sorry, but I have no supplies for you to use._";
	text2 = "_Rest assured, whatever I have, I would give to you if I felt that you would benefit._";

begintalknode 30;
	state = -1;
	nextstate = 9;
	question = "Milton";
	text1 = "A slightly disgruntled monk is sitting by himself at a table covered in esoteria.  When you approach, however, his face lights up.";
	text2 = "_You!  Yes, you bunch with the confused faces.  My name is Milton, wandering monk and scholar extraordinaire._";
	text3 = "_You!  Yes, you fellow with the confused face.  My name is Milton, wandering monk and scholar extraordinaire._";
	text4 = "_Won't you be pleased when you see the deals I have offered for you!  And I won't rub any of that Sud Canopy faith nonsense into your face._";
	text5 = "Milton greets you as you approach.";
	text6 = "_Welcome back!  What can I, Milton, do for you today?_";
	action = INTRO;
	code = 
		if(party_size() > 1)
			remove_string(3);
		if(party_size() == 1)
			remove_string(2);
break;

begintalknode 31;
	state = 9;
	nextstate = -1;
	condition = get_flag(62,0) == 1;
	question = "I heard from Alexander that you found some goblins.";
	text1 = "His eyes open and he begins staring at you intently.";
	text2 = "_Oh, but did I ever!  It was horrendous, and the smell!  It was unbearable.  But worse yet was their POWER.  They shot fire and acid and ice at me, and did not stop until I had fled.  I am lucky to have survived!_";
	text3 = "_If you want to find them, search to the east.  They are east of the plantation south of here._";
	code = 
		set_flag(62,0,2);
break;

begintalknode 32;
	state = 9;
	nextstate = -1;
	condition = get_flag(62,0) == 2 && get_flag(63,0) == 1;
	question = "I slew the chief of those goblins you were talking about.";
	text1 = "He looks at you as if you came out of an asylum.  Shortly thereafter, he begins laughing maniacally.";
	text2 = "_You believed me?  You moron!  You probably only beat up a holed-in bugbear who had rolled around in his own feces.  Heh.  To think, you actually believed me!  Did it shoot out fire?  Ho ho, that's rich!_";
	text3 = "He was...  Making it up?!  But...  You slew the chief...!";
	code = 
		set_flag(62,0,3);
break;

begintalknode 33;
	state = 9;
	nextstate = -1;
	question = "Milton, what is a great scholar like yourself doing here?";
	text1 = "He puts his fist proudly on his chest.  _I am a rogue scholar!_";
	text2 = "_I came from Sud Canopy.  I snuck past the Border Guard with important secrets from your enemies.  I was taken to Leader, where I was given an audience._";
	text3 = "_He quickly dismissed my information as common knowledge and as being worthless, and I was given a thousand coins for my effort before being dismissed._";
	text4 = "_So I've sorta been running around, doing whatever._";
	code = 
		set_flag(66,0,1);
break;

begintalknode 34;
	state = 9;
	nextstate = -1;
	condition = get_flag(66,0) > 0;
	question = "How have you been making a living?";
	text1 = "_I have been using my wit and unchallenged knowledge, but mostly assorted priest spells that I've mastered over the years, to further the end of...  Well, getting stuff._";
	text2 = "_The plan was to raid the bugbears and other people for goods to sell in town, but I haven't really gotten anything that other people have wanted for a while._";
	code = 
		set_flag(66,0,2);
break;

begintalknode 35;
	state = 9;
	nextstate = -1;
	condition = get_flag(66,0) == 2 && get_flag(67,0) == 0;
	question = "Wait, did you say that you were a master of the priestly arts?";
	text1 = "_Finally!  Somebody else who respects the effort it takes to devote one's mind as such._";
	text2 = "_I wasn't sure if anyone over here even USED priest spells, but if you're interested in learning some, I can teach you.  For a price, of course._";
	code = 
		set_flag(67,0,1);
break;

begintalknode 36;
	state = 9;
	nextstate = -1;
	condition = get_flag(67,0) == 1;
	question = "I would like to purchase some priestly rituals.";
	text1 = "_How refreshing.  If you ever want to learn more, I'm always ready to teach!_";
	code = 
		begin_shop_mode("Milton","Milton is a priestly scholar from Sud Canopy, and he's down on his luck.  Fortunately, you can help one another mutually by learning from him.  And indeed, he knows quite a bit.",10,0,-1);
break;

begintalknode 37;
	state = 9;
	nextstate = -1;
	condition = get_flag(66,0) > 1;
	question = "I would like to see the items you have for sale.";
	text1 = "_Come back, if ever you want something else.  Okay?_";
	code = 
		begin_shop_mode("Milton","Milton is a priestly scholar from Sud Canopy with...  Stuff.  You aren't even vaguely sure how he generated such a heap of esoterica, but it's here for you to buy anyway.",8,0,-1);
break;

begintalknode 38;
	state = 9;
	nextstate = -1;
	question = "You don't like the faith of Sud Canopy?";
	text1 = "_No way!  I ran here because I'm sick of their worshipping spirits and gods._";
	text2 = "_It's irritating and nonsensical, and I think that North Canopy is the only way to go._";
	text3 = "_Honestly.  It makes more sense this way._";