OSDN Git Service

185dc7ac5d32a94747bf96af0706568d45d25018
[nazghul-jp/nazghul-jp.git] / worlds / haxima-1.002 / quests-data.scm
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;;
3 ;; Quest Data Table
4 ;;
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
9 ;; quest-sys module.
10 ;;
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)
13 ;;
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
16 ;;
17 ;; (questadd (qst-mk
18 ;;    "Name of Quest"
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
23 ;;    'sprite-for-quest
24 ;;    quest-payload
25 ;;      )
26 ;;
27 ;; The various quest-data-* methods assume that quest-payload is a tbl, containing various
28 ;; info possibly including:
29 ;;
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)
34 ;;
35 ;;
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
41 ;;              
42 ;;              for nicely updating quest information, add the on-update method as described above, and sprinkle
43 ;;      the plot with
44 ;;          (quest-data-update 'tag-to-refer-to-quest 'name-of-quest-flag value-to-set-tag-to)
45 ;;             and
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))
51 ;;
52 ;;
53
54 (let*
55         (
56                 (newtbl (tbl-mk))
57                 (oldtbl (tbl-get (gob (kern-get-player)) 'questdata))
58                 (questdata (if (null? oldtbl)
59                                                 (begin 
60                                                         (tbl-set! (gob (kern-get-player)) 'questdata newtbl)
61                                                         newtbl
62                                                 )
63                                                 oldtbl))
64                 (questadd (lambda (quest)
65                         (if (null? (tbl-get questdata (qst-tag quest)))
66                                 (tbl-set! questdata (qst-tag quest) quest)
67                         )))
68         )
69         
70 (questadd (qst-mk 
71         "Character Creation"
72         'questentry-charcreate
73         (kern-ui-paginate-text
74                 "Move to the moongate at the north side of the room to begin the game."
75                 ""
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."
77         )
78         'quest-assign-notify
79         'quest-status-inprogress
80         's_quest_start
81         0
82 ))
83
84 (questadd (qst-mk "Where am I?"
85         'questentry-whereami
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."
88                 ""
89                 "Where are you?"
90                 "How and why are you here?"
91                 "And what are you going to do now?"
92         )
93         'quest-assign-notify
94         'quest-status-inprogress
95         's_quest_start
96         (tbl-build
97                 'on-update 'quest-whereami-update
98                 )
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)
102 ))
103
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."
108                 ""
109                 "The message suggests that you ask the caretaker of the clearing that you arrived in for directions."
110         )
111         'quest-assign-notify
112         'quest-status-inprogress
113         's_enchanter
114         (tbl-build
115                 'on-update 'quest-calltoarms-update
116                 'bonus-xp 0
117                 )
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
122 ))
123         
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."
128                 ""
129                 "The ^c+mthief^c- has been tracked as far as Trigrave. The townsfolk there may be able to give you further information."
130         )
131         'quest-assign-notify
132         'quest-status-inprogress
133         's_brigand
134         (tbl-build
135                 'on-update 'quest-thiefrune-update
136                 'bonus-xp 0
137                 )
138         ;; '
139         ;; 'tower- pc has reached tower
140         ;; 'talked- pc has talked to the enchanter
141         ;; 'done- pc has been enlisted
142 ))
143
144 (questadd (qst-mk "The Secret of the Runes"
145         'questentry-runeinfo
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."
148                 ""
149                 "He suggests that you start with the ^c+mAlchemist^c-, who may be found at Oparine."
150         )
151         'quest-assign-notify
152         'quest-status-inprogress
153         's_runestone_k
154         (tbl-build
155                 'on-update 'quest-runeinfo-update
156                 'bonus-xp 0
157                 )
158 ))
159
160 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
161 ;; runes questgroup
162
163 (questadd (qst-mk "The Search for the Runes"
164         'questentry-allrunes
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."
167         )
168         'quest-assign-notify
169         'quest-status-inprogress
170         's_runestone_group
171         (tbl-build
172                 ;;'on-update 'quest-allrunes-update
173                 'bonus-xp 0
174                 )
175 ))
176
177 ;; TODO- alternate path in which the rune is lost?
178 (questadd (qst-mk "A Rune in Hand"
179         'questentry-rune-k
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."
182         )
183         'quest-assign-notify
184         'quest-status-inprogress
185         's_runestone_k
186         (tbl-build
187                 'on-update 'quest-rune-k-update
188                 'entrusted-with-rune 0
189                 'player-got-rune 0
190                 'ench-should-have-rune 0
191                 'bonus-xp 0
192                 )
193 ))
194
195 (questadd (qst-mk "A Rune in the Deeps"
196         'questentry-rune-p
197         (kern-ui-paginate-text
198                 "The Alchemist provided you with information on a rune buried in the deeps of Kurpolis."
199         )
200         'quest-assign-notify
201         'quest-status-inprogress
202         's_runestone_r
203         (tbl-build
204                 'on-update 'quest-rune-p-update
205                 'bonus-xp 0
206                 )
207 ))
208
209 (questadd (qst-mk "A Soldier's Rune"
210         'questentry-rune-l
211         (kern-ui-paginate-text
212                 "One of the Runes is carried by the Warritrix."
213         )
214         'quest-assign-notify
215         'quest-status-inprogress
216         's_runestone_r
217         (tbl-build
218                 'on-update 'quest-rune-l-update
219                 'bonus-xp 0
220                 'located 0
221                 'know-hall 0
222                 'approx-hall 0
223                 )
224 ))
225
226 (questadd (qst-mk "A Lost Rune"
227         'questentry-rune-f
228         (kern-ui-paginate-text
229                 "King Clovis once possessed a rune, but he fell during the Goblin Wars."
230         )
231         'quest-assign-notify
232         'quest-status-inprogress
233         's_runestone_r
234         (tbl-build
235                 'on-update 'quest-rune-f-update
236                 'bonus-xp 0
237                 )
238 ))
239
240 (questadd (qst-mk "A Rune in the Void"
241         'questentry-rune-d
242         (kern-ui-paginate-text
243                 "Legends tell of a temple in the void, which housed a rune."
244         )
245         'quest-assign-notify
246         'quest-status-inprogress
247         's_runestone_r
248         (tbl-build
249                 'on-update 'quest-rune-d-update
250                 'bonus-xp 0
251                 )
252 ))
253
254 (questadd (qst-mk "A Rune in Fire"
255         'questentry-rune-w
256         (kern-ui-paginate-text
257                 "A rune was found amongst the hoard of a dragon lairing in the Fire Sea."
258         )
259         'quest-assign-notify
260         'quest-status-inprogress
261         's_runestone_r
262         (tbl-build
263                 'bonus-xp 0
264                 )
265 ))
266
267 (questadd (qst-mk "A Rune in the Ruins"
268         'questentry-rune-s
269         (kern-ui-paginate-text
270                 "A rune can be found in Old Absalot, beneath the ruins."
271         )
272         'quest-assign-notify
273         'quest-status-inprogress
274         's_runestone_r
275         (tbl-build
276                 ;;'on-update 'quest-allrunes-update
277                 'bonus-xp 0
278                 )
279 ))
280
281 (questadd (qst-mk "A Rune in the Sea"
282         'questentry-rune-c
283         (kern-ui-paginate-text
284                 "A rune once belonged to the pirate Ghertie."
285         )
286         'quest-assign-notify
287         'quest-status-inprogress
288         's_runestone_r
289         (tbl-build
290                 'on-update 'quest-rune-c-update
291                 'bonus-xp 0
292                 )
293 ))
294
295 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
296 ;; wise questgroup
297
298 (questadd (qst-mk "The Wise"
299         'questentry-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."
302         )
303         'quest-assign-notify
304         'quest-status-inprogress
305         's_quest_wise
306         (tbl-build
307                 ;;'on-update 'quest-wise-update
308                 )
309 ))
310
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."
315         )
316         'quest-assign-subquest
317         'quest-status-inprogress
318         's_enchanter
319         (tbl-build
320                 ;;'on-update 'quest-enchanter-update
321                 'qparent 'questentry-wise
322                 )
323 ))
324
325 (questadd (qst-mk "The Alchemist"
326         'questentry-alchemist
327         (kern-ui-paginate-text
328                 "The Alchemist is one of the wise."
329         )
330         'quest-assign-subquest
331         'quest-status-inprogress
332         's_companion_tinker
333         (tbl-build
334                 ;;'on-update 'quest-alchemist-update
335                 'qparent 'questentry-wise
336                 )
337 ))
338
339 (questadd (qst-mk "The MAN"
340         'questentry-the-man
341         (kern-ui-paginate-text
342                 "The MAN is one of the wise."
343         )
344         'quest-assign-subquest
345         'quest-status-inprogress
346         's_companion_bard
347         (tbl-build
348                 ;;'on-update 'quest-the-man-update
349                 'qparent 'questentry-wise
350                 )
351 ))
352
353 (questadd (qst-mk "The Engineer"
354         'questentry-engineer
355         (kern-ui-paginate-text
356                 "The Alchemist is one of the wise."
357         )
358         'quest-assign-subquest
359         'quest-status-inprogress
360         's_companion_tinker
361         (tbl-build
362                 ;;'on-update 'quest-engineer-update
363                 'qparent 'questentry-wise
364                 )
365 ))
366
367 (questadd (qst-mk "The Necromancer"
368         'questentry-necromancer
369         (kern-ui-paginate-text
370                 "The Necromancer is one of the wise."
371         )
372         'quest-assign-subquest
373         'quest-status-inprogress
374         's_black_mage
375         (tbl-build
376                 ;;'on-update 'quest-necromancer-update
377                 'qparent 'questentry-wise
378                 )
379 ))
380
381 (questadd (qst-mk "The Warritrix"
382         'questentry-warritrix
383         (kern-ui-paginate-text
384                 "The Warritrix is one of the wise."
385         )
386         'quest-assign-subquest
387         'quest-status-inprogress
388         's_avatar
389         (tbl-build
390                 'on-update 'quest-warritrix-update
391                 'qparent 'questentry-wise
392                 )
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
403 ))
404
405 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
406
407 (questadd (qst-mk "A Haunted Inn"
408         'questentry-ghertie
409         (kern-ui-paginate-text
410                 "A ghost haunts the inn at Oparine. Why does it linger in undeath?"
411         )
412         'quest-assign-notify
413         'quest-status-inprogress
414         's_ghost
415         (tbl-build
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
430                 )
431 ))
432
433 (questadd (qst-mk "Blood Price: Dragon"
434         'questentry-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."
437         )
438         'quest-assign-notify
439         'quest-dragon-update
440         's_dragon_party
441         (tbl-build
442                 )
443 ))
444
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?"
449         )
450         'quest-assign-subquest
451         'quest-status-inprogress
452         's_ghost
453         (tbl-build
454                 'on-update 'quest-warrjustice-update
455                 )
456                 ;;'statue - info about statue
457                 ;;'book - info about journal
458                 ;;'havejournal - found journal
459                 ;;'avenged - completed justice quest
460 ))
461
462 (questadd (qst-mk "Bandit Troubles"
463         'questentry-bandits
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."
466                 ""
467                 "He suggests that the Rangers at Green Tower will be able to assist in this task."
468         )
469         'quest-assign-notify
470         'quest-status-inprogress
471         's_brigand
472         (tbl-build
473          'on-update 'quest-bandits-update
474          )
475 ))
476
477 )
478