begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = 1;
	question = "Hana";
	text1 = "Hana nods at you and smiles.  _Will you be needing any training?_";

begintalknode 2;
	state = 1;
	nextstate = 2;
	question = "How will you be able to afford the taxes?";
	text1 = "She turns her head downward and speaks in a soft voice.  _I'm not entirely sure.  Obviously, it would be nice if I could..._";

begintalknode 3;
	state = 2;
	nextstate = -1;
	question = "Do you know when taxes are coming up?";
	text1 = "_No, not really._  She thinks.  _Usually, the taxman comes once each year.  Whenever he comes into town, that's when taxes are due.  I can't remember the exact date he comes at, but I know that he's coming soon._";

begintalknode 4;
	state = 1;
	nextstate = 3;
	question = "Training would be nice.  How can you train me?";
	text1 = "_Well, I can help you become more agile, if you would like.  Also, I can give you tougher skin, much like natural armor._";

begintalknode 5;
	state = 1;
	nextstate = 4;
	condition = get_flag(8,0) < 250;
	question = "You have my condolences for your dearly departed.";
	text1 = "She sighs.  _I don't need your condolences..._";
	text2 = "She clearly does.";
	code = 
		set_flag(8,0,250);
		break;

begintalknode 6;
	state = 4;
	nextstate = 5;
	question = "What kind of man was Kurojutsu?";
	text1 = "_Oh, he was very kind, a faithful partner, that sort of thing.  He always treated me nicely, almost making me feel special.  Nothing tough-skinned adventurers like yourselves would care about._";

begintalknode 7;
	state = 5;
	nextstate = -1;
	question = "You must miss him.";
	text1 = "She nods quietly to herself and begins to cry gently.  You leave her be.";
	action = END_TALK;
	code = 
		set_flag(8,0,500);
		break;

begintalknode 8;
	state = 4;
	nextstate = -1;
	question = "Walk away.";
	action = END_TALK;

begintalknode 9;
	state = 5;
	nextstate = -1;
	question = "Walk away.";
	action = END_TALK;

// begintalknode 10;
	state = 1;
	nextstate = 6;
	question = "Are you okay?";
	condition = get_flag (8,0) > 500;
	text1 = "She shakes her head.  _I apologize for getting all emotional, and whatnot..._";

// begintalknode 11;
//	state = 6;
//	nextstate = 1;
//	question = "That's fine.";
//	text1 = "She looks up and smiles briefly.  _Thanks._";
//	code = 
//		set_flag(8,0,550);
//		break;
//
// begintalknode 12;
//	state = 6;
//	nextstate = 1;
//	question = "Well, don't.  It makes you look stupid."
//	text1 = "She nods.  _Right, I'm sorry, I apologize..._";
//	code = 
//		set_flag(8,0,250);
//		break;
//
// begintalknode 13;
//	state = 6;
//	nextstate = -1;
//	question = "Walk away.";
//	action = END_TALK;
//	code = 
//		set_flag(8,0,250);
//		break;

begintalknode 14;
	state = 3;
	nextstate = -1;
	question = "Let me purchase some of your training.";
	text1 = "You finish your business.";
	code = 
		begin_shop_mode("Hana's Training","Hana obviously has many years of experience under her belt, and it shows.  She can teach you how to quicken yourself, or how to outright ignore pain.  It's quite impressive.",6,0,-1);
		break;

begintalknode 15;
	state = -1;
	nextstate = 10;
	question = "T.J. Eckleburg";
	text1 = "A man wearing large spectacles looks you over as you enter the inn.  _Greetings, and welcome to this branch office of the Inn of Blades.  How may I help you?_";

begintalknode 16;
	state = 10;
	nextstate = -1;
	question = "My, what large glasses you have.";
	text1 = "_Why, thank you!  All the better to see you with._";

begintalknode 17;
	state = 10;
	nextstate = 11;
	question = "What services can I get here, my good man?";
	text1 = "_Let me name the ways!  Ale is being sold for 2 gold, while rooms are being sold for 5._";

begintalknode 18;
	state = 10;
	nextstate = 12;
	question = "What is the Inn of Blades?";
	text1 = "He shakes his head.  _You don't know about the Inn of Blades?  It's a beautiful inn on the continent of Aizo, filled with exciting characters and lots of fun-filled adventures!_";
	text2 = "_To get there, however, you will have to purchase Blades of Exile._";
	text3 = "HINT: Buy Blades of Exile!";

begintalknode 19;
	state = 12;
	nextstate = -1;
	question = "What's Blades of Exile?";
	text1 = "He sighs and shakes his head.  Are you missing some important information?";
	text2 = "_Blades of Exile is a world similar to yours and mine, except it has many more adventures than this world, and is easy to reach._";

