1 ;;----------------------------------------------------------------------------
3 ;;----------------------------------------------------------------------------
5 ;;----------------------------------------------------------------------------
9 ;;----------------------------------------------------------------------------
10 (kern-mk-sched 'sch_oscar
11 (list 0 0 oparine-innkeepers-bed "sleeping")
12 (list 8 0 bilge-water-seat-3 "eating")
13 (list 9 0 cheerful-counter "working")
14 (list 12 0 bilge-water-seat-3 "eating")
15 (list 13 0 cheerful-counter "working")
16 (list 21 0 bilge-water-seat-3 "eating")
17 (list 22 0 bilge-water-hall "idle")
18 (list 23 0 oparine-innkeepers-bed "sleeping")
21 ;;----------------------------------------------------------------------------
24 ;; Quest flags, etc, go here.
25 ;;----------------------------------------------------------------------------
26 (define (oscar-mk) nil)
28 ;;----------------------------------------------------------------------------
31 ;; Oscar is the innkeeper in Oparine. He is a glum fellow, with a wooden leg.
32 ;;----------------------------------------------------------------------------
35 (define (oscar-hail knpc kpc)
36 (say knpc "[You meet a glum man with a wooden leg] Hello."))
38 (define (oscar-default knpc kpc)
39 (say knpc "I don't know."))
41 (define (oscar-name knpc kpc)
42 (say knpc "I'm Oscar the Innkeeper."))
44 (define (oscar-join knpc kpc)
45 (say knpc "I would just get in the way."))
47 (define (oscar-job knpc kpc)
48 (say knpc "I'm the Innkeeper. "
49 "I doubt you want to rent a room, "
50 "but if you do let me know."))
52 (define (oscar-bye knpc kpc)
56 (define (oscar-trade knpc kpc)
57 (if (not (string=? "working" (kern-obj-get-activity knpc)))
58 (say knpc "The inn is open from 9 to 9, and I do have to eat sometime, "
60 (let ((door (eval 'oparine-inn-room-1-door)))
61 ;; is the room still open?
62 (if (not (door-locked? (kobj-gob door)))
63 ;; yes - remind player
64 (say knpc "Your room is still open.")
65 ;; no - ask if player needs a room
67 (say knpc "Do you need a room?")
68 (if (kern-conv-get-yes-no? kpc)
69 ;; yes - player wants a room
72 "That will be " oparine-inn-room-price " gold. "
73 "You can have the room as long as you're in town. "
74 "Do you still want it?")
75 (if (kern-conv-get-yes-no? kpc)
76 ;; yes - player agrees to the price
77 (let ((gold (kern-player-get-gold)))
78 ;; does player have enough gold?
79 (if (>= gold oparine-inn-room-price)
80 ;; yes - player has enough gold
82 (say knpc "Ok, you're in room 1, "
83 "but you won't like it. "
84 "Don't complain to me because I told you "
88 oparine-inn-room-price))
89 (send-signal knpc door 'unlock)
92 ;; no - player does not have enouvh gold)
93 (say knpc "Sorry, but you don't have the gold. "
94 "This isn't a poorhouse, you know." )))
95 ;; no - player does not agree to the price
97 "I knew you wouldn't.")))
98 ;; no - player does not want a room
99 (say knpc "I didn't think so. "
100 "I was just being polite.")))))))
103 (define (oscar-inn knpc kpc)
104 (say knpc "The former owner gave it the name. "
105 "I didn't feel like changing it. Besides, that would be bad luck."))
107 (define (oscar-luck knpc kpc)
108 (say knpc "The ghost in room 3 likes the name. I don't want the ghost of "
109 "a wicked pirate mad at me.")
110 (quest-data-assign-once 'questentry-ghertie)
111 (quest-data-update 'questentry-ghertie 'ghertieloc 1))
113 (define (oscar-ghost knpc kpc)
114 (say knpc "Ghastly Ghertie was murdered by her crew in room 3. "
115 "She still haunts it so I don't rent it out. "
116 "I wish she would pay her bill.")
117 (quest-data-update 'questentry-ghertie 'ghertieid 1)
118 (quest-data-update 'questentry-ghertie 'ghertieloc 1)
119 (quest-data-assign-once 'questentry-ghertie))
122 (define (oscar-leg knpc kpc)
123 (say knpc "I tried to be a sailor but nobody would take me. "
124 "So I cut off my leg to make myself look like a sailor. "
125 "They still wouldn't take me. I miss that leg."))
128 (define (oscar-opar knpc kpc)
129 (say knpc "This is a port city. Most of my customers are travelers who "
130 "disembark here before traveling north."))
132 (define (oscar-gher knpc kpc)
133 (say knpc "Ghertie was a wicked pirate back before my time. "
134 "Her own crew murdered her and left with her ship and her treasure.")
135 (quest-data-assign-once 'questentry-ghertie))
137 (define (oscar-alch knpc kpc)
138 (say knpc "His shop is next to the tavern. He's always looking for weird "
139 "stuff to use in his experiments."))
141 (define (oscar-bart knpc kpc)
142 (say knpc "Bart the shipwright has a shop just across the way. "
143 "He usually gets pretty drunk at night. I can't keep up with him."))
145 (define (oscar-seaw knpc kpc)
146 (say knpc "The sea witch is very beautiful but keeps to herself. "
147 "She ignores me, of course."))
149 (define (oscar-henr knpc kpc)
150 (say knpc "There's a real sailor. I'll never be like him."))
156 (method 'default oscar-default)
157 (method 'hail oscar-hail)
158 (method 'bye oscar-bye)
159 (method 'job oscar-job)
160 (method 'name oscar-name)
161 (method 'join oscar-join)
164 (method 'trad oscar-trade)
165 (method 'room oscar-trade)
166 (method 'buy oscar-trade)
167 (method 'sell oscar-trade)
170 (method 'inn oscar-inn)
171 (method 'luck oscar-luck)
172 (method 'ghos oscar-ghost)
173 (method 'pira oscar-ghost)
174 (method 'leg oscar-leg)
177 (method 'opar oscar-opar)
178 (method 'alch oscar-alch)
179 (method 'gher oscar-gher)
180 (method 'ghas oscar-gher)
181 (method 'henr oscar-henr)
182 (method 'bart oscar-bart)
183 (method 'sea oscar-seaw)
184 (method 'witc oscar-seaw)
190 (kern-mk-char 'ch_oscar ; tag
195 faction-men ; starting alignment
199 max-health -1 max-health 0 1 ; hp/xp/mp/AP_per_turn/lvl
203 'townsman-ai ; special ai
205 (list t_dagger) ; readied