// TOWN DIALOGUE SCRIPT
//    Town 121: Lava Peninsula

begintalkscript;

variables;

short i,j,k,r1,choice;

// Balorus

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Balorus";
	text1 = "This stone island protrudes from the magma. An efreet, eight feet tall, frighteningly muscled, stands on it. He stares down at you, his arms crossed.";
	text2 = "The efreet considers whether you are weak enough to be easy prey. He decides, wisely, to parley instead. He bows at the waist in greeting. _I know not who you are or of what you seek, but I, Balorus, welcome you to my humble smithy._";
	text5 = "Balorus watches you calmly. _This is my business time. Is there any other way you can be helped by me?_ He has calm, formal, heavily accented speech.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What are you doing out here?_";
	text1 = "_We efreeti are an old and magical race, and sometimes we must practice our skills._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Are you evil?_";
	text1 = "_Of course not. I am a creature of justice. I deal with those I respect and destroy the weak and foolish. That is how justice works, though we must claim to feel otherwise._";
	
begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Tell us about the efreeti._";
	text1 = "_We are creatures of sulphur and ash, lava and fire. Heat is to us as water is to you. Upon heat we thrive._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Is your magic powerful?_";
	text1 = "_Yes. Very. We place great value on our magical powers. Unfortunately, others value them too._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_Do others try to take advantage of your skills?_";
	text1 = "_Mighty mages often enslave us for our powers. These mages, when we get to them, suffer greatly for their temerity. It is the sad and eternal way of things._";

begintalknode;
	state = 1;
	nextstate = 5;
	question = "_What are all of the tools here for?_";
	text1 = "_I am a weaponsmith. Such is the reason I am here._";

begintalknode;
	state = 5;
	nextstate = 6;
	question = "_You make weapons?_";
	text1 = "_We efreeti supplement our magic with powerful physical weapons._ He holds up a massive scimitar. _Our skill with steel is legend. Some pay us great tribute for our blades, which can have great strength._";

begintalknode;
	state = 6;
	nextstate = -1;
	question = "_How do you make such powerful weapons?_";
	text1 = "_We have many secrets. For example, I can take a non-magical weapon and dip it into the lava. Then, when I pull it out, it will be aflame, and this flame will never be extinguished. ";
	text2 = "_It does not come cheaply, but this treatment can be obtained from us._";

begintalknode;
	state = 1;
	nextstate = 7;
	condition = gf(121,11) == 0;
	question = "_Can you sell me any of your equipment?_";
	text1 = "_You do not yet have the privilege. You have not honored us, so I can't let you share in our fine goods._";

begintalknode;
	state = 7;
	nextstate = 8;
	question = "_How may we receive that honor?_";
	text1 = "_You must pay me a tribute. I need valuable metals to do my work. Five thousand human coins will suffice._";

begintalknode;
	state = 8;
	nextstate = -1;
	condition = gf(121,11) == 0;
	question = "_Five thousand coins? That is ridiculous!_";
	text1 = "_Suit yourselves. I will return to my work._ He turns away from you.";
	action = END_TALK;

begintalknode;
	state = 8;
	nextstate = 1;
	condition = gf(121,11) == 0;
	question = "_Fine. I'll pay you._ (Give him 5000 coins.)";
	text1 = "He takes the coins and waves a hand over them. There is a burst of flame, and they are gone. _There. You have honored us, and we will honor you. You may buy our goods._";
	text3 = "_Do not insult me humans! Five thousand coins, or no dealings with me!_";
	code =
		if (coins_amount() < 5000)
			rs(1);
			else {
				rs(3); 
				change_coins(-5000);
				sf(121,11,1);
				}
	break;
	

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(121,11) >= 1;
	question = "_Sell me some of your equipment?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Balorus","Balorus promised that his equipment was very high-quality. He did not lie.",91,4,3);
	break;
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_Then go. I would not have you see me work. Our secrets are secret._";
	action = END_TALK;
