-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLunafay_RNG.lua
385 lines (331 loc) · 10.6 KB
/
Lunafay_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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
local engagedMode = "Normal"
local rangedMode = "Normal"
function get_sets()
incapacitated_states = T {"stun", "petrification", "terror", "sleep"}
debugMode = false
sets.Idle = {
head = "Nyame Helm",
body = "Nyame Mail",
hands = "Nyame Gauntlets",
legs = "Carmine cuisses +1",
feet = "Nyame Sollerets",
neck = "Comm. Charm +2",
waist = "Sailfi Belt +1",
left_ear = "Telos Earring",
right_ear = "Dedition Earring",
left_ring = "Defending Ring",
right_ring = "Ilabrat Ring"
}
sets.Engaged = {}
sets.Engaged.Normal = {
ammo = "Chrono Bullet",
head = "Malignance Chapeau",
body = "Mummu Jacket +2",
hands = "Meg. Gloves +2",
legs = "Malignance Tights",
feet = "Mummu Gamash. +2",
neck = "Comm. Charm +2",
waist = "Sailfi Belt +1",
left_ear = "Telos Earring",
right_ear = "Cessance Earring",
left_ring = "Ilabrat Ring",
right_ring = "Petrov Ring",
back = {
name = "Belenus's Cape",
-- augments = {'DEX+20', 'Accuracy+20 Attack+20', 'DEX+10', '"Dual Wield"+10', 'Phys. dmg. taken-10%'}
}
}
sets.Engaged.Turtle = {
head = "Nyame Helm",
body = "Nyame Mail",
hands = "Nyame Gauntlets",
legs = "Nyame Flanchard",
feet = "Nyame Sollerets",
neck = "Comm. Charm +2",
waist = "Sailfi Belt +1",
left_ear = "Telos Earring",
right_ear = "Cessance Earring",
left_ring = "Defending Ring",
right_ring = "Petrov Ring",
back = {
name = "Belenus's Cape",
-- augments = {'DEX+20', 'Accuracy+20 Attack+20', 'DEX+10', '"Dual Wield"+10', 'Phys. dmg. taken-10%'}
}
}
sets.JobAbility = {}
sets.WeaponSkill = {}
sets.WeaponSkill["Last Stand"] = {
head = "Nyame Helm",
body = "Nyame Mail",
hands = "Nyame Gauntlets",
legs = "Nyame Flanchard",
feet = "Nyame Sollerets",
neck = "Scout's Gorget +2",
waist = "Light Belt",
left_ear = "Telos Earring",
right_ear = "Moonshade Earring",
left_ring = "Dingir Ring",
right_ring = "Karieyh Ring",
back = {
name = "Belenus's Cape",
augments = {'AGI+20', 'Rng.Acc.+20 Rng.Atk.+20', 'AGI+10', 'Weapon skill damage +10%', 'Phys. dmg. taken-10%'}
}
}
sets.WeaponSkill["Detonator"] = sets.WeaponSkill["Last Stand"]
sets.WeaponSkill["Slug Shot"] = sets.WeaponSkill["Last Stand"]
sets.WeaponSkill["Sniper Shot"] = sets.WeaponSkill["Last Stand"]
sets.WeaponSkill["Split Shot"] = sets.WeaponSkill["Last Stand"]
sets.WeaponSkill["Numbing Shot"] = sets.WeaponSkill["Last Stand"]
sets.WeaponSkill["Wildfire"] = {
head = "Nyame Helm",
body = "Lanun Frac +3",
hands = "Nyame Gauntlets",
legs = "Nyame Flanchard",
feet = "Lanun Bottes +3",
neck = "Comm. Charm +2",
waist = "Orpheus's Sash",
left_ear = "Friomisi Earring",
-- right_ear = "Moonshade Earring",
left_ring = "Chirich Ring +1",
right_ring = "Karieyh Ring",
back = {
name = "Belenus's Cape",
augments = {
-- 'AGI+20',
-- 'Mag. Acc+20 /Mag. Dmg.+20',
-- 'AGI+10',
-- 'Weapon skill damage +10%'
}
}
}
sets.WeaponSkill["Aeolian Edge"] = {
ammo = "Living Bullet",
head = "Nyame Helm",
body = "Lanun Frac +3",
hands = "Nyame Gauntlets",
legs = "Nyame Flanchard",
feet = "Lanun Bottes +3",
neck = "Comm. Charm +2",
waist = "Orpheus's Sash",
left_ear = "Friomisi Earring",
right_ear = "Moonshade Earring",
left_ring = "Dingir Ring",
right_ring = "Karieyh Ring",
back = {
name = "Belenus's Cape",
-- augments = {'AGI+20', 'Mag. Acc+20 /Mag. Dmg.+20', 'AGI+10', 'Weapon skill damage +10%'}
}
}
sets.Precast = {}
sets.Precast['Ranged Attack'] = {
head = "Taeon Chapeau",
body = "Ikenga's Vest",
hands = "Carmine Fin. Ga. +1",
legs = "Adhemar Kecks +1",
feet = "Meg. Jam. +2",
neck = "Scout's Gorget +2",
waist = "Impulse Belt",
left_ear = "Telos Earring",
left_ring = "Dingir Ring",
back = {
name = "Belenus's Cape",
augments = {'"Snapshot"+10', 'Phys. dmg. taken-10%'}
}
}
sets.Midcast = {}
sets.Midcast['Ranged Attack'] = {}
sets.Midcast['Ranged Attack']['Normal'] = {
head = "Ikenga's Hat",
body = "Ikenga's Vest",
hands = "Ikenga's Gloves",
legs = "Ikenga's Trousers",
feet = "Ikenga's Clogs",
neck = "Comm. Charm +2",
left_ear = "Dedition Earring",
right_ear = "Telos Earring",
left_ring = "Chirich Ring +1",
right_ring = "Ilabrat Ring",
back = {
name = "Belenus's Cape",
augments = {'AGI+20', 'AGI+10'}
}
}
sets.Midcast['Ranged Attack']['Crit'] = {
head = "Mummu Bonnet +2",
body = "Mummu Jacket +2",
hands = "Mummu Wrists +2",
legs = "Mummu Kecks +2",
feet = "Oshosi Leggings",
neck = {
name = "Comm. Charm +2",
augments = {'Path: A'}
},
waist = "Kwahu Kachina Belt",
left_ear = "Telos Earring",
right_ear = "Cessance Earring",
left_ring = "Mummu Ring",
right_ring = "Chirich Ring +1",
back = {
name = "Belenus's Cape",
augments = {
'AGI+20', 'AGI+10'
}
}
}
sets.Midcast['Ranged Attack']['Triple Shot'] = {
head = "Oshosi Mask",
body = "Oshosi Vest",
hands = "Oshosi Gloves",
legs = "Oshosi Trousers",
feet = "Oshosi Leggings",
neck = "Comm. Charm +2",
waist = "Kwahu Kachina Belt",
left_ear = "Dedition Earring",
right_ear = "Telos Earring",
left_ring = "Mummu Ring",
right_ring = "Ilabrat Ring",
back = {
name = "Belenus's Cape",
augments = {'AGI+20', 'Mag. Acc+20 /Mag. Dmg.+20', 'AGI+10', 'Weapon skill damage +10%'}
}
}
end
function precast(spell, action)
if incapacitated() then
return
end
if (spell.english == "Spectral Jig" or spell.english == "Sneak") and buffactive.Sneak then
cast_delay(0.2)
send_command("cancel Sneak")
end
debug("Pre " .. spell.action_type)
if spell.action_type == 'Ranged Attack' then
equip(sets.Precast['Ranged Attack'])
return
end
if sets[spell.type] and sets[spell.type][spell.english] then
equip(sets[spell.type][spell.english])
return
end
if sets[spell.type] and sets[spell.type].equipable then
equip(sets[spell.type])
return
end
if is_magic(spell) then
equip(sets.FastCast)
return
end
debug("No set for " .. spell.type .. "." .. spell.english)
end
function midcast(spell, action)
if incapacitated() then
return
end
if spell.action_type == 'Ranged Attack' then
if sets.Midcast['Ranged Attack']['Triple Shot'] then
equip(sets.Midcast['Ranged Attack']['Triple Shot'])
return
end
equip(sets.Midcast['Ranged Attack'][rangedMode])
return
end
if not is_magic(spell) then
return
end
notice("Midcast - " .. spell.skill .. " - " .. spell.english)
if sets["Midcast"][spell.skill] and sets["Midcast"][spell.skill][spell.english] then
equip(sets["Midcast"][spell.skill][spell.english])
return
end
if sets["Midcast"][spell.skill] and sets["Midcast"][spell.skill].equipable then
equip(sets["Midcast"][spell.skill])
return
end
debug("No set for Midcast." .. spell.skill .. "." .. spell.english)
end
function aftercast(spell, action)
debug("Aftercast: " .. player.status)
status_change(player.status)
end
function status_change(new, old)
if incapacitated() then
debug("incapacitated")
return
end
if _G["status_change_" .. new:lower()] and not _G["status_change_" .. new:lower()]() then
return
end
if (sets[new]) then
equip(sets[new])
end
end
function buff_change(name, gain, buff_details)
if incapacitated_states:contains(name) then
status_change(player.status)
end
end
function incapacitated()
if incapacitated_states:find(function(value)
return buffactive[value] or false
end) then
equip(sets.Idle)
return true
end
end
function self_command(argsString)
print(T(player).status)
args = argsString:lower():split(" ")
if _G["self_command_" .. args[1]] then
_G["self_command_" .. args[1]](args:slice(2))
end
status_change(player.status)
end
function status_change_engaged()
equip(sets.Engaged[engagedMode])
end
function self_command_e(args)
return self_command_engaged(args)
end
function self_command_engaged(args)
if not args[1] then
error("Error: No Engaged Mode Specified")
return
end
local mode = args[1]:ucfirst()
if not sets.Engaged[mode] then
error("Error: Invalid Engaged Mode: " .. mode)
return
end
engagedMode = mode
notice("Engaged Mode Set: " .. mode)
end
function self_command_r(args)
self_command_ranged(args)
end
function self_command_ranged(args)
if not args[1] then
error("Error: No Ranged Mode Specified")
return
end
local mode = args[1]:ucfirst()
if not sets.Midcast['Ranged Attack'] then
error("Error: Invalid Ranged Mode: " .. mode)
return
end
rangedMode = mode
notice("Ranged Mode Set: " .. mode)
end
function is_magic(spell)
return spell.type:endswith("Magic") or spell.type == "BardSong" or spell.type == "Ninjutsu" or spell.type == "Trust"
end
function notice(s)
add_to_chat(121, s)
end
function error(s)
add_to_chat(4, s)
end
function debug(s)
if debugMode then
notice(s)
end
end