forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsanowret-crystal.lic
More file actions
64 lines (55 loc) · 2.42 KB
/
sanowret-crystal.lic
File metadata and controls
64 lines (55 loc) · 2.42 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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#sanowret-crystal
=end
custom_require.call(%w[common drinfomon])
class SanowretCrystal
def initialize
arg_definitions = [
[
{ name: 'run', regex: /run/i, description: 'Single run of the script', optional: true }
]
]
@invalid_rooms = []
args = parse_args(arg_definitions)
check_crystal if args.run && !hiding?
passive unless args.run
end
def use_crystal
return if @invalid_rooms.include?(Room.current.id)
return if hiding?
if DRSkill.getxp('Arcana') <= 10
response = DRC.bput('gaze sanowret crystal', /A soft light blossoms in the very center of the crystal, and begins to fill your mind with the knowledge of .*\./, 'However, nothing much else happens, as you lack the concentration to focus.', 'This is not a good place for that.')
elsif DRSkill.getxp('Arcana') <= 25
response = DRC.bput('exhale sanowret crystal', 'you come away from the experience with a further understanding of Arcana as the scintillating lights fade again.', 'However, nothing much else happens, as you lack the concentration to focus.', 'This is not a good place for that.', 'Doing that would give away your hiding place.')
end
return if response !~ /This is not a good place for that\./
return if @invalid_rooms.include?(Room.current.id)
@invalid_rooms.push(Room.current.id)
end
def check_crystal
return if DRStats.concentration < 100
return if DRSkill.getxp('Arcana') >= 25
return if hiding?
case DRC.bput('tap my sanowret crystal', /^You tap a sanowret crystal inside your .*.$/, /^You tap a sanowret crystal that you are wearing.$/, /^You tap a sanowret crystal that you are holding.$/, 'I could not find what you were referring to.')
when /You tap a sanowret crystal inside your/
DRC.bput('get my sanowret crystal', 'You get', 'What were you referring to')
use_crystal
DRC.bput('stow my sanowret crystal', 'You put', 'Stow what')
when /^You tap a sanowret crystal that you are wearing\.$/
use_crystal
when /^You tap a sanowret crystal that you are holding\.$/
use_crystal
DRC.bput('stow my sanowret crystal', 'You put', 'Stow what')
else
echo 'Sanowret crystal not found.'
end
end
def passive
loop do
next if @invalid_rooms.include?(Room.current.id)
check_crystal
pause 1
end
end
end
SanowretCrystal.new