forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremedy.lic
More file actions
365 lines (344 loc) · 14.1 KB
/
remedy.lic
File metadata and controls
365 lines (344 loc) · 14.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
=begin
Documentation: https://elanthipedia.play.net/mediawiki/index.php/Lich_script_development#remedy
=end
# ;remedy remedies 2 "blister cream" "red flower" nemoih bar mortar cream
# ;remedy remedies 2 "blister cream" nemoih "not used" bar mortar cream - for when only herb is required
custom_require.call(%w[common common-crafting common-items])
class Remedy
include DRC
include DRCC
include DRCI
def initialize
settings = get_settings
@bag = settings.crafting_container
@bag_items = settings.crafting_items_in_container
@belt = settings.alchemy_belt
arg_definitions = [
[
{ name: 'book_type', display: 'book type', options: %w[remedies], description: 'What alchemy type is this item.' },
{ name: 'chapter', regex: /\d+/i, variable: true, description: 'Chapter containing the item.' },
{ name: 'recipe_name', display: 'recipe name', regex: /^[A-z\s\-]+$/i, variable: true, description: 'Name of the recipe, wrap in double quotes if this is multiple words.' },
{ name: 'herb1', regex: /\w+/i, variable: true, description: 'Prepared herb, wrap in double quotes if this is multiple words..' },
{ name: 'herb2', regex: /\w+/i, variable: true, description: 'Prepared herb, wrap in double quotes if this is multiple words. Put none for none.' },
{ name: 'catalyst', regex: /\w+/i, variable: true, description: 'Type of catalyst.' },
{ name: 'container', regex: /\w+/i, variable: true, description: 'Type of container for creating.' },
{ name: 'noun', regex: /\w+/i, variable: true, options: %w[cream salve wash balm ungent potion tonic ointment elixir poultices draught], description: 'End product' }
]
]
args = parse_args(arg_definitions)
@book_type = args.book_type
@chapter = args.chapter
@recipe_name = args.recipe_name
@herb1 = args.herb1
@herb2 = args.herb2
@catalyst = args.catalyst
@container = args.container
@noun = args.noun
create_item
end
def get_item(name)
get_crafting_item(name, @bag, @bag_items, @belt)
end
def stow_item(name)
stow_crafting_item(name, @bag, @belt)
end
def turn_to(section)
bput("turn my book to #{section}", 'You turn your', 'The book is already')
end
def create_item
stow_item(left_hand)
stow_item(right_hand)
bput('get remed book', 'What were', 'You get')
turn_to("page #{find_recipe(@chapter, @recipe_name)}")
bput('study my book', 'Roundtime')
stow_item('book')
get_item(@container)
if ['red flower', 'blue flower'].include?(@herb1)
@herb1 = 'dried flower' unless exists?('red flower')
end
get_item(@herb1)
case bput("put #{@herb1} in my #{@container}", 'You put', 'already has something', 'can only hold', 'You realize the')
when 'You put', 'can only hold'
stow_item(@herb1) # Added for when the herb is larger than 25 pieces
when 'already has something', 'You realize the'
bput("tilt my #{@container}", 'You grab')
bput("tilt my #{@container}", 'You grab', 'Roundtime')
bput("put #{@herb1} in my #{@container}", 'You put')
stow_item(@herb1) # Added for when the herb is larger than 25 pieces
end
if @container == 'mortar'
get_item('pestle')
crush("crush my #{@herb1} with my pestle")
else
get_item('mixing stick')
mix("mix my #{@container} with my mixing stick")
end
end
def crush(command)
waitrt?
case bput(command,
'You need another splash of water',
'You need another splash of alcohol',
'You toss the',
'Upon completion you see some particulate clouding up the mixture.',
'You need another prepared herb',
'begins to transition colors',
'You need another catalyst material',
'Once finished you notice clumps of material',
'With wide strokes you mix',
'Applying the final touches',
'That tool does not seem suitable for that task.',
'You vigorously rub',
'Patiently you wait a few moments and then proceed',
'Interesting thought really... but no.',
'You need to be holding the pestle first.',
'The mortar can only hold 25 pieces of material.',
'You spin your',
'You slowly filter',
'To avoid a problem',
'Roundtime:')
when 'You need another splash of water'
waitrt?
stow_item(left_hand)
get_item('water')
command = "put water in my #{@container}"
when 'You need another splash of alcohol'
waitrt?
stow_item(left_hand)
get_item('alcohol')
command = "put alcohol in my #{@container}"
when 'You toss the'
stow_item(left_hand)
get_item('pestle')
command = "crush my #{@noun} with my pestle"
when 'You slowly filter', 'You spin your'
stow_item(left_hand)
get_item('pestle')
command = "crush my #{@noun} with my pestle"
when 'Upon completion you see some particulate clouding up the mixture.'
waitrt?
stow_item(left_hand)
get_item('sieve')
command = "push my #{@noun} with my sieve"
when 'Once finished you notice clumps of material'
waitrt?
command = "turn my #{@container} with my pestle"
when 'Patiently you wait a few moments and then proceed'
waitrt?
command = "crush my #{@noun} with my pestle"
when 'Interesting thought really... but no.'
finish
when 'With short strokes you crush'
waitrt?
command = "crush my #{@noun} with my pestle"
when 'Roundtime:'
waitrt?
command = "crush my #{@noun} with my pestle"
when 'To avoid a problem'
analyze_crush
when 'You need another prepared herb'
waitrt?
stow_item(left_hand)
get_item(@herb2)
command = "put my #{@herb2} in my #{@container}"
when 'You need another catalyst material'
waitrt?
stow_item(left_hand)
get_item(@catalyst)
command = "put my #{@catalyst} in my #{@container}"
when 'begins to transition colors'
waitrt?
command = "smell my #{@noun}"
when 'Applying the final touches', 'This appears to be a type'
finish
when 'You vigorously rub'
waitrt?
stow_item(left_hand)
get_item('pestle')
command = "crush my #{@noun} with my pestle"
when 'You need to be holding the pestle first.'
waitrt?
stow_item(left_hand)
get_item('pestle')
command = "crush my #{@noun} with my pestle"
when 'That tool does not seem suitable for that task.'
analyze_crush
end
waitrt?
crush(command)
end
def analyze_crush
case bput("analyze my #{@noun}",
'appears free of defects that would impede further preparation.',
'composition looks accurate and ready for continued preparation',
'smell the mixture', 'You need to be holding the pestle first.',
'You do not see anything that would prevent preparing',
'with a sieve',
'Clumps of material stick to the sides',
'Applying the final touches',
'Interesting thought really... but no.',
'easy piece to make',
'You try to analyze',
'Once finished you notice clumps of material',
'This appears to be a type',
'appears free of defects that would impede further preparation.',
'composition looks accurate and ready for continued preparation.',
'You do not see anything that would prevent preparing',
'smell the mixture',
'You need to be holding the pestle first.',
'with a sieve',
'You try to analyze')
when 'You do not see anything that would prevent preparing', 'You try to analyze', 'appears free of defects that would impede further preparation.', 'You do not see anything that would prevent preparing', 'composition looks accurate and ready for continued preparation.', 'You try to analyze', 'You need to be holding the pestle first', 'appears free of defects that would impede further preparation.', 'composition looks accurate and ready for continued preparation'
stow_item(left_hand)
get_item('pestle')
command = "crush my #{@noun} with my pestle"
when 'smell the mixture'
command = "smell my #{@noun}"
when 'Clumps of material stick to the sides', 'Once finished you notice clumps of material'
waitrt?
command = "turn my #{@container} with my pestle"
when 'Applying the final touches', 'Interesting thought really... but no.', 'easy piece to make'
finish
when 'with a sieve'
stow_item(left_hand)
get_item('sieve')
command = "push my #{@noun} with my sieve"
when 'with a sieve'
stow_item(left_hand)
get_item('sieve')
command = "push my #{@noun} with my sieve"
end
end
def mix(command)
waitrt?
case bput(command,
'You need another splash of water',
'You need another splash of alcohol',
'You toss the',
'Upon completion you see some particulate clouding up the mixture.',
'You need another prepared herb',
'begins to transition colors',
'You need another catalyst material',
'Once finished you notice clumps of material',
'Applying the final touches',
'That tool does not seem suitable for that task.',
'You vigorously rub',
'Patiently you wait a few moments and then proceed',
'Interesting thought really... but no.',
'You need to be holding the mixing stick first.',
'The mortar can only hold 25 pieces of material.',
'You slowly filter',
'You filter',
'Try as you might',
'You spin',
'To avoid a problem',
'Roundtime:')
when 'You need another splash of water'
waitrt?
stow_item(left_hand)
get_item('water')
command = "put water in my #{@container}"
when 'You need another splash of alcohol'
waitrt?
stow_item(left_hand)
get_item('alcohol')
command = "put alcohol in my #{@container}"
when 'You toss the', 'You slowly filter', 'You filter', 'You spin'
stow_item(left_hand)
get_item('mixing stick')
command = "mix my #{@container} with my mixing stick"
when 'Upon completion you see some particulate clouding up the mixture.'
waitrt?
stow_item(left_hand)
get_item('sieve')
command = "push my #{@noun} with my sieve"
when 'Once finished you notice clumps of material'
waitrt?
command = "turn my #{@container} with my mixing stick"
when 'Patiently you wait a few moments and then proceed'
waitrt?
command = "mix my #{@container} with my mixing stick"
when 'Applying the final touches', 'Interesting thought really... but no.', 'Try as you might'
finish
when 'Roundtime:'
waitrt?
command = "mix my #{@container} with my mixing stick"
when 'To avoid a problem', 'That tool does not seem suitable for that task.'
analyze_mix
when 'You need another prepared herb'
waitrt?
stow_item(left_hand)
get_item(@herb2)
command = "put my #{@herb2} in my #{@container}"
when 'You need another catalyst material'
waitrt?
stow_item(left_hand)
get_item(@catalyst)
command = "put my #{@catalyst} in my #{@container}"
when 'begins to transition colors'
waitrt?
command = "smell my #{@noun}"
when 'You vigorously rub'
waitrt?
stow_item(left_hand)
get_item('mixing stick')
command = "mix my #{@container} with my mixing stick"
when 'You need to be holding the mixing stick first.'
waitrt?
stow_item(left_hand)
get_item('mixing stick')
command = "mix my #{@container} with my mixing stick"
end
waitrt?
mix(command)
end
def analyze_mix
case bput("analyze my #{@noun}",
'appears free of defects that would impede further preparation.',
'composition looks accurate and ready for continued preparation.',
'smell the mixture',
'You need to be holding the mixing stick first.',
'with a sieve',
'You try to analyze',
'appears free of defects that would impede further preparation.',
'composition looks accurate and ready for continued preparation',
'smell the mixture',
'You need to be holding the mixing stick first.',
'You do not see anything that would prevent preparing',
'with a sieve',
'Clumps of material stick to the sides',
'Applying the final touches',
'Interesting thought really... but no.',
'easy piece to make',
'basic piece to make',
'simple piece to make',
'You try to analyze',
'You filter',
'Try as you might',
'You spin')
when 'You do not see anything that would prevent preparing', 'appears free of defects that would impede further preparation.', 'composition looks accurate and ready for continued preparation', 'You try to analyze', 'You filter', 'You spin', 'You need to be holding the mixing stick first'
stow_item(left_hand)
get_item('mixing stick')
command = "mix my #{@container} with my mixing stick"
when 'smell the mixture'
command = "smell my #{@noun}"
when 'Clumps of material stick to the sides'
waitrt?
command = "turn my #{@container} with my mixing stick"
when 'Applying the final touches', 'Interesting thought really... but no.', 'easy piece to make', 'basic piece to make', 'simple piece to make', 'Try as you might'
finish
when 'with a sieve'
stow_item(left_hand)
get_item('sieve')
command = "push my #{@noun} with my sieve"
end
end
def finish
waitrt?
stow_item(left_hand)
fput("get my #{@noun} from my #{@container}")
stow_item(right_hand)
exit
end
end
Remedy.new