@blizzhackers/d2data 2.7.14 → 3.1.91636

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.
Files changed (55) hide show
  1. package/compile.js +85 -106
  2. package/json/armor.json +1230 -0
  3. package/json/atomic.json +132 -117
  4. package/json/automagic.json +162 -0
  5. package/json/charstats.json +75 -0
  6. package/json/coldmasterybreakpoints.json +8 -0
  7. package/json/cubemain.json +1070 -0
  8. package/json/difficultylevels.json +3 -0
  9. package/json/events.json +15 -0
  10. package/json/experience.json +101 -0
  11. package/json/gamble.json +86 -102
  12. package/json/inventory.json +168 -14
  13. package/json/items.json +6199 -3489
  14. package/json/itemstatcost.json +144 -72
  15. package/json/itemtypes.json +271 -38
  16. package/json/itemuicategories.json +324 -0
  17. package/json/levelgroups.json +683 -686
  18. package/json/levels.json +232 -0
  19. package/json/lvlprest.json +27 -0
  20. package/json/magicprefix.json +1058 -0
  21. package/json/magicsuffix.json +691 -0
  22. package/json/misc.json +1764 -263
  23. package/json/misscalc.json +20 -0
  24. package/json/missiles.json +1915 -151
  25. package/json/monai.json +74 -8
  26. package/json/monpet.json +2035 -0
  27. package/json/monpopulationest.json +7 -0
  28. package/json/monseq.json +101 -0
  29. package/json/monsounds.json +177 -0
  30. package/json/monstats.json +1635 -0
  31. package/json/monstats2.json +549 -0
  32. package/json/objects.json +633 -33
  33. package/json/objpreset.json +20 -0
  34. package/json/objtype.json +70 -0
  35. package/json/overlay.json +1367 -237
  36. package/json/pettype.json +40 -3
  37. package/json/playerclass.json +6 -0
  38. package/json/plrtype.json +6 -0
  39. package/json/properties.json +431 -0
  40. package/json/propertygroups.json +487 -0
  41. package/json/runes.json +146 -0
  42. package/json/runeworduicategories.json +27 -0
  43. package/json/setitems.json +543 -0
  44. package/json/sets.json +108 -0
  45. package/json/skillcalc.json +140 -0
  46. package/json/skilldesc.json +7315 -6028
  47. package/json/skills.json +3445 -6
  48. package/json/sounds.json +83708 -63203
  49. package/json/states.json +298 -0
  50. package/json/tcprecalc.json +5759 -3396
  51. package/json/treasureclassex.json +4175 -1887
  52. package/json/treasureclassgroupsex.json +37 -0
  53. package/json/uniqueitems.json +1508 -391
  54. package/json/weapons.json +39 -60
  55. package/package.json +1 -1
package/compile.js CHANGED
@@ -56,6 +56,7 @@ const indexes = {
56
56
  missiles: 'Missile',
57
57
  monai: 'AI',
58
58
  monmode: 'code',
59
+ monpet: 'monster',
59
60
  monprop: 'Id',
60
61
  monstats: 'Id',
61
62
  monstats2: 'Id',
@@ -70,7 +71,9 @@ const indexes = {
70
71
  plrtype: 'Token',
71
72
  playerclass: 'Code',
72
73
  properties: 'code',
74
+ propertygroups: 'code',
73
75
  runes: '*Rune Name',
76
+ runeworduicategories: 'Name',
74
77
  setitems: 'index',
75
78
  sets: 'index',
76
79
  shrines: 'Code',
@@ -758,6 +761,68 @@ for (let diff of [0, 1, 2]) {
758
761
  }
759
762
  })(actprofile);
760
763
 