begintalknode 20;
	state = 11;
	nextstate = -1;
	question = "I'll take a room.  (Pay 5 coins.)";
	text1 = "He leads you to one of the inn's many vacant rooms.  The beds are fluffy but firm, and the feather pillows are relaxing.  You sleep well.";
	text2 = "";
	text3 = "He shakes his head.  _You can't afford it.  Why don't you try to earn some gold and come back later?_";
	text4 = "";
	text5 = "You have to get off of your horse beforehand.";
	action = INN 5 30 30;
	code = 
		if (get_flag(6,0) == 250){
			set_flag(11,0,350);
			toggle_quest(0,0);
			set_terrain(36,27,50);
			activate_hidden_group(1);
			set_flag(6,0,249);
		}
		else{
		end();
		}
		break;

begintalknode 21;
	state = 11;
	nextstate = -1;
	question = "I'll buy some ale.  (Pay 2 coins.)";
	condition = coins_amount() > 1;
	text1 = "He pours you a round of amber ale.  The freshness, a direct result of this inn's distance from wheat farms, is impeccable.  It goes down smoothly and gets you comfortably drunk.";
	code = 
		set_party_status(28,25,0);
		break;

begintalknode 22;
	state = 11;
	nextstate = -1;
	question = "I'll buy some ale.  (Pay 2 coins.)";
	condition = coins_amount() < 2;
	text1 = "He sighs.  _You must be really down on your luck._";
	text2 = "He slips you a few coins.";
	code = 
		change_coins(15);
		break;

begintalknode 23;
	state = -1;
	nextstate = 20;
	question = "Receptionist";
	text1 = "A woman is paging through a pulp-fiction novel as you walk into city hall.  She ignores you.";

begintalknode 24;
	state = 20;
	nextstate = -1;
	question = "May I see the mayor?";
	text1 = "She looks up at you with her right eyebrow raised, clearly annoyed.";
	text2 = "_No._";

begintalknode 25;
	state = 20;
	nextstate = 21;
	question = "Which book are you reading?";
	text1 = "She holds up the cover so you can easily read the title.";
	text2 = "The title is _Bandits II: Ballad of the Red Star_.";

begintalknode 26;
	state = 21;
	nextstate = -1;
	question = "Is Bandits II any good?";
	text1 = "_I wouldn't know, because some idiot is romping about my office, preventing me from reading it._";
	text2 = "She clearly wants you to leave.";

begintalknode 27;
	state = 20;
	nextstate = -1;
	condition = get_flag(16,0) == 50;
	question = "Excuse me, but may I see someone in the jail?";
	text1 = "She reaches under her table and presses a small button.  The gates to the north open.";
	text2 = "_There.  Now leave me be._";
	action = END_TALK;
	code = 
		set_flag(16,0,100);
		set_terrain(33,18,30);
		set_terrain(34,18,30);
		play_sound(106);
		play_sound(99);
		break;

begintalknode 28;
	state = -1;
	nextstate = 25;
	question = "Hana";
	text1 = "Hana is standing by the window of the prison, dejected.  She clearly doesn't want to be here, and the burden of her husband's death combined with her imprisonment must be hard on her.  She is, however, happy to see you here.";

begintalknode 29;
	state = 25;
	nextstate = 26;
	question = "Hana...!  Are you okay?";
	text1 = "_I'm glad you came...  I'm still alive, but things aren't going too well..._";

begintalknode 30;
	state = 26;
	nextstate = -1;
	condition = get_flag(20,0) == 0;
	question = "Is there anything we can do to help?";
	text1 = "_Now that you mention it, yes.  I clearly won't be getting out of here soon, so can you do me a favor?_";
	text2 = "_Go down to the Ashton Cemetary- it's to the south of here- and buy some roses.  Place them on Kurojutsu's grave.  It would mean so much to me._";
	code = 
		set_flag(20,0,50);
		toggle_quest(1,1);
		break;

begintalknode 31;
	state = 25;
	nextstate = -1;
	condition = get_flag(20,0) > 0;
	question = "Is there anything we can do to help?";
	text1 = "_Just place some roses on Kurojutsu's grave for me._";
	text2 = "_Please._";

begintalknode 32;
	state = -1;
	nextstate = 30;
	question = "Clark";
	text1 = "This man is walking about his shop, doing mostly nothing.  He nods at you as you walk inside.";
	text2 = "Good day to you!  My name's Clark, what can I do for you?";

begintalknode 33;
	state = 30;
	nextstate = -1;
	question = "Can I purchase some quality weapons and armor?";
	text1 = "You conclude your business.";
	code = 
		begin_shop_mode("Clark's Smithy","Clark is a talented man when it comes to working with Iron.  Perhaps it is true that he couldn't turn iron into steel to save his soul, but his goods are still relatively high-quality.",8,1,-1);
		break;

