1;;----------------------------------------------------------------------------
2;; Constants
3;;----------------------------------------------------------------------------
4(define bill-start-lvl 3)
5
6;;----------------------------------------------------------------------------
7;; Schedule
8;;
9;; In Bole.
10;;----------------------------------------------------------------------------
11(kern-mk-sched 'sch_bill
12               (list 0  0  bole-bed-bill "sleeping")
13               (list 6  0  bole-table-1  "idle")
14               (list 7  0  bole-n-woods  "working")
15               (list 12 0  bole-table-2  "eating")
16               (list 13 0  bole-n-woods  "working")
17               (list 18 0  bole-table-2  "eating")
18               (list 19 0  bole-dining-hall "idle")
19               (list 21 0  bole-bills-hut "idle")
20               (list 22 0  bole-bed-bill "sleeping")
21               )
22
23;;----------------------------------------------------------------------------
24;; Gob
25;;
26;; Quest flags, etc, go here.
27;;----------------------------------------------------------------------------
28(define (bill-mk) nil)
29
30;;----------------------------------------------------------------------------
31;; Conv
32;;
33;; Bill is a woodcutter who lives in Bole.
34;; Not the sharpest tool in the shed.
35;;----------------------------------------------------------------------------
36(define bill-catalog
37  (list
38   (list t_staff 10 "It's hard tuh find branches straight enought to make a staff.") ;; rather cheap
39   (list t_torch  3 "Ah always like tuh see at night, so I make torches.") ;; rather cheap
40   (list t_arrow  3 "The rangers from Green Tower sometimes buy my arrows.")
41   (list t_bolt   4 "Not many folks use crossbows 'round here.")
42   ))
43
44(define bill-merch-msgs
45  (list nil ;; closed
46        "I make all this stuff my self." ;; buy
47        nil ;; sell
48        nil ;; trade
49        "I hope they work ok for you." ;; sold-something
50        "If ye change yer mind ah'll be around." ;; sold-nothing
51        nil ;; bought-something
52        nil ;; bought-nothing
53        nil ;; traded-something
54        nil ;; traded-nothing
55        ))
56
57
58(define (bill-buy knpc kpc) (conv-trade knpc kpc "buy" bill-merch-msgs bill-catalog))
59
60(define (bill-goods knpc kpc)
61  (say knpc "Want to buy some?")
62  (if (kern-conv-get-yes-no? kpc)
63      (bill-buy knpc kpc)
64      (say knpc "Just ask if you ever do.")))
65
66(define (bill-may knpc kpc)
67  (say knpc "She runs the tavern in town an' is a good lady."))
68
69(define (bill-lady knpc kpc)
70  (say knpc "There's uh lady in town now. She's real pretty. But she has "
71       "a big, mean boyfrien'."))
72
73(define (bill-bole knpc kpc)
74  (say knpc "Yeah, Ah like Bole. "
75       "There's uh tavern, where Ah eat an' get shit-faced. "
76       "An' muh house is there."))
77
78(define (bill-wolves knpc kpc)
79  (say knpc "I hafta wach out for them. "
80       "They stays mostly inna south, away from town."))
81
82(define (bill-scared knpc kpc)
83  (say knpc "Ah wuz west o' the town, "
84       "where's I hardly never go on account o' the wulves. "
85       "There was a great big, old, dead oak. "
86       "I sez to myself, that's a good-un! "
87       "Well, no sooner had muh axe bit into the bark "
88       "but it wakes up!"))
89
90(define (bill-thie knpc kpc)
91  (say knpc "There wuz a right nervous feller at the tavern not long ago. "
92       "He had some words with the pretty lady. I think they got in uh "
93       "argument over somethin'. I saw him go into the hills in the "
94       "northeast cornah uh town, you know? And he never came out. I "
95       "don' know where he went! Them hills is uh dead-end! Plumb strange "
96       "if'n you ask me."))
97
98(define (bill-mous knpc kpc)
99  (say knpc "Therez mice all over. Jus' the other day I saw a man what "
100       "scurried lak a mouse!"))
101
102(define bill-conv
103  (ifc nil
104       (method 'default (lambda (knpc kpc) (say knpc "[He shrugs]")))
105       (method 'hail (lambda (knpc kpc) (say knpc "Hi-dee.")))
106       (method 'bye (lambda (knpc kpc) (say knpc "Fare thee well.")))
107       (method 'job (lambda (knpc kpc)
108                      (say knpc "I's a woodcutter.")))
109       (method 'name (lambda (knpc kpc) (say knpc "Called Bill.")))
110       (method 'join (lambda (knpc kpc)
111                       (say knpc "No, sirree! Yousa ass-kicker, "
112                            "and I'sa woodcutter. Not a good match, no "
113                            "offense.")))
114
115       (method 'arro bill-goods)
116       (method 'axe
117               (lambda (knpc kpc)
118                 (say knpc "It works better than muh knife on most trees.")))
119       (method 'buy bill-buy)
120       (method 'bole bill-bole)
121       (method 'chop
122               (lambda (knpc kpc)
123                 (say knpc "Ah use muh axe.")))
124       (method 'fore
125               (lambda (knpc kpc)
126                 (say knpc "Yeah, the forest is plumb full o' trees. "
127                      "And wolves, too.")))
128       (method 'haun
129               (lambda (knpc kpc)
130                 (say knpc "[He leans in close and whispers] "
131                      "Thar's a haunted tree west o' the town. "
132                      "Scared the jinkins outta me! Har!")))
133       (method 'jink bill-scared)
134       (method 'ladi bill-lady)
135       (method 'lady bill-lady)
136
137       (method 'may bill-may)
138
139       (method 'wood
140               (lambda (knpc kpc)
141                 (say knpc "I cuts down trees and chops 'em into firewood. "
142                      "Sometimes Ah make torches or arrows, too. Um-hm.")))
143       (method 'shit
144               (lambda (knpc kpc)
145                 (say knpc "Oops! Sorry. I's not supposed to say that. "
146                      "May's alwiz tellin' me not tuh say words lak shit and "
147                      "damn. Ladies don' lak that, you know.")))
148       (method 'scar bill-scared)
149       (method 'thie bill-thie)
150       (method 'mous bill-mous)
151       (method 'man  bill-thie)
152       (method 'scur bill-thie)
153       (method 'torc bill-goods)
154       (method 'town bill-bole)
155       (method 'trad bill-buy)
156       (method 'tree
157               (lambda (knpc kpc)
158                 (say knpc "There be all kinds uh trees in this forest. "
159                      "Why, t'other day I even came me across a haunted "
160                      "tree!")))
161       (method 'wake
162               (lambda (knpc kpc)
163                 (say knpc "Aye! That old dead oak came alive! "
164                      "It bellered like a bull and two great eyes opened "
165                      "und stared right at me! Uh jumped out of my britches!"
166                      "I dropped muh axe and ran like nothing!")))
167       (method 'wolv bill-wolves)
168       (method 'wulv bill-wolves)
169       ))
170
171;;----------------------------------------------------------------------------
172;; First-time constructor
173;;----------------------------------------------------------------------------
174(define (mk-bill)
175  (bind
176   (kern-char-arm-self
177    (kern-mk-char
178     'ch_bill ;;......tag
179     "Bill" ;;.......name
180     sp_human ;;.....species
181     nil ;;..........occupation
182     s_townsman ;;...sprite
183     faction-men ;;..faction
184     2 ;;............custom strength modifier
185     0 ;;............custom intelligence modifier
186     0 ;;............custom dexterity modifier
187     0 ;;............custom base hp modifier
188     0 ;;............custom hp multiplier (per-level)
189     0 ;;............custom base mp modifier
190     0 ;;............custom mp multiplier (per-level)
191     max-health ;;..current hit points
192     -1  ;;...........current experience points
193     max-health ;;..current magic points
194     0
195     bill-start-lvl  ;;..current level
196     #f ;;...........dead?
197     'bill-conv ;;...conversation (optional)
198     sch_bill ;;.....schedule (optional)
199     'townsman-ai ;;..........custom ai (optional)
200
201     ;;..............container (and contents)
202     (mk-inventory
203      (list
204       (list 10  t_torch)
205       (list 100 t_arrow)
206       (list 1   t_2h_axe)
207       ))
208     nil ;;.........readied arms (in addition to the container contents)
209     nil ;;..........hooks in effect
210     ))
211   (bill-mk)))
212