@blizzhackers/d2data 2.7.15 → 3.1.91637

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 (54) hide show
  1. package/compile.js +23 -107
  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/cubemain.json +1070 -0
  7. package/json/difficultylevels.json +3 -0
  8. package/json/events.json +15 -0
  9. package/json/experience.json +101 -0
  10. package/json/gamble.json +86 -102
  11. package/json/inventory.json +168 -14
  12. package/json/items.json +6199 -3489
  13. package/json/itemstatcost.json +144 -72
  14. package/json/itemtypes.json +271 -38
  15. package/json/itemuicategories.json +324 -0
  16. package/json/levelgroups.json +596 -499
  17. package/json/levels.json +232 -0
  18. package/json/lvlprest.json +27 -0
  19. package/json/magicprefix.json +1058 -0
  20. package/json/magicsuffix.json +691 -0
  21. package/json/misc.json +1764 -263
  22. package/json/misscalc.json +20 -0
  23. package/json/missiles.json +1915 -151
  24. package/json/monai.json +74 -8
  25. package/json/monpet.json +2035 -0
  26. package/json/monpopulationest.json +7 -0
  27. package/json/monseq.json +101 -0
  28. package/json/monsounds.json +177 -0
  29. package/json/monstats.json +1635 -0
  30. package/json/monstats2.json +549 -0
  31. package/json/objects.json +633 -33
  32. package/json/objpreset.json +20 -0
  33. package/json/objtype.json +70 -0
  34. package/json/overlay.json +1367 -237
  35. package/json/pettype.json +40 -3
  36. package/json/playerclass.json +6 -0
  37. package/json/plrtype.json +6 -0
  38. package/json/properties.json +431 -0
  39. package/json/propertygroups.json +487 -0
  40. package/json/runes.json +146 -0
  41. package/json/runeworduicategories.json +27 -0
  42. package/json/setitems.json +543 -0
  43. package/json/sets.json +108 -0
  44. package/json/skillcalc.json +140 -0
  45. package/json/skilldesc.json +7315 -6028
  46. package/json/skills.json +3445 -6
  47. package/json/sounds.json +83708 -63203
  48. package/json/states.json +298 -0
  49. package/json/tcprecalc.json +5759 -3396
  50. package/json/treasureclassex.json +4175 -1887
  51. package/json/treasureclassgroupsex.json +37 -0
  52. package/json/uniqueitems.json +1508 -391
  53. package/json/weapons.json +39 -60
  54. package/package.json +1 -1
package/compile.js CHANGED
@@ -46,7 +46,7 @@ const indexes = {
46
46
  inventory: 'class',
47
47
  itemstatcost: 'Stat',
48
48
  itemtypes: 'Code',
49
- levelgroups: 'Name',
49
+ levelgroups: 'LevelGroupId',
50
50
  levels: 'Id',
51
51
  lvlmaze: 'Level',
52
52
  lvlprest: 'Def',
@@ -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',
@@ -848,120 +851,33 @@ atomic.forEach((precalc, key) => {
848
851
  };
849
852
  });
850
853
 
851
- // Formulas and coefficients for the 6 item cap are from https://github.com/realmonster/diablo2_drop_calc
852
- // He did a lot of work figuring out the formulas that I don't care to replicate,
853
- // 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;
854
857
 
855
- // Adjust droprates for TCs with 7 picks for the 6 item cap.
856
- tcprecalc.forEach((basetc, basekey) => {
857
- if (full.treasureclassex[basekey] && full.treasureclassex[basekey].Picks === 7) {
858
- [1, 2, 3, 4, 5, 6, 7, 8].forEach(playerCount => {
859
- let newvalue = basetc.droprate[playerCount] * (7 - basetc.droprate[playerCount]**6) / 7;
860
- basetc.droprateRoot[playerCount] = newvalue;
861
- });
862
- } else {
863
- basetc.droprateRoot = Object.assign({}, basetc.droprate);
864
- }
865
- });
858
+ for (let subtc in tc.counts) {
859
+ total += tc.counts[subtc] * totalTC(subtc, debug);
860
+ }
866
861
 
