Extra MP gain & Expired pet patch

Fixed "extra MaxMP gain with INT accounting" being given to a leveled up character even when the flag USE_RANDOMIZE_HPMP_GAIN is set to false.
Solved an issue with pets upon expiration, that would render the pet no longer being able to be unequipped until WoL applied.
This commit is contained in:
ronancpl
2018-03-09 13:03:08 -03:00
parent 90ed45d1c3
commit 77234e29df
9 changed files with 100 additions and 35 deletions

View File

@@ -2308,23 +2308,29 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
item.setExpiration(-1);
forceUpdateItem(item); //TEST :3
} else if (expiration != -1 && expiration < currenttime) {
if(!ItemConstants.isPet(item.getItemId()) || ItemConstants.isExpirablePet(item.getItemId())) {
if(!ItemConstants.isPet(item.getItemId())) {
client.announce(MaplePacketCreator.itemExpired(item.getItemId()));
toberemove.add(item);
if(ItemConstants.isRateCoupon(item.getItemId())) {
deletedCoupon = true;
}
} else {
item.setExpiration(-1);
forceUpdateItem(item);
if(item.getPetId() > -1) {
int petIdx = getPetIndex(item.getPetId());
if(petIdx > -1) unequipPet(getPet(petIdx), true);
}
if(ItemConstants.isExpirablePet(item.getItemId())) {
client.announce(MaplePacketCreator.itemExpired(item.getItemId()));
toberemove.add(item);
} else {
item.setExpiration(-1);
forceUpdateItem(item);
}
}
}
}
for (Item item : toberemove) {
if(item.getPetId() > -1) {
int petIdx = getPetIndex(item.getPetId());
if(petIdx > -1) unequipPet(getPet(petIdx), true);
}
MapleInventoryManipulator.removeFromSlot(client, inv.getType(), item.getPosition(), item.getQuantity(), true);
}
toberemove.clear();
@@ -4880,7 +4886,15 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if (improvingMaxMPLevel > 0 && (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.CRUSADER) || job.isA(MapleJob.BLAZEWIZARD1))) {
maxmp += improvingMaxMP.getEffect(improvingMaxMPLevel).getX();
}
maxmp += localint_ / 10;
if (ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
maxmp += localint_ / 20;
} else {
maxmp += localint_ / 10;
}
}
if (takeexp) {
exp.addAndGet(-ExpTable.getExpNeededForLevel(level));
if (exp.get() < 0) {