-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAndromida_DNC_DT.lua
397 lines (334 loc) · 9.59 KB
/
Andromida_DNC_DT.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
386
387
388
389
390
391
392
393
394
395
396
397
local incapacitated_states = T {"stun", "petrification", "terror", "sleep", "weakness"}
-- waltz set changes:
-- augment Odnowa
-- switch vocane for carbuncle
-- step set
-- use 2nd moonlight ring
function get_sets()
sets.Idle = {
ammo = "Staunch Tathlum +1",
head = "Turms Cap +1",
body = "Gleti's Cuirass",
hands = "Gleti's Gauntlets",
legs = "Gleti's Breeches",
feet = "Turms Leggings +1",
neck = "Warder's Charm +1",
waist = "Engraved Belt",
left_ear = "Hearty Earring",
right_ear = "Infused Earring",
left_ring = "Chirich Ring +1",
right_ring = "Chirich Ring +1",
back = {
name = "Senuna's Mantle",
augments = {'Phys. dmg. taken-10%'}
}
}
sets.Engaged = {
ammo = "Coiste Bodhar",
head = "Nyame Helm",
body = "Gleti's Cuirass",
hands = "Malignance Gloves",
legs = "Gleti's Breeches",
feet = "Nyame Sollerets",
neck = "Unmoving Collar +1",
waist = "Sailfi Belt +1",
left_ear = "Odnowa Earring +1",
right_ear = "Sherida Earring",
left_ring = "Chirich Ring +1",
right_ring = "Moonlight Ring",
back = {
name = "Senuna's Mantle",
augments = {'STR+20', 'Accuracy+20 Attack+20', 'STR+10', '"Dbl.Atk."+10', 'Phys. dmg. taken-10%'}
}
}
sets.Buff = {}
sets.Buff["Fan Dance"] = {
head = "Nyame Helm",
body = "Nyame Mail",
hands = "Nyame Gauntlets",
legs = "Nyame Flanchard",
feet = "Nyame Sollerets",
}
-- JA Sets --
sets.JobAbility = {}
sets.JobAbility["Saber Dance"] = {
legs = "Horos Tights +3"
}
sets.JobAbility["Fan Dance"] = {
hands = "Horos Bangles +1"
}
sets.JobAbility["No Foot Rise"] = {
body = "Horos Casaque +3"
}
sets.Jig = {
legs = "Horos Tights +3",
feet = "Maxixi Toe shoes +2"
}
sets.Flourish = {}
sets.Flourish["Violent Flourish"] = {
body = "Horos Casaque +3"
}
sets.Flourish2 = {}
sets.Flourish2["Reverse Flourish"] = {
hands = "Macu. Bangles +3",
back = {
name = "Toetapper Mantle",
augments = {'"Store TP"+2', '"Rev. Flourish"+29', "Weapon skill damage +1%"}
}
}
sets.Flourish3 = {}
sets.Waltz = {
ammo = "Staunch Tathlum +1",
head = "Nyame Helm",
body = "Maxixi Casaque +3",
hands = "Nyame Gauntlets",
legs = "Dashing Subligar",
feet = "Nyame Sollerets",
neck = "Etoile Gorget +2",
waist = "Flume Belt",
left_ear = "Tuisto Earring",
right_ear = "Odnowa Earring +1",
left_ring = "Vocane Ring +1",
right_ring = "Moonlight Ring",
back = {
name = "Senuna's Mantle",
augments = {'DEX+20', 'Accuracy+20 Attack+20', 'DEX+10', '"Store TP"+10', 'Phys. dmg. taken-10%'}
}
}
sets.Samba = {
head = "Maculele Tiara +3",
body = "Macu. Casaque +3",
hands = "Macu. Bangles +3",
legs = "Maculele Tights +3",
feet = "Macu. Toe sh. +3"
}
sets.Step = {
ammo = "Yamarang",
head = "Maxixi Tiara +2",
body = "Nyame Mail",
hands = "Maxixi Bangles +3",
legs = "Nyame Flanchard",
feet = "Horos T. Shoes +3",
neck = "Etoile Gorget +2",
waist = "Eschan Stone",
left_ear = "Tuisto Earring",
right_ear = "Odnowa Earring +1",
left_ring = "Vocane Ring +1",
right_ring = "Moonlight Ring",
back = {
name = "Senuna's Mantle",
augments = {'DEX+20', 'Accuracy+20 Attack+20', 'DEX+10', '"Store TP"+10', 'Phys. dmg. taken-10%'}
}
}
sets.Step['Feather Step'] = set_combine(sets.Step, {
feet = "Maculele toe shoes +3"
})
-- WS Sets --
sets.WeaponSkill = {
ammo = "Oshasha's Treatise",
head = "Maculele Tiara +3",
body = "Nyame Mail",
hands = "Nyame Gauntlets",
legs = "Nyame Flanchard",
feet = "Nyame Sollerets",
neck = "Etoile Gorget +2",
waist = "Sailfi Belt +1",
left_ear = "Moonshade Earring",
right_ear = "Odr Earring",
left_ring = "Regal Ring",
right_ring = "Epaminondas's Ring",
back={
name="Senuna's Mantle",
augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Weapon skill damage +10%',}
},
}
sets.WeaponSkill["Climactic Rudra's Storm"] = set_combine(sets.WeaponSkill, {
ammo = "Charis Feather",
head = "Maculele Tiara +3",
})
end
function precast(spell)
if is_magic(spell) then
equip(sets.FastCast)
return
end
if spell.english == "Spectral Jig" and buffactive.Sneak then
cast_delay(0.2)
send_command("cancel Sneak")
end
if spell.english:startswith("Curing Waltz") and not refine_waltz(spell) then
return
end
if spell.english == "Rudra's Storm" and buffactive["Climactic Flourish"] then
equip(sets.WeaponSkill["Climactic Rudra's Storm"])
debug("WeaponSkill Climactic Rudra's Storm")
return
end
if sets[spell.type] and sets[spell.type][spell.english] then
equip(sets[spell.type][spell.english])
debug(spell.type .. " " .. spell.english)
return
end
if ignore_spell_type(spell) and sets[spell.type] then
equip(sets[spell.type])
debug(spell.type)
return
end
debug("No set for " .. spell.type .. "." .. spell.english)
end
function ignore_spell_type(spell)
return spell.type ~= "JobAbility" and not spell.type:startswith("Flourish")
end
function aftercast(spell, action)
debug("Aftercast")
status_change(player.status)
end
function status_change(new, old)
if incapacitated() then
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 incapacitated()
if incapacitated_states:find(function(value)
return buffactive[value] or false
end) then
equip(sets.Idle)
return true
end
end
function buff_change(name, gain, buff_details)
if not gain and name == 'Scherzo' then send_command('@input /party ' .. name .. ' removed') end
if incapacitated_states:contains(name) then
status_change(player.status)
end
debug(name .. " " .. (gain and "on" or "off"))
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 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
sets.Engaged.mode = mode
status_change(player.status)
notice("Engaged Mode Set: " .. mode)
end
function find_player_in_alliance(name)
for party_index, ally_party in ipairs(alliance) do
for player_index, _player in ipairs(ally_party) do
if _player.name == name then
return _player
end
end
end
end
function get_target_missing_hp(target)
if target.type == "SELF" then
return player.max_hp - player.hp
end
if not target.isallymember then
return
end
local target = find_player_in_alliance(target.name)
return math.floor((target.hp / (target.hpp / 100)) - target.hp)
end
function get_dnc_level()
if player.sub_job == "DNC" then
return player.sub_job_level
end
return player.main_job_level
end
function refine_waltz(spell)
if player.tp < 200 then
add_to_chat(122, "No TP!")
cancel_spell()
return
end
local dncLevel = get_dnc_level()
local spellRecasts = windower.ffxi.get_spell_recasts()
local missingHP = get_target_missing_hp(spell.target)
if not missingHP then
return true
end
local waltzes = table.filter({{
id = 190,
name = "Curing Waltz",
level = 15,
tp = 200,
hp = 300
}, {
id = 191,
name = "Curing Waltz II",
level = 30,
tp = 350,
hp = 600
}, {
id = 192,
name = "Curing Waltz III",
level = 45,
tp = 500,
hp = 1000
}, {
id = 193,
name = "Curing Waltz IV",
level = 70,
tp = 650,
hp = 1500
}, {
id = 194,
name = "Curing Waltz V",
level = 87,
tp = 800,
hp = 2000
}}, function(waltz)
return waltz.level <= dncLevel and waltz.tp <= player.tp and spellRecasts[waltz.id] < 1
end)
local newWaltz = "Curing Waltz"
for _, waltz in ipairs(waltzes) do
if waltz.hp > missingHP then
break
end
newWaltz = waltz.name
end
if newWaltz ~= spell.english then
send_command('@input /ja "' .. newWaltz .. '" ' .. tostring(spell.target.raw))
cancel_spell()
return
end
return true
end
function is_magic(spell)
return spell.action_type == "Magic"
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