use of provider.MapleDataFileEntry in project HeavenMS by ronancpl.
the class SkillFactory method loadAllSkills.
public static void loadAllSkills() {
final MapleDataDirectoryEntry root = datasource.getRoot();
int skillid;
for (MapleDataFileEntry topDir : root.getFiles()) {
// Loop thru jobs
if (topDir.getName().length() <= 8) {
for (MapleData data : datasource.getData(topDir.getName())) {
// Loop thru each jobs
if (data.getName().equals("skill")) {
for (MapleData data2 : data) {
// Loop thru each jobs
if (data2 != null) {
skillid = Integer.parseInt(data2.getName());
skills.put(skillid, loadFromData(skillid, data2));
}
}
}
}
}
}
}
use of provider.MapleDataFileEntry 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.MapleDataFileEntry in project HeavenMS by ronancpl.
the class DataTool method populateBossList.
private static void populateBossList() {
bosses = new HashSet<>();
MapleDataDirectoryEntry mob_data = data.getRoot();
for (MapleDataFileEntry mdfe : mob_data.getFiles()) {
MapleData boss_candidate = data.getData(mdfe.getName());
MapleData monsterInfoData = boss_candidate.getChildByPath("info");
int mid = Integer.valueOf(boss_candidate.getName().replaceAll("[^0-9]", ""));
boolean boss = MapleDataTool.getIntConvert("boss", monsterInfoData, 0) > 0 || mid == 8810018 || mid == 9410066;
if (boss) {
bosses.add(mid);
}
}
}
use of provider.MapleDataFileEntry in project HeavenMS by ronancpl.
the class WZFile method getOffsets.
private void getOffsets(MapleDataDirectoryEntry dir) {
for (MapleDataFileEntry file : dir.getFiles()) {
file.setOffset(cOffset);
cOffset += file.getSize();
}
for (MapleDataDirectoryEntry sdir : dir.getSubdirectories()) {
getOffsets(sdir);
}
}
use of provider.MapleDataFileEntry 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;
}
Aggregations