forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
carve-lockpicks.lic
109 lines (98 loc) · 3.83 KB
/
carve-lockpicks.lic
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
=begin
Need these settings in your yaml:
#Header
Lockpick_carve_settings:
grand_container: #bag for complete grandmaster's lockpicks
master_container: #bag for completed master's lockpicks
trash_container: #bag for anything less than master/grandmaster
initial_grand: #true/false as to whether to initial your grandmasters' lockpicks
=end
custom_require.call(%w[common common-items common-crafting])
class CarveLockpicks
def initialize
@settings = get_settings
@bag = @settings.crafting_container
@bag_items = @settings.crafting_items_in_container
@belt = @settings.engineering_belt
@lockpick_carve_settings = @settings.lockpick_carve_settings
@grandbag = @lockpick_carve_settings['grand_container']
@masterbag = @lockpick_carve_settings['master_container']
@trashbag = @lockpick_carve_settings['trash_container']
@initial = @lockpick_carve_settings['initial_grand']
DRC.wait_for_script_to_complete('buff', ['carve'])
DRC.bput('sit', 'You sit', 'You are already sitting', 'You rise', 'While swimming?') unless sitting?
DRCC.get_crafting_item("carving knife", @bag, @bag_items, @belt)
if DRCI.exists?("keyblank pocket")
get_keyblank
else
DRCC.stow_crafting_item("carving knife", @bag, @belt)
exit
end
end
def get_keyblank
case DRC.bput "get keyblank from my keyblank pocket", 'You get', 'What were you referring to?'
when /What were you referring to?/
case DRC.bput "count my keyblank pocket", /There's nothing inside the keyblank pocket/, /It looks like there/, /I could not find what you were referring to./
when /There's nothing inside the keyblank pocket/
empty_pocket
when /It looks like there/
DRC.bput "open my keyblank pocket", 'You open a'
when /I could not find what you were referring to./
DRCC.stow_crafting_item("carving knife", @belt, @bag)
exit
end
get_keyblank
when /You get/
carve_keyblank
end
end
def carve_keyblank
case DRC.bput('carve my keyblank with my knife', /proudly glance down at a grandmaster/, /begin to carefully carve/, /proudly glance down at a master/, /but feel your knife slip/)
when /proudly glance down at a grandmaster/
stow_item("grand")
when /begin to carefully carve/
carve_lockpick
when /proudly glance down at a master/
stow_item("master")
when /but feel your knife slip and the iron keyblank snaps like a twig/
get_keyblank
end
end
def carve_lockpick
case DRC.bput('carve my lockpick with my knife', /proudly glance down at a grandmaster/, /proudly glance down at a master/, /into the side of a/, /find a creature to carve/, /It would be better/, /Working with extreme caution/, /but feel your knife slip/)
when /proudly glance down at a grandmaster/
stow_item("grand")
when /proudly glance down at a master/
stow_item("master")
when /but feel your knife slip/
get_keyblank
return
when /find a creature to carve/, /It would be better/
stow_item("trash")
when /Working with extreme caution/
carve_lockpick
when /iron lockpick in your hands/
stow_item("trash")
end
end
def stow_item(name)
case name
when /grand/
DRC.bput("carve my lockpick with my knife", 'With the precision and skill') if @initial
DRCI.put_away_item?('lockpick', @grandbag)
when /master/
DRCI.put_away_item?('lockpick', @masterag)
when /trash/
DRCI.put_away_item?('lockpick', @trashbag)
end
get_keyblank
end
def empty_pocket
DRC.bput("get my keyblank pocket", 'You get')
DRC.bput("drop my pocket", 'You drop')
return unless /referring/ =~ DRC.bput("open my keyblank pocket", 'You open', 'What were you referring')
DRCC.stow_crafting_item("carving knife", @bag, @belt)
exit
end
end
CarveLockpicks.new