forked from quisquous/cactbot
-
Notifications
You must be signed in to change notification settings - Fork 36
/
ultima_weapon_ultimate.ts
2002 lines (1933 loc) · 78.3 KB
/
ultima_weapon_ultimate.ts
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
import Conditions from '../../../../../resources/conditions';
import Outputs from '../../../../../resources/outputs';
import { callOverlayHandler } from '../../../../../resources/overlay_plugin_api';
import { Responses } from '../../../../../resources/responses';
import { NamedConfigEntry } from '../../../../../resources/user_config';
import Util, { DirectionOutputCardinal, Directions } from '../../../../../resources/util';
import ZoneId from '../../../../../resources/zone_id';
import { RaidbossData } from '../../../../../types/data';
import { PluginCombatantState } from '../../../../../types/event';
import { NetMatches } from '../../../../../types/net_matches';
import { TriggerSet } from '../../../../../types/trigger';
// Note: without extra network data that is not exposed, it seems impossible to know where Titan
// looks briefly before jumping for Geocrush. A getCombatants trigger on NameToggle 00 was
// extremely inaccurate and so that is likely too late to know.
const centerX = 100;
const centerY = 100;
type BossKey = 'garuda' | 'ifrit' | 'titan' | 'ultima';
export interface Data extends RaidbossData {
readonly triggerSetConfig: {
gaolOrder1: string;
gaolOrder2: string;
gaolOrder3: string;
gaolOrder4: string;
gaolOrder5: string;
gaolOrder6: string;
gaolOrder7: string;
gaolOrder8: string;
gaolOrder9: string;
gaolOrder10: string;
gaolOrder11: string;
gaolOrder12: string;
gaolOrder13: string;
gaolOrder14: string;
gaolOrder15: string;
gaolOrder16: string;
gaolOrder17: string;
gaolOrder18: string;
gaolOrder19: string;
gaolOrder20: string;
};
combatantData: PluginCombatantState[];
phase:
| 'garuda'
| 'ifrit'
| 'titan'
| 'intermission'
| 'predation'
| 'annihilation'
| 'suppression'
| 'finale';
bossId: { [name in BossKey]?: string };
garudaAwoken: boolean;
ifritAwoken: boolean;
thermalLow: { [name: string]: number };
beyondLimits: Set<string>;
slipstreamCount: number;
nailAdds: NetMatches['AddedCombatant'][];
nailDeaths: { [name: string]: NetMatches['Ability'] };
nailDeathOrder: string[];
nailDeathFirst8Dir?: number;
nailDeathLast8Dir?: number;
nailDeathRotationDir?: 'cw' | 'ccw';
ifritUntargetableCount: number;
titanGaols: string[];
seenTitanGaols?: boolean;
titanBury: NetMatches['AddedCombatant'][];
ifritRadiantPlumeLocations: DirectionOutputCardinal[];
possibleIfritIDs: string[];
}
type GaolKey = Extract<keyof Data['triggerSetConfig'], string>;
const gaolConfig = (id: GaolKey): NamedConfigEntry<GaolKey> => {
// Since these are all explicit string types, get the number from the string.
const numStr = id.replace('gaolOrder', '');
return {
id: id,
name: {
en: `Titan Gaol Order ${numStr}`,
de: `Titan Gefängnis Reihenfolge ${numStr}`,
fr: `Ordre geôle de Titan ${numStr}`,
cn: `泰坦石牢顺序 ${numStr}`,
ko: `돌감옥 순서 ${numStr}`,
},
type: 'string',
default: '',
};
};
// Ultima Weapon Ultimate
const triggerSet: TriggerSet<Data> = {
id: 'TheWeaponsRefrainUltimate',
zoneId: ZoneId.TheWeaponsRefrainUltimate,
config: [
// Yes yes, a textarea would be nice here to put everything on separate lines,
// but OverlayPlugin does not seem to support delivering the enter key and
// so there's no way to have one box with names on separate lines. Sorry!
/* eslint-disable max-len */
{
...gaolConfig('gaolOrder1'),
comment: {
en:
'Each entry can be the three letter job (e.g. "war" or "SGE") or the full name (e.g. "Tini Poutini"), all case insensitive. Smaller numbers will be listed first in the gaol order. Duplicate jobs will sort players alphabetically. Anybody not listed will be added to the end alphabetically. Blank entries are ignored. If players are listed multiple times by name or job, the lower number will be considered.',
de:
'Jeder Eintrag kann aus drei Buchstaben des Jobs bestehen (z. B. "war" oder "SGE") oder aus dem vollständigen Namen (z. B. "Tini Poutini"), wobei Groß- und Kleinschreibung nicht berücksichtigt werden. Kleinere Nummern werden in der Reihenfolge der Gefängnisse zuerst aufgeführt. Bei doppelten Aufträgen werden die Spieler alphabetisch sortiert. Jeder nicht aufgeführte Spieler wird am Ende alphabetisch eingeordnet. Leere Einträge werden ignoriert. Wenn Spieler mehrfach nach Namen oder Beruf aufgelistet sind, wird die niedrigere Nummer berücksichtigt.',
fr:
'Chaque entrée peut être désigné par les jobs en trois lettres (par exemple "war" ou "SGE") ou le nom complet (par exemple "Tini Poutini"), sans tenir compte des majuscules et minuscules. Les plus petits numéros seront classés en premier dans l\'ordre des geôles. Les doublons seront classés par ordre alphabétique. Toute personne ne figurant pas sur la liste sera ajoutée à la fin par ordre alphabétique. Les entrées vides sont ignorées. Si des joueurs sont listés plusieurs fois par nom ou par fonction, le numéro le plus bas sera pris en compte.',
cn:
'每个条目可以是三个字母的职业缩写 (例如 "war" 或 "SGE") 或玩家全名(例如 "Tini Poutini"),所有字母不区分大小写。编号较小的将在石牢顺序中排列在前。重复的职业将按姓名字母顺序对玩家进行排序。未列出的队员将按字母顺序添加到末尾。空白条目将被忽略。如果玩家按姓名或职业被多次列出,则以较小编号为准。',
ko:
'각 항목에는 대소문자를 구분하지 않는 세 글자 직업명(예: "war" 또는 "SGE") 또는 전체 이름(예: "빛의전사")을 입력할 수 있습니다. 먼저 입력된 항목이 감옥 순서에서 먼저 나열됩니다. 직업이 중복된 경우에는 알파벳 순(가나다 순)으로 나타납니다. 목록에 없는 사람은 알파벳 순으로 맨 끝에 추가됩니다. 빈 칸은 무시됩니다. 플레이어가 이름 또는 직업별로 여러 번 나열된 경우, 먼저 입력된 항목이 사용됩니다.',
},
},
gaolConfig('gaolOrder2'),
gaolConfig('gaolOrder3'),
gaolConfig('gaolOrder4'),
gaolConfig('gaolOrder5'),
gaolConfig('gaolOrder6'),
gaolConfig('gaolOrder7'),
gaolConfig('gaolOrder8'),
gaolConfig('gaolOrder9'),
gaolConfig('gaolOrder10'),
gaolConfig('gaolOrder11'),
gaolConfig('gaolOrder12'),
gaolConfig('gaolOrder13'),
gaolConfig('gaolOrder14'),
gaolConfig('gaolOrder15'),
gaolConfig('gaolOrder16'),
gaolConfig('gaolOrder17'),
gaolConfig('gaolOrder18'),
gaolConfig('gaolOrder19'),
gaolConfig('gaolOrder20'),
/* eslint-enable max-len */
],
timelineFile: 'ultima_weapon_ultimate.txt',
initData: () => {
return {
combatantData: [],
phase: 'garuda',
bossId: {},
garudaAwoken: false,
ifritAwoken: false,
thermalLow: {},
beyondLimits: new Set<string>(),
slipstreamCount: 0,
nailAdds: [],
nailDeaths: {},
nailDeathOrder: [],
ifritUntargetableCount: 0,
titanGaols: [],
titanBury: [],
ifritRadiantPlumeLocations: [],
possibleIfritIDs: [],
};
},
timelineTriggers: [
{
id: 'UWU Diffractive Laser',
regex: /Diffractive Laser/,
beforeSeconds: 5,
suppressSeconds: 3,
response: Responses.tankCleave(),
},
{
id: 'UWU Feather Rain',
regex: /Feather Rain/,
beforeSeconds: 3,
suppressSeconds: 3,
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
en: 'Move!',
de: 'Bewegen',
fr: 'Bougez !',
ja: 'フェザーレイン',
cn: '躲羽毛',
ko: '이동',
},
},
},
{
id: 'UWU Eruption',
regex: /Eruption 1/,
beforeSeconds: 10,
condition: (data) => data.phase !== 'suppression',
alertText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
en: 'Eruption Baits',
de: 'Köder Eruption',
fr: 'Attirez les éruptions',
cn: '诱导地火',
ko: '용암 분출 유도',
},
},
},
],
triggers: [
// --------- Phases & Buff Tracking ----------
{
id: 'UWU Phase Tracker',
type: 'Ability',
// 2B53 = Slipstream
// 2B5F = Crimson Cyclone
// 2CFD = Geocrush
// 2CF5 = Intermission
// 2B87 = Tank Purge
// 2D4C = Ultimate Annihilation
// 2D4D = Ultimate Suppression
netRegex: { id: ['2B53', '2B5F', '2CFD', '2CF5', '2B87', '2D4C', '2D4D'] },
run: (data, matches) => {
if (data.phase === 'garuda' && matches.id === '2B53') {
data.bossId.garuda = matches.sourceId;
} else if (data.phase === 'garuda' && matches.id === '2B5F') {
data.phase = 'ifrit';
data.bossId.ifrit = matches.sourceId;
} else if (data.phase === 'ifrit' && matches.id === '2CFD') {
data.phase = 'titan';
data.bossId.titan = matches.sourceId;
} else if (data.phase === 'titan' && matches.id === '2CF5') {
data.phase = 'intermission';
} else if (data.phase === 'intermission' && matches.id === '2B87') {
data.phase = 'predation';
data.bossId.ultima = matches.sourceId;
} else if (matches.id === '2D4C') {
data.phase = 'annihilation';
} else if (matches.id === '2D4D') {
data.phase = 'suppression';
}
},
},
{
// Wait after suppression for primal triggers at the end.
id: 'UWU Phase Tracker Finale',
type: 'Ability',
netRegex: { source: 'The Ultima Weapon', id: '2D4D', capture: false },
delaySeconds: 74,
run: (data) => data.phase = 'finale',
},
{
id: 'UWU Garuda Woken',
type: 'GainsEffect',
netRegex: { target: 'Garuda', effectId: '5F9', capture: false },
sound: 'Long',
run: (data) => data.garudaAwoken = true,
},
{
id: 'UWU Ifrit Woken',
type: 'GainsEffect',
netRegex: { target: 'Ifrit', effectId: '5F9', capture: false },
sound: 'Long',
run: (data) => data.ifritAwoken = true,
},
{
id: 'UWU Titan Woken',
type: 'GainsEffect',
netRegex: { target: 'Titan', effectId: '5F9', capture: false },
sound: 'Long',
},
{
id: 'UWU Thermal Low Gain',
type: 'GainsEffect',
netRegex: { effectId: '5F5' },
run: (data, matches) => data.thermalLow[matches.target] = parseInt(matches.count),
},
{
id: 'UWU Thermal Low Lose',
type: 'LosesEffect',
netRegex: { effectId: '5F5' },
run: (data, matches) => data.thermalLow[matches.target] = 0,
},
{
id: 'UWU Beyond Limits Gain',
type: 'GainsEffect',
netRegex: { effectId: '5FA' },
run: (data, matches) => data.beyondLimits.add(matches.target),
},
{
id: 'UWU Beyond Limits Lose',
type: 'LosesEffect',
netRegex: { effectId: '5FA' },
run: (data, matches) => data.beyondLimits.delete(matches.target),
},
// --------- Garuda ----------
{
id: 'UWU Garuda Slipstream',
type: 'StartsUsing',
netRegex: { id: '2B53', source: 'Garuda', capture: false },
response: Responses.getBehind(),
run: (data) => data.slipstreamCount++,
},
{
id: 'UWU Garuda Downburst',
// This always comes after a Slipstream so use that to trigger.
// There is no castbar and the ability ids are the same.
type: 'Ability',
netRegex: { id: '2B53', source: 'Garuda', capture: false },
delaySeconds: (data) => data.slipstreamCount === 4 ? 10 : 0,
suppressSeconds: 3,
response: (data, _matches, output) => {
// cactbot-builtin-response
output.responseOutputStrings = {
// TODO: we could track who Garuda is tanking here and say "on you" or "stack on"
tankCleave: Outputs.tankCleave,
partyStack: Outputs.stackMarker,
tankCleavePartyOut: {
en: 'Tank Cleave (PARTY OUT)',
de: 'Tank Cleave (GRUPPE RAUS)',
fr: 'Tank cleave (Groupe à l\'extérieur)',
cn: '坦克顺劈 (人群出)',
ko: '광역 탱버 (본대 밖으로)',
},
};
if (data.slipstreamCount === 1 || data.slipstreamCount > 4)
return;
// You need to have awoken Garuda by this point to beat the fight, but if you haven't
// and are just progging it's easy to forget that this is not a party share.
// This is also mostly skipped these days.
if (!data.garudaAwoken && data.slipstreamCount === 4)
return { alarmText: output.tankCleavePartyOut!() };
if (data.garudaAwoken)
return { alertText: output.partyStack!() };
return { infoText: output.tankCleave!() };
},
},
{
id: 'UWU Garuda Mistral Song Marker',
type: 'HeadMarker',
netRegex: { id: '0010' },
condition: Conditions.targetIsYou(),
alertText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
en: 'Mistral on YOU',
de: 'Mistral-Song',
fr: 'Mistral sur VOUS',
ja: 'ミストラルソング',
cn: '寒风之歌点名',
ko: '삭풍 징',
},
},
},
{
id: 'UWU Garuda Mistral Song Tank',
type: 'HeadMarker',
netRegex: { id: '0010', capture: false },
condition: (data) => data.role === 'tank',
suppressSeconds: 5,
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
en: 'Block Mistral Song',
de: 'Mistral-Song',
fr: 'Chant du mistral',
ja: 'ミストラルソング',
cn: '寒风之歌',
ko: '삭풍 징',
},
},
},
{
id: 'UWU Garuda Spiny Plume',
type: 'AddedCombatant',
netRegex: { name: 'Spiny Plume', capture: false },
condition: (data) => data.role === 'tank',
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
en: 'Spiny Plume Add',
de: 'Dorniger Federsturm',
fr: 'Add Plume perforante',
ja: 'スパイニープルーム',
cn: '刺羽出现',
ko: '가시돋힌 깃털 등장',
},
},
},
{
id: 'UWU Garuda Wicked Wheel',
type: 'StartsUsing',
netRegex: { id: '2B4E', source: 'Garuda', capture: false },
condition: (data) => data.phase === 'garuda',
response: (data, _matches, output) => {
// cactbot-builtin-response
output.responseOutputStrings = {
unawokenOut: Outputs.out,
awokenOutThenIn: Outputs.outThenIn,
};
if (data.garudaAwoken)
return { alertText: output.awokenOutThenIn!() };
return { infoText: output.unawokenOut!() };
},
},
{
id: 'UWU Garuda Aerial Blast',
type: 'StartsUsing',
netRegex: { id: '2B55', source: 'Garuda', capture: false },
condition: (data) => data.phase === 'garuda',
response: Responses.aoe(),
},
{
id: 'UWU Garuda Sisters Location',
comment: {
en:
'Where the two sisters are for the tanks to block. dir1 is always the first sister location starting North and going clockwise',
de:
'Wo sich die beiden Schwestern befinden, die die Tanks blockieren sollen. dir1 ist immer die erste Schwester, die im Norden beginnt und im Uhrzeigersinn verläuft.',
fr:
'L\'emplacement des deux sœurs à bloquer pour les tanks. dir1 est toujours le premier emplacement de la sœur en commençant par le nord et en allant dans le sens des aiguilles d\'une montre.',
cn: '两分身待坦克阻挡的位置。dir1 始终是从上 (北) 开始顺时针方向的第一个分身位置',
ko: '탱커가 막을 두 분신의 위치. dir1은 북쪽에서 시계방향으로 도는 것을 기준으로 항상 첫 번째 분신의 위치입니다',
},
type: 'StartsUsing',
netRegex: { id: '2B55', source: 'Garuda', capture: false },
/*
[21:13:53.626] StartsCasting 14:400188D4:Garuda:2B55:Aerial Blast:400188D4:Garuda:2.700:100.00:100.00:0.00:0.00
[21:13:56.607] AOEActionEffect 16:400188D4:Garuda:2B55:Aerial Blast:XXXXXXXX:Tiny Poutini:350003:1F560000:1B:2B558000:0:0:0:0:0:0:0:0:0:0:0:0:22867:25795:10000:10000:::100.33:97.62:0.00:0.01:693098:1664845:34464:10000:::100.00:100.00:0.00:0.00:0000D57F:7:8
[21:14:07.587] 261 105:Change:400188CC:Heading:0.0000:PosX:94.0000:PosY:100.0000:PosZ:0.0000
[21:14:07.587] 261 105:Change:400188CB:Heading:0.0000:PosX:106.0000:PosY:100.0000:PosZ:0.0000
[21:14:11.772] StartsCasting 14:400188C6:Garuda:2B4D:Feather Rain:E0000000::0.700:101.06:101.93:0.00:0.00
[21:14:11.772] StartsCasting 14:400188C7:Garuda:2B4D:Feather Rain:E0000000::0.700:101.30:101.74:0.00:0.00
[21:14:11.772] StartsCasting 14:400188C8:Garuda:2B4D:Feather Rain:E0000000::0.700:100.79:102.21:0.00:0.00
[21:14:11.772] StartsCasting 14:400188C9:Garuda:2B4D:Feather Rain:E0000000::0.700:100.50:101.45:0.00:0.00
[21:14:11.772] StartsCasting 14:400188CA:Garuda:2B4D:Feather Rain:E0000000::0.700:100.80:102.30:0.00:0.00
[21:14:11.969] 261 105:Change:400188CB:Heading:0.0000:ModelStatus:16384:PosX:100.0000:PosY:80.5000:PosZ:0.0000
[21:14:11.969] 261 105:Change:400188CC:Heading:3.1416:ModelStatus:16384:PosX:100.0000:PosY:119.5000:PosZ:0.0000
[21:14:14.448] TargetIcon 1B:XXXXXXXX:Tiny Poutini:0000:0000:0010:0000:0000:0000
*/
condition: (data) => data.phase === 'garuda',
delaySeconds: 19,
promise: async (data) => {
data.combatantData = [];
// TODO: it'd be nice if this function allowed filtering by name ids.
data.combatantData = (await callOverlayHandler({
call: 'getCombatants',
})).combatants;
},
alertText: (data, _matches, output) => {
// These two sisters are added before the pull starts,
// but they are the only two with these names.
// 1645 = Suparna
// 1646 = Chirada
const sisters = data.combatantData.filter((x) =>
x.BNpcNameID === 1645 || x.BNpcNameID === 1646
);
const [dir1, dir2] = sisters.map((c) =>
Directions.xyTo4DirNum(c.PosX, c.PosY, centerX, centerY)
).sort();
if (dir1 === undefined || dir2 === undefined || sisters.length !== 2)
return;
const map: { [dir: number]: string } = {
0: output.dirN!(),
1: output.dirE!(),
2: output.dirS!(),
3: output.dirW!(),
} as const;
return output.text!({ dir1: map[dir1], dir2: map[dir2] });
},
outputStrings: {
text: {
en: 'Sisters: ${dir1} / ${dir2}',
de: 'Schwestern: ${dir1} / ${dir2}',
fr: 'Sœurs : ${dir1} / ${dir2}',
cn: '分身:${dir1} / ${dir2}',
ko: '분신: ${dir1} / ${dir2}',
},
// TODO: the lint fails if you `...Directions.outputStringsCardinalDir` :C
dirN: Outputs.dirN,
dirE: Outputs.dirE,
dirS: Outputs.dirS,
dirW: Outputs.dirW,
},
},
{
id: 'UWU Ultima Mesohigh Tether',
type: 'Tether',
// This happens in Garuda, as well in Annihilation and Suppression.
netRegex: { id: '0004', capture: false },
suppressSeconds: 30,
response: (data, _matches, output) => {
// cactbot-builtin-response
output.responseOutputStrings = {
// The person with two stacks must get a tether.
garuda2: {
en: 'Get Sister Tether!!!',
de: 'Nimm Verbindung von der Schwester!!!',
fr: 'Prenez le lien de la sœur !!!',
cn: '接分身的线!!!',
ko: '분신 줄 가져가기!!!',
},
// Other people with 1 stack can be informed about it.
garuda1: {
en: 'Sister Tethers',
de: 'Schwester Verbindungen',
fr: 'Lien de la sœur',
cn: '分身连线',
ko: '분신 줄',
},
// Usually static on a ranged.
annihilation1: {
en: 'Tether',
de: 'Verbindungen',
fr: 'Lien',
cn: '连线',
ko: '줄',
},
// Late in the raid, so make sure anybody with a stack remembers this.
suppression1: {
en: 'Tether!!!',
de: 'Verbindungen!!!',
fr: 'Lien !!!',
cn: '连线!!!',
ko: '줄!!!',
},
};
const myStacks = data.thermalLow[data.me];
if (myStacks === undefined || myStacks === 0)
return;
if (myStacks === 2) {
if (data.phase === 'garuda' && !data.garudaAwoken)
return { alarmText: output.garuda2!() };
return;
}
if (data.phase === 'garuda')
return { alertText: output.garuda1!() };
if (data.phase === 'annihilation')
return { infoText: output.annihilation1!() };
if (data.phase === 'suppression')
return { alarmText: output.suppression1!() };
},
},
// --------- Ifrit ----------
{
id: 'UWU Ifrit Possible ID Locator',
type: 'StartsUsing',
netRegex: { id: '2B55', source: 'Garuda', capture: false },
// Run this after the initial Garuda trigger and just piggyback off its call to `getCombatants`
// We're just looking to pluck the four possible IDs from the array pre-emptively to avoid doing
// that filter on every `CombatantMemory` line
delaySeconds: 25,
run: (data) => {
data.possibleIfritIDs = data.combatantData
.filter((c) => c.BNpcNameID === 0x4A1)
.map((c) => c.ID?.toString(16).toUpperCase() ?? '');
},
},
{
id: 'UWU Ifrit Initial Dash Collector',
type: 'CombatantMemory',
// Filter to only enemy actors for performance
netRegex: { id: '4[0-9A-Fa-f]{7}', capture: true },
condition: (data, matches) => {
if (!data.possibleIfritIDs.includes(matches.id))
return false;
const posXVal = parseFloat(matches.pairPosX ?? '0');
const posYVal = parseFloat(matches.pairPosY ?? '0');
if (posXVal === 0 || posYVal === 0)
return false;
// If the Ifrit actor has jumped to exactly 19.5 out on a cardinal, that's our dash spot
if (
Math.abs(posXVal - 100) - 19.5 < Number.EPSILON ||
Math.abs(posYVal - 100) - 19.5 < Number.EPSILON
)
return true;
return false;
},
suppressSeconds: 9999,
infoText: (data, matches, output) => {
const posXVal = parseFloat(matches.pairPosX ?? '0');
const posYVal = parseFloat(matches.pairPosY ?? '0');
let ifritDir: DirectionOutputCardinal = 'unknown';
// Flag both sides that ifrit is dashing through as unsafe, while also tracking where he's actually
// jumped to so we can use it for the infoText
if (posXVal < 95) {
data.ifritRadiantPlumeLocations.push('dirW', 'dirE');
ifritDir = 'dirW';
} else if (posXVal > 105) {
data.ifritRadiantPlumeLocations.push('dirW', 'dirE');
ifritDir = 'dirE';
} else if (posYVal < 95) {
data.ifritRadiantPlumeLocations.push('dirN', 'dirS');
ifritDir = 'dirN';
} else if (posYVal > 105) {
data.ifritRadiantPlumeLocations.push('dirN', 'dirS');
ifritDir = 'dirS';
}
// Remove duplicates
data.ifritRadiantPlumeLocations = data.ifritRadiantPlumeLocations
.filter((pos, index) => data.ifritRadiantPlumeLocations.indexOf(pos) === index);
return output.text!({ dir: output[ifritDir]!() });
},
outputStrings: {
text: {
en: 'Ifrit ${dir}',
de: 'Ifrit ${dir}',
fr: 'Ifrit ${dir}',
cn: '火神 ${dir}',
ko: '이프리트 ${dir}',
},
unknown: Outputs.unknown,
...Directions.outputStringsCardinalDir,
},
},
{
id: 'UWU Ifrit Initial Radiant Plume Collector',
type: 'StartsUsingExtra',
netRegex: { id: '2B61' },
condition: (data, matches) => {
const posXVal = parseFloat(matches.x);
const posYVal = parseFloat(matches.y);
// Possible plume locations:
// 100.009, 106.998
// 100.009, 118.015 = south
// 100.009, 92.990
// 100.009, 82.003 = north
// 106.998, 100.009
// 110.996, 110.996
// 110.996, 88.992
// 118.015, 100.009 = east
// 82.003, 100.009 = west
// 88.992, 110.996
// 88.992, 88.992
// 92.990, 100.009
if (Math.abs(posXVal - 100) < 1) {
if (Math.abs(posYVal - 83) < 1) {
// North unsafe
data.ifritRadiantPlumeLocations.push('dirN');
} else if (Math.abs(posYVal - 118) < 1) {
// South unsafe
data.ifritRadiantPlumeLocations.push('dirS');
}
} else if (Math.abs(posYVal - 100) < 1) {
if (Math.abs(posXVal - 83) < 1) {
// West unsafe
data.ifritRadiantPlumeLocations.push('dirW');
} else if (Math.abs(posXVal - 118) < 1) {
// East unsafe
data.ifritRadiantPlumeLocations.push('dirE');
}
}
// Remove duplicates
data.ifritRadiantPlumeLocations = data.ifritRadiantPlumeLocations
.filter((pos, index) => data.ifritRadiantPlumeLocations.indexOf(pos) === index);
// 3 danger spots means we only have one safe spot left
return data.ifritRadiantPlumeLocations.length === 3;
},
suppressSeconds: 5,
infoText: (data, _matches, output) => {
if (data.ifritRadiantPlumeLocations.length < 3)
return;
const safeDir =
Directions.outputCardinalDir.filter((dir) =>
!data.ifritRadiantPlumeLocations.includes(dir)
)[0];
return output[safeDir ?? 'unknown']!();
},
outputStrings: {
unknown: Outputs.unknown,
...Directions.outputStringsCardinalDir,
},
},
{
id: 'UWU Ifrit Vulcan Burst',
type: 'StartsUsing',
netRegex: { id: '25B7', source: 'Ifrit', capture: false },
response: Responses.knockback(),
},
{
id: 'UWU Ifrit Nail Adds',
type: 'AddedCombatant',
netRegex: { npcNameId: '1186', npcBaseId: '8731' },
condition: (data, matches) => {
data.nailAdds.push(matches);
return data.nailAdds.length === 4;
},
alertText: (data, _matches, output) => {
// Nails are always on cardinals and intercardinals.
// The back two nails are always 135 degrees apart and the front two are 45 degrees apart,
// and the front and back nails are 90 degrees apart from each other. Thus, you can figure
// out the orientation based on relative positions from the origin.
//
// One possible example of directions:
// 0 = back right
// 3 = back left
// 5 = front left
// 6 = front right
const dirs = data.nailAdds.map((m) => {
return Directions.addedCombatantPosTo8Dir(m, centerX, centerY);
}).sort();
for (let i = 0; i < dirs.length; ++i) {
const this8Dir = dirs[i];
const next8Dir = dirs[(i + 1) % dirs.length];
if (this8Dir === undefined || next8Dir === undefined)
break;
// The two close nails are 45 degrees apart.
if (next8Dir - this8Dir === 1 || this8Dir - next8Dir === 7) {
const between16Dir = this8Dir * 2 + 1;
const outputKey = Directions.output16Dir[between16Dir] ?? 'unknown';
return output.text!({ dir: output[outputKey]!() });
}
}
},
outputStrings: {
text: {
en: 'Near: ${dir}',
de: 'Nahe: ${dir}',
fr: 'Proche : ${dir}',
cn: '近: ${dir}',
ko: '가까운 기둥: ${dir}',
},
...Directions.outputStrings16Dir,
},
},
{
id: 'UWU Ifrit Nail Deaths',
type: 'Ability',
netRegex: { id: '2B58' },
condition: (data, matches) => {
if (data.nailDeaths[matches.sourceId] === undefined) {
data.nailDeaths[matches.sourceId] = matches;
data.nailDeathOrder.push(matches.sourceId);
}
return data.nailDeathOrder.length === 4;
},
suppressSeconds: 999999,
run: (data) => {
// No need to check awoken status here, we'll just look for the status effect later.
const idToDir: { [id: string]: number } = {};
// lastDir is an 8-value direction but modulo 4.
let lastDir: number | undefined;
let lastRotationDir: 'cw' | 'ccw' | undefined;
for (const key of data.nailDeathOrder) {
const m = data.nailDeaths[key];
if (m === undefined)
return;
const x = parseFloat(m.x);
const y = parseFloat(m.y);
// Since dashes go through one direction and its opposite, map to N/NE/E/SE zone.
// Consider a valid kill order to be sequential in either direction.
// Most people do Z or reverse Z, but there's many valid orders (e.g. bowtie/fish).
const this8Dir = Directions.xyTo8DirNum(x, y, centerX, centerY);
idToDir[m.sourceId] = this8Dir;
const thisDir = this8Dir % 4;
if (lastDir === undefined) {
lastDir = thisDir;
continue;
}
const isCW = thisDir - lastDir === 1 || lastDir - thisDir === 3;
const isCCW = lastDir - thisDir === 1 || thisDir - lastDir === 3;
const thisRotationDir = isCW ? 'cw' : isCCW ? 'ccw' : undefined;
lastDir = thisDir;
// Invalid nail kill order.
if (thisRotationDir === undefined)
return;
if (lastRotationDir === undefined) {
lastRotationDir = thisRotationDir;
continue;
}
// Invalid nail kill order.
if (thisRotationDir !== lastRotationDir)
return;
}
const firstNailId = data.nailDeathOrder[0];
const lastNailId = data.nailDeathOrder[3];
data.nailDeathRotationDir = lastRotationDir;
if (firstNailId !== undefined)
data.nailDeathFirst8Dir = idToDir[firstNailId];
if (lastNailId !== undefined)
data.nailDeathLast8Dir = idToDir[lastNailId];
},
},
{
id: 'UWU Ifrit Fetters',
type: 'Tether',
// This is GainsEffect effectId 179 as well applied to each player
// but reapplied when the count changes due to distance.
netRegex: { id: '0009' },
condition: (data, matches) => matches.target === data.me || matches.source === data.me,
infoText: (data, matches, output) => {
const otherPlayer = matches.target === data.me ? matches.source : matches.target;
return output.fetters!({ player: data.party.member(otherPlayer) });
},
outputStrings: {
fetters: {
en: 'Fetters (w/${player})',
de: 'Fesseln (mit ${player})',
fr: 'Entraves (avec ${player})',
cn: '锁链 (与 /${player})',
ko: '사슬 (+${player})',
},
},
},
{
id: 'UWU Ifrit Searing Wind',
type: 'StartsUsing',
netRegex: { id: '2B5B', source: 'Ifrit' },
condition: Conditions.targetIsYou(),
alarmText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
en: 'Searing Wind on YOU',
de: 'Versengen auf DIR',
fr: 'Carbonisation sur VOUS',
ja: '自分に灼熱',
cn: '灼热咆哮点名',
ko: '작열 대상자',
},
},
},
{
id: 'UWU Ifrit Hellfire',
type: 'StartsUsing',
netRegex: { id: '2B5E', source: 'Ifrit', capture: false },
condition: (data) => data.phase === 'ifrit',
response: Responses.aoe(),
},
{
id: 'UWU Ifrit Name Toggle Counter',
type: 'NameToggle',
netRegex: { name: 'Ifrit', toggle: '00', capture: false },
run: (data) => data.ifritUntargetableCount++,
},
{
id: 'UWU Ifrit Dash Safe Spot 1',
// TODO: we could add a config option for the other set of safe spots, as it's also
// valid to go SW/NE instead of SE/NW for the first dashes. It would just change
// the adjust call.
comment: {
en: `If the first nail is SE, this will call SE/NW for both reverse-Z and normal-Z.
If the first nail is S, this will call SE/NW for reverse-Z and SW/NE for normal-Z.
Other nail orders are also supported, these are just examples.`,
de:
`Wenn der erste Nagel SO ist, wird dies SO/NW sowohl für Umgekehrtes-Z als auch für Normal-Z aufgerufen.
Wenn der erste Nagel S ist, wird dies SO/NW für Umgekehrtes-Z und SW/NO für Normal-Z aufgerufen.
Andere Nagelreihenfolgen werden ebenfalls unterstützt, dies sind nur Beispiele.`,
fr: `Si le premier clou est SE, on annoncera SE/NO pour les Z inversés et les Z normaux.
Si le premier clou est S, on annoncera SE/NO pour la zone inversée et SW/NO pour la zone normale.
D'autres ordres de clous sont également possibles, il ne s'agit que d'exemples.`,
cn: `如果第一个火神柱在东南,则反向 Z 和正常 Z 都会提示东南/西北
如果第一个火神柱在南, 则反向 Z 将提示东南/西北,正常 Z 将提示西南/东北。
这些只是示例, 还支持其他火神柱顺序。`,
ko: `첫 번째 기둥이 남동쪽인 경우, 역방향 Z와 일반 Z 모두에 대해 남동/북서를 호출합니다.
첫 번째 기둥이 남쪽인 경우, 역방향 Z는 남동/북서를, 일반 Z는 남서/북동를 호출합니다.
다른 기둥 순서도 지원되며, 이는 예시일 뿐입니다.`,
},
type: 'NameToggle',
netRegex: { name: 'Ifrit', toggle: '00', capture: false },
condition: (data) => data.ifritUntargetableCount === 1,
durationSeconds: 5,
alertText: (data, _matches, output) => {
const firstNailDir = data.nailDeathFirst8Dir;
const rotationType = data.nailDeathRotationDir;
if (firstNailDir === undefined || rotationType === undefined)
return;
const oppositeRotation = rotationType === 'cw' ? 7 : 1;
const isIntercard = firstNailDir % 2 === 1;
// For the first jump, we need to end on an intercard.
// If we're already on an intercard, just stop there. IMO, it's better to have the first
// Ifrit jump directly on the party where it's obvious which way you need to adjusut.
// For the second jump, the first Ifrit jumps directly on the first nail location,
// if that's not an intercard, initial start is good, otherwise party needs to rotate 45
// in the opposite direction they will be rotating to avoid dashes.
const dir1 = isIntercard ? firstNailDir : (firstNailDir + oppositeRotation) % 8;
const dir2 = (dir1 + 4) % 8;
const dir1Str = output[Directions.outputFrom8DirNum(dir1)]!();
const dir2Str = output[Directions.outputFrom8DirNum(dir2)]!();
return output.intercardSafeSpot!({ dir1: dir1Str, dir2: dir2Str });
},
outputStrings: {
intercardSafeSpot: {
en: '${dir1} / ${dir2}',
de: '${dir1} / ${dir2}',
fr: '${dir1} / ${dir2}',
cn: '${dir1} / ${dir2}',
ko: '${dir1} / ${dir2}',
},
...Directions.outputStrings8Dir,
},
},
{
id: 'UWU Ifrit Dash Safe Spot 2 Adjust',
comment: {
en: `If the first nail was on an intercard, then the first Ifrit dash is on an intercard
and this optional call is to move to be adjacent to that first dash.
If you are already safe, this will not be called.`,
de:
`Wenn der erste Nagel Interkardinal war, dann ist der erste Ifrit-Ansturm auf einer Interkardinalen
und dieser optionale Aufruf besteht darin, sich in die Nähe dieses ersten Ansturms zu bewegen.
Wenn man bereits in Sicherheit ist, wird dies nicht aufgerufen.`,
fr:
`Si le premier clou était en intercardinal, alors le premier dash d'Ifrit est en intercardinal
et cette annonce optionnelle vous préviens de vous déplacer pour être adjacent à ce premier dash.
Si vous êtes déjà en sécurité, cette option n'est pas activée.`,
cn: `如果第一个火神柱在对角线上,那么第一次火神冲也在对角线上。
这个可选提示会提示你移动到第一次火神冲附近的位置。
如果你已在安全区,则不会输出此提示。`,
ko: `첫 번째 기둥이 대각선에 있으면 첫 번째 이프리트 돌진도 대각선에 있으며,
이 알람은 첫 번째 돌진 옆으로 이동하라는 것이 됩니다.
이미 안전하다면 이 알람은 호출되지 않습니다.`,
},
type: 'NameToggle',
netRegex: { name: 'Ifrit', toggle: '00', capture: false },
// Unfortunately no way to know for sure if Ifrit dies before dashes.
condition: (data) => data.ifritUntargetableCount === 2 && data.ifritAwoken,
infoText: (data, _matches, output) => {
const firstNailDir = data.nailDeathFirst8Dir;
const rotationType = data.nailDeathRotationDir;
if (firstNailDir === undefined || rotationType === undefined)
return;
// If we didn't start on an intercard, then we are already safe.
const isIntercard = firstNailDir % 2 === 1;
if (!isIntercard)
return;
// Adjust the opposite direction of rotation, e.g. we are rotating clockwise
// and Ifrit hops on the party SE, the party needs to go to E to rotate into
// the first Ifrit at SE.
const dirStr = rotationType === 'cw' ? output.counterclockwise!() : output.clockwise!();
return output.text!({ rotation: dirStr });
},
outputStrings: {
text: {
en: 'Adjust 45° ${rotation}',
de: 'Rotiere 45° ${rotation}',
fr: 'Ajustez de 45° ${rotation}',
cn: '${rotation} 旋转 45°',
ko: '${rotation} 45° 이동',
},
clockwise: Outputs.clockwise,
counterclockwise: Outputs.counterclockwise,
},
},
{
id: 'UWU Ifrit Dash Safe Spot 2',
comment: {
en: `This is the major movement for the Ifrit dashes starting adjacent to the first dash.
Both the party and the healer will move either 45 or 90 degrees.
It is a "fast" movement if you need to move fast to avoid the Ifrit follow-up dash.
It is a "slow" movement if you have extra time to do this.`,
de:
`Dies ist die Hauptbewegung für die Ifrit-Anstürme, die in der Nähe des ersten Ansturms beginnt.
Sowohl die Gruppe als auch der Heiler bewegen sich entweder um 45 oder 90 Grad.
Es ist eine "schnelle" Bewegung, wenn man sich schnell bewegen muss, um dem Ifrit-Folgeschlag auszuweichen.
Es ist eine "langsame" Bewegung, wenn man mehr Zeit hat, dies zu tun.`,
fr:
`Il s'agit du mouvement principal pour les dashs d'Ifrit qui commencent à côté du premier dash.
Le groupe et le soigneur se déplacent de 45 ou 90 degrés.
Il s'agit d'un mouvement "rapide" si vous devez vous déplacer rapidement pour éviter le dash suivant d'Ifrit.
Il s'agit d'un mouvement "lent" si vous avez plus de temps pour le faire.`,
cn: `这是从第一次火神冲附近开始的火神冲主要移动。
人群和奶妈都将移动 45 度或 90 度。
"快" 可以让你快速移动,躲避第二次火神冲。
"慢" 当你有足够的时间来移动时使用。`,
ko: `첫 번째 돌진 직후부터 시작되는 이프리트 돌진의 주요 동선입니다.
본대와 힐러 모두 45도 또는 90도로 움직입니다.
이프리트의 후속 돌진을 피하기 위해 빠르게 이동해야 하는 경우 "빠른" 이동입니다.
시간적 여유가 있다면 "느린" 이동입니다.`,
},
type: 'NameToggle',
netRegex: { name: 'Ifrit', toggle: '00', capture: false },
condition: (data) => data.ifritUntargetableCount === 2 && data.ifritAwoken,
// Here's one log file example for this timing.
// [20:38:36.510] NameToggle 22:40017C12:Ifrit:40017C12:Ifrit:00
// [20:38:38.245] 261 105:Change:40017C12:Heading:2.3562:PosX:86.3000:PosY:113.7000:PosZ:0.0000
// [20:38:40.919] StartsCasting 14:40017C0F:Ifrit:2B5F:Crimson Cyclone:40017C0F:Ifrit:2.700:113.70:113.70:0.00:-2.36
// [20:38:42.343] StartsCasting 14:40017C11:Ifrit:2B5F:Crimson Cyclone:40017C11:Ifrit:2.700:100.00:80.50:0.00:0.00