Skip to content

Commit

Permalink
#1 Added Eureka lockbox methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Donnelly authored and James Donnelly committed Jun 23, 2019
1 parent c72d093 commit 5a0039d
Show file tree
Hide file tree
Showing 33 changed files with 188 additions and 68 deletions.
2 changes: 1 addition & 1 deletion data/currencies.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/items.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/npcs.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/de/barding.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/de/emotes.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/de/minions.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/de/mounts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/de/orchestrion.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/en/barding.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/en/emotes.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/en/minions.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/en/mounts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/en/orchestrion.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/fr/barding.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/fr/emotes.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/fr/minions.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/fr/mounts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/fr/orchestrion.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/icons/methods.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"1":[24,0,24,24],"2":[72,24,24,24],"3":[0,24,24,24],"4":[24,24,24,24],"5":[48,0,24,24],"6":[48,24,24,24],"7":[0,48,24,24],"8":[24,48,24,24],"c1":[48,48,24,24],"c2":[72,0,24,24],"c3":[0,0,24,24],"c4":[72,48,24,24],"c6":[0,72,24,24],"c7":[24,72,24,24],"c8":[48,72,24,24],"g1":[72,72,24,24],"g2":[96,0,24,24],"g3":[96,24,24,24],"q1":[96,48,24,24],"q2":[96,72,24,24],"q3":[0,96,24,24]}
{"1":[0,0,24,24],"2":[24,0,24,24],"3":[0,24,24,24],"4":[24,24,24,24],"5":[48,0,24,24],"6":[48,24,24,24],"7":[0,48,24,24],"8":[24,48,24,24],"9":[48,48,24,24],"c1":[72,0,24,24],"c2":[72,24,24,24],"c3":[72,48,24,24],"c4":[0,72,24,24],"c6":[24,72,24,24],"c7":[48,72,24,24],"c8":[72,72,24,24],"g1":[96,0,24,24],"g2":[96,24,24,24],"g3":[96,48,24,24],"q1":[96,72,24,24],"q2":[0,96,24,24],"q3":[24,96,24,24]}
Binary file modified docs/icons/methods.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/ja/barding.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ja/emotes.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ja/minions.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ja/mounts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ja/orchestrion.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
179
194
14 changes: 13 additions & 1 deletion extensions/items-for-exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,17 @@ module.exports = [
// Gold-trimmed Sack
16173,
// Anemos Lockbox
22508
22508,
// Pagos Lockbox
23142,
// Cold-warped Lockbox
23379,
// Pyros Lockbox
24141,
// Heat-warped Lockbox
24142,
// Hydatos Lockbox
24848,
// Moisture-warped Lockbox
24849
];
22 changes: 21 additions & 1 deletion extensions/npcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = [
1028400, 1016093, 1023940, 1023794, 1018128, 1018129, 1018130, 1017844, 1017230, 1012135,
1016902, 1016903, 1016904, 1005159, 1025313, 1017172, 1016264, 1019804, 1010753, 1010757,
1010761, 1010780, 1010781, 1010782, 1010790, 1010791, 1010792, 1010793, 1010794, 1010795,
1005970, 1009290, 1005790, 1005792, 1005794, 1010175
1005970, 1009290, 1005790, 1005792, 1005794, 1010175, 1025048, 1025950, 1026502, 1027127
].map(id => {
let location;
let x;
Expand Down Expand Up @@ -126,6 +126,26 @@ module.exports = [
x = 12;
y = 12;
break;
case 1025048: // Expedition Lockpick (Eureka Anemos)
location = 732;
x = 18;
y = 31;
break;
case 1025950: // Expedition Lockpick (Eureka Pagos)
location = 763;
x = 3;
y = 25;
break;
case 1026502: // Expedition Lockpick (Eureka Pyros)
location = 795;
x = 16;
y = 23;
break;
case 1027127: // Expedition Lockpick (Eureka Hydatos)
location = 827;
x = 20;
y = 14;
break;
default:
throw new Error(`NPC extension ${id} added to array but not handled in mapping.`);
}
Expand Down
86 changes: 83 additions & 3 deletions extensions/obtain-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ module.exports = {
],
58: [
{ fn: mogStation, args: [] }
],
61: [
// Anemos Lockbox
{ fn: itemExchange, args: [22508, 1025048] }
],
66: [
// Heat-warped Lockbox
{ fn: itemExchange, args: [24142, 1026502] }
]
},
emotes: {
Expand Down Expand Up @@ -107,6 +115,20 @@ module.exports = {
],
153: [
{ fn: mogStation, args: [] }
],
181: [
// Pagos Lockbox
{ fn: itemExchange, args: [23142, 1025950] },
// Cold-warped Lockbox
{ fn: itemExchange, args: [23379, 1025950] }
],
189: [
// Heat-warped Lockbox
{ fn: itemExchange, args: [24142, 1026502] }
],
195: [
// Moisture-warped Lockbox
{ fn: itemExchange, args: [24849, 1027127] }
]
},
minions: {
Expand Down Expand Up @@ -426,6 +448,18 @@ module.exports = {
// Sigmascape V4.0 (Savage)
{ fn: instancedContent, args: [instances.find(instance => instance.id === 30066)] }
],
285: [
// Anemos Lockbox
{ fn: itemExchange, args: [22508, 1025048] }
],
286: [
// Anemos Lockbox
{ fn: itemExchange, args: [22508, 1025048] }
],
287: [
// Anemos Lockbox
{ fn: itemExchange, args: [22508, 1025048] }
],
289: [
// The Hidden Canals of Uznair
{ fn: instancedContent, args: [instances.find(instance => instance.id === 55003)] }
Expand All @@ -434,6 +468,14 @@ module.exports = {
// The Swallow's Compass
{ fn: instancedContent, args: [instances.find(instance => instance.id === 61)] }
],
295: [
// Pagos Lockbox
{ fn: itemExchange, args: [23142, 1025950] }
],
296: [
// Pagos Lockbox
{ fn: itemExchange, args: [23142, 1025950] }
],
299: [
// The Ridorana Lighthouse
{ fn: instancedContent, args: [instances.find(instance => instance.id === 30068)] }
Expand All @@ -455,6 +497,16 @@ module.exports = {
// Saint Mociannes Arboretum (Hard)
{ fn: instancedContent, args: [instances.find(instance => instance.id === 62)] }
],
315: [
// Pyros Lockbox
{ fn: itemExchange, args: [24141, 1026502] },
// Heat-warped Lockbox
{ fn: itemExchange, args: [24142, 1026502] }
],
319: [
// Moisture-warped Lockbox
{ fn: itemExchange, args: [24849, 1027127] }
],
321: [
// The Ghimlyt Dark
{ fn: instancedContent, args: [instances.find(instance => instance.id === 64)] }
Expand Down Expand Up @@ -634,7 +686,7 @@ module.exports = {
],
150: [
// Anemos Lockbox
{ fn: itemExchange, args: [16173] }
{ fn: itemExchange, args: [22508, 1025048] }
],
156: [
// Sigmascape V4.0 (Savage)
Expand All @@ -660,6 +712,16 @@ module.exports = {
// The Wreath of Snakes (Extreme)
{ fn: instancedContent, args: [instances.find(instance => instance.id === 20061)] }
]
},
orchestrion: {
288: [
// Hydatos Lockbox
{ fn: itemExchange, args: [24848, 1027127] }
],
289: [
// Moisture-warped Lockbox
{ fn: itemExchange, args: [24849, 1027127] }
]
}
};

Expand Down Expand Up @@ -749,18 +811,36 @@ function instancedContent(contentId, instance, language) {
* Item exchange rewards.
* @param {Number} contentId - The ID of the content
* @param {Number} itemId - The item's ID
* @param {Number} npcId - The id of the NPC which accepts the item
* @param {String} language - The localisation code (e.g. `"en"`)
*/
function itemExchange(contentId, itemId, language) {
function itemExchange(contentId, itemId, npcId, language) {
const item = items.misc.find(item => item.id === itemId);

if (!item) {
console.warn(`Unable to find an exchange item with ID ${itemId}. Skipping.`);
return;
}

const npc = npcs.find(npc => npc.id === npcId);

if (!npc) {
console.warn(`Unable to find NPC with ID ${npcId} for exchange item ID ${itemId}. Skipping.`);
return;
}

if (!npc.location) {
console.warn(`Missing location data for item exchange NPC ${npcId}. Skipping.`);
return;
}

const map = maps.find(map => map.id === npc.location);

return _localisationHelper.itemExchangeShort({
contentId,
name: item.name,
item,
map,
npc
}, language);
}

Expand Down
Binary file modified icons-raw/methods/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/APICrawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ module.exports = class APICrawler {
console.warn(error);

if (this.errors > 10) {
console.warn(`The below error was thrown using:\n\n ${apiUrl} \n\n`)
throw new Error(`XIVDB API error: ${error}.`);
}

Expand Down Expand Up @@ -354,6 +355,7 @@ module.exports = class APICrawler {
const totalResultsFromAPI = await this[this.config.method](undefined, -1);

if (totalResultsFromAPI !== cachedData.totalResults) {
console.info(`➕ Found ${totalResultsFromAPI - cachedData.totalResults} new entries...`);
return false;
}

Expand Down
8 changes: 7 additions & 1 deletion src/config/_localisationHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ module.exports = {
itemExchangeShort: (entry, language) => ([
'itemExchangeShort',
9,
[entry.name[language]]
[
entry.item.name[language],
entry.npc.name[language],
entry.map.name[language],
entry.npc.x,
entry.npc.y
]
]),
legacyLevelGoalShort: (entry, language) => ([
'legacyLevelGoalShort',
Expand Down
74 changes: 37 additions & 37 deletions src/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,35 +161,35 @@ class API {
const currencies = await this.crawl(config.currencies);
require('./parsers/currencies')(currencies);

// Gathering.
const fishingSpots = await this.crawl(config.gathering.fishingSpots);
const gatheringItems = await this.crawl(config.gathering.items);
const gatheringPoints = await this.crawl(config.gathering.points);
const gatheringTypes = await this.crawl(config.gathering.types);
const spearFishingItems = await this.crawl(config.gathering.spearFishingItems);
require('./parsers/gathering')(
gatheringPoints,
gatheringItems,
gatheringTypes,
fishingSpots,
spearFishingItems
);

// Custom Talk entries.
const customTalk = await this.crawl(config.customTalk);
await require('./parsers/customTalk')(customTalk);

// Special shop data.
const specialShops = await this.crawl(config.shops.specialShops);
await require('./parsers/specialShops')(specialShops);

// // Shops.
const eNPCResidents = await this.crawl(config.shops.eNPCResident);
const gcScripShopItems = await this.crawl(config.shops.gcScripShopItem);
require('./parsers/shops')(
eNPCResidents,
gcScripShopItems
);
// // Gathering.
// const fishingSpots = await this.crawl(config.gathering.fishingSpots);
// const gatheringItems = await this.crawl(config.gathering.items);
// const gatheringPoints = await this.crawl(config.gathering.points);
// const gatheringTypes = await this.crawl(config.gathering.types);
// const spearFishingItems = await this.crawl(config.gathering.spearFishingItems);
// require('./parsers/gathering')(
// gatheringPoints,
// gatheringItems,
// gatheringTypes,
// fishingSpots,
// spearFishingItems
// );

// // Custom Talk entries.
// const customTalk = await this.crawl(config.customTalk);
// await require('./parsers/customTalk')(customTalk);

// // Special shop data.
// const specialShops = await this.crawl(config.shops.specialShops);
// await require('./parsers/specialShops')(specialShops);

// // // Shops.
// const eNPCResidents = await this.crawl(config.shops.eNPCResident);
// const gcScripShopItems = await this.crawl(config.shops.gcScripShopItem);
// require('./parsers/shops')(
// eNPCResidents,
// gcScripShopItems
// );

// // Map data.
const maps = await this.crawl(config.maps);
Expand All @@ -200,18 +200,18 @@ class API {
await require('./parsers/mappy')(npcs);

console.info('Finished parsing of misc required data.');
console.info('Starting parsing of obtain method data...');
// console.info('Starting parsing of obtain method data...');

const quests = await this.crawl(config.quests);
require('./parsers/quests')(quests);
// const quests = await this.crawl(config.quests);
// require('./parsers/quests')(quests);

const recipes = await this.crawl(config.recipes);
require('./parsers/recipes')(recipes);
// const recipes = await this.crawl(config.recipes);
// require('./parsers/recipes')(recipes);

const instances = await this.crawl(config.instances);
require('./parsers/instances')(instances);
// const instances = await this.crawl(config.instances);
// require('./parsers/instances')(instances);

console.info('Finished parsing of obtain methods.');
// console.info('Finished parsing of obtain methods.');
console.timeEnd('Data');
return;
}
Expand Down

0 comments on commit 5a0039d

Please sign in to comment.