764
+ let coldmasterybreakpoints = {}, coldhpbyres = {};
765
+
766
+ for (let act of Object.values(actprofile)) {
767
+ for (let resset of Object.values(act)) {
768
+ if (resset['ResCo(H)']) {
769
+ for (let res in resset['ResCo(H)']) {
770
+ res = Number(res);
771
+ coldhpbyres[res] = coldhpbyres[res] || 0;
772
+ coldhpbyres[res] += resset['ResCo(H)'][res];
773
+ }
774
+ }
775
+ }
776
+ }
777
+
778
+ (function () {
779
+ for (let mastery = 0; mastery <= 195; mastery === 0 ? mastery = 20 : mastery ++) {
780
+ let ehp = 0;
781
+
782
+ for (let res in coldhpbyres) {
783
+ res = Number(res);
784
+ let pierce = (res >= 100 ? (mastery / 5) : mastery);
785
+ let mod = Math.min(2, 1 - (Math.min(95, res) - pierce) / 100);
786
+ ehp += coldhpbyres[res] / mod;
787
+ }
788
+
789
+ coldmasterybreakpoints[mastery] = ehp;
790
+ }
791
+
792
+ let masterylist = Object.keys(coldmasterybreakpoints);
793
+
794
+ for (let i = masterylist.length - 1; i; i--) {
795
+ coldmasterybreakpoints[masterylist[i]] = (coldmasterybreakpoints[masterylist[i - 1]] / coldmasterybreakpoints[masterylist[i]] - 1);
796
+ }
797
+
798
+ coldmasterybreakpoints[0] = 0;
799
+
800
+ for (let c = 0; c < 2; c++) {
801
+ for (let i = masterylist.length - 1; i; i--) {
802
+ coldmasterybreakpoints[masterylist[i]] = coldmasterybreakpoints[masterylist[i]] - coldmasterybreakpoints[masterylist[i - 1]];
803
+ }
804
+ }
805
+
806
+ for (let i = masterylist.length - 1; i; i--) {
807
+ coldmasterybreakpoints[masterylist[i]] = coldmasterybreakpoints[masterylist[i]] * 10000;
808
+ }
809
+
810
+ let newMasteryList = {}, mmin = Infinity;
811
+
812
+ for (let i = masterylist.length; i; i--) {
813
+ if (coldmasterybreakpoints[masterylist[i]] <= -0.5) {
814
+ mmin = Math.min(mmin, -coldmasterybreakpoints[masterylist[i]]);
815
+ newMasteryList[masterylist[i - 1]] = -coldmasterybreakpoints[masterylist[i]];
816
+ }
817
+ }
818
+
819
+ for (let key in newMasteryList) {
820
+ newMasteryList[key] = Math.round(newMasteryList[key] / mmin);
821
+ }
822
+
823
+ coldmasterybreakpoints = newMasteryList;
824
+ })();
825
+
761
826
  let tcprecalc = {};
762
827
 
