// TOWN DIALOGUE SCRIPT
// 	Town 3: Bahssikava Deeps

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;
// int i,j,k,r1,choice;

// *** Talas ***

begintalknode 1;
	state = -1;
	personality = 30;
	nextstate = 1;
	condition = 1;
	question = "Talas";
	text1 = "A slith huddles here by the fire. He looks scared and upset, but seeing you helps a little.";
	text2 = "_Thanks be to the Goddess, you are here!_ he says as soon as you approach him. _Kass said you were coming. We have been waiting._";
	text5 = "_What else do you need to know?_ he asks.";
	action = INTRO;

begintalknode 2;
	state = 1;
	personality = 30;
	nextstate = 2;
	condition = 1;
	question = "Who are you?";
	text1 = "_My name is Talas. I am an engineer from Dharmon, recently a follower of the Prophet._";
	action = SET_SDF 3 17 1;

begintalknode 3;
	state = 2;
	personality = 30;
	nextstate = 1;
	condition = 1;
	question = "An engineer? Isn't that pretty rare among sliths?";
	text1 = "_It is extremely rare. I am the son of Darklings who lived just north of Gnass, but I was separated from the tribe when I was very young. I wandered the Great Cave until Julie the fletcher took me in._";
	text2 = "_Julie quietly raised me in Dharmon as her own child until one day, when I was an adolescent during the Empire-Avernum War, Sarah of the Temple of the Crossed Blades talked to me and discovered that I was very intelligent._";
	text3 = "_She took me with her to the Tower of Magi, where the mages taught me mathematics and physics. I went back to the front lines of the war and worked alongside the vahnatai, who taught me even more._";
	text4 = "_For the past few years since the treaty, I was living in the Castle, the only slith advisor to the king. When the Prophet's call came out, though, I knew I had to leave._";
	text5 = "He chuckles. _And that is how I became an engineer for the Prophet._";
	
begintalknode 4;
	state = 1;
	personality = 30;
	nextstate = 3;
	condition = 1;
	question = "Why have you been waiting?";
	text1 = "_Kass sent us ahead to repair the bridges. When we repaired the two bridges you just saw, we discovered the huge metal gates beyond the second bridge. We told Kass about them._";
	text2 = "_He wanted us to come back down here and open them, but we've tried just about everything we can think of, and we can't get them open. They are beyond our skill. They were devised by the Bahssikavans, who were better engineers than we are._";
	text3 = "_We think we know what we need, but we don't know where to find it._";
	action = SET_SDF 3 17 1;

begintalknode 5;
	state = 3;
	personality = 30;
	nextstate = 1;
	condition = 1;
	question = "What do you need?";
	text1 = "_The metal gates just to the south of here have a strange design, a six-pointed star that is missing all its points. We think we need six metal triangles that would fill in the missing points._";
	text2 = "_Unfortunately, we don't know where even to begin looking for small metal triangles. We can't report back to Kass that we have failed, so we are stuck here until we find those triangles._";
	text3 = "He smiles. _Or rather, until YOU find them, now._";
	code =
	set_flag(3,9,1);
	set_flag(3,14,1);
break;
	
begintalknode 6;
	state = 1;
	personality = 30;
	nextstate = 1;
	condition = ((has_special_item(1) > 0) && (has_special_item(1) < 0)) && (get_flag(3,14) == 1);
	question = "We have some of those metal triangles you were looking for.";
	text1 = "_You do? Do you have all six?_ he asks excitedly. You shake your head. He looks disappointed. _Oh well. Keep looking. The rest should be out there somewhere._";

begintalknode 7;
	state = 1;
	personality = 30;
	nextstate = 1;
	condition = (has_special_item(1) == 6) && (get_flag(3,14) == 1);
	question = "We have all six of those metal triangles you were looking for.";
	text1 = "_Really?_ he says excitedly. You show him. _Go and open the gates, then! We'll be right behind you._";
	action = SET_SDF 3 15 1;