More concurrency fixes + Zombify + BPQ available

Fixed some inconsistencies due to race conditions in the project, added
Zombify monster effect, made BPQ available and some minor patches.
This commit is contained in:
ronancpl
2017-04-09 14:23:23 -03:00
parent 7dc163fc76
commit 8c61c616f9
19 changed files with 321 additions and 115 deletions

View File

@@ -699,7 +699,8 @@ public class MapleStatEffect {
AutobanFactory.MPCON.addPoint(applyfrom.getAutobanManager(), "mpCon hack for skill:" + sourceid + "; Player MP: " + applyto.getMp() + " MP Needed: " + getMpCon());
} */
if (hpchange != 0) {
if (hpchange < 0 && (-hpchange) > applyto.getHp()) {
if (hpchange < 0 && (-hpchange) > applyto.getHp() && !applyto.hasDisease(MapleDisease.ZOMBIFY)) {
applyto.getClient().announce(MaplePacketCreator.enableActions());
return false;
}
int newHp = applyto.getHp() + hpchange;
@@ -712,6 +713,7 @@ public class MapleStatEffect {
int newMp = applyto.getMp() + mpchange;
if (mpchange != 0) {
if (mpchange < 0 && -mpchange > applyto.getMp()) {
applyto.getClient().announce(MaplePacketCreator.enableActions());
return false;
}
@@ -1037,12 +1039,18 @@ public class MapleStatEffect {
} else {
hpchange += hp;
}
} else {
if (applyfrom.hasDisease(MapleDisease.ZOMBIFY)) {
hpchange /= 2;
}
} else { // assumption: this is heal
hpchange += makeHealHP(hp / 100.0, applyfrom.getTotalMagic(), 3, 5);
if (applyfrom.hasDisease(MapleDisease.ZOMBIFY)) {
hpchange = -hpchange;
}
}
}
if (hpR != 0) {
hpchange += (int) (applyfrom.getCurrentMaxHp() * hpR);
hpchange += (int) (applyfrom.getCurrentMaxHp() * hpR) / (applyfrom.hasDisease(MapleDisease.ZOMBIFY) ? 2 : 1);
applyfrom.checkBerserk();
}
if (primary) {