763
828
  full.treasureclassex.forEach((tc, key) => {
@@ -786,120 +851,33 @@ atomic.forEach((precalc, key) => {
786
851
  };
787
852
  });
788
853
 
789
- // Formulas and coefficients for the 6 item cap are from https://github.com/realmonster/diablo2_drop_calc
790
- // He did a lot of work figuring out the formulas that I don't care to replicate,
791
- // so I'm taking the path of least resistance.
854
+ function totalTC (key, debug = []) {
855
+ if (key in tcprecalc) {
856
+ let tc = tcprecalc[key], total = 0;
792
857
 
793
- // Adjust droprates for TCs with 7 picks for the 6 item cap.
794
- tcprecalc.forEach((basetc, basekey) => {
795
- if (full.treasureclassex[basekey] && full.treasureclassex[basekey].Picks === 7) {
796
- [1, 2, 3, 4, 5, 6, 7, 8].forEach(playerCount => {
797
- let newvalue = basetc.droprate[playerCount] * (7 - basetc.droprate[playerCount]**6) / 7;
798
- basetc.droprateRoot[playerCount] = newvalue;
799
- });
800
- } else {
801
- basetc.droprateRoot = Object.assign({}, basetc.droprate);
802
- }
803
- });
858
+ for (let subtc in tc.counts) {
859
+ total += tc.counts[subtc] * totalTC(subtc, debug);
860
+ }
804
861
 
805
- [
806
- "Duriel",
807
- "Duriel Desecrated A",
808
- "Duriel Desecrated B",
809
- "Duriel Desecrated C",
810
- "Duriel (N)",
811
- "Duriel (N) Desecrated A",
812
- "Duriel (N) Desecrated B",
813
- "Duriel (N) Desecrated C",
814
- "Duriel (H)",
815
- "Duriel (H) Desecrated A",
816
- "Duriel (H) Desecrated B",
817
- "Duriel (H) Desecrated C",
818
- "Duriel (H) Desecrated D",
819
- "Durielq",
820
- "Durielq (N)",
821
- "Durielq (H)",
822
- ].forEach(tcname => {
823
- for (let c = 1; c < 9; c++) {
824
- tcprecalc[tcname]['droprateRoot'][c] *= 5 / 11;
862
+ return Math.round(total * 1e15) / 1e15;
825
863
  }
826
- });
827
864
 
828
- tcprecalc.forEach(tc => {
829
- if (tc['counts']['Sunder Charms']) {
830
- delete tc['counts']['Sunder Charms'];
831
- }
832
- });
865
+ return 1;
866
+ }
833
867
 
834
- // Flatten and abstract countess rune TCs so we can adjust the drop rate of each via coefficient.
835
- //tcprecalc.forEach((tc, key) => {
836
- ({
837
- 'Countess Rune': tcprecalc['Countess Rune'],
838
- 'Countess Rune (N)': tcprecalc['Countess Rune (N)'],
839
- 'Countess Rune (H)': tcprecalc['Countess Rune (H)'],
840
- }).forEach((tc, baseName) => {
841
- function flattenAndAbstract (tcName, mult = 1, ret = {}) {
842
- if (tcprecalc[tcName]) {
843
- tcprecalc[tcName].counts.forEach((submult, subtcName) => {
844
- flattenAndAbstract(subtcName, mult * submult, ret);
845
- });
846
- } else {
847
- let newtcName = `${baseName} - ${tcName}`;
848
-
849
- if (!tcprecalc[newtcName]) {
850
- tcprecalc[newtcName] = {
851
- droprate: {
852
- 1: 1,
853
- 2: 1,
854
- 3: 1,
855
- 4: 1,
856
- 5: 1,
857
- 6: 1,
858
- 7: 1,
859
- 8: 1,
860
- },
861
- droprateRoot: {
862
- 1: 1,
863
- 2: 1,
864
- 3: 1,
865
- 4: 1,
866
- 5: 1,
867
- 6: 1,
868
- 7: 1,
869
- 8: 1,
870
- },
871
- counts: {
872
- [tcName]: 1,
873
- }
874
- };
875
- }
868
+ for (let key in tcprecalc) {
869
+ let debug = [], total = totalTC(key, debug), tc = tcprecalc[key];
876
870
 
877
- ret[newtcName] = ret[newtcName] || 0;
878
- ret[newtcName] += mult;
879
- }
871
+ tc.droprateRoot = {
872
+ ...tc.droprate,
873
+ };
880
874
 
881
- return ret;
875
+ if (total > 6) {
876
+ for (let exp in tc.droprateRoot) {
877
+ tc.droprateRoot[exp] = tc.droprateRoot[exp] * 6 / total;
882
878
  }
883
-
884
- tc.counts = flattenAndAbstract(baseName);
885
- });
886
- //});
887
-
888
- // Multiply the coefficients to the abstracted TCs
889
- ({
890
- 'Countess Rune': {"1":{"0.8412177979895897":["r01"],"0.8412177979895898":["r02"],"0.8279977514350507":["r03"],"0.8279977514350506":["r04"],"0.8238064081864378":["r05","r06","r07","r08"]},"2":{"0.5384142786164905":["r01","r02"],"0.4988295919434789":["r03"],"0.498829591943479":["r04"],"0.4862413242371927":["r05","r08"],"0.48624132423719274":["r06","r07"]},"3":{"0.43127418667153955":["r01","r02"],"0.38274414977638443":["r03","r04"],"0.3673191805912878":["r05","r08"],"0.3673191805912879":["r06","r07"]},"4":{"0.4019832189168574":["r01"],"0.40198321891685734":["r02"],"0.3499170812603648":["r03"],"0.34991708126036486":["r04"],"0.3333333333333333":["r05","r07","r08"],"0.33333333333333337":["r06"]},"5":{"0.4019832189168574":["r01"],"0.40198321891685734":["r02"],"0.3499170812603648":["r03"],"0.34991708126036486":["r04"],"0.3333333333333333":["r05","r07","r08"],"0.33333333333333337":["r06"]},"6":{"0.4019832189168574":["r01"],"0.40198321891685734":["r02"],"0.3499170812603648":["r03"],"0.34991708126036486":["r04"],"0.3333333333333333":["r05","r07","r08"],"0.33333333333333337":["r06"]},"7":{"0.4019832189168574":["r01"],"0.40198321891685734":["r02"],"0.3499170812603648":["r03"],"0.34991708126036486":["r04"],"0.3333333333333333":["r05","r07","r08"],"0.33333333333333337":["r06"]},"8":{"0.4019832189168574":["r01"],"0.40198321891685734":["r02"],"0.3499170812603648":["r03"],"0.34991708126036486":["r04"],"0.3333333333333333":["r05","r07","r08"],"0.33333333333333337":["r06"]}},
891
- 'Countess Rune (N)': {"1":{"0.8256244546455895":["r01","r02","r05","r06","r11","r14","r16"],"0.8256244546455894":["r03","r07","r09","r12","r13","r15"],"0.8256244546455896":["r04","r08","r10"]},"2":{"0.491703901847278":["r01","r06"],"0.4917039018472779":["r02","r03","r07","r09","r12","r15","r16"],"0.49170390184727797":["r04","r05","r08","r10","r11","r13","r14"]},"3":{"0.37401224832526186":["r01","r02","r05","r06","r11","r12","r14","r15","r16"],"0.3740122483252619":["r03","r04","r07","r08","r09","r10","r13"]},"4":{"0.34053127677806344":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r11"],"0.3405312767780634":["r12","r13","r14","r15","r16"]},"5":{"0.34053127677806344":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r11"],"0.3405312767780634":["r12","r13","r14","r15","r16"]},"6":{"0.34053127677806344":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r11"],"0.3405312767780634":["r12","r13","r14","r15","r16"]},"7":{"0.34053127677806344":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r11"],"0.3405312767780634":["r12","r13","r14","r15","r16"]},"8":{"0.34053127677806344":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r11"],"0.3405312767780634":["r12","r13","r14","r15","r16"]}},
892
- 'Countess Rune (H)': {"1":{"0.8219588445252253":["r01","r06"],"0.8219588445252254":["r02","r03","r04","r05","r07","r08","r09","r10","r11","r12","r13","r15","r17","r18","r19","r20","r22","r23","r24"],"0.8219588445252255":["r14","r16","r21"]},"2":{"0.4893751399649079":["r01","r02","r11","r17","r19"],"0.48937513996490795":["r03","r05","r06","r07","r09","r12","r13","r15","r16","r18","r20","r21","r22","r23","r24"],"0.489375139964908":["r04","r08","r10","r14"]},"3":{"0.3733514492176993":["r01","r17"],"0.37335144921769925":["r02","r03","r04","r05","r06","r07","r08","r09","r10","r11","r12","r14","r15","r16","r19","r20","r21","r22","r23","r24"],"0.3733514492176992":["r13","r18"]},"4":{"0.34053976872957364":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r12","r13","r14","r15","r16","r17","r19","r20","r23","r24"],"0.3405397687295737":["r11","r18","r21"],"0.3405397687295736":["r22"]},"5":{"0.34053976872957364":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r12","r13","r14","r15","r16","r17","r19","r20","r23","r24"],"0.3405397687295737":["r11","r18","r21"],"0.3405397687295736":["r22"]},"6":{"0.34053976872957364":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r12","r13","r14","r15","r16","r17","r19","r20","r23","r24"],"0.3405397687295737":["r11","r18","r21"],"0.3405397687295736":["r22"]},"7":{"0.34053976872957364":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r12","r13","r14","r15","r16","r17","r19","r20","r23","r24"],"0.3405397687295737":["r11","r18","r21"],"0.3405397687295736":["r22"]},"8":{"0.34053976872957364":["r01","r02","r03","r04","r05","r06","r07","r08","r09","r10","r12","r13","r14","r15","r16","r17","r19","r20","r23","r24"],"0.3405397687295737":["r11","r18","r21"],"0.3405397687295736":["r22"]}},
893
- }).forEach((data, baseName) => {
894
- [1, 2, 3, 4, 5, 6, 7, 8].forEach(players => {
895
- data[players].forEach((runes, value) => {
896
- value = Number(value);
897
- runes.forEach(runeName => {
898
- tcprecalc[baseName + ' - ' + runeName]['droprate'][players] *= value;
899
- });
900
- });
901
- });
902
- });
879
+ }
880
+ }
903
881
 
904
882
  files.forEach(fn => {
905
883
  fs.writeFileSync(outDir + fn + '.json', JSON.stringify(keySort(full[fn]), null, ' '));
@@ -911,3 +889,4 @@ fs.writeFileSync(outDir + 'treasureclassgroupsex.json', JSON.stringify(groupsEx,
911
889
  fs.writeFileSync(outDir + 'monpopulationest.json', JSON.stringify(monpopulation, null, ' '));
912
890
  fs.writeFileSync(outDir + 'tcprecalc.json', JSON.stringify(tcprecalc, null, ' '));
913
891
  fs.writeFileSync(outDir + 'actprofile.json', JSON.stringify(actprofile, null, ' '));
892
+ fs.writeFileSync(outDir + 'coldmasterybreakpoints.json', JSON.stringify(coldmasterybreakpoints, null, ' '));