-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTristamgreen_SMN.lua
1222 lines (1063 loc) · 40.5 KB
/
Tristamgreen_SMN.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
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--[[
----------------
-- Properties --
----------------
Only job-specific properties are shown here. For the general list, more info, tips etc. visit my Gearswap page: https://enedin.be/gs/
AUTOMATIC
- Adjusts your current perpetuation set to minimize MP loss, according to pet status/player status/day/weather.
- Informs party members of the effects of moonphase/day-dependent Blood Pacts.
- Cancels Blood Pacts/Assault when you are too far.
COMMANDS (Blood Pacts) (The full list can be found at the end of this file)
- bplowlv Lower level Blood Pacts
- bpcure Single-target cure
- bpcuraga AoE cure
- bpbuffoffense Mostly offensive buffs
- bpbuffdefense Mostly defensive buffs
- bpdebuff1 Single-target debuffs
- bpdebuff2 AoE debuffs
- bpsleep Shiva/Diabolos' Sleep
- bpnuke2 Elemental Magic II
- bpnuke4 Elemental Magic IV
- bplv70 The level 65/70 Blood Pacts
- bplv75 The merited Group 2 Blood Pacts
- bpaf Astral Flow
COMMANDS (other)
- meleeMode Cycle melee and weapon sets. Weapon/grip/ammo is locked except in mage mode.
- dispmp Toggle showing spells' MP cost and other info.
- dispperp Toggle showing your current perpetuation set.
- use_terras Toggle the use of Claustrum/Terra's Staff in idle (useful for BLM Augment's Refresh).
- siphon Auto-summon the correct Spirit for siphoning, siphon it and release it. The right Spirit is chosen based on day/weather.
- respirit Release a Spirit and immediately re-summon it.
- endurance Toggle Endurance mode, which keeps on Refresh gear instead of pet melee gear.
- showtime_bprage Informs party of the time until your next Blood Pact: Rage.
- showtime_bpward Informs party of the time until your next Blood Pact: Ward.
- showtime_apogee Informs party of the time until your next Apogee.
-------------------------
-- Tips/Best practices --
-------------------------
- Use Assault with <stnpc> macro. If you want to use <t> macro, do a search for #CHANGETARGET in this file, and follow the instructions in that comment.
- When using a Blood Pact, wait for it to be executed, or you might end up using the wrong gear for it.
---------------------
-- About this file --
---------------------
CHANGELOG
- v2.4: added melee.staffhaste for situations where you can build TP on easier stuff
added use_terras to switch between Terra's Staff and Claustrum in idle (for BLM augmented staff)
changed melee command to meleeMode (for consistency with my other jobs)
- v2.3: fixed a bug where the command was showtime_bpapogee instead of showtime_apogee
fixed a bug where changing melee modes while resting would unequip resting gear
changed the messages that you get when your BP/apogee abilities are ready to party chat
- v2.2: added Endurance mode: prevent your pet-engaged gear from equipping when you want to keep maximum perp at all times
useful when in weather/day to keep pet's MP cost down. can be toggled on or off
fixed a bug where dispperp would still display 'Garuda' in wind weather even though AF2 would be equipped when using Garuda
- v2.1: added cancellation of spells you want to cast when they're still on cooldown (to prevent gear changes and status cancels)
added commands to show your party how long until your next BPrage, BPward or Apogee
- v2.0: base (core functionality)
CREDITS
- Adapted this from Wren's GearSwap luas: https://supernovaffxi.fandom.com/wiki/Wren%27s_Gearswaps
- Included good ideas from Kinematic's SMN GearSwap lua: https://github.com/Kinematics/GearSwap-Jobs/blob/master/SMN.lua
- Thanks to Tehbonz for listening to me complain about Motes and eventually inspiring me to make this.
]]--
require("common_gs_functions")
----------
-- Sets --
----------
function get_sets()
-- Including this gives an easy way of defining cyclic/trigger/etc variables, makes handling self_commands easier.
-- Motes also uses this, but this is completely independent from Motes
include('Modes.lua')
-- Idle sets
sets.idle = { -- Movement, PDT, MDT, Refresh, HP, MP
main = "Claustrum",
sub = "Magic Strap",
ammo = "Hedgehog Bomb",
head = "Zenith Crown +1",
body = "Dalmatica +1",
hands = "Smn. Bracers +1",
legs = "Goliard Trews",
feet = "Herald's Gaiters",
neck = "Orochi Nodowa +1",
waist = "Hierarch Belt",
left_ear = "Novia Earring",
right_ear = "Loquacious Earring",
left_ring = "Shadow Ring",
right_ring = "Patronus Ring",
back = "Shadow Mantle"
}
sets.dayregen = { -- idle with daylight refresh stuff. lyco sash, feronia's bangles...
hands = "Feronia's Bangles",
waist = "Lycopodium Sash"
}
--[[ Perp sets
Perp sets are equipped in this order, if applicabble:
sets.perp
.perp.melee (if you're meleeing)
.perp.avatar/spirit (avatar-specific stuff)
.perp.day/weather (when day/weather applies)
.perp.engaged (if pet is engaged)
.perp.endurance (if endurance mode is on)
.perp.avatar/spirit (again to overwrite possible engaged stuff)
.perp.day/weather (again to overwrite possible engaged stuff)
.perp.engaged.melee (if you're meleeing)
]]--
sets.perp = { -- Perp cost-
-- the base perp set
main = "Claustrum",
sub = "Magic Strap",
ammo = "Hedgehog Bomb",
head = "Zenith Crown +1",
body = "Penance Robe",
hands = "Nashira Gages",
legs = "Goliard Trews",
feet = "Evk. Pigaches +1",
neck = "Orochi Nodowa +1",
waist = "Hierarch Belt",
left_ear = "Merman's Earring",
right_ear = "Merman's Earring",
left_ring = "Evoker's Ring",
right_ring = "Patronus Ring",
back = "Umbra Cape",
}
sets.perp.melee = set_combine(sets.perp,{ -- Perp cost- + acc for yourself
-- a combination of the base perp set and your melee gear
head = "Optical Hat",
legs = "Hydra Brais",
feet = "Evk. Pigaches +1",
neck = "Ancient Torque",
waist = "Virtuoso Belt",
left_ear = "Pixie Earring",
right_ear = "Brutal Earring",
right_ring = "Mars's Ring",
})
sets.perp.carbuncle = { -- Carbuncle-specific items (Mitts and Claustrum/Chatoyant is enough to get free carby, so fill up other perp slots with useful gear)
body = "Yinyang Robe",
hands = "Carbuncle Mitts",
left_ring = "Shadow Ring",
}
sets.perp.spirit = {body = "Yinyang Robe"} -- Spirit-specific items
sets.perp.garuda = {head = "Karura Hachigane"} -- Garuda-specific items
sets.perp.day = {body = "Smn. Doublet +1"} -- Perp cost- on day
sets.perp.weather = {head = "Smn. Horn +1"} -- Perp cost- in weather
sets.perp.engaged = { -- Avatar acc/atk/haste
-- after sets.perp, this one is equipped when your pet is engaged
main = "Claustrum",
sub = "Magic Strap",
ammo = "Hedgehog Bomb",
head = "Spurrer Beret",
hands = "Smn. Bracers +1",
legs = "Evoker's Spats +1",
feet = "Smn. Pigaches +1",
}
sets.perp.endurance = { -- Perp cost- (only this, since it overwrites perp.engaged)
-- perp.engaged's relevant petacc/atk/haste slots will stay equipped even after equipping
-- perp.endurance, but only in slots where endurance has no perp- to offer.
main = "Claustrum",
sub = "Magic Strap",
ammo = "Hedgehog Bomb",
body = "Penance Robe",
hands = "Nashira Gages",
feet = "Evk. Pigaches +1",
left_ring = "Evoker's Ring",
}
sets.perp.engaged.melee = { -- Acc for yourself (dont overwrite perp.engaged slots)
-- this comes at the end, after perp.engaged or perp.endurance, so only define slots
-- here that won't overwrite relevant perp.engaged or perp.endurance slots
neck = "Ancient Torque",
waist = "Virtuoso Belt",
left_ear = "Pixie Earring",
right_ear = "Brutal Earring",
right_ring = "Mars's Ring",
back = "Umbra Cape",
}
-- SMN potency sets
sets.bpdelay = { -- BP delay
head = "Smn. Horn +1",
body = "Yinyang Robe",
hands = "Smn. Bracers +1",
legs = "Smn. Spats +1",
feet = "Smn. Pigaches +1",
}
sets.siphon = { -- Summoning magic skill
main = "Claustrum",
sub = "Magic Strap",
head = "Evk. Horn +1",
hands = "Smn. Bracers +1",
legs = "Oracle's Braconi",
feet = "Nashira Crackows",
neck = "Smn. Torque",
waist = "Summoning Belt",
left_ear = "Smn. Earring",
right_ear = "Loquac. Earring",
left_ring = "Evoker's Ring",
right_ring = "Serket Ring",
back = "Astute Cape",
}
sets.midcast = {}
sets.midcast.bpragephys = set_combine(sets.siphon,{ -- BP potency (Summoning magic skill + acc/atk)
body = "Smn. Doublet +1",
legs = "Evoker's Spats +1",
feet = "Smn. Pigaches +1",
})
sets.midcast.bprageclaws = set_combine({sets.bpragephys, -- Garuda-specific
head = "Karura Hachigane",
})
sets.midcast.bpragewolf = set_combine({sets.bpragephys, -- Fenrir-specific
head = "Fenrir's Crown",
})
sets.midcast.bpragemag = sets.midcast.bpragephys -- BP potency (Summoning magic skill + macc/matk)
sets.midcast.bpragestrike = set_combine({sets.bpragemag, -- Heavenly Strike-specific: added Morana's Pigaches
feet = "Morana's Pigaches",
})
sets.midcast.bpragemag = sets.siphon -- BP potency (Summoning magic skill + macc/matk)
sets.midcast.bpwarddebuff = sets.siphon -- BP potency (Summoning magic skill)
sets.midcast.bpwardbuff = sets.siphon -- BP potency (Summoning magic skill)
-- Magic sets
sets.healing_magic = { -- Cure Potency > 1MND = 3VIT = 5skill
main = "Chatoyant Staff",
sub = "Reign Grip",
ammo = "Hedgehog Bomb",
head = "Maat's Cap",
body = "Mahatma Hpl.",
hands = "Dvt. Mitts +1",
legs = "Mahatma Slops",
feet = "Mahatma Pigaches",
neck = "Fylgja Torque +1",
waist = "Pythia Sash +1",
left_ear = "Roundel Earring",
right_ear = "Celestial Earring",
left_ring = "Celestial Ring",
right_ring = "Celestial Ring",
back = "Dew Silk Cape +1",
}
sets.enhancing_magic = { -- Skill (pot)
main = "Claustrum",
sub = "Vivid Strap +1",
feet = "Rostrum Pumps",
neck = "Enhancing Torque",
left_ear = "Augment. Earring",
right_ear = "Loquac. Earring",
back = "Merciful Cape",
}
sets.enhancing_magic.stoneskin = { -- MND (pot)
-- With 131 (/whm+16merits+10claustrum) skill and 450 being SN cap, you need 167 MND on SMN to get cap
main = "Claustrum",
sub = "Reign Grip",
ammo = "Hedgehog Bomb",
head = "Maat's Cap",
body = "Mahatma Hpl.",
hands = "Dvt. Mitts +1",
legs = "Mahatma Slops",
feet = "Mahatma Pigaches",
neck = "Stone Gorget",
waist = "Pythia Sash +1",
left_ear = "Celestial Earring",
right_ear = "Celestial Earring",
left_ring = "Celestial Ring",
right_ring = "Celestial Ring",
back = "Dew Silk Cape +1",
}
-- Fast Cast and Haste sets
sets.precastfastcast = { -- Fast Cast (casting time)
sub = "Vivid Strap +1",
right_ear = "Loquac. Earring",
feet = "Rostrum Pumps",
back = "Veela Cape"
}
sets.fastcasthaste = { -- Fast Caste = Haste (recast time)
main = "Claustrum",
sub = "Vivid Strap +1",
ammo = "Hedgehog Bomb",
head = "Walahra Turban",
body = "Goliard Saio",
hands = "Zenith Mitts +1",
legs = "Nashira Seraweels",
feet = "Rostrum Pumps",
neck = "Bloodbead Gorget",
waist = "Ninurta's Sash",
left_ear = "Merman's Earring",
right_ear = "Loquac. Earring",
left_ring = "Shadow Ring",
right_ring = "Patronus Ring",
back = "Veela Cape",
}
-- Other sets
sets.matching_dayweather = {waist="Hachirin-no-Obi"}
sets.resting = { -- hMP
main = "Claustrum",
sub = "Reign Grip",
ammo = "Hedgehog Bomb",
head = "Mirror Tiara",
body = "Mahatma Hpl.",
hands = "Oracle's Gloves",
legs = "Oracle's Braconi",
feet = "Goliard Clogs",
neck = "Gnole Torque",
waist = "Qiqirn Sash +1",
left_ear = "Relaxing Earring",
right_ear = "Antivenom Earring",
left_ring = "Celestial Ring",
right_ring = "Celestial Ring",
back = "Invigorating Cape"
}
-- Melee sets
sets.melee = {}
sets.melee.club = { -- Haste > whatever is best in that slot
head = "Walahra Turban",
body = "Goliard Saio",
hands = "Hydra Gloves",
legs = "Nashira Seraweels",
feet = "Hydra Gaiters",
neck = "Ire Torque +1",
waist = "Ninurta's Sash",
left_ear = "Merman's Earring",
right_ear = "Merman's Earring",
left_ring = "Rajas Ring",
right_ring = "Patronus Ring",
back = "Umbra Cape",
}
sets.melee.staffhaste = { -- Haste > whatever is best in that slot
head ="Walahra Turban",
body ="Goliard Saio",
hands ="Hydra Gloves",
legs ="Nashira Seraweels",
feet ="Hydra Gaiters",
neck ="Ancient Torque",
waist ="Ninurta's Sash",
left_ear ="Merman's Earring",
right_ear ="Brutal Earring",
left_ring ="Rajas Ring",
right_ring ="Patronus Ring",
back ="Umbra Cape",
}
sets.melee.staffacc = { -- Accuracy > Haste
head = "Optical Hat",
body = "Hydra Doublet",
hands = "Hydra Gloves",
legs = "Hydra Brais",
feet = "Hydra Gaiters",
neck = "Ancient Torque",
waist = "Virtuoso Belt",
left_ear = "Pixie Earring",
right_ear = "Brutal Earring",
left_ring = "Mars's Ring",
right_ring = "Patronus Ring",
back = "Umbra Cape",
}
sets.weapons = {}
sets.weapons.club = {
main = "Kraken Club",
sub = "Genbu's Shield",
ammo = "White Tathlum",
}
sets.weapons.staff = {
main = "Claustrum",
-- sub = "Pole Grip",
ammo = "White Tathlum",
}
sets.ws = {}
sets.ws.gateoftartarus = set_combine(sets.melee.staff,{ -- Accuracy
right_ring = "Mars's Ring",
})
sets.ws.blackhalo = { -- 30%STR, 50%MND
head = "Maat's Cap",
body = "Hydra Doublet",
hands = "Dvt. Mitts +1",
legs = "Jet Seraweels",
feet = "Goliard Clogs",
neck = "Fotia Gorget",
waist = "Pythia Sash +1",
left_ear = "Harmonius Earring",
right_ear = "Harmonius Earring",
left_ring = "Rajas Ring",
right_ring = "Mars's Ring",
back = "Dew Silk Cape +1",
}
sets.ws.spirittaker = { -- 50%INT, 50%MND
head = "Maat's Cap",
body = "Mahatma Hpl.",
hands = "Mahatma Cuffs",
legs = "Mahatma Slops",
feet = "Goliard Clogs",
neck = "Lmg. Medallion +1",
waist = "Pythia Sash +1",
left_ear = "Celestial Earring",
right_ear = "Celestial Earring",
left_ring = "Omniscient Ring",
right_ring = "Galdr Ring",
back = "Prism Cape",
}
---------------
-- Variables --
---------------
-- Don't change this:
melee = false
bp_waiting_for_execution = false
oldperpinfo = ''
setup_job()
-- Default values, feel free to change
endurance_mode = false -- true: pet doesn't go into engaged perp set, it keeps on most MP efficient perp set
display_mp_cost = true -- true: show cost of MP and Blood Pacts
display_perp_set = false -- true: show current perp set
use_terras = false -- true: use Terra's Staff in idle (over BLM augmented Claustrum)
-- Lists of options. Default value is the first one
clippingPlane = M{'1', '0.75', '0.5', '10', '5', '2'} -- config ClippingPlane value
meleeMode = M{'mage','staffhaste','staffacc','club'} -- melee modes
end
---------------
-- Functions --
---------------
function status_change(new,old)
choose_set()
end
-- Main function that decides whether to equip engaged/idle/resting gear
function choose_set()
if player.status == "Engaged" then
equip_engaged()
elseif player.status == "Resting" then
equip_rest()
else
equip_idle()
end
end
function equip_engaged()
-- decide which engaged set to equip
local temp = meleeMode.value
if temp == 'club' or temp == 'staffacc' or temp == 'staffhaste' then
equip(sets.melee[meleeMode.value])
elseif temp == 'mage' then
equip(sets.melee.staffacc)
end
-- if you've got a pet, it takes priority
if pet.isvalid then equip_perp(pet.name) end
end
function equip_rest()
equip(sets.resting)
end
function equip_idle(name)
if world.time <= 1080 and world.time >= 360 then
windower.add_to_chat(8,"[Bonus Regen ON]")
equip(sets.idle,sets.dayregen)
else
windower.add_to_chat(8,"[Summoner's Base Idle set]")
equip(sets.idle)
end
if use_terras then equip({main="Terra's Staff"}) end
-- if you've got a pet, it takes priority
if pet.isvalid then equip_perp(pet.name) end
end
function equip_ws(name)
if name == "Gate of Tartarus" then
equip(sets.ws.gateoftartarus)
elseif name == "Black Halo" then
equip(sets.ws.blackhalo)
elseif name == "Spirit Taker" then
equip(sets.ws.spirittaker)
end
end
-- Auto-detect when a pet changes states
function pet_status_change(new,old)
-- if pet engages a monster, or comes back from engaging it
if (old == 'Engaged' and new == 'Idle') or (old == 'Idle' and new == 'Engaged') then
equip_perp(pet.name)
end
end
-- Auto-detect when a pet is summoned or dismissed/dies
function pet_change(pet,gain)
-- if pet dies (or you Release it), go back to the correct non-perp idle set
if gain == false then
oldperpinfo = '' -- reset oldperpinfo, we want the new one to show always
choose_set()
end
end
function equip_bp(spell)
-- For reducing BP delay, since in precast it doesn't seem to do shit
equip(sets.bpdelay)
-- Figure out which set to use for the BP
local bpequip = ''
local bptype = get_bp_type(spell)
if bptype == 'RagePhys' then
bpequip = 'midcast.bpragephys'
if spell.name:contains('Claw')
then bpequip = 'midcast.bprageclaws'
elseif spell.name:contains('Eclipse Bite') or spell.name:contains('Fang')
then bpequip = 'midcast.bpragewolf'
end
elseif bptype == 'RageMag' then
bpequip = 'midcast.bpragemag'
if spell.name:contains('Heavenly Strike') or spell.name:contains('Diamond Dust') or spell.name:contains('Blizzard')
then bpequip = 'midcast.bpragestrike'
end
elseif bptype == 'WardDebuff' then
bpequip = 'midcast.bpwarddebuff'
elseif bptype == 'WardBuff' then
bpequip = 'midcast.bpwardbuff'
end
-- Delayed equip to let BPdelay- gear work properly
send_command('wait 1;input //gs equip ' .. bpequip)
-- Skip aftercast while waiting for BP execution
bp_waiting_for_execution = true
end
function equip_heal(spell)
-- Cures
if spell.name:contains('Cure')
or spell.name:contains('Cura') then
equip(sets.healing_magic)
-- Matching day
if spell.element == world.day_element then
addedmagicinfo = "on matching day"
equip(sets.matching_dayweather) -- obi
-- Matching day and weather
if spell.element == world.weather_element then
addedmagicinfo = "on matching day and weather"
end
-- Matching weather
elseif spell.element == world.weather_element then
addedmagicinfo = "in matching weather"
equip(sets.matching_dayweather) -- obi
end
-- Other spells
else
equip(sets.fastcasthaste)
end
end
function equip_enfeebling(spell)
-- if you're enfeebling on SMN, I take it you mean Dia so no potency gear here
equip(sets.fastcasthaste)
end
function equip_enhancing(spell)
-- Stoneskin
if spell.name == 'Stoneskin' then
equip(sets.enhancing_magic.stoneskin)
-- Barspells/enspells/phalanx
elseif spell.name:contains('Bar')
or spell.name:startswith('En')
or spell.name:contains('Phalanx') then
equip(sets.enhancing_magic)
-- Other spells
else
equip(sets.fastcasthaste)
end
end
-- Equips the right perp set
function equip_perp(name)
local write_info = display_perp_set
local addedperpinfo = ''
local pava = ''
local pday = ''
local pweather = ''
local pengaged = ''
-- Start with your regular, idle pet perp set
equip(sets.perp)
pengaged = "idle"
-- Player is meleeing
if player.status == "Engaged" then
equip(sets.perp.melee)
pengaged = "idle/melee"
end
-- Garuda (before weather since weather head is better than Garuda's piece)
if name == 'Garuda' then
equip(sets.perp.garuda)
pava = ', Garuda'
end
-- Carbuncle (has no day/weather check since it's free)
if name == 'Carbuncle' then
equip(sets.perp.carbuncle)
pava = ', Carbuncle'
end
-- Spirits (has no day/weather check since it's free)
if pet.name:contains('Spirit') then
equip(sets.perp.spirit)
pava = ', Spirit'
end
-- check day
if (name == 'Ifrit' and world.day_element == 'Fire')
or (name == 'Shiva' and world.day_element == 'Ice')
or (name == 'Garuda' and world.day_element == 'Wind')
or (name == 'Titan' and world.day_element == 'Earth')
or (name == 'Ramuh' and world.day_element == 'Lightning')
or (name == 'Leviathan' and world.day_element == 'Water')
or ((name == 'Diabolos' or name == 'Fenrir') and world.day_element == 'Dark') then
equip(sets.perp.day)
pday = ', day'
end
-- check weather
if (name == 'Ifrit' and world.weather_element == 'Fire')
or (name == 'Shiva' and world.weather_element == 'Ice')
or (name == 'Garuda' and world.weather_element == 'Wind')
or (name == 'Titan' and world.weather_element == 'Earth')
or (name == 'Ramuh' and world.weather_element == 'Lightning')
or (name == 'Leviathan' and world.weather_element == 'Water')
or ((name == 'Diabolos' or name == 'Fenrir') and world.weather_element == 'Dark') then
equip(sets.perp.weather)
pweather = ', weather'
end
-- engaged pet
if pet.status == 'Engaged' then
equip(sets.perp.engaged)
pengaged = 'engaged'
-- endurance mode overwrites some engaged stuff to maximize perp cost
if endurance_mode then
equip(sets.perp.endurance)
pengaged = "endurance"
-- Repeat of all the above functions. Engaged < Endurance < day/weather/avatar-specific stuff
if name == 'Garuda' then
equip(sets.perp.garuda)
pava = ', Garuda'
end
if name == 'Carbuncle' then
equip(sets.perp.carbuncle)
pava = ', Carbuncle'
end
if name:contains('Spirit') then
equip(sets.perp.spirit)
pava = ', Spirit'
end
if (name == 'Ifrit' and world.day_element == 'Fire')
or (name == 'Shiva' and world.day_element == 'Ice')
or (name == 'Garuda' and world.day_element == 'Wind')
or (name == 'Titan' and world.day_element == 'Earth')
or (name == 'Ramuh' and world.day_element == 'Lightning')
or (name == 'Leviathan' and world.day_element == 'Water')
or ((name == 'Diabolos' or name == 'Fenrir') and world.day_element == 'Dark') then
equip(sets.perp.day)
pday = ', day'
end
if (name == 'Ifrit' and world.weather_element == 'Fire')
or (name == 'Shiva' and world.weather_element == 'Ice')
or (name == 'Garuda' and world.weather_element == 'Wind')
or (name == 'Titan' and world.weather_element == 'Earth')
or (name == 'Ramuh' and world.weather_element == 'Lightning')
or (name == 'Leviathan' and world.weather_element == 'Water')
or ((name == 'Diabolos' or name == 'Fenrir') and world.weather_element == 'Dark') then
equip(sets.perp.weather)
pweather = ', weather'
end
end
-- Player is meleeing
if player.status == "Engaged" then
equip(sets.perp.engaged.melee)
if endurance_mode then pengaged = "endurance/melee" else pengaged = "engaged/melee" end
end
-- Carbuncle Mitts overwrite Smn. Bracers +1 (engaged) or Nashira Gages (endurance)
if name == 'Carbuncle' then
equip({hands = "Carbuncle Mitts"})
end
end
-- Consolidate perp info string
if pava == ', Garuda' and world.weather_element == 'Wind' then pava = '' end -- weather overwrites Garuda head piece
addedperpinfo = pengaged .. pava .. pday .. pweather
-- Check to see if the new perp info is the same as the old perp info. if so, don't write it again.
if oldperpinfo == addedperpinfo then write_info = false end
oldperpinfo = addedperpinfo
-- Write the info string
if write_info then windower.add_to_chat(160,"[" .. addedperpinfo .. "]") end
end
-- Get BP type
function get_bp_type(spell)
if spell.type == 'BloodPactRage' then
if magicalRagePacts:contains(spell.english) then
return 'RageMag'
elseif physicalRagePacts:contains(spell.english) then
return 'RagePhys'
end
elseif spell.type == 'BloodPactWard' then
if debuffWardPacts:contains(spell.english) then
return 'WardDebuff'
elseif buffWardPacts:contains(spell.english) then
return 'WardBuff'
end
end
end
-- Execute Blood Pacts with general commands
function execute_blood_pact(name)
-- if you don't have a pet
if pet.isvalid == false then
add_to_chat(122,'No avatar currently available.')
return
end
-- if you have a pet, but it's a spirit
if pet.name:contains('Spirit') then
add_to_chat(122,'Cannot use pacts with spirits.')
return
end
-- if the name of the pact doesn't exist in the list
if not pacts[name] then
add_to_chat(122,'Unknown pact type: '..tostring(name))
return
end
-- if the pact exists for that pet
if pacts[name][pet.name] then
-- if it's astral flow and you have astral flow active
if name == 'af' and not buffactive['astral flow'] then
add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
return
end
-- Target is either <me>, <stpc> or <stnpc>. <stpc> for Healing Ruby I/II, <me> for all other buffs/heals, <stnpc> for everything else
if bptargets_stpc:contains(pacts[name][pet.name]) then
send_command('input /pet "'..pacts[name][pet.name]..'" <stpc>')
elseif bptargets_me:contains(pacts[name][pet.name]) then
send_command('input /pet "'..pacts[name][pet.name]..'" <me>')
else
send_command('input /pet "'..pacts[name][pet.name]..'" <stnpc>')
end
else
add_to_chat(122,pet.name..' does not have a pact of type ['..name..'].')
end
end
-- Show information about spells' variable effects to the party (or yourself)
function blood_pact_information_for_party(name)
if name == "Dream Shroud" then
-- https://github.com/DarkstarProject/darkstar/blob/08f7115f028376eb4db577c465fc9cfc89abdeb7/scripts/globals/abilities/pets/dream_shroud.lua
local hour = math.abs(12-math.floor(world.time/60))+1
send_command('input /p - ' .. name .. ': MAB +' .. tostring(hour) .. ', MDB +' .. tostring(14-hour) .. '')
end
if name == "Lunar Cry" then
-- https://github.com/DarkstarProject/darkstar/blob/08f7115f028376eb4db577c465fc9cfc89abdeb7/scripts/globals/abilities/pets/lunar_cry.lua
local moon = 0
if world.moon_pct > 90 then moon = 31
elseif world.moon_pct > 75 then moon = 26
elseif world.moon_pct > 60 then moon = 21
elseif world.moon_pct > 40 then moon = 16
elseif world.moon_pct > 24 then moon = 11
elseif world.moon_pct > 10 then moon = 6
else moon = 1
end
send_command('input /p - ' .. name .. ': Accuracy -' .. tostring(moon) .. ', Evasion -' .. tostring(32-moon) .. '')
end
if name == "Ecliptic Growl" then
-- https://github.com/DarkstarProject/darkstar/blob/08f7115f028376eb4db577c465fc9cfc89abdeb7/scripts/globals/abilities/pets/ecliptic_growl.lua
local moon = 0
if world.moon_pct > 90 then moon = 7
elseif world.moon_pct > 75 then moon = 6
elseif world.moon_pct > 60 then moon = 5
elseif world.moon_pct > 40 then moon = 4
elseif world.moon_pct > 24 then moon = 3
elseif world.moon_pct > 10 then moon = 2
else moon = 1
end
send_command('input /p - ' .. name .. ': STR/DEX/VIT +' .. tostring(moon) .. ', AGI/INT/MND/CHR +' .. tostring(8-moon) .. '')
end
if name == "Ecliptic Howl" then
-- https://github.com/DarkstarProject/darkstar/blob/08f7115f028376eb4db577c465fc9cfc89abdeb7/scripts/globals/abilities/pets/ecliptic_howl.lua
local moon = 0
if world.moon_pct > 90 then moon = 25
elseif world.moon_pct > 75 then moon = 21
elseif world.moon_pct > 60 then moon = 17
elseif world.moon_pct > 40 then moon = 13
elseif world.moon_pct > 24 then moon = 9
elseif world.moon_pct > 10 then moon = 5
else moon = 1
end
send_command('input /p - ' .. name .. ': Accuracy +' .. tostring(moon) .. ', Evasion +' .. tostring(25-moon) .. '')
end
end
-- Release your current spirit and immediately recast it
function respirit()
if pet.isvalid then
if pet.name:contains('Spirit') then
local spirit_to_cast = ''
if pet.name == 'FireSpirit' then spirit_to_cast = 'Fire Spirit' end
if pet.name == 'IceSpirit' then spirit_to_cast = 'Ice Spirit' end
if pet.name == 'AirSpirit' then spirit_to_cast = 'Air Spirit' end
if pet.name == 'EarthSpirit' then spirit_to_cast = 'Earth Spirit' end
if pet.name == 'ThunderSpirit' then spirit_to_cast = 'Thunder Spirit' end
if pet.name == 'WaterSpirit' then spirit_to_cast = 'Water Spirit' end
if pet.name == 'LightSpirit' then spirit_to_cast = 'Light Spirit' end
if pet.name == 'DarkSpirit' then spirit_to_cast = 'Dark Spirit' end
send_command('input /release <me>;wait 0.5;input /ma "' .. spirit_to_cast .. '"')
else
add_to_chat(122,'You do not have a Spirit out.')
end
else
add_to_chat(122,'You do not have a pet out.')
end
end
-- Auto-Siphon
function auto_siphon()
local element_to_use = world.day_element -- usual case
-- if there's weather
if world.weather_element ~= 'None' then
-- if it's double weather, we choose weather element
if (world.weather_id > 4 and world.weather_id %1 == 0) then
element_to_use = world.weather_element
else
-- only use single weather element if it's not weak to the element of the current day
if (world.weather_element == 'Fire' and world.day_element ~= 'Water')
or (world.weather_element == 'Ice' and world.day_element ~= 'Fire')
or (world.weather_element == 'Wind' and world.day_element ~= 'Ice')
or (world.weather_element == 'Earth' and world.day_element ~= 'Wind')
or (world.weather_element == 'Lightning' and world.day_element ~= 'Earth')
or (world.weather_element == 'Water' and world.day_element ~= 'Lightning')
or (world.weather_element == 'Dark' and world.day_element ~= 'Light')
or (world.weather_element == 'Light' and world.day_element ~= 'Dark') then
element_to_use = world.weather_element
else
-- use day element if the current day is strong to the current weather
element_to_use = world.day_element
end
end
else
-- use day element if there's no weather
element_to_use = world.day_element
end
-- check whether the right pet is out
if pet.isvalid == true then
-- if the right spirit is already out, just Siphon (I assume there's a reason it's out, so keep it out)
if pet.name:contains('Spirit') and pet.element == element_to_use then
send_command('input /ja "Elemental Siphon" <me>')
else
-- if the wrong pet is out, release it
send_command('input /pet "Release" <me>')
windower.add_to_chat(122, 'Wrong pet for Siphon: released ' .. pet.name .. '.')
end
else
-- if you don't yet have a pet out, Summon, Siphon and Release
local rest = ' wait 4.5; input /ja "Elemental Siphon" <me>; wait 1.5; input /pet "Release" <me>'
if element_to_use == 'Fire' then send_command('input /ma "Fire Spirit" <me>;' .. rest) end
if element_to_use == 'Ice' then send_command('input /ma "Ice Spirit" <me>;' .. rest) end
if element_to_use == 'Wind' then send_command('input /ma "Air Spirit" <me>;' .. rest) end
if element_to_use == 'Earth' then send_command('input /ma "Earth Spirit" <me>;' .. rest) end
if element_to_use == 'Lightning' then send_command('input /ma "Thunder Spirit" <me>;' .. rest) end
if element_to_use == 'Water' then send_command('input /ma "Water Spirit" <me>;' .. rest) end
if element_to_use == 'Dark' then send_command('input /ma "Dark Spirit" <me>;' .. rest) end
if element_to_use == 'Light' then send_command('input /ma "Light Spirit" <me>;' .. rest) end
end
end
---------------------------------------
-- Pre/mid/aftercast/after_aftercast --
---------------------------------------
-- Before casting/using ability
function precast(spell)
-- Magic
if spell.action_type == 'Magic' then
-- Cancel magic when it is not up yet
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
-- Fast cast for all spells
equip(sets.precastfastcast)
-- Cancel status effects for spells that don't overwrite themselves
if spell.name == "Sneak" then send_command("cancel sneak") end
if spell.name == "Stoneskin" then send_command("wait 4;cancel stoneskin") end
if spell.name == "Reraise" then send_command("cancel reraise") end
if spell.name == "Blink" then send_command("wait 4;cancel blink") end
if spell.name == "Aquaveil" then send_command("wait 4;cancel aquaveil") end
if spell.name == "Ice Spikes" then send_command("cancel ice spikes") end
if spell.name == "Shock Spikes" then send_command("cancel shock spikes") end
if spell.name == "Phalanx" then send_command("cancel phalanx") end
end
-- Abilities
else
-- Cancel sneak when using Spectral Jig
if spell.name == "Spectral Jig" then
send_command("cancel sneak")
-- Siphon
elseif spell.name == 'Elemental Siphon' then
equip(sets.siphon)
-- Weaponskills
elseif spell.type == 'WeaponSkill' then
equip_ws(spell.name)
elseif spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
-- check whether we have to cancel the BP (due to being too far) so we don't change gear unnecessarily
-- we KNOW that <stpc> and <stnpc> have to have a subtarget, so if we have none, it's a <me>
if tostring(player.subtarget.name) ~= 'nil' then
-- if it's a <stnpc> or <stpc>, check whether we're not too far
if player.subtarget.distance > 18 then
add_to_chat(122,'You are too far to use a Blood Pact.')
cancel_spell()
end
end