1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 ;; The basic quest data mechanism is based on a tbl of quest information. This allows quests
6 ;; to be created once, then tracked and updated from a central repository.
7 ;; While not suitable for quests generated on the fly, this is a lot more convenient for
8 ;; complex plot based quests. On the fly quests can still interface directly with the
11 ;; The questadd function here handles creation of quests (it also makes sure the quest is
12 ;; created iff it is needed, so savegames have some chance of updating right)
14 ;; It is inside a let definition, and hence wont work elsewhere. The quest to be added is
15 ;; a quest using qst-mk from the quest-sys module
19 ;; 'tag-to-refer-to-quest
20 ;; "Text description of quest, probably using kern-ui-paginate-text"
21 ;; 'function-called-on-quest-assignment ;; probably 'quest-assign-notify, or nil
22 ;; 'function-called-before-quest-is-displayed ;; probably nil
27 ;; The various quest-data-* methods assume that quest-payload is a tbl, containing various
28 ;; info possibly including:
30 ;; 'on-update a method name that will be called in response to a quest-data-update call
31 ;; 'bonus-xp a storage space for experience rewards that are accrued before the player
32 ;; knows about the quest (the xp will increase the rewards given once the
33 ;; the player knows why they are being given xp)
36 ;; Using quests basically boils down to:
37 ;; defining the quest here
38 ;; adding a (quest-data-assign-once 'tag-to-refer-to-quest) at the relevent place in the game code
39 ;; adding a (quest-data-complete 'tag-to-refer-to-quest)
40 ;; at the relevent place in the game code
42 ;; for nicely updating quest information, add the on-update method as described above, and sprinkle
44 ;; (quest-data-update 'tag-to-refer-to-quest 'name-of-quest-flag value-to-set-tag-to)
46 ;; (quest-data-update-with 'tag-to-refer-to-quest 'name-of-quest-flag value-to-set-tag-to
47 ;; function-to-perform-if-the-tag-wasnt-already-set-that-way)
48 ;; a common example of the latter would be giving the party an xp reward:
49 ;; (quest-data-update-with 'tag-to-refer-to-quest 'name-of-quest-flag value-to-set-tag-to
50 ;; (grant-party-xp-fn amount-of-xp-to-share-out))
57 (oldtbl (tbl-get (gob (kern-get-player)) 'questdata))
58 (questdata (if (null? oldtbl)
60 (tbl-set! (gob (kern-get-player)) 'questdata newtbl)
64 (questadd (lambda (quest)
65 (if (null? (tbl-get questdata (qst-tag quest)))
66 (tbl-set! questdata (qst-tag quest) quest)
72 'questentry-charcreate
73 (kern-ui-paginate-text
74 "Move to the moongate at the north side of the room to begin the game."
76 "Along the way you will be prompted for your characters name. You may also customize your attributes by talking to the statues in the room."
79 'quest-status-inprogress
84 (questadd (qst-mk "Where am I?"
86 (kern-ui-paginate-text
87 "You have found yourself in a world you have no knowledge of, with barest impressions of what might have gone before."
90 "How and why are you here?"
91 "And what are you going to do now?"
94 'quest-status-inprogress
97 'on-update 'quest-whereami-update
99 ;; 'shard- pc knows about shard(1), cosmology(2)
100 ;; 'wanderer- pc knows about wanderers(1), potential(2)
101 ;; 'nossifer- pc knows about N's summoning(3)
104 (questadd (qst-mk "A Call to Arms"
105 'questentry-calltoarms
106 (kern-ui-paginate-text
107 "You have recieved an urgent message to contact someone called the Enchanter as soon as possible."
109 "The message suggests that you ask the caretaker of the clearing that you arrived in for directions."
112 'quest-status-inprogress
115 'on-update 'quest-calltoarms-update
118 ;; 'directions- pc has directions to tower
119 ;; 'tower- pc has reached tower
120 ;; 'talked- pc has talked to the enchanter
121 ;; 'done- pc has been enlisted
124 (questadd (qst-mk "To Catch a Thief"
125 'questentry-thiefrune
126 (kern-ui-paginate-text
127 "The Enchanter has asked you to investigate a theft from his tower."
129 "The ^c+mthief^c- has been tracked as far as Trigrave. The townsfolk there may be able to give you further information."
132 'quest-status-inprogress
135 'on-update 'quest-thiefrune-update
139 ;; 'tower- pc has reached tower
140 ;; 'talked- pc has talked to the enchanter
141 ;; 'done- pc has been enlisted
144 (questadd (qst-mk "The Secret of the Runes"
146 (kern-ui-paginate-text
147 "The stolen rune that you recovered must have great significance to prompt it's theft. The Enchanter has given you the task of seeking out this reason."
149 "He suggests that you start with the ^c+mAlchemist^c-, who may be found at Oparine."
152 'quest-status-inprogress
155 'on-update 'quest-runeinfo-update
160 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
163 (questadd (qst-mk "The Search for the Runes"
165 (kern-ui-paginate-text
166 "The Enchanter believes that the Accursed are seeking the runes for nefarious purposes. It is up to you to collect them first."
169 'quest-status-inprogress
172 ;;'on-update 'quest-allrunes-update
177 ;; TODO- alternate path in which the rune is lost?
178 (questadd (qst-mk "A Rune in Hand"
180 (kern-ui-paginate-text
181 "The Rune of Knowledge belongs to the Enchanter. You may be able to convince him to turn it over to you."
184 'quest-status-inprogress
187 'on-update 'quest-rune-k-update
188 'entrusted-with-rune 0
190 'ench-should-have-rune 0
195 (questadd (qst-mk "A Rune in the Deeps"
197 (kern-ui-paginate-text
198 "The Alchemist provided you with information on a rune buried in the deeps of Kurpolis."
201 'quest-status-inprogress
204 'on-update 'quest-rune-p-update
209 (questadd (qst-mk "A Soldier's Rune"
211 (kern-ui-paginate-text
212 "One of the Runes is carried by the Warritrix."
215 'quest-status-inprogress
218 'on-update 'quest-rune-l-update
226 (questadd (qst-mk "A Lost Rune"
228 (kern-ui-paginate-text
229 "King Clovis once possessed a rune, but he fell during the Goblin Wars."
232 'quest-status-inprogress
235 'on-update 'quest-rune-f-update
240 (questadd (qst-mk "A Rune in the Void"
242 (kern-ui-paginate-text
243 "Legends tell of a temple in the void, which housed a rune."
246 'quest-status-inprogress
249 'on-update 'quest-rune-d-update
254 (questadd (qst-mk "A Rune in Fire"
256 (kern-ui-paginate-text
257 "A rune was found amongst the hoard of a dragon lairing in the Fire Sea."
260 'quest-status-inprogress
267 (questadd (qst-mk "A Rune in the Ruins"
269 (kern-ui-paginate-text
270 "A rune can be found in Old Absalot, beneath the ruins."
273 'quest-status-inprogress
276 ;;'on-update 'quest-allrunes-update
281 (questadd (qst-mk "A Rune in the Sea"
283 (kern-ui-paginate-text
284 "A rune once belonged to the pirate Ghertie."
287 'quest-status-inprogress
290 'on-update 'quest-rune-c-update
295 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
298 (questadd (qst-mk "The Wise"
300 (kern-ui-paginate-text
301 "The Wise have great influence over affairs in the Shard. Seeking them out may be critical to your success."
304 'quest-status-inprogress
307 ;;'on-update 'quest-wise-update
311 (questadd (qst-mk "The Enchanter"
312 'questentry-enchanter
313 (kern-ui-paginate-text
314 "The Enchanter is a great and knowledgable Wizard, one of the Wise of the present age."
316 'quest-assign-subquest
317 'quest-status-inprogress
320 ;;'on-update 'quest-enchanter-update
321 'qparent 'questentry-wise
325 (questadd (qst-mk "The Alchemist"
326 'questentry-alchemist
327 (kern-ui-paginate-text
328 "The Alchemist is one of the wise."
330 'quest-assign-subquest
331 'quest-status-inprogress
334 ;;'on-update 'quest-alchemist-update
335 'qparent 'questentry-wise
339 (questadd (qst-mk "The MAN"
341 (kern-ui-paginate-text
342 "The MAN is one of the wise."
344 'quest-assign-subquest
345 'quest-status-inprogress
348 ;;'on-update 'quest-the-man-update
349 'qparent 'questentry-wise
353 (questadd (qst-mk "The Engineer"
355 (kern-ui-paginate-text
356 "The Alchemist is one of the wise."
358 'quest-assign-subquest
359 'quest-status-inprogress
362 ;;'on-update 'quest-engineer-update
363 'qparent 'questentry-wise
367 (questadd (qst-mk "The Necromancer"
368 'questentry-necromancer
369 (kern-ui-paginate-text
370 "The Necromancer is one of the wise."
372 'quest-assign-subquest
373 'quest-status-inprogress
376 ;;'on-update 'quest-necromancer-update
377 'qparent 'questentry-wise
381 (questadd (qst-mk "The Warritrix"
382 'questentry-warritrix
383 (kern-ui-paginate-text
384 "The Warritrix is one of the wise."
386 'quest-assign-subquest
387 'quest-status-inprogress
390 'on-update 'quest-warritrix-update
391 'qparent 'questentry-wise
393 ;;'name - knows existance, but no info
394 ;;'common - basic info
395 ;;'general-loc - common knowledge info
396 ;;'assignment - failed to find her
397 ;;'lost-hall - where she has been sent
398 ;;'lost-hall-loc - additionally, knows location of hall
399 ;;'slain - indirect evidence of her fall
400 ;;'reached - reached location of corpse - used by losthalls mechs
401 ;;'found - located corpse
402 ;;'avenged - completed justice quest TODO- pull from that quest info instead
405 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
407 (questadd (qst-mk "A Haunted Inn"
409 (kern-ui-paginate-text
410 "A ghost haunts the inn at Oparine. Why does it linger in undeath?"
413 'quest-status-inprogress
416 'on-update 'quest-ghertie-update
417 ;; ghertieloc - gherties loc
418 ;; ghertieid - ghertie info
419 ;; revenge - gherties trigger
420 ;; questinfo - quest info revealed
421 ;; meaney-loc - location of meaney
422 ;; ring-meaney - got ring from meaney
423 ;; jorn-forest - rough info on jorn
424 ;; jorn-loc - jorn found
425 ;; ring-jorn - got ring from jorn
426 ;; gholet-prison - rough info on gholet
427 ;; gholet-glasdrin - found gholet
428 ;; gholet-price - gholets offer for ring
429 ;; ring-gholet - got ring from gholet
433 (questadd (qst-mk "Blood Price: Dragon"
435 (kern-ui-paginate-text
436 "The Alchemist has offered to trade you information on the wherabouts of a Rune, in exchange for the blood of a dragon."
445 (questadd (qst-mk "A Soldiers Justice"
446 'questentry-warrjustice
447 (kern-ui-paginate-text
448 "The Warritrix has been slain by treachery. Will this crime go unpunished?"
450 'quest-assign-subquest
451 'quest-status-inprogress
454 'on-update 'quest-warrjustice-update
456 ;;'statue - info about statue
457 ;;'book - info about journal
458 ;;'havejournal - found journal
459 ;;'avenged - completed justice quest
462 (questadd (qst-mk "Bandit Troubles"
464 (kern-ui-paginate-text
465 "Gregor, an old charcoal burner, has asked for your help in dealing with some troublesome bandits that have been plaguing the great forest."
467 "He suggests that the Rangers at Green Tower will be able to assist in this task."
470 'quest-status-inprogress
473 'on-update 'quest-bandits-update