From 0a0ee47d0d745b3ae432764b32c11d06592ea060 Mon Sep 17 00:00:00 2001 From: theBowja Date: Mon, 30 May 2022 16:59:09 -0400 Subject: [PATCH] fix property names also added adventureranks --- myscripts/collateAchievement.js | 56 ++++---- myscripts/collateAchievementGroup.js | 20 +-- myscripts/collateAdventureRank.js | 50 +++++++ myscripts/collateAnimal.js | 25 ++-- myscripts/collateArtifact.js | 34 ++--- myscripts/collateCharacter.js | 104 +++++++------- myscripts/collateCommission.js | 26 ++-- myscripts/collateConstellation.js | 24 ++-- myscripts/collateDomain.js | 188 ++++++++++++------------ myscripts/collateDomainMonsterList.js | 14 +- myscripts/collateEnemy.js | 197 +++++++++++++------------- myscripts/collateFishingPoint.js | 50 +++---- myscripts/collateFood.js | 76 +++++----- myscripts/collateGeography.js | 19 ++- myscripts/collateMaterial.js | 65 +++++---- myscripts/collateNamecard.js | 24 ++-- myscripts/collateOutfit.js | 42 +++--- myscripts/collateTalent.js | 64 ++++----- myscripts/collateVoiceover.js | 32 ++--- myscripts/collateWeapon.js | 80 +++++------ myscripts/collateWindGlider.js | 26 ++-- myscripts/myscript.js | 52 +++---- package-lock.json | 14 +- package.json | 2 +- 24 files changed, 678 insertions(+), 606 deletions(-) create mode 100644 myscripts/collateAdventureRank.js diff --git a/myscripts/collateAchievement.js b/myscripts/collateAchievement.js index 635c45519..51c31d4af 100644 --- a/myscripts/collateAchievement.js +++ b/myscripts/collateAchievement.js @@ -6,19 +6,19 @@ const xmat = getExcel('MaterialExcelConfigData'); function collateAchievement(lang) { const language = getLanguage(lang); let myachievement = xachieve.reduce((accum, obj) => { - if(obj.IsDeleteWatcherAfterFinish === true) { - // console.log(`disuse: ${obj.Id} ${language[obj.TitleTextMapHash]}`) + if(obj.isDisuse === true) { + // console.log(`disuse: ${obj.id} ${language[obj.titleTextMapHash]}`) return accum; } - if(obj.Id === 84517) return accum; // Instant Karma achievement is unobtainable + if(obj.id === 84517) return accum; // Instant Karma achievement is unobtainable - if(obj.PreStageAchievementId) { - if(language[obj.DescTextMapHash] === '') return accum; - let data = Object.values(accum).find(ele => ele.Id.includes(obj.PreStageAchievementId)); - data.Id.push(obj.Id); + if(obj.preStageAchievementId) { + if(language[obj.descTextMapHash] === '') return accum; + let data = Object.values(accum).find(ele => ele.id.includes(obj.preStageAchievementId)); + data.id.push(obj.id); data.stages = data.stages + 1; - if(data.stages > 3) console.log(`achievement ${obj.Id} has more than 3 stages`); + if(data.stages > 3) console.log(`achievement ${obj.id} has more than 3 stages`); data['stage'+data.stages] = addStage(obj, language); @@ -26,24 +26,24 @@ function collateAchievement(lang) { } let data = {}; - data.Id = [obj.Id]; + data.id = [obj.id]; - data.name = language[obj.TitleTextMapHash]; + data.name = language[obj.titleTextMapHash]; if(data.name === '') return accum; - data.achievementgroup = language[xgoal.find(e => e.Id === obj.GoalId).NameTextMapHash]; - data.ishidden = obj.IsShow === 'SHOWTYPE_HIDE' ? true : undefined; - data.sortorder = obj.OrderId; + data.achievementgroup = language[xgoal.find(e => e.id === obj.goalId).nameTextMapHash]; + data.ishidden = obj.isShow === 'SHOWTYPE_HIDE' ? true : undefined; + data.sortorder = obj.orderId; data.stages = 1; data['stage'+data.stages] = addStage(obj, language); - let filename = makeFileName(getLanguage('EN')[obj.TitleTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.titleTextMapHash]); if(filename === '') return accum; if(accum[filename] !== undefined) { - if(obj.Id !== 84004 && obj.Id !== 86007) - console.log('filename collision: ' + filename + ' disuse: ' + obj.IsDisuse); + if(obj.id !== 84004 && obj.id !== 86007) + console.log('filename collision: ' + filename + ' disuse: ' + obj.isDisuse); filename+='a'; } // if(accum[filename] !== undefined) return accum; @@ -51,7 +51,7 @@ function collateAchievement(lang) { return accum; }, {}); - const groups = [...new Set(xgoal.map(e => language[e.NameTextMapHash]))]; + const groups = [...new Set(xgoal.map(e => language[e.nameTextMapHash]))]; // for(const g of groups) { showNumber(myachievement, g); }; console.log('total: ' + Object.values(myachievement).reduce((accum, ele) => { accum+=ele.stages; return accum }, 0)); @@ -71,19 +71,19 @@ function showNumber(myachievement, group) { function addStage(obj, language) { let out = {}; - out.title = language[obj.TitleTextMapHash]; - if(language[obj.Ps5TitleTextMapHash] !== '') - out.ps5title = language[obj.Ps5TitleTextMapHash]; - out.description = sanitizeDescription(language[obj.DescTextMapHash]); - out.progress = obj.Progress; - const rewards = xreward.find(e => e.RewardId === obj.FinishRewardId).RewardItemList.filter(f => f.ItemId); - if(rewards.length === 0) console.log(`achievement ${obj.Id} has no rewards`); - if(rewards.length > 1) console.log(`achievement ${obj.Id} has multiple rewards`); - if(rewards[0].ItemId !== 201) console.log(`achievement ${obj.Id} has non-primogem reward`); + out.title = language[obj.titleTextMapHash]; + if(language[obj.ps5TitleTextMapHash] !== '') + out.ps5title = language[obj.ps5TitleTextMapHash]; + out.description = sanitizeDescription(language[obj.descTextMapHash]); + out.progress = obj.progress; + const rewards = xreward.find(e => e.rewardId === obj.finishRewardId).rewardItemList.filter(f => f.itemId); + if(rewards.length === 0) console.log(`achievement ${obj.id} has no rewards`); + if(rewards.length > 1) console.log(`achievement ${obj.id} has multiple rewards`); + if(rewards[0].itemId !== 201) console.log(`achievement ${obj.id} has non-primogem reward`); out.reward = rewards.map(ele => { return { - name: language[xmat.find(mat => mat.Id === ele.ItemId).NameTextMapHash], - count: ele.ItemCount + name: language[xmat.find(mat => mat.id === ele.itemId).nameTextMapHash], + count: ele.itemCount }; })[0]; return out; diff --git a/myscripts/collateAchievementGroup.js b/myscripts/collateAchievementGroup.js index e4fa6a083..e6159364e 100644 --- a/myscripts/collateAchievementGroup.js +++ b/myscripts/collateAchievementGroup.js @@ -6,26 +6,26 @@ function collateAchievementGroup(lang) { const language = getLanguage(lang); let myachievementgroup = xgroup.reduce((accum, obj) => { let data = {}; - data.Id = obj.Id; + data.id = obj.id; - data.name = language[obj.NameTextMapHash]; - data.sortorder = obj.OrderId; + data.name = language[obj.nameTextMapHash]; + data.sortorder = obj.orderId; - if(obj.FinishRewardId) { - const rewards = xreward.find(e => e.RewardId === obj.FinishRewardId).RewardItemList.filter(f => f.ItemId); - if(rewards.length > 1) console.log(`achievementgroup ${obj.Id} has multiple rewards`); + if(obj.finishRewardId) { + const rewards = xreward.find(e => e.rewardId === obj.finishRewardId).rewardItemList.filter(f => f.itemId); + if(rewards.length > 1) console.log(`achievementgroup ${obj.id} has multiple rewards`); data.reward = rewards.map(ele => { return { - name: language[xmat.find(mat => mat.Id === ele.ItemId).NameTextMapHash], - // count: ele.ItemCount + name: language[xmat.find(mat => mat.id === ele.itemId).nameTextMapHash], + // count: ele.itemCount }; })[0]; } - data.nameicon = obj.IconPath; + data.nameicon = obj.iconPath; - let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(filename === '') return accum; if(accum[filename] !== undefined) console.log('filename collision: ' + filename); accum[filename] = data; diff --git a/myscripts/collateAdventureRank.js b/myscripts/collateAdventureRank.js new file mode 100644 index 000000000..30614f034 --- /dev/null +++ b/myscripts/collateAdventureRank.js @@ -0,0 +1,50 @@ +const xmat = getExcel('MaterialExcelConfigData'); +const xsource = getExcel('MaterialSourceDataExcelConfigData'); +const xplevel = getExcel('PlayerLevelExcelConfigData'); +const xreward = getExcel('RewardExcelConfigData'); +const xartifact = getExcel('ReliquaryExcelConfigData'); +const xweapon = getExcel('WeaponExcelConfigData'); + +function collateAdventureRank(lang) { + const language = getLanguage(lang); + let myadventurerank = xplevel.reduce((accum, obj) => { + let data = {}; + data.id = obj.id; + // data.rankLevel = obj.rankLevel; // all rarity 4 + + data.name = obj.level+""; + data.exp = obj.exp; + data.unlockdescription = sanitizeDescription(language[obj.unlockDescTextMapHash]); + + if(obj.rewardId) { + const rewards = xreward.find(e => e.rewardId === obj.rewardId).rewardItemList.filter(f => f.itemId); + data.reward = rewards.map(ele => { + let item; + let type; + if(item = xmat.find(mat => mat.id === ele.itemId)) + type = "MATERIAL"; + else if(item = xartifact.find(d => d.id === ele.itemId)) + type = "ARTIFACT"; + else if(item = xweapon.find(w => w.id === ele.itemId)) + type = "WEAPON"; + return { + name: language[item.nameTextMapHash], + count: ele.itemCount, + type: type + }; + }); + } else { + data.reward = []; + } + + let filename = obj.level+""; + if(filename === '') return accum; + if(accum[filename] !== undefined) console.log('filename collision: ' + filename); + accum[filename] = data; + return accum; + }, {}); + + return myadventurerank; +} + +module.exports = collateAdventureRank; \ No newline at end of file diff --git a/myscripts/collateAnimal.js b/myscripts/collateAnimal.js index a1bd2e978..827880668 100644 --- a/myscripts/collateAnimal.js +++ b/myscripts/collateAnimal.js @@ -4,26 +4,31 @@ const xcodex = getExcel('AnimalCodexExcelConfigData'); const xdescribe = getExcel('AnimalDescribeExcelConfigData'); const xcapture = getExcel('CaptureExcelConfigData'); +// FIX THIS EVERY VERSION +const propCOUNTTYPE = "OCCLHPBCDGL"; + function collateAnimal(lang) { const language = getLanguage(lang); let mydata = xcodex.reduce((accum, obj) => { - if(obj.Type === 'CODEX_MONSTER') return accum; - if(obj.IsDeleteWatcherAfterFinish) return accum; + if(obj.type === 'CODEX_MONSTER') return accum; + if(obj.isDisuse) return accum; let data = {}; - data.Id = obj.Id; + data.id = obj.Id; - let mydescribe = xdescribe.find(ele => ele.Id === obj.DescribeId); + let mydescribe = xdescribe.find(ele => ele.id === obj.describeId); - data.name = language[mydescribe.NameTextMapHash]; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); - data.category = language[xmanualtext.find(ele => ele.TextMapId === `UI_CODEX_ANIMAL_CATEGORY_${obj.SubType.substring(obj.SubType.lastIndexOf('_')+1)}`).TextMapContentTextMapHash] - data.capturable = xcapture.find(ele => ele.MonsterID === obj.Id) ? true : undefined; + data.name = language[mydescribe.nameTextMapHash]; + data.description = sanitizeDescription(language[obj.descTextMapHash]); + data.category = language[xmanualtext.find(ele => ele.textMapId === `UI_CODEX_ANIMAL_CATEGORY_${obj.subType.substring(obj.subType.lastIndexOf('_')+1)}`).textMapContentTextMapHash] + // data.capturable = xcapture.find(ele => ele.monsterID === obj.Id) ? true : undefined; + let counttype = obj[propCOUNTTYPE] || "_NONE"; + data.counttype = counttype.substring(counttype.lastIndexOf('_')+1); data.sortorder = obj.SortOrder; - data.nameicon = mydescribe.Icon; + data.nameicon = mydescribe.icon; - let filename = makeFileName(getLanguage('EN')[mydescribe.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[mydescribe.nameTextMapHash]); if(filename === '') return accum; if(accum[filename] !== undefined) console.log('filename collision: ' + filename); accum[filename] = data; diff --git a/myscripts/collateArtifact.js b/myscripts/collateArtifact.js index 4a2805ff1..7368a485f 100644 --- a/myscripts/collateArtifact.js +++ b/myscripts/collateArtifact.js @@ -9,26 +9,26 @@ function collateArtifact(lang) { const xrefine = getExcel('EquipAffixExcelConfigData'); let myartifact = xsets.reduce((accum, obj) => { - if(obj.SetIcon === '') return accum; + if(obj.setIcon === '') return accum; let setname; let filename; let data = {}; // get available rarities data.rarity = xreliccodex.reduce((accum, relic) => { - if(obj.SetId !== relic.SuitId) return accum; - relic.Level = relic.Level.toString(); - if(accum.indexOf(relic.Level) === -1) accum.push(relic.Level); + if(obj.setId !== relic.suitId) return accum; + relic.level = relic.level.toString(); + if(accum.indexOf(relic.level) === -1) accum.push(relic.level); return accum; }, []); // set bonus effects - obj.SetNeedNum.forEach((ele, ind) => { - let effect = xrefine.find(e => e.AffixId === obj.EquipAffixId*10 + ind); - data[ele+'pc'] = language[effect.DescTextMapHash]; + obj.setNeedNum.forEach((ele, ind) => { + let effect = xrefine.find(e => e.affixId === obj.EquipAffixId*10 + ind); + data[ele+'pc'] = language[effect.descTextMapHash]; if(setname === undefined) { - setname = language[effect.NameTextMapHash]; - filename = makeFileName(getLanguage('EN')[effect.NameTextMapHash]); + setname = language[effect.nameTextMapHash]; + filename = makeFileName(getLanguage('EN')[effect.nameTextMapHash]); } }); @@ -39,16 +39,16 @@ function collateArtifact(lang) { data.images = {}; // relic pieces - obj.ContainsList.forEach(ele => { - let relic = xrelics.find(e => e.Id === ele); + obj.containsList.forEach(ele => { + let relic = xrelics.find(e => e.id === ele); let relicdata = {}; - relicdata.name = language[relic.NameTextMapHash]; - relicdata.relictype = xmanualtext.find(ele => ele.TextMapId === relic.EquipType).TextMapContentTextMapHash; + relicdata.name = language[relic.nameTextMapHash]; + relicdata.relictype = xmanualtext.find(ele => ele.textMapId === relic.equipType).textMapContentTextMapHash; relicdata.relictype = language[relicdata.relictype]; - relicdata.description = language[relic.DescTextMapHash]; - data[relicTypeToPropertyName[relic.EquipType]] = relicdata; - data.images['name'+relicTypeToPropertyName[relic.EquipType]] = relic.Icon; - data.images[relicTypeToPropertyName[relic.EquipType]] = `https://upload-os-bbs.mihoyo.com/game_record/genshin/equip/${relic.Icon}.png`; + relicdata.description = language[relic.descTextMapHash]; + data[relicTypeToPropertyName[relic.equipType]] = relicdata; + data.images['name'+relicTypeToPropertyName[relic.equipType]] = relic.icon; + data.images[relicTypeToPropertyName[relic.equipType]] = `https://upload-os-bbs.mihoyo.com/game_record/genshin/equip/${relic.icon}.png`; }); data.name = setname; diff --git a/myscripts/collateCharacter.js b/myscripts/collateCharacter.js index 39f150614..fd7cff72f 100644 --- a/myscripts/collateCharacter.js +++ b/myscripts/collateCharacter.js @@ -3,7 +3,7 @@ const xextrainfo = getExcel('FetterInfoExcelConfigData'); // object map that converts player's avatar id to TextMapHash const playerIdToTextMapHash = { 10000005: 2329553598, 10000007: 3241049361 }; -const moraNameTextMapHash = getExcel('MaterialExcelConfigData').find(ele => ele.Id === 202).NameTextMapHash; +const moraNameTextMapHash = getExcel('MaterialExcelConfigData').find(ele => ele.id === 202).nameTextMapHash; const xmat = getExcel('MaterialExcelConfigData'); const xcity = getExcel('CityConfigData'); @@ -19,78 +19,78 @@ const associationToCityId = { function collateCharacter(lang) { const language = getLanguage(lang); const xsubstat = getExcel('AvatarPromoteExcelConfigData'); - // console.log(xplayableAvatar.map(ele => ele.ImageName)); + // console.log(xplayableAvatar.map(ele => ele.imageName)); // console.log(avatarIdToFileName) let myavatar = xplayableAvatar.reduce((accum, obj) => { let data = {}; - let extra = xextrainfo.find(ele => ele.AvatarId === obj.Id); + let extra = xextrainfo.find(ele => ele.avatarId === obj.id); - data.name = language[obj.NameTextMapHash]; - if(isPlayer(obj)) data.name = language[playerIdToTextMapHash[obj.Id]]; + data.name = language[obj.nameTextMapHash]; + if(isPlayer(obj)) data.name = language[playerIdToTextMapHash[obj.id]]; data.fullname = data.name; if(!isPlayer(obj)) { - let cardimgname = obj.IconName.slice(obj.IconName.lastIndexOf('_')+1); + let cardimgname = obj.iconName.slice(obj.iconName.lastIndexOf('_')+1); cardimgname = `UI_AvatarIcon_${cardimgname}_Card`; - let charmat = xmat.find(ele => ele.Icon === cardimgname); - data.fullname = language[charmat.NameTextMapHash]; + let charmat = xmat.find(ele => ele.icon === cardimgname); + data.fullname = language[charmat.nameTextMapHash]; } if(data.name !== data.fullname) console.log(`fullname diff ${lang}: ${data.name} | ${data.fullname}`); - //if(data.name === 'Traveler') data.name = capitalizeFirst(avatarIdToFileName[obj.Id]); - 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'; + //if(data.name === 'Traveler') data.name = capitalizeFirst(avatarIdToFileName[obj.id]); + 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'; if(!isPlayer(obj)) { - data.birthmonth = extra.InfoBirthMonth; - data.birthday = extra.InfoBirthDay; + data.birthmonth = extra.infoBirthMonth; + data.birthday = extra.infoBirthDay; } if(isPlayer(obj) && (data.birthmonth || data.birthday)) console.log('warning player has birthday'); - data.affiliation = isPlayer(obj) ? '' : language[extra.AvatarNativeTextMapHash]; - data.element = language[extra.AvatarVisionBeforTextMapHash]; - data.constellation = language[extra.AvatarConstellationBeforTextMapHash]; - if(obj.Id === 10000030) data.constellation = language[extra.AvatarConstellationAfterTextMapHash]; // Zhongli exception - data.title = language[extra.AvatarTitleTextMapHash]; - data.association = extra.AvatarAssocType.slice(extra.AvatarAssocType.indexOf('TYPE_')+5); + data.affiliation = isPlayer(obj) ? '' : language[extra.avatarNativeTextMapHash]; + data.element = language[extra.avatarVisionBeforTextMapHash]; + data.constellation = language[extra.avatarConstellationBeforTextMapHash]; + if(obj.id === 10000030) data.constellation = language[extra.avatarConstellationAfterTextMapHash]; // Zhongli exception + data.title = language[extra.avatarTitleTextMapHash]; + data.association = extra.avatarAssocType.slice(extra.avatarAssocType.indexOf('TYPE_')+5); if(associationToCityId[data.association] === undefined) console.log(`character missing cityId for association ${data.association}`); else if(associationToCityId[data.association] === '') data.region = ''; else { - data.region = language[xcity.find(ele => ele.CityId === associationToCityId[data.association]).CityNameTextMapHash]; + data.region = language[xcity.find(ele => ele.cityId === associationToCityId[data.association]).cityNameTextMapHash]; } data.cv = { - english: language[extra.CvEnglishTextMapHash], - chinese: language[extra.CvChineseTextMapHash], - japanese: language[extra.CvJapaneseTextMapHash], - korean: language[extra.CvKoreanTextMapHash] + english: language[extra.cvEnglishTextMapHash], + chinese: language[extra.cvChineseTextMapHash], + japanese: language[extra.cvJapaneseTextMapHash], + korean: language[extra.cvKoreanTextMapHash] }; const xsubstat = getExcel('AvatarPromoteExcelConfigData'); const xmanualtext = getExcel('ManualTextMapConfigData'); - let substat = xsubstat.find(ele => ele.AvatarPromoteId === obj.AvatarPromoteId).AddProps[3].PropType; - data.substat = language[xmanualtext.find(ele => ele.TextMapId === substat).TextMapContentTextMapHash]; + let substat = xsubstat.find(ele => ele.avatarPromoteId === obj.avatarPromoteId).addProps[3].propType; + data.substat = language[xmanualtext.find(ele => ele.textMapId === substat).textMapContentTextMapHash]; - data.icon = obj.IconName; - data.sideicon = obj.SideIconName; + data.icon = obj.iconName; + data.sideicon = obj.sideIconName; // get the promotion costs let costs = {}; for(let i = 1; i <= 6; i++) { - let apromo = xsubstat.find(ele => ele.AvatarPromoteId === obj.AvatarPromoteId && ele.PromoteLevel === i); + let apromo = xsubstat.find(ele => ele.avatarPromoteId === obj.avatarPromoteId && ele.promoteLevel === i); costs['ascend'+i] = [{ name: language[moraNameTextMapHash], - count: apromo.ScoinCost + count: apromo.scoinCost }]; - for(let items of apromo.CostItems) { - if(items.Id === undefined) continue; + for(let items of apromo.costItems) { + if(items.id === undefined) continue; costs['ascend'+i].push({ - name: language[xmat.find(ele => ele.Id === items.Id).NameTextMapHash], - count: items.Count + name: language[xmat.find(ele => ele.id === items.id).nameTextMapHash], + count: items.count }) } } @@ -98,31 +98,31 @@ function collateCharacter(lang) { // INFORMATION TO CALCULATE STATS AT EACH LEVEL let stats = { base: {}, curve: {} }; - stats.base.hp = obj.HpBase; - stats.base.attack = obj.AttackBase; - stats.base.defense = obj.DefenseBase; - stats.base.critrate = obj.Critical; - stats.base.critdmg = obj.CriticalHurt; + stats.base.hp = obj.hpBase; + stats.base.attack = obj.attackBase; + stats.base.defense = obj.defenseBase; + stats.base.critrate = obj.critical; + stats.base.critdmg = obj.criticalHurt; - stats.curve.hp = obj.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_HP').GrowCurve; - stats.curve.attack = obj.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_ATTACK').GrowCurve; - stats.curve.defense = obj.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_DEFENSE').GrowCurve; + stats.curve.hp = obj.propGrowCurves.find(ele => ele.type === 'FIGHT_PROP_BASE_HP').growCurve; + stats.curve.attack = obj.propGrowCurves.find(ele => ele.type === 'FIGHT_PROP_BASE_ATTACK').growCurve; + stats.curve.defense = obj.propGrowCurves.find(ele => ele.type === 'FIGHT_PROP_BASE_DEFENSE').growCurve; stats.specialized = substat; stats.promotion = xsubstat.reduce((accum, ele) => { - if(ele.AvatarPromoteId !== obj.AvatarPromoteId) return accum; - let promotelevel = ele.PromoteLevel || 0; + if(ele.avatarPromoteId !== obj.avatarPromoteId) return accum; + let promotelevel = ele.promoteLevel || 0; accum[promotelevel] = { - maxlevel: ele.UnlockMaxLevel, - hp: ele.AddProps.find(ele => ele.PropType === 'FIGHT_PROP_BASE_HP').Value || 0, - attack: ele.AddProps.find(ele => ele.PropType === 'FIGHT_PROP_BASE_ATTACK').Value || 0, - defense: ele.AddProps.find(ele => ele.PropType === 'FIGHT_PROP_BASE_DEFENSE').Value || 0, - specialized: ele.AddProps.find(ele => ele.PropType === substat).Value || 0, + maxlevel: ele.unlockMaxLevel, + hp: ele.addProps.find(ele => ele.propType === 'FIGHT_PROP_BASE_HP').value || 0, + attack: ele.addProps.find(ele => ele.propType === 'FIGHT_PROP_BASE_ATTACK').value || 0, + defense: ele.addProps.find(ele => ele.propType === 'FIGHT_PROP_BASE_DEFENSE').value || 0, + specialized: ele.addProps.find(ele => ele.propType === substat).value || 0, }; return accum; }, []); data.stats = stats; - accum[avatarIdToFileName[obj.Id]] = data; + accum[avatarIdToFileName[obj.id]] = data; return accum; }, {}) return myavatar; diff --git a/myscripts/collateCommission.js b/myscripts/collateCommission.js index c4a922404..54b9e4db9 100644 --- a/myscripts/collateCommission.js +++ b/myscripts/collateCommission.js @@ -26,32 +26,32 @@ function collateCommission(lang) { const language = getLanguage(lang); let mydata = xdaily.reduce((accum, obj) => { let data = {}; - data.Id = obj.ID; + data.id = obj.iD; - data.name = language[obj.TitleTextMapHash]; - data.description = sanitizeDescription(language[obj.DescriptionTextMapHash]); - data.target = sanitizeDescription(language[obj.TargetTextMapHash]); + data.name = language[obj.titleTextMapHash]; + data.description = sanitizeDescription(language[obj.descriptionTextMapHash]); + data.target = sanitizeDescription(language[obj.targetTextMapHash]); - data.city = language[xcity.find(e => e.CityId === obj.CityId).CityNameTextMapHash]; + data.city = language[xcity.find(e => e.cityId === obj.cityId).cityNameTextMapHash]; - const taskreward = xtaskreward.find(e => e.ID === obj.TaskRewardId); + const taskreward = xtaskreward.find(e => e.iD === obj.taskRewardId); data.rewardpreviews = {}; for(let i = 0; i < 12; i++) { - let rewardpreview = xpreview.find(pre => pre.Id === taskreward.DropVec[i].PreviewRewardId).PreviewItems.filter(pre => pre.Id); + let rewardpreview = xpreview.find(pre => pre.id === taskreward.dropVec[i].previewRewardId).previewItems.filter(pre => pre.id); data.rewardpreviews[mapRewardToAR[i]] = rewardpreview.map(repre => { - let mat = xmat.find(m => m.Id === repre.Id); - let reward = { name: language[mat.NameTextMapHash] }; - reward.count = parseInt(repre.Count); - if(repre.Count.includes(';')) reward.countmax = parseInt(repre.Count.substring(repre.Count.indexOf(';')+1)); + let mat = xmat.find(m => m.id === repre.id); + let reward = { name: language[mat.nameTextMapHash] }; + reward.count = parseInt(repre.count); + if(repre.count.includes(';')) reward.countmax = parseInt(repre.count.substring(repre.count.indexOf(';')+1)); return reward; }); } - data.TaskRewardId = obj.TaskRewardId + data.taskRewardId = obj.taskRewardId - let filename = makeFileName(getLanguage('EN')[obj.TitleTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.titleTextMapHash]); if(filename === '') return accum; while(accum[filename] !== undefined) { filename += 'a'; diff --git a/myscripts/collateConstellation.js b/myscripts/collateConstellation.js index 48bf0a6d2..34120e7db 100644 --- a/myscripts/collateConstellation.js +++ b/myscripts/collateConstellation.js @@ -6,29 +6,29 @@ function collateConstellation(lang) { // bad practice to declare functions inside loop but i need to be able to call it multiple times for players function dowork() { let data = {}; - let depot = xskilldepot.find(ele => ele.Id === obj.SkillDepotId); - if(depot === undefined || depot.EnergySkill === undefined) return; // not a finished (traveler) character - if(depot.TalentStarName === '') return; // unfinished + let depot = xskilldepot.find(ele => ele.id === obj.skillDepotId); + if(depot === undefined || depot.energySkill === undefined) return; // not a finished (traveler) character + if(depot.talentStarName === '') return; // unfinished - data.name = language[obj.NameTextMapHash]; - if(isPlayer(obj)) data.name += ` (${language[elementTextMapHash[getPlayerElement(obj.SkillDepotId)]]})` + data.name = language[obj.nameTextMapHash]; + if(isPlayer(obj)) data.name += ` (${language[elementTextMapHash[getPlayerElement(obj.skillDepotId)]]})` //console.log(depot) data.images = {}; - let stars = depot.Talents.map(talentId => xconstellation.find(ele => ele.TalentId === talentId)); + let stars = depot.talents.map(talentId => xconstellation.find(ele => ele.talentId === talentId)); for(let i = 1; i <= 6; i++) { data['c'+i] = { - name: sanitizeDescription(language[stars[i-1].NameTextMapHash]), - effect: sanitizeDescription(language[stars[i-1].DescTextMapHash]) + name: sanitizeDescription(language[stars[i-1].nameTextMapHash]), + effect: sanitizeDescription(language[stars[i-1].descTextMapHash]) }; - data.images['c'+i] = `https://upload-os-bbs.mihoyo.com/game_record/genshin/constellation_icon/${stars[i-1].Icon}.png`; + data.images['c'+i] = `https://upload-os-bbs.mihoyo.com/game_record/genshin/constellation_icon/${stars[i-1].icon}.png`; } - accum[avatarIdToFileName[isPlayer(obj) ? obj.SkillDepotId : obj.Id]] = data; + accum[avatarIdToFileName[isPlayer(obj) ? obj.skillDepotId : obj.id]] = data; } if(isPlayer(obj)) { - obj.CandSkillDepotIds.forEach(ele => { - obj.SkillDepotId = ele; + obj.candSkillDepotIds.forEach(ele => { + obj.skillDepotId = ele; dowork(); }); } else { diff --git a/myscripts/collateDomain.js b/myscripts/collateDomain.js index ac9fe5539..b3de37840 100644 --- a/myscripts/collateDomain.js +++ b/myscripts/collateDomain.js @@ -12,7 +12,7 @@ const domainType = { UI_ABYSSUS_AVATAR_PROUD: "UI_ABYSSUS_AVATAR_PROUD" } function getDomainTypeTextMapHash(domaintype) { - return xmanualtext.find(ele => ele.TextMapId === domaintype).TextMapContentTextMapHash; + return xmanualtext.find(ele => ele.textMapId === domaintype).textMapContentTextMapHash; } /* @@ -35,7 +35,7 @@ function getDomainTypeTextMapHash(domaintype) { */ function getDomainEntranceTextMapHash(englishname) { englishname = englishname.toLowerCase(); - function mapping(textmapid) { return xmanualtext.find(ele => ele.TextMapId === textmapid).TextMapContentTextMapHash; } + function mapping(textmapid) { return xmanualtext.find(ele => ele.textMapId === textmapid).textMapContentTextMapHash; } if(englishname.includes('dance of steel')) return mapping("UI_DUNGEON_ENTRY_27"); @@ -57,7 +57,7 @@ function getDomainEntranceTextMapHash(englishname) { return mapping("UI_DUNGEON_ENTRY_54"); else if(englishname.includes('unyielding')) return mapping("UI_DUNGEON_ENTRY_282"); - else if(englishname.includes('elegaic rime')) + else if(englishname.includes('elegiac rime')) return mapping("UI_DUNGEON_ENTRY_221"); else if(englishname.includes('autumn hunt')) return mapping("UI_DUNGEON_ENTRY_361"); @@ -83,55 +83,56 @@ function isSundaySpecial(englishname) { function collateDomain(lang) { const language = getLanguage(lang); const xmat = getExcel('MaterialExcelConfigData'); - xdungeon = moredungeons.concat(xdungeon); + // xdungeon = moredungeons.concat(xdungeon); let mydomain = xdungeon.reduce((accum, obj) => { - if(obj.Type !== "DUNGEON_DAILY_FIGHT" || obj.StateType !== "DUNGEON_STATE_RELEASE") return accum; - if(isSundaySpecial(getLanguage('EN')[obj.NameTextMapHash])) return accum; - // console.log(obj.Id); + if(obj.type !== "DUNGEON_DAILY_FIGHT" || obj.stateType !== "DUNGEON_STATE_RELEASE") return accum; + if(isSundaySpecial(getLanguage('EN')[obj.nameTextMapHash])) return accum; + // console.log(obj.id); let data = {}; - data.Id = obj.Id; - data.name = language[obj.NameTextMapHash]; - // data.displayname = language[obj.DisplayNameTextMapHash]; // doesn't exist for artifact domains - data.domainentrance = language[getDomainEntranceTextMapHash(getLanguage('EN')[obj.NameTextMapHash])];// obj.EntryPicPath; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); + data.id = obj.id; + data.name = language[obj.nameTextMapHash]; + // data.displayname = language[obj.displayNameTextMapHash]; // doesn't exist for artifact domains + data.domainentrance = language[getDomainEntranceTextMapHash(getLanguage('EN')[obj.nameTextMapHash])];// obj.entryPicPath; + data.description = sanitizeDescription(language[obj.descTextMapHash]); - if(obj.Id === 5120 || obj.Id === 5121 || obj.Id === 5122 || obj.Id === 5123) obj.CityID = 1; // Peak of Vindagnyr region fix from Liyue to Mondstadt - if(obj.Id >= 5258 && obj.Id <= 5265) obj.CityID = 2; // Taishan Mansion in Liyue - if(obj.Id >= 5214 && obj.Id <= 5225) obj.CityID = 2; // Hidden Palace of Lianshan Formula in Liyue - if(obj.Id >= 5200 && obj.Id <= 5207) obj.CityID = 3; // Slumbering Court in Inazuma, and Momiji-Dyed Court + // CITY FIX // fix no longer needed 2.7 + // if(obj.id === 5120 || obj.id === 5121 || obj.id === 5122 || obj.id === 5123) obj.cityID = 1; // Peak of Vindagnyr region fix from Liyue to Mondstadt + // if(obj.id >= 5258 && obj.id <= 5265) obj.cityID = 2; // Taishan Mansion in Liyue + // if(obj.id >= 5214 && obj.id <= 5225) obj.cityID = 2; // Hidden Palace of Lianshan Formula in Liyue + // if(obj.id >= 5200 && obj.id <= 5207) obj.cityID = 3; // Slumbering Court in Inazuma, and Momiji-Dyed Court - data.region = language[xcity.find(city => city.CityId === obj.CityID).CityNameTextMapHash]; + data.region = language[xcity.find(city => city.cityId === obj.cityID).cityNameTextMapHash]; - data.recommendedlevel = obj.ShowLevel; - if(typeof obj.RecommendElementTypes[0] === 'string') - data.recommendedelements = obj.RecommendElementTypes.filter(ele => ele !== 'None').map(ele => language[xmanualtext.find(man => man.TextMapId === ele).TextMapContentTextMapHash]); - data.daysofweek = getDayWeekList(obj.Id, language); + data.recommendedlevel = obj.showLevel; + if(typeof obj.recommendElementTypes[0] === 'string') + data.recommendedelements = obj.recommendElementTypes.filter(ele => ele !== 'None').map(ele => language[xmanualtext.find(man => man.textMapId === ele).textMapContentTextMapHash]); + data.daysofweek = getDayWeekList(obj.id, language); if(data.daysofweek.length === 0) delete data.daysofweek; - data.unlockrank = obj.LimitLevel; - let rewardpreview = xpreview.find(pre => pre.Id === obj.PassRewardPreviewID).PreviewItems.filter(pre => pre.Id); + data.unlockrank = obj.limitLevel; + let rewardpreview = xpreview.find(pre => pre.id === obj.passRewardPreviewID).previewItems.filter(pre => pre.id); data.rewardpreview = rewardpreview.map(repre => { - let mat = xmat.find(m => m.Id === repre.Id); + let mat = xmat.find(m => m.id === repre.id); if(mat) { // is material - let reward = { name: language[mat.NameTextMapHash] }; - if(mat.MaterialType !== 'MATERIAL_AVATAR_MATERIAL') reward.count = parseInt(repre.Count); - if((getLanguage('EN')[mat.TypeDescTextMapHash]).includes('Weapon')) { + let reward = { name: language[mat.nameTextMapHash] }; + if(mat.materialType !== 'MATERIAL_AVATAR_MATERIAL') reward.count = parseInt(repre.count); + if((getLanguage('EN')[mat.typeDescTextMapHash]).includes('Weapon')) { data.domaintype = language[getDomainTypeTextMapHash(domainType.UI_ABYSSUS_WEAPON_PROMOTE)]; } else { data.domaintype = language[getDomainTypeTextMapHash(domainType.UI_ABYSSUS_AVATAR_PROUD)]; } return reward; } else { // is artifact - let disp = xdisplay.find(d => d.Id === repre.Id); + let disp = xdisplay.find(d => d.id === repre.id); data.domaintype = language[getDomainTypeTextMapHash(domainType.UI_ABYSSUS_RELIC)]; - return { name: language[disp.NameTextMapHash], rarity: disp.RankLevel+'' }; + return { name: language[disp.nameTextMapHash], rarity: disp.rankLevel+'' }; } }); - if(obj.disorderoverride) data.disorder = obj.disorderoverride.map(d => language[d]); - //data.disorder = xdisorder.filter(d => d.Id+'' === Object.keys(obj.LevelConfigMap)[0]).map(d => language[d.DescTextMapHash]); - data.imagename = obj.EntryPicPath; + // if(obj.disorderoverride) data.disorder = obj.disorderoverride.map(d => language[d]); // fix not needed anymore + data.disorder = xdisorder.filter(d => d.id+'' === Object.keys(obj.levelConfigMap)[0]).map(d => language[d.descTextMapHash]); + data.imagename = obj.entryPicPath; - let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(filename === '') return accum; accum[filename] = data; return accum; @@ -142,7 +143,7 @@ function collateDomain(lang) { // format returned is translated and sorted array ["Monday", "Thursday", "Sunday"] function getDayWeekList(dungeonId, langmap) { const xdailyd = getExcel('DailyDungeonConfigData'); - const mapENtoNum = { 'Monday': 1, 'Tuesday': 2, 'Wednesday': 3, 'Thursday': 4, 'Friday': 5, 'Saturday': 6, 'Sunday': 7 }; + const mapENtoNum = { 'monday': 1, 'tuesday': 2, 'wednesday': 3, 'thursday': 4, 'friday': 5, 'saturday': 6, 'sunday': 7 }; let mylist = []; for(const ele of xdailyd) for(const [key, value] of Object.entries(mapENtoNum)) @@ -163,65 +164,66 @@ function cleanupDungeonFile() { fs.writeFileSync('../ExcelBinOutput/DungeonExcelConfigData.json', data); } -cleanupDungeonFile(); +// cleanupDungeonFile(); // Fire, Water, Ice, Rock, Electric, Wind, Grass -let moredungeons = [ -{ // machine nest 1 - Id: 99991, - Type: "DUNGEON_DAILY_FIGHT", - StateType: "DUNGEON_STATE_RELEASE", - NameTextMapHash: 4233644080, - DescTextMapHash: 1269716077, - CityID: 2, - ShowLevel: 59, - RecommendElementTypes: ['Fire', 'Electric', 'Rock', 'Wind'], - LimitLevel: 30, - PassRewardPreviewID: 22443, - EntryPicPath: 'UI_DungeonPic_CycleDungeonChasm', - disorderoverride: [4145618250] -}, -{ // machine nest 2 - Id: 99992, - Type: "DUNGEON_DAILY_FIGHT", - StateType: "DUNGEON_STATE_RELEASE", - NameTextMapHash: 1948966872, - DescTextMapHash: 1269716077, - CityID: 2, - ShowLevel: 59, - RecommendElementTypes: ['Fire', 'Electric', 'Rock', 'Wind'], - LimitLevel: 35, - PassRewardPreviewID: 22444, - EntryPicPath: 'UI_DungeonPic_CycleDungeonChasm', - disorderoverride: [4145618250] -}, -{ // machine nest 3 - Id: 99993, - Type: "DUNGEON_DAILY_FIGHT", - StateType: "DUNGEON_STATE_RELEASE", - NameTextMapHash: 2797186184, - DescTextMapHash: 1269716077, - CityID: 2, - ShowLevel: 59, - RecommendElementTypes: ['Fire', 'Electric', 'Rock', 'Wind'], - LimitLevel: 40, - PassRewardPreviewID: 22445, - EntryPicPath: 'UI_DungeonPic_CycleDungeonChasm', - disorderoverride: [4145618250] -}, -{ // machine nest 4 - Id: 99994, - Type: "DUNGEON_DAILY_FIGHT", - StateType: "DUNGEON_STATE_RELEASE", - NameTextMapHash: 1531297112, - DescTextMapHash: 1269716077, - CityID: 2, - ShowLevel: 59, - RecommendElementTypes: ['Fire', 'Electric', 'Rock', 'Wind'], - LimitLevel: 45, - PassRewardPreviewID: 22446, - EntryPicPath: 'UI_DungeonPic_CycleDungeonChasm', - disorderoverride: [4145618250] -}, -]; \ No newline at end of file +// not used anymore since it was fixed 2.7 +// let moredungeons = [ +// { // machine nest 1 +// Id: 99991, +// Type: "DUNGEON_DAILY_FIGHT", +// StateType: "DUNGEON_STATE_RELEASE", +// NameTextMapHash: 4233644080, +// DescTextMapHash: 1269716077, +// CityID: 2, +// ShowLevel: 59, +// RecommendElementTypes: ['Fire', 'Electric', 'Rock', 'Wind'], +// LimitLevel: 30, +// PassRewardPreviewID: 22443, +// EntryPicPath: 'UI_DungeonPic_CycleDungeonChasm', +// disorderoverride: [4145618250] +// }, +// { // machine nest 2 +// Id: 99992, +// Type: "DUNGEON_DAILY_FIGHT", +// StateType: "DUNGEON_STATE_RELEASE", +// NameTextMapHash: 1948966872, +// DescTextMapHash: 1269716077, +// CityID: 2, +// ShowLevel: 59, +// RecommendElementTypes: ['Fire', 'Electric', 'Rock', 'Wind'], +// LimitLevel: 35, +// PassRewardPreviewID: 22444, +// EntryPicPath: 'UI_DungeonPic_CycleDungeonChasm', +// disorderoverride: [4145618250] +// }, +// { // machine nest 3 +// Id: 99993, +// Type: "DUNGEON_DAILY_FIGHT", +// StateType: "DUNGEON_STATE_RELEASE", +// NameTextMapHash: 2797186184, +// DescTextMapHash: 1269716077, +// CityID: 2, +// ShowLevel: 59, +// RecommendElementTypes: ['Fire', 'Electric', 'Rock', 'Wind'], +// LimitLevel: 40, +// PassRewardPreviewID: 22445, +// EntryPicPath: 'UI_DungeonPic_CycleDungeonChasm', +// disorderoverride: [4145618250] +// }, +// { // machine nest 4 +// Id: 99994, +// Type: "DUNGEON_DAILY_FIGHT", +// StateType: "DUNGEON_STATE_RELEASE", +// NameTextMapHash: 1531297112, +// DescTextMapHash: 1269716077, +// CityID: 2, +// ShowLevel: 59, +// RecommendElementTypes: ['Fire', 'Electric', 'Rock', 'Wind'], +// LimitLevel: 45, +// PassRewardPreviewID: 22446, +// EntryPicPath: 'UI_DungeonPic_CycleDungeonChasm', +// disorderoverride: [4145618250] +// }, +// ]; \ No newline at end of file diff --git a/myscripts/collateDomainMonsterList.js b/myscripts/collateDomainMonsterList.js index 44e493fae..d30f6a593 100644 --- a/myscripts/collateDomainMonsterList.js +++ b/myscripts/collateDomainMonsterList.js @@ -15,10 +15,10 @@ const monsterMap = { "bless dance steel iv": ['pyro agent', 'fa el ci mage', 'th pyro pot', 'th hy pot', 'th el pot', 'th cry pot', 'th seaman'], "bless dance steel v": ['pyro agent', 'fa el ci mage', 'th cry pot'], - "bless elegaic r i": ['cr slime', 'la cry slime', 'ice shield mita'], - "bless elegaic r ii": ['cr slime', 'la cr slime', 'cr hili grenad', 'ice shield mita'], - "bless elegaic r iii": ['la cr slime', 'cr hili grenad', 'ice shield mita', 'cr ab mage'], - "bless elegaic r iv": ['frostarm lawa', 'cr ab mage'], + "bless eleg r i": ['cr slime', 'la cry slime', 'ice shield mita'], + "bless eleg r ii": ['cr slime', 'la cr slime', 'cr hili grenad', 'ice shield mita'], + "bless eleg r iii": ['la cr slime', 'cr hili grenad', 'ice shield mita', 'cr ab mage'], + "bless eleg r iv": ['frostarm lawa', 'cr ab mage'], "bless fire puri i": ['cryo slime', 'large cryo slime', 'large hydro slime', 'wood shield hili guard', 'cryo mage'], "bless fire puri ii": ['elec slime', 'lar elec slime', 'muta ele slime', 'fat ele cic mage'], @@ -174,12 +174,12 @@ function collateDomainMonsterList(lang) { let mydomain = require(`./export/${lang}/domains.json`); for(let [dom, monList] of Object.entries(autoMonsterMap)) { - const domId = Object.values(ENdomain).find(ele => ele.name === dom).Id; - const monNameHashList = monList.map(ele => Object.values(ENmonster).find(tmp => tmp.name === ele).NameTextMapHash); + const domId = Object.values(ENdomain).find(ele => ele.name === dom).id; + const monNameHashList = monList.map(ele => Object.values(ENmonster).find(tmp => tmp.name === ele).nameTextMapHash); const monsterlist = monNameHashList.map(NameTextMapHash => language[NameTextMapHash]); - Object.values(mydomain).find(ele => ele.Id === domId).monsterlist = monsterlist; + Object.values(mydomain).find(ele => ele.id === domId).monsterlist = monsterlist; } for(let dom of Object.values(mydomain)) { diff --git a/myscripts/collateEnemy.js b/myscripts/collateEnemy.js index b92768d1d..f8098bab9 100644 --- a/myscripts/collateEnemy.js +++ b/myscripts/collateEnemy.js @@ -29,30 +29,30 @@ function collateEnemy(lang) { const xmat = getExcel('MaterialExcelConfigData'); let mymonster = xcodex.reduce((accum, obj) => { - if(obj.Type !== 'CODEX_MONSTER') return accum; - if(obj.IsDeleteWatcherAfterFinish) return accum; + if(obj.type !== 'CODEX_MONSTER') return accum; + if(obj.isDisuse) return accum; if(obj.Id === 29010101) obj.Id = 29010104; // use correct stormterror - 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 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.id = obj.Id; - data.NameTextMapHash = des.NameTextMapHash; - data.name = language[des.NameTextMapHash]; - data.specialname = language[spe.SpecialNameTextMapHash]; + 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; + 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); + 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 @@ -64,83 +64,86 @@ function collateEnemy(lang) { // Abyss Lector: Violet Lightning, Abyss Herald: Wicked Torrents, Abyss Lector: Fathomless Flames // Hydro Cicin, Electro Cicin, Cryo Cicin data.rewardpreview = []; + } else if(obj.Id === 26090101) { // Floating Hydro Fungus + let rewardpreview = xpreview.find(pre => pre.id === 16012).previewItems.filter(pre => pre.id); + data.rewardpreview = mapRewardList(rewardpreview, language); } else if(obj.Id === 29010104) { // dvalin lvl90 - let rewardpreview = xpreview.find(pre => pre.Id === 15005).PreviewItems.filter(pre => pre.Id); + 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); + 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); + 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); + 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); + let rewardpreview = xpreview.find(pre => pre.id === 15034).previewItems.filter(pre => pre.id); data.rewardpreview = mapRewardList(rewardpreview, language); } else if(obj.Id === 26050801) { - let rewardpreview = xpreview.find(pre => pre.Id === 15177).PreviewItems.filter(pre => pre.Id); + let rewardpreview = xpreview.find(pre => pre.id === 15177).previewItems.filter(pre => pre.id); data.rewardpreview = mapRewardList(rewardpreview, language); } else if(obj.Id === 29060201) { // raiden shogun lvl90 - let rewardpreview = xpreview.find(pre => pre.Id === 15038).PreviewItems.filter(pre => pre.Id); + let rewardpreview = xpreview.find(pre => pre.id === 15038).previewItems.filter(pre => pre.id); data.rewardpreview = mapRewardList(rewardpreview, language); } } if(!data.rewardpreview) { - console.log('no reward list for '+data.name); + console.log('no reward list for '+obj.Id+' : '+data.name); data.rewardpreview = []; } - let sub = obj.SubType || 'CODEX_SUBTYPE_ELEMENTAL'; + let sub = obj.subType || 'CODEX_SUBTYPE_ELEMENTAL'; sub = sub.slice(sub.lastIndexOf('_')+1); // console.log(obj.Id); // console.log(sub); - sub = xmanualtext.find(m => m.TextMapId === `UI_CODEX_ANIMAL_CATEGORY_${sub}`).TextMapContentTextMapHash; - data.enemytype = mon.SecurityLevel || 'COMMON'; + sub = xmanualtext.find(m => m.textMapId === `UI_CODEX_ANIMAL_CATEGORY_${sub}`).textMapContentTextMapHash; + data.enemytype = mon.securityLevel || 'COMMON'; data.category = language[sub]; - data.imageicon = des.Icon; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); + data.imageicon = des.icon; + data.description = sanitizeDescription(language[obj.descTextMapHash]); - data.aggrorange = mon.VisionLevel; - data.bgm = mon.CombatBGMLevel; - data.budget = mon.EntityBudgetLevel; + data.aggrorange = mon.visionLevel; + data.bgm = mon.combatBGMLevel; + data.budget = mon.entityBudgetLevel; // particle drops let drops = []; - for(let x of mon.HpDrops) { - if(x.DropId) drops.push(x.DropId); + for(let x of mon.hpDrops) { + if(x.dropId) drops.push(x.dropId); } - drops.push(mon.KillDropId); + drops.push(mon.killDropId); data.drops = drops; let stats = {}; stats.resistance = {}; - stats.resistance.physical = round(mon.PhysicalSubHurt, 2) || 0; - stats.resistance.pyro = round(mon.FireSubHurt, 2) || 0; - stats.resistance.dendro = round(mon.GrassSubHurt, 2) || 0; - stats.resistance.hydro = round(mon.WaterSubHurt, 2) || 0; - stats.resistance.geo = round(mon.RockSubHurt, 2) || 0; - stats.resistance.anemo = round(mon.WindSubHurt, 2) || 0; - stats.resistance.cryo = round(mon.IceSubHurt, 2) || 0; - stats.resistance.electro = round(mon.ElecSubHurt, 2) || 0; + stats.resistance.physical = round(mon.physicalSubHurt, 2) || 0; + stats.resistance.pyro = round(mon.fireSubHurt, 2) || 0; + stats.resistance.dendro = round(mon.grassSubHurt, 2) || 0; + stats.resistance.hydro = round(mon.waterSubHurt, 2) || 0; + stats.resistance.geo = round(mon.rockSubHurt, 2) || 0; + stats.resistance.anemo = round(mon.windSubHurt, 2) || 0; + stats.resistance.cryo = round(mon.iceSubHurt, 2) || 0; + stats.resistance.electro = round(mon.elecSubHurt, 2) || 0; stats.base = {}; - stats.base.hp = mon.HpBase; - stats.base.attack = mon.AttackBase; - stats.base.defense = mon.DefenseBase; + stats.base.hp = mon.hpBase; + stats.base.attack = mon.attackBase; + stats.base.defense = mon.defenseBase; stats.curve = {}; try { - // if(obj.Id === 29010101) console.log(mon.PropGrowCurves); - stats.curve.hp = mon.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_HP').GrowCurve; - stats.curve.attack = mon.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_ATTACK').GrowCurve; - stats.curve.defense = mon.PropGrowCurves.find(ele => ele.Type === 'FIGHT_PROP_BASE_DEFENSE').GrowCurve; + // if(obj.Id === 29010101) console.log(mon.propGrowCurves); + stats.curve.hp = mon.propGrowCurves.find(ele => ele.type === 'FIGHT_PROP_BASE_HP').growCurve; + stats.curve.attack = mon.propGrowCurves.find(ele => ele.type === 'FIGHT_PROP_BASE_ATTACK').growCurve; + stats.curve.defense = mon.propGrowCurves.find(ele => ele.type === 'FIGHT_PROP_BASE_DEFENSE').growCurve; } catch(e) { console.log(obj.Id + " - " + data.name + " - failed PropGrowCurves"); } data.stats = stats; - let filename = makeFileName(getLanguage('EN')[des.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[des.nameTextMapHash]); if(filename === '') return accum; accum[filename] = data; @@ -149,83 +152,85 @@ function collateEnemy(lang) { return mymonster; } +// mapping for monsters that don't have rewardlist to use another monster's rewardlist +const noRewardListMonsterMap = { + 21011601: 21010601, // Electro Hilichurl Grenadier + 21020701: 21020101, // Crackling Axe Mitachurl + 21020801: 21020401, // Thunderhelm Lawachurl + 21030601: 21030101, // Electro Samachurl + 22010401: 22010101, // Electro Abyss Mage + 26010301: 26010201, // Electro Whopperflower + 20060601: 20060201, // Pyro Specter + 20060501: 20060201, // Electro Specter + 20060401: 20060201, // Cryo Specter + 22080101: 22070101, // Black Serpent Knight: Windcutter + 25010101: 25010201, // Treasure Hoarders: Liuliu + 25020101: 25010201, // Treasure Hoarders: Raptor + 25030101: 25010201, // Treasure Hoarders: Carmen + 25040101: 25010201, // Treasure Hoarders: Boss + 25050101: 25010201, // Millelith Soldier + 25050201: 25010201 // Millelith Sergeant +} + +// makes sure each monster has a corresponding "investigation" data 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 - else if(monId === 20060601) monId = 20060201; // Pyro Specter - else if(monId === 20060501) monId = 20060201; // Electro Specter - else if(monId === 20060401) monId = 20060201; // Cryo Specter - // else if - - // Hydro Cicin - // Electro Cicin - // Cryo Cicin - // Stormterror - // Lupus Boreas, Dominator of Wolves - // Childe - // Azhdaha - // La Signora - - return xinvest.find(i => i.MonsterIdList.includes(monId)); + if(noRewardListMonsterMap[monId]) monId = noRewardListMonsterMap[monId]; + 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); + 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); + 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+'' }; + let disp = xdisplay.find(d => d.id === repre.id); + return { name: language[disp.nameTextMapHash], rarity: disp.rankLevel+'' }; } }); } const eyestormreward = [ { - "Id": 202 + "id": 202 }, { - "Id": 400022 + "id": 400022 }, { - "Id": 400032 + "id": 400032 }, { - "Id": 400042 + "id": 400042 }, { - "Id": 400062 + "id": 400062 }, { - "Id": 400023 + "id": 400023 }, { - "Id": 400033 + "id": 400033 }, { - "Id": 400043 + "id": 400043 } ]; const unusualreward = [ { - "Id": 102 // Adventure EXP + "id": 102 // Adventure EXP }, { - "Id": 202 // Mora + "id": 202 // Mora }, { - "Id": 100018// Cabbage + "id": 100018// Cabbage } ] @@ -236,18 +241,18 @@ function fixAnimalCodexSubType() { let obfu = require('../[Obfuscated] ExcelBinOutput/AnimalCodexExcelConfigData.json'); let out = require('../ExcelBinOutput/AnimalCodexExcelConfigData.json'); for(let ob of obfu) { - let match = out.find(ele => ele.Id === ob.KABAHENDGOO); // replace with ID - match.SubType = ob.JKOLEMPKHMI; // replace with CODEX_SUBTYPE_HILICHURL + let match = out.find(ele => ele.id === ob.KABAHENDGOO); // replace with ID + match.subType = ob.JKOLEMPKHMI; // replace with CODEX_SUBTYPE_HILICHURL } // manual fixes for 2.6 update - out.find(ele => ele.Id === 22080101).SubType = "CODEX_SUBTYPE_ABYSS"; - out.find(ele => ele.Id === 24010401).SubType = "CODEX_SUBTYPE_AUTOMATRON"; - out.find(ele => ele.Id === 26090101).SubType = "CODEX_SUBTYPE_BEAST"; + out.find(ele => ele.Id === 22080101).subType = "CODEX_SUBTYPE_ABYSS"; + out.find(ele => ele.Id === 24010401).subType = "CODEX_SUBTYPE_AUTOMATRON"; + out.find(ele => ele.Id === 26090101).subType = "CODEX_SUBTYPE_BEAST"; out = JSON.stringify(out, null, '\t'); fs.writeFileSync('../ExcelBinOutput/AnimalCodexExcelConfigData.json', out); } -fixAnimalCodexSubType(); +// fixAnimalCodexSubType(); function fixInvestigationMonsterList() { const fs = require('fs'); @@ -255,13 +260,13 @@ function fixInvestigationMonsterList() { let out = require('../ExcelBinOutput/InvestigationMonsterConfigData.json'); for(let ob of obfu) { - let match = out.find(ele => ele.Id === ob.JNAAGOAENLE); // replace with ID - match.MonsterIdList = ob.ENEMLKMDNFJ; // replace with CODEX_SUBTYPE_HILICHURL + let match = out.find(ele => ele.id === ob.JNAAGOAENLE); // replace with ID + match.monsterIdList = ob.ENEMLKMDNFJ; // replace with CODEX_SUBTYPE_HILICHURL } out = JSON.stringify(out, null, '\t'); fs.writeFileSync('../ExcelBinOutput/InvestigationMonsterConfigData.json', out); } -fixInvestigationMonsterList(); +// fixInvestigationMonsterList(); module.exports = collateEnemy; diff --git a/myscripts/collateFishingPoint.js b/myscripts/collateFishingPoint.js index 4b0ff2084..f81bde506 100644 --- a/myscripts/collateFishingPoint.js +++ b/myscripts/collateFishingPoint.js @@ -14,10 +14,10 @@ // 101005, 101007, 106000, 106001]; // function sortMaterials(mata, matb) { -// if(mata.Rank < matb.Rank) return -1; -// if(mata.Rank > matb.Rank) return 1; -// if(mata.Id < matb.Id) return -1; -// if(mata.Id > matb.Id) return 1; +// if(mata.rank < matb.rank) return -1; +// if(mata.rank > matb.rank) return 1; +// if(mata.id < matb.id) return -1; +// if(mata.id > matb.id) return 1; // return 0; // } @@ -32,42 +32,42 @@ // let mymaterial = xmat.reduce((accum, obj) => { // sortOrder++; -// if(!includeMatId.includes(obj.Id)) { -// if(!obj.MaterialType) return accum; -// if(excludeMatId.includes(obj.Id)) return accum; -// if(!filter.includes(obj.MaterialType)) return accum; +// if(!includeMatId.includes(obj.id)) { +// if(!obj.materialType) return accum; +// 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 +// 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; -// data.name = language[obj.NameTextMapHash]; +// data.id = obj.id; +// data.name = language[obj.nameTextMapHash]; // if(data.name === '') return accum; // data.sortorder = sortOrder; -// data.description = sanitizeDescription(language[obj.DescTextMapHash]); -// data.category = obj.MaterialType ? obj.MaterialType.slice(9) : obj.ItemType; -// data.materialtype = language[obj.TypeDescTextMapHash]; -// if(obj.RankLevel) data.rarity = ''+obj.RankLevel; +// data.description = sanitizeDescription(language[obj.descTextMapHash]); +// data.category = obj.materialType ? obj.materialType.slice(9) : obj.itemType; +// data.materialtype = language[obj.typeDescTextMapHash]; +// if(obj.rankLevel) data.rarity = ''+obj.rankLevel; -// let tmp = xsource.find(ele => ele.Id === obj.Id); -// let dungeonlist = tmp.DungeonList.filter(ele => ele !== 0); +// let tmp = xsource.find(ele => ele.id === obj.id); +// let dungeonlist = tmp.dungeonList.filter(ele => ele !== 0); // if(dungeonlist > 0) { // if(dungeonlist.length > 1) console.log(`${data.name} drops from more than one dungeon!`); -// data.dropdomain = language[xdungeon.find(ele => ele.Id === dungeonlist[0]).DisplayNameTextMapHash]; // artifact domains don't have DisplayNameTextMapHash +// data.dropdomain = language[xdungeon.find(ele => ele.id === dungeonlist[0]).displayNameTextMapHash]; // artifact domains don't have DisplayNameTextMapHash // data.daysofweek = getDayWeekList(dungeonlist[0], language); // } -// if(getLanguage('EN')[obj.TypeDescTextMapHash] === 'Fish') { // get fishing locations +// if(getLanguage('EN')[obj.typeDescTextMapHash] === 'Fish') { // get fishing locations // } -// data.source = tmp.TextList.map(ele => language[ele]).filter(ele => ele !== ''); +// data.source = tmp.textList.map(ele => language[ele]).filter(ele => ele !== ''); -// data.imagename = obj.Icon; +// data.imagename = obj.icon; // if(!data.imagename) console.log(data.name+' has no icon'); -// let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); +// let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); // if(filename === '') return accum; // if(filename.includes('shrineofdepthskey')) return accum; // accum[filename] = data; diff --git a/myscripts/collateFood.js b/myscripts/collateFood.js index 40f67976f..73f55fded 100644 --- a/myscripts/collateFood.js +++ b/myscripts/collateFood.js @@ -4,12 +4,12 @@ const xsource = getExcel('MaterialSourceDataExcelConfigData'); const xspecialty = getExcel('CookBonusExcelConfigData'); const xavatar = getExcel('AvatarExcelConfigData'); -function getSpecialty(id) { return xspecialty.find(ele => ele.RecipeId === id); } -function getMaterial(id) { return xmaterial.find(ele => ele.Id === id); } -function getAvatar(id) { return xavatar.find(ele => ele.Id === id); } +function getSpecialty(id) { return xspecialty.find(ele => ele.recipeId === id); } +function getMaterial(id) { return xmaterial.find(ele => ele.id === id); } +function getAvatar(id) { return xavatar.find(ele => ele.id === id); } function getManualTextMapHash(id) { if(id === 'COOK_FOOD_DEFENSE') id = 'COOK_FOOD_DEFENCE'; - return xmanualtext.find(ele => ele.TextMapId === id).TextMapContentTextMapHash; + return xmanualtext.find(ele => ele.textMapId === id).textMapContentTextMapHash; } const mapQualityToProp = { @@ -22,75 +22,75 @@ function collateFood(lang) { const language = getLanguage(lang); let myfood = xrecipe.reduce((accum, obj) => { - //if(obj.Id !== 1003) return accum; + //if(obj.id !== 1003) return accum; let data = {}; - data.name = language[obj.NameTextMapHash]; - data.Id = obj.Id; - data.rarity = obj.RankLevel; + data.name = language[obj.nameTextMapHash]; + data.id = obj.id; + data.rarity = obj.rankLevel; data.foodtype = 'NORMAL'; - data.foodfilter = language[getManualTextMapHash(obj.FoodType)]; + data.foodfilter = language[getManualTextMapHash(obj.foodType)]; data.foodcategory = undefined; - data.effect = obj.EffectDesc.reduce((accum, eff) => { + data.effect = obj.effectDesc.reduce((accum, eff) => { const tmp = replaceLayout(stripHTML(language[eff])); if(tmp) accum.push(tmp); return accum; }, []).join('\n'); - data.description = sanitizeDescription(language[obj.DescTextMapHash]); + data.description = sanitizeDescription(language[obj.descTextMapHash]); // check error - for(let i = 2; i <= 3; i++) { const tmp = language[obj.EffectDesc[i]]; if(tmp) console.log(`${obj.Id} ${data.name}: ${tmp}`); } + for(let i = 2; i <= 3; i++) { const tmp = language[obj.effectDesc[i]]; if(tmp) console.log(`${obj.id} ${data.name}: ${tmp}`); } // get suspicious, normal, delicious - for(let xd of obj.QualityOutputVec) { - xd = getMaterial(xd.Id); + for(let xd of obj.qualityOutputVec) { + xd = getMaterial(xd.id); let subdata = {}; - if(language[xd.InteractionTitleTextMapHash]) console.log(`food ${obj.Id} has interaction`); - if(language[xd.SpecialDescTextMapHash]) console.log(`food ${obj.Id} has special`); - subdata.effect = language[xd.EffectDescTextMapHash]; - subdata.description = sanitizeDescription(language[xd.DescTextMapHash]); - data[mapQualityToProp[xd.FoodQuality]] = subdata; - data.foodcategory = xd.EffectIcon.substring(13); + if(language[xd.interactionTitleTextMapHash]) console.log(`food ${obj.id} has interaction`); + if(language[xd.specialDescTextMapHash]) console.log(`food ${obj.id} has special`); + subdata.effect = language[xd.effectDescTextMapHash]; + subdata.description = sanitizeDescription(language[xd.descTextMapHash]); + data[mapQualityToProp[xd.foodQuality]] = subdata; + data.foodcategory = xd.effectIcon.substring(13); } - data.ingredients = obj.InputVec.reduce((accum, ing) => { - if(ing.Id === undefined) return accum; - const mat = getMaterial(ing.Id); - accum.push({ name: language[mat.NameTextMapHash], count: ing.Count }); + data.ingredients = obj.inputVec.reduce((accum, ing) => { + if(ing.id === undefined) return accum; + const mat = getMaterial(ing.id); + accum.push({ name: language[mat.nameTextMapHash], count: ing.count }); return accum; }, []); // data.source = - data.imagename = obj.Icon; + data.imagename = obj.icon; - accum[makeFileName(getLanguage('EN')[obj.NameTextMapHash])] = data; + accum[makeFileName(getLanguage('EN')[obj.nameTextMapHash])] = data; // check if there is a specialty - let myspec = getSpecialty(obj.Id); + let myspec = getSpecialty(obj.id); if(myspec === undefined) return accum; - let xd = getMaterial(myspec.ParamVec[0]); + let xd = getMaterial(myspec.paramVec[0]); // if(xd === undefined) return accum; let foodfilter = data.foodfilter; let basedish = data.name; let ingredients = data.ingredients; let spdata = {}; - spdata.name = language[xd.NameTextMapHash]; - spdata.rarity = xd.RankLevel; + spdata.name = language[xd.nameTextMapHash]; + spdata.rarity = xd.rankLevel; spdata.foodtype = 'SPECIALTY'; spdata.foodfilter = foodfilter; - spdata.foodcategory = xd.EffectIcon.substring(13); + spdata.foodcategory = xd.effectIcon.substring(13); - if(language[xd.InteractionTitleTextMapHash]) console.log(`specialty ${obj.Id} has interaction`); - if(language[xd.SpecialDescTextMapHash]) console.log(`specialty ${obj.Id} has special`); - spdata.effect = replaceLayout(language[xd.EffectDescTextMapHash]); - spdata.description = sanitizeDescription(language[xd.DescTextMapHash]); + if(language[xd.interactionTitleTextMapHash]) console.log(`specialty ${obj.id} has interaction`); + if(language[xd.specialDescTextMapHash]) console.log(`specialty ${obj.id} has special`); + spdata.effect = replaceLayout(language[xd.effectDescTextMapHash]); + spdata.description = sanitizeDescription(language[xd.descTextMapHash]); spdata.basedish = basedish; - spdata.character = language[getAvatar(myspec.AvatarId).NameTextMapHash]; + spdata.character = language[getAvatar(myspec.avatarId).nameTextMapHash]; spdata.ingredients = ingredients; - spdata.imagename = xd.Icon; + spdata.imagename = xd.icon; - accum[makeFileName(getLanguage('EN')[xd.NameTextMapHash])] = spdata; + accum[makeFileName(getLanguage('EN')[xd.nameTextMapHash])] = spdata; return accum; }, {}); // console.log(myfood); diff --git a/myscripts/collateGeography.js b/myscripts/collateGeography.js index 3a44ce776..7a5e0a0fb 100644 --- a/myscripts/collateGeography.js +++ b/myscripts/collateGeography.js @@ -8,21 +8,20 @@ function collageGeography(lang) { let mygeography = xview.reduce((accum, obj) => { let data = {}; - data.Id = obj.Id; + data.id = obj.Id; - data.name = language[obj.NameTextMapHash]; - data.area = language[xarea.find(area => area.ID === obj.WorldAreaId).AreaNameTextMapHash]; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); - data.region = language[xcity.find(city => city.CityId === obj.CityId).CityNameTextMapHash]; - data.hiddenactive = obj.IsSeenActive ? true : undefined; + data.name = language[obj.nameTextMapHash]; + data.area = language[xarea.find(area => area.ID === obj.worldAreaId).AreaNameTextMapHash]; + data.description = sanitizeDescription(language[obj.descTextMapHash]); + data.region = language[xcity.find(city => city.cityId === obj.cityId).cityNameTextMapHash]; + data.showonlyunlocked = obj.showOnlyUnlocked ? true : undefined; data.sortorder = obj.SortOrder; + // console.log(obj.cityID); - // console.log(obj.CityID); + data.nameimage = obj.image; - data.nameimage = obj.Image; - - let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(filename === '') return accum; if(accum[filename] !== undefined) console.log('filename collision: ' + filename); accum[filename] = data; diff --git a/myscripts/collateMaterial.js b/myscripts/collateMaterial.js index 39dd2c6ad..05aae2841 100644 --- a/myscripts/collateMaterial.js +++ b/myscripts/collateMaterial.js @@ -34,10 +34,14 @@ const excludeMatId = [110000, 112001, 100086, 100087, 210, 211, 101005, 101007, 106000, 106001]; function sortMaterials(mata, matb) { - if(mata.Rank < matb.Rank) return -1; - if(mata.Rank > matb.Rank) return 1; - if(mata.Id < matb.Id) return -1; - if(mata.Id > matb.Id) return 1; + if(mata.rank === undefined) mata.rank = 99999999; + if(matb.rank === undefined) matb.rank = 99999999; + if(mata.rank < matb.rank) return -1; + if(mata.rank > matb.rank) return 1; + if((mata.rankLevel || 0) > (matb.rankLevel || 0)) return -1; + if((mata.rankLevel || 0) < (matb.rankLevel || 0)) return 1; + if(mata.id < matb.id) return -1; + if(mata.id > matb.id) return 1; return 0; } @@ -56,40 +60,41 @@ function collateMaterial(lang) { let mymaterial = xmat.reduce((accum, obj) => { sortOrder++; - if(!includeMatId.includes(obj.Id)) { - if(!obj.MaterialType) return accum; - if(excludeMatId.includes(obj.Id)) return accum; - if(!filter.includes(obj.MaterialType)) return accum; + if(!includeMatId.includes(obj.id)) { + if(!obj.materialType) return accum; + 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 + 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; - data.name = language[obj.NameTextMapHash]; + data.id = obj.id; + data.name = language[obj.nameTextMapHash]; if(data.name === '') return accum; data.sortorder = sortOrder; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); - data.category = obj.MaterialType ? obj.MaterialType.slice(9) : obj.ItemType; - data.materialtype = language[obj.TypeDescTextMapHash]; - if(obj.RankLevel) data.rarity = ''+obj.RankLevel; + data.description = sanitizeDescription(language[obj.descTextMapHash]); + data.category = obj.materialType ? obj.materialType.slice(9) : obj.itemType; + data.materialtype = language[obj.typeDescTextMapHash]; + // data.bagtab = + if(obj.rankLevel) data.rarity = ''+obj.rankLevel; - let tmp = xsource.find(ele => ele.Id === obj.Id); - let dungeonlist = tmp.DungeonList.filter(ele => ele !== 0); + let tmp = xsource.find(ele => ele.id === obj.id); + let dungeonlist = tmp.dungeonList.filter(ele => ele !== 0); if(dungeonlist > 0) { if(dungeonlist.length > 1) console.log(`${data.name} drops from more than one dungeon!`); - if(xdungeon.find(ele => ele.Id === dungeonlist[0])) { - // data.dropdomain = language[xdungeon.find(ele => ele.Id === dungeonlist[0]).DisplayNameTextMapHash]; // artifact domains don't have DisplayNameTextMapHash + if(xdungeon.find(ele => ele.id === dungeonlist[0])) { + // data.dropdomain = language[xdungeon.find(ele => ele.id === dungeonlist[0]).displayNameTextMapHash]; // artifact domains don't have DisplayNameTextMapHash // data.daysofweek = getDayWeekList(dungeonlist[0], language); } } // get fishing locations - if(getLanguage('EN')[obj.TypeDescTextMapHash] === 'Fish') { - let fishId = xfish.find(ele => ele.ItemId === obj.Id).Id; + if(getLanguage('EN')[obj.typeDescTextMapHash] === 'Fish') { + let fishId = xfish.find(ele => ele.itemId === obj.id).id; let stockIds = xstock.reduce((stockAccum, stockObj) => { - if(stockObj._fishWeight[fishId] !== undefined) stockAccum.push(stockObj.Id); + if(stockObj._fishWeight[fishId] !== undefined) stockAccum.push(stockObj.id); return stockAccum; }, []); data.fishinglocations = stockIds.reduce((poolAccum, stockId) => { @@ -100,18 +105,22 @@ function collateMaterial(lang) { return poolAccum; }, []); } - const sourcelist = tmp.TextList.concat(tmp.JumpList); + const sourcelist = tmp.textList.concat(tmp.jumpList); data.source = sourcelist.map(ele => language[ele]).filter(ele => ele !== ''); // TextList/JumpList - data.imagename = obj.Icon; + data.imagename = obj.icon; if(!data.imagename) console.log(data.name+' has no icon'); - let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(filename === '') return accum; if(filename.includes('shrineofdepthskey')) return accum; accum[filename] = data; return accum; }, {}); + + // console.log(Object.values(mymaterial).filter(e => e.materialtype === "Material").map(e => e.name)); + // console.log(Object.values(mymaterial).map(e => e.name)); + return mymaterial; } diff --git a/myscripts/collateNamecard.js b/myscripts/collateNamecard.js index 2fcaa604d..c98ad658b 100644 --- a/myscripts/collateNamecard.js +++ b/myscripts/collateNamecard.js @@ -4,25 +4,25 @@ const xsource = getExcel('MaterialSourceDataExcelConfigData'); function collateNamecard(lang) { const language = getLanguage(lang); let mynamecard = xmat.reduce((accum, obj) => { - if(obj.MaterialType !== 'MATERIAL_NAMECARD') return accum; + if(obj.materialType !== 'MATERIAL_NAMECARD') return accum; let data = {}; - data.Id = obj.Id; - // data.RankLevel = obj.RankLevel; // all rarity 4 + data.id = obj.id; + // data.rankLevel = obj.rankLevel; // all rarity 4 - data.name = language[obj.NameTextMapHash]; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); - data.sortorder = obj.Id; + data.name = language[obj.nameTextMapHash]; + data.description = sanitizeDescription(language[obj.descTextMapHash]); + data.sortorder = obj.id; - let sauce = xsource.find(ele => ele.Id === obj.Id); - data.source = sauce.TextList.map(ele => language[ele]).filter(ele => ele !== ''); + let sauce = xsource.find(ele => ele.id === obj.id); + data.source = sauce.textList.map(ele => language[ele]).filter(ele => ele !== ''); - data.nameicon = obj.Icon; - data.namebanner = obj.UseParam[0] !== "" ? obj.UseParam[0] : undefined; - data.namebackground = obj.UseParam[1]; + data.nameicon = obj.icon; + data.namebanner = obj.picPath[0] !== "" ? obj.picPath[0] : undefined; + data.namebackground = obj.picPath[1]; - let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(filename === '') return accum; if(accum[filename] !== undefined) console.log('filename collision: ' + filename); accum[filename] = data; diff --git a/myscripts/collateOutfit.js b/myscripts/collateOutfit.js index 22719326e..2e5bef8b2 100644 --- a/myscripts/collateOutfit.js +++ b/myscripts/collateOutfit.js @@ -5,9 +5,9 @@ const xavatar = getExcel('AvatarExcelConfigData'); // for AvatarCostumeExcelConfigData const propertyMap = { - Id: 'OBACDKHOCAM', // 200301 - AvatarId: 'BPAMNILGFPK', // 10000003 - IconName: 'DANEMGDCNIM' // UI_AvatarIcon_QinCostumeSea + id: 'GMECDCKBFJM', // 200301 + avatarId: 'FMAJGGBGKKN', // 10000003 + iconName: 'FOINIGFDKIP' // UI_AvatarIcon_QinCostumeSea } // taken from collateCharacter.js @@ -18,43 +18,43 @@ function collateOutfit(lang) { let myoutfit = xcostume.reduce((accum, obj) => { let data = {}; - data.Id = obj[propertyMap.Id]; + data.id = obj[propertyMap.id]; - data.name = language[obj.NameTextMapHash]; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); + data.name = language[obj.nameTextMapHash]; + data.description = sanitizeDescription(language[obj.descTextMapHash]); - data.isdefault = obj.IsDefault === true; + data.isdefault = obj.isDefault === true; - const AvatarId = obj[propertyMap.AvatarId]; + const AvatarId = obj[propertyMap.avatarId]; if(playerIdToTextMapHash[AvatarId]) data.character = language[playerIdToTextMapHash[AvatarId]]; else - data.character = language[xavatar.find(ele => ele.Id === obj[propertyMap.AvatarId]).NameTextMapHash]; + data.character = language[xavatar.find(ele => ele.id === obj[propertyMap.avatarId]).nameTextMapHash]; - if(obj.ItemId) { - let sauce = xsource.find(ele => ele.Id === obj.ItemId); - data.source = sauce.TextList.map(ele => language[ele]).filter(ele => ele !== ''); + if(obj.itemId) { + let sauce = xsource.find(ele => ele.id === obj.itemId); + data.source = sauce.textList.map(ele => language[ele]).filter(ele => ele !== ''); - data.namecard = xmat.find(ele => ele.Id === obj.ItemId).Icon; + data.namecard = xmat.find(ele => ele.id === obj.itemId).icon; } else { data.namecard = 'UI_AvatarIcon_Costume_Card'; } - if(obj[propertyMap.IconName]) { - data.nameicon = obj[propertyMap.IconName]; + if(obj[propertyMap.iconName]) { + data.nameicon = obj[propertyMap.iconName]; const name = data.nameicon.slice(data.nameicon.lastIndexOf('_')+1); data.namesplash = `UI_Costume_${name}`; } - if(obj.SideIconName) - data.namesideicon = obj.SideIconName; + if(obj.sideIconName) + data.namesideicon = obj.sideIconName; - // data.nameicon = obj.Icon; - // data.namebanner = obj.UseParam[0] !== "" ? obj.UseParam[0] : undefined; - // data.namebackground = obj.UseParam[1]; + // data.nameicon = obj.icon; + // data.namebanner = obj.useParam[0] !== "" ? obj.useParam[0] : undefined; + // data.namebackground = obj.useParam[1]; - let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(filename === '') return accum; if(filename === 'defaultoutfit') return accum; if(playerIdToTextMapHash[AvatarId]) diff --git a/myscripts/collateTalent.js b/myscripts/collateTalent.js index 13d82aa64..c7edf9ed4 100644 --- a/myscripts/collateTalent.js +++ b/myscripts/collateTalent.js @@ -4,7 +4,7 @@ const xpassive = getExcel('ProudSkillExcelConfigData'); // passive talents. also // object map that converts index to the talent type const talentCombatTypeMap = { '0': 'combat1', '1': 'combat2', '2': 'combatsp', '4': 'combat3' }; -const moraNameTextMapHash = getExcel('MaterialExcelConfigData').find(ele => ele.Id === 202).NameTextMapHash; +const moraNameTextMapHash = getExcel('MaterialExcelConfigData').find(ele => ele.id === 202).nameTextMapHash; function collateTalent(lang) { const language = getLanguage(lang); @@ -13,42 +13,42 @@ function collateTalent(lang) { // bad practice to declare functions inside loop but i need to be able to call it multiple times for players function dowork() { let data = {}; - let depot = xskilldepot.find(ele => ele.Id === obj.SkillDepotId); - if(depot === undefined || depot.EnergySkill === undefined) return; // not a finished (traveler) character - if(depot.TalentStarName === '') return; // unfinished + let depot = xskilldepot.find(ele => ele.id === obj.skillDepotId); + if(depot === undefined || depot.energySkill === undefined) return; // not a finished (traveler) character + if(depot.talentStarName === '') return; // unfinished - let filename = avatarIdToFileName[isPlayer(obj) ? obj.SkillDepotId : obj.Id]; + let filename = avatarIdToFileName[isPlayer(obj) ? obj.skillDepotId : obj.id]; - data.name = language[obj.NameTextMapHash]; // client-facing name - if(isPlayer(obj)) data.name += ` (${language[elementTextMapHash[getPlayerElement(obj.SkillDepotId)]]})` + data.name = language[obj.nameTextMapHash]; // client-facing name + if(isPlayer(obj)) data.name += ` (${language[elementTextMapHash[getPlayerElement(obj.skillDepotId)]]})` - let combat = depot.Skills.concat([depot.EnergySkill]) // get array of combat skills IDs - // console.log(depot.InherentProudSkillOpens) - let passive = depot.InherentProudSkillOpens.reduce((accum2, proud, index) => { // get array of passive skill IDs + let combat = depot.skills.concat([depot.energySkill]) // get array of combat skills IDs + // console.log(depot.inherentProudSkillOpens) + let passive = depot.inherentProudSkillOpens.reduce((accum2, proud, index) => { // get array of passive skill IDs if(filename === 'raidenshogun' && index === 2) return accum2; // skip hidden cannot cook passive - if(proud.ProudSkillGroupId) accum2.push(proud.ProudSkillGroupId); + if(proud.proudSkillGroupId) accum2.push(proud.proudSkillGroupId); return accum2; }, []); let parameters = {}; let costs = {}; combat.forEach((skId, index) => { if(skId === 0) return; - let talent = xtalent.find(tal => tal.Id === skId); + let talent = xtalent.find(tal => tal.id === skId); let combatTypeProp = talentCombatTypeMap[index]; let ref = data[combatTypeProp] = {}; - ref.Id = talent.Id; - ref.name = language[talent.NameTextMapHash]; - let desc = language[talent.DescTextMapHash].split('\\n\\n'); // extract out the italicized part + ref.id = talent.id; + ref.name = language[talent.nameTextMapHash]; + let desc = language[talent.descTextMapHash].split('\\n\\n'); // extract out the italicized part ref.info = sanitizeDescription(desc[0]); if(desc[1]) ref.description = sanitizeDescription(desc[1]); - ref.icon = talent.SkillIcon; + ref.icon = talent.skillIcon; if(combatTypeProp === 'combat3') ref.icon = ref.icon + '_HD'; ref.labels = []; // build the labels - let attTalent = xpassive.find(tal => (tal.ProudSkillGroupId === talent.ProudSkillGroupId && tal.Level === 1)); - for(let labelTextMap of attTalent.ParamDescList) { + let attTalent = xpassive.find(tal => (tal.proudSkillGroupId === talent.proudSkillGroupId && tal.level === 1)); + for(let labelTextMap of attTalent.paramDescList) { if(language[labelTextMap] === "") continue; ref.labels.push(replaceLayout(language[labelTextMap])); } @@ -56,8 +56,8 @@ function collateTalent(lang) { parameters[combatTypeProp] = {}; for(let lvl = 1; lvl <= 15; lvl++) { if(lvl !== 1 && index === 2) continue; // sprint skills don't have level-up - let attTalent = xpassive.find(tal => (tal.ProudSkillGroupId === talent.ProudSkillGroupId && tal.Level === lvl)); - attTalent.ParamList.forEach((value, paramIndex) => { + let attTalent = xpassive.find(tal => (tal.proudSkillGroupId === talent.proudSkillGroupId && tal.level === lvl)); + attTalent.paramList.forEach((value, paramIndex) => { const name = `param${paramIndex+1}`; if(value === 0) { // exclude those with values of 0 if(lvl !== 1 && parameters[combatTypeProp][name] !== undefined) console.log(`talent ${ref.name} value 0`); @@ -69,13 +69,13 @@ function collateTalent(lang) { if(lvl >= 2 && lvl <= 10) { // get upgrade costs costs['lvl'+lvl] = [{ name: language[moraNameTextMapHash], - count: attTalent.CoinCost + count: attTalent.coinCost }]; - for(let items of attTalent.CostItems) { - if(items.Id === undefined) continue; + for(let items of attTalent.costItems) { + if(items.id === undefined) continue; costs['lvl'+lvl].push({ - name: language[xmat.find(ele => ele.Id === items.Id).NameTextMapHash], - count: items.Count + name: language[xmat.find(ele => ele.id === items.id).nameTextMapHash], + count: items.count }) } } @@ -83,12 +83,12 @@ function collateTalent(lang) { }); passive.forEach((skId, index) => { - let talent = xpassive.find(pas => pas.ProudSkillGroupId === skId); + let talent = xpassive.find(pas => pas.proudSkillGroupId === skId); let ref = data['passive'+(index+1)] = {}; // store reference in variable to make it easier to access - ref.Id = skId; - ref.name = language[talent.NameTextMapHash]; - ref.info = sanitizeDescription(language[talent.DescTextMapHash]); - ref.icon = talent.Icon; + ref.id = skId; + ref.name = language[talent.nameTextMapHash]; + ref.info = sanitizeDescription(language[talent.descTextMapHash]); + ref.icon = talent.icon; }); data.costs = costs; data.parameters = parameters; @@ -97,8 +97,8 @@ function collateTalent(lang) { } if(isPlayer(obj)) { - obj.CandSkillDepotIds.forEach(ele => { - obj.SkillDepotId = ele; + obj.candSkillDepotIds.forEach(ele => { + obj.skillDepotId = ele; dowork(); }); } else { diff --git a/myscripts/collateVoiceover.js b/myscripts/collateVoiceover.js index 60e1e0804..7eefe287c 100644 --- a/myscripts/collateVoiceover.js +++ b/myscripts/collateVoiceover.js @@ -10,37 +10,37 @@ function collateVoiceover(lang) { let mynamecard = xplayableAvatar.reduce((accum, obj) => { let data = {}; - data.Id = obj.Id; + data.id = obj.id; - data.name = language[obj.NameTextMapHash]; - if(isPlayer(obj)) data.name = language[playerIdToTextMapHash[obj.Id]]; + data.name = language[obj.nameTextMapHash]; + if(isPlayer(obj)) data.name = language[playerIdToTextMapHash[obj.id]]; data.story = []; data.combat = []; - let xvoices = xfetter.filter(ele => ele.AvatarId === obj.Id); + let xvoices = xfetter.filter(ele => ele.avatarId === obj.id); xvoices.forEach(ele => { let tmp = { - Id: ele.FetterId, // DEBUG - title: language[ele.VoiceTitleTextMapHash], - text: sanitizeDescription(language[ele.VoiceFileTextTextMapHash]), - unlock: ele.Tips.map(e => language[e]).filter(e => e !== '') // TextList/JumpList + Id: ele.fetterId, // DEBUG + title: language[ele.voiceTitleTextMapHash], + text: sanitizeDescription(language[ele.voiceFileTextTextMapHash]), + unlock: ele.tips.map(e => language[e]).filter(e => e !== '') // TextList/JumpList } if(tmp.unlock.length === 0) delete tmp.unlock; - if(ele.IsHiden === 1) data.story.push(tmp); - else if(ele.IsHiden === 2) data.combat.push(tmp); - else console.log('unknown voiceover tab: ' + ele.FetterId); + if(ele.isHiden === 1) data.story.push(tmp); + else if(ele.isHiden === 2) data.combat.push(tmp); + else console.log('unknown voiceover tab: ' + ele.fetterId); }); - // data.description = sanitizeDescription(language[obj.DescTextMapHash]); - // data.sortorder = obj.Id; + // data.description = sanitizeDescription(language[obj.descTextMapHash]); + // data.sortorder = obj.id; - // let sauce = xsource.find(ele => ele.Id === obj.Id); - // data.source = sauce.TextList.map(ele => language[ele]).filter(ele => ele !== ''); + // let sauce = xsource.find(ele => ele.id === obj.id); + // data.source = sauce.textList.map(ele => language[ele]).filter(ele => ele !== ''); - let filename = makeFileName(getLanguage('EN')[isPlayer(obj) ? playerIdToTextMapHash[obj.Id] : obj.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[isPlayer(obj) ? playerIdToTextMapHash[obj.id] : obj.nameTextMapHash]); if(filename === '') return accum; if(accum[filename] !== undefined) console.log('filename collision: ' + filename); accum[filename] = data; diff --git a/myscripts/collateWeapon.js b/myscripts/collateWeapon.js index a79c2ca92..d1ffc6e5b 100644 --- a/myscripts/collateWeapon.js +++ b/myscripts/collateWeapon.js @@ -1,13 +1,13 @@ const xweapon = getExcel('WeaponExcelConfigData'); const xrefine = getExcel('EquipAffixExcelConfigData'); -const moraNameTextMapHash = getExcel('MaterialExcelConfigData').find(ele => ele.Id === 202).NameTextMapHash; +const moraNameTextMapHash = getExcel('MaterialExcelConfigData').find(ele => ele.id === 202).nameTextMapHash; const xmat = getExcel('MaterialExcelConfigData'); const xplayableWeapon = xweapon.filter(obj => { - if(obj.RankLevel >= 3 && obj.SkillAffix[0] === 0) return false; - if(obj.SkillAffix[1] !== 0) { console.log('danger'); return false }; - const name = getLanguage('EN')[obj.NameTextMapHash]; + if(obj.rankLevel >= 3 && obj.skillAffix[0] === 0) return false; + if(obj.skillAffix[1] !== 0) { console.log('danger'); return false }; + const name = getLanguage('EN')[obj.nameTextMapHash]; if(name === '') return false; else if(name === 'The Flagstaff' || name === 'Quartz' || name === 'Ebony Bow' || name === 'Amber Bead') return false; return true; @@ -19,32 +19,32 @@ function collateWeapon(lang) { let myweapon = xplayableWeapon.reduce((accum, obj) => { let data = {}; - data.Id = obj.Id; - let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + data.id = obj.id; + let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(accum[filename] !== undefined) console.log(filename+' IS NOT UNIQUE'); - data.name = language[obj.NameTextMapHash]; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); - data.weapontype = language[weaponTextMapHash[obj.WeaponType]]; - data.rarity = ''+obj.RankLevel; + data.name = language[obj.nameTextMapHash]; + data.description = sanitizeDescription(language[obj.descTextMapHash]); + data.weapontype = language[weaponTextMapHash[obj.weaponType]]; + data.rarity = ''+obj.rankLevel; - if(obj.WeaponProp[0].PropType !== 'FIGHT_PROP_BASE_ATTACK') console.log(obj,'weapon did not find base atk'); - data.baseatk = obj.WeaponProp.find(obj => obj.PropType === 'FIGHT_PROP_BASE_ATTACK').InitValue; + if(obj.weaponProp[0].propType !== 'FIGHT_PROP_BASE_ATTACK') console.log(obj,'weapon did not find base atk'); + data.baseatk = obj.weaponProp.find(obj => obj.propType === 'FIGHT_PROP_BASE_ATTACK').initValue; - let substat = obj.WeaponProp[1].PropType; + let substat = obj.weaponProp[1].propType; if(substat !== undefined) { - data.substat = language[xmanualtext.find(ele => ele.TextMapId === substat).TextMapContentTextMapHash]; - let subvalue = obj.WeaponProp[1].InitValue; + data.substat = language[xmanualtext.find(ele => ele.textMapId === substat).textMapContentTextMapHash]; + let subvalue = obj.weaponProp[1].initValue; data.subvalue = subvalue; } - if(obj.SkillAffix[0] !== 0) { - let affixId = obj.SkillAffix[0] * 10; + if(obj.skillAffix[0] !== 0) { + let affixId = obj.skillAffix[0] * 10; for(let offset = 0; offset < 5; offset++) { - let ref = xrefine.find(ele => ele.AffixId === affixId+offset); + let ref = xrefine.find(ele => ele.affixId === affixId+offset); if(ref === undefined) break; - if(offset === 0) data.effectname = language[ref.NameTextMapHash]; - let effect = language[ref.DescTextMapHash]; + if(offset === 0) data.effectname = language[ref.nameTextMapHash]; + let effect = language[ref.descTextMapHash]; effect = effect.replaceAll('{NON_BREAK_SPACE}', ' '); effect = effect.replace(/<\/color>s/g, 's<\/color>'); if(filename === 'swordofdescension' || filename === 'predator') { // has extra color @@ -70,19 +70,19 @@ function collateWeapon(lang) { // get the promotion costs let costs = {}; - for(let i = 1; i <= (obj.RankLevel <= 2 ? 4 : 6); i++) { + for(let i = 1; i <= (obj.rankLevel <= 2 ? 4 : 6); i++) { // 1 and 2 star weapons only have 4 ascensions instead of 6 - let apromo = xsubstat.find(ele => ele.WeaponPromoteId === obj.WeaponPromoteId && ele.PromoteLevel === i); + let apromo = xsubstat.find(ele => ele.weaponPromoteId === obj.weaponPromoteId && ele.promoteLevel === i); costs['ascend'+i] = [{ name: language[moraNameTextMapHash], - count: apromo.CoinCost + count: apromo.coinCost }]; - for(let items of apromo.CostItems) { - if(items.Id === undefined) continue; + for(let items of apromo.costItems) { + if(items.id === undefined) continue; costs['ascend'+i].push({ - name: language[xmat.find(ele => ele.Id === items.Id).NameTextMapHash], - count: items.Count + name: language[xmat.find(ele => ele.id === items.id).nameTextMapHash], + count: items.count }) } } @@ -90,31 +90,31 @@ function collateWeapon(lang) { // INFORMATION TO CALCULATE STATS AT EACH LEVEL let stats = { base: {}, curve: {} }; - stats.base.attack = obj.WeaponProp[0].InitValue; - stats.base.specialized = obj.WeaponProp[1].InitValue || 0; + stats.base.attack = obj.weaponProp[0].initValue; + stats.base.specialized = obj.weaponProp[1].initValue || 0; - stats.curve.attack = obj.WeaponProp[0].Type; - stats.curve.specialized = obj.WeaponProp[1].Type; + stats.curve.attack = obj.weaponProp[0].type; + stats.curve.specialized = obj.weaponProp[1].type; stats.specialized = substat; stats.promotion = xsubstat.reduce((accum, ele) => { - if(ele.WeaponPromoteId !== obj.WeaponPromoteId) return accum; - let promotelevel = ele.PromoteLevel || 0; + if(ele.weaponPromoteId !== obj.weaponPromoteId) return accum; + let promotelevel = ele.promoteLevel || 0; accum[promotelevel] = { - maxlevel: ele.UnlockMaxLevel, - attack: ele.AddProps.find(ele => ele.PropType === 'FIGHT_PROP_BASE_ATTACK').Value || 0 + maxlevel: ele.unlockMaxLevel, + attack: ele.addProps.find(ele => ele.propType === 'FIGHT_PROP_BASE_ATTACK').value || 0 }; - let special = ele.AddProps.find(ele => ele.PropType === substat);//.Value; - if(special) special = special.Value; + let special = ele.addProps.find(ele => ele.propType === substat);//.value; + if(special) special = special.value; if(special !== undefined) { - console.log('WEAPON SPECIAL SUBSTAT FOUND: ' + obj.Id) + console.log('WEAPON SPECIAL SUBSTAT FOUND: ' + obj.id) accum[promotelevel].specialized = special; } return accum; }, []) data.stats = stats; - data.icon = obj.Icon; - data.awakenicon = obj.AwakenIcon; + data.icon = obj.icon; + data.awakenicon = obj.awakenIcon; accum[filename] = data; return accum; diff --git a/myscripts/collateWindGlider.js b/myscripts/collateWindGlider.js index a78f324ee..15a8bb510 100644 --- a/myscripts/collateWindGlider.js +++ b/myscripts/collateWindGlider.js @@ -6,26 +6,26 @@ function collateWindGlider(lang) { const language = getLanguage(lang); let mydata = xfly.reduce((accum, obj) => { let data = {}; - data.Id = obj.FlycloakId; + data.id = obj.flycloakId; - data.name = language[obj.NameTextMapHash]; - data.description = sanitizeDescription(language[obj.DescTextMapHash]); + data.name = language[obj.nameTextMapHash]; + data.description = sanitizeDescription(language[obj.descTextMapHash]); - let flymat = xmat.find(ele => ele.Id === obj.MaterialId) || {}; + let flymat = xmat.find(ele => ele.id === obj.materialId) || {}; - data.rarity = flymat.RankLevel+""; - data.sortorder = obj.FlycloakId; - data.ishidden = obj.Hide ? true : undefined; + data.rarity = flymat.rankLevel+""; + data.sortorder = obj.flycloakId; + data.ishidden = obj.hide ? true : undefined; - // let sauce = xsource.find(ele => ele.Id === obj.Id); - // data.source = sauce.TextList.map(ele => language[ele]).filter(ele => ele !== ''); - data.source = getMatSourceText(obj.MaterialId, language); + // let sauce = xsource.find(ele => ele.id === obj.id); + // data.source = sauce.textList.map(ele => language[ele]).filter(ele => ele !== ''); + data.source = getMatSourceText(obj.materialId, language); - data.nameicon = flymat.Icon; - data.namegacha = obj.Icon; + data.nameicon = flymat.icon; + data.namegacha = obj.icon; - let filename = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(filename === '') return accum; if(accum[filename] !== undefined) console.log('filename collision: ' + filename); accum[filename] = data; diff --git a/myscripts/myscript.js b/myscripts/myscript.js index 4b1b447b4..a71ef2889 100644 --- a/myscripts/myscript.js +++ b/myscripts/myscript.js @@ -15,7 +15,7 @@ const langcodes = ['CHS', 'CHT', 'DE', 'EN', 'ES', 'FR', 'ID', 'JP', 'KR', 'PT', // const weaponIdToFileName = xweapon.reduce((accum, obj) => { -// accum[obj.Id] = +// accum[obj.id] = // }, {}) @@ -23,8 +23,8 @@ const langcodes = ['CHS', 'CHT', 'DE', 'EN', 'ES', 'FR', 'ID', 'JP', 'KR', 'PT', // UNUSED object map that converts AvatarAssocType into a TextMapHash const assocTextMapHash = ['ASSOC_TYPE_MONDSTADT', 'ASSOC_TYPE_LIYUE', 'ASSOC_TYPE_FATUI']; -global.isPlayer = function(data) { return data.CandSkillDepotIds && data.CandSkillDepotIds.length !== 0; } -global.getPlayerElement = function(SkillDepotId) { let tmp = xskilldepot.find(ele => ele.Id === SkillDepotId); return tmp === undefined ? tmp : tmp.TalentStarName.split('_').pop(); } +global.isPlayer = function(data) { return data.candSkillDepotIds && data.candSkillDepotIds.length !== 0; } +global.getPlayerElement = function(SkillDepotId) { let tmp = xskilldepot.find(ele => ele.id === SkillDepotId); return tmp === undefined ? tmp : tmp.talentStarName.split('_').pop(); } global.getLanguage = function(abbriev) { return getTextMap(abbriev.toUpperCase()); } global.normalizeStr = function(str) { return str.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); } global.makeFileName = function(str, lang) { return normalizeStr(str).toLowerCase().replace(/[^a-z]/g,''); } @@ -34,26 +34,26 @@ global.capitalizeFirst = function(str) { return str[0].toUpperCase() + str.toLow 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 || '')))); } -global.getMatSourceText = function(id, textmap) { return getExcel('MaterialSourceDataExcelConfigData').find(e => e.Id === id).TextList.map(e => textmap[e]).filter(e => e !== ''); } +global.getMatSourceText = function(id, textmap) { return getExcel('MaterialSourceDataExcelConfigData').find(e => e.id === id).textList.map(e => textmap[e]).filter(e => e !== ''); } /* ======================================================================================= */ // object map that converts the genshin coded element into a TextMapHash global.elementTextMapHash = ['Fire', 'Water', 'Grass', 'Electric', 'Wind', 'Ice', 'Rock'].reduce((accum, element) => { - accum[element] = xmanualtext.find(ele => ele.TextMapId === element).TextMapContentTextMapHash; + accum[element] = xmanualtext.find(ele => ele.textMapId === element).textMapContentTextMapHash; return accum; }, {}); -global.xplayableAvatar = xavatar.filter(obj => obj.AvatarPromoteId !== 2 || obj.Id === 10000002); // array +global.xplayableAvatar = xavatar.filter(obj => obj.avatarPromoteId !== 2 || obj.id === 10000002); // array // object map that converts an avatar Id or traveler SkillDepotId to filename global.avatarIdToFileName = xplayableAvatar.reduce((accum, obj) => { - if(obj.Id === 10000005) accum[obj.Id] = 'aether'; - else if(obj.Id === 10000007) accum[obj.Id] = 'lumine'; - else accum[obj.Id] = makeFileName(getLanguage('EN')[obj.NameTextMapHash]); + if(obj.id === 10000005) accum[obj.id] = 'aether'; + else if(obj.id === 10000007) accum[obj.id] = 'lumine'; + else accum[obj.id] = makeFileName(getLanguage('EN')[obj.nameTextMapHash]); if(isPlayer(obj)) { // - obj.CandSkillDepotIds.forEach(skdeId => { + obj.candSkillDepotIds.forEach(skdeId => { let trelement = elementTextMapHash[getPlayerElement(skdeId)]; if(trelement === undefined) return; - accum[skdeId] = makeFileName(getLanguage('EN')[obj.NameTextMapHash] + getLanguage('EN')[trelement]); + accum[skdeId] = makeFileName(getLanguage('EN')[obj.nameTextMapHash] + getLanguage('EN')[trelement]); }) } return accum; @@ -61,18 +61,18 @@ global.avatarIdToFileName = xplayableAvatar.reduce((accum, obj) => { // object map that converts a WeaponType into a TextMapHash global.weaponTextMapHash = ['WEAPON_SWORD_ONE_HAND', 'WEAPON_CATALYST', 'WEAPON_CLAYMORE', 'WEAPON_BOW', 'WEAPON_POLE'].reduce((accum, str) => { - accum[str] = xmanualtext.find(ele => ele.TextMapId === str).TextMapContentTextMapHash; + accum[str] = xmanualtext.find(ele => ele.textMapId === str).textMapContentTextMapHash; return accum; }, {}); // translates day of the week. 1 => Monday, etc. Returns textmaphash global.dayOfWeek = function(num) { - return xmanualtext.find(ele => ele.TextMapId === 'UI_ABYSSUS_DATE'+num).TextMapContentTextMapHash; + return xmanualtext.find(ele => ele.textMapId === 'UI_ABYSSUS_DATE'+num).textMapContentTextMapHash; } const xcity = getExcel('CityConfigData'); // adds Snezhnaya manually -if(!xcity.find(ele => getLanguage('EN')[ele.CityNameTextMapHash] === 'Snezhnaya')) { +if(!xcity.find(ele => getLanguage('EN')[ele.cityNameTextMapHash] === 'Snezhnaya')) { getLanguage('CHS')['Snezhnaya'] = '至冬国'; getLanguage('CHT')['Snezhnaya'] = '至冬國'; getLanguage('DE')['Snezhnaya'] = 'Snezhnaya'; @@ -87,7 +87,7 @@ if(!xcity.find(ele => getLanguage('EN')[ele.CityNameTextMapHash] === 'Snezhnaya' getLanguage('TH')['Snezhnaya'] = 'Snezhnaya'; getLanguage('VI')['Snezhnaya'] = 'Snezhnaya'; - xcity.push({ CityId: 8758412, CityNameTextMapHash: 'Snezhnaya'}) + xcity.push({ cityId: 8758412, cityNameTextMapHash: 'Snezhnaya'}) } /* =========================================================================================== */ @@ -97,10 +97,10 @@ function exportCurve(folder, file) { let output = {}; xcurve.forEach(ele => { let curveinfo = {}; - ele.CurveInfos.forEach(ele => { - curveinfo[ele.Type] = ele.Value; + ele.curveInfos.forEach(ele => { + curveinfo[ele.type] = ele.value; }); - output[ele.Level] = curveinfo; + output[ele.level] = curveinfo; }); fs.mkdirSync(`./export/curve`, { recursive: true }); fs.writeFileSync(`./export/curve/${folder}.json`, JSON.stringify(output, null, '\t')); @@ -128,24 +128,26 @@ function exportData(folder, collateFunc, englishonly, skipwrite) { // exportCurve('weapons', 'WeaponCurveExcelConfigData') // exportData('artifacts', require('./collateArtifact.js')); // exportData('foods', require('./collateFood')); -// exportData('materials', require('./collateMaterial'), false); // change: used both TextList/JumpList. temp removed dropdomain/daysofweek +// exportData('materials', require('./collateMaterial')); // change: used both TextList/JumpList. temp removed dropdomain/daysofweek // exportData('domains', require('./collateDomain')); // run twice // remember to add back recommendedelements and disorder and entrypicpath -// exportData('enemies', require('./collateEnemy'), true); +// exportData('enemies', require('./collateEnemy')); // exportCurve('enemies', 'MonsterCurveExcelConfigData'); // exportData('domains', require('./collateDomainMonsterList')); // MUST do run only after both domains and enemies have run. sync. -// exportData('outfits', require('./collateOutfit')); // Fix obfuscated keys! +// exportData('outfits', require('./collateOutfit')); // Fix obfuscated keys after every version update // exportData('windgliders', require('./collateWindGlider')); -// exportData('animals', require('./collateAnimal')); +// exportData('animals', require('./collateAnimal')); // Fix obfuscated keys after every version update // exportData('namecards', require('./collateNamecard')); // exportData('geographies', require('./collateGeography')); // exportData('achievements', require('./collateAchievement')); // exportData('achievementgroups', require('./collateAchievementGroup')); -// exportData('commissions', require('./collateCommission'), true); -exportData('voiceovers', require('./collateVoiceover'), true); +// exportData('adventureranks', require('./collateAdventureRank')); -// // exportData('fishingpoints', require('./collateFishingPoint')); +// exportData('commissions', require('./collateCommission'), true); // unfinished +// exportData('voiceovers', require('./collateVoiceover'), true); // unfinished + +// // exportData('fishingpoints', require('./collateFishingPoint')); // unfinished //console.log(collateCharacter('EN')) //console.log(collateConstellation('EN').hutao) diff --git a/package-lock.json b/package-lock.json index 3946a08be..7a0c55bc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,20 +5,20 @@ "packages": { "": { "dependencies": { - "fuzzysort": "^1.1.4" + "fuzzysort": "^2.0.1" } }, "node_modules/fuzzysort": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-1.1.4.tgz", - "integrity": "sha512-JzK/lHjVZ6joAg3OnCjylwYXYVjRiwTY6Yb25LvfpJHK8bjisfnZJ5bY8aVWwTwCXgxPNgLAtmHL+Hs5q1ddLQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-2.0.1.tgz", + "integrity": "sha512-SlgbPAq0eQ6JQ1h3l4MNeGH/t9DHKH8GGM0RD/6RhmJrNnSoWt3oIVaiQm9g9BPB+wAhRMeMqlUTbhbd7+Ufcg==" } }, "dependencies": { "fuzzysort": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-1.1.4.tgz", - "integrity": "sha512-JzK/lHjVZ6joAg3OnCjylwYXYVjRiwTY6Yb25LvfpJHK8bjisfnZJ5bY8aVWwTwCXgxPNgLAtmHL+Hs5q1ddLQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-2.0.1.tgz", + "integrity": "sha512-SlgbPAq0eQ6JQ1h3l4MNeGH/t9DHKH8GGM0RD/6RhmJrNnSoWt3oIVaiQm9g9BPB+wAhRMeMqlUTbhbd7+Ufcg==" } } } diff --git a/package.json b/package.json index 0bdb82301..3e83b9a72 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "fuzzysort": "^1.1.4" + "fuzzysort": "^2.0.1" } }