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
@@ -69,6 +69,7 @@ import java.sql.Connection;
import server.MakerItemFactory.MakerItemCreateEntry;
import server.life.MapleMonsterInformationProvider;
import server.life.MapleLifeFactory;
import tools.StringUtil;
/**
*
@@ -81,6 +82,7 @@ public class MapleItemInformationProvider {
protected MapleDataProvider itemData;
protected MapleDataProvider equipData;
protected MapleDataProvider stringData;
protected MapleDataProvider etcData;
protected MapleData cashStringData;
protected MapleData consumeStringData;
protected MapleData eqpStringData;
@@ -112,17 +114,20 @@ public class MapleItemInformationProvider {
protected Map<Integer, Boolean> consumeOnPickupCache = new HashMap<>();
protected Map<Integer, Boolean> isQuestItemCache = new HashMap<>();
protected Map<Integer, Boolean> isPartyQuestItemCache = new HashMap<>();
protected Map<Integer, Pair<Integer, String>> replaceOnExpireCache = new HashMap<>();
protected Map<Integer, String> equipmentSlotCache = new HashMap<>();
protected Map<Integer, Boolean> noCancelMouseCache = new HashMap<>();
protected Map<Integer, Integer> mobCrystalMakerCache = new HashMap<>();
protected Map<Integer, Pair<String, Integer>> statUpgradeMakerCache = new HashMap<>();
protected Map<Integer, MakerItemFactory.MakerItemCreateEntry> makerItemCache = new HashMap<>();
protected Map<Integer, Integer> makerCatalystCache = new HashMap<>();
private MapleItemInformationProvider() {
loadCardIdData();
itemData = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Item.wz"));
equipData = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Character.wz"));
stringData = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/String.wz"));
etcData = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Etc.wz"));
cashStringData = stringData.getData("Cash.img");
consumeStringData = stringData.getData("Consume.img");
eqpStringData = stringData.getData("Eqp.img");
@@ -515,6 +520,20 @@ public class MapleItemInformationProvider {
return retPrice;
}
public Pair<Integer, String> getReplaceOnExpire(int itemId) { // thanks to GabrielSin
if (replaceOnExpireCache.containsKey(itemId)) {
return replaceOnExpireCache.get(itemId);
}
int itemReplacement = MapleDataTool.getInt("info/replace/itemid", getItemData(itemId), 0);
String msg = MapleDataTool.getString("info/replace/msg", getItemData(itemId));
Pair<Integer, String> ret = new Pair<>(itemReplacement, msg);
replaceOnExpireCache.put(itemId, ret);
return ret;
}
protected String getEquipmentSlot(int itemId) {
if (equipmentSlotCache.containsKey(itemId)) {
return equipmentSlotCache.get(itemId);
@@ -1869,6 +1888,26 @@ public class MapleItemInformationProvider {
return fee;
}
public int getMakerStimulant(int itemId) { // thanks to Arnah
Integer itemid = makerCatalystCache.get(itemId);
if(itemid != null) {
return itemid;
}
itemid = -1;
for(MapleData md : etcData.getData("ItemMake.img").getChildren()) {
MapleData me = md.getChildByPath(StringUtil.getLeftPaddedStr(Integer.toString(itemId), '0', 8));
if(me != null) {
itemid = MapleDataTool.getInt(me.getChildByPath("catalyst"), -1);
break;
}
}
makerCatalystCache.put(itemId, itemid);
return itemid;
}
public Set<String> getWhoDrops(Integer itemId) {
Set<String> list = new HashSet<>();
Connection con = null;