-
Notifications
You must be signed in to change notification settings - Fork 157
/
RNG.lua
293 lines (225 loc) · 11.4 KB
/
RNG.lua
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
-- Initialization function for this job file.
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
state.Buff.Barrage = buffactive.Barrage or false
state.Buff.Camouflage = buffactive.Camouflage or false
state.Buff['Unlimited Shot'] = buffactive['Unlimited Shot'] or false
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.RangedMode:options('Normal', 'Acc')
state.WeaponskillMode:options('Normal', 'Acc')
gear.default.weaponskill_neck = "Ocachi Gorget"
gear.default.weaponskill_waist = "Elanid Belt"
DefaultAmmo = {['Yoichinoyumi'] = "Achiyalabopa arrow", ['Annihilator'] = "Achiyalabopa bullet"}
U_Shot_Ammo = {['Yoichinoyumi'] = "Achiyalabopa arrow", ['Annihilator'] = "Achiyalabopa bullet"}
select_default_macro_book()
send_command('bind f9 gs c cycle RangedMode')
send_command('bind ^f9 gs c cycle OffenseMode')
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind f9')
send_command('unbind ^f9')
end
-- Set up all gear sets.
function init_gear_sets()
--------------------------------------
-- Precast sets
--------------------------------------
-- Precast sets to enhance JAs
sets.precast.JA['Bounty Shot'] = {hands="Sylvan Glovelettes +2"}
sets.precast.JA['Camouflage'] = {body="Orion Jerkin +1"}
sets.precast.JA['Scavenge'] = {feet="Orion Socks +1"}
sets.precast.JA['Shadowbind'] = {hands="Orion Bracers +1"}
sets.precast.JA['Sharpshot'] = {legs="Orion Braccae +1"}
-- Fast cast sets for spells
sets.precast.FC = {
head="Haruspex Hat",ear2="Loquacious Earring",
hands="Thaumas Gloves",ring1="Prolix Ring"}
sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
-- Ranged sets (snapshot)
sets.precast.RA = {
head="Orion Beret +1",
body="Sylvan Caban +2",hands="Iuitl Wristbands",
waist="Impulse Belt",legs="Nahtirah Trousers",feet="Khepri Gamashes"}
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
head="Orion beret +1",neck=gear.ElementalGorget,ear1="Vulcan's Pearl",ear2="Vulcan's Pearl",
body="Khepri Jacket",hands="Arcadian Bracers +1",ring1="Pyrosoul Ring",ring2="Rajas Ring",
back="Sylvan Chlamys",waist=gear.ElementalBelt,legs="Nahtirah Trousers",feet="Orion Socks +1" }
sets.precast.WS.Acc = set_combine(sets.precast.WS, {body="Kyujutsugi",ring1="Hajduk Ring +1",
back="Lutian Cape",legs="Orion Braccae +1"})
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
--------------------------------------
-- Midcast sets
--------------------------------------
-- Fast recast for spells
sets.midcast.FastRecast = {
head="Orion Beret +1",ear1="Loquacious Earring",
ring1="Prolix Ring",
waist="Pya'ekue Belt +1",legs="Orion Braccae +1",feet="Orion Socks +1"}
sets.midcast.Utsusemi = {}
-- Ranged sets
sets.midcast.RA = {
head="Arcadian Beret +1",neck="Ocachi Gorget",ear1="Volley earring",ear2="Tripudio Earring",
body="Kyujutsugi",hands="Manibozho Gloves",ring1="Paqichikaji Ring",ring2="Hajduk Ring +1",
back="Lutian Cape",waist="Elanid Belt",legs="Nahtirah Trousers",feet="Orion Socks +1"}
sets.midcast.RA.Acc = set_combine(sets.midcast.RA,
{head="Orion Beret +1",neck="Ej Necklace +1",hands="Manibozho Gloves",ring2="Hajduk Ring +1",
back="Lutian Cape",legs="Orion Braccae +1"})
sets.midcast.RA.Annihilator = set_combine(sets.midcast.RA)
sets.midcast.RA.Annihilator.Acc = set_combine(sets.midcast.RA.Acc)
sets.midcast.RA.Yoichinoyumi = set_combine(sets.midcast.RA, {ear2="Clearview Earring",ring2="Rajas Ring",
back="Sylvan Chlamys"})
sets.midcast.RA.Yoichinoyumi.Acc = set_combine(sets.midcast.RA.Acc, {ear2="Clearview Earring"})
--------------------------------------
-- Idle/resting/defense/etc sets
--------------------------------------
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {head="Ocelomeh Headpiece +1",neck="Wiglen Gorget",
ring1="Sheltered Ring",ring2="Paguroidea Ring"}
-- Idle sets
sets.idle = {
head="Arcadian Beret +1",neck="Ej Necklace +1",ear1="Vulcan's Pearl",ear2="Vulcan's Pearl",
body="Khepri Jacket",hands="Arcadian Bracers +1",ring1="Defending Ring",ring2="Shadow Ring",
back="Shadow Mantle",waist="Pya'ekue Belt +1",legs="Nahtirah Trousers",feet="Fajin Boots"}
-- Defense sets
sets.defense.PDT = {
head="Whirlpool Mask",neck="Twilight Torque",
body="Orion Jerkin +1",hands="Orion Bracers +1",ring1="Defending Ring",ring2=gear.DarkRing.physical,
back="Mollusca Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Orion Socks +1"}
sets.defense.MDT = {
head="Orion Beret +1",neck="Twilight Torque",
body="Orion Jerkin +1",hands="Orion Bracers +1",ring1="Defending Ring",ring2="Shadow Ring",
back="Mollusca Cape",waist="Flume Belt",legs="Nahtirah Trousers",feet="Orion Socks +1"}
sets.Kiting = {feet="Fajin Boots"}
--------------------------------------
-- Engaged sets
--------------------------------------
sets.engaged = {
head="Whirlpool Mask",neck="Twilight Torque",ear1="Steelflash Earring",ear2="Bladeborn Earring",
body="Orion Jerkin +1", hands="Arcadian Bracers +1", ring1="Defending Ring",ring2="Rajas Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Orion Socks +1"}
sets.engaged.Acc = {
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Steelflash Earring",ear2="Bladeborn Earring",
body="Manibozho Jerkin",hands="Iuitl Wristbands",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Letalis Mantle",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Iuitl Gaiters"}
--------------------------------------
-- Custom buff sets
--------------------------------------
sets.buff.Barrage = set_combine(sets.midcast.RA.Acc, {hands="Orion Bracers +1"})
sets.buff.Camouflage = {body="Orion Jerkin +1"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Ranged Attack' then
state.CombatWeapon:set(player.equipment.range)
end
if spell.action_type == 'Ranged Attack' or
(spell.type == 'WeaponSkill' and (spell.skill == 'Marksmanship' or spell.skill == 'Archery')) then
check_ammo(spell, action, spellMap, eventArgs)
end
if state.DefenseMode.value ~= 'None' and spell.type == 'WeaponSkill' then
-- Don't gearswap for weaponskills when Defense is active.
eventArgs.handled = true
end
end
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_midcast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Ranged Attack' and state.Buff.Barrage then
equip(sets.buff.Barrage)
eventArgs.handled = true
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff, gain)
if buff == "Camouflage" then
if gain then
equip(sets.buff.Camouflage)
disable('body')
else
enable('body')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
-- Check for proper ammo when shooting or weaponskilling
function check_ammo(spell, action, spellMap, eventArgs)
-- Filter ammo checks depending on Unlimited Shot
if state.Buff['Unlimited Shot'] then
if player.equipment.ammo ~= U_Shot_Ammo[player.equipment.range] then
if player.inventory[U_Shot_Ammo[player.equipment.range]] or player.wardrobe[U_Shot_Ammo[player.equipment.range]] then
add_to_chat(122,"Unlimited Shot active. Using custom ammo.")
equip({ammo=U_Shot_Ammo[player.equipment.range]})
elseif player.inventory[DefaultAmmo[player.equipment.range]] or player.wardrobe[DefaultAmmo[player.equipment.range]] then
add_to_chat(122,"Unlimited Shot active but no custom ammo available. Using default ammo.")
equip({ammo=DefaultAmmo[player.equipment.range]})
else
add_to_chat(122,"Unlimited Shot active but unable to find any custom or default ammo.")
end
end
else
if player.equipment.ammo == U_Shot_Ammo[player.equipment.range] and player.equipment.ammo ~= DefaultAmmo[player.equipment.range] then
if DefaultAmmo[player.equipment.range] then
if player.inventory[DefaultAmmo[player.equipment.range]] then
add_to_chat(122,"Unlimited Shot not active. Using Default Ammo")
equip({ammo=DefaultAmmo[player.equipment.range]})
else
add_to_chat(122,"Default ammo unavailable. Removing Unlimited Shot ammo.")
equip({ammo=empty})
end
else
add_to_chat(122,"Unable to determine default ammo for current weapon. Removing Unlimited Shot ammo.")
equip({ammo=empty})
end
elseif player.equipment.ammo == 'empty' then
if DefaultAmmo[player.equipment.range] then
if player.inventory[DefaultAmmo[player.equipment.range]] then
add_to_chat(122,"Using Default Ammo")
equip({ammo=DefaultAmmo[player.equipment.range]})
else
add_to_chat(122,"Default ammo unavailable. Leaving empty.")
end
else
add_to_chat(122,"Unable to determine default ammo for current weapon. Leaving empty.")
end
elseif player.inventory[player.equipment.ammo].count < 15 then
add_to_chat(122,"Ammo '"..player.inventory[player.equipment.ammo].shortname.."' running low ("..player.inventory[player.equipment.ammo].count..")")
end
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
set_macro_page(1, 7)
end