1 ;;----------------------------------------------------------------------------
2 ;; The Alchemist is numbered among the Wise, but he's not a very nice person.
3 ;; He's very clever, very greedy and likes to trick people. He is also very
4 ;; knowledgeable. He knows there is a rune buried in trigrave, and that the
5 ;; enchanter knows what the runes are for. He also knows that one of then
6 ;; entrances to the MAN's hideout is in the northwest.
8 ;; The Alchemist would be very happy to obtain the blood of a hydra, dragon and
9 ;; lich. He will also teach the player how to make potions for gold?
10 ;;----------------------------------------------------------------------------
11 ;;----------------------------------------------------------------------------
13 ;;----------------------------------------------------------------------------
15 ;;----------------------------------------------------------------------------
19 ;;----------------------------------------------------------------------------
20 (kern-mk-sched 'sch_alch
21 (list 0 0 alkemist-shop "idle")
22 (list 2 0 alkemist-bed "sleeping")
23 (list 8 0 bilge-water-seat-9 "eating")
24 (list 9 0 alkemist-shop "working")
25 (list 12 0 bilge-water-seat-9 "eating")
26 (list 13 0 alkemist-shop "working")
27 (list 17 0 bilge-water-seat-9 "eating")
28 (list 18 0 bilge-water-hall "idle")
29 (list 19 0 sea-witch-shop "idle")
30 (list 20 0 alkemist-shop "idle")
33 ;;----------------------------------------------------------------------------
36 ;; Quest flags, etc, go here.
37 ;;----------------------------------------------------------------------------
46 (define (alchq-dragon gob) (car gob))
47 (define (alchq-lich? gob) (cadr gob))
48 (define (alchq-hydra? gob) (caddr gob))
49 (define (alchq-lich! gob val) (set-car! (cdr gob) val))
50 (define (alchq-hydra! gob val) (set-car! (cddr gob) val))
52 ;;----------------------------------------------------------------------------
54 ;;----------------------------------------------------------------------------
58 (list t_heal_potion 18 "When you run out of Mani or mana in the pitch of battle, these will save your life!")
59 (list t_cure_potion 18 "An Nox may be cheaper, but nothing works better than my cure potions!")
60 (list t_mana_potion 18 "No other potions rejuvenate your mana like mine do!")
62 (list t_poison_immunity_potion 18 "Prevention is better than a cure! With my immunity potions you need never fear poison again!")
63 (list t_invisibility_potion 100 "One quaff of this and your enemies will never find you!")
64 (list t_str_potion 999 "The strength of a troll will be yours with this potion!" ) ;; limited stock would be nice...
65 (list t_dex_potion 999 "Your arrows will fly straight as truth when you drink this potion!") ;; limited stock would be nice...
66 (list t_int_potion 999 "The wise man seeks more wisdom! With this potion, it can be yours for a very reasonable price!") ;; limited stock would be nice...
67 (list t_info_potion 150 "The sage said to 'Know thyself'. This potion will help!")
69 (list t_oil 6 "Hurl fire at your foes! Protect your flanks or cover your retreat with flaming fields of death!")
70 (list t_slime_vial 25 "More fun than a barrel of monkeys! Confound your foes with a multiplying army of slimes!")
73 (define alch-merch-msgs
74 (list "I'm afraid my shop is closed now. Come by between 9:00AM to 5:00PM."
75 "I'm sure I have something you'll like! [He rubs his hands briskly]"
76 "I sometimes buy used goods... at a discount of course."
77 "Yes, let's get down to business!"
78 "You'll be back for more when you see for yourself how good my potions are!"
79 "I hope you don't regret passing up these fine potions."
80 "I can probably find some use for these."
81 "I doubt you'll find a better offer anywhere else."
82 "A pleasure doing business with you!"
87 (define (alch-hail knpc kpc)
88 (say knpc "[You meet a short, fat old man with a long nose] "
89 "Hello and welcome, Traveler!"))
91 (define (alch-default knpc kpc)
92 (say knpc "I'm afraid I can't help you with that."))
94 (define (alch-name knpc kpc)
95 (say knpc "I'm known as the Alchemist.")
96 (quest-data-update 'questentry-alchemist 'found 1)
97 (quest-data-complete 'questentry-alchemist)
100 (define (alch-join knpc kpc)
101 (say knpc "Too busy! And far too old for adventures."))
103 (define (alch-job knpc kpc)
104 (say knpc "I make potions, dabble in mysteries, that sort of thing. "
105 "If you want to buy something just say so!"))
107 (define (alch-bye knpc kpc)
108 (say knpc "Farewell! Come back again soon!"))
111 (define (alch-trade knpc kpc) (conv-trade knpc kpc "trade" alch-merch-msgs alch-catalog))
112 (define (alch-buy knpc kpc) (conv-trade knpc kpc "buy" alch-merch-msgs alch-catalog))
113 (define (alch-sell knpc kpc) (conv-trade knpc kpc "sell" alch-merch-msgs alch-catalog))
116 ;; offered: shown k rune
117 ;; accepted: sent to find p rune
118 ;; done: known to have found p rune
119 (define (alch-dragon-reward knpc kpc)
120 (say knpc "Oh, yes, the rune...")
123 "The paladins have built several fortifications in the "
124 "deeps of Kurpolis. One of the runes was buried in the "
125 "foundations of the deepest fort.")
128 "A pick and shovel may be enough to get it out again, "
129 "but it might be difficult with a dozen paladins breathing "
131 (quest-data-assign-once 'questentry-rune-p)
132 (quest-rune-p-update)
135 (define (alch-dragon-done knpc kpc)
136 (say knpc "I am afraid I dont know the locations of the other "
137 "runes. Try asking the rest of the Wise."))
139 (define (alch-dragon-quest knpc kpc qstat)
140 (if (kern-conv-get-yes-no? kpc)
143 (alch-dragon-done knpc kpc)
145 ((in-inventory? kpc t_rune_p)
146 (quest-done! qstat #t)
147 (say knpc "I see you have collected the Rune of Power.")
148 (alch-dragon-done knpc kpc)
150 ((quest-accepted? qstat)
151 (alch-dragon-reward knpc kpc qstat)
153 ((in-inventory? kpc t_dragons_blood 1)
155 (say knpc "I know where ones is buried, "
156 "and I'll tell you in exchange for that vial of "
157 "dragon's blood you're carrying. Deal?")
158 (if (kern-conv-get-yes-no? kpc)
160 (quest-accepted! qstat #t)
161 (kern-obj-remove-from-inventory kpc
164 (kern-obj-add-to-inventory knpc
167 (say knpc "[He eyes the vial hungrily] "
168 "Yes! It's just what I need!")
169 (quest-data-update 'questentry-dragon 'done 1)
170 (quest-data-complete 'questentry-dragon)
171 (quest-data-assign-once 'questentry-dragon)
172 (alch-dragon-reward knpc kpc))
174 (say knpc "Well, I suppose if you dig up the "
175 "whole Shard you'll someday find it without "
176 "my help. Good luck!")
177 (quest-data-assign-once 'questentry-dragon)
181 (say knpc "Then perhaps we can exchange favors. "
182 "I happen to know where one of these runes "
183 "is buried. I'll tell you its location if you "
184 "bring me a vial of dragon's blood. ")
185 (quest-data-assign-once 'questentry-dragon)))
186 (say knpc "Well, if you are, I happen to know where one is "
189 (define (alch-more knpc kpc)
190 (let ((qstat (alchq-dragon (gob knpc))))
191 (say knpc "Abe knows more about the runes themselves. Are you "
192 "interested in finding the others?")
193 (quest-data-update-with 'questentry-runeinfo 'abe 1 (quest-notify nil))
194 (alch-dragon-quest knpc kpc qstat)
197 (define (alch-rune knpc kpc)
198 (if (not (null? (quest-data-getvalue 'questentry-dragon 'rerune)))
201 (say knpc "[He gets a canny look] Runes, eh? I've seen a few in my time. "
202 "Have you one to look at?")
203 (if (kern-conv-get-yes-no? kpc)
204 (if (in-inventory? kpc t_rune_k 1)
206 (say knpc "Yes, I see. This once belonged to the Enchanter, "
207 "I believe. I hope you didn't steal it! "
208 "I have seen several more like it, "
209 "but the person you really should speak to "
211 (quest-data-update 'questentry-dragon 'rerune 1)
212 (quest-data-update-with 'questentry-runeinfo 'abe 1 (quest-notify nil))
214 (say knpc "I don't see it. Perhaps you dropped it?"))
215 (say knpc "I might be able to help if you could show me.")))
218 (define (alch-abe knpc kpc)
219 (say knpc "An old acquaintance of mine. "
220 "Last I heard he was studying the ruins at Green Tower."))
222 (define (alch-drag knpc kpc)
223 (say knpc "I've never done it personally, but if one wants to obtain some "
224 "dragon's blood my understanding is that one must kill a dragon! "
225 "I hear they're common as cows in the regions of the Fire Sea."
227 (quest-data-update-with 'questentry-dragon 'sea 1 (quest-notify nil)))
231 (define (alch-necr knpc kpc)
232 (say knpc "The Necromancer is an old acquaintance of mine. "
233 "Since the razing of Absalot he's retired to the underworld. "
234 "'Tis a pity, but we've lost touch."))
236 (define (alch-ench knpc kpc)
237 (say knpc "The Enchanter is a great and knowledgable Wizard. "
238 "I'm afraid we don't always see eye-to-eye. "
239 "Lately he's been pre-occupied with the Accursed."
242 (define (alch-man-reward knpc kpc)
243 (say knpc "In the mountains of "
244 "the northeast, along their southern face, "
245 "there is a secret passage. It is near coordinates "
248 (define (alch-man knpc kpc)
249 (let ((qstat (gob knpc)))
250 (say knpc "I've never met the MAN. "
251 "Being the most accomplished of Wrogues, "
252 "he probably has a fortune stashed in his hideout. "
253 "If I were the adventurous type I might go seek it out myself. "
255 (if (kern-conv-get-yes-no? kpc)
257 ((alchq-hydra? qstat)
258 (say knpc "I've heard, from a reliable source, of an entrance "
259 "to the MAN's secret hideout.")
260 (alch-man-reward knpc kpc))
261 ((in-inventory? kpc t_hydras_blood 1)
263 (say knpc "I've heard, from a reliable source, of an entrance "
264 "to the MAN's secret hideout. I'll tell you in exchange "
265 "for that vial of hydra's blood in your pack. Yes?")
266 (if (kern-conv-get-yes-no? kpc)
268 (alchq-hydra! qstat #t)
269 (kern-obj-remove-from-inventory kpc
272 (kern-obj-add-to-inventory knpc
275 (say knpc "[He fairly drools over the noxious stuff] "
276 "Oh, lovely... lovely!")
278 (alch-man-reward knpc kpc))
279 (say knpc "'Tis a pity. You have no use for the "
280 "vial, and I am too old to go treasure-hunting."))))
282 (say knpc "Well, I do hear many things, many of which are only "
283 "rumour. But a reliable source has told me of where to find "
284 "an entrance to the MAN's hideout. If you bring me a vial of "
285 "hydra's blood I'll disclose it to you.")))
286 (say knpc "For fie, Wanderer! "
287 "I thought you were the adventurous type."))))
289 (define (alch-hydr knpc kpc)
290 (say knpc "The hydra is a most difficult foe. "
291 "I understand that striking them only increases their strength! "
292 "But if you do succeed in killing one their blood is quite useful "
293 "to the arcane arts."))
295 (define (alch-warr knpc kpc)
296 (say knpc "On a few occasions I have met the Warritrix. "
297 "Her ferocity is legendary, "
298 "but I found her to be very calm and gracious in her demeanor. "
299 "I understand she refused to take part in the destruction of "
302 (define (alch-engi knpc kpc)
303 (say knpc "I've never met the Engineer, "
304 "I understand he is quite the recluse."))
306 (define (alch-alch knpc kpc)
307 (say knpc "Yes, that's me. I am the Alchemist.")
308 (quest-data-update 'questentry-alchemist 'found 1)
309 (quest-data-complete 'questentry-alchemist)
314 (define (alch-absa-reward knpc kpc)
315 (say knpc "There was a fortress overlooking a river of fire. "
316 "Pity it wasn't manned, it might have turned Glasdrin's invasion. "
317 "It will make a perilous crossing if monsters have taken it over.")
320 "There is, however, an older route that bypasses the fortress. "
321 "Probe the east wall of the first cavern, "
322 "you will find a hidden passage.")
325 "You will still need to cross the river of fire. "
326 "There is a statue upon the river. Speak the password 'ONUS' to pass unharmed. "
327 "Write that password down!")
330 "The passage rejoins the main route near the stairway which leads up to "
331 "the lost city. You won't escape all the hazards of the journey, "
332 "but it should make your life somewhat easier."))
334 (define (alch-absa knpc kpc)
335 (let ((qstat (gob knpc)))
336 (say knpc "The passage to Absalot was always dangerous even when it was maintained. "
337 "You wouldn't happen to be thinking of going there?")
338 (if (kern-conv-get-yes-no? kpc)
341 (alch-absa-reward knpc kpc))
342 ((in-inventory? kpc t_lichs_blood 1)
343 (say knpc "In exchange for that vial of lich's blood I'd be "
344 "happy to tell you of a back door. What do you say?")
345 (if (kern-conv-get-yes-no? kpc)
347 (alchq-lich! qstat #t)
348 (kern-obj-remove-from-inventory kpc
351 (kern-obj-add-to-inventory knpc
354 (say knpc "[He grins and winks] Just the stuff I need!")
355 (alch-absa-reward knpc kpc))
356 (say knpc "I see. No doubt you have IMPORTANT plans for "
357 "that lich's blood. I can always get some from "
358 "another adventurer.")))
360 (say knpc "Bring me a vial of lich's blood and I'll tell you "
362 (say knpc "It's just a ruin now anyways. Everything was destroyed "
363 "when it was sacked."))))
365 (define (alch-sack knpc kpc)
366 (say knpc "Oh yes, didn't you know? Absalot was sacked by the armies "
367 "of Glasdrin, Green Tower and Oparine. Destroyed for its wickedness, "
368 "they say. [He chuckles without humour]"))
370 (define (alch-esca knpc kpc)
371 (say knpc "Er... did I say that? I can't imagine why. Anyone who escaped "
372 "from Absalot would have the death sentence on their head."))
374 (define (alch-wick knpc kpc)
375 (say knpc "Yes, Absalot was so wicked that every man, woman and child "
376 "who dwelt there had to be put to the sword. Lucky for us to have "
377 "paladins willing to carry out this righteous work! "
378 "[You detect a hint of irony in his raised eyebrows and innocent "
381 (define (alch-lich knpc kpc)
382 (say knpc "A lich is an undead wizard. This foul thing corrupts all it "
383 "touches and commands armies of the dead. Its blood has many uses "
384 "in necromancy, which is not my specialty."))
387 (define (alch-accu knpc kpc)
388 (say knpc "The so-called Accursed are a secret society blamed for "
389 "many heinous deeds, but who can say how much of that is rumour?"))
392 (define (alch-lia knpc kpc)
393 (say knpc "A bewitching creature! "
394 "If I could, I would break her curse. In fact, I would do it for free. "
395 "Call me an old fool!"))
399 (method 'default alch-default)
400 (method 'hail alch-hail)
401 (method 'bye alch-bye)
402 (method 'job alch-job)
403 (method 'name alch-name)
404 (method 'join alch-join)
406 (method 'trad alch-trade)
407 (method 'buy alch-buy)
408 (method 'sell alch-sell)
409 (method 'poti alch-buy)
411 (method 'rune alch-rune)
412 (method 'more alch-more)
413 (method 'drag alch-drag)
415 (method 'necr alch-necr)
416 (method 'ench alch-ench)
417 (method 'man alch-man)
418 (method 'hydr alch-hydr)
419 (method 'warr alch-warr)
420 (method 'engi alch-engi)
421 (method 'alch alch-alch)
423 (method 'absa alch-absa)
424 (method 'sack alch-sack)
425 (method 'esca alch-esca)
426 (method 'wick alch-wick)
427 (method 'lich alch-lich)
429 (method 'accu alch-accu)
431 (method 'lia alch-lia)
432 (method 'abe alch-abe)
436 ;;----------------------------------------------------------------------------
437 ;; First-time constructor
438 ;;----------------------------------------------------------------------------
439 (define (mk-alchemist)
443 'ch_alchemist ;;.....tag
444 "Alchemist" ;;.......name
445 sp_human ;;.....species
446 oc_wright ;;...occupation
447 s_companion_tinker ;;......sprite
448 faction-men ;;..faction
449 0 ;;............custom strength modifier
450 4 ;;............custom intelligence modifier
451 1 ;;............custom dexterity modifier
452 0 ;;............custom base hp modifier
453 0 ;;............custom hp multiplier (per-level)
454 0 ;;............custom base mp modifier
455 0 ;;............custom mp multiplier (per-level)
456 max-health ;;..current hit points
457 -1 ;;...........current experience points
458 max-health ;;..current magic points
461 #f ;;...........dead?
462 'alch-conv ;;...conversation (optional)
463 sch_alch ;;.....schedule (optional)
464 'townsman-ai ;;..........custom ai (optional)
465 nil ;;..........container (and contents)
468 ) ;;......... readied arms (in addition to the container contents)
469 nil ;;..........hooks in effect