867
- [
868
- "Duriel",
869
- "Duriel Desecrated A",
870
- "Duriel Desecrated B",
871
- "Duriel Desecrated C",
872
- "Duriel (N)",
873
- "Duriel (N) Desecrated A",
874
- "Duriel (N) Desecrated B",
875
- "Duriel (N) Desecrated C",
876
- "Duriel (H)",
877
- "Duriel (H) Desecrated A",
878
- "Duriel (H) Desecrated B",
879
- "Duriel (H) Desecrated C",
880
- "Duriel (H) Desecrated D",
881
- "Durielq",
882
- "Durielq (N)",
883
- "Durielq (H)",
884
- ].forEach(tcname => {
885
- for (let c = 1; c < 9; c++) {
886
- tcprecalc[tcname]['droprateRoot'][c] *= 5 / 11;
862
+ return Math.round(total * 1e15) / 1e15;
887
863
  }
888
- });
889
864
 
890
- tcprecalc.forEach(tc => {
891
- if (tc['counts']['Sunder Charms']) {
892
- delete tc['counts']['Sunder Charms'];
893
- }
894
- });
865
+ return 1;
866
+ }
895
867
 
896
- // Flatten and abstract countess rune TCs so we can adjust the drop rate of each via coefficient.
897
- //tcprecalc.forEach((tc, key) => {
898
- ({
899
- 'Countess Rune': tcprecalc['Countess Rune'],
900
- 'Countess Rune (N)': tcprecalc['Countess Rune (N)'],
901
- 'Countess Rune (H)': tcprecalc['Countess Rune (H)'],
902
- }).forEach((tc, baseName) => {
903
- function flattenAndAbstract (tcName, mult = 1, ret = {}) {
904
- if (tcprecalc[tcName]) {
905
- tcprecalc[tcName].counts.forEach((submult, subtcName) => {
906
- flattenAndAbstract(subtcName, mult * submult, ret);
907
- });
908
- } else {
909
- let newtcName = `${baseName} - ${tcName}`;
910
-
911
- if (!tcprecalc[newtcName]) {
912
- tcprecalc[newtcName] = {
913
- droprate: {
914
- 1: 1,
915
- 2: 1,
916
- 3: 1,
917
- 4: 1,
918
- 5: 1,
919
- 6: 1,
920
- 7: 1,
921
- 8: 1,
922
- },
923
- droprateRoot: {
924
- 1: 1,
925
- 2: 1,
926
- 3: 1,
927
- 4: 1,
928
- 5: 1,
929
- 6: 1,
930
- 7: 1,
931
- 8: 1,
932
- },
933
- counts: {
934
- [tcName]: 1,
935
- }
936
- };
937
- }
868
+ for (let key in tcprecalc) {
869
+ let debug = [], total = totalTC(key, debug), tc = tcprecalc[key];
938
870
 
939
- ret[newtcName] = ret[newtcName] || 0;
940
- ret[newtcName] += mult;
941
- }
871
+ tc.droprateRoot = {
872
+ ...tc.droprate,
873
+ };
942
874
 
943
- return ret;
875
+ if (total > 6) {
876
+ for (let exp in tc.droprateRoot) {
877
+ tc.droprateRoot[exp] = tc.droprateRoot[exp] * 6 / total;
944
878
  }
945
-
946
- tc.counts = flattenAndAbstract(baseName);
947
- });
948
- //});
949
-
950
- // Multiply the coefficients to the abstracted TCs
951
- ({
952
- '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"]}},
953
- '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"]}},
954
- '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"]}},
955
- }).forEach((data, baseName) => {
956
- [1, 2, 3, 4, 5, 6, 7, 8].forEach(players => {
957
- data[players].forEach((runes, value) => {
958
- value = Number(value);
959
- runes.forEach(runeName => {
960
- tcprecalc[baseName + ' - ' + runeName]['droprate'][players] *= value;
961
- });
962
- });
963
- });
964
- });
879
+ }
880
+ }
965
881
 
966
882
  files.forEach(fn => {
967
883
  fs.writeFileSync(outDir + fn + '.json', JSON.stringify(keySort(full[fn]), null, ' '));