forked from rpherbig/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appraisal.lic
101 lines (89 loc) · 3.37 KB
/
appraisal.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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#appraisal
=end
custom_require.call(%w[common common-travel drinfomon equipmanager])
class Appraisal
include DRC
include DRCT
def initialize
@equipment_manager = EquipmentManager.new
settings = get_settings
train_list = settings.appraisal_training
train_list.each do |task|
break if DRSkill.getxp('Appraisal') >= 30
case task
when 'zills'
assess_zills
when 'pouches'
train_appraisal_with_pouches(settings.full_pouch_container, settings.gem_pouch_adjective)
when 'gear'
train_appraisal_with_gear
when 'bundle'
train_appraisal_with_bundle
when 'art'
train_appraisal_with_art
else
echo "#{task} is not a valid appraisal_training setting"
end
end
end
def train_appraisal_with_art
wait_for_script_to_complete('study-art', ['appraisal'])
end
def train_appraisal_with_gear
@equipment_manager.wear_equipment_set?('standard')
@equipment_manager.items.each { |item| break unless appraise_item?(item) }
end
def train_appraisal_with_bundle
bput('appraise my bundle quick', 'Roundtime', 'Appraise what', 'You cannot appraise')
waitrt?
end
def train_appraisal_with_pouches(full_pouch_container, gem_pouch_adjective)
if gem_pouch_adjective
case bput("appraise my #{gem_pouch_adjective} pouch quick", 'Roundtime', 'You can.t appraise the', 'Appraise what', /You.ll need to open the .*gem pouch to examine its contents./)
when /You.ll need to open the .*gem pouch to examine its contents./
bput("open my #{gem_pouch_adjective} pouch", /You open your .*gem pouch./, /That is already open/)
bput("appraise my #{gem_pouch_adjective} pouch quick", 'Roundtime', 'You can.t appraise the', 'Appraise what')
bput("close my #{gem_pouch_adjective} pouch", /You close your/, /That is already closed/)
end
end
$ORDINALS.each do |ordinal|
case bput("get #{ordinal} pouch from my #{full_pouch_container}", '^You get ', '^What were you referring')
when /^You get /
case bput('appraise my pouch quick', 'Roundtime', /You.ll need to open the .*gem pouch to examine its contents./)
when /You.ll need to open the .*gem pouch to examine its contents./
bput('open my pouch', /You open your .*gem pouch./, /That is already open/)
bput('appraise my pouch quick', 'Roundtime')
bput('close my pouch', /You close your/, /That is already closed/)
end
waitrt?
bput("put my pouch in my #{full_pouch_container}", 'You put')
else
break
end
break if DRSkill.getxp('Appraisal') >= 30
end
end
def appraise_item?(item)
@equipment_manager.get_item?(item)
bput("appraise #{item.short_name} quick", 'Roundtime')
waitrt?
@equipment_manager.empty_hands
DRSkill.getxp('Appraisal') < 30
end
def assess_zills
if DRSkill.getrank('Appraisal') >= 250
echo "Your appraisal skill is above 250. You can remove 'zills' from appraisal_training"
return
end
case bput('remove my zill', 'You slide', 'Remove what')
when 'Remove what'
return
end
bput('assess my zill', 'you carefully look them over')
waitrt?
bput('wear my zill', 'You slide')
end
end
# Call this last to avoid the need for forward declarations
Appraisal.new