add shorthand option to search for a nickname of something, add debug flag to get internal id of things

This commit is contained in:
Ean Milligan 2024-09-13 04:38:09 -04:00
parent 51cb8004ea
commit 05ddddf145
6 changed files with 92 additions and 22 deletions

View File

@ -1,4 +1,4 @@
# Logogram Discord Bot - A FFXIV Eureka Utility Bot | V1.1.1 - 2025/09/13 # Logogram Discord Bot - A FFXIV Eureka Utility Bot | V1.1.2 - 2025/09/13
A Discord bot for Eureka Logos Actions and their recipes. A Discord bot for Eureka Logos Actions and their recipes.
## Commands ## Commands

View File

@ -1,6 +1,6 @@
export const config = { export const config = {
'name': 'Logogram Bot', // Name of the bot 'name': 'Logogram Bot', // Name of the bot
'version': '1.1.1', // Version of the bot 'version': '1.1.2', // Version of the bot
'token': 'the_bot_token', // Discord API Token for this bot 'token': 'the_bot_token', // Discord API Token for this bot
'localToken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token" 'localToken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token"
'prefix': 'l!', // Prefix for all commands 'prefix': 'l!', // Prefix for all commands

31
mod.ts
View File

@ -107,39 +107,50 @@ startBot({
rawClass: '', rawClass: '',
isNin: false, isNin: false,
page: 1, page: 1,
debug: false,
}; };
const classPrefixes = ['-class=', 'class=', '-c=', 'c=']; const classPrefixes = ['-class=', 'class=', '-c=', 'c='];
const pagePrefixes = ['-page=', 'page=', '-p=', 'p=']; const pagePrefixes = ['-page=', 'page=', '-p=', 'p='];
const debugPrefixes = ['-debug=', 'debug=', '-d=', 'd='];
const allPrefixes = classPrefixes.concat(pagePrefixes).concat(debugPrefixes);
args.forEach((arg) => { args.forEach((arg) => {
if (classPrefixes.some(pfx => arg.toLowerCase().startsWith(pfx))) { // if (classPrefixes.some((pfx) => arg.toLowerCase().startsWith(pfx))) { //
params.rawClass = arg.split('=')[1]; params.rawClass = arg.split('=')[1];
params.class = classToType(params.rawClass); params.class = classToType(params.rawClass);
params.isNin = params.rawClass.toLowerCase() === 'nin'; params.isNin = params.rawClass.toLowerCase() === 'nin';
} else if (pagePrefixes.some(pfx => arg.toLowerCase().startsWith(pfx))) { } else if (pagePrefixes.some((pfx) => arg.toLowerCase().startsWith(pfx))) {
params.page = parseInt(arg.split('=')[1]); params.page = parseInt(arg.split('=')[1]);
} else if (debugPrefixes.some((pfx) => arg.toLowerCase().startsWith(pfx))) {
params.debug = true;
} }
}); });
const cleanArgs = args.filter((arg) => !(classPrefixes.concat(pagePrefixes).some(pfx => arg.toLowerCase().startsWith(pfx)))); const cleanArgs = args.filter((arg) => !(allPrefixes.some((pfx) => arg.toLowerCase().startsWith(pfx))));
const rawQuery = cleanArgs.join(' '); const rawQuery = cleanArgs.join(' ');
const query = rawQuery.toLowerCase(); const query = rawQuery.toLowerCase();
if (data.ActionNames.includes(query)) { if (data.ActionNames.includes(query)) {
const singleAction: Array<number> = [data.ActionNames.indexOf(query)]; const singleAction: Array<number> = [data.ActionNames.indexOf(query)];
message.send({ message.send({
content: `Showing single action:`, content: 'Showing single action:',
embeds: generateEmbeds(singleAction), embeds: generateEmbeds(singleAction, params.debug),
}).catch((e) => {
log(LT.ERROR, `Failed to send message: ${JSON.stringify(message)} | ${JSON.stringify(e)}`);
});
} else if (data.ActionShortNames.includes(query)) {
const searchResults: Array<number> = data.Actions.filter((action) => action.shorthand === query).map((action) => data.ActionNames.indexOf(action.name.toLowerCase()));
message.send({
content: searchResults.length > 1 ? `Showing ${searchResults.length} actions:` : 'Showing single action:',
embeds: generateEmbeds(searchResults, params.debug),
}).catch((e) => { }).catch((e) => {
log(LT.ERROR, `Failed to send message: ${JSON.stringify(message)} | ${JSON.stringify(e)}`); log(LT.ERROR, `Failed to send message: ${JSON.stringify(message)} | ${JSON.stringify(e)}`);
}); });
} else { } else {
const initialSearchResults: Array<number> = data.ActionNames.filter((action) => action.includes(query)).map((action) => data.ActionNames.indexOf(action)); const initialSearchResults: Array<number> = data.ActionNames.filter((action) => action.includes(query)).map((action) => data.ActionNames.indexOf(action));
const searchResults: Array<number> = initialSearchResults.filter((actionIdx) => const searchResults: Array<number> = initialSearchResults.filter((actionIdx) =>
params.class params.class ? (data.Actions[actionIdx].jobs.includes('all-nin') && !params.isNin) || data.Actions[actionIdx].jobs.includes('all') || data.Actions[actionIdx].jobs.includes(params.class) : true
? (data.Actions[actionIdx].jobs.includes('all-nin') && !params.isNin) || data.Actions[actionIdx].jobs.includes('all') || data.Actions[actionIdx].jobs.includes(params.class)
: true
); );
if (searchResults.length) { if (searchResults.length) {
@ -154,7 +165,7 @@ startBot({
: ''; : '';
message.send({ message.send({
content: `${searchResults.length} result${searchResults.length > 1 ? 's' : ''} matching query: \`${userQuery}\`${paginationMessage}`, content: `${searchResults.length} result${searchResults.length > 1 ? 's' : ''} matching query: \`${userQuery}\`${paginationMessage}`,
embeds: generateEmbeds(searchResults.slice((params.page - 1) * config.resultsPerPage, config.resultsPerPage * params.page)), embeds: generateEmbeds(searchResults.slice((params.page - 1) * config.resultsPerPage, config.resultsPerPage * params.page), params.debug),
}).catch((e) => { }).catch((e) => {
log(LT.ERROR, `Failed to send message: ${JSON.stringify(message)} | ${JSON.stringify(e)}`); log(LT.ERROR, `Failed to send message: ${JSON.stringify(message)} | ${JSON.stringify(e)}`);
}); });
@ -177,7 +188,7 @@ startBot({
const preset: Array<number> = data.Presets.get(query) ?? []; const preset: Array<number> = data.Presets.get(query) ?? [];
message.send({ message.send({
content: `Showing ${rawQuery} Preset:`, content: `Showing ${rawQuery} Preset:`,
embeds: generateEmbeds(preset), embeds: generateEmbeds(preset, false),
}).catch((e) => { }).catch((e) => {
log(LT.ERROR, `Failed to send message: ${JSON.stringify(message)} | ${JSON.stringify(e)}`); log(LT.ERROR, `Failed to send message: ${JSON.stringify(message)} | ${JSON.stringify(e)}`);
}); });

View File

@ -36,6 +36,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Aetherweaver', name: 'Wisdom of the Aetherweaver',
description: 'Increases magic damage dealt by 60%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases magic damage dealt by 60%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 1, imageId: 1,
shorthand: 'wota',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -47,6 +48,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Martialist', name: 'Wisdom of the Martialist',
description: 'Increases damage dealt by 40%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases damage dealt by 40%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 2, imageId: 2,
shorthand: 'wotm',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -58,6 +60,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Platebearer', name: 'Wisdom of the Platebearer',
description: 'Increases defense by 3,000 and maximum HP by 50%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases defense by 3,000 and maximum HP by 50%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 3, imageId: 3,
shorthand: 'wotp',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -69,6 +72,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Guardian', name: 'Wisdom of the Guardian',
description: 'Increases defense by 1,800 and maximum HP by 10%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases defense by 1,800 and maximum HP by 10%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 4, imageId: 4,
shorthand: 'wotg',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -80,6 +84,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Ordained', name: 'Wisdom of the Ordained',
description: 'Increases maximum MP by 50% and healing magic potency by 25%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases maximum MP by 50% and healing magic potency by 25%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 5, imageId: 5,
shorthand: 'woto',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -91,6 +96,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Skirmisher', name: 'Wisdom of the Skirmisher',
description: 'Increases damage dealt by 20%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases damage dealt by 20%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 6, imageId: 6,
shorthand: 'wots',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -102,6 +108,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Watcher', name: 'Wisdom of the Watcher',
description: 'Increases evasion by 25% while reducing damage dealt by 5%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases evasion by 25% while reducing damage dealt by 5%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 7, imageId: 7,
shorthand: 'wotw',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -111,9 +118,9 @@ const Actions: Array<LogosAction> = [
}, },
{ {
name: 'Wisdom of the Templar', name: 'Wisdom of the Templar',
description: description: 'Increases healing magic potency by 50% and maximum HP by 30%, while reducing damage dealt by 5%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
'Increases healing magic potency by 50% and maximum HP by 30%, while reducing damage dealt by 5%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 8, imageId: 8,
shorthand: 'wott',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -129,6 +136,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Irregular', name: 'Wisdom of the Irregular',
description: 'Increases damage dealt by 30% while reducing magic defense by 60%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases damage dealt by 30% while reducing magic defense by 60%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 9, imageId: 9,
shorthand: 'woti',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -141,9 +149,9 @@ const Actions: Array<LogosAction> = [
}, },
{ {
name: 'Wisdom of the Breathtaker', name: 'Wisdom of the Breathtaker',
description: description: 'Increases poison resistance and movement speed, including mount speed, and increases evasion by 10%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
'Increases poison resistance and movement speed, including mount speed, and increases evasion by 10%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 10, imageId: 10,
shorthand: 'wotb',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -155,6 +163,7 @@ const Actions: Array<LogosAction> = [
name: 'Spirit of the Remembered', name: 'Spirit of the Remembered',
description: 'Increases maximum HP by 10% and accuracy by 30%.\nAdditional Effect: Grants a 70% chance of automatic revival upon KO.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases maximum HP by 10% and accuracy by 30%.\nAdditional Effect: Grants a 70% chance of automatic revival upon KO.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 11, imageId: 11,
shorthand: 'sotr',
type: 'Ability', type: 'Ability',
uses: 1, uses: 1,
duration: 10800, duration: 10800,
@ -167,6 +176,7 @@ const Actions: Array<LogosAction> = [
name: 'Protect L', name: 'Protect L',
description: 'Increases the physical defense of the target by 1,000.', description: 'Increases the physical defense of the target by 1,000.',
imageId: 12, imageId: 12,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: Infinity, uses: Infinity,
duration: 1800, duration: 1800,
@ -179,6 +189,7 @@ const Actions: Array<LogosAction> = [
name: 'Shell L', name: 'Shell L',
description: 'Increases the magic defense of the target by 1,000.', description: 'Increases the magic defense of the target by 1,000.',
imageId: 13, imageId: 13,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: Infinity, uses: Infinity,
duration: 1800, duration: 1800,
@ -191,6 +202,7 @@ const Actions: Array<LogosAction> = [
name: 'Death L', name: 'Death L',
description: "KOs target. The less the target's HP, the greater the chance of success.", description: "KOs target. The less the target's HP, the greater the chance of success.",
imageId: 14, imageId: 14,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 30, uses: 30,
cast: 5, cast: 5,
@ -207,6 +219,7 @@ const Actions: Array<LogosAction> = [
name: 'Focus L', name: 'Focus L',
description: 'Grants a stack of Boost, up to a maximum of 16.\nBoost Bonus: Increases potency of next weaponskill by 30% per stack.\nShares a recast timer with all weaponskills.', description: 'Grants a stack of Boost, up to a maximum of 16.\nBoost Bonus: Increases potency of next weaponskill by 30% per stack.\nShares a recast timer with all weaponskills.',
imageId: 15, imageId: 15,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 99, uses: 99,
duration: 30, duration: 30,
@ -222,6 +235,7 @@ const Actions: Array<LogosAction> = [
name: 'Paralyze L', name: 'Paralyze L',
description: 'Afflicts target with Paralysis.', description: 'Afflicts target with Paralysis.',
imageId: 16, imageId: 16,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
duration: 60, duration: 60,
@ -234,6 +248,7 @@ const Actions: Array<LogosAction> = [
name: 'Paralyze L III', name: 'Paralyze L III',
description: 'Afflicts target and all nearby enemies with Paralysis.', description: 'Afflicts target and all nearby enemies with Paralysis.',
imageId: 17, imageId: 17,
shorthand: 'paralyze 3',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
duration: 60, duration: 60,
@ -250,6 +265,7 @@ const Actions: Array<LogosAction> = [
name: 'Swift L', name: 'Swift L',
description: 'Greatly increases movement speed.', description: 'Greatly increases movement speed.',
imageId: 18, imageId: 18,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 20, uses: 20,
duration: 10, duration: 10,
@ -265,6 +281,7 @@ const Actions: Array<LogosAction> = [
name: 'Featherfoot L', name: 'Featherfoot L',
description: 'Increases evasion by 15%.', description: 'Increases evasion by 15%.',
imageId: 19, imageId: 19,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 50, uses: 50,
duration: 45, duration: 45,
@ -277,6 +294,7 @@ const Actions: Array<LogosAction> = [
name: 'Spirit Dart L', name: 'Spirit Dart L',
description: 'Delivers a ranged attack with a potency of 100.\nAdditional Effect: Afflicts target with Spirit Dart L, increasing damage taken by 8%.', description: 'Delivers a ranged attack with a potency of 100.\nAdditional Effect: Afflicts target with Spirit Dart L, increasing damage taken by 8%.',
imageId: 20, imageId: 20,
shorthand: 'sd',
type: 'Weaponskill', type: 'Weaponskill',
uses: 50, uses: 50,
duration: 60, duration: 60,
@ -289,6 +307,7 @@ const Actions: Array<LogosAction> = [
name: 'Catastrophe L', name: 'Catastrophe L',
description: 'Deals unaspected damage to all nearby enemies with a potency of 4,000, while dealing damage with a potency of 999,999 to self.', description: 'Deals unaspected damage to all nearby enemies with a potency of 4,000, while dealing damage with a potency of 999,999 to self.',
imageId: 21, imageId: 21,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -304,6 +323,7 @@ const Actions: Array<LogosAction> = [
name: 'Dispel L', name: 'Dispel L',
description: 'Removes one beneficial status from target.', description: 'Removes one beneficial status from target.',
imageId: 22, imageId: 22,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: Infinity, uses: Infinity,
cast: 2.5, cast: 2.5,
@ -315,6 +335,7 @@ const Actions: Array<LogosAction> = [
name: 'Feint L', name: 'Feint L',
description: "Delivers an attack with a potency of 100.\nAdditional Effect: Reduces target's evasion.", description: "Delivers an attack with a potency of 100.\nAdditional Effect: Reduces target's evasion.",
imageId: 23, imageId: 23,
shorthand: '',
type: 'Weaponskill', type: 'Weaponskill',
uses: Infinity, uses: Infinity,
duration: 60, duration: 60,
@ -328,6 +349,7 @@ const Actions: Array<LogosAction> = [
description: description:
'Blend in with your surroundings, making it impossible for most enemies to detect you, but reducing movement speed by 50%.\nHas no effect on certain enemies with special sight.\nCannot be executed while in combat.\nEffect ends upon use of any action other than Sprint, or upon reuse.', 'Blend in with your surroundings, making it impossible for most enemies to detect you, but reducing movement speed by 50%.\nHas no effect on certain enemies with special sight.\nCannot be executed while in combat.\nEffect ends upon use of any action other than Sprint, or upon reuse.',
imageId: 24, imageId: 24,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 50, uses: 50,
cast: 0, cast: 0,
@ -339,6 +361,7 @@ const Actions: Array<LogosAction> = [
name: 'Aetherial Manipulation L', name: 'Aetherial Manipulation L',
description: "Rush to a target's side.\nUnable to cast if bound.", description: "Rush to a target's side.\nUnable to cast if bound.",
imageId: 25, imageId: 25,
shorthand: 'am',
type: 'Ability', type: 'Ability',
uses: 99, uses: 99,
cast: 0, cast: 0,
@ -353,6 +376,7 @@ const Actions: Array<LogosAction> = [
name: 'Backstep L', name: 'Backstep L',
description: 'Jump 10 yalms back from current position.\nCannot be executed while bound.', description: 'Jump 10 yalms back from current position.\nCannot be executed while bound.',
imageId: 26, imageId: 26,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 99, uses: 99,
cast: 0, cast: 0,
@ -364,6 +388,7 @@ const Actions: Array<LogosAction> = [
name: 'Tranquilizer L', name: 'Tranquilizer L',
description: 'Stuns target.', description: 'Stuns target.',
imageId: 27, imageId: 27,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 50, uses: 50,
duration: 8, duration: 8,
@ -376,6 +401,7 @@ const Actions: Array<LogosAction> = [
name: 'Bloodbath L', name: 'Bloodbath L',
description: 'Converts a portion of damage dealt into HP.', description: 'Converts a portion of damage dealt into HP.',
imageId: 28, imageId: 28,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 30, uses: 30,
duration: 45, duration: 45,
@ -388,6 +414,7 @@ const Actions: Array<LogosAction> = [
name: 'Rejuvenate L', name: 'Rejuvenate L',
description: 'Instantly restores 50% of maximum HP and MP.', description: 'Instantly restores 50% of maximum HP and MP.',
imageId: 29, imageId: 29,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 50, uses: 50,
cast: 0, cast: 0,
@ -403,6 +430,7 @@ const Actions: Array<LogosAction> = [
name: 'Haymaker L', name: 'Haymaker L',
description: 'Delivers an attack with a potency of 300.\nCan only be executed immediately after evading an attack.\nAdditional Effect: Slow +20%.', description: 'Delivers an attack with a potency of 300.\nCan only be executed immediately after evading an attack.\nAdditional Effect: Slow +20%.',
imageId: 30, imageId: 30,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 50, uses: 50,
duration: 30, duration: 30,
@ -418,6 +446,7 @@ const Actions: Array<LogosAction> = [
name: 'Rapid Recast L', name: 'Rapid Recast L',
description: 'Shortens recast time for next ability used by 50%.', description: 'Shortens recast time for next ability used by 50%.',
imageId: 31, imageId: 31,
shorthand: 'rr',
type: 'Ability', type: 'Ability',
uses: 50, uses: 50,
duration: 15, duration: 15,
@ -433,6 +462,7 @@ const Actions: Array<LogosAction> = [
name: 'Cure L', name: 'Cure L',
description: "Restores target's HP.\nCure Potency: 9,000.", description: "Restores target's HP.\nCure Potency: 9,000.",
imageId: 32, imageId: 32,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: Infinity, uses: Infinity,
cast: 2, cast: 2,
@ -444,6 +474,7 @@ const Actions: Array<LogosAction> = [
name: 'Cure L II', name: 'Cure L II',
description: "Restores target's HP.\nCure Potency: 12,000.", description: "Restores target's HP.\nCure Potency: 12,000.",
imageId: 33, imageId: 33,
shorthand: 'cure 2',
type: 'Ability', type: 'Ability',
uses: 50, uses: 50,
cast: 0, cast: 0,
@ -455,6 +486,7 @@ const Actions: Array<LogosAction> = [
name: 'Stoneskin L', name: 'Stoneskin L',
description: "Creates a barrier around target that absorbs damage totaling 10% of target's maximum HP.", description: "Creates a barrier around target that absorbs damage totaling 10% of target's maximum HP.",
imageId: 34, imageId: 34,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
duration: 30, duration: 30,
@ -467,6 +499,7 @@ const Actions: Array<LogosAction> = [
name: 'Cure L III', name: 'Cure L III',
description: 'Restores HP of target and all party members nearby target.\nCure Potency: 9,000.', description: 'Restores HP of target and all party members nearby target.\nCure Potency: 9,000.',
imageId: 35, imageId: 35,
shorthand: 'cure 3',
type: 'Spell', type: 'Spell',
uses: 50, uses: 50,
cast: 2, cast: 2,
@ -482,6 +515,7 @@ const Actions: Array<LogosAction> = [
name: 'Regen L', name: 'Regen L',
description: 'Grants healing over time effect to target.\nCure Potency: 2,500.', description: 'Grants healing over time effect to target.\nCure Potency: 2,500.',
imageId: 36, imageId: 36,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
duration: 21, duration: 21,
@ -498,6 +532,7 @@ const Actions: Array<LogosAction> = [
name: 'Esuna L', name: 'Esuna L',
description: 'Removes a single detrimental effect from target.', description: 'Removes a single detrimental effect from target.',
imageId: 37, imageId: 37,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: Infinity, uses: Infinity,
cast: 1, cast: 1,
@ -509,6 +544,7 @@ const Actions: Array<LogosAction> = [
name: 'Incense L', name: 'Incense L',
description: "Gesture threateningly, placing yourself at the top of the target's enmity list and increasing enmity generation.", description: "Gesture threateningly, placing yourself at the top of the target's enmity list and increasing enmity generation.",
imageId: 38, imageId: 38,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: Infinity, uses: Infinity,
cast: 0, cast: 0,
@ -521,6 +557,7 @@ const Actions: Array<LogosAction> = [
name: 'Raise L', name: 'Raise L',
description: 'Resurrects target to a weakened state.', description: 'Resurrects target to a weakened state.',
imageId: 39, imageId: 39,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
cast: 3, cast: 3,
@ -532,6 +569,7 @@ const Actions: Array<LogosAction> = [
name: 'Bravery L', name: 'Bravery L',
description: "Increases target's damage dealt by 10%.", description: "Increases target's damage dealt by 10%.",
imageId: 40, imageId: 40,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
duration: 300, duration: 300,
@ -544,6 +582,7 @@ const Actions: Array<LogosAction> = [
name: 'Solid Shield L', name: 'Solid Shield L',
description: 'Reduces physical damage taken by 99%.', description: 'Reduces physical damage taken by 99%.',
imageId: 41, imageId: 41,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 30, uses: 30,
duration: 8, duration: 8,
@ -556,6 +595,7 @@ const Actions: Array<LogosAction> = [
name: 'Spell Shield L', name: 'Spell Shield L',
description: 'Reduces magic damage taken by 99%.', description: 'Reduces magic damage taken by 99%.',
imageId: 42, imageId: 42,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 30, uses: 30,
duration: 8, duration: 8,
@ -568,6 +608,7 @@ const Actions: Array<LogosAction> = [
name: 'Reflect L', name: 'Reflect L',
description: 'Creates a magic-reflecting barrier around self or party member.', description: 'Creates a magic-reflecting barrier around self or party member.',
imageId: 43, imageId: 43,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
duration: 10, duration: 10,
@ -580,6 +621,7 @@ const Actions: Array<LogosAction> = [
name: 'Smite L', name: 'Smite L',
description: 'Delivers an attack with a potency of 1,000.\nCan only be executed when your HP is below 50%.\nAdditional Effect: Restores an amount of own HP proportional to damage dealt.', description: 'Delivers an attack with a potency of 1,000.\nCan only be executed when your HP is below 50%.\nAdditional Effect: Restores an amount of own HP proportional to damage dealt.',
imageId: 44, imageId: 44,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 30, uses: 30,
cast: 0, cast: 0,
@ -591,6 +633,7 @@ const Actions: Array<LogosAction> = [
name: 'Refresh L', name: 'Refresh L',
description: 'Increases the amount of magia aether regenerated over time by self and nearby party members.', description: 'Increases the amount of magia aether regenerated over time by self and nearby party members.',
imageId: 45, imageId: 45,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
duration: 30, duration: 30,
@ -603,6 +646,7 @@ const Actions: Array<LogosAction> = [
name: 'Banish L', name: 'Banish L',
description: 'Deals unaspected damage with a potency of 200.\nAdditional Effect: Afflicts undead targets with Banish L, increasing damage taken by 25%.', description: 'Deals unaspected damage with a potency of 200.\nAdditional Effect: Afflicts undead targets with Banish L, increasing damage taken by 25%.',
imageId: 46, imageId: 46,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 99, uses: 99,
duration: 60, duration: 60,
@ -615,6 +659,7 @@ const Actions: Array<LogosAction> = [
name: 'Banish L III', name: 'Banish L III',
description: 'Deals unaspected damage with a potency of 150 to target and all enemies nearby it.\nAdditional Effect: Afflicts undead targets with Banish L, increasing damage taken by 25%.', description: 'Deals unaspected damage with a potency of 150 to target and all enemies nearby it.\nAdditional Effect: Afflicts undead targets with Banish L, increasing damage taken by 25%.',
imageId: 47, imageId: 47,
shorthand: 'banish 3',
type: 'Spell', type: 'Spell',
uses: 50, uses: 50,
duration: 60, duration: 60,
@ -627,6 +672,7 @@ const Actions: Array<LogosAction> = [
name: 'Magic Burst L', name: 'Magic Burst L',
description: 'Increases spell damage by 100% while increasing MP cost.', description: 'Increases spell damage by 100% while increasing MP cost.',
imageId: 48, imageId: 48,
shorthand: 'mb',
type: 'Ability', type: 'Ability',
uses: 10, uses: 10,
duration: 20, duration: 20,
@ -640,6 +686,7 @@ const Actions: Array<LogosAction> = [
description: description:
'Increases physical damage dealt while dealing damage to self over time.\nStacks increase every 3 seconds, up to a maximum of 16.\nFor each stack, physical damage dealt is increased by 15%, and potency of damage dealt to self increases by 1,200.', 'Increases physical damage dealt while dealing damage to self over time.\nStacks increase every 3 seconds, up to a maximum of 16.\nFor each stack, physical damage dealt is increased by 15%, and potency of damage dealt to self increases by 1,200.',
imageId: 49, imageId: 49,
shorthand: 'de',
type: 'Ability', type: 'Ability',
uses: 10, uses: 10,
duration: 48, duration: 48,
@ -652,6 +699,7 @@ const Actions: Array<LogosAction> = [
name: 'Eagle Eye Shot L', name: 'Eagle Eye Shot L',
description: "Delivers a ranged attack with a potency of 80.\nPotency increases up to 1,000% the lower the target's HP.\nGenerates significant enmity upon use.", description: "Delivers a ranged attack with a potency of 80.\nPotency increases up to 1,000% the lower the target's HP.\nGenerates significant enmity upon use.",
imageId: 50, imageId: 50,
shorthand: 'ees',
type: 'Weaponskill', type: 'Weaponskill',
uses: 30, uses: 30,
cast: 0, cast: 0,
@ -663,6 +711,7 @@ const Actions: Array<LogosAction> = [
name: 'Perception L', name: 'Perception L',
description: 'Reveals all traps within a 15-yalm radius.\nIf no traps exist within 15 yalms, detects whether any traps are present within a 36-yalm radius.\nOnly effective within dungeons.', description: 'Reveals all traps within a 15-yalm radius.\nIf no traps exist within 15 yalms, detects whether any traps are present within a 36-yalm radius.\nOnly effective within dungeons.',
imageId: 51, imageId: 51,
shorthand: '',
type: 'Ability', type: 'Ability',
uses: 99, uses: 99,
cast: 0, cast: 0,
@ -675,9 +724,9 @@ const Actions: Array<LogosAction> = [
}, },
{ {
name: 'Wisdom of the Elder', name: 'Wisdom of the Elder',
description: description: 'Increases magic damage dealt by 35% and magic defense by 1,000, while decreasing spell MP cost.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
'Increases magic damage dealt by 35% and magic defense by 1,000, while decreasing spell MP cost.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 52, imageId: 52,
shorthand: 'wote',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -692,6 +741,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Duelist', name: 'Wisdom of the Duelist',
description: 'Increases physical damage dealt by 40% and maximum HP by 15%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases physical damage dealt by 40% and maximum HP by 15%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 53, imageId: 53,
shorthand: 'wotd',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -706,6 +756,7 @@ const Actions: Array<LogosAction> = [
name: 'Wisdom of the Fiendhunter', name: 'Wisdom of the Fiendhunter',
description: 'Increases physical damage dealt by 25% and evasion by 25%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', description: 'Increases physical damage dealt by 25% and evasion by 25%.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 54, imageId: 54,
shorthand: 'wotf',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -721,6 +772,7 @@ const Actions: Array<LogosAction> = [
description: description:
'Increases defense by 2,000.\nGrants one stack of HP Boost each time damage equal to or greater than half of maximum HP is taken from a single-target attack.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.', 'Increases defense by 2,000.\nGrants one stack of HP Boost each time damage equal to or greater than half of maximum HP is taken from a single-target attack.\nCannot be used with other Wisdom abilities.\nEffect ends upon reuse or upon replacement of duty action.',
imageId: 55, imageId: 55,
shorthand: 'woti',
type: 'Spell', type: 'Spell',
uses: 3, uses: 3,
cast: 0, cast: 0,
@ -735,6 +787,7 @@ const Actions: Array<LogosAction> = [
name: 'Sacrifice L', name: 'Sacrifice L',
description: "Restores 100% of target's HP, even if target is KO'd.\nCannot be executed if currently afflicted with Doom.\nAdditional Effect: Inflicts Doom on self.", description: "Restores 100% of target's HP, even if target is KO'd.\nCannot be executed if currently afflicted with Doom.\nAdditional Effect: Inflicts Doom on self.",
imageId: 56, imageId: 56,
shorthand: '',
type: 'Spell', type: 'Spell',
uses: 10, uses: 10,
duration: 10, duration: 10,
@ -745,14 +798,15 @@ const Actions: Array<LogosAction> = [
}, },
]; ];
// add dps flag at runtime // add dps flag at runtime and shorthand name
Actions.forEach(action => { Actions.forEach((action) => {
if (action.jobs.includes('melee') || action.jobs.includes('ranged') || action.jobs.includes('magic')) { if (action.jobs.includes('melee') || action.jobs.includes('ranged') || action.jobs.includes('magic')) {
action.jobs.push('dps'); action.jobs.push('dps');
} }
}); });
const ActionNames = Actions.map((action) => action.name.toLowerCase()); const ActionNames = Actions.map((action) => action.name.toLowerCase());
const ActionShortNames = Actions.map((action) => action.shorthand);
const Presets: Map<string, Array<number>> = new Map([ const Presets: Map<string, Array<number>> = new Map([
['dps', [9, 10, 52, 14, 48]], ['dps', [9, 10, 52, 14, 48]],
@ -763,5 +817,6 @@ export default {
Mnemes, Mnemes,
Actions, Actions,
ActionNames, ActionNames,
ActionShortNames,
Presets, Presets,
}; };

View File

@ -69,7 +69,7 @@ const getJobs = (jobs: Array<string>): string => {
return jobIcons; return jobIcons;
}; };
const generateActionEmbed = (action: LogosAction): Embed => ({ const generateActionEmbed = (action: LogosAction, debug: boolean): Embed => ({
title: action.name, title: action.name,
description: `**${action.type}** | ${action.duration ? `**Duration:** ${getHumanDuration(action.duration)} | ` : ''}**Uses:** ${getActionUses(action.uses)} | **Cast:** ${getActionCast(action.cast)} | **Recast:** ${action.recast}s description: `**${action.type}** | ${action.duration ? `**Duration:** ${getHumanDuration(action.duration)} | ` : ''}**Uses:** ${getActionUses(action.uses)} | **Cast:** ${getActionCast(action.cast)} | **Recast:** ${action.recast}s
${getJobs(action.jobs)} ${getJobs(action.jobs)}
@ -82,6 +82,9 @@ ${action.description}`,
value: combo.map((mneme) => `${getMnemeEmoji(mneme)} ${data.Mnemes.get(mneme)}`).join('\n'), value: combo.map((mneme) => `${getMnemeEmoji(mneme)} ${data.Mnemes.get(mneme)}`).join('\n'),
inline: true, inline: true,
})), })),
footer: {
text: debug ? `Internal ID: ${action.imageId - 1}` : '',
},
}); });
export const generateEmbeds = (actions: Array<number>): Array<Embed> => actions.map((actionIdx) => generateActionEmbed(data.Actions[actionIdx])); export const generateEmbeds = (actions: Array<number>, debug: boolean): Array<Embed> => actions.map((actionIdx) => generateActionEmbed(data.Actions[actionIdx], debug));

1
src/types.d.ts vendored
View File

@ -2,6 +2,7 @@ export type LogosAction = {
name: string; name: string;
description: string; description: string;
imageId: number; imageId: number;
shorthand: string;
type: string; type: string;
uses: number; uses: number;
duration?: number; duration?: number;