Gain infinite slots with clean slate scroll
P0nk opened this issue · comments
Crabo in #bug-report:
it's currently possible to get infinite slots with Clean Slate Scrolls (especially if someone removes boom chance from the item in the WZs), as the server does not check whether the used slots (item + X) and free slots together match the total number of slots (i.e. 7 for a weapon) + vicious hammer usages.
Here's a/the fix for use in ScrollHandler.java (I've left in the original check as a 2nd if)
if (ItemConstants.isCleanSlate(scroll.getItemId())) {
Map<String, Integer> eqStats = ii.getEquipStats(toScroll.getItemId());
int totalUpgradeCount = eqStats.get("tuc");
int freeUpgradeCount = toScroll.getUpgradeSlots();
int vicious = toScroll.getVicious();
int appliedScrollCount = toScroll.getLevel();
if ((freeUpgradeCount + appliedScrollCount) >= (totalUpgradeCount + vicious)) {
announceCannotScroll(c, legendarySpirit);
return;
}
if (eqStats == null || eqStats.get("tuc") == 0 ) {
announceCannotScroll(c, legendarySpirit);
return;
}
}