diff --git a/06-ew/ultimate/the_omega_protocol.js b/06-ew/ultimate/the_omega_protocol.js index 092466b4a1..9911518164 100644 --- a/06-ew/ultimate/the_omega_protocol.js +++ b/06-ew/ultimate/the_omega_protocol.js @@ -1397,12 +1397,13 @@ Options.Triggers.push({ }, }, { - id: 'TOP Omega Safe Spots', - // 7B9B Diffuse Wave Cannon (North/South), is followed up with 7B78 - // 7B9C Diffuse Wave Cannon (East/West), is followed up with 7B77 - type: 'StartsUsing', - netRegex: { id: ['7B9B', '7B9C'], source: 'Omega' }, - durationSeconds: (_data, matches) => parseFloat(matches.castTime), + id: 'TOP Omega Pre-Safe Spot', + // Adds appear at end of the cast, but the AddCombatants line appears around + // the cast time of Omega Version + type: 'Ability', + netRegex: { id: '8015', source: 'Omega-M', capture: false }, + delaySeconds: 3.1, + suppressSeconds: 1, promise: async (data) => { data.combatantData = []; data.combatantData = (await callOverlayHandler({ @@ -1412,6 +1413,132 @@ Options.Triggers.push({ const sortCombatants = (a, b) => (b.ID ?? 0) - (a.ID ?? 0); data.combatantData = data.combatantData.sort(sortCombatants); }, + infoText: (data, _matches, output) => { + // The higher id is first set + const omegaMNPCId = 15721; + const omegaFNPCId = 15722; + let isFIn = false; + let isMIn = false; + let northSouthSwordStaffDir; + let eastWestSwordStaffDir; + let distance; + const findOmegaF = (combatant) => combatant.BNpcID === omegaFNPCId; + const findOmegaM = (combatant) => combatant.BNpcID === omegaMNPCId; + const f = data.combatantData.filter(findOmegaF).shift(); + const m = data.combatantData.filter(findOmegaM).shift(); + if (f === undefined || m === undefined) { + console.error(`Omega Safe Spots: missing m/f: ${JSON.stringify(data.combatantData)}`); + return; + } + console.log(`Omega Safe Pre Spots: m/f: (${JSON.stringify(m)}), (${JSON.stringify(f)})); `); + if (f.WeaponId === 4) + isFIn = true; + if (m.WeaponId === 4) + isMIn = true; + if (isFIn) + distance = output.close(); + else if (isMIn) + distance = output.mid(); + else + distance = output.far(); + // The combatants only spawn in these intercards: + // 92.93, 92.93 (NW) 107.07, 92.93 (NE) + // 92.93, 107.07 (SW) 107.07, 107.07 (SE) + // They will either spawn NW/SE first or NE/SW + // Boss cleave is unknown at this time, so call both sides + const pos1 = (!isMIn && isFIn) ? f.PosY : m.PosY; + const pos2 = (!isMIn && isFIn) ? f.PosX : m.PosX; + const northSouthDir = pos1 < 100 ? output.dirN() : output.dirS(); + const eastWestDir = pos2 < 100 ? output.dirW() : output.dirE(); + // Secondary Spot for Staff + Sword + if (!isMIn && !isFIn) { + // East/West Safe + if (f.PosX < 100 && f.PosY < 100) { + // NW + eastWestSwordStaffDir = output.dirNNE(); + } else if (f.PosX < 100 && f.PosY > 100) { + // SW + eastWestSwordStaffDir = output.dirSSE(); + } else if (f.PosX > 100 && f.PosY < 100) { + // NE + eastWestSwordStaffDir = output.dirNNW(); + } else { + // SE + eastWestSwordStaffDir = output.dirSSW(); + } + // North/South Safe + if (f.PosX < 100 && f.PosY < 100) { + // NW + northSouthSwordStaffDir = output.dirWSW(); + } else if (f.PosX < 100 && f.PosY > 100) { + // SW + northSouthSwordStaffDir = output.dirWNW(); + } else if (f.PosX > 100 && f.PosY < 100) { + // NE + northSouthSwordStaffDir = output.dirESE(); + } else { + // SE + northSouthSwordStaffDir = output.dirENE(); + } + const staffSwordFar = output.staffSwordFar({ + northSouth: northSouthDir, + eastWest: eastWestDir, + }); + const staffSwordMid = output.staffSwordMid({ + northSouth: northSouthSwordStaffDir, + eastWest: eastWestSwordStaffDir, + }); + return output.staffSwordCombo({ farText: staffSwordFar, midText: staffSwordMid }); + } + return output.safeSpot({ + distance: distance, + northSouth: northSouthDir, + eastWest: eastWestDir, + }); + }, + outputStrings: { + safeSpot: { + en: '${distance} ${northSouth} or ${eastWest}', + }, + staffSwordCombo: { + en: '${farText} / ${midText}', + }, + staffSwordFar: { + en: 'Far ${northSouth} or ${eastWest}', + }, + staffSwordMid: { + en: 'Mid ${northSouth} or ${eastWest}', + }, + close: { + en: 'Close', + }, + mid: { + en: 'Mid', + }, + far: { + en: 'Far', + }, + dirN: Outputs.dirN, + dirE: Outputs.dirE, + dirS: Outputs.dirS, + dirW: Outputs.dirW, + dirNNW: Outputs.dirNNW, + dirNNE: Outputs.dirNNE, + dirENE: Outputs.dirENE, + dirESE: Outputs.dirESE, + dirSSE: Outputs.dirSSE, + dirSSW: Outputs.dirSSW, + dirWSW: Outputs.dirWSW, + dirWNW: Outputs.dirWNW, + }, + }, + { + id: 'TOP Omega Safe Spots', + // 7B9B Diffuse Wave Cannon (North/South), is followed up with 7B78 + // 7B9C Diffuse Wave Cannon (East/West), is followed up with 7B77 + type: 'StartsUsing', + netRegex: { id: ['7B9B', '7B9C'], source: 'Omega' }, + durationSeconds: (_data, matches) => parseFloat(matches.castTime), alertText: (data, matches, output) => { // The higher id is first set const omegaMNPCId = 15721;