@malib/gear 0.11.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +2 -2
- package/index.js +52 -41
- package/lib/gear.d.ts +12 -0
- package/lib/soul.d.ts +9 -6
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class L{constructor(){this.base=0,this.bonus=0,this.upgrade=0,this.enchant=0}get empty(){return this.base===0&&this.bonus===0&&this.upgrade===0&&this.enchant===0}get sum(){return Math.max(0,this.base+this.bonus+this.upgrade+this.enchant)}get diff(){return this.bonus+this.upgrade+this.enchant}}var s=(t=>(t[t.incSTR=1]="incSTR",t[t.incSTRr=2]="incSTRr",t[t.incDEX=3]="incDEX",t[t.incDEXr=4]="incDEXr",t[t.incINT=5]="incINT",t[t.incINTr=6]="incINTr",t[t.incLUK=7]="incLUK",t[t.incLUKr=8]="incLUKr",t[t.incAllStat=9]="incAllStat",t[t.incMHP=10]="incMHP",t[t.incMMP=11]="incMMP",t[t.incMHPr=12]="incMHPr",t[t.incMMPr=13]="incMMPr",t[t.incMDF=14]="incMDF",t[t.incARC=15]="incARC",t[t.incAUT=16]="incAUT",t[t.incPAD=17]="incPAD",t[t.incMAD=18]="incMAD",t[t.incAD=19]="incAD",t[t.incPDD=20]="incPDD",t[t.incSpeed=21]="incSpeed",t[t.incJump=22]="incJump",t[t.knockback=23]="knockback",t[t.bdR=24]="bdR",t[t.incBDR=25]="incBDR",t[t.imdR=26]="imdR",t[t.incIMDR=27]="incIMDR",t[t.damR=28]="damR",t[t.nbdR=29]="nbdR",t[t.statR=30]="statR",t[t.incCHUC=31]="incCHUC",t[t.incPADr=100]="incPADr",t[t.incMADr=101]="incMADr",t[t.incPDDr=102]="incPDDr",t[t.incCr=103]="incCr",t[t.incDAMr=104]="incDAMr",t[t.RecoveryHP=105]="RecoveryHP",t[t.RecoveryMP=106]="RecoveryMP",t[t.face=107]="face",t[t.prop=108]="prop",t[t.time=109]="time",t[t.HP=110]="HP",t[t.MP=111]="MP",t[t.attackType=112]="attackType",t[t.ignoreTargetDEF=113]="ignoreTargetDEF",t[t.ignoreDAM=114]="ignoreDAM",t[t.ignoreDAMr=115]="ignoreDAMr",t[t.DAMreflect=116]="DAMreflect",t[t.mpconReduce=117]="mpconReduce",t[t.incMesoProp=118]="incMesoProp",t[t.incRewardProp=119]="incRewardProp",t[t.incAllskill=120]="incAllskill",t[t.RecoveryUP=121]="RecoveryUP",t[t.boss=122]="boss",t[t.level=123]="level",t[t.incTerR=124]="incTerR",t[t.incAsrR=125]="incAsrR",t[t.incEXPr=126]="incEXPr",t[t.reduceCooltime=127]="reduceCooltime",t[t.incSTRlv=128]="incSTRlv",t[t.incDEXlv=129]="incDEXlv",t[t.incINTlv=130]="incINTlv",t[t.incLUKlv=131]="incLUKlv",t[t.incMHPlv=132]="incMHPlv",t[t.incPADlv=133]="incPADlv",t[t.incMADlv=134]="incMADlv",t[t.incCriticaldamage=135]="incCriticaldamage",t[t.attackSpeed=200]="attackSpeed",t[t.setItemID=201]="setItemID",t[t.durability=202]="durability",t[t.reduceReq=203]="reduceReq",t[t.only=1100]="only",t[t.tradeBlock=1101]="tradeBlock",t[t.accountSharable=1102]="accountSharable",t[t.onlyEquip=1103]="onlyEquip",t[t.tradeAvailable=1104]="tradeAvailable",t[t.equipTradeBlock=1105]="equipTradeBlock",t[t.sharableOnce=1106]="sharableOnce",t[t.charismaEXP=1107]="charismaEXP",t[t.senseEXP=1108]="senseEXP",t[t.insightEXP=1109]="insightEXP",t[t.willEXP=1110]="willEXP",t[t.craftEXP=1111]="craftEXP",t[t.charmEXP=1112]="charmEXP",t[t.accountShareTag=1113]="accountShareTag",t[t.bossReward=1114]="bossReward",t[t.noPotential=1115]="noPotential",t[t.fixedPotential=1116]="fixedPotential",t[t.specialGrade=1117]="specialGrade",t[t.fixedGrade=1118]="fixedGrade",t[t.superiorEqp=1119]="superiorEqp",t[t.incPQEXPr=1120]="incPQEXPr",t[t.jokerToSetItem=1121]="jokerToSetItem",t[t.blockGoldHammer=1122]="blockGoldHammer",t[t.exceptUpgrade=1123]="exceptUpgrade",t[t.onlyUpgrade=1124]="onlyUpgrade",t[t.noLookChange=1125]="noLookChange",t[t.tucIgnoreForPotential=1126]="tucIgnoreForPotential",t))(s||{}),f=(t=>(t[t.cap=100]="cap",t[t.faceAccessory=101]="faceAccessory",t[t.eyeAccessory=102]="eyeAccessory",t[t.earrings=103]="earrings",t[t.coat=104]="coat",t[t.longcoat=105]="longcoat",t[t.pants=106]="pants",t[t.shoes=107]="shoes",t[t.glove=108]="glove",t[t.cape=110]="cape",t[t.ring=111]="ring",t[t.pendant=112]="pendant",t[t.belt=113]="belt",t[t.medal=114]="medal",t[t.shoulder=115]="shoulder",t[t.pocket=116]="pocket",t[t.badge=118]="badge",t[t.android=166]="android",t[t.machineHeart=167]="machineHeart",t[t.shield=109]="shield",t[t.emblem=119]="emblem",t[t.powerSource=119020]="powerSource",t[t.shiningRod=1212]="shiningRod",t[t.tuner=1213]="tuner",t[t.breathShooter=1214]="breathShooter",t[t.soulShooter=122]="soulShooter",t[t.desperado=123]="desperado",t[t.energySword=124]="energySword",t[t.espLimiter=126]="espLimiter",t[t.chain=127]="chain",t[t.magicGauntlet=128]="magicGauntlet",t[t.ritualFan=129]="ritualFan",t[t.ohSword=130]="ohSword",t[t.ohAxe=131]="ohAxe",t[t.ohBlunt=132]="ohBlunt",t[t.dagger=133]="dagger",t[t.katara=134]="katara",t[t.cane=136]="cane",t[t.wand=137]="wand",t[t.staff=138]="staff",t[t.thSword=140]="thSword",t[t.chakram=1404]="chakram",t[t.thAxe=141]="thAxe",t[t.thBlunt=142]="thBlunt",t[t.spear=143]="spear",t[t.polearm=144]="polearm",t[t.bow=145]="bow",t[t.crossbow=146]="crossbow",t[t.claw=147]="claw",t[t.knuckle=148]="knuckle",t[t.gun=149]="gun",t[t.shovel=150]="shovel",t[t.pickaxe=151]="pickaxe",t[t.dualBowguns=152]="dualBowguns",t[t.handCannon=153]="handCannon",t[t.heavySword=156]="heavySword",t[t.longSword=157]="longSword",t[t.gauntletRevolver=158]="gauntletRevolver",t[t.ancientBow=159]="ancientBow",t[t.soulShield=1098]="soulShield",t[t.demonShield=1099]="demonShield",t[t.magicArrow=135200]="magicArrow",t[t.card=135210]="card",t[t.medallion=135220]="medallion",t[t.rosary=135221]="rosary",t[t.ironChain=135222]="ironChain",t[t.magicBook1=135223]="magicBook1",t[t.magicBook2=135224]="magicBook2",t[t.magicBook3=135225]="magicBook3",t[t.arrowFletching=135226]="arrowFletching",t[t.bowThimble=135227]="bowThimble",t[t.daggerScabbard=135228]="daggerScabbard",t[t.charm=135229]="charm",t[t.orb=135240]="orb",t[t.dragonEssence=135250]="dragonEssence",t[t.soulRing=135260]="soulRing",t[t.magnum=135270]="magnum",t[t.wristBand=135290]="wristBand",t[t.farSight=135291]="farSight",t[t.powderKeg=135292]="powderKeg",t[t.mass=135293]="mass",t[t.document=135294]="document",t[t.magicMarble=135295]="magicMarble",t[t.arrowhead=135296]="arrowhead",t[t.jewel=135297]="jewel",t[t.powderKeg2=135298]="powderKeg2",t[t.controller=135300]="controller",t[t.foxMarble=135310]="foxMarble",t[t.chessPiece=135320]="chessPiece",t[t.transmitter=135330]="transmitter",t[t.charge=135340]="charge",t[t.magicWing=135350]="magicWing",t[t.pathOfAbyss=135360]="pathOfAbyss",t[t.relic=135370]="relic",t[t.fanTassel=135380]="fanTassel",t[t.bracelet=135400]="bracelet",t[t.weaponBelt=135401]="weaponBelt",t[t.ornament=135402]="ornament",t[t.hexSeeker=135403]="hexSeeker",t[t.petEquip=180]="petEquip",t[t.machineEngine=161]="machineEngine",t[t.machineArms=162]="machineArms",t[t.machineLegs=163]="machineLegs",t[t.machineBody=164]="machineBody",t[t.machineTransistors=165]="machineTransistors",t[t.dragonMask=194]="dragonMask",t[t.dragonPendant=195]="dragonPendant",t[t.dragonWings=196]="dragonWings",t[t.dragonTail=197]="dragonTail",t))(f||{}),C=(t=>(t[t.normal=0]="normal",t[t.rare=1]="rare",t[t.epic=2]="epic",t[t.unique=3]="unique",t[t.legendary=4]="legendary",t[t.special=5]="special",t))(C||{});class l{constructor(i){this.enchanted=!1,this.charge=0,this.chargeOption=new Map,this.gear=i}enchant(){return this.enchanted||!D.isWeapon(this.gear.type)?!1:(this.enchanted=!0,this.soul=void 0,this.charge=0,this.chargeOption.clear(),!0)}disenchant(){return this.enchanted?(this.enchanted=!1,this.soul=void 0,this.charge=0,this.chargeOption.clear(),!0):!1}setSoul(i){return this.enchanted?(this.soul=i,this.setCharge(this.charge),!0):!1}removeSoul(){return!this.enchanted||!this.soul?!1:(this.soul=void 0,this.setCharge(this.charge),!0)}setCharge(i){if(!this.enchanted||i<0||i>1e3)return!1;this.charge=i;const a=this.gear.option(s.incPAD).base<this.gear.option(s.incMAD).base?s.incMAD:s.incPAD;return this.chargeOption.clear(),this.chargeOption.set(a,this.getChargeAD()),!0}getChargeAD(){if(!this.enchanted||this.charge===0)return 0;const i=Math.min(Math.ceil(this.charge/100)-1,5);if(this.soul){const o=this.soul.multiplier;return 10+i*o}return 5+i}}const w=class{constructor(){this.itemID=0,this.name="",this.desc="",this.type=0,this.props=new Map,this.options=new Map,this.totalUpgradeCount=0,this.upgradeCount=0,this.upgradeFailCount=0,this.hammerCount=0,this.maxStar=0,this.star=0,this.amazing=!1,this.canPotential=!1,this.grade=C.normal,this.potentials=[],this.additionalGrade=C.normal,this.additionalPotentials=[],this.soulWeapon=new l(this),this.icon={id:0,origin:[0,0]},this.req={level:0,str:0,dex:0,int:0,luk:0,job:0,specJob:0}}get upgradeCountLeft(){return this.totalUpgradeCount+this.hammerCount-this.upgradeCount-this.upgradeFailCount}get diff(){let t=0;for(const[i,o]of this.options)t+=Math.floor(o.diff/w.getPropTypeWeight(i));return t}get isNewBonusType(){return!!([...this.options.values()].some(i=>i.bonus>0)&&this.getPropValue(s.tradeAvailable)!==1)}option(t){return this.options.has(t)||this.options.set(t,new L),this.options.get(t)}getPropValue(t){return this.props.get(t)??0}getBooleanValue(t){return(this.props.get(t)??0)>0}setAnvil(t,i){this.anvilIcon=t,this.anvilName=i}resetAnvil(){this.anvilIcon=void 0,this.anvilName=void 0}static isWeapon(t){return this.isLeftWeapon(t)||this.isDoubleHandWeapon(t)}static isLeftWeapon(t){return t>=121&&t<=139&&t!==f.katara||Math.floor(t/10)===121}static isDoubleHandWeapon(t){return t>=140&&t<=149||t>=152&&t<=159||Math.floor(t/10)===140}static isSubWeapon(t){switch(t){case f.katara:case f.shield:case f.demonShield:case f.soulShield:return!0;default:return Math.floor(t/1e3)===135}}static isShield(t){switch(t){case f.shield:case f.demonShield:case f.soulShield:return!0;default:return!1}}static isArmor(t){return t===100||t>=104&&t<=110||t===f.soulShield||t===f.demonShield}static isAccessory(t){return t>=101&&t<=103||t>=111&&t<=113||t===115}static isMechanicGear(t){return t>=161&&t<=165}static isDragonGear(t){return t>=194&&t<=197}static getGearType(t){switch(Math.floor(t/1e3)){case 1098:return f.soulShield;case 1099:return f.demonShield;case 1212:return f.shiningRod;case 1213:return f.tuner;case 1214:return f.breathShooter;case 1404:return f.chakram}if(Math.floor(t/1e4)===135)switch(Math.floor(t/100)){case 13522:case 13528:case 13529:case 13540:return Math.floor(t/10);default:return Math.floor(t/100)*10}if(Math.floor(t/1e4)===119)switch(Math.floor(t/100)){case 11902:return Math.floor(t/10)}return Math.floor(t/1e4)}static getMaxStar(t){if(t.totalUpgradeCount<=0||t.getBooleanValue(s.onlyUpgrade)||w.isMechanicGear(t.type)||w.isDragonGear(t.type))return 0;let i;const o=t.req.level;for(const a of w.starData)if(o>=a[0])i=a;else break;return i===void 0?0:t.getBooleanValue(s.superiorEqp)?i[2]:i[1]}static getPropTypeWeight(t){if(t<100)switch(t){case s.incSTR:case s.incDEX:case s.incINT:case s.incLUK:case s.incPAD:case s.incMAD:case s.incSpeed:case s.incJump:return 1;case s.incMHP:case s.incMMP:return 100;case s.incPDD:return 10;case s.incAD:return 2}return Number.MAX_VALUE}};let D=w;D.starData=[[0,5,3],[95,8,5],[110,10,8],[120,15,10],[130,20,12],[140,25,15]];class N{constructor(){this.code=0,this.optionType=0,this.reqLevel=0,this.summary="",this.option=new Map}get convertSummary(){const i=[...this.option.keys()];i.sort((a,r)=>s[r].length-s[a].length);let o=this.summary;for(const a of i)o=o.replace(`#${s[a]}`,(this.option.get(a)??0).toString());return o}static getPotentialLevel(i){return i<=0?1:i>=250?25:Math.floor((i+9)/10)}static checkOptionType(i,o){switch(i){case 0:return!0;case 10:return D.isWeapon(o)||D.isSubWeapon(o)||o===f.emblem;case 11:return!N.checkOptionType(10,o);case 20:return D.isSubWeapon(o)||o===f.cap||o===f.coat||o===f.longcoat||o===f.pants||o===f.shoes||o===f.glove||o===f.cape||o===f.belt||o===f.shoulder;case 40:return o===f.faceAccessory||o===f.eyeAccessory||o===f.earrings||o===f.ring||o===f.pendant;case 51:return o===f.cap;case 52:return o===f.coat||o===f.longcoat;case 53:return o===f.pants;case 54:return o===f.glove;case 55:return o===f.shoes;default:return!1}}}var h=(t=>(t[t.STR=0]="STR",t[t.DEX=1]="DEX",t[t.INT=2]="INT",t[t.LUK=3]="LUK",t[t.STR_DEX=4]="STR_DEX",t[t.STR_INT=5]="STR_INT",t[t.STR_LUK=6]="STR_LUK",t[t.DEX_INT=7]="DEX_INT",t[t.DEX_LUK=8]="DEX_LUK",t[t.INT_LUK=9]="INT_LUK",t[t.MHP=10]="MHP",t[t.MMP=11]="MMP",t[t.PAD=12]="PAD",t[t.MAD=13]="MAD",t[t.PDD=14]="PDD",t[t.speed=15]="speed",t[t.jump=16]="jump",t[t.damR=17]="damR",t[t.bdR=18]="bdR",t[t.allStatR=19]="allStatR",t[t.reduceReq=20]="reduceReq",t))(h||{});function G(t,i,o){const a=J(t,i,o);if(a.size===0)return!1;for(const[r,d]of a)t.option(r).bonus+=d;return!0}function p(t){for(const[,i]of t.options)i.bonus=0;return!0}function J(t,i,o){const a=i0(i),r=B(t,i,o);return r===0?new Map:new Map(a.map(d=>[d,r]))}function B(t,i,o){const a=t.req.level,r=t.getBooleanValue(s.bossReward),d=t.type;if(a<0||r&&o<3)return 0;switch(i){case h.STR:case h.DEX:case h.INT:case h.LUK:return x(a,o);case h.STR_DEX:case h.STR_INT:case h.STR_LUK:case h.DEX_INT:case h.DEX_LUK:case h.INT_LUK:return e(a,o);case h.PDD:return x(a,o);case h.PAD:case h.MAD:return t0(a,o,i,t.type,r,t.option(s.incPAD).base,t.option(s.incMAD).base);case h.MHP:case h.MMP:return n0(a,o);case h.speed:case h.jump:return D.isWeapon(d)?0:o;case h.damR:return D.isWeapon(d)?o:0;case h.bdR:return a<90||!D.isWeapon(d)?0:2*o;case h.allStatR:return a<70&&!D.isWeapon(d)?0:o;case h.reduceReq:return c0(a,o);default:return 0}}function x(t,i){return t>=250?Math.floor(t/20)*i:(Math.floor(t/20)+1)*i}function e(t,i){return(Math.floor(t/40)+1)*i}function t0(t,i,o,a,r,d,M){if(D.isWeapon(a)){const c=r?[0,0,1,1.4666,2.0166,2.663,3.4166]:[1,2.222,3.63,5.325,7.32,8.777,10.25];let n=d;if(a===f.heavySword||a===f.longSword){if(a===f.longSword)switch(n){case 100:n=102;break;case 103:n=105;break;case 105:n=107;break;case 112:n=114;break;case 117:n=121;break;case 135:n=139;break;case 169:n=173;break;case 203:n=207;break;case 293:n=297;break;case 337:n=342;break}const A=t>180?6:t>160?5:t>110?4:3;return Math.ceil(n*c[i-1]*A/100)}else if(o===h.MAD&&M>=n&&(n=M),r){const A=t>160?18:t>150?15:t>110?12:9;return Math.ceil(n*c[i-1]*A/100)}else{const A=t>110?4:3;return Math.ceil(n*c[i-1]*A/100)}}else if(t<60)return 0;return i}function n0(t,i){return t<10?3*i:t>=250?700*i:Math.floor(t/10)*30*i}function c0(t,i){return i*5}function i0(t){switch(t){case h.STR:return[s.incSTR];case h.DEX:return[s.incDEX];case h.INT:return[s.incINT];case h.LUK:return[s.incLUK];case h.STR_DEX:return[s.incSTR,s.incDEX];case h.STR_INT:return[s.incSTR,s.incINT];case h.STR_LUK:return[s.incSTR,s.incLUK];case h.DEX_INT:return[s.incDEX,s.incINT];case h.DEX_LUK:return[s.incDEX,s.incLUK];case h.INT_LUK:return[s.incINT,s.incLUK];case h.PDD:return[s.incPDD];case h.PAD:return[s.incPAD];case h.MAD:return[s.incMAD];case h.MHP:return[s.incMHP];case h.MMP:return[s.incMMP];case h.speed:return[s.incSpeed];case h.jump:return[s.incJump];case h.damR:return[s.damR];case h.bdR:return[s.bdR];case h.allStatR:return[s.statR];case h.reduceReq:return[s.reduceReq];default:return[]}}const s0=25,W=15;function Q(t,i=!1){if(t.getBooleanValue(s.incCHUC))return!1;if(t.getBooleanValue(s.superiorEqp))return o0(t);if(t.star>=t.maxStar&&!i||t.star>=s0)return!1;t.star+=1;const o=t.star,a=v(t,!1,!1),r=v(t,!1,!0),d=D.isWeapon(t.type)||t.type===f.katara,M=[[s.incSTR,s.incDEX],[s.incINT,s.incLUK],[s.incDEX,s.incSTR],[s.incLUK,s.incDEX],[s.incSTR,s.incDEX]],c=[s.incSTR,s.incDEX,s.incINT,s.incLUK];let n;const A=t.req.job;if(A===0)n=new Set([s.incSTR,s.incDEX,s.incINT,s.incLUK]);else{n=new Set;for(let u=0;u<5;u++)if(A&1<<u)for(const S of M[u])n.add(S)}for(const u of c)(n.has(u)||o>15&&(t.option(u).base>0||t.option(u).upgrade>0))&&(t.option(u).enchant+=a[o]);if(d){const u=A===0||Math.floor(A/2)%2===1||t.option(s.incMAD).upgrade>0;if(o>15)t.option(s.incPAD).enchant+=r[o],u&&(t.option(s.incMAD).enchant+=r[o]);else{const S=t.option(s.incPAD).sum-t.option(s.incPAD).bonus;if(t.option(s.incPAD).enchant+=Math.floor(S/50)+1,u){const T=t.option(s.incMAD).sum-t.option(s.incMAD).bonus;t.option(s.incMAD).enchant+=Math.floor(T/50)+1}}}else t.option(s.incPAD).enchant+=r[o],t.option(s.incMAD).enchant+=r[o],t.type===f.glove&&(A===0?(t.option(s.incPAD).enchant+=E[o],t.option(s.incMAD).enchant+=E[o]):Math.floor(A/2)%2===1?t.option(s.incMAD).enchant+=E[o]:t.option(s.incPAD).enchant+=E[o]);if(!d&&t.type!==f.machineHeart){const u=t.option(s.incPDD).sum-t.option(s.incPDD).bonus;t.option(s.incPDD).enchant+=Math.floor(u/20)+1}const b=[f.cap,f.coat,f.longcoat,f.pants,f.cape,f.ring,f.pendant,f.belt,f.shoulder,f.shield];return d?(t.option(s.incMHP).enchant+=I[o],t.option(s.incMMP).enchant+=I[o]):b.includes(t.type)&&(t.option(s.incMHP).enchant+=I[o]),t.type===f.shoes&&(t.option(s.incSpeed).enchant+=q[o],t.option(s.incJump).enchant+=q[o]),!0}function o0(t){if(t.star>=t.maxStar)return!1;t.star+=1;const i=t.star,o=v(t,!1,!1),a=v(t,!1,!0),r=[s.incSTR,s.incDEX,s.incINT,s.incLUK];for(const c of r)t.option(c).base>0&&(t.option(c).enchant+=o[i]);const d=[s.incPAD,s.incMAD];for(const c of d)t.option(c).base>0&&(t.option(c).enchant+=a[i]);const M=t.option(s.incPDD).sum-t.option(s.incPDD).bonus;return t.option(s.incPDD).enchant+=Math.floor(M/20)+1,!0}function a0(t,i=!1,o=!1){if(t.getBooleanValue(s.incCHUC)||t.getBooleanValue(s.superiorEqp)||t.req.level>150||t.star>=t.maxStar&&!o||t.star>=W)return!1;t.amazing||(t.amazing=!0,t.maxStar=Math.min(t.maxStar,W)),t.star+=1;const a=t.star,r=v(t,!0,!1),d=v(t,!0,!0),M=D.isWeapon(t.type)||t.type===f.katara,c=[s.incSTR,s.incDEX,s.incINT,s.incLUK];for(const b of c)if(t.option(b).sum>0){let S=r[a];i&&D.isAccessory(t.type)&&(S+=a>5?2:1),t.option(b).enchant+=S}const n=[s.incPAD,s.incMAD];for(const b of n){const u=t.option(b).sum;if(u>0){M&&(t.option(b).enchant+=Math.floor(u/50)+1);let S=d[a];i&&(M||t.type===f.shield)&&(S+=1),t.option(b).enchant+=S}}i&&D.isArmor(t.type)&&(t.option(s.incMHP).enchant+=50);const A=t.option(s.incPDD).sum;return t.option(s.incPDD).enchant+=Math.floor(A/20)+1,!0}function Z(t){if(t.getBooleanValue(s.incCHUC))return!1;t.star=0,t.amazing=!1,t.maxStar=D.getMaxStar(t);for(const[,i]of t.options)i.enchant=0;return!0}function f0(t){if(t.getBooleanValue(s.incCHUC)||t.amazing)return!1;const i=t.star;Z(t);for(let o=0;o<i;o++)Q(t,!0);return!0}function v(t,i,o){let a;t.getBooleanValue(s.superiorEqp)?o?a=h0:a=r0:i?o?a=A0:a=M0:o?D.isWeapon(t.type)||t.type===f.katara?a=d0:a=u0:a=D0;const r=t.req.level;for(const d of[...a].reverse())if(r>=d[0])return d;throw Error(`Gear has invalid reqLevel.
|
|
2
|
-
`+t)}const h0=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[110,0,0,0,0,0,5,6,7,0,0,0,0,0,0,0],[150,0,0,0,0,0,9,10,11,12,13,15,17,19,21,23]],r0=[[0,1,2,4,7,11,0,0,0,0,0,0,0,0,0,0],[80,2,3,5,8,12,0,0,0,0,0,0,0,0,0,0],[110,9,10,12,15,19,0,0,0,0,0,0,0,0,0,0],[150,19,20,22,25,29,0,0,0,0,0,0,0,0,0,0]],d0=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,5,6,7,8,9,27,28,29],[118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,6,7,8,9,10,28,29,30],[128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,7,8,9,10,11,29,30,31],[138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,8,9,10,11,12,30,31,32],[148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,9,10,11,12,13,31,32,33],[158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,10,11,12,13,14,32,33,34],[198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,13,14,14,15,16,17,34,35,36],[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,15,16,16,17,18,19,36,37,38]],u0=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,7,8,9,10,12,13,15,17],[118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,8,9,10,11,13,14,16,18],[128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,9,10,11,12,14,16,18,20],[138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,10,11,12,13,15,17,19,21],[148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,10,11,12,13,14,16,18,20,22],[158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,11,12,13,14,15,17,19,21,23],[198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,13,14,15,16,17,19,21,23,25],[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16,17,18,19,21,23,25,27]],D0=[[0,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0],[108,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0],[118,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,0,0,0],[128,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,7,7,7,7,7,7,7,0,0,0],[138,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,9,9,9,9,9,9,9,0,0,0],[148,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,11,11,11,11,11,11,11,0,0,0],[158,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,13,13,13,13,13,13,13,0,0,0],[198,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,15,15,15,15,15,15,15,0,0,0],[248,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,17,17,17,17,17,17,17,0,0,0]],A0=[[0,0,0,0,0,0,1,2,3,4,5,6,8,10,12,14],[80,0,0,0,0,0,2,3,4,5,6,7,9,11,13,15],[90,0,0,0,0,0,3,4,5,6,7,8,10,12,14,16],[100,0,0,0,0,0,4,5,6,7,8,9,11,13,15,17],[110,0,0,0,0,0,5,6,7,8,9,10,12,14,16,18],[120,0,0,0,0,0,6,7,8,9,10,11,13,15,17,19],[130,0,0,0,0,0,7,8,9,10,11,12,14,16,18,20],[140,0,0,0,0,0,8,9,10,11,12,13,15,17,19,21],[150,0,0,0,0,0,9,10,11,12,13,14,16,18,20,22]],M0=[[0,1,2,4,7,11,0,0,0,0,0,0,0,0,0,0],[80,2,3,5,8,12,0,0,0,0,0,0,0,0,0,0],[85,3,4,6,9,13,0,0,0,0,0,0,0,0,0,0],[90,4,5,7,10,14,0,0,0,0,0,0,0,0,0,0],[95,5,6,8,11,15,0,0,0,0,0,0,0,0,0,0],[100,7,8,10,13,17,0,0,0,0,0,0,0,0,0,0],[105,8,9,11,14,18,0,0,0,0,0,0,0,0,0,0],[110,9,10,12,15,19,0,0,0,0,0,0,0,0,0,0],[115,10,11,13,16,20,0,0,0,0,0,0,0,0,0,0],[120,12,13,15,18,22,0,0,0,0,0,0,0,0,0,0],[125,13,14,16,19,23,0,0,0,0,0,0,0,0,0,0],[130,14,15,17,20,24,0,0,0,0,0,0,0,0,0,0],[135,15,16,18,21,25,0,0,0,0,0,0,0,0,0,0],[140,17,18,20,23,27,0,0,0,0,0,0,0,0,0,0],[145,18,19,21,24,28,0,0,0,0,0,0,0,0,0,0],[150,19,20,22,25,29,0,0,0,0,0,0,0,0,0,0]],E=[0,0,0,0,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0],I=[0,5,5,5,10,10,15,15,20,20,25,25,25,25,25,25,0,0,0,0,0,0,0,0,0,0],q=[0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0];function Y(t,i,o){if(D.isWeapon(t.type)||t.type===f.katara)return R0(t,i,o);if(t.type===f.glove)return g0(t,i,o);if(D.isArmor(t.type)||t.type===f.shoulder)return w0(t,i,o);if(D.isAccessory(t.type))return E0(t,i,o);if(t.type===f.machineHeart)return C0(t,i,o)}const S0={100:[[1,0],[2,0],[3,1]],70:[[2,0],[3,1],[5,2]],30:[[3,1],[5,2],[7,3]],15:[[5,2],[7,3],[9,4]]},b0={100:[[1,5,1],[2,20,2],[3,30,3]],70:[[2,15,2],[3,40,4],[4,70,5]],30:[[3,30,4],[5,70,7],[7,120,10]],15:[[4,45,6],[7,110,10],[10,170,15]]},k={30:[1,2,3],15:[2,3,4]},_={30:[1,2,3]},v0={100:[0,1,1],70:[1,2,2],30:[2,3,3],15:[3,4,4]},O={100:[1,1,2],70:[2,2,3],30:[3,4,5]},V={100:[1,2,3],70:[2,3,5],30:[3,5,7]},H={[s.incSTR]:s.incPAD,[s.incDEX]:s.incPAD,[s.incINT]:s.incMAD,[s.incLUK]:s.incPAD,[s.incMHP]:s.incPAD,[s.incAllStat]:s.incPAD},R={[s.incSTR]:"힘",[s.incDEX]:"민첩",[s.incINT]:"지력",[s.incLUK]:"운",[s.incMHP]:"체력",[s.incAllStat]:"올스탯",[s.incPAD]:"공격력",[s.incMAD]:"마력"};function g(t){return t.req.level>110?2:t.req.level>70?1:0}function R0(t,i,o){if(i===s.incAllStat)return;const a=g(t);let[r,d]=S0[o][a];const M=H[i],c=R[M];return i===s.incMHP&&(d*=50),{name:d>0?`${o}% ${c}(${R[i]}) 주문서`:`${o}% ${c} 주문서`,option:new Map([[i,d],[M,r]])}}function w0(t,i,o){const a=g(t),[r,d,M]=b0[o][a];let c=[],n=[],A=[];if(i===s.incMHP)n=[[s.incMHP,d+r*50]];else if(n=[[s.incMHP,d]],i===s.incAllStat){if(!(o in k))return;const S=k[o][a];c=[[s.incSTR,S],[s.incDEX,S],[s.incINT,S],[s.incLUK,S]]}else c=[[i,r]];t.upgradeCount===3&&(t.req.job===0?A=[[s.incPAD,1],[s.incMAD,1]]:Math.floor(t.req.job/2)%2===1?A=[[s.incMAD,1]]:A=[[s.incPAD,1]]);const b=`${o}% ${R[i]} 주문서`,u=new Map([...c,...A,...n,[s.incPDD,M]]);return{name:b,option:u}}function g0(t,i,o){const a=g(t),r=v0[o][a];if(r===0)return{name:`${o}% 방어력 주문서`,option:new Map([[s.incPDD,3]])};{const d=H[i];return{name:`${o}% ${R[d]} 주문서`,option:new Map([[d,r]])}}}function E0(t,i,o){if(!(o in O))return;const a=g(t),r=O[o][a];let d=[];if(i===s.incMHP)d=[[s.incMHP,r*50]];else if(i===s.incAllStat){if(!(o in _))return;const n=_[o][a];d=[[s.incSTR,n],[s.incDEX,n],[s.incINT,n],[s.incLUK,n]]}else d=[[i,r]];const M=`${o}% ${R[i]} 주문서`,c=new Map(d);return{name:M,option:c}}function C0(t,i,o){if(!(o in V))return;const a=g(t),r=V[o][a],d=H[i];return{name:`${o}% ${R[i]} 주문서`,option:new Map([[d,r]])}}function U0(t){return t.getBooleanValue(s.blockGoldHammer)||t.getBooleanValue(s.onlyUpgrade)||t.totalUpgradeCount<=0||t.hammerCount>0?!1:(t.hammerCount=1,!0)}function P(t,i){if(t.upgradeCountLeft<1)return!1;t.upgradeCount+=1;for(const[o,a]of i.option)t.option(o).upgrade+=a;return!0}function X0(t,i,o){const a=Y(t,i,o);return a?P(t,a):!1}function N0(t){return t.upgradeCountLeft<1?!1:(t.upgradeFailCount+=1,!0)}function I0(t){return t.upgradeFailCount<1?!1:(t.upgradeFailCount-=1,!0)}function L0(t){t.upgradeCount=0,t.upgradeFailCount=0,t.hammerCount=0;for(const[,i]of t.options)i.upgrade=0;return!0}function m(t){const i={};i.id=t.itemID,i.n=t.name,t.desc.length>0&&(i.d=t.desc),i.i=t.icon,t.anvilIcon&&(i.i2=t.anvilIcon),t.anvilName&&(i.n2=t.anvilName),i.t=t.type,i.r=t.req,i.pr=U(t.props,a=>a!==0),i.o=U(t.options,a=>!a.empty,H0),t.totalUpgradeCount>0&&(i.c=t.totalUpgradeCount),t.upgradeCount>0&&(i.up=t.upgradeCount),t.upgradeFailCount>0&&(i.f=t.upgradeFailCount),t.hammerCount>0&&(i.h=t.hammerCount),t.maxStar>0&&(i.m=t.maxStar),t.star>0&&(i.s=t.star),t.amazing&&(i.a=t.amazing),t.karma!==void 0&&(i.k=t.karma),t.canPotential&&(i.cp=t.canPotential),t.grade>0&&(i.g=t.grade),t.grade>0&&t.potentials.length>0&&(i.p=z(t.potentials,void 0,j)),t.additionalGrade>0&&(i.g2=t.additionalGrade),t.additionalGrade>0&&t.additionalPotentials.length>0&&(i.p2=z(t.additionalPotentials,void 0,j));const o=K0(t.soulWeapon);return o&&(i.w=o),i}function H0(t){return[t.base,t.bonus,t.upgrade,t.enchant]}function j(t){return t?{c:t.code,t:t.optionType,l:t.reqLevel,s:t.summary,o:U(t.option,i=>i!==0)}:null}function K0(t){const i={};if(t.enchanted&&(i.e=t.enchanted),t.soul&&(i.s=t.soul),t.charge>0&&(i.c=t.charge),t.chargeOption.size>0&&(i.o=U(t.chargeOption,o=>o!==0)),Object.keys(i).length>0)return i}const y=t=>{const i=c=>typeof c.id=="number"&&typeof c.n=="string"&&(c.d===void 0||typeof c.d=="string")&&typeof c.i=="object"&&c.i!==null&&o(c.i)&&(c.i2===void 0||typeof c.i2=="object"&&c.i2!==null&&o(c.i2))&&(c.n2===void 0||typeof c.n2=="string")&&(c.t===100||c.t===101||c.t===102||c.t===103||c.t===104||c.t===105||c.t===106||c.t===107||c.t===108||c.t===110||c.t===111||c.t===112||c.t===113||c.t===114||c.t===115||c.t===116||c.t===118||c.t===166||c.t===167||c.t===109||c.t===119||c.t===119020||c.t===1212||c.t===1213||c.t===1214||c.t===122||c.t===123||c.t===124||c.t===126||c.t===127||c.t===128||c.t===129||c.t===130||c.t===131||c.t===132||c.t===133||c.t===134||c.t===136||c.t===137||c.t===138||c.t===140||c.t===1404||c.t===141||c.t===142||c.t===143||c.t===144||c.t===145||c.t===146||c.t===147||c.t===148||c.t===149||c.t===150||c.t===151||c.t===152||c.t===153||c.t===156||c.t===157||c.t===158||c.t===159||c.t===1098||c.t===1099||c.t===135200||c.t===135210||c.t===135220||c.t===135221||c.t===135222||c.t===135223||c.t===135224||c.t===135225||c.t===135226||c.t===135227||c.t===135228||c.t===135229||c.t===135240||c.t===135250||c.t===135260||c.t===135270||c.t===135290||c.t===135291||c.t===135292||c.t===135293||c.t===135294||c.t===135295||c.t===135296||c.t===135297||c.t===135298||c.t===135300||c.t===135310||c.t===135320||c.t===135330||c.t===135340||c.t===135350||c.t===135360||c.t===135370||c.t===135380||c.t===135400||c.t===135401||c.t===135402||c.t===135403||c.t===180||c.t===161||c.t===162||c.t===163||c.t===164||c.t===165||c.t===194||c.t===195||c.t===196||c.t===197)&&typeof c.r=="object"&&c.r!==null&&a(c.r)&&Array.isArray(c.pr)&&c.pr.every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&typeof n[1]=="number")&&Array.isArray(c.o)&&c.o.every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&Array.isArray(n[1])&&n[1].length===4&&typeof n[1][0]=="number"&&typeof n[1][1]=="number"&&typeof n[1][2]=="number"&&typeof n[1][3]=="number")&&(c.c===void 0||typeof c.c=="number")&&(c.up===void 0||typeof c.up=="number")&&(c.f===void 0||typeof c.f=="number")&&(c.h===void 0||typeof c.h=="number")&&(c.m===void 0||typeof c.m=="number")&&(c.s===void 0||typeof c.s=="number")&&(c.a===void 0||typeof c.a=="boolean")&&(c.k===void 0||typeof c.k=="number")&&(c.cp===void 0||typeof c.cp=="boolean")&&(c.g===void 0||c.g===0||c.g===1||c.g===2||c.g===3||c.g===4||c.g===5)&&(c.p===void 0||Array.isArray(c.p)&&c.p.every(n=>n===null||typeof n=="object"&&n!==null&&r(n)))&&(c.g2===void 0||c.g2===0||c.g2===1||c.g2===2||c.g2===3||c.g2===4||c.g2===5)&&(c.p2===void 0||Array.isArray(c.p2)&&c.p2.every(n=>n===null||typeof n=="object"&&n!==null&&r(n)))&&(c.w===void 0||typeof c.w=="object"&&c.w!==null&&Array.isArray(c.w)===!1&&d(c.w)),o=c=>typeof c.id=="number"&&Array.isArray(c.origin)&&c.origin.length===2&&typeof c.origin[0]=="number"&&typeof c.origin[1]=="number",a=c=>typeof c.level=="number"&&typeof c.str=="number"&&typeof c.luk=="number"&&typeof c.dex=="number"&&typeof c.int=="number"&&typeof c.job=="number"&&typeof c.specJob=="number",r=c=>typeof c.c=="number"&&typeof c.t=="number"&&typeof c.l=="number"&&typeof c.s=="string"&&Array.isArray(c.o)&&c.o.every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&typeof n[1]=="number"),d=c=>(c.e===void 0||typeof c.e=="boolean")&&(c.s===void 0||typeof c.s=="object"&&c.s!==null&&M(c.s))&&(c.c===void 0||typeof c.c=="number")&&(c.o===void 0||Array.isArray(c.o)&&c.o.every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&typeof n[1]=="number")),M=c=>typeof c.name=="string"&&typeof c.skill=="string"&&c.option instanceof Map&&[...c.option].every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&typeof n[1]=="number")&&typeof c.multiplier=="number";return typeof t=="object"&&t!==null&&i(t)};function x0(t){return JSON.stringify(m(t))}function W0(t){return K(JSON.parse(t))}function q0(t){try{const i=JSON.parse(t);if(y(i))return K(i)}catch{}return null}function U(t,i,o){let a=[...t];return i&&(a=a.filter(r=>i(r[1]))),o?a.map(r=>[r[0],o(r[1])]):a}function z(t,i,o){let a=t;return i&&(a=a.filter(i)),o?a.map(o):a===t?[...t]:a}function X(t,i){return i?new Map(t.map(o=>[o[0],i(o[1])])):new Map(t)}function $(t,i){return i?[...t].map(i):[...t]}function K(t){const i=new D;return i.itemID=t.id,i.name=t.n,t.d&&(i.desc=t.d),i.icon=t.i,t.i2&&t.n2&&(i.anvilIcon=t.i2,i.anvilName=t.n2),i.type=t.t,i.req=t.r,i.props=X(t.pr),i.options=X(t.o,k0),t.c&&(i.totalUpgradeCount=t.c),t.up&&(i.upgradeCount=t.up),t.f&&(i.upgradeFailCount=t.f),t.h&&(i.hammerCount=t.h),t.m&&(i.maxStar=t.m),t.s&&(i.star=t.s),t.a&&(i.amazing=t.a),t.k&&(i.karma=t.k),t.cp&&(i.canPotential=t.cp),t.g&&(i.grade=t.g),t.p&&(i.potentials=$(t.p,F)),t.g2&&(i.additionalGrade=t.g2),t.p2&&(i.additionalPotentials=$(t.p2,F)),_0(t.w,i),i}function k0(t){const i=new L;return i.base=t[0],i.bonus=t[1],i.upgrade=t[2],i.enchant=t[3],i}function F(t){if(!t)return null;const i=new N;return i.code=t.c,i.optionType=t.t,i.reqLevel=t.l,i.summary=t.s,i.option=X(t.o),i}function _0(t,i){if(t){const o=i.soulWeapon;t?.e&&(o.enchanted=t.e),t?.s&&(o.soul=t.s),t?.c&&(o.charge=t.c),t?.o&&(o.chargeOption=X(t.o))}}exports.BonusStatType=h;exports.Gear=D;exports.GearOption=L;exports.GearPropType=s;exports.GearType=f;exports.Potential=N;exports.PotentialGrade=C;exports.SoulWeapon=l;exports.addAmazingEnhancement=a0;exports.addBonusStat=G;exports.addStarforce=Q;exports.addUpgradeFailCount=N0;exports.applyGoldHammer=U0;exports.applyScroll=P;exports.applySpellTrace=X0;exports.gearToPlain=m;exports.getBonusStatOption=J;exports.getBonusStatValue=B;exports.getSpellTraceScroll=Y;exports.isGearLike=y;exports.parseGear=W0;exports.plainToGear=K;exports.recalculateStarforce=f0;exports.resetBonusStat=p;exports.resetEnhancement=Z;exports.resetUpgrade=L0;exports.restoreUpgradeCount=I0;exports.stringifyGear=x0;exports.validateParseGear=q0;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class I{constructor(){this.base=0,this.bonus=0,this.upgrade=0,this.enchant=0}get empty(){return this.base===0&&this.bonus===0&&this.upgrade===0&&this.enchant===0}get sum(){return Math.max(0,this.base+this.bonus+this.upgrade+this.enchant)}get diff(){return this.bonus+this.upgrade+this.enchant}}var o=(t=>(t[t.incSTR=1]="incSTR",t[t.incSTRr=2]="incSTRr",t[t.incDEX=3]="incDEX",t[t.incDEXr=4]="incDEXr",t[t.incINT=5]="incINT",t[t.incINTr=6]="incINTr",t[t.incLUK=7]="incLUK",t[t.incLUKr=8]="incLUKr",t[t.incAllStat=9]="incAllStat",t[t.incMHP=10]="incMHP",t[t.incMMP=11]="incMMP",t[t.incMHPr=12]="incMHPr",t[t.incMMPr=13]="incMMPr",t[t.incMDF=14]="incMDF",t[t.incARC=15]="incARC",t[t.incAUT=16]="incAUT",t[t.incPAD=17]="incPAD",t[t.incMAD=18]="incMAD",t[t.incAD=19]="incAD",t[t.incPDD=20]="incPDD",t[t.incSpeed=21]="incSpeed",t[t.incJump=22]="incJump",t[t.knockback=23]="knockback",t[t.bdR=24]="bdR",t[t.incBDR=25]="incBDR",t[t.imdR=26]="imdR",t[t.incIMDR=27]="incIMDR",t[t.damR=28]="damR",t[t.nbdR=29]="nbdR",t[t.statR=30]="statR",t[t.incCHUC=31]="incCHUC",t[t.incPADr=100]="incPADr",t[t.incMADr=101]="incMADr",t[t.incPDDr=102]="incPDDr",t[t.incCr=103]="incCr",t[t.incDAMr=104]="incDAMr",t[t.RecoveryHP=105]="RecoveryHP",t[t.RecoveryMP=106]="RecoveryMP",t[t.face=107]="face",t[t.prop=108]="prop",t[t.time=109]="time",t[t.HP=110]="HP",t[t.MP=111]="MP",t[t.attackType=112]="attackType",t[t.ignoreTargetDEF=113]="ignoreTargetDEF",t[t.ignoreDAM=114]="ignoreDAM",t[t.ignoreDAMr=115]="ignoreDAMr",t[t.DAMreflect=116]="DAMreflect",t[t.mpconReduce=117]="mpconReduce",t[t.incMesoProp=118]="incMesoProp",t[t.incRewardProp=119]="incRewardProp",t[t.incAllskill=120]="incAllskill",t[t.RecoveryUP=121]="RecoveryUP",t[t.boss=122]="boss",t[t.level=123]="level",t[t.incTerR=124]="incTerR",t[t.incAsrR=125]="incAsrR",t[t.incEXPr=126]="incEXPr",t[t.reduceCooltime=127]="reduceCooltime",t[t.incSTRlv=128]="incSTRlv",t[t.incDEXlv=129]="incDEXlv",t[t.incINTlv=130]="incINTlv",t[t.incLUKlv=131]="incLUKlv",t[t.incMHPlv=132]="incMHPlv",t[t.incPADlv=133]="incPADlv",t[t.incMADlv=134]="incMADlv",t[t.incCriticaldamage=135]="incCriticaldamage",t[t.attackSpeed=200]="attackSpeed",t[t.setItemID=201]="setItemID",t[t.durability=202]="durability",t[t.reduceReq=203]="reduceReq",t[t.only=1100]="only",t[t.tradeBlock=1101]="tradeBlock",t[t.accountSharable=1102]="accountSharable",t[t.onlyEquip=1103]="onlyEquip",t[t.tradeAvailable=1104]="tradeAvailable",t[t.equipTradeBlock=1105]="equipTradeBlock",t[t.sharableOnce=1106]="sharableOnce",t[t.charismaEXP=1107]="charismaEXP",t[t.senseEXP=1108]="senseEXP",t[t.insightEXP=1109]="insightEXP",t[t.willEXP=1110]="willEXP",t[t.craftEXP=1111]="craftEXP",t[t.charmEXP=1112]="charmEXP",t[t.accountShareTag=1113]="accountShareTag",t[t.bossReward=1114]="bossReward",t[t.noPotential=1115]="noPotential",t[t.fixedPotential=1116]="fixedPotential",t[t.specialGrade=1117]="specialGrade",t[t.fixedGrade=1118]="fixedGrade",t[t.superiorEqp=1119]="superiorEqp",t[t.incPQEXPr=1120]="incPQEXPr",t[t.jokerToSetItem=1121]="jokerToSetItem",t[t.blockGoldHammer=1122]="blockGoldHammer",t[t.exceptUpgrade=1123]="exceptUpgrade",t[t.onlyUpgrade=1124]="onlyUpgrade",t[t.noLookChange=1125]="noLookChange",t[t.tucIgnoreForPotential=1126]="tucIgnoreForPotential",t))(o||{}),f=(t=>(t[t.cap=100]="cap",t[t.faceAccessory=101]="faceAccessory",t[t.eyeAccessory=102]="eyeAccessory",t[t.earrings=103]="earrings",t[t.coat=104]="coat",t[t.longcoat=105]="longcoat",t[t.pants=106]="pants",t[t.shoes=107]="shoes",t[t.glove=108]="glove",t[t.cape=110]="cape",t[t.ring=111]="ring",t[t.pendant=112]="pendant",t[t.belt=113]="belt",t[t.medal=114]="medal",t[t.shoulder=115]="shoulder",t[t.pocket=116]="pocket",t[t.badge=118]="badge",t[t.android=166]="android",t[t.machineHeart=167]="machineHeart",t[t.shield=109]="shield",t[t.emblem=119]="emblem",t[t.powerSource=119020]="powerSource",t[t.shiningRod=1212]="shiningRod",t[t.tuner=1213]="tuner",t[t.breathShooter=1214]="breathShooter",t[t.soulShooter=122]="soulShooter",t[t.desperado=123]="desperado",t[t.energySword=124]="energySword",t[t.espLimiter=126]="espLimiter",t[t.chain=127]="chain",t[t.magicGauntlet=128]="magicGauntlet",t[t.ritualFan=129]="ritualFan",t[t.ohSword=130]="ohSword",t[t.ohAxe=131]="ohAxe",t[t.ohBlunt=132]="ohBlunt",t[t.dagger=133]="dagger",t[t.katara=134]="katara",t[t.cane=136]="cane",t[t.wand=137]="wand",t[t.staff=138]="staff",t[t.thSword=140]="thSword",t[t.chakram=1404]="chakram",t[t.thAxe=141]="thAxe",t[t.thBlunt=142]="thBlunt",t[t.spear=143]="spear",t[t.polearm=144]="polearm",t[t.bow=145]="bow",t[t.crossbow=146]="crossbow",t[t.claw=147]="claw",t[t.knuckle=148]="knuckle",t[t.gun=149]="gun",t[t.shovel=150]="shovel",t[t.pickaxe=151]="pickaxe",t[t.dualBowguns=152]="dualBowguns",t[t.handCannon=153]="handCannon",t[t.heavySword=156]="heavySword",t[t.longSword=157]="longSword",t[t.gauntletRevolver=158]="gauntletRevolver",t[t.ancientBow=159]="ancientBow",t[t.soulShield=1098]="soulShield",t[t.demonShield=1099]="demonShield",t[t.magicArrow=135200]="magicArrow",t[t.card=135210]="card",t[t.medallion=135220]="medallion",t[t.rosary=135221]="rosary",t[t.ironChain=135222]="ironChain",t[t.magicBook1=135223]="magicBook1",t[t.magicBook2=135224]="magicBook2",t[t.magicBook3=135225]="magicBook3",t[t.arrowFletching=135226]="arrowFletching",t[t.bowThimble=135227]="bowThimble",t[t.daggerScabbard=135228]="daggerScabbard",t[t.charm=135229]="charm",t[t.orb=135240]="orb",t[t.dragonEssence=135250]="dragonEssence",t[t.soulRing=135260]="soulRing",t[t.magnum=135270]="magnum",t[t.wristBand=135290]="wristBand",t[t.farSight=135291]="farSight",t[t.powderKeg=135292]="powderKeg",t[t.mass=135293]="mass",t[t.document=135294]="document",t[t.magicMarble=135295]="magicMarble",t[t.arrowhead=135296]="arrowhead",t[t.jewel=135297]="jewel",t[t.powderKeg2=135298]="powderKeg2",t[t.controller=135300]="controller",t[t.foxMarble=135310]="foxMarble",t[t.chessPiece=135320]="chessPiece",t[t.transmitter=135330]="transmitter",t[t.charge=135340]="charge",t[t.magicWing=135350]="magicWing",t[t.pathOfAbyss=135360]="pathOfAbyss",t[t.relic=135370]="relic",t[t.fanTassel=135380]="fanTassel",t[t.bracelet=135400]="bracelet",t[t.weaponBelt=135401]="weaponBelt",t[t.ornament=135402]="ornament",t[t.hexSeeker=135403]="hexSeeker",t[t.petEquip=180]="petEquip",t[t.machineEngine=161]="machineEngine",t[t.machineArms=162]="machineArms",t[t.machineLegs=163]="machineLegs",t[t.machineBody=164]="machineBody",t[t.machineTransistors=165]="machineTransistors",t[t.dragonMask=194]="dragonMask",t[t.dragonPendant=195]="dragonPendant",t[t.dragonWings=196]="dragonWings",t[t.dragonTail=197]="dragonTail",t))(f||{}),C=(t=>(t[t.normal=0]="normal",t[t.rare=1]="rare",t[t.epic=2]="epic",t[t.unique=3]="unique",t[t.legendary=4]="legendary",t[t.special=5]="special",t))(C||{});class l{constructor(i){this.enchanted=!1,this._charge=0,this.chargeOption=new Map,this.gear=i}get charge(){return this._charge}set charge(i){this.enchanted&&(i<0||i>1e3||(this._charge=i,this.updateChargeOption()))}enchant(){return this.enchanted||!D.isWeapon(this.gear.type)?!1:(this.enchanted=!0,this.soul=void 0,this.charge=0,this.chargeOption.clear(),!0)}disenchant(){return this.enchanted?(this.enchanted=!1,this.soul=void 0,this.charge=0,this.chargeOption.clear(),!0):!1}setSoul(i){return this.enchanted?(this.soul=i,this.updateChargeOption(),!0):!1}removeSoul(){return!this.enchanted||!this.soul?!1:(this.soul=void 0,this.updateChargeOption(),!0)}updateChargeOption(){const s=this.gear.option(o.incPAD).base<this.gear.option(o.incMAD).base?o.incMAD:o.incPAD;return this.chargeOption.clear(),this.chargeOption.set(s,this.getChargeAD()),!0}getChargeAD(){if(!this.enchanted||this.charge===0)return 0;const i=Math.min(Math.ceil(this.charge/100)-1,5);if(this.soul){const s=this.soul.multiplier;return 10+i*s}return 5+i}}const g=class{constructor(){this.itemID=0,this.name="",this.desc="",this.type=0,this.props=new Map,this.options=new Map,this.exceptionalOptions=new Map,this.totalUpgradeCount=0,this.upgradeCount=0,this.upgradeFailCount=0,this.hammerCount=0,this.exceptionalTotalUpgradeCount=0,this.exceptionalUpgradeCount=0,this.maxStar=0,this.star=0,this.amazing=!1,this.canPotential=!1,this.grade=C.normal,this.potentials=[],this.additionalGrade=C.normal,this.additionalPotentials=[],this.soulWeapon=new l(this),this.icon={id:0,origin:[0,0]},this.req={level:0,str:0,dex:0,int:0,luk:0,job:0,specJob:0}}get upgradeCountLeft(){return this.totalUpgradeCount+this.hammerCount-this.upgradeCount-this.upgradeFailCount}get exceptionalUpgradeCountLeft(){return this.exceptionalTotalUpgradeCount-this.exceptionalUpgradeCount}get diff(){let t=0;for(const[i,s]of this.options)t+=Math.floor(s.diff/g.getPropTypeWeight(i));return t}get isNewBonusType(){return!!([...this.options.values()].some(i=>i.bonus>0)&&this.getPropValue(o.tradeAvailable)!==1)}option(t){return this.options.has(t)||this.options.set(t,new I),this.options.get(t)}getPropValue(t){return this.props.get(t)??0}getBooleanValue(t){return(this.props.get(t)??0)>0}setAnvil(t,i){this.anvilIcon=t,this.anvilName=i}resetAnvil(){this.anvilIcon=void 0,this.anvilName=void 0}static isWeapon(t){return this.isLeftWeapon(t)||this.isDoubleHandWeapon(t)}static isLeftWeapon(t){return t>=121&&t<=139&&t!==f.katara||Math.floor(t/10)===121}static isDoubleHandWeapon(t){return t>=140&&t<=149||t>=152&&t<=159||Math.floor(t/10)===140}static isSubWeapon(t){switch(t){case f.katara:case f.shield:case f.demonShield:case f.soulShield:return!0;default:return Math.floor(t/1e3)===135}}static isShield(t){switch(t){case f.shield:case f.demonShield:case f.soulShield:return!0;default:return!1}}static isArmor(t){return t===100||t>=104&&t<=110||t===f.soulShield||t===f.demonShield}static isAccessory(t){return t>=101&&t<=103||t>=111&&t<=113||t===115}static isMechanicGear(t){return t>=161&&t<=165}static isDragonGear(t){return t>=194&&t<=197}static getGearType(t){switch(Math.floor(t/1e3)){case 1098:return f.soulShield;case 1099:return f.demonShield;case 1212:return f.shiningRod;case 1213:return f.tuner;case 1214:return f.breathShooter;case 1404:return f.chakram}if(Math.floor(t/1e4)===135)switch(Math.floor(t/100)){case 13522:case 13528:case 13529:case 13540:return Math.floor(t/10);default:return Math.floor(t/100)*10}if(Math.floor(t/1e4)===119)switch(Math.floor(t/100)){case 11902:return Math.floor(t/10)}return Math.floor(t/1e4)}static getMaxStar(t){if(t.totalUpgradeCount<=0||t.getBooleanValue(o.onlyUpgrade)||g.isMechanicGear(t.type)||g.isDragonGear(t.type))return 0;let i;const s=t.req.level;for(const a of g.starData)if(s>=a[0])i=a;else break;return i===void 0?0:t.getBooleanValue(o.superiorEqp)?i[2]:i[1]}static getPropTypeWeight(t){if(t<100)switch(t){case o.incSTR:case o.incDEX:case o.incINT:case o.incLUK:case o.incPAD:case o.incMAD:case o.incSpeed:case o.incJump:return 1;case o.incMHP:case o.incMMP:return 100;case o.incPDD:return 10;case o.incAD:return 2}return Number.MAX_VALUE}};let D=g;D.starData=[[0,5,3],[95,8,5],[110,10,8],[120,15,10],[130,20,12],[140,25,15]];class N{constructor(){this.code=0,this.optionType=0,this.reqLevel=0,this.summary="",this.option=new Map}get convertSummary(){const i=[...this.option.keys()];i.sort((a,r)=>o[r].length-o[a].length);let s=this.summary;for(const a of i)s=s.replace(`#${o[a]}`,(this.option.get(a)??0).toString());return s}static getPotentialLevel(i){return i<=0?1:i>=250?25:Math.floor((i+9)/10)}static checkOptionType(i,s){switch(i){case 0:return!0;case 10:return D.isWeapon(s)||D.isSubWeapon(s)||s===f.emblem;case 11:return!N.checkOptionType(10,s);case 20:return D.isSubWeapon(s)||s===f.cap||s===f.coat||s===f.longcoat||s===f.pants||s===f.shoes||s===f.glove||s===f.cape||s===f.belt||s===f.shoulder;case 40:return s===f.faceAccessory||s===f.eyeAccessory||s===f.earrings||s===f.ring||s===f.pendant;case 51:return s===f.cap;case 52:return s===f.coat||s===f.longcoat;case 53:return s===f.pants;case 54:return s===f.glove;case 55:return s===f.shoes;default:return!1}}}var h=(t=>(t[t.STR=0]="STR",t[t.DEX=1]="DEX",t[t.INT=2]="INT",t[t.LUK=3]="LUK",t[t.STR_DEX=4]="STR_DEX",t[t.STR_INT=5]="STR_INT",t[t.STR_LUK=6]="STR_LUK",t[t.DEX_INT=7]="DEX_INT",t[t.DEX_LUK=8]="DEX_LUK",t[t.INT_LUK=9]="INT_LUK",t[t.MHP=10]="MHP",t[t.MMP=11]="MMP",t[t.PAD=12]="PAD",t[t.MAD=13]="MAD",t[t.PDD=14]="PDD",t[t.speed=15]="speed",t[t.jump=16]="jump",t[t.damR=17]="damR",t[t.bdR=18]="bdR",t[t.allStatR=19]="allStatR",t[t.reduceReq=20]="reduceReq",t))(h||{});function G(t,i,s){const a=J(t,i,s);if(a.size===0)return!1;for(const[r,d]of a)t.option(r).bonus+=d;return!0}function p(t){for(const[,i]of t.options)i.bonus=0;return!0}function J(t,i,s){const a=i0(i),r=B(t,i,s);return r===0?new Map:new Map(a.map(d=>[d,r]))}function B(t,i,s){const a=t.req.level,r=t.getBooleanValue(o.bossReward),d=t.type;if(a<0||r&&s<3)return 0;switch(i){case h.STR:case h.DEX:case h.INT:case h.LUK:return x(a,s);case h.STR_DEX:case h.STR_INT:case h.STR_LUK:case h.DEX_INT:case h.DEX_LUK:case h.INT_LUK:return e(a,s);case h.PDD:return x(a,s);case h.PAD:case h.MAD:return t0(a,s,i,t.type,r,t.option(o.incPAD).base,t.option(o.incMAD).base);case h.MHP:case h.MMP:return n0(a,s);case h.speed:case h.jump:return D.isWeapon(d)?0:s;case h.damR:return D.isWeapon(d)?s:0;case h.bdR:return a<90||!D.isWeapon(d)?0:2*s;case h.allStatR:return a<70&&!D.isWeapon(d)?0:s;case h.reduceReq:return c0(a,s);default:return 0}}function x(t,i){return t>=250?Math.floor(t/20)*i:(Math.floor(t/20)+1)*i}function e(t,i){return(Math.floor(t/40)+1)*i}function t0(t,i,s,a,r,d,M){if(D.isWeapon(a)){const c=r?[0,0,1,1.4666,2.0166,2.663,3.4166]:[1,2.222,3.63,5.325,7.32,8.777,10.25];let n=d;if(a===f.heavySword||a===f.longSword){if(a===f.longSword)switch(n){case 100:n=102;break;case 103:n=105;break;case 105:n=107;break;case 112:n=114;break;case 117:n=121;break;case 135:n=139;break;case 169:n=173;break;case 203:n=207;break;case 293:n=297;break;case 337:n=342;break}const A=t>180?6:t>160?5:t>110?4:3;return Math.ceil(n*c[i-1]*A/100)}else if(s===h.MAD&&M>=n&&(n=M),r){const A=t>160?18:t>150?15:t>110?12:9;return Math.ceil(n*c[i-1]*A/100)}else{const A=t>110?4:3;return Math.ceil(n*c[i-1]*A/100)}}else if(t<60)return 0;return i}function n0(t,i){return t<10?3*i:t>=250?700*i:Math.floor(t/10)*30*i}function c0(t,i){return i*5}function i0(t){switch(t){case h.STR:return[o.incSTR];case h.DEX:return[o.incDEX];case h.INT:return[o.incINT];case h.LUK:return[o.incLUK];case h.STR_DEX:return[o.incSTR,o.incDEX];case h.STR_INT:return[o.incSTR,o.incINT];case h.STR_LUK:return[o.incSTR,o.incLUK];case h.DEX_INT:return[o.incDEX,o.incINT];case h.DEX_LUK:return[o.incDEX,o.incLUK];case h.INT_LUK:return[o.incINT,o.incLUK];case h.PDD:return[o.incPDD];case h.PAD:return[o.incPAD];case h.MAD:return[o.incMAD];case h.MHP:return[o.incMHP];case h.MMP:return[o.incMMP];case h.speed:return[o.incSpeed];case h.jump:return[o.incJump];case h.damR:return[o.damR];case h.bdR:return[o.bdR];case h.allStatR:return[o.statR];case h.reduceReq:return[o.reduceReq];default:return[]}}const o0=25,O=15;function Q(t,i=!1){if(t.getBooleanValue(o.incCHUC))return!1;if(t.getBooleanValue(o.superiorEqp))return s0(t);if(t.star>=t.maxStar&&!i||t.star>=o0)return!1;t.star+=1;const s=t.star,a=v(t,!1,!1),r=v(t,!1,!0),d=D.isWeapon(t.type)||t.type===f.katara,M=[[o.incSTR,o.incDEX],[o.incINT,o.incLUK],[o.incDEX,o.incSTR],[o.incLUK,o.incDEX],[o.incSTR,o.incDEX]],c=[o.incSTR,o.incDEX,o.incINT,o.incLUK];let n;const A=t.req.job;if(A===0)n=new Set([o.incSTR,o.incDEX,o.incINT,o.incLUK]);else{n=new Set;for(let u=0;u<5;u++)if(A&1<<u)for(const S of M[u])n.add(S)}for(const u of c)(n.has(u)||s>15&&(t.option(u).base>0||t.option(u).upgrade>0))&&(t.option(u).enchant+=a[s]);if(d){const u=A===0||Math.floor(A/2)%2===1||t.option(o.incMAD).upgrade>0;if(s>15)t.option(o.incPAD).enchant+=r[s],u&&(t.option(o.incMAD).enchant+=r[s]);else{const S=t.option(o.incPAD).sum-t.option(o.incPAD).bonus;if(t.option(o.incPAD).enchant+=Math.floor(S/50)+1,u){const T=t.option(o.incMAD).sum-t.option(o.incMAD).bonus;t.option(o.incMAD).enchant+=Math.floor(T/50)+1}}}else t.option(o.incPAD).enchant+=r[s],t.option(o.incMAD).enchant+=r[s],t.type===f.glove&&(A===0?(t.option(o.incPAD).enchant+=E[s],t.option(o.incMAD).enchant+=E[s]):Math.floor(A/2)%2===1?t.option(o.incMAD).enchant+=E[s]:t.option(o.incPAD).enchant+=E[s]);if(!d&&t.type!==f.machineHeart){const u=t.option(o.incPDD).sum-t.option(o.incPDD).bonus;t.option(o.incPDD).enchant+=Math.floor(u/20)+1}const b=[f.cap,f.coat,f.longcoat,f.pants,f.cape,f.ring,f.pendant,f.belt,f.shoulder,f.shield];return d?(t.option(o.incMHP).enchant+=L[s],t.option(o.incMMP).enchant+=L[s]):b.includes(t.type)&&(t.option(o.incMHP).enchant+=L[s]),t.type===f.shoes&&(t.option(o.incSpeed).enchant+=W[s],t.option(o.incJump).enchant+=W[s]),!0}function s0(t){if(t.star>=t.maxStar)return!1;t.star+=1;const i=t.star,s=v(t,!1,!1),a=v(t,!1,!0),r=[o.incSTR,o.incDEX,o.incINT,o.incLUK];for(const c of r)t.option(c).base>0&&(t.option(c).enchant+=s[i]);const d=[o.incPAD,o.incMAD];for(const c of d)t.option(c).base>0&&(t.option(c).enchant+=a[i]);const M=t.option(o.incPDD).sum-t.option(o.incPDD).bonus;return t.option(o.incPDD).enchant+=Math.floor(M/20)+1,!0}function a0(t,i=!1,s=!1){if(t.getBooleanValue(o.incCHUC)||t.getBooleanValue(o.superiorEqp)||t.req.level>150||t.star>=t.maxStar&&!s||t.star>=O)return!1;t.amazing||(t.amazing=!0,t.maxStar=Math.min(t.maxStar,O)),t.star+=1;const a=t.star,r=v(t,!0,!1),d=v(t,!0,!0),M=D.isWeapon(t.type)||t.type===f.katara,c=[o.incSTR,o.incDEX,o.incINT,o.incLUK];for(const b of c)if(t.option(b).sum>0){let S=r[a];i&&D.isAccessory(t.type)&&(S+=a>5?2:1),t.option(b).enchant+=S}const n=[o.incPAD,o.incMAD];for(const b of n){const u=t.option(b).sum;if(u>0){M&&(t.option(b).enchant+=Math.floor(u/50)+1);let S=d[a];i&&(M||t.type===f.shield)&&(S+=1),t.option(b).enchant+=S}}i&&D.isArmor(t.type)&&(t.option(o.incMHP).enchant+=50);const A=t.option(o.incPDD).sum;return t.option(o.incPDD).enchant+=Math.floor(A/20)+1,!0}function Z(t){if(t.getBooleanValue(o.incCHUC))return!1;t.star=0,t.amazing=!1,t.maxStar=D.getMaxStar(t);for(const[,i]of t.options)i.enchant=0;return!0}function f0(t){if(t.getBooleanValue(o.incCHUC)||t.amazing)return!1;const i=t.star;Z(t);for(let s=0;s<i;s++)Q(t,!0);return!0}function v(t,i,s){let a;t.getBooleanValue(o.superiorEqp)?s?a=h0:a=r0:i?s?a=A0:a=M0:s?D.isWeapon(t.type)||t.type===f.katara?a=d0:a=u0:a=D0;const r=t.req.level;for(const d of[...a].reverse())if(r>=d[0])return d;throw Error(`Gear has invalid reqLevel.
|
|
2
|
+
`+t)}const h0=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[110,0,0,0,0,0,5,6,7,0,0,0,0,0,0,0],[150,0,0,0,0,0,9,10,11,12,13,15,17,19,21,23]],r0=[[0,1,2,4,7,11,0,0,0,0,0,0,0,0,0,0],[80,2,3,5,8,12,0,0,0,0,0,0,0,0,0,0],[110,9,10,12,15,19,0,0,0,0,0,0,0,0,0,0],[150,19,20,22,25,29,0,0,0,0,0,0,0,0,0,0]],d0=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,5,6,7,8,9,27,28,29],[118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,6,7,8,9,10,28,29,30],[128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,7,8,9,10,11,29,30,31],[138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,8,9,10,11,12,30,31,32],[148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,9,10,11,12,13,31,32,33],[158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,10,11,12,13,14,32,33,34],[198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,13,14,14,15,16,17,34,35,36],[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,15,16,16,17,18,19,36,37,38]],u0=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,7,8,9,10,12,13,15,17],[118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,8,9,10,11,13,14,16,18],[128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,9,10,11,12,14,16,18,20],[138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,10,11,12,13,15,17,19,21],[148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,10,11,12,13,14,16,18,20,22],[158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,11,12,13,14,15,17,19,21,23],[198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,13,14,15,16,17,19,21,23,25],[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16,17,18,19,21,23,25,27]],D0=[[0,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0],[108,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0],[118,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,0,0,0],[128,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,7,7,7,7,7,7,7,0,0,0],[138,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,9,9,9,9,9,9,9,0,0,0],[148,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,11,11,11,11,11,11,11,0,0,0],[158,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,13,13,13,13,13,13,13,0,0,0],[198,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,15,15,15,15,15,15,15,0,0,0],[248,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,17,17,17,17,17,17,17,0,0,0]],A0=[[0,0,0,0,0,0,1,2,3,4,5,6,8,10,12,14],[80,0,0,0,0,0,2,3,4,5,6,7,9,11,13,15],[90,0,0,0,0,0,3,4,5,6,7,8,10,12,14,16],[100,0,0,0,0,0,4,5,6,7,8,9,11,13,15,17],[110,0,0,0,0,0,5,6,7,8,9,10,12,14,16,18],[120,0,0,0,0,0,6,7,8,9,10,11,13,15,17,19],[130,0,0,0,0,0,7,8,9,10,11,12,14,16,18,20],[140,0,0,0,0,0,8,9,10,11,12,13,15,17,19,21],[150,0,0,0,0,0,9,10,11,12,13,14,16,18,20,22]],M0=[[0,1,2,4,7,11,0,0,0,0,0,0,0,0,0,0],[80,2,3,5,8,12,0,0,0,0,0,0,0,0,0,0],[85,3,4,6,9,13,0,0,0,0,0,0,0,0,0,0],[90,4,5,7,10,14,0,0,0,0,0,0,0,0,0,0],[95,5,6,8,11,15,0,0,0,0,0,0,0,0,0,0],[100,7,8,10,13,17,0,0,0,0,0,0,0,0,0,0],[105,8,9,11,14,18,0,0,0,0,0,0,0,0,0,0],[110,9,10,12,15,19,0,0,0,0,0,0,0,0,0,0],[115,10,11,13,16,20,0,0,0,0,0,0,0,0,0,0],[120,12,13,15,18,22,0,0,0,0,0,0,0,0,0,0],[125,13,14,16,19,23,0,0,0,0,0,0,0,0,0,0],[130,14,15,17,20,24,0,0,0,0,0,0,0,0,0,0],[135,15,16,18,21,25,0,0,0,0,0,0,0,0,0,0],[140,17,18,20,23,27,0,0,0,0,0,0,0,0,0,0],[145,18,19,21,24,28,0,0,0,0,0,0,0,0,0,0],[150,19,20,22,25,29,0,0,0,0,0,0,0,0,0,0]],E=[0,0,0,0,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0],L=[0,5,5,5,10,10,15,15,20,20,25,25,25,25,25,25,0,0,0,0,0,0,0,0,0,0],W=[0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0];function Y(t,i,s){if(D.isWeapon(t.type)||t.type===f.katara)return R0(t,i,s);if(t.type===f.glove)return w0(t,i,s);if(D.isArmor(t.type)||t.type===f.shoulder)return g0(t,i,s);if(D.isAccessory(t.type))return E0(t,i,s);if(t.type===f.machineHeart)return C0(t,i,s)}const S0={100:[[1,0],[2,0],[3,1]],70:[[2,0],[3,1],[5,2]],30:[[3,1],[5,2],[7,3]],15:[[5,2],[7,3],[9,4]]},b0={100:[[1,5,1],[2,20,2],[3,30,3]],70:[[2,15,2],[3,40,4],[4,70,5]],30:[[3,30,4],[5,70,7],[7,120,10]],15:[[4,45,6],[7,110,10],[10,170,15]]},_={30:[1,2,3],15:[2,3,4]},q={30:[1,2,3]},v0={100:[0,1,1],70:[1,2,2],30:[2,3,3],15:[3,4,4]},k={100:[1,1,2],70:[2,2,3],30:[3,4,5]},V={100:[1,2,3],70:[2,3,5],30:[3,5,7]},H={[o.incSTR]:o.incPAD,[o.incDEX]:o.incPAD,[o.incINT]:o.incMAD,[o.incLUK]:o.incPAD,[o.incMHP]:o.incPAD,[o.incAllStat]:o.incPAD},R={[o.incSTR]:"힘",[o.incDEX]:"민첩",[o.incINT]:"지력",[o.incLUK]:"운",[o.incMHP]:"체력",[o.incAllStat]:"올스탯",[o.incPAD]:"공격력",[o.incMAD]:"마력"};function w(t){return t.req.level>110?2:t.req.level>70?1:0}function R0(t,i,s){if(i===o.incAllStat)return;const a=w(t);let[r,d]=S0[s][a];const M=H[i],c=R[M];return i===o.incMHP&&(d*=50),{name:d>0?`${s}% ${c}(${R[i]}) 주문서`:`${s}% ${c} 주문서`,option:new Map([[i,d],[M,r]])}}function g0(t,i,s){const a=w(t),[r,d,M]=b0[s][a];let c=[],n=[],A=[];if(i===o.incMHP)n=[[o.incMHP,d+r*50]];else if(n=[[o.incMHP,d]],i===o.incAllStat){if(!(s in _))return;const S=_[s][a];c=[[o.incSTR,S],[o.incDEX,S],[o.incINT,S],[o.incLUK,S]]}else c=[[i,r]];t.upgradeCount===3&&(t.req.job===0?A=[[o.incPAD,1],[o.incMAD,1]]:Math.floor(t.req.job/2)%2===1?A=[[o.incMAD,1]]:A=[[o.incPAD,1]]);const b=`${s}% ${R[i]} 주문서`,u=new Map([...c,...A,...n,[o.incPDD,M]]);return{name:b,option:u}}function w0(t,i,s){const a=w(t),r=v0[s][a];if(r===0)return{name:`${s}% 방어력 주문서`,option:new Map([[o.incPDD,3]])};{const d=H[i];return{name:`${s}% ${R[d]} 주문서`,option:new Map([[d,r]])}}}function E0(t,i,s){if(!(s in k))return;const a=w(t),r=k[s][a];let d=[];if(i===o.incMHP)d=[[o.incMHP,r*50]];else if(i===o.incAllStat){if(!(s in q))return;const n=q[s][a];d=[[o.incSTR,n],[o.incDEX,n],[o.incINT,n],[o.incLUK,n]]}else d=[[i,r]];const M=`${s}% ${R[i]} 주문서`,c=new Map(d);return{name:M,option:c}}function C0(t,i,s){if(!(s in V))return;const a=w(t),r=V[s][a],d=H[i];return{name:`${s}% ${R[i]} 주문서`,option:new Map([[d,r]])}}function U0(t){return t.getBooleanValue(o.blockGoldHammer)||t.getBooleanValue(o.onlyUpgrade)||t.totalUpgradeCount<=0||t.hammerCount>0?!1:(t.hammerCount=1,!0)}function P(t,i){if(t.upgradeCountLeft<1)return!1;t.upgradeCount+=1;for(const[s,a]of i.option)t.option(s).upgrade+=a;return!0}function X0(t,i,s){const a=Y(t,i,s);return a?P(t,a):!1}function N0(t){return t.upgradeCountLeft<1?!1:(t.upgradeFailCount+=1,!0)}function L0(t){return t.upgradeFailCount<1?!1:(t.upgradeFailCount-=1,!0)}function I0(t){t.upgradeCount=0,t.upgradeFailCount=0,t.hammerCount=0;for(const[,i]of t.options)i.upgrade=0;return!0}function m(t){const i={};i.id=t.itemID,i.n=t.name,t.desc.length>0&&(i.d=t.desc),i.i=t.icon,t.anvilIcon&&(i.i2=t.anvilIcon),t.anvilName&&(i.n2=t.anvilName),i.t=t.type,i.r=t.req,i.pr=U(t.props,a=>a!==0),i.o=U(t.options,a=>!a.empty,H0),t.totalUpgradeCount>0&&(i.c=t.totalUpgradeCount),t.upgradeCount>0&&(i.up=t.upgradeCount),t.upgradeFailCount>0&&(i.f=t.upgradeFailCount),t.hammerCount>0&&(i.h=t.hammerCount),t.maxStar>0&&(i.m=t.maxStar),t.star>0&&(i.s=t.star),t.amazing&&(i.a=t.amazing),t.karma!==void 0&&(i.k=t.karma),t.canPotential&&(i.cp=t.canPotential),t.grade>0&&(i.g=t.grade),t.grade>0&&t.potentials.length>0&&(i.p=z(t.potentials,void 0,j)),t.additionalGrade>0&&(i.g2=t.additionalGrade),t.additionalGrade>0&&t.additionalPotentials.length>0&&(i.p2=z(t.additionalPotentials,void 0,j));const s=K0(t.soulWeapon);return s&&(i.w=s),i}function H0(t){return[t.base,t.bonus,t.upgrade,t.enchant]}function j(t){return t?{c:t.code,t:t.optionType,l:t.reqLevel,s:t.summary,o:U(t.option,i=>i!==0)}:null}function K0(t){const i={};if(t.enchanted&&(i.e=t.enchanted),t.soul&&(i.s=t.soul),t.charge>0&&(i.c=t.charge),t.chargeOption.size>0&&(i.o=U(t.chargeOption,s=>s!==0)),Object.keys(i).length>0)return i}const y=t=>{const i=c=>typeof c.id=="number"&&typeof c.n=="string"&&(c.d===void 0||typeof c.d=="string")&&typeof c.i=="object"&&c.i!==null&&s(c.i)&&(c.i2===void 0||typeof c.i2=="object"&&c.i2!==null&&s(c.i2))&&(c.n2===void 0||typeof c.n2=="string")&&(c.t===100||c.t===101||c.t===102||c.t===103||c.t===104||c.t===105||c.t===106||c.t===107||c.t===108||c.t===110||c.t===111||c.t===112||c.t===113||c.t===114||c.t===115||c.t===116||c.t===118||c.t===166||c.t===167||c.t===109||c.t===119||c.t===119020||c.t===1212||c.t===1213||c.t===1214||c.t===122||c.t===123||c.t===124||c.t===126||c.t===127||c.t===128||c.t===129||c.t===130||c.t===131||c.t===132||c.t===133||c.t===134||c.t===136||c.t===137||c.t===138||c.t===140||c.t===1404||c.t===141||c.t===142||c.t===143||c.t===144||c.t===145||c.t===146||c.t===147||c.t===148||c.t===149||c.t===150||c.t===151||c.t===152||c.t===153||c.t===156||c.t===157||c.t===158||c.t===159||c.t===1098||c.t===1099||c.t===135200||c.t===135210||c.t===135220||c.t===135221||c.t===135222||c.t===135223||c.t===135224||c.t===135225||c.t===135226||c.t===135227||c.t===135228||c.t===135229||c.t===135240||c.t===135250||c.t===135260||c.t===135270||c.t===135290||c.t===135291||c.t===135292||c.t===135293||c.t===135294||c.t===135295||c.t===135296||c.t===135297||c.t===135298||c.t===135300||c.t===135310||c.t===135320||c.t===135330||c.t===135340||c.t===135350||c.t===135360||c.t===135370||c.t===135380||c.t===135400||c.t===135401||c.t===135402||c.t===135403||c.t===180||c.t===161||c.t===162||c.t===163||c.t===164||c.t===165||c.t===194||c.t===195||c.t===196||c.t===197)&&typeof c.r=="object"&&c.r!==null&&a(c.r)&&Array.isArray(c.pr)&&c.pr.every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&typeof n[1]=="number")&&Array.isArray(c.o)&&c.o.every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&Array.isArray(n[1])&&n[1].length===4&&typeof n[1][0]=="number"&&typeof n[1][1]=="number"&&typeof n[1][2]=="number"&&typeof n[1][3]=="number")&&(c.c===void 0||typeof c.c=="number")&&(c.up===void 0||typeof c.up=="number")&&(c.f===void 0||typeof c.f=="number")&&(c.h===void 0||typeof c.h=="number")&&(c.m===void 0||typeof c.m=="number")&&(c.s===void 0||typeof c.s=="number")&&(c.a===void 0||typeof c.a=="boolean")&&(c.k===void 0||typeof c.k=="number")&&(c.cp===void 0||typeof c.cp=="boolean")&&(c.g===void 0||c.g===0||c.g===1||c.g===2||c.g===3||c.g===4||c.g===5)&&(c.p===void 0||Array.isArray(c.p)&&c.p.every(n=>n===null||typeof n=="object"&&n!==null&&r(n)))&&(c.g2===void 0||c.g2===0||c.g2===1||c.g2===2||c.g2===3||c.g2===4||c.g2===5)&&(c.p2===void 0||Array.isArray(c.p2)&&c.p2.every(n=>n===null||typeof n=="object"&&n!==null&&r(n)))&&(c.w===void 0||typeof c.w=="object"&&c.w!==null&&Array.isArray(c.w)===!1&&d(c.w)),s=c=>typeof c.id=="number"&&Array.isArray(c.origin)&&c.origin.length===2&&typeof c.origin[0]=="number"&&typeof c.origin[1]=="number",a=c=>typeof c.level=="number"&&typeof c.str=="number"&&typeof c.luk=="number"&&typeof c.dex=="number"&&typeof c.int=="number"&&typeof c.job=="number"&&typeof c.specJob=="number",r=c=>typeof c.c=="number"&&typeof c.t=="number"&&typeof c.l=="number"&&typeof c.s=="string"&&Array.isArray(c.o)&&c.o.every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&typeof n[1]=="number"),d=c=>(c.e===void 0||typeof c.e=="boolean")&&(c.s===void 0||typeof c.s=="object"&&c.s!==null&&M(c.s))&&(c.c===void 0||typeof c.c=="number")&&(c.o===void 0||Array.isArray(c.o)&&c.o.every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&typeof n[1]=="number")),M=c=>typeof c.name=="string"&&typeof c.skill=="string"&&c.option instanceof Map&&[...c.option].every(n=>Array.isArray(n)&&n.length===2&&(n[0]===1||n[0]===2||n[0]===3||n[0]===4||n[0]===5||n[0]===6||n[0]===7||n[0]===8||n[0]===9||n[0]===10||n[0]===11||n[0]===12||n[0]===13||n[0]===14||n[0]===15||n[0]===16||n[0]===17||n[0]===18||n[0]===19||n[0]===20||n[0]===21||n[0]===22||n[0]===23||n[0]===24||n[0]===25||n[0]===26||n[0]===27||n[0]===28||n[0]===29||n[0]===30||n[0]===31||n[0]===100||n[0]===101||n[0]===102||n[0]===103||n[0]===104||n[0]===105||n[0]===106||n[0]===107||n[0]===108||n[0]===109||n[0]===110||n[0]===111||n[0]===112||n[0]===113||n[0]===114||n[0]===115||n[0]===116||n[0]===117||n[0]===118||n[0]===119||n[0]===120||n[0]===121||n[0]===122||n[0]===123||n[0]===124||n[0]===125||n[0]===126||n[0]===127||n[0]===128||n[0]===129||n[0]===130||n[0]===131||n[0]===132||n[0]===133||n[0]===134||n[0]===135||n[0]===200||n[0]===201||n[0]===202||n[0]===203||n[0]===1100||n[0]===1101||n[0]===1102||n[0]===1103||n[0]===1104||n[0]===1105||n[0]===1106||n[0]===1107||n[0]===1108||n[0]===1109||n[0]===1110||n[0]===1111||n[0]===1112||n[0]===1113||n[0]===1114||n[0]===1115||n[0]===1116||n[0]===1117||n[0]===1118||n[0]===1119||n[0]===1120||n[0]===1121||n[0]===1122||n[0]===1123||n[0]===1124||n[0]===1125||n[0]===1126)&&typeof n[1]=="number")&&typeof c.multiplier=="number";return typeof t=="object"&&t!==null&&i(t)};function x0(t){return JSON.stringify(m(t))}function O0(t){return K(JSON.parse(t))}function W0(t){try{const i=JSON.parse(t);if(y(i))return K(i)}catch{}return null}function U(t,i,s){let a=[...t];return i&&(a=a.filter(r=>i(r[1]))),s?a.map(r=>[r[0],s(r[1])]):a}function z(t,i,s){let a=t;return i&&(a=a.filter(i)),s?a.map(s):a===t?[...t]:a}function X(t,i){return i?new Map(t.map(s=>[s[0],i(s[1])])):new Map(t)}function $(t,i){return i?[...t].map(i):[...t]}function K(t){const i=new D;return i.itemID=t.id,i.name=t.n,t.d&&(i.desc=t.d),i.icon=t.i,t.i2&&t.n2&&(i.anvilIcon=t.i2,i.anvilName=t.n2),i.type=t.t,i.req=t.r,i.props=X(t.pr),i.options=X(t.o,_0),t.c&&(i.totalUpgradeCount=t.c),t.up&&(i.upgradeCount=t.up),t.f&&(i.upgradeFailCount=t.f),t.h&&(i.hammerCount=t.h),t.m&&(i.maxStar=t.m),t.s&&(i.star=t.s),t.a&&(i.amazing=t.a),t.k&&(i.karma=t.k),t.cp&&(i.canPotential=t.cp),t.g&&(i.grade=t.g),t.p&&(i.potentials=$(t.p,F)),t.g2&&(i.additionalGrade=t.g2),t.p2&&(i.additionalPotentials=$(t.p2,F)),q0(t.w,i),i}function _0(t){const i=new I;return i.base=t[0],i.bonus=t[1],i.upgrade=t[2],i.enchant=t[3],i}function F(t){if(!t)return null;const i=new N;return i.code=t.c,i.optionType=t.t,i.reqLevel=t.l,i.summary=t.s,i.option=X(t.o),i}function q0(t,i){if(t){const s=i.soulWeapon;t?.e&&(s.enchanted=t.e),t?.s&&(s.soul=t.s),t?.c&&(s.charge=t.c),t?.o&&(s.chargeOption=X(t.o))}}exports.BonusStatType=h;exports.Gear=D;exports.GearOption=I;exports.GearPropType=o;exports.GearType=f;exports.Potential=N;exports.PotentialGrade=C;exports.SoulWeapon=l;exports.addAmazingEnhancement=a0;exports.addBonusStat=G;exports.addStarforce=Q;exports.addUpgradeFailCount=N0;exports.applyGoldHammer=U0;exports.applyScroll=P;exports.applySpellTrace=X0;exports.gearToPlain=m;exports.getBonusStatOption=J;exports.getBonusStatValue=B;exports.getSpellTraceScroll=Y;exports.isGearLike=y;exports.parseGear=O0;exports.plainToGear=K;exports.recalculateStarforce=f0;exports.resetBonusStat=p;exports.resetEnhancement=Z;exports.resetUpgrade=I0;exports.restoreUpgradeCount=L0;exports.stringifyGear=x0;exports.validateParseGear=W0;
|
package/index.js
CHANGED
|
@@ -18,7 +18,19 @@ class $ {
|
|
|
18
18
|
var s = /* @__PURE__ */ ((t) => (t[t.incSTR = 1] = "incSTR", t[t.incSTRr = 2] = "incSTRr", t[t.incDEX = 3] = "incDEX", t[t.incDEXr = 4] = "incDEXr", t[t.incINT = 5] = "incINT", t[t.incINTr = 6] = "incINTr", t[t.incLUK = 7] = "incLUK", t[t.incLUKr = 8] = "incLUKr", t[t.incAllStat = 9] = "incAllStat", t[t.incMHP = 10] = "incMHP", t[t.incMMP = 11] = "incMMP", t[t.incMHPr = 12] = "incMHPr", t[t.incMMPr = 13] = "incMMPr", t[t.incMDF = 14] = "incMDF", t[t.incARC = 15] = "incARC", t[t.incAUT = 16] = "incAUT", t[t.incPAD = 17] = "incPAD", t[t.incMAD = 18] = "incMAD", t[t.incAD = 19] = "incAD", t[t.incPDD = 20] = "incPDD", t[t.incSpeed = 21] = "incSpeed", t[t.incJump = 22] = "incJump", t[t.knockback = 23] = "knockback", t[t.bdR = 24] = "bdR", t[t.incBDR = 25] = "incBDR", t[t.imdR = 26] = "imdR", t[t.incIMDR = 27] = "incIMDR", t[t.damR = 28] = "damR", t[t.nbdR = 29] = "nbdR", t[t.statR = 30] = "statR", t[t.incCHUC = 31] = "incCHUC", t[t.incPADr = 100] = "incPADr", t[t.incMADr = 101] = "incMADr", t[t.incPDDr = 102] = "incPDDr", t[t.incCr = 103] = "incCr", t[t.incDAMr = 104] = "incDAMr", t[t.RecoveryHP = 105] = "RecoveryHP", t[t.RecoveryMP = 106] = "RecoveryMP", t[t.face = 107] = "face", t[t.prop = 108] = "prop", t[t.time = 109] = "time", t[t.HP = 110] = "HP", t[t.MP = 111] = "MP", t[t.attackType = 112] = "attackType", t[t.ignoreTargetDEF = 113] = "ignoreTargetDEF", t[t.ignoreDAM = 114] = "ignoreDAM", t[t.ignoreDAMr = 115] = "ignoreDAMr", t[t.DAMreflect = 116] = "DAMreflect", t[t.mpconReduce = 117] = "mpconReduce", t[t.incMesoProp = 118] = "incMesoProp", t[t.incRewardProp = 119] = "incRewardProp", t[t.incAllskill = 120] = "incAllskill", t[t.RecoveryUP = 121] = "RecoveryUP", t[t.boss = 122] = "boss", t[t.level = 123] = "level", t[t.incTerR = 124] = "incTerR", t[t.incAsrR = 125] = "incAsrR", t[t.incEXPr = 126] = "incEXPr", t[t.reduceCooltime = 127] = "reduceCooltime", t[t.incSTRlv = 128] = "incSTRlv", t[t.incDEXlv = 129] = "incDEXlv", t[t.incINTlv = 130] = "incINTlv", t[t.incLUKlv = 131] = "incLUKlv", t[t.incMHPlv = 132] = "incMHPlv", t[t.incPADlv = 133] = "incPADlv", t[t.incMADlv = 134] = "incMADlv", t[t.incCriticaldamage = 135] = "incCriticaldamage", t[t.attackSpeed = 200] = "attackSpeed", t[t.setItemID = 201] = "setItemID", t[t.durability = 202] = "durability", t[t.reduceReq = 203] = "reduceReq", t[t.only = 1100] = "only", t[t.tradeBlock = 1101] = "tradeBlock", t[t.accountSharable = 1102] = "accountSharable", t[t.onlyEquip = 1103] = "onlyEquip", t[t.tradeAvailable = 1104] = "tradeAvailable", t[t.equipTradeBlock = 1105] = "equipTradeBlock", t[t.sharableOnce = 1106] = "sharableOnce", t[t.charismaEXP = 1107] = "charismaEXP", t[t.senseEXP = 1108] = "senseEXP", t[t.insightEXP = 1109] = "insightEXP", t[t.willEXP = 1110] = "willEXP", t[t.craftEXP = 1111] = "craftEXP", t[t.charmEXP = 1112] = "charmEXP", t[t.accountShareTag = 1113] = "accountShareTag", t[t.bossReward = 1114] = "bossReward", t[t.noPotential = 1115] = "noPotential", t[t.fixedPotential = 1116] = "fixedPotential", t[t.specialGrade = 1117] = "specialGrade", t[t.fixedGrade = 1118] = "fixedGrade", t[t.superiorEqp = 1119] = "superiorEqp", t[t.incPQEXPr = 1120] = "incPQEXPr", t[t.jokerToSetItem = 1121] = "jokerToSetItem", t[t.blockGoldHammer = 1122] = "blockGoldHammer", t[t.exceptUpgrade = 1123] = "exceptUpgrade", t[t.onlyUpgrade = 1124] = "onlyUpgrade", t[t.noLookChange = 1125] = "noLookChange", t[t.tucIgnoreForPotential = 1126] = "tucIgnoreForPotential", t))(s || {}), f = /* @__PURE__ */ ((t) => (t[t.cap = 100] = "cap", t[t.faceAccessory = 101] = "faceAccessory", t[t.eyeAccessory = 102] = "eyeAccessory", t[t.earrings = 103] = "earrings", t[t.coat = 104] = "coat", t[t.longcoat = 105] = "longcoat", t[t.pants = 106] = "pants", t[t.shoes = 107] = "shoes", t[t.glove = 108] = "glove", t[t.cape = 110] = "cape", t[t.ring = 111] = "ring", t[t.pendant = 112] = "pendant", t[t.belt = 113] = "belt", t[t.medal = 114] = "medal", t[t.shoulder = 115] = "shoulder", t[t.pocket = 116] = "pocket", t[t.badge = 118] = "badge", t[t.android = 166] = "android", t[t.machineHeart = 167] = "machineHeart", t[t.shield = 109] = "shield", t[t.emblem = 119] = "emblem", t[t.powerSource = 119020] = "powerSource", t[t.shiningRod = 1212] = "shiningRod", t[t.tuner = 1213] = "tuner", t[t.breathShooter = 1214] = "breathShooter", t[t.soulShooter = 122] = "soulShooter", t[t.desperado = 123] = "desperado", t[t.energySword = 124] = "energySword", t[t.espLimiter = 126] = "espLimiter", t[t.chain = 127] = "chain", t[t.magicGauntlet = 128] = "magicGauntlet", t[t.ritualFan = 129] = "ritualFan", t[t.ohSword = 130] = "ohSword", t[t.ohAxe = 131] = "ohAxe", t[t.ohBlunt = 132] = "ohBlunt", t[t.dagger = 133] = "dagger", t[t.katara = 134] = "katara", t[t.cane = 136] = "cane", t[t.wand = 137] = "wand", t[t.staff = 138] = "staff", t[t.thSword = 140] = "thSword", t[t.chakram = 1404] = "chakram", t[t.thAxe = 141] = "thAxe", t[t.thBlunt = 142] = "thBlunt", t[t.spear = 143] = "spear", t[t.polearm = 144] = "polearm", t[t.bow = 145] = "bow", t[t.crossbow = 146] = "crossbow", t[t.claw = 147] = "claw", t[t.knuckle = 148] = "knuckle", t[t.gun = 149] = "gun", t[t.shovel = 150] = "shovel", t[t.pickaxe = 151] = "pickaxe", t[t.dualBowguns = 152] = "dualBowguns", t[t.handCannon = 153] = "handCannon", t[t.heavySword = 156] = "heavySword", t[t.longSword = 157] = "longSword", t[t.gauntletRevolver = 158] = "gauntletRevolver", t[t.ancientBow = 159] = "ancientBow", t[t.soulShield = 1098] = "soulShield", t[t.demonShield = 1099] = "demonShield", t[t.magicArrow = 135200] = "magicArrow", t[t.card = 135210] = "card", t[t.medallion = 135220] = "medallion", t[t.rosary = 135221] = "rosary", t[t.ironChain = 135222] = "ironChain", t[t.magicBook1 = 135223] = "magicBook1", t[t.magicBook2 = 135224] = "magicBook2", t[t.magicBook3 = 135225] = "magicBook3", t[t.arrowFletching = 135226] = "arrowFletching", t[t.bowThimble = 135227] = "bowThimble", t[t.daggerScabbard = 135228] = "daggerScabbard", t[t.charm = 135229] = "charm", t[t.orb = 135240] = "orb", t[t.dragonEssence = 135250] = "dragonEssence", t[t.soulRing = 135260] = "soulRing", t[t.magnum = 135270] = "magnum", t[t.wristBand = 135290] = "wristBand", t[t.farSight = 135291] = "farSight", t[t.powderKeg = 135292] = "powderKeg", t[t.mass = 135293] = "mass", t[t.document = 135294] = "document", t[t.magicMarble = 135295] = "magicMarble", t[t.arrowhead = 135296] = "arrowhead", t[t.jewel = 135297] = "jewel", t[t.powderKeg2 = 135298] = "powderKeg2", t[t.controller = 135300] = "controller", t[t.foxMarble = 135310] = "foxMarble", t[t.chessPiece = 135320] = "chessPiece", t[t.transmitter = 135330] = "transmitter", t[t.charge = 135340] = "charge", t[t.magicWing = 135350] = "magicWing", t[t.pathOfAbyss = 135360] = "pathOfAbyss", t[t.relic = 135370] = "relic", t[t.fanTassel = 135380] = "fanTassel", t[t.bracelet = 135400] = "bracelet", t[t.weaponBelt = 135401] = "weaponBelt", t[t.ornament = 135402] = "ornament", t[t.hexSeeker = 135403] = "hexSeeker", t[t.petEquip = 180] = "petEquip", t[t.machineEngine = 161] = "machineEngine", t[t.machineArms = 162] = "machineArms", t[t.machineLegs = 163] = "machineLegs", t[t.machineBody = 164] = "machineBody", t[t.machineTransistors = 165] = "machineTransistors", t[t.dragonMask = 194] = "dragonMask", t[t.dragonPendant = 195] = "dragonPendant", t[t.dragonWings = 196] = "dragonWings", t[t.dragonTail = 197] = "dragonTail", t))(f || {}), N = /* @__PURE__ */ ((t) => (t[t.normal = 0] = "normal", t[t.rare = 1] = "rare", t[t.epic = 2] = "epic", t[t.unique = 3] = "unique", t[t.legendary = 4] = "legendary", t[t.special = 5] = "special", t))(N || {});
|
|
19
19
|
class B {
|
|
20
20
|
constructor(i) {
|
|
21
|
-
this.enchanted = !1, this.
|
|
21
|
+
this.enchanted = !1, this._charge = 0, this.chargeOption = /* @__PURE__ */ new Map(), this.gear = i;
|
|
22
|
+
}
|
|
23
|
+
/** 소울 충전량 */
|
|
24
|
+
get charge() {
|
|
25
|
+
return this._charge;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 소울 충전량
|
|
29
|
+
*
|
|
30
|
+
* `0`부터 `1000`까지의 값으로 설정할 수 있습니다.
|
|
31
|
+
*/
|
|
32
|
+
set charge(i) {
|
|
33
|
+
this.enchanted && (i < 0 || i > 1e3 || (this._charge = i, this.updateChargeOption()));
|
|
22
34
|
}
|
|
23
35
|
/**
|
|
24
36
|
* 소울 인챈트를 적용합니다.
|
|
@@ -45,7 +57,7 @@ class B {
|
|
|
45
57
|
* 소울 인챈트 상태가 아닐 경우 `false`를 반환합니다.
|
|
46
58
|
*/
|
|
47
59
|
setSoul(i) {
|
|
48
|
-
return this.enchanted ? (this.soul = i, this.
|
|
60
|
+
return this.enchanted ? (this.soul = i, this.updateChargeOption(), !0) : !1;
|
|
49
61
|
}
|
|
50
62
|
/**
|
|
51
63
|
* 장착된 소울을 제거합니다.
|
|
@@ -53,22 +65,15 @@ class B {
|
|
|
53
65
|
* 소울 인챈트 상태가 아니거나 장착된 소울이 없을 경우 `false`를 반환합니다.
|
|
54
66
|
*/
|
|
55
67
|
removeSoul() {
|
|
56
|
-
return !this.enchanted || !this.soul ? !1 : (this.soul = void 0, this.
|
|
68
|
+
return !this.enchanted || !this.soul ? !1 : (this.soul = void 0, this.updateChargeOption(), !0);
|
|
57
69
|
}
|
|
58
70
|
/**
|
|
59
|
-
* 소울 충전량을 설정합니다.
|
|
60
71
|
* 소울 충전량으로 증가하는 옵션을 다시 계산합니다.
|
|
61
|
-
* @param charge 설정할 소울 충전량.
|
|
62
|
-
* `0`부터 `1000`까지의 값으로 설정할 수 있습니다.
|
|
63
72
|
* @returns 적용했을 경우 `true`; 아닐 경우 `false`.
|
|
64
|
-
* 소울 인챈트 상태가 아니거나 설정할 소울 충전량이 0과 1000 사이의 값이 아닐 경우 `false`를 반환합니다.
|
|
65
73
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.charge = i;
|
|
70
|
-
const a = this.gear.option(s.incPAD).base < this.gear.option(s.incMAD).base ? s.incMAD : s.incPAD;
|
|
71
|
-
return this.chargeOption.clear(), this.chargeOption.set(a, this.getChargeAD()), !0;
|
|
74
|
+
updateChargeOption() {
|
|
75
|
+
const o = this.gear.option(s.incPAD).base < this.gear.option(s.incMAD).base ? s.incMAD : s.incPAD;
|
|
76
|
+
return this.chargeOption.clear(), this.chargeOption.set(o, this.getChargeAD()), !0;
|
|
72
77
|
}
|
|
73
78
|
getChargeAD() {
|
|
74
79
|
if (!this.enchanted || this.charge === 0)
|
|
@@ -83,7 +88,7 @@ class B {
|
|
|
83
88
|
}
|
|
84
89
|
const w = class {
|
|
85
90
|
constructor() {
|
|
86
|
-
this.itemID = 0, this.name = "", this.desc = "", this.type = 0, this.props = /* @__PURE__ */ new Map(), this.options = /* @__PURE__ */ new Map(), this.totalUpgradeCount = 0, this.upgradeCount = 0, this.upgradeFailCount = 0, this.hammerCount = 0, this.maxStar = 0, this.star = 0, this.amazing = !1, this.canPotential = !1, this.grade = N.normal, this.potentials = [], this.additionalGrade = N.normal, this.additionalPotentials = [], this.soulWeapon = new B(this), this.icon = {
|
|
91
|
+
this.itemID = 0, this.name = "", this.desc = "", this.type = 0, this.props = /* @__PURE__ */ new Map(), this.options = /* @__PURE__ */ new Map(), this.exceptionalOptions = /* @__PURE__ */ new Map(), this.totalUpgradeCount = 0, this.upgradeCount = 0, this.upgradeFailCount = 0, this.hammerCount = 0, this.exceptionalTotalUpgradeCount = 0, this.exceptionalUpgradeCount = 0, this.maxStar = 0, this.star = 0, this.amazing = !1, this.canPotential = !1, this.grade = N.normal, this.potentials = [], this.additionalGrade = N.normal, this.additionalPotentials = [], this.soulWeapon = new B(this), this.icon = {
|
|
87
92
|
id: 0,
|
|
88
93
|
origin: [0, 0]
|
|
89
94
|
}, this.req = {
|
|
@@ -102,6 +107,12 @@ const w = class {
|
|
|
102
107
|
get upgradeCountLeft() {
|
|
103
108
|
return this.totalUpgradeCount + this.hammerCount - this.upgradeCount - this.upgradeFailCount;
|
|
104
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* 익셉셔널 업그레이드 가능 횟수
|
|
112
|
+
*/
|
|
113
|
+
get exceptionalUpgradeCountLeft() {
|
|
114
|
+
return this.exceptionalTotalUpgradeCount - this.exceptionalUpgradeCount;
|
|
115
|
+
}
|
|
105
116
|
/**
|
|
106
117
|
* 가중치를 포함하여 계산한 현재 옵션과 기본 옵션의 차이
|
|
107
118
|
*/
|
|
@@ -1643,21 +1654,21 @@ const h0 = {
|
|
|
1643
1654
|
[7, 110, 10],
|
|
1644
1655
|
[10, 170, 15]
|
|
1645
1656
|
]
|
|
1646
|
-
},
|
|
1657
|
+
}, _ = {
|
|
1647
1658
|
30: [1, 2, 3],
|
|
1648
1659
|
15: [2, 3, 4]
|
|
1649
|
-
},
|
|
1660
|
+
}, q = {
|
|
1650
1661
|
30: [1, 2, 3]
|
|
1651
1662
|
}, d0 = {
|
|
1652
1663
|
100: [0, 1, 1],
|
|
1653
1664
|
70: [1, 2, 2],
|
|
1654
1665
|
30: [2, 3, 3],
|
|
1655
1666
|
15: [3, 4, 4]
|
|
1656
|
-
},
|
|
1667
|
+
}, W = {
|
|
1657
1668
|
100: [1, 1, 2],
|
|
1658
1669
|
70: [2, 2, 3],
|
|
1659
1670
|
30: [3, 4, 5]
|
|
1660
|
-
},
|
|
1671
|
+
}, O = {
|
|
1661
1672
|
100: [1, 2, 3],
|
|
1662
1673
|
70: [2, 3, 5],
|
|
1663
1674
|
30: [3, 5, 7]
|
|
@@ -1698,9 +1709,9 @@ function D0(t, i, o) {
|
|
|
1698
1709
|
if (i === s.incMHP)
|
|
1699
1710
|
n = [[s.incMHP, d + h * 50]];
|
|
1700
1711
|
else if (n = [[s.incMHP, d]], i === s.incAllStat) {
|
|
1701
|
-
if (!(o in
|
|
1712
|
+
if (!(o in _))
|
|
1702
1713
|
return;
|
|
1703
|
-
const S =
|
|
1714
|
+
const S = _[o][a];
|
|
1704
1715
|
c = [
|
|
1705
1716
|
[s.incSTR, S],
|
|
1706
1717
|
[s.incDEX, S],
|
|
@@ -1737,16 +1748,16 @@ function A0(t, i, o) {
|
|
|
1737
1748
|
}
|
|
1738
1749
|
}
|
|
1739
1750
|
function M0(t, i, o) {
|
|
1740
|
-
if (!(o in
|
|
1751
|
+
if (!(o in W))
|
|
1741
1752
|
return;
|
|
1742
|
-
const a = g(t), h =
|
|
1753
|
+
const a = g(t), h = W[o][a];
|
|
1743
1754
|
let d = [];
|
|
1744
1755
|
if (i === s.incMHP)
|
|
1745
1756
|
d = [[s.incMHP, h * 50]];
|
|
1746
1757
|
else if (i === s.incAllStat) {
|
|
1747
|
-
if (!(o in
|
|
1758
|
+
if (!(o in q))
|
|
1748
1759
|
return;
|
|
1749
|
-
const n =
|
|
1760
|
+
const n = q[o][a];
|
|
1750
1761
|
d = [
|
|
1751
1762
|
[s.incSTR, n],
|
|
1752
1763
|
[s.incDEX, n],
|
|
@@ -1759,9 +1770,9 @@ function M0(t, i, o) {
|
|
|
1759
1770
|
return { name: M, option: c };
|
|
1760
1771
|
}
|
|
1761
1772
|
function S0(t, i, o) {
|
|
1762
|
-
if (!(o in
|
|
1773
|
+
if (!(o in O))
|
|
1763
1774
|
return;
|
|
1764
|
-
const a = g(t), h =
|
|
1775
|
+
const a = g(t), h = O[o][a], d = L[i];
|
|
1765
1776
|
return { name: `${o}% ${R[i]} 주문서`, option: /* @__PURE__ */ new Map([[d, h]]) };
|
|
1766
1777
|
}
|
|
1767
1778
|
function L0(t) {
|
|
@@ -1785,7 +1796,7 @@ function K0(t) {
|
|
|
1785
1796
|
function x0(t) {
|
|
1786
1797
|
return t.upgradeFailCount < 1 ? !1 : (t.upgradeFailCount -= 1, !0);
|
|
1787
1798
|
}
|
|
1788
|
-
function
|
|
1799
|
+
function _0(t) {
|
|
1789
1800
|
t.upgradeCount = 0, t.upgradeFailCount = 0, t.hammerCount = 0;
|
|
1790
1801
|
for (const [, i] of t.options)
|
|
1791
1802
|
i.upgrade = 0;
|
|
@@ -1793,10 +1804,10 @@ function q0(t) {
|
|
|
1793
1804
|
}
|
|
1794
1805
|
function v0(t) {
|
|
1795
1806
|
const i = {};
|
|
1796
|
-
i.id = t.itemID, i.n = t.name, t.desc.length > 0 && (i.d = t.desc), i.i = t.icon, t.anvilIcon && (i.i2 = t.anvilIcon), t.anvilName && (i.n2 = t.anvilName), i.t = t.type, i.r = t.req, i.pr = C(t.props, (a) => a !== 0), i.o = C(t.options, (a) => !a.empty, R0), t.totalUpgradeCount > 0 && (i.c = t.totalUpgradeCount), t.upgradeCount > 0 && (i.up = t.upgradeCount), t.upgradeFailCount > 0 && (i.f = t.upgradeFailCount), t.hammerCount > 0 && (i.h = t.hammerCount), t.maxStar > 0 && (i.m = t.maxStar), t.star > 0 && (i.s = t.star), t.amazing && (i.a = t.amazing), t.karma !== void 0 && (i.k = t.karma), t.canPotential && (i.cp = t.canPotential), t.grade > 0 && (i.g = t.grade), t.grade > 0 && t.potentials.length > 0 && (i.p =
|
|
1807
|
+
i.id = t.itemID, i.n = t.name, t.desc.length > 0 && (i.d = t.desc), i.i = t.icon, t.anvilIcon && (i.i2 = t.anvilIcon), t.anvilName && (i.n2 = t.anvilName), i.t = t.type, i.r = t.req, i.pr = C(t.props, (a) => a !== 0), i.o = C(t.options, (a) => !a.empty, R0), t.totalUpgradeCount > 0 && (i.c = t.totalUpgradeCount), t.upgradeCount > 0 && (i.up = t.upgradeCount), t.upgradeFailCount > 0 && (i.f = t.upgradeFailCount), t.hammerCount > 0 && (i.h = t.hammerCount), t.maxStar > 0 && (i.m = t.maxStar), t.star > 0 && (i.s = t.star), t.amazing && (i.a = t.amazing), t.karma !== void 0 && (i.k = t.karma), t.canPotential && (i.cp = t.canPotential), t.grade > 0 && (i.g = t.grade), t.grade > 0 && t.potentials.length > 0 && (i.p = V(t.potentials, void 0, k)), t.additionalGrade > 0 && (i.g2 = t.additionalGrade), t.additionalGrade > 0 && t.additionalPotentials.length > 0 && (i.p2 = V(
|
|
1797
1808
|
t.additionalPotentials,
|
|
1798
1809
|
void 0,
|
|
1799
|
-
|
|
1810
|
+
k
|
|
1800
1811
|
));
|
|
1801
1812
|
const o = w0(t.soulWeapon);
|
|
1802
1813
|
return o && (i.w = o), i;
|
|
@@ -1804,7 +1815,7 @@ function v0(t) {
|
|
|
1804
1815
|
function R0(t) {
|
|
1805
1816
|
return [t.base, t.bonus, t.upgrade, t.enchant];
|
|
1806
1817
|
}
|
|
1807
|
-
function
|
|
1818
|
+
function k(t) {
|
|
1808
1819
|
return t ? {
|
|
1809
1820
|
c: t.code,
|
|
1810
1821
|
t: t.optionType,
|
|
@@ -1836,13 +1847,13 @@ const g0 = (t) => {
|
|
|
1836
1847
|
) && typeof c.multiplier == "number";
|
|
1837
1848
|
return typeof t == "object" && t !== null && i(t);
|
|
1838
1849
|
};
|
|
1839
|
-
function
|
|
1850
|
+
function q0(t) {
|
|
1840
1851
|
return JSON.stringify(v0(t));
|
|
1841
1852
|
}
|
|
1842
|
-
function
|
|
1853
|
+
function W0(t) {
|
|
1843
1854
|
return F(JSON.parse(t));
|
|
1844
1855
|
}
|
|
1845
|
-
function
|
|
1856
|
+
function O0(t) {
|
|
1846
1857
|
try {
|
|
1847
1858
|
const i = JSON.parse(t);
|
|
1848
1859
|
if (g0(i))
|
|
@@ -1855,25 +1866,25 @@ function C(t, i, o) {
|
|
|
1855
1866
|
let a = [...t];
|
|
1856
1867
|
return i && (a = a.filter((h) => i(h[1]))), o ? a.map((h) => [h[0], o(h[1])]) : a;
|
|
1857
1868
|
}
|
|
1858
|
-
function
|
|
1869
|
+
function V(t, i, o) {
|
|
1859
1870
|
let a = t;
|
|
1860
1871
|
return i && (a = a.filter(i)), o ? a.map(o) : a === t ? [...t] : a;
|
|
1861
1872
|
}
|
|
1862
1873
|
function U(t, i) {
|
|
1863
1874
|
return i ? new Map(t.map((o) => [o[0], i(o[1])])) : new Map(t);
|
|
1864
1875
|
}
|
|
1865
|
-
function
|
|
1876
|
+
function j(t, i) {
|
|
1866
1877
|
return i ? [...t].map(i) : [...t];
|
|
1867
1878
|
}
|
|
1868
1879
|
function F(t) {
|
|
1869
1880
|
const i = new A();
|
|
1870
|
-
return i.itemID = t.id, i.name = t.n, t.d && (i.desc = t.d), i.icon = t.i, t.i2 && t.n2 && (i.anvilIcon = t.i2, i.anvilName = t.n2), i.type = t.t, i.req = t.r, i.props = U(t.pr), i.options = U(t.o, E0), t.c && (i.totalUpgradeCount = t.c), t.up && (i.upgradeCount = t.up), t.f && (i.upgradeFailCount = t.f), t.h && (i.hammerCount = t.h), t.m && (i.maxStar = t.m), t.s && (i.star = t.s), t.a && (i.amazing = t.a), t.k && (i.karma = t.k), t.cp && (i.canPotential = t.cp), t.g && (i.grade = t.g), t.p && (i.potentials =
|
|
1881
|
+
return i.itemID = t.id, i.name = t.n, t.d && (i.desc = t.d), i.icon = t.i, t.i2 && t.n2 && (i.anvilIcon = t.i2, i.anvilName = t.n2), i.type = t.t, i.req = t.r, i.props = U(t.pr), i.options = U(t.o, E0), t.c && (i.totalUpgradeCount = t.c), t.up && (i.upgradeCount = t.up), t.f && (i.upgradeFailCount = t.f), t.h && (i.hammerCount = t.h), t.m && (i.maxStar = t.m), t.s && (i.star = t.s), t.a && (i.amazing = t.a), t.k && (i.karma = t.k), t.cp && (i.canPotential = t.cp), t.g && (i.grade = t.g), t.p && (i.potentials = j(t.p, z)), t.g2 && (i.additionalGrade = t.g2), t.p2 && (i.additionalPotentials = j(t.p2, z)), C0(t.w, i), i;
|
|
1871
1882
|
}
|
|
1872
1883
|
function E0(t) {
|
|
1873
1884
|
const i = new $();
|
|
1874
1885
|
return i.base = t[0], i.bonus = t[1], i.upgrade = t[2], i.enchant = t[3], i;
|
|
1875
1886
|
}
|
|
1876
|
-
function
|
|
1887
|
+
function z(t) {
|
|
1877
1888
|
if (!t)
|
|
1878
1889
|
return null;
|
|
1879
1890
|
const i = new I();
|
|
@@ -1906,13 +1917,13 @@ export {
|
|
|
1906
1917
|
Z as getBonusStatValue,
|
|
1907
1918
|
f0 as getSpellTraceScroll,
|
|
1908
1919
|
g0 as isGearLike,
|
|
1909
|
-
|
|
1920
|
+
W0 as parseGear,
|
|
1910
1921
|
F as plainToGear,
|
|
1911
1922
|
I0 as recalculateStarforce,
|
|
1912
1923
|
X0 as resetBonusStat,
|
|
1913
1924
|
e as resetEnhancement,
|
|
1914
|
-
|
|
1925
|
+
_0 as resetUpgrade,
|
|
1915
1926
|
x0 as restoreUpgradeCount,
|
|
1916
|
-
|
|
1917
|
-
|
|
1927
|
+
q0 as stringifyGear,
|
|
1928
|
+
O0 as validateParseGear
|
|
1918
1929
|
};
|
package/lib/gear.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ export declare class Gear {
|
|
|
60
60
|
* 개별 속성 접근 시 이 속성 대신 `option`을 사용하는 것이 권장됩니다.
|
|
61
61
|
*/
|
|
62
62
|
options: Map<GearPropType, GearOption>;
|
|
63
|
+
/**
|
|
64
|
+
* 익셉셔널 강화 옵션
|
|
65
|
+
*/
|
|
66
|
+
exceptionalOptions: Map<GearPropType, number>;
|
|
63
67
|
/** 최대 업그레이드 가능 횟수 */
|
|
64
68
|
totalUpgradeCount: number;
|
|
65
69
|
/** 업그레이드 횟수 */
|
|
@@ -68,6 +72,10 @@ export declare class Gear {
|
|
|
68
72
|
upgradeFailCount: number;
|
|
69
73
|
/** 황금망치 횟수 */
|
|
70
74
|
hammerCount: number;
|
|
75
|
+
/** 익셉셔널 강화 가능 횟수 */
|
|
76
|
+
exceptionalTotalUpgradeCount: number;
|
|
77
|
+
/** 익셉셔널 강화 횟수 */
|
|
78
|
+
exceptionalUpgradeCount: number;
|
|
71
79
|
/** 최대 장비 강화 수치 */
|
|
72
80
|
maxStar: number;
|
|
73
81
|
/** 장비 강화 수치 */
|
|
@@ -97,6 +105,10 @@ export declare class Gear {
|
|
|
97
105
|
* 업그레이드 가능 횟수
|
|
98
106
|
*/
|
|
99
107
|
get upgradeCountLeft(): number;
|
|
108
|
+
/**
|
|
109
|
+
* 익셉셔널 업그레이드 가능 횟수
|
|
110
|
+
*/
|
|
111
|
+
get exceptionalUpgradeCountLeft(): number;
|
|
100
112
|
/**
|
|
101
113
|
* 가중치를 포함하여 계산한 현재 옵션과 기본 옵션의 차이
|
|
102
114
|
*/
|
package/lib/soul.d.ts
CHANGED
|
@@ -20,8 +20,15 @@ export declare class SoulWeapon {
|
|
|
20
20
|
enchanted: boolean;
|
|
21
21
|
/** 소울 */
|
|
22
22
|
soul: Soul | undefined;
|
|
23
|
+
private _charge;
|
|
23
24
|
/** 소울 충전량 */
|
|
24
|
-
charge: number;
|
|
25
|
+
get charge(): number;
|
|
26
|
+
/**
|
|
27
|
+
* 소울 충전량
|
|
28
|
+
*
|
|
29
|
+
* `0`부터 `1000`까지의 값으로 설정할 수 있습니다.
|
|
30
|
+
*/
|
|
31
|
+
set charge(value: number);
|
|
25
32
|
/** 소울 충전량으로 증가하는 옵션 */
|
|
26
33
|
chargeOption: Map<GearPropType, number>;
|
|
27
34
|
private gear;
|
|
@@ -54,13 +61,9 @@ export declare class SoulWeapon {
|
|
|
54
61
|
*/
|
|
55
62
|
removeSoul(): boolean;
|
|
56
63
|
/**
|
|
57
|
-
* 소울 충전량을 설정합니다.
|
|
58
64
|
* 소울 충전량으로 증가하는 옵션을 다시 계산합니다.
|
|
59
|
-
* @param charge 설정할 소울 충전량.
|
|
60
|
-
* `0`부터 `1000`까지의 값으로 설정할 수 있습니다.
|
|
61
65
|
* @returns 적용했을 경우 `true`; 아닐 경우 `false`.
|
|
62
|
-
* 소울 인챈트 상태가 아니거나 설정할 소울 충전량이 0과 1000 사이의 값이 아닐 경우 `false`를 반환합니다.
|
|
63
66
|
*/
|
|
64
|
-
|
|
67
|
+
updateChargeOption(): boolean;
|
|
65
68
|
private getChargeAD;
|
|
66
69
|
}
|