begintalknode 34;
	state = 30;
	nextstate = 31;
	question = "Do you know where I can sell or trade my items?";
	text1 = "Clark sighs.";
	text2 = "_There's a small Thieves' Guild in town that I hide in the back of my shop._";
	text3 = "_They haven't done anything wrong, so I don't see the harm in letting do-gooders like yourself in on the information._";
	text4 = "_There's a secret passage in this room that reveals a lever.  Pulling that lever will open up the Thieves' Guild, located in the back corner of my shop._";

begintalknode 35;
	state = 31;
	nextstate = 32;
	question = "How do you know that the Guild hasn't done anything wrong?";
	text1 = "_Simple.  I haven't heard of anybody getting robbed, and in a small community like this, that means that there's no robbing going on._";

begintalknode 36;
	state = 32;
	nextstate = 30;
	question = "I see.";
	text1 = "_Is there anything else I can help you with?_";

begintalknode 37;
	state = 30;
	nextstate = -1;
	question = "I'm fine, thank you.  Have a nice day.";
	action = END_TALK;
	text1 = "_Okay.  See you later._";

begintalknode 38;
	state = -1;
	nextstate = 35;
	question = "Blade";
	text1 = "This man holds an intricate dirk lying on his lap with his right hand and gives you an evil look as you approach.";
	text2 = "_You can call me Blade.  What's your business here, goody two-shoes?_";

begintalknode 39;
	state = 35;
	nextstate = -1;
	question = "Let's trade.";
	text1 = "You conclude your business.";
	code = 
		begin_shop_mode("Thieves' Guild","Blade is willing to sell items of potentially illegal use to you at a low cost.  Plus, he is also willing to give you good money for the items that you have.",9,1,5);
		break;

begintalknode 40;
	state = 35;
	nextstate = -1;
	question = "Can I join the Thieves' Guild?";
	text1 = "_Never._";
	action = END_TALK;

begintalknode 41;
	state = 35;
	nextstate = -1;
	question = "Can I do a mission for you?";
	text1 = "_Not really._";
	action = END_TALK;

begintalknode 42;
	state = -1;
	nextstate = 40;
	question = "Jeremy";
	text1 = "An incredibly handsome man is the proprietor of this establishment.  His finely woven robes reflect his debonair demeanor and ambivalent genius, whereas his rock-hard physique represents his incredible aptitude at every task imaginable.";
	text2 = "This man is not overcompensating for anything.  Nope, nothing at all.";

begintalknode 43;
	state = 40;
	nextstate = 41;
	question = "Excuse me, sir?";
	text1 = "The sexy beast of a warrior-archmage faces you and almost blinds you with his amazingly clean teeth.";
	text2 = "_Greetings.  How may I help you, little one?_";

begintalknode 44;
	state = 41;
	nextstate = 42;
	question = "What do you sell here?";
	text1 = "_Why, simple!  I sell books.  They're incredibly good books.  I am a good author.  You WANT to buy my books.  My books WANT to be read._";

begintalknode 45;
	state = 42;
	nextstate = -1;
	question = "Alcritas is a better author.";
	text1 = "He grumbles incoherently under his breath.";

begintalknode 46;
	state = 42;
	nextstate = -1;
	question = "Brett Bixler is a better author.";
	text1 = "He begins giggling like a schoolgirl.";
	text2 = "_Haha!  It is being the joke, no?  Very funny!_";
	text3 = "Oblivious fool...";

begintalknode 47;
	state = 42;
	nextstate = -1;
	question = "I'll buy some of your so-called good books.";
	text1 = "You conclude your business.";
	text2 = "(With the god of scenario design.)";
	code = 
		begin_shop_mode("Jeremy","Jeremy LeVeque is one handsome slice of manmeat.  His body rivals that of God's, but his intellect is vastly superior.  He sells books.  They are GOOD books.  YOU WANT TO BUY HIS BOOKS.",10,0,-1);
		break;

begintalknode 48;
	state = 41;
	nextstate = -1;
	question = "Say, Jeremy, how do you stay so amazing?";
	text1 = "He leans forward.";
	text2 = "_This is an insider's secret, but what you do is you become good enough at scenario design that you're making two of them each week.  Then, you stick self-indulgent, egotistical cameos of yourself in each._";
	text3 = "He laughs heartily, allowing his gargantuan, sculpted pectoral muscles to stretch against the breast of his outfit.";

begintalknode 49;
	state = 20;
	nextstate = 48;
	condition = get_flag(20,0) > 149;
	question = "I need to see the mayor NOW.  It's important.";
	text1 = "She raises her head.  _Why?_";

begintalknode 50;
	state = 48;
	nextstate = -1;
	question = "Because there are Vampires under Ashton Cemetery who are going to murder us all!";
	text1 = "She sighs.  _Just go away, okay?_";
	text2 = "You're unlikely to get anything done this way.";
	action = END_TALK;