Skip to content

Instantly share code, notes, and snippets.

@LeonBlade
Last active January 19, 2020 04:16
Show Gist options
  • Save LeonBlade/9bc925a62d681ffb44533984c0c7e580 to your computer and use it in GitHub Desktop.
Save LeonBlade/9bc925a62d681ffb44533984c0c7e580 to your computer and use it in GitHub Desktop.
Cactbot Trigger for UCoB Nael Divebombs
/*
This trigger relies on the unending_coil_ultimate.js triggers to be used.
Those triggers give us access to data.naelMarks which are literally waymark
positions that seemingly never actually get used (until now).
The coords array is for the cardinal and intercardinal directions that each
divebomb placement area can be. This means that two waymarks can and will
overlap. It's possible to nudge C if desired to make it more obvious, but
it hasn't been a major issue for my group. You can even nudge it up in the
Y coordinate if you want as waymarks can float by doing this.
I'm not sending the Y coordinate normally because UCoB's Y floor is at 0 and
there's no need to specify the Y coordinate in that case.
This trigger comes out as soon as the dragons have all been found.
If you want to delay waymarks from getting placed, you can use a setTimeout
to delay it. Once the data exists though, it can be accessed even from another
trigger point later in the fight if desired.
- Love, LeonBlade
*/
{
id: 'UCU Nael Waymarks',
zoneRegex: /The Unending Coil Of Bahamut \(Ultimate\)/,
triggers: [
{
id: 'UCU Nael Dragon Placement',
regex: Regexes.ability({ source: 'Iceclaw', id: '26C6', capture: false }),
regexDe: Regexes.ability({ source: 'Eisklaue', id: '26C6', capture: false }),
regexFr: Regexes.ability({ source: 'Griffe-De-Glace', id: '26C6', capture: false }),
regexJa: Regexes.ability({ source: 'アイスクロウ', id: '26C6', capture: false }),
regexCn: Regexes.ability({ source: '冰爪', id: '26C6', capture: false }),
regexKo: Regexes.ability({ source: '얼음발톱', id: '26C6', capture: false }),
condition: function(data) {
return data.naelMarks && !data.calledNaelDragons;
},
run: function (data) {
// cordinate locations for waymarks
const coords = {
"N": { X: 0, Y: -24 },
"NE": { X: 17, Y: -17 },
"E": { X: 24, Y: 0 },
"SE": { X: 17, Y: 17 },
"S": { X: 0, Y: 24 },
"SW": { X: -17, Y: 17 },
"W": { X: -24, Y: 0 },
"NW": { X: -17, Y: -17 },
}
// get coords from lookup array
const a = coords[data.naelMarks[0]];
const b = coords[data.naelMarks[1]];
const c = coords[data.naelMarks[2]];
// waymarks to send to Paisley Park
const waymarks = {
A: { Active: true, X: a.X, Z: a.Y },
B: { Active: true, X: b.X, Z: b.Y },
C: { Active: true, X: c.X, Z: c.Y }
}
// place the waymarks down
fetch('http://localhost:1337/place', {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(waymarks)
});
},
durationSeconds: 20,
infoText: function(data) {
data.calledNaelDragons = true;
return {
en: 'Marks: ' + data.naelMarks.join(', ') + (data.wideThirdDive ? ' (WIDE)' : ''),
fr: 'Marque : ' + data.naelMarks.join(', ') + (data.wideThirdDive ? ' (LARGE)' : ''),
de: 'Markierungen : ' + data.naelMarks.join(', ') + (data.wideThirdDive ? ' (GROß)' : ''),
ja: 'マーカー: ' + data.naelMarks.join(', ') + (data.wideThirdDive ? ' (広)' : ''),
cn: '标记: ' + data.naelMarks.join(', ') + (data.wideThirdDive ? ' (大)' : ''),
};
},
}
]
},
@LeonBlade
Copy link
Author

  1. Go into the cactbot/user folder, and copy the raidboss-example.js file and rename it to raidboss.js.
  2. Find the section with Options.Triggers = [
  3. Add the code after the opening bracket [ on a new line.

It will look something like this:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment