forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oshu_manor.lic
161 lines (142 loc) · 4 KB
/
oshu_manor.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
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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#oshu_manor
=end
custom_require.call(%w(common common-travel common-items events drinfomon))
class Oshu
include DRC
include DRCT
include DRCI
def initialize
arg_definitions = [
[
{ name: 'worm', regex: /^worm/i, description: 'Hunt grave worms' }
],
[
{ name: 'kartais', regex: /^kartais/i, description: 'Hunt seordhevor kartais' }
]
]
args = parse_args(arg_definitions)
@critter = args
settings = get_settings
@ignored_npcs = settings.ignored_npcs
@waiting_room = 2317
@graves = [2334, 2337, 2338, 2317]
@grave_exits = [2356, 2349, 2347]
Flags.add('allready', "The gargoyle head doesn't budge.")
Flags.add('blasted', 'The blast catches you fully and sends you careening northward through the air!')
Flags.add('head-reset', 'A stone gargoyle head suddenly makes a series of loud grinding')
stow_hands
grave_digger
end
def safe_to_dig?
(DRRoom.npcs - @ignored_npcs).empty?
end
def grave_digger
@graves.each do |grave|
walk_to(grave)
grave_digger if Room.current.id == @waiting_room
break if safe_to_dig?
end
case bput('dig grave', 'You struggle to dig', 'You use your bare hands')
when 'You struggle to dig'
waitrt?
grave_digger
when 'You use your bare hands'
waitrt?
waitfor('You dig to the surface')
waitrt?
fix_standing
return if @critter.worm
puzzle_begin if @critter.kartais
end
grave_digger
end
def puzzle_begin
walk_to(2350)
stow_hands
case bput('push statue', 'and it settles into its new position with a click', 'The granite statue has already been pushed', 'You must have both hands free to do that.')
when 'You must have both hands free to do that.'
stow_hands
puzzle_begin
end
to_house
end
def to_house
walk_to(2340)
move('go house')
move('south')
head_game
end
def blasted?
return unless Flags['blasted']
Flags.reset('blasted')
fix_standing
move('south')
end
def head_reset?
return unless Flags['head-reset']
Flags.reset('head-reset')
head_game
end
def wait_and_check
pause
waitrt?
blasted?
head_reset?
end
def head_game
stow_hands
fput'look head'
pause 1
last_lines = reget(20)
.flatten
gotfire = last_lines.any? { |line| line.include?('the crooked nose of the gargoyle head is pointed towards the word "Fire."') }
head_turner('Fire') unless gotfire
wait_and_check
bput('push claw', 'claw is already pushed up as far as it will', 'and it clicks into place')
wait_and_check
bput('push head', 'The gargoyle head shudders as something inside grinds into', 'Roundtime')
wait_and_check
head_turner('Exchange')
wait_and_check
bput('pull claw', ' as far as it will', 'and it clicks into place')
wait_and_check
bput('push head', 'The gargoyle head shudders as something inside grinds into', 'Roundtime')
wait_and_check
head_turner('Poison')
wait_and_check
bput('push claw', 'claw is already pushed up as far as it will', 'and it clicks into place')
wait_and_check
bput('push head', 'The gargoyle head shudders as something inside grinds into', 'Roundtime')
wait_and_check
fput('pull lever')
gtfo
end
def open?
return unless Flags['allready']
Flags.reset('allready')
gtfo
end
def head_turner(word)
waitrt?
open?
bput('turn head', 'Roundtime', "The gargoyle head doesn't budge.")
word_list = reget(4)
.flatten
head_turner(word) unless word_list.any? { |line| line.include?("You grab the gargoyle head and wrestle it around until it points at the word \"#{word}.\"") }
end
def gtfo
move('north')
move('go door')
pause 1
unless Room.current.id == 2340
move('south')
fput('pull lever')
gtfo
end
walk_to(2345)
move('go door')
exit
end
end
Oshu.new