use of provider.MapleData in project HeavenMS by ronancpl.
the class MapleItemInformationProvider method noCancelMouse.
public boolean noCancelMouse(int itemId) {
if (noCancelMouseCache.containsKey(itemId)) {
return noCancelMouseCache.get(itemId);
}
MapleData item = getItemData(itemId);
if (item == null) {
noCancelMouseCache.put(itemId, false);
return false;
}
boolean blockMouse = MapleDataTool.getIntConvert("info/noCancelMouse", item, 0) == 1;
noCancelMouseCache.put(itemId, blockMouse);
return blockMouse;
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class MapleItemInformationProvider method getQuestIdFromItem.
public int getQuestIdFromItem(int itemId) {
MapleData data = getItemData(itemId);
int questItem = MapleDataTool.getIntConvert("info/quest", data, 0);
return questItem;
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class MapleItemInformationProvider method getEquipStats.
public Map<String, Integer> getEquipStats(int itemId) {
if (equipStatsCache.containsKey(itemId)) {
return equipStatsCache.get(itemId);
}
Map<String, Integer> ret = new LinkedHashMap<>();
MapleData item = getItemData(itemId);
if (item == null) {
return null;
}
MapleData info = item.getChildByPath("info");
if (info == null) {
return null;
}
for (MapleData data : info.getChildren()) {
if (data.getName().startsWith("inc")) {
ret.put(data.getName().substring(3), MapleDataTool.getIntConvert(data));
}
/*else if (data.getName().startsWith("req"))
ret.put(data.getName(), MapleDataTool.getInt(data.getName(), info, 0));*/
}
ret.put("reqJob", MapleDataTool.getInt("reqJob", info, 0));
ret.put("reqLevel", MapleDataTool.getInt("reqLevel", info, 0));
ret.put("reqDEX", MapleDataTool.getInt("reqDEX", info, 0));
ret.put("reqSTR", MapleDataTool.getInt("reqSTR", info, 0));
ret.put("reqINT", MapleDataTool.getInt("reqINT", info, 0));
ret.put("reqLUK", MapleDataTool.getInt("reqLUK", info, 0));
ret.put("reqPOP", MapleDataTool.getInt("reqPOP", info, 0));
ret.put("cash", MapleDataTool.getInt("cash", info, 0));
ret.put("tuc", MapleDataTool.getInt("tuc", info, 0));
ret.put("cursed", MapleDataTool.getInt("cursed", info, 0));
ret.put("success", MapleDataTool.getInt("success", info, 0));
ret.put("fs", MapleDataTool.getInt("fs", info, 0));
equipStatsCache.put(itemId, ret);
return ret;
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class MapleItemInformationProvider method getItemData.
private MapleData getItemData(int itemId) {
MapleData ret = null;
String idStr = "0" + String.valueOf(itemId);
MapleDataDirectoryEntry root = itemData.getRoot();
for (MapleDataDirectoryEntry topDir : root.getSubdirectories()) {
for (MapleDataFileEntry iFile : topDir.getFiles()) {
if (iFile.getName().equals(idStr.substring(0, 4) + ".img")) {
ret = itemData.getData(topDir.getName() + "/" + iFile.getName());
if (ret == null) {
return null;
}
ret = ret.getChildByPath(idStr);
return ret;
} else if (iFile.getName().equals(idStr.substring(1) + ".img")) {
return itemData.getData(topDir.getName() + "/" + iFile.getName());
}
}
}
root = equipData.getRoot();
for (MapleDataDirectoryEntry topDir : root.getSubdirectories()) {
for (MapleDataFileEntry iFile : topDir.getFiles()) {
if (iFile.getName().equals(idStr + ".img")) {
return equipData.getData(topDir.getName() + "/" + iFile.getName());
}
}
}
return ret;
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class MapleItemInformationProvider method getEquipmentSlot.
protected String getEquipmentSlot(int itemId) {
if (equipmentSlotCache.containsKey(itemId)) {
return equipmentSlotCache.get(itemId);
}
String ret = "";
MapleData item = getItemData(itemId);
if (item == null) {
return null;
}
MapleData info = item.getChildByPath("info");
if (info == null) {
return null;
}
ret = MapleDataTool.getString("islot", info, "");
equipmentSlotCache.put(itemId, ret);
return ret;
}
Aggregations