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 several functions used by the blacksword,
21 *	including dialog with Arcadion in all forms.
22 *
23 *	Author: Marzo Junior
24 *	Last Modified: 2006-02-27
25 */
26
27//For better coding of the blacksword creation sequence:
28const int BLACKSWORD_SWING_EVENT					= 1;
29const int BLACKSWORD_LIGHTNING_EVENT				= 2;
30
31void killLordBritish (var lordbritish)
32{
33	//Lord British is close enough to kill:
34	if (AVATAR->get_distance(lordbritish) < 5)
35	{
36		//The dialog with Lord British:
37		say("@Yes! I have long sought the end of Lord British, my traitorous master.@");
38		LORD_BRITISH.say("@", getAvatarName(), ", for what reason art thou brandishing that black sword in my presence?@");
39		AVATAR->show_npc_face(UI_is_pc_female());
40		say("The daemon responds, using your mouth. @This blade is thy doom,...@ You spit the words, @Lord British!@");
41		LORD_BRITISH.say("Lord British looks truly taken aback, his eyes narrow calculatingly. @What foul treachery is this?@");
42		AVATAR->show_npc_face(UI_is_pc_female());
43		say("You find yourself unable to respond, and your muscles are clenching as if to lash out with the wicked blade in your hand.");
44		LORD_BRITISH.say("@Perhaps when thou art sitting in a dungeon, thy tongue will loosen.");
45		LORD_BRITISH.say("@Guards!@*");
46
47		//The direction the avatar must face:
48		var dir = directionFromAvatar(lordbritish);
49
50		//Avatar strikes his liege:
51		script AVATAR
52		{
53			face dir;					actor frame ready;			wait 2;
54			actor frame raise_2h;		wait 2;						actor frame reach_2h;
55			wait 1;						actor frame strike_2h;		wait 2;
56			actor frame standing;
57		}
58
59		//Lord British is awake:
60		if (!lordbritish->get_item_flag(ASLEEP))
61		{
62			//Direction Lord British must face:
63			dir = ((dir + 4) % 8);
64
65			//Lord British tries to defend himself, but dies anyway:
66			script lordbritish
67			{
68				face dir;					wait 3;						actor frame ready;
69				wait 7;						call killTarget;
70			}
71		}
72
73		//You cod, striking down your liege while he is ASLEEP???
74		else
75			//Kill Lord British:
76			script lordbritish {wait 12;	call killTarget;}
77	}
78
79	//Lord British is too far away to kill:
80	else
81		say("The Shade Blade lets out a harsh whisper. @Move a little closer to him, and I'll perform this task for thee, master.@");
82}
83
84var isCloseEnoughtToKill (var target, var answer)
85{
86	if (AVATAR->get_distance(target) < 5)
87		return true;
88
89	else
90	{
91		say(answer);
92		return false;
93	}
94}
95
96void killAnimation (var target)
97{
98	//The direction the avatar must face:
99	var dir = directionFromAvatar(target);
100
101	//Avatar strikes his foe:
102	script AVATAR
103	{
104		face dir;					actor frame ready;			wait 1;
105		actor frame raise_2h;		wait 1;						actor frame reach_2h;
106		wait 1;						actor frame strike_2h;		wait 2;
107		actor frame standing;
108	}
109
110	//Target is awake:
111	if (!target->get_item_flag(ASLEEP))
112	{
113		//Direction target must face:
114		dir = ((dir + 4) % 8);
115
116		//Target tries to defend itself and dies anyway:
117		script target
118		{
119			face dir;					wait 2;						actor frame ready;
120			wait 4;						actor frame bowing;			wait 1;
121			actor frame kneeling;			wait 1;						call killTarget;
122		}
123	}
124
125	//In a great display of valor and honor, the avatar kills a sleeping foe:
126	else
127		script target {wait 12;		call killTarget;}
128}
129
130void arcadionSwordFormDialog object#() ()
131{
132	BLACK_SWORD_FACE->show_npc_face(0);
133
134	if (gflags[MET_ARCADION])
135		say("@Yes, master. What dost thou seek of thy servant?@ Arcadion asks you in a deep, harmonic voice.");
136
137	else
138	{
139		say("The sword glimmers darkly as you speak to it. @Greetings, my master. And how can thy humble servant aid thee?@ The daemon's voice has regained much of its oddly disturbing humor.");
140		gflags[MET_ARCADION] = true;
141	}
142
143	add(["name", "job", "bye", "powers"]);
144	if (gflags[SCROLL_OF_INFINITY] && (!gflags[BANISHED_EXODUS])) add("help");
145
146	converse(0)
147	{
148		case "name" (remove):
149			say("The daemon sword's tone is rather ominous as he says, @I am, and ever shall be, thy servant Arcadion.@");
150
151		case "job" (remove):
152			say("@I am the Shade Blade. My destiny is to serve thee until we are...@ The sword pauses, @parted.@");
153
154		case "powers":
155			if (!AVATAR->is_readied(BG_WEAPON_HAND, SHAPE_BLACK_SWORD, FRAME_ANY))
156				say("@I needs must be in thy hand, master, if thou wishest to use my powers.@");
157			else
158			{
159				say("@Which of my powers dost thou seek to use?@");
160				converse(["Magic", "Fire", "Death", "Return", "none"])
161				{
162					case "none":
163						say("@As thou wish, master. I but seek to serve thee.@");
164						break;
165
166					case "Magic":
167						var part_of_day = UI_part_of_day();
168						if ((part_of_day == NIGHT) || ((part_of_day == MIDNIGHT) || (part_of_day == EARLY)))
169							replenishMana(true);
170						else
171							say("The blade croons quietly, @Alas, master. My energies seem a trifle low. Perhaps if thou were to find some creature to slay, my power would be sufficient. After all, I have needs just as thou dost.@");
172
173					case "Death":
174						say("@Where is the corpse of which thou dost speak?@ The dark sword begins to vibrate in your hand.*");
175						BLACK_SWORD_FACE.hide();
176
177						var target = UI_click_on_item();
178						var target_shape = target->get_item_shape();
179						var target_position = target->get_object_position();
180
181						BLACK_SWORD_FACE->show_npc_face(0);
182
183						if (target->is_npc())
184						{
185							if ((target_shape == SHAPE_MALE_AVATAR) || (target_shape == SHAPE_FEMALE_AVATAR))
186								say("The daemon speaks with a sanctimonious tone. @I could not in honor take the life of my most wondrous master.@");
187
188							else if (target_shape == SHAPE_LORD_BRITISH)
189							{
190								killLordBritish(target);
191								return;
192							}
193
194							else if ((target_shape == SHAPE_BATLIN) || (target_shape == SHAPE_BATLIN2))
195								say("@Alas master, this one is protected by a power greater than mine. His destiny lies elsewhere.@");
196
197							else if (isUndead(target_shape))
198								say("The sword recoils in something akin to horror. @That creature is beyond even my power. I suggest that thou hackest it to bits, if possible, then burn the pieces.@ Arcadion offers helpfully.");
199
200							else if (target->get_npc_number() == ZAURIEL)
201								say("The sword recoils in something akin to horror. @This one is beyond even my power. I suggest that thou hackest him to bits, if possible, then burn the pieces.@ Arcadion offers helpfully.");
202
203							else if (target->get_npc_number() == LAURIANNA)
204								say("The sword recoils in something akin to horror. @Alas, master, I dare not. Her power is so great it would destroy us both were I to kill her.@");
205
206							else if (target_shape == SHAPE_DRAGON)
207							{
208								if (isCloseEnoughtToKill(target, "The Shade Blade croons sofltly. @Move a little closer to the dragon, and I'll end its life for thee, master.@"))
209								{
210									if (target->get_cont_items(SHAPE_SCROLL, 241, 4))
211									{
212										say("@Ah, Dracothraxus. We meet once again. 'Tis a pity thou shan't survive our meeting this time. Perhaps if thou hadst given the gem to me when first I asked, none of this unpleasantness would be necessary.@");
213
214										DRACOTHRAXUS_FACE->show_npc_face(0);
215										say("The dragon responds with great resignation. @My will is not mine own in this matter, Arcadion. Mayhap thou art finding too, that thy will is not thine own.@");
216										DRACOTHRAXUS_FACE.hide();
217
218										say("The daemon, possibly stung by the dragon's repartee, falls silent and goes to its bloody work.*");
219									}
220									killAnimation(target);
221									return;
222								}
223							}
224
225							else if (target_shape == SHAPE_MONSTER_MAGE)
226							{
227								if (isCloseEnoughtToKill(target, "@Move closer to him, and I'll see that his life plagues thee no more.@ The dark sword sounds almost gleeful at this prospect."))
228								{
229									if (target->get_cont_items(SHAPE_SCROLL, 240, 4))
230										say("@I owe thee quite a favor for this, master. I thank thee for allowing me this, my revenge!@*");
231
232									killAnimation(target);
233									return;
234								}
235							}
236
237							else if (target_shape == SHAPE_GOLEM)
238								say("@This creature is not strictly speaking,... living. Thy best course of action would be to smash it to pieces@ You hear a smile in Arcadion's voice.");
239
240							else if (isWorthyToKill(target_shape))
241							{
242								if (isCloseEnoughtToKill(target, "@I must get closer to this one in order to enjoy its essence.@ The blade hums eagerly as it tugs in the direction of your selected target."))
243								{
244									say("@Very well, master. If thou cannot dispatch this foe thyself, I shall do it for thee.@");
245									killAnimation(target);
246									return;
247								}
248							}
249
250							else
251								say("The daemon sword abruptly ceases its vibration. @This being is hardly worth a death the likes of which I would visit upon it. Call upon me again when thou art faced with a more worthy opponent.@");
252						}
253
254						else
255						{
256							if (isCorpseShape(target_shape))
257								say("@Perhaps thou misunderstands my meaning. I do not raise the dead... I slay the living.@ The last is spoken in a sibilant whisper.");
258
259							else if (!target_shape)
260								say("@Thou wouldst have me destroy the very world around thee. Not a very bright idea for such a virtuous one as thou art thought to be.@ A strangely metallic chuckle escapes from the sword.");
261
262							else if (target_shape == SHAPE_FERRYMAN)
263								say("The sword recoils in something akin to horror. @That one is beyond even my power.@");
264
265							else if ((target_shape == SHAPE_DRAFT_HORSE) || (target_shape == SHAPE_WOUNDED_MAN))
266								say("The daemon sword abruptly ceases its vibration. @This being is hardly worth a death the likes of which I would visit upon it. Call upon me again when thou art faced with a more worthy opponent.@");
267
268							else if (target_shape == SHAPE_BLACK_SWORD)
269								say("@Thou shall not be rid of me quite so easily, my master. However, I do not begrudge thine attempt. Quite to the contrary. I respect thy resourcefulness.@");
270
271							else if (target_shape == SHAPE_DARK_CORE)
272								say("@Would that I had such power. That artifact would allow me to return to my home plane if only I could unlock its secrets.@");
273
274							else
275								say("@Hast thou such a grudge against this inanimate object that thou wouldst see it perish forever?@ His voice is laden with undisguised sarcasm. @I cannot take life from that which is already lifeless.@");
276						}
277
278					case "Return":
279						if (!inIsleOfFire())
280						{
281							say("@Ah... home again. I never tire of rocky little islands. Dost thou truly wish to go to the forsaken Isle of Fire?@");
282							if (askYesNo())
283							{
284								say("@I see. Very well, master. But let us not forget this little favor...@ The gem in the hilt of the sword glows brightly then everything dims.*");
285								script item {wait 1;	call teleportIsleOfFire;}
286								return;
287							}
288
289							else
290								say("@It is good. Sense returns to the Virtuous Wonder. Thou art truly without peer in the arena of thought, master.@");
291						}
292
293						else
294							say("@Forgive me, master, but are we not already on or near the Isle of Fire? Though, why one would wish to remain here on this forsaken piece of rock, I have no idea.@");
295
296					case "Fire":
297						say("@And what, pray tell, is the intended target of thy immense and most puissant wrath, O' Master of Infinite Destruction?@");
298						BLACK_SWORD_FACE.hide();
299						item->createFire();
300						return;
301				}
302			}
303
304		case "help" (remove):
305			say("Arcadion's voice is smug as he replies to your request for assistance. @Yes, I can help thee if thou wishest to exile what remains of Exodus to the Void. Firstly, thou shalt have need of the lenses of which the doddering, old fool spoke. Next thou needs must have the three Talismans of Principle. And finally, make sure that there are lit torches upon the walls to either side of the pedestal upon which the Dark Core rests.");
306			add(["lenses", "talismans"]);
307
308		case "lenses" (remove):
309			say("@The concave and convex lenses which thou used to place the Codex of Infinite Wisdom within the Void, I believe now sit forgotten in the Museum of Britannia. They must be placed between the Dark Core and the torches on either side of the pedestal@");
310
311		case "talismans" (remove):
312			say("@The Talismans of Principle must be placed upon the Dark Core like wedges in a pie.@");
313
314		case "bye":
315			say("@Forgive me master, but I shan't be leaving. However, thou mayest cease thy speaking... if thou dost wish it.@*");
316			return;
317	}
318}
319
320void blackswordCreationAnimation object#() ()
321{
322	//The original used global flags for this; they *could* have used quality instead...
323	//I use event levels since they are available on Exult for UCC scripts.
324	//Also, this was originally in the arcadionDialog function.
325	if (event == BLACKSWORD_SWING_EVENT)		//(!gflags[BEGIN_BOND])
326	{
327		script AVATAR
328		{
329			face south;					actor frame strike_2h;		wait 1;
330			actor frame reach_2h;		wait 1;						actor frame raise_2h;
331			wait 1;
332		}
333
334		script item after 7 ticks
335			call blackswordCreationAnimation, BLACKSWORD_LIGHTNING_EVENT;
336
337		//gflags[BEGIN_BOND] = true;
338		return;
339	}
340
341	else if (event == BLACKSWORD_LIGHTNING_EVENT)	//(!gflags[FINISHED_BOND])
342	{
343		var pos = AVATAR->get_object_position();
344		UI_sprite_effect(ANIMATION_LIGHTNING, pos[X], pos[Y], 0, 0, 0, 3);
345		UI_sprite_effect(ANIMATION_LIGHTNING, pos[X], pos[Y], 0, 0, 0, -1);
346		UI_play_sound_effect(0x003E);
347
348		script item after 3 ticks
349			//call arcadionDialog;
350			call arcadionSwordFormDialog;
351
352		//gflags[FINISHED_BOND] = true;
353		return;
354	}
355}
356
357void arcadionGemFormDialog object#() ()
358{
359	ARCADION_GEM_FACE->show_npc_face(0);
360
361	var dont_add_master = false;
362	var msg;
363
364	if (!gflags[MET_ARCADION])
365	{
366		say("The little gem pulses with energy, @Now all Britannia shall feel my wrath. I'll make them all pay for every decade I spent within that accursed mirror!@ The gem glows brighter, and you expect the world to come apart at the seams... then, nothing. @NO!@ The daemon's primal scream sounds a bit crystalline through the medium of the gem. @This cannot be! That old fool was right. I'm still trapped!@ The daemon's anguished voice falls silent.");
367		gflags[MET_ARCADION] = true;
368		add(["name", "job", "wrath", "trapped", "bye"]);
369	}
370
371	else
372	{
373		say("The gem sparkles up at you, @Yes, master. How may I serve thee?@ Arcadion's voice is subdued.");
374		add(["name", "job", "master", "bye"]);
375	}
376
377	if (gflags[TALKED_ABOUT_BINDING_GEM])
378		add("black sword");
379	if (gflags[ARCADION_SLAVE])
380		add("power");
381
382	converse (0)
383	{
384		case "black sword" (remove):
385			say("@If thou dost wish me to bond the gem to the sword, thou hast but to command me, master.@");
386			add("bond");
387
388		case "bond" (remove):
389			if (swordBlankAndGemInHands())
390			{
391				var blacksword_blank = AVATAR->get_cont_items(SHAPE_SWORDBLANK, QUALITY_ANY, 15);
392				var daemon_gem = AVATAR->get_cont_items(SHAPE_GEM, QUALITY_ANY, 13);
393
394				blacksword_blank->remove_item();
395				daemon_gem->remove_item();
396
397				var blacksword = UI_create_new_object(SHAPE_BLACK_SWORD);
398				blacksword->set_item_frame(0);
399
400				say("@It will be done!@");
401				say("As the gem touches the crosspiece of the sword, the sound of tearing metal screeches through the air. The blade shifts and shimmers almost as if alive.");
402
403				if (AVATAR->give_last_created())
404					say("Slowly, the sword settles into its original shape, except for the blue gem glowing in the hilt.");
405				else
406				{
407					say("There is a flash of what can only be described as black light and the sword is wrenched out of your grasp and falls to the ground.");
408					var pos = AVATAR->get_object_position();
409					UI_update_last_created(pos);
410				}
411
412				gflags[COMMANDED_BOND] = true;
413				gflags[MET_ARCADION] = false;
414
415				script blacksword
416				{
417					finish;			nohalt;
418					call forceGiveBlackSword;	//Maybe not needed?
419					call blackswordCreationAnimation, BLACKSWORD_SWING_EVENT;
420				}
421				return;
422			}
423			else
424				say("@The sword and gem must be in thy hands for the bonding to be accomplished.@");
425
426		case "name" (remove):
427			say("@My name is still Arcadion, although my prison has changed.@");
428
429		case "job" (remove):
430			say("@I am now thy servant. What is thy bidding, master?@");
431			if(!dont_add_master)
432				add("master");
433
434		case "wrath" (remove):
435			say("Arcadion sounds a bit pensive as he replies, @Forgive my momentary indiscretion, master. My bitter emotions overcame my reasoning for a brief time. I shall not let it happen again.@");
436			if (!dont_add_master)
437				add("master");
438
439		case "trapped" (remove):
440			if (!gflags[MET_ERETHIAN])
441				msg = "the mage Erethian";
442			else
443				msg = "Erethian";
444			say("@It would seem that ", msg, " was correct in his assumption that should I enter this gem, my power would not be set free to use as I wish, instead it is at the beck and call of the one who possesses the gem.@");
445			gflags[ARCADION_SLAVE] = true;
446			add("power");
447
448		case "power" (remove):
449			if (!gflags[ACCEPTED_GEM_POWER])
450			{
451				say("You hear a faint sigh, then, @Wouldst thou care to partake of my power?@");
452				if (askYesNo())
453				{
454					say("Arcadion sounds disappointed, @It is as I knew it would be. I am forever meant to be the slave of weak-willed mortals. Very well then, prepare thyself to recieve a portion of my vast eneregy.");
455					gflags[ACCEPTED_GEM_POWER] = true;
456					replenishMana(false);
457				}
458				else if (!gflags[REFUSED_GEM_POWER])
459				{
460					say("@Perhaps I misjudged thee, master.@ He pauses for a thoughtful moment, @Mayhap in time thou canst call me friend as well as ally.@");
461					gflags[REFUSED_GEM_POWER] = true;
462				}
463				if(!dont_add_master)
464					add("master");
465			}
466
467			else
468			{
469				say("@Thou hast need of my energies again?@ Arcadion asks a little petulantly.");
470				if(askYesNo())
471				{
472					say("@Very well, prepare thyself.@ The gem glows.");
473					replenishMana(false);
474				}
475				else if (!gflags[REFUSED_GEM_POWER])
476				{
477					say("@What dost thou seek of me...@ A pause, @Master?@");
478					gflags[REFUSED_GEM_POWER] = true;
479				}
480				else
481					say("@Dost thou seek to torment me with useless questions, or may I be of some service...@ A long pause, @Master.@");
482
483				if(!dont_add_master)
484					add("master");
485			}
486
487		case "master" (remove):
488			say("The daemon pauses for a moment, @Thou hast imprisoned my physical form, I am therefore bound to thy will by powers far older than thou or I wield. What wouldst thou have of me?@");
489			add("bound");
490			dont_add_master = true;
491
492		case "bound" (remove):
493			say("@Long ago, even by my accounting of time, my people were defeated by a powerful race of beings in an attempt to conquer this realm. This race lived here long before the coming of thy sovereign, Lord British. My poeple were defeated and they expected death, but these great and powerful beings were not destroyers. However, they also did not wish futher disruption by my kind. So they weaved enchantments beyond the ken of my race, binding us to the inhabitants of this realm. Thine own people merely use the existing enchantments to keep us enslaved, sometimes without an incling of how this was achieved.@");
494
495		case "bye":
496			say("@Farewell my master.@ The gem seems to dim a little.*");
497			break;
498	}
499}
500
501var isErethianHere()
502{
503	var mage_list = find_nearby(SHAPE_MONSTER_MAGE, 10, MASK_NPC2);
504	for (mage in mage_list)
505	{
506		if (mage->get_cont_items(SHAPE_SCROLL, 240, 4))
507			return true;
508	}
509	return false;
510}
511
512var isArcadionGemNearby ()
513{
514	var nearby_gems = find_nearby(SHAPE_GEM, 15, MASK_NONE);
515	if (nearby_gems)
516		return arcadionGemInList(nearby_gems);
517	else
518		return false;
519}
520
521void arcadionMirrorFormDialog object#() ()
522{
523	ARCADION_MIRROR_FACE->show_npc_face(0);
524
525	var msg;
526
527	if (isErethianHere())
528	{
529		say("@Yes, Master. How may I serve thee?@ The dark form in the mirror bows deeply.");
530
531		if (gflags[MET_ERETHIAN]) msg = "Erethian";
532		else msg = "the mage";
533
534		ERETHIAN_FACE->show_npc_face(1);
535		say("Surprised, ", msg, " looks around and says, @I don't recall summoning thee. Nevermind, I have no need of thee at the current time. Begone!@ The old man waves his hand, negligently.");
536
537		ARCADION_MIRROR_FACE->show_npc_face(0);
538		say("Through a tightly clenched smile, the figure replies, @Very well...@ And after a significant pause, @Master.@*");
539		arcadionMirrorHide();
540		return;
541	}
542
543	if (gflags[HELPING_ARCADION])
544	{
545		if (gflags[TALKED_ARCADION_WITH_GEM])
546		{
547			say("Arcadion appears truly astonished, @For what dost thou wait?! I beg of thee! Release me!@");
548			arcadionMirrorHide();
549			return;
550		}
551		else
552		{
553			if (isArcadionGemNearby())
554			{
555				say("@There is a gem nearby that can free me! It is a small blue stone. Take it, quickly, and use it to free me of this accursed mirror!@ The large daemon seethes with pent up frustration.*");
556				gflags[TALKED_ARCADION_WITH_GEM] = true;
557				arcadionMirrorHide();
558				return;
559			}
560
561			else if (PARTY->count_objects(SHAPE_GEM, QUALITY_ANY, 12))
562			{
563				say("@Thou hast within thy possessions a small blue gem. It can be used to free me! Crack this accursed mirror with it! I'll enter it as I am freed!@ Arcadion looks prepared to burst from the mirror.*");
564				gflags[TALKED_ARCADION_WITH_GEM] = true;
565				arcadionMirrorHide();
566				return;
567			}
568
569			say("@Can I be of some small assistance in thy quest to release me. If so, thou hast but to ask.@ Arcadion's smile stretches from ear to ear.");
570			add(["name", "job", "release", "bye"]);
571		}
572	}
573
574	else if (gflags[REFUSED_HELP_ARCADION])
575	{
576		say("@Run along now little mortal. Do not pester thy betters with the idle rantings of thy tongue.@ He appears at first nonchallant, then his expression becomes intense, @That is unless thou hast reconsidered my offer... Hast thou?@");
577		if (askYesNo())
578		{
579			say("A wicked look of triumph flickers across Arcadion's face to be quickly replaced by a ludicrous semblance of gratitude, @Thou art truly courageous to vow to release me. My eternal thanks are thine.@ An oily grin coats the daemon's face, @Thou hast made quite a powerful ally this day, mortal.@ His eyes blink in what is possibly meant to be a charming manner.");
580			gflags[HELPING_ARCADION] = true;
581			add(["name", "job", "daemon", "release", "bye"]);
582		}
583		else
584		{
585			say("@Ah, I see. Still content to run about with the other sheep.@ He waves you off and dims from sight.*");
586			arcadionMirrorHide();
587			return;
588		}
589	}
590
591	else if (!gflags[MET_ARCADION])
592	{
593		say("@Yes, Master. How may I serve thee...@ The wavering visage in the mirror hesitates for a moment, @Thou art not my master.@");
594		say("He then continues with a small bow, @Greetings Britannian. What dost thou wish of the great daemon, Arcadion?@");
595
596		gflags[MET_ARCADION] = true;
597		add(["name", "job", "daemon", "bye"]);
598	}
599	else
600	{
601		say("@Greetings once again Britannian. What dost thou wish of me.@ The daemon is the soul of congeniality.");
602		add(["name", "job", "daemon", "bye"]);
603	}
604	var dont_add_daemon = false;
605	converse(0)
606	{
607		case "name" (remove):
608			say("The big daemon smiles ingratiatingly, showing inch long pointed teeth. @As I have said, I am the daemon Arcadion.@");
609			if (gflags[HELPING_ARCADION])
610				say("His somewhat polished veneer seems to be unravelling at the edges in his anticipation of freedom.");
611			else if (!dont_add_daemon)
612				add("daemon");
613
614		case "job" (remove):
615			if (!gflags[HELPING_ARCADION])
616			{
617				say("Arcadion attempts to smile, but failing miserably, he gives you a grimace that could turn a dragon to stone. @I am currently in the service of one mage, Erethian by name.@ He states, rather formally. You get the distinct impression that Arcadion would just as soon rip Erethian limb from limb as serve him.");
618				add(["Erethian", "serve"]);
619			}
620			else
621			{
622				say("@Well, if thou keepest thy promise to release me, I'll be free of that lice-ridden, flea-bitten, old mage.@");
623				add("release");
624			}
625
626		case "Erethian" (remove):
627			say("@He is my master...@ The daemon's smile contorts into a scarcely hidden scowl of hatred. @Until other... arrangements can be made.@ Arcadion's toothsome smile appears on his shadowy features.");
628			if (!dont_add_daemon)
629				add("daemon");
630
631		case "daemon" (remove):
632			say("@That is how thy people address those of my race.@ You can't tell from Arcadion's tone of voice whether or not he minds that fact.");
633			dont_add_daemon = true;
634
635		case "serve" (remove):
636			say("The large daemon's eyes close as he appears to be restraining the force of horrific emotions,");
637			say("@I have served that blind, old fool for over two hundred years!@ Arcadion pauses, regaining his composure. A thought visibly crosses his darkened face, @Perhaps thou mightest assist me to free myself of this unwanted bondage. I could prove an invaluable ally.@ The daemon pauses to let his offer sink in, then, @Well, mortal. Wilt thou help me?@");
638			if(askYesNo())
639			{
640				say("A wicked look of triumph flickers across Arcadion's face to be quickly replaced by a ludicrous semblance of gratitude, @Thou art truly courageous to vow to release me. My gratitude hath no bounds.@ An oily grin coats the daemon's face, @Thou hast made quite a powerful ally this day, mortal.@ His eyes blink in what is possibly meant to be a charming manner.");
641				gflags[HELPING_ARCADION] = true;
642				if (!dont_add_daemon)
643					add("daemon");
644
645				add("release");
646			}
647			else
648			{
649				gflags[REFUSED_HELP_ARCADION] = true;
650				ARCADION_MIRROR_FACE.hide();
651				ARCADION_MIRROR_FACE->show_npc_face(1);
652				say("Arcadion looks as if he's about to force his way through the mirror, then once again masters his incredible rage.");
653				ARCADION_MIRROR_FACE.hide();
654				ARCADION_MIRROR_FACE->show_npc_face(0);
655				say("He folds massive arms across a broad chest and slowly restores his gruesome smile, @I can respect thy cowardice in this situation. After all, Erethian is a powerful mage, not the sort that a sheep like thyself should be trifling with.@ His contemtuous sneer begins to fade as the daemon takes his leave.*");
656				break;
657			}
658
659		case "release" (remove):
660			say("@I'll need a special gem in which to house my essence when thou crackest this prison of a mirror.@ His eyes are alight with the possibility of his impending freedom.");
661			add("gem");
662
663		case "gem" (remove):
664			if (isArcadionGemNearby())
665			{
666				say("@I can sense that the gem is near! Take it! Take it, quickly and use it to free me of this accursed mirror!@ Arcadion is almost drooling in anticipation.*");
667				gflags[TALKED_ARCADION_WITH_GEM] = true;
668				break;
669			}
670			else if (PARTY->count_objects(SHAPE_GEM, QUALITY_ANY, 12))
671			{
672				say("@Thou hast the gem! I feel it! Use it now to crack the mirror! I'll enter it as I'm freed!@ The daemon hardly restains his enthusiasm.*");
673				gflags[TALKED_ARCADION_WITH_GEM] = true;
674				break;
675			}
676
677			else say("@There was one on this island, that much I know. Find it. Bring it to me and together, we shall break this mirror which binds me to that blasted mage.@*");
678
679		case "bye":
680			if (gflags[HELPING_ARCADION])
681				say("Arcadion winks in a very undaemonlike manner, @Farewell, brave mortal. Thy courage is unsurpassed among humans.@*");
682
683			else
684				say("The smiling daemon bows again, @Fare thee well, Britannian. Until we meet again.@ The daemon begins to fade even as his last words are spoken.*");
685
686			break;
687	}
688	arcadionMirrorHide();
689}
690