-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGallionaire.lua
More file actions
1657 lines (1544 loc) · 56 KB
/
Copy pathGallionaire.lua
File metadata and controls
1657 lines (1544 loc) · 56 KB
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
--[[
Copyright © 2025, Staticvoid
All rights reserved.
Redistribution and use in source and binary forms, without
modification, is permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Gallionaire nor the
name of its author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Staticvoid BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**THANKS AND CREDIT TO SETH VAN HEULEN FOR THE NPC DATA
]] --[[
Gallimaufry Tracker addon for Windower 4
Tracks gallimaufry earned in Sortie per instance, record per instance and total held and displays it on screen
with messages and sound effects at gallimaufry thresholds; Tracks and displays Ruspix plate and shiny plate timers. Shows the status of
temp-items within sortie such as shards, metals, fragments and the seal. Opens doors by targetting them (No need to drop invisible) with
an option to toggle auto-open when approaching the doors. Tracks NPCs within Sortie and displays their location. Displays an Absorb-TP readout
when fighting Aminon. Shows "Gallionaire" in blue ordinarily, but displays it in green while in a sortie zone or sortie staging zone and all
6 party members are within 15 yalms, providing an indicator for when it is safe to pull bosses without having to count 6 players.
More to come!
]]
_addon.name = 'Gallionaire'
_addon.author = 'Staticvoid'
_addon.version = '2.5'
_addon.commands = {'Gallionaire', 'ga'}
require('tables')
require('chat')
require('logger')
require('functions')
require('strings')
require('luau')
packets = require('packets')
config = require('config')
res = require('resources')
local texts = require('texts')
bit = require('bit')
require('pack')
local player_name = windower.ffxi.get_info().logged_in and windower.ffxi.get_player().name
local addon_path = windower.addon_path
local screen_w = windower.get_windower_settings().ui_x_res
local screen_h = windower.get_windower_settings().ui_y_res
local interaction_delay = 0
local player_total = 0
local galli_message_id = 39998
local last_update_time = 0
local update_interval = 5
local initial_delay = 60
local refresh_interval = 60
local manual_time_checker = 0
local ruspix_updatinator = os.clock()
local current_character = nil
local frame_count = 0
local npc_status = {}
local defaults = {}
local last = {}
local doors = S{}
local thresholds = {10000, 20000, 30000, 40000, 50000, 60000}
local last_threshold = 0
local zone_in_amount = nil
local last_zone_time = nil
local oh_notifier = {}
local absorb_counts = {}
local flags = {}
local plates = {}
plates.shiny = {}
plates.shiny.timer = nil
plates.shiny.start_time = 153223
plates.shiny.duration = 20 * 60 * 60
plates.shiny.cooldown_seconds = 20 * 60 * 60
plates.ruspix = {}
plates.ruspix.accumulation_rate = 5
plates.ruspix.start_time = 0
plates.ruspix.manually_entered = 0
plates.ruspix.accumulated_time = 0
plates.ruspix.grabbed_ruspix_plate = true
flags.entered_sortie = true
flags.entered_sortie_now = false
flags.zoning = false
flags.in_sortie_zone = false
flags.polling_zone = false
flags.in_leafalia = false
flags.in_silverknife = false
flags.upgraded_weapon = false
-- Display settings
local settings = config.load('data/settings_' .. player_name .. '.xml', {
pos = {
x = screen_w / 5,
y = screen_h / 10000
},
bg = {
alpha = 150,
red = 0,
green = 0,
blue = 40
},
text = {
size = 10,
font = 'Comic Sans MS',
red = 255,
green = 255,
blue = 255,
alpha = 255,
stroke = {
alpha = 255,
red = 15,
green = 15,
blue = 15,
width = 2,
padding = 1
}
},
padding = 1,
gallimaufry_record = 0,
plates = {
shiny = {
start_time = 0,
},
ruspix = {
accumulated_time = 0,
start_time = 0,
},
},
toggle_sound = true,
Auto = true,
Range = 10,
})
local gallimaufry_record = settings.gallimaufry_record
-- UI elements
local display = texts.new('', settings, settings)
local sortie_display = texts.new(config.load{
pos = {
x = math.floor(screen_w / 1.1199),
y = math.floor(screen_h / 5),
},
bg = {
alpha = 125,
red = 0,
green = 0,
blue = 40
},
flags = {
bold = true,
},
text = {
size = 9,
font = 'Comic Sans MS',
red = 190,
green = 210,
blue = 253,
alpha = 255,
stroke = {
alpha = 255,
red = 15,
green = 15,
blue = 15,
width = 3,
padding = 2
}
},
})
local aminon_display = texts.new(config.load('data/absorb_settings.xml', {
pos = {
x = math.floor(screen_w / 8),
y = math.floor(screen_h / 6),
},
bg = {
alpha = 125,
red = 0,
green = 0,
blue = 40
},
text = {size = 12, font = 'Consolas', stroke = {alpha = 255,width = 3,padding = 2
}},
}))
local sound_paths = {
outstanding = addon_path .. 'data/waves/30.wav',
a_minor = addon_path .. 'data/waves/a_minor.wav',
loading = addon_path .. 'data/waves/load.wav',
notify = addon_path .. 'data/waves/notify.wav',
warning = addon_path .. 'data/waves/warning.wav'
}
-- NM and bitzer machinery
------------------------------------------------------------------------
local map_location = {
[0] = {
['(A-1)'] = 'Vamp. rm',
},
[1] = {
['(F-6)'] = 'Gadget #A',
['(F-7)'] = 'Big rm #A boss',
['(G-7)'] = 'Big rm #A boss',
['(H-7)'] = 'NW of Dev. #A',
['(I-7)'] = 'NW of Dev. #A',
['(J-7)'] = 'NW of Dev. #A',
['(K-7)'] = 'NW of Dev. #A',
['(F-8)'] = 'Big rm #A boss',
['(G-8)'] = 'Big rm #A boss',
['(H-8)'] = 'NW of Dev. #A',
['(I-8)'] = 'NW of Dev. #A',
['(J-8)'] = 'NW of Dev. #A',
['(F-9)'] = 'Big rm #A boss',
['(G-9)'] = 'Big rm #A boss',
['(I-9)'] = 'NW of Dev. #A',
['(J-9)'] = 'NW of Dev. #A',
},
[2] = {
['(F-6)'] = 'Big rm NE-N Dev. #A',
['(G-6)'] = 'Big rm NE-N Dev. #A',
['(H-6)'] = 'Big rm NE-N Dev. #A',
['(I-6)'] = 'Big rm NE-N Dev. #A',
['(F-7)'] = 'Big rm NE-N Dev. #A',
['(G-7)'] = 'Big rm NE-N Dev. #A',
['(H-7)'] = 'NE Dev. #A',
['(I-7)'] = 'NE Dev. #A',
['(J-7)'] = 'NE Dev. #A',
['(G-8)'] = 'Small rm NE Dev. #A',
['(H-8)'] = 'NE Dev. #A',
['(I-8)'] = 'NE Dev. #A',
['(J-8)'] = 'NE Dev. #A',
['(F-9)'] = 'Dev. #A',
['(G-9)'] = 'Small rm NE Dev. #A',
['(H-9)'] = 'Small rm NE Dev. #A',
['(F-10)'] = 'Dev. #A',
['(G-10)'] = 'Dev. #A',
['(H-10)'] = 'Dev. #A',
},
[3] = {
['(I-5)'] = 'Big rm #B boss',
['(J-5)'] = 'Big rm #B boss',
['(G-6)'] = 'Big rm #B boss',
['(H-6)'] = 'Big rm #B boss',
['(I-6)'] = 'Big rm #B boss',
['(G-7)'] = 'Big rm #B boss',
['(H-7)'] = 'Big rm #B boss',
['(I-7)'] = 'Big rm #B boss',
['(H-8)'] = 'S #B boss, NE Dev. #B',
['(I-8)'] = 'S #B boss, NE Dev. #B',
['(E-9)'] = 'Med. rm NE Dev. #B',
['(G-9)'] = 'Med. rm NE Dev. #B',
['(H-9)'] = 'S #B boss, NE Dev. #B',
['(I-9)'] = 'S #B boss, NE Dev. #B',
['(E-10)'] = 'Med. rm NE Dev. #B',
['(F-10)'] = 'Med. rm NE Dev. #B',
['(G-10)'] = 'Med. rm NE Dev. #B',
['(H-10)'] = 'Med. rm NE Dev. #B',
['(I-10)'] = 'S #B boss, NE Dev. #B',
},
[4] = {
['(G-5)'] = 'N starting Dev.',
['(H-5)'] = 'N starting Dev.',
['(I-5)'] = 'N starting Dev.',
['(G-6)'] = 'N starting Dev.',
['(H-6)'] = 'N starting Dev.',
['(I-6)'] = 'N starting Dev.',
['(F-7)'] = 'Starting Dev.',
['(G-7)'] = 'Starting Dev.',
['(H-7)'] = 'Starting Dev.',
['(I-7)'] = 'Starting Dev.',
['(F-8)'] = 'Starting Dev.',
['(G-8)'] = 'Starting Dev.',
['(H-8)'] = 'Starting Dev.',
['(I-8)'] = 'Starting Dev.',
['(G-9)'] = 'S starting Dev.',
['(H-9)'] = 'S starting Dev.',
['(G-10)'] = 'S starting Dev.',
['(H-10)'] = 'S starting Dev.',
},
[5] = {
['(I-5)'] = 'Med. rm NW Dev. #A',
['(G-6)'] = 'Med. rm NW Dev. #A',
['(H-6)'] = 'Med. rm NW Dev. #A',
['(I-6)'] = 'Med. rm NW Dev. #A',
['(H-7)'] = 'Med. rm NW Dev. #A',
['(I-7)'] = 'Med. rm NW Dev. #A',
['(F-8)'] = 'Small rm NW Dev. #D',
['(G-8)'] = 'Small rm NW Dev. #D',
['(H-8)'] = 'Small rm NW Dev. #D',
['(F-9)'] = 'Small rm NW Dev. #D',
['(G-9)'] = 'Small rm NW Dev. #D',
['(H-9)'] = 'Dev. #D',
['(G-10)'] = 'Dev. #D',
['(H-10)'] = 'Dev. #D',
},
[6] = {
['(G-6)'] = 'N #C boss, SE Dev. #B',
['(H-6)'] = 'N #C boss, SE Dev. #B',
['(I-6)'] = 'N #C boss, SE Dev. #B',
['(G-7)'] = 'N #C boss, SE Dev. #B',
['(H-7)'] = 'N #C boss, SE Dev. #B',
['(I-7)'] = 'N #C boss, SE Dev. #B',
['(J-7)'] = 'Big rm #C boss',
['(F-8)'] = 'W #C boss, SE Dev. #C',
['(G-8)'] = 'W #C boss, SE Dev. #C',
['(H-8)'] = 'Big rm #C boss',
['(I-8)'] = 'Big rm #C boss',
['(J-8)'] = 'Big rm #C boss',
['(E-9)'] = 'W #C boss, SE Dev. #C',
['(F-9)'] = 'W #C boss, SE Dev. #C',
['(G-9)'] = 'W #C boss, SE Dev. #C',
['(H-9)'] = 'W #C boss, SE Dev. #C',
['(I-9)'] = 'Big rm #C boss',
['(J-9)'] = 'Big rm #C boss',
['(E-10)'] = 'W #C boss, SE Dev. #C',
['(F-10)'] = 'W #C boss, SE Dev. #C',
['(G-10)'] = 'W #C boss, SE Dev. #C',
['(H-10)'] = 'W #C boss, SE Dev. #C',
['(I-10)'] = 'Big rm #C boss',
['(J-10)'] = 'Big rm #C boss',
},
[7] = {
['(G-6)'] = 'Big rm #D boss',
['(H-6)'] = 'Big rm #D boss',
['(G-7)'] = 'Big rm #D boss',
['(H-7)'] = 'Big rm #D boss',
['(I-7)'] = 'Big rm #D boss',
['(G-8)'] = 'Big rm #D boss',
['(H-8)'] = 'Big rm #D boss',
['(I-8)'] = 'Big rm #D boss',
['(G-9)'] = 'Big rm #D boss',
['(H-9)'] = 'Big rm #D boss',
['(I-9)'] = 'Big rm #D boss',
},
[8] = {
['(F-5)'] = 'Med. rm SW Dev. #D',
['(G-5)'] = 'Med. rm SW Dev. #D',
['(F-6)'] = 'Med. rm SW Dev. #D',
['(G-6)'] = 'Med. rm SW Dev. #D',
['(H-6)'] = 'Med. rm SW Dev. #D',
['(F-7)'] = 'Med. rm SW Dev. #D',
['(H-7)'] = 'Small rm SW Dev. #C',
['(I-7)'] = 'Small rm SW Dev. #C',
['(G-8)'] = 'SW Dev. #C',
['(H-8)'] = 'SW Dev. #C',
['(I-8)'] = 'Small rm SW Dev. #C',
['(G-9)'] = 'SW Dev. #C',
['(H-9)'] = 'SW Dev. #C',
['(I-9)'] = 'Big rm SW-S Dev. #C',
['(J-9)'] = 'Big rm SW-S Dev. #C',
['(G-10)'] = 'SW Dev. #C',
['(H-10)'] = 'SW Dev. #C',
['(I-10)'] = 'Big rm SW-S Dev. #C',
['(J-10)'] = 'Big rm SW-S Dev. #C',
},
[9] = {
['(G-6)'] = 'Dev. #B',
['(H-6)'] = 'Dev. #B',
['(F-7)'] = 'Dev. #C',
['(G-7)'] = 'Sm. rm SE Dev. #B',
['(H-7)'] = 'Sm. rm SE Dev. #B',
['(I-7)'] = 'Sm. rm SE Dev. #B',
['(J-7)'] = 'Sm. rm SE Dev. #B',
['(F-8)'] = 'Dev. #C',
['(G-8)'] = 'Med. rm SE Dev. #C',
['(H-8)'] = 'Med. rm SE Dev. #C',
['(I-8)'] = 'Sm. rm SE Dev. #B',
['(F-9)'] = 'Med. rm SE Dev. #C',
['(G-9)'] = 'Med. rm SE Dev. #C',
['(H-9)'] = 'Med. rm SE Dev. #C',
['(F-10)'] = 'Med. rm SE Dev. #C',
['(G-10)'] = 'Med. rm SE Dev. #C',
['(H-10)'] = 'Med. rm SE Dev. #C',
},
[10] = {
['(F-6)'] = 'Gadget #E',
['(G-6)'] = 'Gadget #E',
['(F-7)'] = '#E boss, NW corner',
['(G-7)'] = '#E boss, NE corner',
['(H-7)'] = 'Split-rm, 1st 1/2',
['(I-7)'] = 'Split-rm, 1st 1/2',
['(J-7)'] = 'Starting rm',
['(F-8)'] = '#E boss, SW corner',
['(G-8)'] = '#E boss, SE corner',
['(H-8)'] = 'Split-rm',
['(I-8)'] = 'Split-rm',
['(J-8)'] = 'Starting rm',
['(K-8)'] = 'Starting rm',
['(F-9)'] = 'Big flan rm',
['(G-9)'] = 'Big flan rm',
['(J-9)'] = 'Starting rm',
['(E-10)'] = 'Big flan rm',
['(F-10)'] = 'Big flan rm',
['(G-10)'] = 'Big flan rm',
},
[11] = {
['(F-7)'] = 'Far, NW corner',
['(G-7)'] = 'Far, N hallway',
['(H-7)'] = 'Far, NE corner',
['(F-8)'] = 'Far, SW corner',
['(G-8)'] = 'Far, S hallway',
['(H-8)'] = 'Far, SE corner',
['(I-8)'] = 'Big pixie rm',
['(J-8)'] = 'Big pixie rm',
},
[12] = {
['(F-7)'] = '#F boss, NW corner',
['(G-7)'] = '#F boss, N hallway',
['(H-7)'] = '#F boss, NE corner',
['(I-7)'] = 'Gadget #F',
['(F-8)'] = '#F boss, SW corner',
['(G-8)'] = '#F boss, S hallway',
['(H-8)'] = '#F boss, SE corner',
['(I-8)'] = 'OffPath, N hallway',
['(J-8)'] = 'OffPath, NE corner',
['(F-9)'] = 'Split-rm second half',
['(G-9)'] = 'Split-rm',
['(H-9)'] = 'OffPath, SW corner',
['(I-9)'] = 'OffPath, S hallway',
['(J-9)'] = 'OffPath, SE corner',
},
[13] = {
['(I-6)'] = 'Start rm',
['(H-7)'] = 'Start rm',
['(I-7)'] = 'Start rm',
['(J-7)'] = 'Start rm',
['(F-8)'] = 'OffPath, NW corner',
['(G-8)'] = 'OffPath, NE corner',
['(H-8)'] = 'Split-rm, 1st 1/2',
['(I-8)'] = 'Split-rm',
['(F-9)'] = 'OffPath, W hallway',
['(G-9)'] = 'OffPath, E hallway',
['(H-9)'] = 'Split-rm, 1st 1/2',
['(I-9)'] = 'Split-rm',
['(F-10)'] = 'OffPath, SW corner',
['(G-10)'] = 'OffPath, SE corner',
},
[14] = {
['(I-6)'] = 'Start rm',
['(H-7)'] = 'Start rm',
['(I-7)'] = 'Start rm',
['(J-7)'] = 'Start rm',
['(G-8)'] = 'Start rm',
['(H-8)'] = 'Start rm',
['(I-8)'] = 'Start rm',
['(F-9)'] = 'Start rm',
['(G-9)'] = 'Start rm',
['(H-9)'] = 'Split-rm',
['(I-9)'] = 'Split-rm',
['(J-9)'] = 'Split-rm',
['(G-10)'] = 'Starting rm',
['(H-10)'] = 'Split-rm, 1st 1/2',
['(I-10)'] = 'Split-rm, 1st 1/2',
},
[15] = {
['(F-7)'] = '#H boss, NW corner',
['(G-7)'] = '#H boss, NE corner',
['(F-8)'] = '#H boss, W hallway',
['(G-8)'] = '#H boss, SE corner',
['(H-8)'] = 'Big fomor rm',
['(I-8)'] = 'Big fomor rm',
['(J-8)'] = 'Far, NW corner',
['(K-8)'] = 'Far, NE corner',
['(F-9)'] = '#H boss, SW corner',
['(G-9)'] = '#H boss, SE corner',
['(H-9)'] = 'Big fomor rm',
['(I-9)'] = 'Big fomor rm',
['(J-9)'] = 'Far, SW corner',
['(K-9)'] = 'Far, SE corner',
},
[16] = {
['(G-7)'] = '#G boss, NW corner',
['(H-7)'] = '#G boss, N hallway',
['(I-7)'] = '#G boss, NE corner',
['(G-8)'] = '#G boss, SW corner',
['(H-8)'] = '#G boss, S hallway',
['(I-8)'] = '#G boss, SE corner',
},
}
local tracked_zone = {
[133] = "Outer Ra'Kaznar [U2]",
[189] = "Outer Ra'Kaznar [U3]",
[275] = "Outer Ra'Kaznar [U1]",
}
local tracked_npc = {
[0x0090] = 'Obdella',
[0x00df] = 'Porxie',
[0x011d] = 'Bhoot',
[0x0175] = 'Deleterious',
[0x01ab] = 'Botulus',
[0x01f2] = 'Ixion',
[0x0228] = 'Naraka',
[0x026e] = 'Tulittia',
[0x0345] = 'Bitzer #E',
[0x0346] = 'Bitzer #F',
[0x0347] = 'Bitzer #G',
[0x0348] = 'Bitzer #H',
}
local sectors = {
{name='A',npcs={0x0090}},
{name='B',npcs={0x00df}},
{name='C',npcs={0x011d}},
{name='D',npcs={0x0175}},
{name='E',npcs={0x01ab,0x0345}},
{name='F',npcs={0x01f2,0x0346}},
{name='G',npcs={0x0228,0x0347}},
{name='H',npcs={0x026e,0x0348}},
}
function initialization()
start_up = true
initial_checkthrough = false
previous_gallimaufry = 0
earned_gallimaufry = 0
newly_earned_gallimaufry = 0
coroutine.schedule(induct_data, 0.5)
end
function induct_data()
if not windower.ffxi.get_info().logged_in then
return
end
local packet = packets.new('outgoing', 0x115, {})
packets.inject(packet)
end
initialization()
windower.register_event('incoming chunk', function(id, org, modi, is_injected, is_blocked)
local player = windower.ffxi.get_player()
if is_injected or id ~= 0x118 then
return
end
local current_time = os.clock()
if current_time - last_update_time < update_interval then
return
end
local p = packets.parse('incoming', org)
local new_gallimaufry = p["Gallimaufry"]
if start_up then
previous_gallimaufry = new_gallimaufry
start_up = false
elseif new_gallimaufry ~= previous_gallimaufry then
if player and player.name == current_character then
earned_gallimaufry = earned_gallimaufry + (new_gallimaufry - previous_gallimaufry)
else
earned_gallimaufry = 0
end
previous_gallimaufry = new_gallimaufry
update_display()
end
last_update_time = current_time
end)
windower.register_event('incoming chunk', function(id, data)
if flags.in_sortie_zone then
-- Parse the packet to log relevant information
local packet = packets.parse('incoming', data)
if id == 0x02A and not injected then
--windower.add_to_chat(207,
--string.format('Packet 0x02A - Message ID: %d, Param 1: %d, Param 2: %d', packet['Message ID'],
--packet['Param 1'], packet['Param 2']))
if initial_checkthrough == true and not galli_message_id then
--print("Initial checkthrough data induction")
induct_data()
end
-- Only process if Param 1 and Param 2 exist
if packet['Param 2'] and packet['Param 1'] then
if galli_message_id and packet['Message ID'] == galli_message_id and previous_gallimaufry ~= packet['Param 2'] then
-- Handle potential loss of packets
--print(galli_message_id)
--if packet['Param 2'] - packet['Param 1'] ~= player_total and player_total ~= 0 then
--earned_gallimaufry = earned_gallimaufry + (packet['Param 2'] - player_total)
--print("Debugging message, Packetloss detected; attempting to correct")
--windower.add_to_chat(207, 'Gallimaufry updated with adjustment: ' .. earned_gallimaufry)
--else
--earned_gallimaufry = earned_gallimaufry + packet['Param 1']
--windower.add_to_chat(207, 'Gallimaufry updated: ' .. earned_gallimaufry)
--end
-- Update player total
--player_total = packet['Param 2']
if zone_in_amount then
previous_gallimaufry = packet['Param 2']
earned_gallimaufry = packet['Param 2'] - zone_in_amount
else
zone_in_amount = previous_gallimaufry
previous_gallimaufry = packet['Param 2']
earned_gallimaufry = packet['Param 2'] - zone_in_amount
end
elseif galli_message_id and packet['Message ID'] ~= galli_message_id and packet['Param 2'] == previous_gallimaufry + packet['Param 1'] then
-- This should indicate SE has added something to the currency 2 menu and we'll need to grab the new Message ID dynamically until this addon receives an update.
--print("Packet Message ID updated Dynamically")
galli_message_id = packet['Message ID']
elseif not galli_message_id then
if packet['Param 2'] == previous_gallimaufry + packet['Param 1'] then
galli_message_id = packet['Message ID'] -- Store the dynamic message ID
--windower.add_to_chat(207, 'Galli message ID dynamically updated to: ' .. galli_message_id)
else
initial_checkthrough = true
end
end
update_display()
end
end
elseif flags.in_silverknife then
if id == 0x034 then
flags.upgraded_weapon = true
--induct_data()
end
end
---------------------------------------------------------------------------
end)
windower.register_event('incoming chunk', function(id, original)
if not tracked_zone[windower.ffxi.get_info().zone] then return end
if id == 0x00E then
local index = original:unpack('H', 9)
if not tracked_npc[index] then return end
local mask = original:byte(11)
if bit.band(mask, 1) == 1 then
local x, z, y = original:unpack('fff', 13)
npc_status[index] = npc_status[index] or {}
npc_status[index].map = windower.ffxi.get_map_data(x, y, z)
npc_status[index].position = windower.ffxi.get_position(x, y, z)
end
if bit.band(mask, 4) == 4 then
npc_status[index] = npc_status[index] or {}
npc_status[index].hidden = bit.band(original:byte(33), 6) ~=0
npc_status[index].dead = original:byte(32) > 1
end
update_sortie_display()
if npc_status[index] and npc_status[index].wait_ping then
npc_status[index].wait_ping = nil
return true
end
end
if id == 0x065 then
next_refresh = 0
end
end)
function display_message(earned_gallimaufry)
if earned_gallimaufry >= 78000 and last_threshold < 78000 then
windower.add_to_chat(207, "Aminon: Outstanding!")
last_threshold = 78000
aminon_display:hide()
if toggle_sound then
windower.play_sound(sound_paths.outstanding)
end
elseif earned_gallimaufry >= 48000 and last_threshold < 48000 then
windower.add_to_chat(207, "Aminon: Impressive!")
last_threshold = 48000
if toggle_sound then
windower.play_sound(sound_paths.a_minor)
end
elseif earned_gallimaufry >= 40000 and last_threshold < 40000 then
windower.add_to_chat(200, "40,000 gallimaufry.")
last_threshold = 40000
elseif earned_gallimaufry >= 30000 and last_threshold < 30000 then
windower.add_to_chat(200, "30,000 gallimaufry.")
last_threshold = 30000
elseif earned_gallimaufry >= 20000 and last_threshold < 20000 then
windower.add_to_chat(200, "20,000 gallimaufry.")
last_threshold = 20000
elseif earned_gallimaufry >= 10000 and last_threshold < 10000 then
windower.add_to_chat(200, "10,000 gallimaufry")
last_threshold = 10000
end
end
update_doors = function()
local mobs = windower.ffxi.get_mob_array()
doors:clear()
for index, mob in pairs(mobs) do
if mob.spawn_type == 34 and mob.distance < 2500 then
doors:add(index)
end
end
end:cond(function()
return settings.Auto
end)
update_doors()
exceptions = S{
17097337,
}
check_door = function(door)
return door
and door.spawn_type == 34
and door.distance < settings.Range^2
and (not last[door.index] or os.time() - last[door.index] > 7)
and door.name:byte() ~= 95
and door.name ~= 'Furniture'
and not exceptions:contains(door.id)
and door.status == 9
end
-- Function to interpolate between colors
local function interpolate_color(start_color, end_color, fraction)
local red = start_color.red + (end_color.red - start_color.red) * fraction
local green = start_color.green + (end_color.green - start_color.green) * fraction
local blue = start_color.blue + (end_color.blue - start_color.blue) * fraction
return {
red = red,
green = green,
blue = blue
}
end
-- Function to determine the interpolated color based on gallimaufry count
local function determine_color(gallimaufry)
local thresholds = {
{
value = 0,
color = {
red = 255,
green = 0,
blue = 0
}
}, -- Red
{
value = 20000,
color = {
red = 225,
green = 165,
blue = 0
}
}, -- Orange
{
value = 30000,
color = {
red = 255,
green = 255,
blue = 0
}
}, -- Yellow
{
value = 40000,
color = {
red = 0,
green = 255,
blue = 0
}
}, -- Green
{
value = 50000,
color = {
red = 0,
green = 0,
blue = 255
}
}, -- Blue
{
value = 60000,
color = {
red = 140,
green = 0,
blue = 140
}
} -- Purple
}
for i = 1, #thresholds - 1 do
local current = thresholds[i]
local next = thresholds[i + 1]
if gallimaufry >= current.value and gallimaufry < next.value then
local fraction = (gallimaufry - current.value) / (next.value - current.value)
return interpolate_color(current.color, next.color, fraction)
end
end
-- If gallimaufry goes further we maintain the last color (purple)
return thresholds[#thresholds].color
end
function format_with_commas(amount)
local formatted = tostring(amount):reverse():gsub("(%d%d%d)", "%1,"):reverse()
return formatted:sub(1, 1) == "," and formatted:sub(2) or formatted
end
local shard_metal_ids = {
A = {
shard = 9906,
metal = 9918
},
B = {
shard = 9907,
metal = 9919
},
C = {
shard = 9908,
metal = 9920
},
D = {
shard = 9909,
metal = 9921
},
E = {
shard = 9910,
metal = 9922
},
F = {
shard = 9911,
metal = 9923
},
G = {
shard = 9912,
metal = 9924
},
H = {
shard = 9913,
metal = 9925
}
}
function has_ruspix_plate()
local key_items = windower.ffxi.get_key_items()
for _, ki in ipairs(key_items) do
if ki == 3300 then
return true
end
end
return false
end
local function has_item(item_id)
local temp_items = windower.ffxi.get_items(3)
for _, item in ipairs(temp_items) do
if item.id == item_id then
return true
end
end
return false
end
-- Function to generate the display string for the shards and metals
local function get_sector_display()
local display_str = ""
local displayed_keys = {"A", "B", "C", "D", "E", "F", "G", "H"}
for _, sector in ipairs(displayed_keys) do
local ids = shard_metal_ids[sector]
local shard_color = has_item(ids.shard) and "\\cs(0,255,0)√\\cr" or " "
local metal_color = has_item(ids.metal) and "\\cs(0,255,0)√\\cr" or " "
display_str = display_str .. sector .. ":" .. shard_color .. "," .. metal_color .. "|"
end
return display_str
end
local function start_shinyplate_timer()
plates.shiny.start_time = os.time() -- Get the current real-world time
plates.shiny.timer = plates.shiny.duration - (os.time() - plates.shiny.start_time)
plates.ruspix.start_time = (plates.shiny.start_time) + (plates.shiny.duration) -- Start Ruspix accumulation after 20 hours
settings.plates.ruspix.start_time = plates.ruspix.start_time
settings.plates.shiny.start_time = plates.shiny.start_time -- Save the start time to settings.xml
settings:save()
end
local function load_timer_from_settings()
if not settings then
log('Settings table is nil. Retrying...')
coroutine.sleep(1) -- Retry delay
return load_timer_from_settings()
end
if settings.plates.shiny.start_time then
plates.shiny.start_time = settings.plates.shiny.start_time
else
coroutine.sleep(1) -- Small delay to retry loading
log('No shinyplayte_start_time found in settings.xml for '..player_name)
plates.shiny.start_time = settings.plates.shiny.start_time
end
plates.ruspix.start_time = settings.plates.ruspix.start_time
plates.ruspix.accumulated_time = settings.plates.ruspix.accumulated_time
coroutine.sleep(0.4)
update_display()
plates.shiny.timer = plates.shiny.duration - (os.time() - plates.shiny.start_time)
end
local function save_ruspix_data()
if plates.ruspix.accumulated_time ~= settings.plates.ruspix.accumulated_time then
settings.plates.ruspix.accumulated_time = plates.ruspix.accumulated_time
settings.plates.ruspix.start_time = os.time()
settings:save()
--settings:save()
end
end
-- Check to see if the bard's recast on 1hrs is low enough or the cor has used cutting cards.
local function one_hour_checker()
local player = windower.ffxi.get_player()
if player.main_job ~= 'COR' and player.main_job ~= 'BRD' then return end
local abil_recasts = windower.ffxi.get_ability_recasts()[254] / 60
if player.main_job == 'COR' then
if abil_recasts == 0 then
log("Cut the bard...")
coroutine.sleep(1)
log("Cut the bard...")
if toggle_sound then windower.play_sound(sound_paths.notify) end
end
elseif player.main_job == 'BRD' then
if abil_recasts > 0 then
if abil_recasts > 33.75 then
log("Ask for cutting cards...")
coroutine.sleep(1)
log("Ask for cutting cards...")
if toggle_sound then windower.play_sound(sound_paths.notify) end
elseif oh_notifier.five and abil_recasts > 23 then
log("Ask for cutting cards...")
coroutine.sleep(1)
log("Ask for cutting cards...")
if toggle_sound then windower.play_sound(sound_paths.notify) end
elseif oh_notifier.six and abil_recasts > 17 then
log("Ask for cutting cards...")
coroutine.sleep(1)
log("Ask for cutting cards...")
if toggle_sound then windower.play_sound(sound_paths.notify) end
end
end
end
end
local function vicinity_reader()
local party = windower.ffxi.get_party()
if not party then return false end
local count = 0
for i = 0, 5 do
local member = party['p' .. i]
if member and member.mob then
local mob = member.mob
if mob.valid_target and math.sqrt(mob.distance) < 15 then
count = count + 1
if count >= 6 then
return true
end
end
end
end
return false
end
local function get_gallionaire_logo()
local primary_color
local highlight_color
if flags.polling_zone and not flags.zoning then
if not vicinity_reader() then
primary_color = {red = 0, green = 0, blue = 255}
highlight_color = {red = 0, green = 0, blue = 255}
else
primary_color = {red = 187, green = 255, blue = 0}
highlight_color = {red = 187, green = 255, blue = 0}
end
else
primary_color = {red = 0, green = 0, blue = 255}
highlight_color = {red = 0, green = 0, blue = 255}
end
local logo_str = string.format(
'\\cs(%d,%d,%d)Galli\\cr\\cs(%d,%d,%d)onaire\\cr',
highlight_color.red, highlight_color.green, highlight_color.blue,
primary_color.red, primary_color.green, primary_color.blue
)
return logo_str
end
-- Get a count on sapphires and starstones while in Leafallia to cue a gallimaufry check when reforging gear.
function count_rakaznar_gems()