-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTristamgreen_DNC.lua
430 lines (386 loc) · 13.9 KB
/
Tristamgreen_DNC.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
--[[ *************************************************************
Tristamgreen's DNC lua for Supernova FFXI
Save as windower/addons/GearSwap/data/%username%_THF.lua
2020-06-22 - first version
2020-06-23 - revision 1.01, added modes and weaponskill change modes
2020-06-24 - revision 1.02, added precast setup for all DNC JA's
2020-06-24 - revision 1.03, added specific engaged handler for DRG Subjob and Wyvern Earring
************************************************************* --]]
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 movement speed and evasion.
sets.idle = {
ammo = "Fenrir's Stone",
head = "Gnole Crown",
neck = "Orochi Nodowa +1",
left_ear = "Triton Earring",
right_ear = "Novia Earring",
body = "Scorpion Harness +1",
hands = "Denali Wristbands",
left_ring = "Patronus Ring",
right_ring = "Shadow Ring",
back = "Boxer's Mantle",
waist = "Scouter's Rope",
legs = "Denali Kecks",
feet = "Dancer's Toe Shoes"
}
sets.dayregen = {
hands = "Feronia's Bangles",
waist = "Lycopodium Sash"
}
sets.weapons = {
main = "Mandau",
sub = "Papilio Kirpan"
}
-- Haste Samba set
sets.haste={
ammo = "Black Tathlum",
head = "Denali Bonnet",
body = "Rapparee Harness",
hands = "Dusk Gloves +1",
legs = "Etoile Tights +1",
feet = "Dusk Ledelsens +1",
neck = "Love Torque",
waist = "Ninurta's Sash",
left_ear = "Brutal Earring",
right_ear = "Pixie Earring",
left_ring = "Mars's Ring",
right_ring = "Rajas Ring",
back = "Etoile Cape"
}
-- Drain Samba set
sets.drainsamba={
ammo = "White Tathlum",
head = "Dancer's Tiara",
body = "Cobra Unit Harness",
hands = "Dusk Gloves +1",
legs = "Cobra Unit Subligar",
feet = "Dusk Ledelsens +1",
neck = "Chivalrous Chain",
waist = "Ninurta's Sash",
-- left_ear = "Wyvern Earring",
right_ear = "Pixie Earring",
left_ring = "Mars's Ring",
right_ring = "Rajas Ring",
back = "Amemet Mantle +1"
}
sets.eva = {
head = "Gnole Crown",
neck = "Evasion Torque",
left_ear = "Triton Earring",
right_ear = "Novia Earring",
body = "Scorpion Harness +1",
hands = "Denali Wristbands",
left_ring = "Wivre Ring +1",
right_ring = "Wivre Ring +1",
back = "Boxer's Mantle",
waist = "Scouter's Rope",
legs = "Denali Kecks",
feet = "Dancer's Toe Shoes"
}
-- wsdex set is for dex-based weapon skills.
sets.wsdex = {
ammo = "Black Tathlum",
head = "Maat's Cap",
neck = "Fotia Gorget",
left_ear = "Brutal Earring",
right_ear = "Pixie Earring",
body = "Antares Harness",
hands = "Enkidu's Mittens",
left_ring = "Rajas Ring",
right_ring = "Adroit Ring +1",
back = "Warwolf Mantle",
waist = "Cuchulain's Belt",
legs = "Enkidu's Subligar",
feet = "Setanta's Ledelsens"
}
sets.evis = { -- 511 ws acc / 430 atk
ammo = "Black Tathlum",
head = "Maat's Cap",
body = "Antares Harness",
hands = "Enkidu's Mittens",
legs = "Enkidu's Subligar",
feet = "Etoile Shoes +1",
neck = "Fotia Gorget",
waist = "Cuchulain's Belt",
left_ear = "Brutal Earring",
right_ear = "Pixie Earring",
left_ring = "Rajas Ring",
right_ring = "Adroit Ring +1",
back = "Cuchulain's Mantle",
}
sets.de = { -- 487 weaponskill acc
ammo = "Black Tathlum",
head = "Maat's Cap",
body = "Enkidu's Harness",
hands = "Enkidu's Mittens",
legs = "Enkidu's Subligar",
feet = "Denali Gamashes",
neck = "Fotia Gorget",
waist = "Cuchulain's Belt",
left_ear = "Brutal Earring",
right_ear = "Harmonius Earring",
left_ring = "Rajas Ring",
right_ring = "Mars's Ring",
back = "Cerb. Mantle +1",
}
-- mercy set stacks lots of STR for mercy stroke.
sets.mercy = { --472 ws acc
ammo = "Black Tathlum",
head = "Maat's Cap",
body = "Enkidu's Harness",
hands = "Alkyoneus's Brc.",
legs = "Enkidu's Subligar",
feet = "Denali Gamashes",
neck = "Fotia Gorget",
waist = "Warwolf Belt",
left_ear = "Brutal Earring",
right_ear = "Harmonius Earring",
left_ring = "Rajas Ring",
right_ring = "Mars's Ring",
back = "Cerberus Mantle +1",
}
-- fast cast for ninjutsu
sets.fc = {
left_ear = "Loquac. Earring",
--legs = "Homam Cosciales"
hands = "Dusk Gloves +1",
feet = "Dusk Ledelsens +1",
}
-- utsusemi haste
sets.utsu = {
head = "Walahra Turban",
neck = "Tiercel Necklace",
left_ear = "Triton Earring",
right_ear = "Novia Earring",
body = "Rapparee Harness",
hands = "Dusk Gloves +1",
left_ring = "Wivre Ring +1",
right_ring = "Wivre Ring +1",
back = "Shadow Mantle",
waist = "Ninurta's Sash",
legs = "Etoile Tights +1",
feet = "Dusk Ledelsens +1"
}
--***DANCER-SPECIFIC SETS***
sets.samba = {
head = "Dancer's Tiara"
}
sets.jig = {
legs = "Etoile Tights +1",
feet = "Dancer's Toe Shoes"
}
sets.waltz = { -- stack chr+vit for maximum healage
head = "Etoile Tiara +1",
body = "Dancer's Casaque",
legs = "Etoile Tights +1",
feet = "Dance Shoes +1",
ring1 = "Corneus Ring",
left_ear = "Roundel Earring",
right_ear = "Robust Earring",
back = "Etoile Cape",
waist = "Warwolf Belt"
}
sets.violent_flourish = {
body = "Etoile Casaque +1"
}
sets.step = {
hands = "Dnc. Bangles +1",
feet = "Etoile Shoes +1"
}
end
--[[ ******************************************************
Equip functions - put on the sets we defined above, and
echo a note to our chat log so we know it worked.
****************************************************** --]]
-- equip our idle set
function equip_idle()
common_idle_equip()
end
-- equip our engaged set
function equip_engaged()
windower.add_to_chat(8,'[Engaged]')
if ev == true then
equip(sets.haste,sets.eva)
if world.time >= 1080 and world.time <= 360 then
windower.add_to_chat(8,"[Engaged - Night Evasion Bonus]")
equip(sets.haste,sets.eva,{ammo="Fenrir's Stone"})
end
else
equip(sets.haste)
end
if player.sub_job == "DRG" then
windower.add_to_chat(8,"[Dragoon Subjob - Wyvern Earring]")
equip({right_ear="Wyvern Earring"})
end
end
-- equip either our mercy stroke or dex set
function equip_ws(spell)
windower.add_to_chat(8,'[Weapon Skill: ' .. spell.name .. ']')
if spell.name == 'Mercy Stroke' then
equip(sets.mercy)
elseif spell.name == 'Dancing Edge' then
equip(sets.de)
elseif spell.name == 'Evisceration' then
equip(sets.evis)
else
equip(sets.wsdex)
end
if world.time <= 1080 and world.time >= 360 then
windower.add_to_chat(8,"[Engaged - Daylight Bonus]")
equip({left_ear="Fenrir's Earring"})
end
end
-- the choose_set function figures out whether we're engaged with a
-- mob or not, and passes control to the relevant function above.
function choose_set()
if player.status == "Engaged" then
windower.add_to_chat(8,'[Engaged]')
equip_engaged()
if world.time <= 1080 and world.time >= 360 then
windower.add_to_chat(8,"[Daylight Bonus]")
equip({left_ear="Fenrir's Earring"})
end
else
equip_idle()
end
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. For our THF,
-- we want to equip ws gear for weapon skills, and flee
-- duration gear when fleeing.
function precast(spell, spellMap, action)
if spell.type == 'Ninjutsu' then
equip(sets.fc)
elseif spell.type == 'WeaponSkill' then
equip_ws(spell)
elseif spell.type:contains('Waltz') then
equip(sets.waltz)
if buffactive['Saber Dance'] then
send_command('cancel "Saber Dance"')
windower.add_to_chat(8,'[Saber Dance cancelled for Waltz]')
end
elseif spell.type:contains('Step') then
equip(sets.step)
elseif spell.type:contains('Jig')then
equip(sets.jig)
if spell.name == 'Spectral Jig' then
send_command('cancel sneak')
end
elseif spell.type:contains('Samba') then
equip(sets.samba)
if buffactive['Fan Dance'] then
send_command('cancel "Fan Dance"')
windower.add_to_chat(8,'[Fan Dance cancelled for Samba]')
end
elseif spell.name == 'Violent Flourish' then
equip(sets.violent_flourish)
end
end
-- equip haste gear for ninjutsu
function midcast(spell)
if spell.type == 'Ninjutsu' then
equip(sets.utsu)
end
if player.sub_job == "DRG" then
windower.add_to_chat(8,"[Dragoon Subjob - Wyvern Earring]")
equip({right_ear="Wyvern Earring"})
end
end
-- after we JA or WS, we want to return either to our
-- engaged gear or our idle gear. The choose_set function
-- handles that for us.
function aftercast(spell)
choose_set()
end
-- status_change also calls the choose_set function, which
-- handles engaging and disengaging from combat.
function status_change(new,old)
choose_set()
end
function buff_change(name,gain)
debuff_items()
end
function self_command(m)
-- mode selectors are run by the macro command /console gs c [modename]
-- modes included here are:
-- W+ - cycles selected weaponskill between Vorpal Blade and Knights of Round; extensible for others.
-- WS - executes currently selected WS defined in W+
-- EVA - equips Evasion Gearsets
-- step+ - change Step selection
-- samba+ - change Samba selection
-- step - use selected Step
-- S - use selected Samba
if m == "W+" then
if ws == "Mercy Stroke" then
ws = "Dancing Edge"
elseif ws == "Dancing Edge" then
ws = "Evisceration"
elseif ws == "Evisceration" then
ws = "Mercy Stroke"
end
windower.add_to_chat(222,'[Current WS: ' .. ws .. ']')
elseif m == "WS" then
send_command('input /ws "' .. ws .. '" <t>')
elseif m == "samba+" then
if sambatype == "Drain Samba III" then
sambatype = "Aspir Samba II"
elseif sambatype == "Aspir Samba II" then
sambatype = "Haste Samba"
else
sambatype = "Drain Samba III"
end
windower.add_to_chat(8,'[Current Samba: ' .. sambatype .. ']')
elseif m == "step+" then
if steptype == "Quickstep" then
steptype = "Box Step"
windower.add_to_chat(8,'[Current Step: ' .. steptype .. '] - Defense Down')
elseif steptype == "Box Step" then
steptype = "Stutter Step"
windower.add_to_chat(8,'[Current Step: ' .. steptype .. '] - Magical Evasion Down')
else
steptype = "Quickstep"
windower.add_to_chat(8,'[Current Step: ' .. steptype .. '] - Evasion Down')
end
elseif m == "S" then
send_command('input /ja "' .. sambatype .. '" <me>')
elseif m == "step" then
send_command('input /ja "' .. steptype .. '" <t>')
elseif m == "EVA" then
if ev == false then
ev = true
windower.add_to_chat(8,'[Evasion: ON]')
choose_set()
else
ev = false
windower.add_to_chat(8,'[Evasion: OFF]')
choose_set()
end
end
end
--[[ ******************************************************
Code that runs once, when we first swap to our THF job
****************************************************** --]]
-- ev determines whether we should wear our evasion gear in combat
ev = false
-- ws determines which weapon skill we'll use. Mercy Stroke by default.
ws = "Mercy Stroke"
-- sambatype determines what our default samba type is on start
sambatype = "Drain Samba III"
-- steptype determines what our default step type is on start
steptype = "Quickstep"
-- Finally, puts on our fashion set, lockstyle it, then switch to our idle set.
send_command('wait 1; input /lockstyleset 19; wait 1; gs equip idle; wait 1; gs equip weapons')
send_command('input /macro book 19; wait 0.1; input /macro set 1')
windower.add_to_chat(8,'[Evasion: OFF]')
windower.add_to_chat(8,'[Samba Selection: ' .. sambatype .. ']')
windower.add_to_chat(8,'[Step Selection: ' .. steptype .. ']')
send_command('input //dp ja')