-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTristamgreen_DRK.lua
555 lines (478 loc) · 16.1 KB
/
Tristamgreen_DRK.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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
--[[ *************************************************************
TG's DRK lua - 2018
rebuilt 2020
************************************************************* --]]
require("common_gs_functions")
--[[ ******************************************************
Gearsets - define the various sets of gear we'll wear.
****************************************************** --]]
function get_sets()
-- idle set is worn when we're standing around doing
-- nothing. we want auto-refresh, auto-regen, movement speed, some evasion
sets.idle = {
ammo = "Fenrir's Stone",
neck = "Orochi Nodowa +1",
left_ear = "Novia Earring",
right_ear = "Ethereal Earring",
head = "Blood Mask",
body = "Valhalla Breastplate",
hands = "Darksteel Mittens +1",
left_ring = "Shadow Ring",
right_ring = "Patronus Ring",
back = "Boxer's Mantle",
waist = "Resolute Belt",
legs = "Blood Cuisses",
feet = "Askar Gambieras"
}
-- daylight idle set with lycopodium sash and feronia's bangles for super regen
sets.dayregen = {
waist = "Lycopodium Sash",
hands = "Feronia's Bangles"
}
sets.scythe = {
main = "Apocalypse"
}
sets.greatsword = {
main = "Ragnarok"
}
sets.rosestrap = {
sub = "Rose Strap"
}
sets.polegrip = {
sub = "Pole Grip"
}
-- we throw on our engaged set when we engage a mob
-- stacks a balance of haste and attack
sets.engaged = {}
sets.engaged.fivehit = {
ammo = "White Tathlum",
head = "Ace's Helm",
neck = "Chivalrous Chain",
body = "Aurum Cuirass",
hands = "Homam Manopolas",
back = "Abyss Cape",
legs = "Homam Cosciales",
waist = "Ninurta's Sash",
feet = "Homam Gambieras",
ring1 = "Blitz Ring",
ring2 = "Rajas Ring",
ear1 = "Brutal Earring",
ear2 = "Abyssal Earring"
}
sets.engaged.haste = {
ammo = "Fire Bomblet",
head = "Ace's Helm",
neck = "Justice Torque",
body = "Nocturnus Mail",
hands = "Homam Manopolas",
back = "Abyss Cape",
legs = "Homam Cosciales",
waist = "Ninurta's Sash",
feet = "Homam Gambieras",
ring1 = "Blitz Ring",
ring2 = "Rajas Ring",
ear1 = "Brutal Earring",
ear2 = "Ethereal Earring"
}
sets.evasion = {
ammo = "Fenrir's Stone",
head = "Optical Hat",
neck = "Evasion Torque",
body = "Scorpion Harness +1",
hands = "Homam Manopolas",
back = "Boxer's Mantle",
legs = "Chaos Flanchard +1",
feet = "Askar Gambieras",
ring1 = "Wivre Ring +1",
ring2 = "Wivre Ring +1",
ear1 = "Triton Earring",
ear2 = "Triton Earring"
}
-- if its latent is procced, we'd rather wear the
-- parade gorget than the others
sets.parade = {
neck = "Parade Gorget"
}
-- our resting set is for hMP.
sets.rest = {
neck = "Gnole Torque",
left_ear = "Relaxing Earring",
right_ear = "Antivenom Earring",
hands = "Genie Gages",
left_ring = "Celestial Ring",
right_ring = "Celestial Ring",
waist = "Qiqirn Sash +1",
feet = "Askar Gambieras",
back = "Shadow Mantle"
}
-- stacking strength for Guillotine
sets.guillotine = {
ammo = "Fire Bomblet",
head = "Nocturnus Helm",
neck = "Fotia Gorget",
left_ear = "Brutal Earring",
right_ear = "Harmonius Earring",
body = "Armada Hauberk",
hands = "Hct. Mittens +1",
left_ring = "Mars's Ring",
right_ring = "Rajas Ring",
back = "Abyss Cape",
waist = "Warwolf Belt",
legs = "Aurum Cuisses",
feet = "Hct. Leggings +1"
}
-- stacking more str for other WSs (Cata, Insurgency)
sets.str = {
ammo = "Bomb Core",
head = "Nocturnus Helm",
neck = "Fotia Gorget",
left_ear = "Brutal Earring",
right_ear = "Harmonius Earring",
body = "Armada Hauberk",
hands = "Hct. Mittens +1",
left_ring = "Mars's Ring",
right_ring = "Rajas Ring",
back = "Cerberus Mantle +1",
waist = "Warwolf Belt",
legs = "Onyx Cuisses",
feet = "Hct. Leggings +1"
}
-- weapon bash set
sets.bash = {
hands = "Chaos Gauntlets +1",
}
-- stun set prioritizes haste over dark magic skill
sets.stun={
ammo = "Phantom Tathlum",
head = "Walahra Turban",
body = "Corselet +1",
hands = "Blood Fng. Gnt.",
legs = "Abs. Flanchard +1",
feet = "Homam Gambieras",
neck = "Dark Torque",
waist = "Ninurta's Sash",
left_ear = "Abyssal Earring",
right_ear = "Dark Earring",
left_ring = "Blitz Ring",
right_ring = "Omn. Ring +1",
back = "Abyss Cape",
}
-- dark magic set maximizes dark magic skill and MAB for Bio
sets.dark={
ammo = "Phantom Tathlum",
head = "Chaos Burgeonet +1",
body = "Corselet +1",
hands = "Blood Fng. Gnt.",
legs = "Abyss Flanchard +1",
feet = "Shrewd Pumps",
neck = "Dark Torque",
waist = "Crimson Belt",
left_ear = "Dark Earring",
right_ear = "Abyssal Earring",
left_ring = "Galdr Ring",
right_ring = "Omega Ring",
back = "Merciful Cape"
}
-- drain and aspir set maximize dark magic skill with a little haste thrown in
sets.drain={
ammo = "Fire Bomblet",
head = "Chaos Burgeonet +1",
body = "Dmn. Harness +1",
hands = "Blood Fng. Gnt.",
legs = "Abs. Flanchard +1",
feet = "Homam Gambieras",
neck = "Dark Torque",
waist = "Crimson Belt",
left_ear = "Abyssal Earring",
right_ear = "Dark Earring",
left_ring = "Galdr Ring",
right_ring = "Omega Ring",
back = "Merciful Cape",
}
-- absorb set maximizes duration for absorb-style spells by maxing dark skill and using
-- onyx set + vicious mufflers
sets.absorb={
head = "Onyx Sallet",
body = "Plastron +1",
hands = "Vicious Mufflers",
legs = "Onyx Cuisses",
feet = "Onyx Sollerets",
neck = "Dark Torque",
waist = "Ninurta's Sash",
left_ear = "Abyssal Earring",
right_ear = "Dark Earring",
left_ring = "Galdr Ring",
right_ring = "Omega Ring",
back = "Abyss Cape",
}
-- equip Chaos Burgeonet for Souleater maximizing
sets.souleater = {
head = "Chaos Burgeonet +1",
}
-- equip Abyss Sollerets +1 for Last Resort
sets.lastresort = {
feet = "Abs. Sollerets +1",
}
-- for utsusemi, maximize haste.
sets.utsu = {
neck = "",
left_ear = "Ninjutsu Earring",
back = "Astute Cape",
}
sets.fc = {
head = "Walahra Turban",
right_ear = "Loquac. Earring",
feet = "Homam Gambieras",
hands = "Dusk Gloves +1",
left_ring = "Blitz Ring"
}
end
--[[ ******************************************************
Equip functions - put on the sets we defined above, and
echo a note to our chat log so we know it worked.
****************************************************** --]]
-- pick between our idle set and engaged set, depending on
-- whether we're currently engaged with a mob.
function choose_set()
if player.status == "Engaged" then
equip_engaged()
else
equip_idle()
end
if fivehit == true then
windower.add_to_chat(8,'[Five-Hit DRK: ON]')
equip(sets.rosestrap)
else
equip(sets.polegrip)
end
end
-- equip our idle set for standing around
function equip_idle()
common_idle_equip()
if weapontype == "scythe" then
equip({main="Apocalypse"})
elseif weapontype == "greatsword" then
equip({main="Ragnarok"})
end
if player.hpp >= 85 and player.mpp <= 99 then
windower.add_to_chat(8,"[Parade Gorget - MP at " .. player.mpp .. "%]")
equip(sets.parade)
end
end
-- equip our engaged set. If the parade gorget latent is
-- procced and we need mp, throw that on as well.
function equip_engaged()
windower.add_to_chat(8,'[Engaged]')
if fivehit == true then
equip(sets.engaged.fivehit)
else
equip(sets.engaged.haste)
if weapontype == "scythe" then
equip({neck="Justice Torque"})
elseif weapontype == "greatsword" then
equip({neck="Prudence Torque"})
end
end
if world.time <= 1080 and world.time >= 360 then
windower.add_to_chat(8,"[Engaged - Daylight Bonus]")
equip({right_ear="Fenrir's Earring"})
end
end
-- equip our WS set
function equip_ws(spell)
windower.add_to_chat(8,'[Weapon Skill]')
if spell.name == 'Guillotine' then
equip(sets.guillotine)
else
equip(sets.str)
end
end
-- Dark Spell equip macros.
function equip_dark(spell)
equip(sets.dark)
if spell.english:contains 'Absorb' then
equip(sets.absorb)
end
if spell.element == world.day_element then
equip({waist="Hachirin-no-Obi"})
if spell.element == world.weather_element then
equip({right_ring="Diabolos's Ring"})
add_to_chat(8,'[Matching Day + Weather]')
else
add_to_chat(8,'[Matching Day]')
end
elseif spell.element == world.weather_element then
add_to_chat(8,'[Matching Weather]')
equip({waist="Hachirin-no-Obi",right_ring="Diabolos's Ring"})
end
if spell.english:contains('Bio') then
if player.mp - spell.mp_cost < 0.51*player.max_mp then
windower.add_to_chat(8,'[Uggalepih Pendant boost]')
equip({neck="Uggalepih Pendant"})
end
end
if spell.english:contains 'Drain' or spell.english:contains 'Aspir' then
equip(sets.drain)
if player.status ~= "Engaged" and player.tp == 0 then
if spell.element == world.weather_element then
windower.add_to_chat(8,"[Diabolos's Pole enhanced effect]")
equip({main="Diabolos's Pole"})
end
end
end
end
-- equip our hMP set
function equip_rest()
windower.add_to_chat(8,'[Resting]')
equip(sets.rest)
end
--[[ ******************************************************
Casting functions - these functions run automatically when
we cast a spell, use a job ability, rest for MP, and so on
****************************************************** --]]
-- the precast function runs automatically BEFORE we
-- begin casting a spell or job ability.
function precast(spell)
if spell.type == 'WeaponSkill' then
equip_ws(spell)
elseif spell.name == 'Weapon Bash' then
windower.add_to_chat(8,'[Weapon Bash]')
equip(sets.engaged,sets.bash)
if player.hpp <= 75 and player.tp <= 1000 then
equip({ring2="Slayer's Ring"})
end
elseif spell.name == 'Souleater' then
equip(sets.engaged,sets.souleater)
elseif spell.name == 'Last Resort' then
equip(sets.engaged,sets.lastresort)
elseif spell.action_type == 'Magic' then
local spell_recasts = windower.ffxi.get_spell_recasts()
if spell_recasts[spell.recast_id] > 60 then -- 1s margin
add_to_chat(167,spell.english .. ' is still on cooldown!')
cancel_spell()
else
equip(sets.fc)
end
end
if player.tp == 0 then
equip({sub="Vivid Strap +1"})
end
end
-- most of our abilities are either insta-cast or require
-- gearswaps at the start, so we don't do much mid-cast.
function midcast(spell)
if spell.name == 'Utsusemi: Ni' or spell.name == 'Utsusemi: Ichi' then
windower.add_to_chat(8,'[Utsusemi]')
equip(sets.fc)
elseif spell.skill == 'Dark Magic' then
windower.add_to_chat(8,'[Dark Magic]')
equip_dark(spell)
end
if player.tp == 0 then
equip({sub="Vivid Strap +1"})
end
end
-- when we're done with our spell or ability, return to either
-- our idle or engaged gear.
function aftercast(spell)
choose_set()
end
-- swap into hMP gear when we /heal, and return to idle gear
-- when we stand up.
function status_change(new,old)
if new == 'Resting' then
equip_rest()
else
choose_set()
end
end
function buff_change(name,gain)
debuff_item()
end
-- a set of self commands that dictate various job functions
-- self commands are called via macro, through the syntax /console gs c (command name)
-- eg., /console gs c W+ cycles through weaponskills to call on for our generic WS macro
function self_command(m)
-- W+ cycles weapon skill names. If using a Scythe, it will cycle Guillotine and Catastrophe.
-- If using a Great Sword it cycles Scourge and Ground Strike.
if m == "W+" then
if weapontype == "scythe" then
if ws == "Guillotine" then
ws = "Catastrophe"
else ws = "Guillotine"
end
else
if ws == "Ground Strike" then
ws = "Scourge"
else ws = "Ground Strike"
end
end
windower.add_to_chat(222,'[Current WS: ' .. ws .. ']')
-- initiates the weaponskill defined above.
elseif m == "WS" then
send_command('input /ws "' .. ws .. '" <t>')
-- selects weapon being used and changes equipment accordingly.
-- Available types are Scythe and Great Sword.
elseif m == "weapontype" then
if weapontype == "gsword" then
weapontype = "scythe"
ws = 'Catastrophe'
windower.add_to_chat(8,'[Weapon: Scythe]')
windower.add_to_chat(222,'[Current WS: ' .. ws .. ']')
equip(sets.scythe)
--send_command('input /lockstyle off;wait 10;input /lockstyleset 8')
choose_set()
else
weapontype = "gsword"
ws = 'Scourge'
windower.add_to_chat(8,'[Weapon Type: Great Sword]')
windower.add_to_chat(222,'[Current WS: ' .. ws .. ']')
equip(sets.greatsword)
--send_command('input /lockstyle off;wait 10;input /lockstyleset 8')
choose_set()
end
-- Dictates whether or not we want full evasion gear during combat.
elseif m == "EVA" then
if ev == false then
ev = true
windower.add_to_chat(8,'[Evasion while engaged: ON]')
choose_set()
else
ev = false
windower.add_to_chat(8,'[Evasion while engaged: OFF]')
choose_set()
end
elseif m == "fivehit" then
if fivehit == false then
enable('sub')
fivehit = true
choose_set()
disable('sub')
else
fivehit = false
enable('sub')
windower.add_to_chat(8,'[Five-Hit DRK: OFF]')
choose_set()
disable('sub')
end
end
end
--[[ ******************************************************
Code that runs once, when we first swap to Dark Knight
****************************************************** --]]
-- weapontype variable determines which weapon we fight with and is defaulted to scythe.
-- (note: only scythe and great sword are compensated for here, axes and kclubs are not)
weapontype = "scythe"
-- ev determines whether we should wear our evasion gear in combat
ev = false
-- ws determines which weapon skill we'll use. Catastrophe by default.
ws = "Catastrophe"
-- fivehit mode is defaulted off
fivehit = false
-- Runs the job setup function to populate list of spells
setup_job()
-- Puts on our fashion set, lockstyle it, then switch
-- to our idle set.
send_command('gs enable all;wait 1;gs equip idle; wait 1; input /lockstyleset 8; wait 1; gs equip scythe;wait 1;gs equip polegrip')
-- Set current macro book to book 8 and set 1
send_command('input /macro book 8; wait 0.1; input /macro set 1')