This commit is contained in:
theBowja 2021-12-04 14:22:30 -05:00
parent 9c8fdedd43
commit ad1c09dca8
7 changed files with 135 additions and 8 deletions

View File

@ -19,7 +19,7 @@ function collateCharacter(lang) {
data.name = language[obj.NameTextMapHash];
if(isPlayer(obj)) data.name = language[playerIdToTextMapHash[obj.Id]];
//if(data.name === 'Traveler') data.name = capitalizeFirst(avatarIdToFileName[obj.Id]);
data.description = language[obj.DescTextMapHash];
data.description = sanitizeDescription(language[obj.DescTextMapHash]);
data.weapontype = language[weaponTextMapHash[obj.WeaponType]];
data.body = obj.BodyType.slice(obj.BodyType.indexOf('BODY_')+5);
data.rarity = obj.QualityType === 'QUALITY_PURPLE' ? '4' : '5';

View File

@ -63,6 +63,8 @@ function getDomainEntranceTextMapHash(englishname) {
return mapping("UI_DUNGEON_ENTRY_310");
else if(englishname.includes('sunken sands') || englishname.includes('altar of sands') || englishname.includes('sand burial'))
return mapping("UI_DUNGEON_ENTRY_368");
else if(englishname.includes('necropolis'))
return mapping("UI_DUNGEON_ENTRY_433")
else
console.log('no domain entrance mapping found for '+englishname);
}

View File

@ -48,6 +48,11 @@ const monsterMap = {
"bless unyield iii": ['la py slime', 'blaz axe mita', 'rock shield mita'],
"bless unyield iv": ['geovish'],
"bless necropolis i": ['crack axe mita', 'la hy slime', 'hy slime'],
"bless necropolis ii": ['crack axe mita', 'la hy slime', 'hy slime', 'el hili shoot', 'hili berserk'],
"bless necropolis iii": ['thunder hound', 'thunder hound whelp', 'el hili shooter'],
"bless necropolis iv": ['thunder hound', 'thunder hound whelp', 'crack axe mita'],
"forge alt sand i": ['hy slime', 'la hy slime', 'py slime', 'la py slime'],
"forge alt sand ii": ['la hy slime', 'la py slime'],
"forge alt sand iii": ['la hy slime', 'la py slime', 'hy ab mage', 'py ab mage'],

View File

@ -7,7 +7,6 @@ const xcity = getExcel('CityConfigData');
const xmonster = getExcel('MonsterExcelConfigData');
const xcodex = getExcel('AnimalCodexExcelConfigData');
const xinvest = getExcel('InvestigationMonsterConfigData');
const xdescribe = getExcel('MonsterDescribeExcelConfigData');
const xspecial = getExcel('MonsterSpecialNameExcelConfigData');
@ -35,15 +34,53 @@ function collateEnemy(lang) {
let mon = xmonster.find(m => m.Id === obj.Id);
let des = xdescribe.find(d => d.Id === obj.DescribeId);
let spe = xspecial.find(s => s.SpecialNameLabID === des.SpecialNameLabID);
let inv = findInvestigation(obj.Id);
if(!spe) console.log('no special for '+obj.Id);
let data = {};
data.Id = obj.Id;
data.NameTextMapHash = des.NameTextMapHash;
data.name = language[des.NameTextMapHash];
data.specialname = language[spe.SpecialNameTextMapHash];
if(inv) {
data.investigation = {};
data.investigation.name = language[inv.NameTextMapHash];
data.investigation.category = language[xmanualtext.find(e => e.TextMapId === `INVESTIGATION_${inv.MonsterCategory.toUpperCase()}_MONSTER`).TextMapContentTextMapHash];
data.investigation.description = language[inv.DescTextMapHash];
if(language[inv.LockDescTextMapHash] !== "") data.investigation.lockdesc = language[inv.LockDescTextMapHash];
data.investigationicon = inv.Icon;
// REWARD PREVIEW
let rewardpreview = xpreview.find(pre => pre.Id === inv.RewardPreviewId).PreviewItems.filter(pre => pre.Id);
data.rewardpreview = mapRewardList(rewardpreview, language);
} else {
if(obj.Id === 20020101) { // Eye of the Storm
data.rewardpreview = mapRewardList(eyestormreward, language);
} else if(obj.Id === 21011501) { // Unusual Hilichurl
data.rewardpreview = mapRewardList(unusualreward, language);
} else if(obj.Id === 22030101 || obj.Id === 22020101 ||
obj.Id === 26060201 || obj.Id === 26060101 || obj.Id === 26060301) {
// Abyss Lector: Violet Lightning, Abyss Herald: Wicked Torrents
// Hydro Cicin, Electro Cicin, Cryo Cicin
data.rewardpreview = [];
} else if(obj.Id === 29010101) { // dvalin lvl90
let rewardpreview = xpreview.find(pre => pre.Id === 15005).PreviewItems.filter(pre => pre.Id);
data.rewardpreview = mapRewardList(rewardpreview, language);
} else if(obj.Id === 29020101) { // wolfboss lvl90
let rewardpreview = xpreview.find(pre => pre.Id === 15010).PreviewItems.filter(pre => pre.Id);
data.rewardpreview = mapRewardList(rewardpreview, language);
} else if(obj.Id === 29030101) { // childe lvl90
let rewardpreview = xpreview.find(pre => pre.Id === 15014).PreviewItems.filter(pre => pre.Id);
data.rewardpreview = mapRewardList(rewardpreview, language);
} else if(obj.Id === 29040101) { // azhdaha lvl90
let rewardpreview = xpreview.find(pre => pre.Id === 15018).PreviewItems.filter(pre => pre.Id);
data.rewardpreview = mapRewardList(rewardpreview, language);
} else if(obj.Id === 29050101) { // signora lvl90
let rewardpreview = xpreview.find(pre => pre.Id === 15034).PreviewItems.filter(pre => pre.Id);
data.rewardpreview = mapRewardList(rewardpreview, language);
}
}
if(!data.rewardpreview) console.log('no reward list for '+data.name);
let sub = obj.SubType || 'CODEX_SUBTYPE_ELEMENTAL';
sub = sub.slice(sub.lastIndexOf('_')+1);
@ -99,4 +136,79 @@ function collateEnemy(lang) {
return mymonster;
}
function findInvestigation(monId) {
const xinvest = getExcel('InvestigationMonsterConfigData');
if(monId === 21011601) monId = 21010601; // Electro Hilichurl Grenadier
else if(monId === 21020701) monId = 21020101; // Crackling Axe Mitachurl
else if(monId === 21020801) monId = 21020401; // Thunderhelm Lawachurl
else if(monId === 21030601) monId = 21030101; // Electro Samachurl
else if(monId === 22010401) monId = 22010101; // Electro Abyss Mage
else if(monId === 26010301) monId = 26010201; // Electro Whopperflower
// Hydro Cicin
// Electro Cicin
// Cryo Cicin
// Stormterror
// Lupus Boreas, Dominator of Wolves
// Childe
// Azhdaha
// La Signora
return xinvest.find(i => i.MonsterIdList.includes(monId));
}
function mapRewardList(rewardlist, language) {
const xmat = getExcel('MaterialExcelConfigData');
const xdisplay = getExcel('DisplayItemExcelConfigData');
return rewardlist.map(repre => {
let mat = xmat.find(m => m.Id === repre.Id);
if(mat) { // is material
let reward = { name: language[mat.NameTextMapHash] };
if(repre.Count && repre.Count !== "") reward.count = parseFloat(repre.Count);
return reward;
} else { // is artifact
let disp = xdisplay.find(d => d.Id === repre.Id);
return { name: language[disp.NameTextMapHash], rarity: disp.RankLevel+'' };
}
});
}
const eyestormreward = [
{
"Id": 202
},
{
"Id": 400022
},
{
"Id": 400032
},
{
"Id": 400042
},
{
"Id": 400062
},
{
"Id": 400023
},
{
"Id": 400033
},
{
"Id": 400043
}
];
const unusualreward = [
{
"Id": 102 // Adventure EXP
},
{
"Id": 202 // Mora
},
{
"Id": 100018// Cabbage
}
]
module.exports = collateEnemy;

View File

@ -27,6 +27,7 @@ function collateFood(lang) {
let data = {};
data.name = language[obj.NameTextMapHash];
data.Id = obj.Id;
data.rarity = obj.RankLevel;
data.foodtype = 'NORMAL';
data.foodfilter = language[getManualTextMapHash(obj.FoodType)];

View File

@ -3,12 +3,15 @@ MATERIAL_AVATAR_MATERIAL is talent level-up material, etc.
*/
const filter = ['MATERIAL_EXCHANGE', 'MATERIAL_WOOD', 'MATERIAL_AVATAR_MATERIAL', 'MATERIAL_EXP_FRUIT', 'MATERIAL_WEAPON_EXP_STONE'];
const filter = ['MATERIAL_EXCHANGE', 'MATERIAL_WOOD', 'MATERIAL_AVATAR_MATERIAL', 'MATERIAL_EXP_FRUIT',
'MATERIAL_WEAPON_EXP_STONE', 'MATERIAL_CONSUME', 'MATERIAL_FISH_BAIT', 'MATERIAL_FISH_ROD'];
// Adventure EXP, Mora, Primogems, Companionship EXP, Apple, Sunsettia
const includeMatId = [102, 202, 201, 105, 100001, 100002];
// Crafted Items, Primordial Essence, Raw Meat (S), Fowl (S)
const excludeMatId = [110000, 112001, 100086, 100087];
// Crafted Items, Primordial Essence, Raw Meat (S), Fowl (S), Original Essence (Invalidated), Original Resin (Invalidated)
// Scarlet Quartz, Scarlet Quartz, Test Stamina Growth Item, Test Temporary stamina Growth Item
const excludeMatId = [110000, 112001, 100086, 100087, 210, 211,
101005, 101007, 106000, 106001];
function sortMaterials(mata, matb) {
if(mata.Rank < matb.Rank) return -1;
@ -34,6 +37,10 @@ function collateMaterial(lang) {
if(excludeMatId.includes(obj.Id)) return accum;
if(!filter.includes(obj.MaterialType)) return accum;
}
if(obj.Icon === "UI_ItemIcon_109000") return accum; // skip recipes
else if(obj.Icon === "UI_ItemIcon_221003") return accum; // skip diagrams
else if(obj.Icon === "UI_ItemIcon_221035") return accum; // skip bait blueprint
else if(obj.Icon === "UI_ItemIcon_221001") return accum; // skip instruction blueprints
let data = {};
data.Id = obj.Id;

View File

@ -31,7 +31,7 @@ global.makeFileName = function(str, lang) { return normalizeStr(str).toLowerCase
global.convertBold = function(str) { return str.replace(/<color=#FFD780FF>(.*?)<\/color>/gi, '**$1**'); }
global.stripHTML = function(str) { return (str || '').replace(/(<([^>]+)>)/gi, ''); }
global.capitalizeFirst = function(str) { return str[0].toUpperCase() + str.toLowerCase().slice(1); }
global.replaceLayout = function(str) { return str.replace(/{LAYOUT_MOBILE#.*?}{LAYOUT_PC#(.*?)}{LAYOUT_PS#.*?}/gi,'$1').replace('#',''); }
global.replaceLayout = function(str) { return str.replace(/{LAYOUT_MOBILE#.*?}{LAYOUT_PC#(.*?)}{LAYOUT_PS#.*?}/gi,'$1').replace('#','').replaceAll('{NON_BREAK_SPACE}', ' '); }
global.replaceNewline = function(str) { return str.replace(/\\n/gi, '\n'); }
global.sanitizeDescription = function(str) { return replaceNewline(replaceLayout(stripHTML(convertBold(str)))); }
/* ======================================================================================= */
@ -109,7 +109,7 @@ function exportData(folder, collateFunc, englishonly, skipwrite) {
// exportData('foods', require('./collateFood'));
// exportData('materials', require('./collateMaterial')); // run twice
// exportData('domains', require('./collateDomain')); // run twice // remember to add back recommendedelements and disorder and entrypicpath
// exportData('enemies', require('./collateEnemy'));
exportData('enemies', require('./collateEnemy'), true);
// exportData('domains', require('./collateDomainMonsterList')); // run only after both domains and enemies have run. sync
// exportCurve('enemies', 'MonsterCurveExcelConfigData');