1/*
2 *
3 *  Copyright (C) 2006  The Exult Team
4 *
5 *  This program is free software; you can redistribute it and/or modify
6 *  it under the terms of the GNU General Public License as published by
7 *  the Free Software Foundation; either version 2 of the License, or
8 *  (at your option) any later version.
9 *
10 *  This program is distributed in the hope that it will be useful,
11 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 *  GNU General Public License for more details.
14 *
15 *  You should have received a copy of the GNU General Public License
16 *  along with this program; if not, write to the Free Software
17 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 *
20 *	This source file contains usecode to make the NPC use the
21 *	Generic Healing Service.
22 *
23 *	Author: Marzo Junior
24 *	Last Modified: 2006-06-18
25 */
26
27//Externs:
28//extern void leighHeal 0x8AC (var price_heal, var price_cure, var price_resurrect);
29
30void Leigh object#(0x4C9) ()
31{
32	if (event == DOUBLECLICK)
33	{
34		var avatartitle = getPoliteTitle();
35		if (!gflags[MET_LEIGH])
36		{
37			item.say("This attractive woman gives you an approving look.");
38			gflags[MET_LEIGH] = true;
39		}
40		else
41			item.say("@Greetings, ", avatartitle, ".@ Leigh smiles at you.");
42
43		add(["name", "job", "bye"]);
44		if (gflags[CAN_EXAMINE_STONE_CHIPS] && gflags[KNOWS_LEIGH_IS_HEALER])
45				add("examine chips");
46
47		converse (0)
48		{
49			case "name" (remove):
50				say("She blushes. @I am Lady Leigh.@");
51
52			case "job":
53				say("@I am the Healer of Serpent's Hold.@");
54				add(["Serpent's Hold", "heal"]);
55				gflags[KNOWS_LEIGH_IS_HEALER] = true;
56				if (gflags[CAN_EXAMINE_STONE_CHIPS])
57					add("examine chips");
58
59			case "heal" (remove):
60				if (get_schedule_type() == TEND_SHOP)
61					//leighHeal(25, 8, 385);
62					serviceHeal();
63				else
64					say("@I am sorry, but I have too many other patients to help thee now. Perhaps when I next open my shop.@");
65
66			case "Serpent's Hold" (remove):
67				say("@Lord Jean-Paul is in charge of keeping the order here, but Sir Denton would be an even better source of information about Serpent's Hold.@");
68				add(["John-Paul", "Denton"]);
69
70			case "John-Paul" (remove):
71				say("@He is an easy man to find, for Sir Horffe hardly ever leaves his side. Watch for the tall, muscular gargoyle.@");
72				if (!gflags[DOING_STATUE_QUEST])
73					say("@In fact,@ she says, looking off in the distance, @I believe he may have a desire to speak with thee. Perhaps thou shouldst truly seek him out.@");
74				say("@If thou hast business about the town, and are not able to locate John-Paul, thou mightest wish to speak with Sir Richter.@");
75				add(["Horffe", "Richter"]);
76
77			case "Horffe" (remove):
78				say("@He was found at a very young age, apparently abandoned by his father. Two people took and raised him as their own. As thou couldst see simply by meeting him, he is a very noble person and a stout warrior.@");
79
80			case "Richter" (remove):
81				say("@He is the armourer. His shop is in the back of the Hold.@");
82
83			case "Denton" (remove):
84				say("@He is the tavern keeper at the Hallowed Dock, just inside the Hold's doors. He is wonderful at remembering and discussing important facts.@");
85
86			case "examine chips" (remove):
87				if (contHasItemCount(PARTY, 1, SHAPE_STONE_CHIPS, QUALITY_ANY, 4))
88				{
89					//Usecode bug: flag 0x268 is used exactly this once in the entire
90					//BG usecode. I assume that they switched the flag number during
91					//production, which made this into a bug.
92					//if (gflags[0x268])
93					//Instead, I check to see if the chips have been examined:
94					if (gflags[EXAMINED_CHIPS])
95						say("She looks at you, puzzled. @Did I not do that already?@");
96					else
97					{
98						say("She takes the stone chips from you and examines them. Using several vials of strange and unusual mixtures, she analyzes the blood. Finally, after a few silent minutes, she looks up, grinning.",
99							"~~@I have determined the nature of the blood. It is definitely not human. In fact,@ she looks back down at the sample and raises one eyebrow, @it is gargoyle blood.@");
100						add("gargoyle blood");
101						gflags[EXAMINED_CHIPS] = true;
102					}
103				}
104				else
105					say("@I am afraid that I must be able to see them to examine them.@");
106
107			case "gargoyle blood" (remove):
108				say("She appears thoughtful.",
109					"~~@What is odd, ", avatartitle,
110					", is that there is only one gargoyle in Serpent's Hold. But I cannot imagine Sir Horffe would have had anything to do with this wanton destruction.@");
111
112			case "bye":
113				say("@Farewell, ", avatartitle, ".@*");
114				break;
115		}
116	}
117	else if (event == PROXIMITY)
118		scheduleBarks(LEIGH);
119}
120