-
Notifications
You must be signed in to change notification settings - Fork 0
/
PUP.lua
713 lines (658 loc) · 24.5 KB
/
PUP.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
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
--require('common');
--require('common\pupui');
local puplib = gFunc.LoadFile('puplib.lua');
local profile = {};
local sets = {
['tp_lowacc'] = {
Range = '',
Head = 'Walahra turban',-- Haste+5%
Neck = 'Chivalrous Chain',
Ear1 = 'Brutal Earring',-- ACC+2
Ear2 = 'Bushinomimi',
Body = 'Pup. Tobe +1',
Hands = 'Enkidu\'s Mittens',-- Acc+5 STR/DEX+4 SB+2
Ring1 = 'Rajas Ring',
Ring2 = 'Mars\'s Ring',
Back = 'Aesir Mantle',
Waist = 'Ninurta\'s Sash',
Legs = 'Enkidu\'s Subligar',-- STR/DEX+4 STP+5 SB+5
Feet = 'Promptitude Solea',
},
['tp_medacc'] = {
Range = '',
Head = 'Shinku Hatsuburi',-- STR+3 ACC+3 ATK+5
Neck = 'Chivalrous Chain',
Ear1 = 'Megasco Earring',-- ACC+2
Ear2 = 'Brutal Earring',
Body = 'Pln. Khazagand',
Hands = 'Enkidu\'s Mitten',-- Acc+5 Atk+5
Ring1 = 'Rajas Ring',
Ring2 = 'Mars\'s Ring',
Back = 'Aesir Mantle',
Waist = 'Potent Belt',
Legs = 'Pantin Churidars',-- ACC+5 STR+2
Feet = 'Promptitude Solea',
},
['tp_highacc'] = {
Range = '',
Head = 'Optical Hat',
Neck = 'Peacock Amulet',
Ear1 = 'Megasco Earring',-- ACC+2
Ear2 = 'Bushinomimi',
Body = 'Pln. Khazagand',
Hands = 'Enkidu\'s Mitten',-- Acc+5 Atk+5
Ring1 = 'Oneiros Annulet',
Ring2 = 'Mars\'s Ring',
Back = 'Aesir Mantle',
Waist = 'Virtuoso Belt',
Legs = 'Pantin Churidars',-- ACC+5 STR+2
Feet = 'Promptitude Solea',
},
['idle'] = {
Range = 'Animator +1',
Ammo = 'Automat. Oil +2',
Head = 'Pantin Taj +1',
Neck = 'Orochi Nodowa',
Ear1 = 'Megasco Earring',
Ear2 = 'Hollow Earring',
Body = 'Pup. Tobe +1',
Hands = 'Pup. Dastanas',
Ring1 = 'Rajas Ring',
Ring2 = 'Warp Ring',
Back = 'Aesir Mantle',
Waist = 'Selemnus Belt',
Legs = 'Pup. Churidars',
Feet = 'Pup. Babouches',
},
['idle_magesub'] = {
Range = 'Animator +1',
Ammo = 'Automat. Oil +2',
Head = 'Displaced',
Neck = 'Orochi Nodowa',
Ear1 = 'Megasco Earring',
Ear2 = 'Hollow Earring',
Body = 'Vermillion Cloak',
Hands = 'Pup. Dastanas',
Ring1 = 'Succor Ring',
Ring2 = 'Warp Ring',
Back = 'Aesir Mantle',
Waist = 'Selemnus Belt',
Legs = 'Pup. Churidars',
Feet = 'Pup. Babouches',
},
['idle_town'] = {
Range = 'Animator +1',
Ammo = 'Automat. Oil +2',
Head = 'Pantin Taj +1',
Neck = 'Shepherd\'s Chain',
Ear1 = 'Megasco Earring',
Ear2 = 'Hollow Earring',
Body = 'Pup. Tobe +1',
Hands = 'Pup. Dastanas',
Ring1 = 'Rajas Ring',
Ring2 = 'Warp Ring',
Back = 'Aesir Mantle',
Waist = 'Selemnus Belt',
Legs = 'Pup. Churidars',
Feet = 'Pup. Babouches',
},
['ws_default_lowacc'] = {
Head = 'Shinku Hatsuburi',
Neck = 'Fotia Gorget',
Ear1 = 'Bushinomimi',
Ear2 = 'Aesir ear pendant',
Body = 'Pln. Khazagand',
Hands = 'Enkidu\'s Mitten',
Ring1 = 'Rajas Ring',
Ring2 = 'Mars\'s Ring',
Back = 'Aesir Mantle',
Waist = 'Potent Belt',
Legs = 'Pln. Seraweels',--STR+3 ACC+4
Feet = 'Pup. Babouches',
},
['ws_default_medacc'] = {
Head = 'Shinku Hatsuburi',
Neck = 'Fotia Gorget',
Ear1 = 'Bushinomimi',
Ear2 = 'Aesir ear pendant',
Body = 'Pln. Khazagand',
Hands = 'Enkidu\'s Mitten',
Ring1 = 'Rajas Ring',
Ring2 = 'Mars\'s Ring',
Back = 'Aesir Mantle',
Waist = 'Potent Belt',
Legs = 'Pln. Seraweels',--STR+3 ACC+4
Feet = 'Pup. Babouches',
},
['ws_default_highacc'] = {
Head = 'Shinku Hatsuburi',
Neck = 'Fotia Gorget',
Ear1 = 'Bushinomimi',
Ear2 = 'Aesir ear pendant',
Body = 'Pln. Khazagand',
Hands = 'Enkidu\'s Mitten',
Ring1 = 'Oneiros Annulet',
Ring2 = 'Mars\'s Ring',
Back = 'Aesir Mantle',
Waist = 'Potent Belt',
Legs = 'Pln. Seraweels',--STR+3 ACC+4
Feet = 'Agrona\'s Leggings',
},
['ws_shijin_lowacc'] = {
Head = 'Maat\'s Cap',-- DEX+7
Neck = 'Fotia Gorget',
Ear1 = 'Hollow Earring',-- DEX+2
Ear2 = 'Pixie Earring',-- DEX+3
Body = 'Pln. Khazagand',--Acc+10 Crit Rate +
Hands = 'Enkidu\'s Mitten',-- DEX+2
Ring1 = 'Rajas Ring',-- DEX+5
Ring2 = 'Zilant Ring',-- DEX+6
Back = 'Pantin Cape',
Waist = 'Potent Belt',-- STR+3 ACC+8
Legs = 'Enkidu\'s Subligar',--DEX+4 ACC+4
Feet = 'Agrona\'s Leggings',-- STR+3
},
['ws_shijin_medacc'] = {
Head = 'Optical Hat',-- DEX+3
Neck = 'Fotia Gorget',-- STR+3 ACC+5
Ear1 = 'Hollow Earring',-- DEX+2
Ear2 = 'Aesir ear pendant',-- ATK+7
Body = 'Pln. Khazagand',--Acc+10 Crit Rate +
Hands = 'Enkidu\'s Mitten',-- DEX+4
Ring1 = 'Rajas Ring',-- DEX+5
Ring2 = 'Zilant Ring',-- DEX+6
Back = 'Aesir Mantle',
Waist = 'Potent Belt',-- STR+3 ACC+8
Legs = 'Pln. Seraweels',--STR+3 ACC+4
Feet = 'Agrona\'s Leggings',-- STR+3
},
['ws_shijin_highacc'] = {
Head = 'Optical Hat',-- DEX+3
Neck = 'Fotia Gorget',-- STR+3 ACC+5
Ear1 = 'Hollow Earring',-- DEX+2
Ear2 = 'Aesir ear pendant',-- ATK+7
Body = 'Pln. Khazagand',--Acc+10 Crit Rate +
Hands = 'Enkidu\'s Mitten',-- DEX+4
Ring1 = 'Zilant Ring',-- DEX+6
Ring2 = 'Rajas Ring',-- DEX+5
Back = 'Aesir Mantle',
Waist = 'Potent Belt',-- STR+3 ACC+8
Legs = 'Pln. Seraweels',--STR+3 ACC+4
Feet = 'Agrona\'s Leggings',-- STR+3
},
['ws_pummel_lowacc'] = {
Head = 'Maat\'s Cap',-- STR+7
Neck = 'Fotia Gorget',-- STR+3 ACC+5
Ear1 = 'Bushinomimi',-- STR+2
Ear2 = 'Aesir ear pendant',-- ATK+7
Body = 'Pln. Khazagand',--Acc+10 Crit Rate +
Hands = 'Enkidu\'s Mitten',-- Acc+5 Atk+5
Ring1 = 'Rajas Ring',-- STR+5
Ring2 = 'Strigoi Ring',-- STR+6
Back = 'Aesir Mantle',
Waist = 'Potent Belt',-- STR+3 ACC+8
Legs = 'Enkidu\'s Subligar',--STR+3 ACC+4
Feet = 'Agrona\'s Leggings',-- STR+3
},
['ws_pummel_medacc'] = {
Head = 'Shinku Hatsuburi',-- STR+3 ACC+3 ATK+5
Neck = 'Fotia Gorget',-- STR+3 ACC+5
Ear1 = 'Bushinomimi',-- STR+2
Ear2 = 'Aesir ear pendant',-- ATK+7
Body = 'Pln. Khazagand',--Acc+10 Crit Rate +
Hands = 'Enkidu\'s Mitten',-- Acc+5 Atk+5
Ring1 = 'Rajas Ring',-- STR+5
Ring2 = 'Strigoi Ring',-- STR+6
Back = 'Aesir Mantle',
Waist = 'Potent Belt',-- STR+3 ACC+8
Legs = 'Pln. Seraweels',--STR+3 ACC+4
Feet = 'Agrona\'s Leggings',-- STR+3
},
['ws_pummel_highacc'] = {
Head = 'Optical Hat', -- +10 ACC
Neck = 'Fotia Gorget',-- STR+3 ACC+5
Ear1 = 'Bushinomimi',-- STR+2
Ear2 = 'Aesir ear pendant',-- ATK+7
Body = 'Pln. Khazagand',--Acc+10 Crit Rate +
Hands = 'Enkidu\'s Mitten',-- Acc+5 Atk+5
Ring1 = 'Oneiros Annulet',-- ACC+8
Ring2 = 'Strigoi Ring',-- STR+5
Back = 'Aesir Mantle',
Waist = 'Potent Belt',-- STR+3 ACC+8
Legs = 'Pln. Seraweels',--STR+3 ACC+4
Feet = 'Agrona\'s Leggings',-- STR+3
},
['rest'] = {
Range = '',
Head = 'Pup. Taj',
Neck = 'Chivalrous Chain',
Ear1 = 'Megasco Earring',
Ear2 = 'Aesir ear pendant',
Body = 'Pup. Tobe +1',
Hands = 'Pup. Dastanas',
Ring1 = 'Setae Ring',
Ring2 = 'Rajas Ring',
Back = 'Aesir Mantle',
Waist = 'Selemnus Belt',
Legs = 'Pup. Churidars',
Feet = 'Pup. Babouches',
},
['repair_set'] = {
Feet = 'Pup. Babouches',
--Ammo = 'Automaton Oil +2',
},
['di_set'] = {
Main = 'Maochinoli',
--Feet = 'Pup. Babouches',
--Ammo = 'Automaton Oil +2',
},
['stylelock'] = {
Main = 'Kenkonken',
Head = 'Shinku Hatsuburi',
Body = 'Pup. Tobe +1',
Hands = 'Pup. Dastanas',
Legs = 'Pup. Churidars',
Feet = 'Pup. Babouches',
},
['pet_only_melee'] = {
Head = 'Spurrer Beret',
Neck = 'Shepherd\'s Chain',
Body = 'Pup. Tobe +1',
Hands = 'Pup. Dastanas',
Back = 'Pantin Cape',
Waist = 'Selemnus Belt',
Legs = 'Pup. Churidars',
Feet = 'Pup. Babouches',
},
['pet_melee_addon'] = {
Head = 'Spurrer Beret',
Neck = 'Shepherd\'s Chain',
--Body = 'Pup. Tobe +1',
--Hands = 'Pup. Dastanas',
Back = 'Pantin Cape',
--Waist = 'Selemnus Belt',
--Legs = 'Pup. Churidars',
},
['pet_matk'] = {
Head = 'Oneiros Headgear',
Neck = 'Shepard\'s Chain',
Body = 'Pup. Tobe +1',
Hands = 'Pantin Dastanas',
Back = 'Fidelity mantle',
Waist = 'Selemnus Belt',
Legs = 'Pantin Churidars',
Feet = 'Pantin Babouches',
},
['pet_macc'] = {
Head = 'Oneiros Headgear',
Neck = 'Chivalrous Chain',
Body = 'Pup. Tobe +1',
Hands = 'Pantin Dastanas',
Back = 'Fidelity mantle',
Waist = 'Selemnus Belt',
Legs = 'Pantin Churidars',
Feet = 'Pantin Babouches',
},
['pet_cure'] = {
Head = 'Spurrer Beret',
Body = 'Pup. Tobe +1',
Hands = 'Pantin Dastanas',
Waist = 'Selemnus Belt',
Legs = 'Pup. Churidars',
Feet = 'Aife\'s Pumps',
},
['chr'] = {
Head = 'Maat\'s Cap', --CHR+7
Neck = 'Flower Necklace', --CHR+3
Ear1 = 'Delta Earring', --CHR+2
Ear2 = 'Roundel Earring',
Body = { Name = 'Pup. Tobe +1', Augment = { [1] = '"Store TP"+3', [2] = '"Martial Arts"+2' } },
Hands = 'Pup. Dastanas',
Ring1 = 'Light Ring', --CHR+5
Ring2 = 'Angel\'s Ring', --CHR+4
Back = 'Jester\'s Cape +1', --CHR+10
Waist = 'Corsette', --CHR+5
Legs = 'Pup. Churidars', --CHR+3
Feet = 'Dance Shoes +1', --CHR+5
},
['str'] = {
Head = 'Maat\'s Cap', -- STR+7
Neck = 'Ire Torque', --STR+4
Ear1 = 'Giant\'s Earring', --STR+1
Ear2 = 'Bushinomimi', --STR+2
Body = 'Pup. Tobe +1',
Hands = 'Enkidu\'s Mittens',
Ring1 = 'Rajas Ring', --STR+5
Ring2 = 'Strigoi Ring',-- STR+6
Back = 'Ryl. Army Mantle',
Waist = 'Buccaneer\'s Belt',
Legs = 'Enkidu\'s Subligar',
Feet = 'Pup. Babouches',
},
['whmsub'] = {
Ear1 = 'Astral Earring',
Ear2 = 'Loquac. Earring',
Ring1 = 'Succor Ring',
Ring2 = 'Serket Ring',
},
};
local pet_ele_spells = T{
'Stone', 'Stone II', 'Stone III', 'Stone IV', 'Stone V',
'Water', 'Water II', 'Water III', 'Water IV', 'Water V',
'Aero', 'Aero II', 'Aero III', 'Aero IV', 'Aero V',
'Fire', 'Fire II', 'Fire III', 'Fire IV', 'Fire V',
'Blizzard', 'Blizzard II', 'Blizzard III', 'Blizzard IV', 'Blizzard V',
'Thunder', 'Thunder II', 'Thunder III', 'Thunder IV', 'Thunder V',
};
local pet_debuff_spells = T{'Slow', 'Paralyze', 'Silence', 'Blind', 'Bio', 'Bio II', 'Dia', 'Dia II', 'Poison', 'Poison II',};
local pet_dark_spells = T{'Aspir', 'Drain', 'Absorb-INT', 'Dread Spikes',};
local pet_healing_spells = T{'Cure', 'Cure II', 'Cure III', 'Cure IV', 'Cure V', 'Cure VI',};
local towns = T{'Aht Urhgan Whitegate','Al Zahbi','Bastok Markets [S]','Bastok Markets','Bastok Mines','Bastok-Jeuno Airship','Celennia Memorial Library','Chateau d\'Oraguille','Eastern Adoulin','Heavens Tower','Kazham','Kazham-Jeuno Airship','Lower Jeuno','Metalworks','Mhaura','Mog Garden','Nashmau','Norg','Northern San d\'Oria','Port Bastok','Port Jeuno','Port San d\'Oria','Port Windurst','Rabao','Ru\'Lude Gardens','San d\'Oria-Jeuno Airship','Selbina','Southern San d\'Oria [S]','Southern San d\'Oria','Tavnazian Safehold','Upper Jeuno','Western Adoulin','Windurst Walls','Windurst Waters [S]','Windurst Waters','Windurst Woods','Windurst-Jeuno Airship',};
local mageSubs = T{'BLM', 'BLU', 'PLD', 'RUN', 'RDM', 'WHM', 'SCH', 'SMN'};
local tpvarianttable = {
[1] = 'lowacc',
[2] = 'medacc',
[3] = 'highacc',
--[4] = 'lowacc'
};
local manelements = {
i = 'Ice',
f = 'Fire',
wi = 'Wind',
wa = 'Water',
t = 'Thunder',
l = 'Light',
d = 'Dark',
e = 'Earth',
};
local settings = {
tpvariant = 1,
diset = false;
automan = false,
autorepair = false,
repairpercent = 20,
maneuver = {};
usedrepair = false,
autoWS = {
active = false,
minTP = 1200,
minHP = 35,
useWS = 'Stringing Pummel',
},
};
profile.Sets = sets;
profile.Packer = {
};
function CancelAftermath()
local AM1 = gData.GetBuffCount(270);
local AM2 = gData.GetBuffCount(271);
local AM3 = gData.GetBuffCount(272);
local TP = gData.GetPlayer().TP;
if (AM3 > 0 and TP >= 2000) then
--Cancels Lv.3 Aftermath for PUP
AshitaCore:GetChatManager():QueueCommand(1, '/cancel 272');
elseif (AM2 > 0 and TP >= 1375) then
--Cancels Lv.2 Aftermath for PUP
AshitaCore:GetChatManager():QueueCommand(1, '/cancel 271');
elseif (AM1 > 0 and TP >= 1000) then
--Cancels Lv.1 Aftermath for PUP
AshitaCore:GetChatManager():QueueCommand(1, '/cancel 270');
end
end
local function HandlePetAction(PetAction)
local petaction = PetAction;
if (PetAction ~= nil) and pet_ele_spells:contains(PetAction.Name) then
gFunc.EquipSet(sets.pet_matk);
elseif (PetAction ~= nil) and pet_debuff_spells:contains(PetAction.Name) then
gFunc.EquipSet(sets.pet_macc);
elseif (PetAction ~= nil) and pet_dark_spells:contains(PetAction.Name) then
gFunc.EquipSet(sets.pet_macc);
elseif (PetAction ~= nil) and pet_healing_spells:contains(PetAction.Name) then
gFunc.EquipSet(sets.pet_cure);
else
end
end
profile.OnLoad = function()
gSettings.AllowAddSet = true;
local pet = gData.GetPet();
local player = gData.GetPlayer()
AshitaCore:GetChatManager():QueueCommand(1, '/macro book 4');
if (player.SubJob == 'WAR') then
AshitaCore:GetChatManager():QueueCommand(1, '/macro set 2');
elseif (player.SubJob == 'DNC') then
AshitaCore:GetChatManager():QueueCommand(1, '/macro set 1');
else
AshitaCore:GetChatManager():QueueCommand(1, '/macro set 1');
end
-- Binds Start
AshitaCore:GetChatManager():QueueCommand(-1, '/alias /pup /lac fwd');
AshitaCore:GetChatManager():QueueCommand(-1, '/alias /autorepair /lac fwd autorepair');
AshitaCore:GetChatManager():QueueCommand(-1, '/alias /ps /pupset');
AshitaCore:GetChatManager():QueueCommand(-1, '/alias /psl /pupset load');
AshitaCore:GetChatManager():QueueCommand(-1, '/bind !F1 /lac fwd tpset');
AshitaCore:GetChatManager():QueueCommand(-1, '/bind !F2 /lac fwd diset');
gFunc.Message('Active Alias - /pup [/lac fwd]');
gFunc.Message('Active Binds - Alt+F1 to cycle TP sets');
gFunc.Message('Active Binds - Alt+F2 to cycle DI set');
-- Binds End
-- Sets the delay for the Pupsets addon to be slower than the safe mode
AshitaCore:GetChatManager():QueueCommand(1, '/pupset delay 1.2');
AshitaCore:GetChatManager():QueueCommand(1, '/lockstyleset 001');
--gFunc.LockStyle(sets.stylelock);
end
profile.OnUnload = function()
-- Bind clean up
AshitaCore:GetChatManager():QueueCommand(-1, '/alias delete /pup');
AshitaCore:GetChatManager():QueueCommand(-1, '/alias delete /autorepair');
AshitaCore:GetChatManager():QueueCommand(-1, '/alias delete /ps');
AshitaCore:GetChatManager():QueueCommand(-1, '/alias delete /psl');
AshitaCore:GetChatManager():QueueCommand(-1, '/unbind !F1');
AshitaCore:GetChatManager():QueueCommand(-1, '/unbind !F2');
end
profile.HandleCommand = function(args)
if (args[1] == 'tpset') then
settings.tpvariant = settings.tpvariant + 1;
if (settings.tpvariant > #tpvarianttable) then
settings.tpvariant = 1;
end
gFunc.Message('TP Set: ' .. tpvarianttable[settings.tpvariant]);
elseif (args[1] == 'diset') then
if (settings.diset == true) then
settings.diset = false;
else
settings.diset = true;
end
gFunc.Message('DI Set is now set to ' .. tostring(settings.diset));
elseif (args[1] == 'autorepair') then
if (args[2] ~= nil) then
if (args[2] == 'on') then
settings.autorepair = true;
else
settings.autorepair = false;
end
end
elseif (args[1] == 'automan') then
n = 1;
if (#args > 2) then
while n <= #args do
settings.maneuver[n] = args[n];
n = n+1;
end
end
elseif (args[1] == 'autowstp') then --Cancel Aftermath
if (args[2] ~= '' or args[2] ~= nil) then
settings.autoWS.minTP = args[2];
end
gFunc.Message('AutoWS Minimum TP is set to: ' .. chat.success(tostring(settings.autoWS.minTP)));
elseif (args[1] == 'autowshp') then
if (args[2] ~= '' or args[2] ~= nil) then
settings.autoWS.minHP = args[2];
end
gFunc.Message('AutoWS Minimum HP is set to: ' .. chat.success(tostring(settings.autoWS.minHP)));
elseif (args[1] == 'autowsws') then
if (args[2] ~= '' or args[2] ~= nil) then
settings.autoWS.useWS = args[2];
end
gFunc.Message('AutoWS Weapon SKill is set to: ' .. chat.success(tostring(settings.autoWS.useWS)));
elseif (args[1] == 'autows') then
if (args[2] == '' or args[2] == nil) then
gFunc.Messages('Auto Weapon Skill is currently: ' .. chat.success(tostring(settings.autoWS.active)));
elseif (args[2] == 'on') then
settings.autoWS.active = true;
gFunc.Messages('Auto Weapon Skill is currently: ' .. chat.success(tostring(settings.autoWS.active)));
elseif (args[2] == 'off') then
settings.autoWS.active = false;
gFunc.Messages('Auto Weapon Skill is currently: ' .. chat.success(tostring(settings.autoWS.active)));
end
end
end
profile.HandleDefault = function()
-- This section handles if the Auto is doing something
local petAction = gData.GetPetAction();
if (petAction ~= nil) then
HandlePetAction(petAction);
return;
end
local player = gData.GetPlayer();
local pet = gData.GetPet();
local place = gData.GetEnvironment();
local target = gData.GetTarget();
local frame = puplib.GetFrameName();
if (player.Status == 'Engaged') then
gFunc.EquipSet('tp_' .. tpvarianttable[settings.tpvariant]);
-- If you have a pet out
if (pet ~= nil) then
if (pet.Status == 'Engaged') then
if target ~= nil then
if target.Distance >= 5 then -- You far but engaged and auto is engaged
gFunc.EquipSet(sets.pet_only_melee); -- A set with gear just for your Auto and whatever -DT gear for yourself or regen.
elseif target.Distance < 5 then -- You near and engaged and auto is engaged
gFunc.EquipSet('tp_' .. tpvarianttable[settings.tpvariant]); -- Master gear set
gFunc.EquipSet(sets.pet_melee_addon); -- Auto gear addon item set
end
end
end
end
--Auto Weapon Skill
if (settings.autoWS.active == true) then
if (target ~= nil) then
if (target.HPP <= tonumber(settings.autoWS.minHP) and player.TP > tonumber(settings.autoWS.minTP)) then
AshitaCore:GetChatManager():QueueCommand(1, '/ws "' .. settings.autoWS.useWS .. '" <t>');
end
end
end
elseif (player.Status == 'Resting') then
gFunc.EquipSet(sets.rest);
elseif (player.Status == 'Idle') then
if (towns:contains(place.Area)) then
gFunc.EquipSet(sets.idle_town);
else
gFunc.EquipSet(sets.idle);
if mageSubs:contains(player.SubJob) then
gFunc.EquipSet(sets.idle_magesub);
end
if (pet ~= nil) then -- If you have a pet
if (pet.Status == 'Engaged') then -- if your pet is fighting? Yes.
gFunc.EquipSet(sets.pet_only_melee); -- A set with gear just for your Auto and whatever -DT gear for yourself or regen.
else -- If pet not engaged
if (frame ~= nil) then
if (string.match(frame, 'Stormwaker') or string.match(frame, 'Harlequin')) then
gFunc.Equip('Head', 'Oneiros Headgear');
else
--Do nothing instead of throwing an error when zoning with a pet out
end
end
end
end
end
end
if (settings.diset == true) then
gFunc.EquipSet(sets.di_set);
end
if (pet ~= nil) then -- If you have a pet out
-- If the automan is true we'll do stuff here
if (settings.automa == true) then
end
-- If autorepair is true we handle here
if (settings.autorepair == true) and (pet.HPP <= settings.repairpercent) and settings.usedrepair == false then
if string.match(gData.GetEquipment.Range.Name, 'Automat. Oil') then
AshitaCore:GetChatManager():QueueCommand(1, '/ja "repair" <me>');
settings.usedrepair = true;
end
end
if settings.usedrepair == true and (pet.HPP > settings.repairpercent) then
settings.usedrepair = false;
end
end
if (player.SubJob == 'WHM') then
gFunc.EquipSet(sets.whmsub);
end
if player.IsMoving then
gFunc.Equip('Feet', 'Hermes\' Sandals')
end
end
profile.HandleAbility = function()
local action = gData.GetAction();
if string.match(action.Name, ' Maneuver') then
gFunc.Equip('Hands', 'Pup. Dastanas');
gFunc.Equip('Neck', 'Baffoon\'s Collar');
if (settings.diset == true) then
gFunc.EquipSet(sets.di_set);
end
elseif (action.Name == 'Repair') then
gFunc.Equip('Ammo', 'Automat. Oil +2');
gFunc.EquipSet(sets.repair_set);
elseif (action.Name == 'Maintenance') then
gFunc.Equip('Ammo', 'Automaton Oil');
gFunc.EquipSet(sets.repair_set);
elseif string.match(action.Name, 'Waltz') then
gFunc.EquipSet(sets.chr);
end
end
profile.HandleItem = function()
end
profile.HandlePrecast = function()
end
profile.HandleMidcast = function()
local spell = gData.GetAction();
if (string.match(spell.Name, 'Cure')) then
gFunc.Equip('Ear1', 'Roundel Earring');
end
end
profile.HandlePreshot = function()
end
profile.HandleMidshot = function()
end
profile.HandleWeaponskill = function()
local action = gData.GetAction();
local AM1 = gData.GetBuffCount(270);
local AM2 = gData.GetBuffCount(271);
local AM3 = gData.GetBuffCount(272);
local TP = gData.GetPlayer().TP;
local buffId;
local packet;
if (action.Name == 'Stringing Pummel') then
if (AM3 > 0 and TP >= 2000) then
--Cancels Lv.3 Aftermath for PUP
buffId = 272;
packet = struct.pack('LHH', 0, buffId, 0);
AshitaCore:GetPacketManager():AddOutgoingPacket(0xF1, packet:totable());
elseif (AM2 > 0 and TP >= 1335) then
--Cancels Lv.2 Aftermath for PUP
buffId = 271;
packet = struct.pack('LHH', 0, buffId, 0);
AshitaCore:GetPacketManager():AddOutgoingPacket(0xF1, packet:totable());
elseif (AM1 > 0 and TP >= 1000) then
--Cancels Lv.1 Aftermath for PUP
buffId = 270;
packet = struct.pack('LHH', 0, buffId, 0);
AshitaCore:GetPacketManager():AddOutgoingPacket(0xF1, packet:totable());
end
gFunc.EquipSet('ws_pummel_' .. tpvarianttable[settings.tpvariant]);
elseif (action.Name == 'Shijin Spiral') then
gFunc.EquipSet('ws_shijin_' .. tpvarianttable[settings.tpvariant]);
else
gFunc.EquipSet('ws_default_' .. tpvarianttable[settings.tpvariant]);
end
end
return profile;