@blizzhackers/d2data 2.7.11 → 2.7.13
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/compile.js +127 -0
- package/docs/drops/dist/index.html +9 -23
- package/docs/drops.html +1 -1
- package/json/actprofile.json +1436 -0
- package/package.json +1 -1
package/compile.js
CHANGED
|
@@ -628,6 +628,132 @@ let monpopulation = {};
|
|
|
628
628
|
});
|
|
629
629
|
});
|
|
630
630
|
|
|
631
|
+
let actprofile = {};
|
|
632
|
+
let montypes = ['normal', 'champion', 'unique', 'superunique', 'boss'];
|
|
633
|
+
let dmgtypes = [
|
|
634
|
+
'ResDm',
|
|
635
|
+
'ResMa',
|
|
636
|
+
'ResFi',
|
|
637
|
+
'ResLi',
|
|
638
|
+
'ResCo',
|
|
639
|
+
'ResPo',
|
|
640
|
+
];
|
|
641
|
+
|
|
642
|
+
let requiredAreas = [ // Areas that we're forced to deal with through questing.
|
|
643
|
+
// Act 1
|
|
644
|
+
2,3,4,5,6,7,10,26,27,28,29,30,31,32,33,34,35,36,37,
|
|
645
|
+
// Act 2
|
|
646
|
+
41,42,43,44,45,46,50,51,52,53,54,56,57,58,60,61,62,63,64,66,67,68,69,70,71,72,73,74,
|
|
647
|
+
// Act 3
|
|
648
|
+
76,77,78,79,80,81,82,83,85,88,89,91,92,93,100,101,102,
|
|
649
|
+
// Act 4
|
|
650
|
+
104,105,106,107,108,
|
|
651
|
+
// Act 5
|
|
652
|
+
110,111,112,113,115,117,118,120,128,129,130,131,132
|
|
653
|
+
];
|
|
654
|
+
|
|
655
|
+
for (let diff of [0, 1, 2]) {
|
|
656
|
+
let s = str => str + ['', '(N)', '(H)'][diff];
|
|
657
|
+
|
|
658
|
+
for (let levelid in monpopulation) {
|
|
659
|
+
levelid = Number(levelid);
|
|
660
|
+
|
|
661
|
+
let level = full.levels[levelid];
|
|
662
|
+
let act = (level.Act || 0);
|
|
663
|
+
let pop = monpopulation[levelid];
|
|
664
|
+
|
|
665
|
+
if (levelid < 1 || levelid > 132) {
|
|
666
|
+
continue;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
let category = requiredAreas.indexOf(levelid) >= 0 ? 'required' : 'optional';
|
|
670
|
+
|
|
671
|
+
for (let montype of montypes) {
|
|
672
|
+
for (let id in pop[montype]) {
|
|
673
|
+
let sup = undefined,
|
|
674
|
+
mon = undefined;
|
|
675
|
+
|
|
676
|
+
if (montype === 'superunique') {
|
|
677
|
+
sup = full.superuniques[id];
|
|
678
|
+
mon = full.monstats[sup.Class];
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
mon = full.monstats[id];
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
let grp = Math.max(1, ((mon['MinGrp'] || 1) + (mon['MaxGrp'] || 1)) / 2),
|
|
685
|
+
party = ((mon['PartyMin'] || 0) + mon['PartyMax'] || 0) / 4,
|
|
686
|
+
minions = [
|
|
687
|
+
mon['minion1'] || undefined,
|
|
688
|
+
mon['minion2'] || undefined,
|
|
689
|
+
].filter(Boolean),
|
|
690
|
+
packCount = pop[montype][id][s('packCount')],
|
|
691
|
+
mlvl = pop[montype][id][s('mlvl')],
|
|
692
|
+
hp = full.monlvl[mlvl][s('HP')] *
|
|
693
|
+
(mon[['minHP', 'MinHP(N)', 'MinHP(H)'][diff]] + mon[['maxHP', 'MaxHP(N)', 'MaxHP(H)'][diff]]) / 200;
|
|
694
|
+
|
|
695
|
+
if ((montype === 'superunique' || montype === 'unique') && !minions.length) {
|
|
696
|
+
minions.push(mon.Id);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
actprofile[act] = actprofile[act] || {};
|
|
700
|
+
actprofile[act][category] = actprofile[act][category] || {};
|
|
701
|
+
|
|
702
|
+
for (let dmgtype of dmgtypes) {
|
|
703
|
+
actprofile[act][category][s(dmgtype)] = actprofile[act][category][s(dmgtype)] || {};
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
for (let dmgtype of dmgtypes) {
|
|
707
|
+
let resist = mon[s(dmgtype)] || 0;
|
|
708
|
+
|
|
709
|
+
actprofile[act][category][s(dmgtype)][resist] = actprofile[act][category][s(dmgtype)][resist] || 0;
|
|
710
|
+
|
|
711
|
+
if (montype === 'superunique' || montype === 'unique') {
|
|
712
|
+
if (montype === 'superunique') {
|
|
713
|
+
grp = Math.max(1, ((sup['MinGrp'] || mon['MinGrp'] || 1) + (sup['MaxGrp'] || mon['MaxGrp'] || 1)) / 2);
|
|
714
|
+
}
|
|
715
|
+
else {
|
|
716
|
+
grp = Math.max(1, ((mon['MinGrp'] || 1) + (mon['MaxGrp'] || 1)) / 2);
|
|
717
|
+
}
|
|
718
|
+
actprofile[act][category][s(dmgtype)][resist] += packCount * hp * [4, 3, 2][diff];
|
|
719
|
+
party = 2.5 + diff;
|
|
720
|
+
}
|
|
721
|
+
else if (montype === 'champion') {
|
|
722
|
+
actprofile[act][category][s(dmgtype)][resist] += packCount * hp * 3 * [3, 2.5, 2][diff];
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
actprofile[act][category][s(dmgtype)][resist] += packCount * hp * grp;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
if (party > 0 && minions.length > 0) {
|
|
729
|
+
for (let minion of minions) {
|
|
730
|
+
let mmon = full.monstats[minion],
|
|
731
|
+
mresist = mmon[s(dmgtype)] || 0,
|
|
732
|
+
mmlvl = (diff ? mmon['Level'] : level[s('MonLvl')]) + (montype === 'superunique' || montype === 'unique' ? 3 : 0),
|
|
733
|
+
mhp = full.monlvl[mmlvl][s('HP')] *
|
|
734
|
+
(mmon[['minHP', 'MinHP(N)', 'MinHP(H)'][diff]] + mmon[['maxHP', 'MaxHP(N)', 'MaxHP(H)'][diff]]) / 100;
|
|
735
|
+
|
|
736
|
+
actprofile[act][category][s(dmgtype)][mresist] = actprofile[act][category][s(dmgtype)][mresist] || 0;
|
|
737
|
+
actprofile[act][category][s(dmgtype)][mresist] += packCount * mhp * party / minions.length;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
(function roundValues (obj) {
|
|
747
|
+
for (let key in obj) {
|
|
748
|
+
if (typeof obj[key] === 'number') {
|
|
749
|
+
obj[key] = Math.round(obj[key]);
|
|
750
|
+
}
|
|
751
|
+
else if(typeof obj[key] === 'object') {
|
|
752
|
+
roundValues(obj[key]);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
})(actprofile);
|
|
756
|
+
|
|
631
757
|
let tcprecalc = {};
|
|
632
758
|
|
|
633
759
|
full.treasureclassex.forEach((tc, key) => {
|
|
@@ -780,3 +906,4 @@ fs.writeFileSync(outDir + 'atomic.json', JSON.stringify(keySort(atomic), null, '
|
|
|
780
906
|
fs.writeFileSync(outDir + 'treasureclassgroupsex.json', JSON.stringify(groupsEx, null, ' '));
|
|
781
907
|
fs.writeFileSync(outDir + 'monpopulationest.json', JSON.stringify(monpopulation, null, ' '));
|
|
782
908
|
fs.writeFileSync(outDir + 'tcprecalc.json', JSON.stringify(tcprecalc, null, ' '));
|
|
909
|
+
fs.writeFileSync(outDir + 'actprofile.json', JSON.stringify(actprofile, null, ' '));
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<body class="container my-5 bg-dark">
|
|
11
|
-
<div class="card">
|
|
12
|
-
<h1 class="card-header bg-primary text-light text-center">
|
|
13
|
-
Diablo 2 (D2R 2.4) Drop Calculator
|
|
14
|
-
</h1>
|
|
15
|
-
<div class="card-body">
|
|
16
|
-
<div id="app"></div>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="card-footer text-center">
|
|
19
|
-
<em>Powered by <a href="https://vuejs.org">Vue.js</a> and <a href="https://getbootstrap.com">Bootstrap 5</a>. Work in progress and based on reversing by r57shell and Kingpin, and verified by in-game drops.</em>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
</body>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Diablo 2 (D2R 2.4) Drop Calculator</title>
|
|
5
|
+
<meta http-equiv="refresh" content="0;url=https://blizzhackers.dev/#/dropfinder/" />
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<p>The drop calculator has moved! Redirecting to the new calculator...</p>
|
|
9
|
+
</body>
|
|
24
10
|
</html>
|
package/docs/drops.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<title>Diablo 2 (D2R 2.4) Drop Calculator</title>
|
|
5
|
-
<meta http-equiv="refresh" content="0;url=
|
|
5
|
+
<meta http-equiv="refresh" content="0;url=https://blizzhackers.dev/#/dropfinder/" />
|
|
6
6
|
</head>
|
|
7
7
|
<body>
|
|
8
8
|
<p>The drop calculator has moved! Redirecting to the new calculator...</p>
|