-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrbolt.lic
127 lines (117 loc) · 3.57 KB
/
rbolt.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
=begin
Cast at something with rapid fire until it dies.
https://github.com/matt-lowe/lich-scripts
=end
mana_cost = {
'901' => 1,
'903' => 3,
'904' => 4,
'905' => 5,
'906' => 6,
'907' => 7,
'908' => 8,
'910' => 10,
'505' => 5,
'510' => 10,
'518' => 18,
'917' => 22
}
spell_num_to_name = {
'505' => 'Hand of Tonis',
'510' => 'Hurl Boulder',
'518' => 'Cone of Lightning',
'901' => 'Minor Shock',
'903' => 'Minor Water',
'904' => 'Minor Acid',
'906' => 'Minor Fire',
'907' => 'Major Cold',
'908' => 'Major Fire',
'910' => 'Major Shock',
'917' => 'Boil Earth'
}
#
# check the spell number and target, or make some up
#
if script.vars[2]
spell = script.vars[1]
target = script.vars[2..-1].join(' ')
elsif script.vars[1]
spell = script.vars[1]
target = 'target'
else
spell = '901'
target = 'target'
end
#
# if it's not a bolt spell, exit
#
unless mana_cost[spell]
echo '#{spell} is not a valid bolt spell.'
exit
end
#
# Cast rapid fire if it's not already up
#
until checkspell(515)
Spell[515].cast
sleep 1
waitcastrt?
end
#
# check mana
#
unless mana(mana_cost[spell])
echo 'Not enough mana.'
exit
end
#
# release a spell if a different one is already prepared
#
if (checkprep != 'None') && (checkprep != spell_num_to_name[spell])
dothistimeout 'release', 5, /^You feel the magic of your spell rush away from you\.$|^You don't have a prepared spell to release!$/
end
#
# prepare the spell
#
unless checkprep == spell_num_to_name[spell]
begin
prepare_result = dothistimeout 'prepare ' + spell, 5, /^You already have a spell readied! You must RELEASE it if you wish to prepare another!$|^You can't think clearly enough to prepare a spell!$|^Your spell is ready\.( [Spell is stored])?$/
if prepare_result == 'You already have a spell readied! You must RELEASE it if you wish to prepare another!'
dothistimeout 'release', 5, /^You feel the magic of your spell rush away from you\.$|^You don't have a prepared spell to release!$/
elsif prepare_result == "You can't think clearly enough to prepare a spell!" || prepare_result == nil
exit
end
end until prepare_result =~ /^Your spell is ready\.( [Spell is stored])?$/
end
#
# change stance
#
unless (checkstance == 'offensive') or (spell == '917')
stance_result = dothistimeout 'stance offensive', 2, /^You are now in an offensive stance\.$/
if stance_result == nil
fput 'stance guarded'
exit
end
end
#
# cast a lot
#
if target == 'target'
begin
cast_result = dothistimeout 'cast target', 2, /^Cast Roundtime 3 Seconds\.$|^Your armor prevents the spell from working correctly\.$|^You don't have a spell prepared!$|^Cast at what\?$/
end while ( cast_result == 'Cast Roundtime 3 Seconds.' ) && checkmana(mana_cost[spell])
else
begin
cast_result = dothistimeout 'cast ' + target, 2, /^Cast Roundtime 3 Seconds\.$|^Your armor prevents the spell from working correctly\.$|^You don't have a spell prepared!$|^Cast at what\?$|^A little bit late for that don't you think\?$|goes still\.$|crumbles into a pile of rubble\.$|and dies\.$|lying still\.$|goes still\.$|shudders, then topples to the ground\.$|topples to the ground motionless\.$|^The body twitches slightly in response\.$/
echo cast_result
end while ( cast_result == 'Cast Roundtime 3 Seconds.' ) && checkmana(mana_cost[spell])
end
#But it is dead!
#
# done
#
dothistimeout 'stance guarded', 3, /^You are now in a guarded stance\.$|^You are unable to change your stance\.$/
unless (checkprep == 'None') or checkspell(515)
dothistimeout 'release', 5, /^You feel the magic of your spell rush away from you\.$|^You don't have a prepared spell to release!$/
end