Maker & Storage fetch Wz + Buff system & PS / HM patch + Pet Evolution

Storage now fetches transaction fees from the WZ.
Maker now pulls info about catalyzers from the WZ.
Fixed the enhanced buff system disappearing with some statsup when using multiple-statups items.
Fixed hired merchant now removing owner and visitors at expiration time.
Fixed some concurrent issues with player shops and hired merchants.
Fixed pet evolutions, now not only handing out not-expired pets but also refreshing the expire time as well.
Added item replace behaviour on the item expire system.
This commit is contained in:
ronancpl
2018-06-07 12:57:56 -03:00
parent ce74680953
commit cdac59326a
22 changed files with 486 additions and 262 deletions

View File

@@ -90,7 +90,7 @@ public class MakerProcessor {
} else {
if(ItemConstants.isEquipment(toCreate)) { // only equips uses stimulant and reagents
if(slea.readByte() != 0) { // stimulant
stimulantid = getMakerStimulant(toCreate);
stimulantid = ii.getMakerStimulant(toCreate);
if(!c.getAbstractPlayerInteraction().haveItem(stimulantid)) {
stimulantid = -1;
}
@@ -270,84 +270,6 @@ public class MakerProcessor {
}
}
private static int getMakerStimulant(int itemId) {
EquipType et = EquipType.getEquipTypeById(itemId);
switch(et) {
case GLOVES:
return 4130000;
case SHOES:
return 4130001;
case SWORD:
return 4130002;
case AXE:
return 4130003;
case MACE:
return 4130004;
case SWORD_2H:
return 4130005;
case AXE_2H:
return 4130006;
case MACE_2H:
return 4130007;
case SPEAR:
return 4130008;
case POLEARM:
return 4130009;
case WAND:
return 4130010;
case STAFF:
return 4130011;
case BOW:
return 4130012;
case CROSSBOW:
return 4130013;
case DAGGER:
return 4130014;
case CLAW:
return 4130015;
case KNUCKLER:
return 4130016;
case PISTOL:
return 4130017;
case CAP:
return 4130018;
case COAT:
return 4130019;
case PANTS:
return 4130020;
case LONGCOAT:
return 4130021;
case SHIELD:
return 4130022;
default:
return -1;
}
}
private static Pair<Integer, Integer> generateDisassemblyInfo(int itemId) {
int recvFee = ii.getMakerDisassembledFee(itemId);
if(recvFee > -1) {

View File

@@ -72,14 +72,15 @@ public class StorageProcessor {
c.announce(MaplePacketCreator.getStorageError((byte) 0x0C));
return;
}
if (chr.getMap().getId() == 910000000) {
if (chr.getMeso() < 1000) {
c.announce(MaplePacketCreator.getStorageError((byte) 0x0B));
return;
} else {
chr.gainMeso(-1000, false);
}
}
int takeoutFee = storage.getTakeOutFee();
if (chr.getMeso() < takeoutFee) {
c.announce(MaplePacketCreator.getStorageError((byte) 0x0B));
return;
} else {
chr.gainMeso(-takeoutFee, false);
}
if (MapleInventoryManipulator.checkSpace(c, item.getItemId(), item.getQuantity(), item.getOwner())) {
item = storage.takeOut(slot);//actually the same but idc
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
@@ -112,17 +113,19 @@ public class StorageProcessor {
c.announce(MaplePacketCreator.getStorageError((byte) 0x11));
return;
}
short meso = (short) (chr.getMap().getId() == 910000000 ? -500 : -100);
if (chr.getMeso() < meso) {
int storeFee = storage.getStoreFee();
if (chr.getMeso() < storeFee) {
c.announce(MaplePacketCreator.getStorageError((byte) 0x0B));
} else {
MapleInventoryType invType = ItemConstants.getInventoryType(itemId);
Item item = chr.getInventory(invType).getItem(slot).copy();
if (item.getItemId() == itemId && (item.getQuantity() >= quantity || ItemConstants.isRechargeable(itemId))) {
if (item != null && item.getItemId() == itemId && (item.getQuantity() >= quantity || ItemConstants.isRechargeable(itemId))) {
if (ItemConstants.isRechargeable(itemId)) {
quantity = item.getQuantity();
}
chr.gainMeso(meso, false, true, false);
chr.gainMeso(-storeFee, false, true, false);
MapleKarmaManipulator.toggleKarmaFlagToUntradeable(item);
MapleInventoryManipulator.removeFromSlot(c, invType, slot, quantity, false);
item.setQuantity(quantity);