1 ;;----------------------------------------------------
2 ;; this is a collection place for updates to quests
4 ;; the function is an arbitary method call, but the ones here tend to
5 ;; basically boil down to retreiving a bunch of flags from the quest payload
6 ;; and updating the quest via (qst-set-descr! text)
8 ;; the boilerplate at the front of the methods just makes the quest data easily accessible
9 ;; via a tbl-flag? method without needing to go through several level of redirection each time
14 (define (quest-bandits-update)
15 (println "quest-bandits-update")
16 (let* ((quest (quest-data-get 'questentry-bandits))
17 (quest-tbl (car (qst-payload quest)))
18 (header (kern-ui-paginate-text
19 "Gregor, an old charcoal burner, has asked for your help in dealing with some troublesome bandits that have been plaguing the great forest."
21 (println "quest-tbl:" quest-tbl)
22 (define (tbl-flag? tag)
23 (not (null? (tbl-get quest-tbl tag)))
26 (cond ((tbl-flag? 'done)
27 (kern-ui-paginate-text
28 "You have delivered Nate to the Rangers of Green Tower and he is now their problem."
30 ((tbl-flag? 'nate-given-to-jailor)
32 (kern-ui-paginate-text
33 "Take the jailor's receipt back to Deric, the commander of the Green Tower rangers, to collect the reward."
35 ((tbl-flag? 'captured-nate-and-talked-to-deric)
37 (kern-ui-paginate-text
38 "Deliver Nate to the jailor in Green Tower and he will give you a receipt."
40 ((tbl-flag? 'captured-nate)
42 (kern-ui-paginate-text
43 "Take Nate back to Green Tower and talk to the Ranger commander."
45 ((tbl-flag? 'talked-to-deric)
47 (kern-ui-paginate-text
48 "Deric, commander of the rangers, was not much help. But he did give you signed orders to enlist one of his men."
52 (kern-ui-paginate-text
53 "Gregor said to ask about the bandits in Green Tower."
63 (define (quest-whereami-update)
64 (let* ((quest (quest-data-get 'questentry-whereami))
65 (quest-tbl (car (qst-payload quest)))
66 (qp-shard (tbl-get quest-tbl 'shard))
67 (qp-wanderer (tbl-get quest-tbl 'wanderer)))
71 (if (not (null? (tbl-get quest-tbl 'nossifer)))
73 (kern-ui-paginate-text
74 "You have found yourself on the Shard, a small fragment of a world, that floats surrounded by a great void."
76 "The demon lord Nossifer arranged for your arrival, to set in motion events that would allow his own passage to the Shard."
78 "Now the Demon Gate is open, and the only thing left in Nossifer's way is you..."
83 (cond ((null? qp-shard)
84 (kern-ui-paginate-text
85 "You have found yourself in a world you have no knowledge of, with barest impressions of what might have gone before."
89 (kern-ui-paginate-text
90 "You have found yourself in a world you have no knowledge of. The inhabitants refer to it as the Shard."
93 (#t (kern-ui-paginate-text
94 "You have found yourself on the Shard, a small fragment of a world, that floats surrounded by a great void."
101 (if (and (null? qp-wanderer) (null? qp-shard))
102 (kern-ui-paginate-text "Where are you?")
106 (cond ((null? qp-wanderer)
107 (kern-ui-paginate-text
108 "How and why are you here?"
109 "And what are you going to do now?"
111 ((equal? 1 qp-wanderer)
112 (kern-ui-paginate-text
113 "Others like you have in the past been found stumbling into this world. The inhabitants know you as 'Wanderers'."
115 "Now you are here, what are you going to do?"
117 (#t (kern-ui-paginate-text
118 "Wanderers like yourself, who have occasionally stumbled upon this world, have in the past been responsible for great deeds."
120 "How will you make your place?"
129 ;;-----------------------
132 (define (quest-calltoarms-update)
133 (let* ((quest (quest-data-get 'questentry-calltoarms))
134 (quest-tbl (car (qst-payload quest)))
135 (header (kern-ui-paginate-text
136 "You have recieved an urgent message to contact someone called the Enchanter as soon as possible."
138 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
139 (qst-set-descr! quest
141 (cond ((tbl-flag? 'done)
142 (kern-ui-paginate-text
143 "You have allied yourself with the Enchanter, one of the Wise who watch over the shard."
147 (kern-ui-paginate-text
148 "You have met with the Enchanter, but you and he did not come to any agreement."
152 (kern-ui-paginate-text
153 "You have found the Enchanter's Tower in the Fens. However, getting inside could be more difficult than reaching it."
155 ((tbl-flag? 'directions)
157 (kern-ui-paginate-text
158 "The Enchanter's Tower may be found in the Fens, a swampland north of the town of Trigrave, in the western part of the Shard."
162 (kern-ui-paginate-text
163 "The message suggests that you ask the caretaker of the clearing that you arrived in for directions."
170 ;; give some xp for reaching the tower
171 (define (quest-calltoarms-tower kplace kplayer)
172 (quest-data-update-with 'questentry-calltoarms 'tower 1 (quest-notify (grant-xp-fn 5)))
175 ;;-----------------------
178 ;; TODO: make the theft appear not to happen until the player is on the scene, by altering convs based on quest status
180 (define (quest-thiefrune-update)
181 (let* ((quest (quest-data-get 'questentry-thiefrune))
182 (quest-tbl (car (qst-payload quest)))
183 (header (kern-ui-paginate-text
184 "The Enchanter has asked you to investigate a theft from his tower."
186 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
187 (qst-set-descr! quest
189 (cond ((tbl-flag? 'recovered)
191 (kern-ui-paginate-text
192 "You have tracked down the thief and retrieved a rune belonging to the Enchanter."
196 (kern-ui-paginate-text
197 "The culprit, Mouse, seems to be willing to negotiate."
201 (kern-ui-paginate-text
202 "You have found the thief's hideout in Bole, and breached the defensive upper levels."
206 (kern-ui-paginate-text
207 "You have found the thief's hideout in Bole, and have passed three levels of traps."
211 (kern-ui-paginate-text
212 "You have found the thief's hideout in Bole, and have passed two levels of traps."
216 (kern-ui-paginate-text
217 "You have found the thief's hideout in Bole, but have only passed the first level."
221 (kern-ui-paginate-text
222 "You have found the thief's hideout in Bole, but have yet to breach its defenses."
226 (kern-ui-paginate-text
227 "The ^c+mthief^c- has been seen heading northeast through the Great Forest. Bole would be the most likely place to look."
231 (kern-ui-paginate-text
232 "The ^c+mthief^c- has been seen heading east through the mountain passes. The Green Tower would be the best place to start looking."
236 (kern-ui-paginate-text
237 "The ^c+mthief^c- has been tracked as far as Trigrave. The townsfolk there may be able to give you further information."
244 ;; give some xp for getting through the dungeon
245 (define (quest-thiefrune-den1 kplace kplayer)
246 (quest-data-update 'questentry-thiefrune 'tower 1)
247 (quest-data-update 'questentry-thiefrune 'bole 1)
248 (quest-data-update-with 'questentry-thiefrune 'den1 1 (quest-notify (grant-party-xp-fn 10)))
250 (define (quest-thiefrune-den2 kplace kplayer)
251 (quest-data-update-with 'questentry-thiefrune 'den2 1 (quest-notify (grant-party-xp-fn 10)))
253 (define (quest-thiefrune-den3 kplace kplayer)
254 (quest-data-update-with 'questentry-thiefrune 'den3 1 (quest-notify (grant-party-xp-fn 10)))
256 (define (quest-thiefrune-den4 kplace kplayer)
257 (quest-data-update-with 'questentry-thiefrune 'den4 1 (quest-notify (grant-party-xp-fn 10)))
259 (define (quest-thiefrune-den5 kplace kplayer)
260 (quest-data-update-with 'questentry-thiefrune 'den5 1 (quest-notify (grant-party-xp-fn 10)))
264 ;;-----------------------
267 ;; TODO: runes are unidentified until you check in with abe?
269 (define (quest-runeinfo-update)
270 (let* ((quest (quest-data-get 'questentry-runeinfo))
271 (quest-tbl (car (qst-payload quest)))
272 (header (kern-ui-paginate-text
273 "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."
276 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
277 (qst-set-descr! quest
281 (kern-ui-paginate-text
282 "The rune you carry is one of the Keys to the Demon Gate. The gate itself lies somewhere in the north. It was sealed by the wise in ages past, and the Keys were scattered and hidden."
286 (kern-ui-paginate-text
287 "The runes are also known as the Keys to the Demon Gate. The gate itself lies somewhere in the north. It was sealed by the wise in ages past, and the Keys were scattered and hidden."
291 (kern-ui-paginate-text
292 "The runes are also known as the Keys to the Demon Gate. What that means remains unknown."
296 (kern-ui-paginate-text
297 "The Alchemist has advised you that ^c+mAbe^c-, at the Green Tower, has studied the nature of the runes."
301 (kern-ui-paginate-text
302 "He suggests that you start with the ^c+mAlchemist^c-, who may be found at Oparine."
310 ;;-----------------------
313 (define (quest-dragon-update quest)
314 (let* ((quest-tbl (car (qst-payload quest)))
315 (header (kern-ui-paginate-text
316 "The Alchemist has offered to trade you information on the wherabouts of a Rune, in exchange for the blood of a dragon."
318 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
319 (qst-set-descr! quest
323 (kern-ui-paginate-text
324 "The Alchemist has traded you information on the wherabouts of a Rune, in exchange for the blood of a dragon."
326 ((in-inventory? (car (kern-party-get-members (kern-get-player))) t_dragons_blood 1)
328 (kern-ui-paginate-text
330 "You have a vial of dragon's blood in your possession."
334 (kern-ui-paginate-text
336 "He suggests that the Fire Sea may be the best place to seek them out."
346 ;;-----------------------
349 (define (quest-rune-p-update)
350 (let* ((quest (quest-data-get 'questentry-rune-p))
351 (quest-tbl (car (qst-payload quest))))
352 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
353 (qst-set-descr! quest
357 (kern-ui-paginate-text
358 "A rune was found in the depths of Kurpolis."
361 (kern-ui-paginate-text
362 "The Alchemist provided you with information on a rune buried in the deeps of Kurpolis:"
364 "\"The paladins have built several fortifications in the deeps of Kurpolis. One of the runes was buried in the foundations of the deepest fort.\""
366 "\"A pick and shovel may be enough to get it out again, but it might be difficult with a dozen paladins breathing down your neck.\""
374 ;;-----------------------
377 (define (quest-rune-f-update)
378 (let* ((quest (quest-data-get 'questentry-rune-f))
379 (quest-tbl (car (qst-payload quest))))
380 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
381 (qst-set-descr! quest
385 (kern-ui-paginate-text
386 "The lost rune of King Clovis was retrieved from the Spider Queen Angriss."
388 ((and (tbl-flag? 'angrisslair) (tbl-flag? 'angriss))
389 (kern-ui-paginate-text
390 "King Clovis once possessed a rune, but he fell during the Goblin Wars."
392 "Information from the goblins has lead you to Angriss' lair, which may be where the rune lies now."
394 ((tbl-flag? 'angriss)
395 (kern-ui-paginate-text
396 "King Clovis once possessed a rune, but he fell during the Goblin Wars."
398 "The goblin Kama has given you a clue to its location- Something (maybe a spider?) can be found where the southern edge of the Great Forest meets the mountains in the east."
401 (kern-ui-paginate-text
402 "King Clovis once possessed a rune, but he fell during the Goblin Wars."
404 "The goblins may know what became of it. The goblin Kama may be able to help you, if you can find him."
407 (kern-ui-paginate-text
408 "King Clovis once possessed a rune, but he fell during the Goblin Wars."
410 "The goblins may know what became of it. Amongst humans, the ranger Gen has the greatest knowledge of their kind."
413 (kern-ui-paginate-text
414 "King Clovis once possessed a rune, but he fell during the Goblin Wars."
416 "The goblins may know what became of it, but would they tell you?"
423 (define (quest-rune-f-lair kplace kplayer)
424 (if (not (null? (quest-data-getvalue 'questentry-rune-f 'angriss)))
425 (quest-data-update-with 'questentry-rune-f 'angrisslair 1 (quest-notify nil))
428 ;;-----------------------
431 ;; todo add more sections? info on voidships, etc?
433 (define (quest-rune-d-update)
434 (let* ((quest (quest-data-get 'questentry-rune-d))
435 (quest-tbl (car (qst-payload quest))))
436 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
437 (qst-set-descr! quest
441 (kern-ui-paginate-text
442 "A rune was recovered from the Temple of the Void."
445 (kern-ui-paginate-text
446 "Legends tell of a temple in the void, which housed a rune."
453 ;;-----------------------
456 (define (quest-rune-c-update)
457 (let* ((quest (quest-data-get 'questentry-rune-c))
458 (quest-tbl (car (qst-payload quest))))
459 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
460 (qst-set-descr! quest
464 (kern-ui-paginate-text
465 "A rune was recovered from the wreck of the Merciful Death."
467 ((tbl-flag? 'shiploc)
469 (kern-ui-paginate-text
470 "The pirate captain Ghertie once held a rune aboard her ship, the Merciful Death."
473 (kern-ui-paginate-text (string-append "Her ghost has revealed the location of the ship: [" (number->string merciful-death-x) ", " (number->string merciful-death-y) "]."))
474 (if (tbl-flag? 'shipraise)
475 (kern-ui-paginate-text
477 "The ship may be raised with the Vas Uus Ylem spell, mixed using mandrake, blood moss and spider silk."
483 (kern-ui-paginate-text
484 "The pirate captain Ghertie once held a rune aboard her ship, the Merciful Death."
486 "Her ghost now haunts Oparine, seeking ^c+mrevenge^c- upon her crew."
489 (kern-ui-paginate-text
490 "The pirate captain Ghertie once held a rune."
497 ;;-----------------------
500 (define (quest-ghertie-update)
501 (let* ((quest (quest-data-get 'questentry-ghertie))
502 (quest-tbl (car (qst-payload quest))))
503 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
504 (qst-set-descr! quest
508 (kern-ui-paginate-text
509 (string-append "The ghost of Ghertie the pirate once haunted the inn at Oparine. In exchange for her revenge, she revealed the location of her sunken ship: [" (number->string merciful-death-x) ", " (number->string merciful-death-y) "].")
511 ((tbl-flag? 'questinfo)
513 (kern-ui-paginate-text
514 "The ghost of Ghertie the pirate haunts the inn at Oparine. She seeks revenge on the survivors of the crew that betrayed her."
516 "Gholet, Jorn and Meaney each wear a ring marking them as Ghertie's crew. Ghertie will accept the rings as proof that you have hunted them down, in exchange for the location of her sunken treasure."
518 (if (and (tbl-flag? 'ring-jorn)
519 (tbl-flag? 'ring-meaney)
520 (tbl-flag? 'ring-gholet))
521 (kern-ui-paginate-text
523 "You have retrieved all three skull rings."
527 ((tbl-flag? 'ring-gholet)
528 (kern-ui-paginate-text
530 "You have retrieved a skull ring from Gholet."
532 ((tbl-flag? 'gholet-price)
533 (kern-ui-paginate-text
535 "Gholet is held in the dungeons beneath Glasdrin, and will exchange the ring for a dozen lockpicks."
537 ((tbl-flag? 'gholet-dungeon)
538 (kern-ui-paginate-text
540 "Gholet is held in the dungeons beneath Glasdrin."
542 ((tbl-flag? 'gholet-prison)
543 (kern-ui-paginate-text
545 "If Gholet can be found anywhere it will be in some prison or another."
550 ((tbl-flag? 'ring-jorn)
551 (kern-ui-paginate-text
553 "You have retrieved a skull ring from Jorn."
555 ((tbl-flag? 'jorn-loc)
556 (kern-ui-paginate-text
558 "Jorn can be found at the Green Tower's White Stag Inn."
560 ((tbl-flag? 'jorn-forest)
561 (kern-ui-paginate-text
563 "Jorn is a bandit somewhere in the Great Forest."
568 ((tbl-flag? 'ring-meaney)
569 (kern-ui-paginate-text
571 "You have retrieved a skull ring from Meaney."
573 ((tbl-flag? 'meaney-loc)
574 (kern-ui-paginate-text
576 "Meaney runs the Poor House, north of Oparine."
584 (kern-ui-paginate-text
586 (if (tbl-flag? 'ghertieid)
587 "The ghost of Ghertie the pirate"
589 (if (tbl-flag? 'ghertieloc)
590 "haunts the inn at Oparine. "
591 "may be found in Oparine. ")
592 (if (tbl-flag? 'revenge)
593 "She seeks ^c+mrevenge^c-, and may aid you if you take care of her unfinished business."
594 (string-append "Why does "
595 (if (tbl-flag? 'ghertieid) "she" "it")
606 ;;------------------------------------------------------------------------
610 (define (quest-rune-l-update)
611 (let* ((quest (quest-data-get 'questentry-rune-l))
612 (quest-tbl (car (qst-payload quest))))
613 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
614 (qst-set-descr! quest
618 (kern-ui-paginate-text
619 "A rune was recovered from the fallen Warritrix."
621 ((and (tbl-flag? 'located) (tbl-flag? 'know-hall))
622 (kern-ui-paginate-text
624 "One of the runes is carried by the Warritrix. "
625 "She may be found in the Lost Halls, at ["
626 (number->string (loc-x lost-halls-loc)) "," (number->string (loc-y lost-halls-loc))
630 ((and (tbl-flag? 'located) (tbl-flag? 'approx-hall))
631 (kern-ui-paginate-text
633 "One of the runes is carried by the Warritrix. "
634 "She may be found in the Lost Halls, on the Shard's south coast."
637 ((tbl-flag? 'located)
638 (kern-ui-paginate-text
639 "One of the Runes is carried by the Warritrix, who may be found at the Lost Halls."
642 (kern-ui-paginate-text
643 "One of the Runes is carried by the Warritrix."
650 ;;-----------------------
653 (define (quest-rune-s-update)
654 (let* ((quest (quest-data-get 'questentry-rune-s))
655 (quest-tbl (car (qst-payload quest))))
656 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
657 (qst-set-descr! quest
661 (kern-ui-paginate-text
662 "A rune was recovered from the Absalot ruins."
664 ((tbl-flag? 'silasinfo)
665 (kern-ui-paginate-text
666 "Silas has a rune hidden in the Absalot ruins."
669 (kern-ui-paginate-text
670 "A rune may be found somewhere in Absalot."
677 ;;-----------------------
679 ;; tracks if the player has gotten the rune back from the enchanter
681 (define (quest-rune-k-update)
682 (let* ((quest (quest-data-get 'questentry-rune-k))
683 (quest-tbl (car (qst-payload quest))))
684 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
685 (qst-set-descr! quest
688 ((tbl-flag? 'entrusted-with-rune)
689 (kern-ui-paginate-text
690 "The Enchanter has entrusted the Rune of Knowledge into your care."
692 ((tbl-flag? 'player-got-rune)
693 (kern-ui-paginate-text
694 "The Rune of Knowledge belonged to the Enchanter, but has since fallen into your hands."
696 ((tbl-flag? 'ench-should-have-rune)
697 (kern-ui-paginate-text
698 "The Rune of Knowledge belongs to the Enchanter. You may be able to convince him to turn it over to you."
701 (kern-ui-paginate-text
702 "The Rune of Knowledge belonged to the Enchanter."
710 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
711 ;; Search for the Wise quest group
713 (define (quest-wise-init)
714 (quest-data-assign-once 'questentry-wise)
716 (if (not (null? (quest-data-getvalue tag 'name)))
717 (quest-data-assign-once tag)
719 (list 'questentry-enchanter 'questentry-warritrix 'questentry-alchemist
720 'questentry-the-man 'questentry-engineer 'questentry-necromancer)
723 (define (quest-wise-subinit tag)
724 (quest-data-update tag 'name 1)
725 (if (quest-data-assigned? 'questentry-wise)
726 (quest-data-assign-once tag)
730 ;; TODO- merge lost hall location info with rune quest
731 (define (quest-warritrix-update)
732 (let* ((quest (quest-data-get 'questentry-warritrix))
733 (quest-tbl (car (qst-payload quest))))
734 (define (tbl-flag? tag) (not (null? (tbl-get quest-tbl tag))))
735 (qst-set-descr! quest
738 ((tbl-flag? 'avenged)
739 (kern-ui-paginate-text
740 "The Warritrix was the most cunning warrior of the age, but was slain in an ambush in the Lost Halls."
742 "You have since brought her betrayers to justice."
745 (kern-ui-paginate-text
746 "The Warritrix was the most cunning warrior of the age, but was slain in an ambush in the Lost Halls."
750 ((tbl-flag? 'lost-hall-loc)
751 (kern-ui-paginate-text
753 "The Warritrix was the most cunning warrior of the age, but her spirit has been seen in the Void."
755 "Her mortal remains may still lie in the Lost Halls, at ["
756 (number->string (loc-x lost-halls-loc)) "," (number->string (loc-y lost-halls-loc))
760 ((tbl-flag? 'lost-hall)
761 (kern-ui-paginate-text
762 "The Warritrix was the most cunning warrior of the age, but her spirit has been seen in the Void."
764 "Her mortal remains may still lie in the Lost Halls."
767 (kern-ui-paginate-text
768 "The Warritrix was the most cunning warrior of the age, but her spirit has been seen in the Void."
770 "When alive, she served the city of Glasdrin."
773 ((tbl-flag? 'lost-hall-loc)
774 (kern-ui-paginate-text
776 "The Warritrix is the most cunning warrior of the age. She is overdue from her mission the the Lost Halls, which can be found at ["
777 (number->string (loc-x lost-halls-loc)) "," (number->string (loc-y lost-halls-loc))
781 ((tbl-flag? 'lost-hall)
782 (kern-ui-paginate-text
783 "The Warritrix is the most cunning warrior of the age. A mission has taken her to the Lost Halls."
785 ((tbl-flag? 'assignment)
786 (kern-ui-paginate-text
787 "The Warritrix is the most cunning warrior of the age. She is currently away from Glasdrin on a mission."
789 ((tbl-flag? 'general-loc)
790 (kern-ui-paginate-text
791 "The Warritrix is the most cunning warrior of the age. She can normally be found around Glasdrin."
794 (kern-ui-paginate-text
795 "The Warritrix is the most cunning warrior of the age."
798 (kern-ui-paginate-text
799 "The Warritrix is one of the wise."