Skip to content

Commit ac401bf

Browse files
author
Freddie
committed
"Handle" item bonus 49 and 52
1 parent 88f2a5e commit ac401bf

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

apps/frontend/enums/item-bonus-type.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export enum ItemBonusType {
3535
Unknown33 = 33,
3636
ItemBonusListGroupId = 34,
3737
ItemLimitCategoryId = 35,
38-
Unknown36 = 36,
38+
ItemLevelPvp = 36,
3939
ItemConversionId = 37,
4040
Unknown38 = 38,
4141
Unknown39 = 39,
@@ -44,4 +44,15 @@ export enum ItemBonusType {
4444
BaseItemLevel = 42,
4545
Unknown43 = 43,
4646
Unknown44 = 44,
47+
Unknown45 = 45,
48+
Unknown46 = 46,
49+
Unknown47 = 47,
50+
SquishCurve = 48,
51+
ScaleConfig = 49,
52+
Unknown50 = 50,
53+
Unknown51 = 51,
54+
ScaleCrafted = 52,
55+
PostSquishItemLevel = 53,
56+
Unknown54 = 54,
57+
Unknown55 = 55,
4758
}

apps/frontend/utils/items/apply-bonus-ids.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export function applyBonusIds(bonusIds: number[], { itemLevel, quality }: Props)
1010
const ret = {
1111
itemLevel: itemLevel || 0,
1212
quality: quality || 0,
13+
bonusStars: 0,
1314
};
1415

1516
for (const bonusId of bonusIds) {
@@ -25,9 +26,24 @@ export function applyBonusIds(bonusIds: number[], { itemLevel, quality }: Props)
2526
ret.quality = bonus[1];
2627
} else if (bonus[0] === ItemBonusType.BaseItemLevel) {
2728
ret.itemLevel = bonus[1];
29+
} else if (bonus[0] === ItemBonusType.ScaleConfig) {
30+
if (scaleConfigToItemLevel[bonus[1]]) {
31+
ret.itemLevel = scaleConfigToItemLevel[bonus[1]];
32+
}
33+
} else if (bonus[0] === ItemBonusType.ScaleCrafted) {
34+
// TODO: fix for non-profession items?
35+
if (bonus[2] === 2) {
36+
ret.itemLevel += bonus[1];
37+
ret.bonusStars = bonus[3];
38+
}
2839
}
2940
}
3041
}
3142

3243
return ret;
3344
}
45+
46+
// I don't want to deal with all of the item scaling dumps, hardcode it for now
47+
const scaleConfigToItemLevel: Record<number, number> = {
48+
266: 206,
49+
};

0 commit comments

Comments
 (0)