Skip to content
72 changes: 72 additions & 0 deletions ui/raidboss/data/07-dt/eureka/occult_crescent_south_horn.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import Conditions from '../../../../../resources/conditions';
import { Responses } from '../../../../../resources/responses';
import ZoneId from '../../../../../resources/zone_id';
import { RaidbossData } from '../../../../../types/data';
import { TriggerSet } from '../../../../../types/trigger';

export interface Data extends RaidbossData {
ce?: string;
phantomJob?: string;
phantomJobLevel?: number;
}

// List of events:
Expand Down Expand Up @@ -34,6 +37,42 @@ const ceIds: { [ce: string]: string } = {
withExtremePredjudice: '339',
};

// Used to filter the GainsEffect
const phantomJobEffectIds = [
'1092', // Freelancer
'1106', // Knight
'1107', // Berserker
'1108', // Monk
'1109', // Ranger
'1110', // Oracle
'1111', // Thief
'110A', // Samurai
'110B', // Bard
'110C', // Geomancer
'110D', // Time Mage
'110E', // Cannonneer
'110F', // Chemist
];

// Useful for matching on job name in condition trigger
/*
const phantomJobData = {
'freelancer': '1092',
'knight': '1106',
'berserker': '1107',
'monk': '1108',
'ranger': '1109',
'oracle': '1110',
'thief': '1111',
'samurai': '110A',
'bard': '110B',
'geomancer': '110C',
'timeMage': '110D',
'cannoneer': '110E',
'chemist': '110F',
} as const;
*/

const triggerSet: TriggerSet<Data> = {
id: 'TheOccultCrescentSouthHorn',
zoneId: ZoneId.TheOccultCrescentSouthHorn,
Expand Down Expand Up @@ -76,6 +115,39 @@ const triggerSet: TriggerSet<Data> = {
console.log(`Start CE: ??? (${ceId})`);
},
},
{
id: 'Occult Crescent Phantom Job Tracker',
// count also contains a Phantom Job id and level, it's supposed to be two bytes but has weird padding in logs
// Expecting first two characters to be part of Phantom Job id, and the later two to be the level
// First digit is the job:
// Thief = C
// Oracle = B
// Chemist = A
// Cannoneer = 9
// Time Mage = 8
// Geomancer = 7
// Bard = 6
// Samurai = 5
// Ranger = 4
// Monk = 3
// Berserker = 2
// Knight = 1
// Freelancer = null
// Freelancer level is accumulation of maxed jobs +1
type: 'GainsEffect',
netRegex: { effectId: [...phantomJobEffectIds], capture: true },
condition: Conditions.targetIsYou(),
run: (data, matches) => {
data.phantomJob = matches.effectId;
const jobData = matches.count?.padStart(4, '0');

// Assuming this isn't possible given the filter on statuses
if (jobData === undefined)
return;

data.phantomJobLevel = parseInt(jobData.slice(2), 16);
},
},
{
id: 'Occult Crescent Cloister Demon Tidal Breath',
type: 'StartsUsing',
Expand Down