Rename and clean up MapleData
This commit is contained in:
@@ -43,9 +43,9 @@ public class SkillFactory {
|
||||
final MapleDataDirectoryEntry root = datasource.getRoot();
|
||||
for (MapleDataFileEntry topDir : root.getFiles()) { // Loop thru jobs
|
||||
if (topDir.getName().length() <= 8) {
|
||||
for (MapleData data : datasource.getData(topDir.getName())) { // Loop thru each jobs
|
||||
for (Data data : datasource.getData(topDir.getName())) { // Loop thru each jobs
|
||||
if (data.getName().equals("skill")) {
|
||||
for (MapleData data2 : data) { // Loop thru each jobs
|
||||
for (Data data2 : data) { // Loop thru each jobs
|
||||
if (data2 != null) {
|
||||
int skillId = Integer.parseInt(data2.getName());
|
||||
loadedSkills.put(skillId, loadFromData(skillId, data2));
|
||||
@@ -59,7 +59,7 @@ public class SkillFactory {
|
||||
skills = loadedSkills;
|
||||
}
|
||||
|
||||
private static Skill loadFromData(int id, MapleData data) {
|
||||
private static Skill loadFromData(int id, Data data) {
|
||||
Skill ret = new Skill(id);
|
||||
boolean isBuff = false;
|
||||
int skillType = MapleDataTool.getInt("skillType", data, -1);
|
||||
@@ -69,13 +69,13 @@ public class SkillFactory {
|
||||
} else {
|
||||
ret.setElement(Element.NEUTRAL);
|
||||
}
|
||||
MapleData effect = data.getChildByPath("effect");
|
||||
Data effect = data.getChildByPath("effect");
|
||||
if (skillType != -1) {
|
||||
if (skillType == 2) {
|
||||
isBuff = true;
|
||||
}
|
||||
} else {
|
||||
MapleData action_ = data.getChildByPath("action");
|
||||
Data action_ = data.getChildByPath("action");
|
||||
boolean action = false;
|
||||
if (action_ == null) {
|
||||
if (data.getChildByPath("prepare/action") != null) {
|
||||
@@ -92,8 +92,8 @@ public class SkillFactory {
|
||||
action = true;
|
||||
}
|
||||
ret.setAction(action);
|
||||
MapleData hit = data.getChildByPath("hit");
|
||||
MapleData ball = data.getChildByPath("ball");
|
||||
Data hit = data.getChildByPath("hit");
|
||||
Data ball = data.getChildByPath("ball");
|
||||
isBuff = effect != null && hit == null && ball == null;
|
||||
isBuff |= action_ != null && MapleDataTool.getString("0", action_, "").equals("alert2");
|
||||
switch (id) {
|
||||
@@ -317,12 +317,12 @@ public class SkillFactory {
|
||||
}
|
||||
}
|
||||
|
||||
for (MapleData level : data.getChildByPath("level")) {
|
||||
for (Data level : data.getChildByPath("level")) {
|
||||
ret.addLevelEffect(MapleStatEffect.loadSkillEffectFromData(level, id, isBuff));
|
||||
}
|
||||
ret.setAnimationTime(0);
|
||||
if (effect != null) {
|
||||
for (MapleData effectEntry : effect) {
|
||||
for (Data effectEntry : effect) {
|
||||
ret.incAnimationTime(MapleDataTool.getIntConvert("delay", effectEntry, 0));
|
||||
}
|
||||
}
|
||||
@@ -330,7 +330,7 @@ public class SkillFactory {
|
||||
}
|
||||
|
||||
public static String getSkillName(int skillid) {
|
||||
MapleData data = MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img");
|
||||
Data data = MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img");
|
||||
StringBuilder skill = new StringBuilder();
|
||||
skill.append(skillid);
|
||||
if (skill.length() == 4) {
|
||||
@@ -338,7 +338,7 @@ public class SkillFactory {
|
||||
skill.append("000").append(skillid);
|
||||
}
|
||||
if (data.getChildByPath(skill.toString()) != null) {
|
||||
for (MapleData skilldata : data.getChildByPath(skill.toString()).getChildren()) {
|
||||
for (Data skilldata : data.getChildByPath(skill.toString()).getChildren()) {
|
||||
if (skilldata.getName().equals("name"))
|
||||
return MapleDataTool.getString(skilldata, null);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.command.Command;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.wz.WZFiles;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class MaxSkillCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
||||
for (Data skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
||||
try {
|
||||
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
||||
player.changeSkillLevel(skill, (byte) skill.getMaxLevel(), skill.getMaxLevel(), -1);
|
||||
|
||||
@@ -26,7 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.command.Command;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.wz.WZFiles;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ResetSkillCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
||||
for (Data skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
||||
try {
|
||||
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
||||
player.changeSkillLevel(skill, (byte) 0, skill.getMaxLevel(), -1);
|
||||
|
||||
@@ -26,7 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -36,10 +36,10 @@ import server.quest.MapleQuest;
|
||||
import tools.Pair;
|
||||
|
||||
public class SearchCommand extends Command {
|
||||
private static MapleData npcStringData;
|
||||
private static MapleData mobStringData;
|
||||
private static MapleData skillStringData;
|
||||
private static MapleData mapStringData;
|
||||
private static Data npcStringData;
|
||||
private static Data mobStringData;
|
||||
private static Data skillStringData;
|
||||
private static Data mapStringData;
|
||||
|
||||
{
|
||||
setDescription("Search String.wz.");
|
||||
@@ -62,7 +62,7 @@ public class SearchCommand extends Command {
|
||||
|
||||
String search = joinStringFrom(params,1);
|
||||
long start = System.currentTimeMillis();//for the lulz
|
||||
MapleData data = null;
|
||||
Data data = null;
|
||||
if (!params[0].equalsIgnoreCase("ITEM")) {
|
||||
int searchType = 0;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class SearchCommand extends Command {
|
||||
String name;
|
||||
|
||||
if (searchType == 0) {
|
||||
for (MapleData searchData : data.getChildren()) {
|
||||
for (Data searchData : data.getChildren()) {
|
||||
name = MapleDataTool.getString(searchData.getChildByPath("name"), "NO-NAME");
|
||||
if (name.toLowerCase().contains(search.toLowerCase())) {
|
||||
sb.append("#b").append(Integer.parseInt(searchData.getName())).append("#k - #r").append(name).append("\r\n");
|
||||
@@ -94,8 +94,8 @@ public class SearchCommand extends Command {
|
||||
} else if (searchType == 1) {
|
||||
String mapName, streetName;
|
||||
|
||||
for (MapleData searchDataDir : data.getChildren()) {
|
||||
for (MapleData searchData : searchDataDir.getChildren()) {
|
||||
for (Data searchDataDir : data.getChildren()) {
|
||||
for (Data searchData : searchDataDir.getChildren()) {
|
||||
mapName = MapleDataTool.getString(searchData.getChildByPath("mapName"), "NO-NAME");
|
||||
streetName = MapleDataTool.getString(searchData.getChildByPath("streetName"), "NO-NAME");
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
package client.inventory;
|
||||
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -47,7 +47,7 @@ public class PetDataFactory {
|
||||
synchronized (petCommands) {
|
||||
ret = petCommands.get(petId + "" + skillId);
|
||||
if (ret == null) {
|
||||
MapleData skillData = dataRoot.getData("Pet/" + petId + ".img");
|
||||
Data skillData = dataRoot.getData("Pet/" + petId + ".img");
|
||||
int prob = 0;
|
||||
int inc = 0;
|
||||
if (skillData != null) {
|
||||
|
||||
@@ -686,9 +686,9 @@ public class GameConstants {
|
||||
}
|
||||
|
||||
for (MapleDataFileEntry obj : objData.getFiles()) {
|
||||
for (MapleData l0 : mapSource.getData(objData.getName() + "/" + obj.getName()).getChildren()) {
|
||||
for (MapleData l1 : l0.getChildren()) {
|
||||
for (MapleData l2 : l1.getChildren()) {
|
||||
for (Data l0 : mapSource.getData(objData.getName() + "/" + obj.getName()).getChildren()) {
|
||||
for (Data l1 : l0.getChildren()) {
|
||||
for (Data l2 : l1.getChildren()) {
|
||||
int objDmg = MapleDataTool.getIntConvert("s1/mobdamage", l2, 0);
|
||||
if (maxMobDmg < objDmg) {
|
||||
maxMobDmg = objDmg;
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.server.audit.locks.factory.MonitoredWriteLockFactory;
|
||||
import net.server.coordinator.world.InviteCoordinator;
|
||||
import net.server.coordinator.world.InviteCoordinator.InviteType;
|
||||
import net.server.world.Party;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
import provider.wz.WZFiles;
|
||||
@@ -67,15 +67,15 @@ public class PartySearchCoordinator {
|
||||
private static Map<Integer, Set<Integer>> fetchNeighbouringMaps() {
|
||||
Map<Integer, Set<Integer>> mapLinks = new HashMap<>();
|
||||
|
||||
MapleData data = MapleDataProviderFactory.getDataProvider(WZFiles.ETC).getData("MapNeighbors.img");
|
||||
Data data = MapleDataProviderFactory.getDataProvider(WZFiles.ETC).getData("MapNeighbors.img");
|
||||
if (data != null) {
|
||||
for (MapleData mapdata : data.getChildren()) {
|
||||
for (Data mapdata : data.getChildren()) {
|
||||
int mapid = Integer.parseInt(mapdata.getName());
|
||||
|
||||
Set<Integer> neighborMaps = new HashSet<>();
|
||||
mapLinks.put(mapid, neighborMaps);
|
||||
|
||||
for (MapleData neighbordata : mapdata.getChildren()) {
|
||||
for (Data neighbordata : mapdata.getChildren()) {
|
||||
int neighborid = MapleDataTool.getInt(neighbordata, 999999999);
|
||||
|
||||
if (neighborid != 999999999) {
|
||||
|
||||
@@ -25,11 +25,11 @@ import provider.wz.DataType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MapleData extends MapleDataEntity, Iterable<MapleData> {
|
||||
public interface Data extends MapleDataEntity, Iterable<Data> {
|
||||
@Override
|
||||
String getName();
|
||||
DataType getType();
|
||||
List<MapleData> getChildren();
|
||||
MapleData getChildByPath(String path);
|
||||
List<Data> getChildren();
|
||||
Data getChildByPath(String path);
|
||||
Object getData();
|
||||
}
|
||||
@@ -22,6 +22,6 @@
|
||||
package provider;
|
||||
|
||||
public interface MapleDataProvider {
|
||||
MapleData getData(String path);
|
||||
Data getData(String path);
|
||||
MapleDataDirectoryEntry getRoot();
|
||||
}
|
||||
|
||||
@@ -26,11 +26,11 @@ import provider.wz.DataType;
|
||||
import java.awt.*;
|
||||
|
||||
public class MapleDataTool {
|
||||
public static String getString(MapleData data) {
|
||||
public static String getString(Data data) {
|
||||
return ((String) data.getData());
|
||||
}
|
||||
|
||||
public static String getString(MapleData data, String def) {
|
||||
public static String getString(Data data, String def) {
|
||||
if (data == null || data.getData() == null) {
|
||||
return def;
|
||||
} else {
|
||||
@@ -38,34 +38,34 @@ public class MapleDataTool {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getString(String path, MapleData data) {
|
||||
public static String getString(String path, Data data) {
|
||||
return getString(data.getChildByPath(path));
|
||||
}
|
||||
|
||||
public static String getString(String path, MapleData data, String def) {
|
||||
public static String getString(String path, Data data, String def) {
|
||||
return getString(data.getChildByPath(path), def);
|
||||
}
|
||||
|
||||
public static double getDouble(MapleData data) {
|
||||
public static double getDouble(Data data) {
|
||||
return (Double) data.getData();
|
||||
}
|
||||
|
||||
public static float getFloat(MapleData data) {
|
||||
public static float getFloat(Data data) {
|
||||
return (Float) data.getData();
|
||||
}
|
||||
|
||||
public static int getInt(MapleData data) {
|
||||
public static int getInt(Data data) {
|
||||
if (data == null || data.getData() == null) {
|
||||
return 0;// DEF?
|
||||
}
|
||||
return (Integer) data.getData();
|
||||
}
|
||||
|
||||
public static int getInt(String path, MapleData data) {
|
||||
public static int getInt(String path, Data data) {
|
||||
return getInt(data.getChildByPath(path));
|
||||
}
|
||||
|
||||
public static int getIntConvert(MapleData data) {
|
||||
public static int getIntConvert(Data data) {
|
||||
if (data.getType() == DataType.STRING) {
|
||||
return Integer.parseInt(getString(data));
|
||||
} else {
|
||||
@@ -73,7 +73,7 @@ public class MapleDataTool {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getIntConvert(MapleData data, int def) {
|
||||
public static int getIntConvert(Data data, int def) {
|
||||
if (data == null) {
|
||||
return def;
|
||||
}
|
||||
@@ -92,8 +92,8 @@ public class MapleDataTool {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getIntConvert(String path, MapleData data) {
|
||||
MapleData d = data.getChildByPath(path);
|
||||
public static int getIntConvert(String path, Data data) {
|
||||
Data d = data.getChildByPath(path);
|
||||
if (d.getType() == DataType.STRING) {
|
||||
return Integer.parseInt(getString(d));
|
||||
} else {
|
||||
@@ -101,7 +101,7 @@ public class MapleDataTool {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getInt(MapleData data, int def) {
|
||||
public static int getInt(Data data, int def) {
|
||||
if (data == null || data.getData() == null) {
|
||||
return def;
|
||||
} else if (data.getType() == DataType.STRING) {
|
||||
@@ -116,12 +116,12 @@ public class MapleDataTool {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getInt(String path, MapleData data, int def) {
|
||||
public static int getInt(String path, Data data, int def) {
|
||||
return getInt(data.getChildByPath(path), def);
|
||||
}
|
||||
|
||||
public static int getIntConvert(String path, MapleData data, int def) {
|
||||
MapleData d = data.getChildByPath(path);
|
||||
public static int getIntConvert(String path, Data data, int def) {
|
||||
Data d = data.getChildByPath(path);
|
||||
if (d == null) {
|
||||
return def;
|
||||
}
|
||||
@@ -137,23 +137,23 @@ public class MapleDataTool {
|
||||
}
|
||||
}
|
||||
|
||||
public static Point getPoint(MapleData data) {
|
||||
public static Point getPoint(Data data) {
|
||||
return ((Point) data.getData());
|
||||
}
|
||||
|
||||
public static Point getPoint(String path, MapleData data) {
|
||||
public static Point getPoint(String path, Data data) {
|
||||
return getPoint(data.getChildByPath(path));
|
||||
}
|
||||
|
||||
public static Point getPoint(String path, MapleData data, Point def) {
|
||||
final MapleData pointData = data.getChildByPath(path);
|
||||
public static Point getPoint(String path, Data data, Point def) {
|
||||
final Data pointData = data.getChildByPath(path);
|
||||
if (pointData == null) {
|
||||
return def;
|
||||
}
|
||||
return getPoint(pointData);
|
||||
}
|
||||
|
||||
public static String getFullDataPath(MapleData data) {
|
||||
public static String getFullDataPath(Data data) {
|
||||
String path = "";
|
||||
MapleDataEntity myData = data;
|
||||
while (myData != null) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.SAXException;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataEntity;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
@@ -41,7 +41,7 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class XMLDomMapleData implements MapleData {
|
||||
public class XMLDomMapleData implements Data {
|
||||
private Node node;
|
||||
private File imageDataDir;
|
||||
|
||||
@@ -66,10 +66,10 @@ public class XMLDomMapleData implements MapleData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized MapleData getChildByPath(String path) { // the whole XML reading system seems susceptible to give nulls on strenuous read scenarios
|
||||
public synchronized Data getChildByPath(String path) { // the whole XML reading system seems susceptible to give nulls on strenuous read scenarios
|
||||
String[] segments = path.split("/");
|
||||
if (segments[0].equals("..")) {
|
||||
return ((MapleData) getParent()).getChildByPath(path.substring(path.indexOf("/") + 1));
|
||||
return ((Data) getParent()).getChildByPath(path.substring(path.indexOf("/") + 1));
|
||||
}
|
||||
|
||||
Node myNode;
|
||||
@@ -96,8 +96,8 @@ public class XMLDomMapleData implements MapleData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized List<MapleData> getChildren() {
|
||||
List<MapleData> ret = new ArrayList<>();
|
||||
public synchronized List<Data> getChildren() {
|
||||
List<Data> ret = new ArrayList<>();
|
||||
|
||||
NodeList childNodes = node.getChildNodes();
|
||||
for (int i = 0; i < childNodes.getLength(); i++) {
|
||||
@@ -203,7 +203,7 @@ public class XMLDomMapleData implements MapleData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Iterator<MapleData> iterator() {
|
||||
public synchronized Iterator<Data> iterator() {
|
||||
return getChildren().iterator();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,14 @@
|
||||
*/
|
||||
package provider.wz;
|
||||
|
||||
import provider.Data;
|
||||
import provider.MapleDataDirectoryEntry;
|
||||
import provider.MapleDataProvider;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataDirectoryEntry;
|
||||
import provider.MapleDataProvider;
|
||||
|
||||
public class XMLWZFile implements MapleDataProvider {
|
||||
private File root;
|
||||
@@ -53,7 +54,7 @@ public class XMLWZFile implements MapleDataProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized MapleData getData(String path) {
|
||||
public synchronized Data getData(String path) {
|
||||
File dataFile = new File(root, path + ".xml");
|
||||
File imageDataDir = new File(root, path);
|
||||
if (!dataFile.exists()) {
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.server.guild.Guild;
|
||||
import net.server.guild.GuildPackets;
|
||||
import net.server.world.Party;
|
||||
import net.server.world.PartyCharacter;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.wz.WZFiles;
|
||||
import scripting.AbstractPlayerInteraction;
|
||||
@@ -384,7 +384,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
}
|
||||
|
||||
public void maxMastery() {
|
||||
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
||||
for (Data skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
||||
try {
|
||||
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
||||
getPlayer().changeSkillLevel(skill, (byte) 0, skill.getMaxLevel(), -1);
|
||||
|
||||
@@ -27,7 +27,7 @@ import constants.inventory.ItemConstants;
|
||||
import net.server.Server;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -153,7 +153,7 @@ public class CashShop {
|
||||
|
||||
Map<Integer, CashItem> loadedItems = new HashMap<>();
|
||||
List<Integer> onSaleItems = new ArrayList<>();
|
||||
for (MapleData item : etc.getData("Commodity.img").getChildren()) {
|
||||
for (Data item : etc.getData("Commodity.img").getChildren()) {
|
||||
int sn = MapleDataTool.getIntConvert("SN", item);
|
||||
int itemId = MapleDataTool.getIntConvert("ItemId", item);
|
||||
int price = MapleDataTool.getIntConvert("Price", item, 0);
|
||||
@@ -170,10 +170,10 @@ public class CashShop {
|
||||
CashItemFactory.randomitemsns = onSaleItems;
|
||||
|
||||
Map<Integer, List<Integer>> loadedPackages = new HashMap<>();
|
||||
for (MapleData cashPackage : etc.getData("CashPackage.img").getChildren()) {
|
||||
for (Data cashPackage : etc.getData("CashPackage.img").getChildren()) {
|
||||
List<Integer> cPackage = new ArrayList<>();
|
||||
|
||||
for (MapleData item : cashPackage.getChildByPath("SN").getChildren()) {
|
||||
for (Data item : cashPackage.getChildByPath("SN").getChildren()) {
|
||||
cPackage.add(Integer.parseInt(item.getData().toString()));
|
||||
}
|
||||
|
||||
|
||||
@@ -62,17 +62,17 @@ public class MapleItemInformationProvider {
|
||||
protected MapleDataProvider equipData;
|
||||
protected MapleDataProvider stringData;
|
||||
protected MapleDataProvider etcData;
|
||||
protected MapleData cashStringData;
|
||||
protected MapleData consumeStringData;
|
||||
protected MapleData eqpStringData;
|
||||
protected MapleData etcStringData;
|
||||
protected MapleData insStringData;
|
||||
protected MapleData petStringData;
|
||||
protected Data cashStringData;
|
||||
protected Data consumeStringData;
|
||||
protected Data eqpStringData;
|
||||
protected Data etcStringData;
|
||||
protected Data insStringData;
|
||||
protected Data petStringData;
|
||||
protected Map<Integer, Short> slotMaxCache = new HashMap<>();
|
||||
protected Map<Integer, MapleStatEffect> itemEffects = new HashMap<>();
|
||||
protected Map<Integer, Map<String, Integer>> equipStatsCache = new HashMap<>();
|
||||
protected Map<Integer, Equip> equipCache = new HashMap<>();
|
||||
protected Map<Integer, MapleData> equipLevelInfoCache = new HashMap<>();
|
||||
protected Map<Integer, Data> equipLevelInfoCache = new HashMap<>();
|
||||
protected Map<Integer, Integer> equipLevelReqCache = new HashMap<>();
|
||||
protected Map<Integer, Integer> equipMaxLevelCache = new HashMap<>();
|
||||
protected Map<Integer, List<Integer>> scrollReqsCache = new HashMap<>();
|
||||
@@ -111,7 +111,7 @@ public class MapleItemInformationProvider {
|
||||
protected Map<Integer, MakerItemFactory.MakerItemCreateEntry> makerItemCache = new HashMap<>();
|
||||
protected Map<Integer, Integer> makerCatalystCache = new HashMap<>();
|
||||
protected Map<Integer, Map<String, Integer>> skillUpgradeCache = new HashMap<>();
|
||||
protected Map<Integer, MapleData> skillUpgradeInfoCache = new HashMap<>();
|
||||
protected Map<Integer, Data> skillUpgradeInfoCache = new HashMap<>();
|
||||
protected Map<Integer, Pair<Integer, Set<Integer>>> cashPetFoodCache = new HashMap<>();
|
||||
protected Map<Integer, QuestConsItem> questItemConsCache = new HashMap<>();
|
||||
|
||||
@@ -138,31 +138,31 @@ public class MapleItemInformationProvider {
|
||||
return itemNameCache;
|
||||
}
|
||||
List<Pair<Integer, String>> itemPairs = new ArrayList<>();
|
||||
MapleData itemsData;
|
||||
Data itemsData;
|
||||
itemsData = stringData.getData("Cash.img");
|
||||
for (MapleData itemFolder : itemsData.getChildren()) {
|
||||
for (Data itemFolder : itemsData.getChildren()) {
|
||||
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
|
||||
}
|
||||
itemsData = stringData.getData("Consume.img");
|
||||
for (MapleData itemFolder : itemsData.getChildren()) {
|
||||
for (Data itemFolder : itemsData.getChildren()) {
|
||||
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
|
||||
}
|
||||
itemsData = stringData.getData("Eqp.img").getChildByPath("Eqp");
|
||||
for (MapleData eqpType : itemsData.getChildren()) {
|
||||
for (MapleData itemFolder : eqpType.getChildren()) {
|
||||
for (Data eqpType : itemsData.getChildren()) {
|
||||
for (Data itemFolder : eqpType.getChildren()) {
|
||||
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
|
||||
}
|
||||
}
|
||||
itemsData = stringData.getData("Etc.img").getChildByPath("Etc");
|
||||
for (MapleData itemFolder : itemsData.getChildren()) {
|
||||
for (Data itemFolder : itemsData.getChildren()) {
|
||||
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
|
||||
}
|
||||
itemsData = stringData.getData("Ins.img");
|
||||
for (MapleData itemFolder : itemsData.getChildren()) {
|
||||
for (Data itemFolder : itemsData.getChildren()) {
|
||||
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
|
||||
}
|
||||
itemsData = stringData.getData("Pet.img");
|
||||
for (MapleData itemFolder : itemsData.getChildren()) {
|
||||
for (Data itemFolder : itemsData.getChildren()) {
|
||||
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
|
||||
}
|
||||
return itemPairs;
|
||||
@@ -174,18 +174,18 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
List<Pair<Integer, String>> itemPairs = new ArrayList<>();
|
||||
MapleData itemsData;
|
||||
Data itemsData;
|
||||
|
||||
itemsData = stringData.getData("Etc.img").getChildByPath("Etc");
|
||||
for (MapleData itemFolder : itemsData.getChildren()) {
|
||||
for (Data itemFolder : itemsData.getChildren()) {
|
||||
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
|
||||
}
|
||||
return itemPairs;
|
||||
}
|
||||
|
||||
private MapleData getStringData(int itemId) {
|
||||
private Data getStringData(int itemId) {
|
||||
String cat = "null";
|
||||
MapleData theData;
|
||||
Data theData;
|
||||
if (itemId >= 5010000) {
|
||||
theData = cashStringData;
|
||||
} else if (itemId >= 2000000 && itemId < 3000000) {
|
||||
@@ -257,7 +257,7 @@ public class MapleItemInformationProvider {
|
||||
return noCancelMouseCache.get(itemId);
|
||||
}
|
||||
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
if (item == null) {
|
||||
noCancelMouseCache.put(itemId, false);
|
||||
return false;
|
||||
@@ -268,8 +268,8 @@ public class MapleItemInformationProvider {
|
||||
return blockMouse;
|
||||
}
|
||||
|
||||
private MapleData getItemData(int itemId) {
|
||||
MapleData ret = null;
|
||||
private Data getItemData(int itemId) {
|
||||
Data ret = null;
|
||||
String idStr = "0" + String.valueOf(itemId);
|
||||
MapleDataDirectoryEntry root = itemData.getRoot();
|
||||
for (MapleDataDirectoryEntry topDir : root.getSubdirectories()) {
|
||||
@@ -342,9 +342,9 @@ public class MapleItemInformationProvider {
|
||||
return (short)(slotMax + getExtraSlotMaxFromPlayer(c, itemId));
|
||||
}
|
||||
short ret = 0;
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
if (item != null) {
|
||||
MapleData smEntry = item.getChildByPath("info/slotMax");
|
||||
Data smEntry = item.getChildByPath("info/slotMax");
|
||||
if (smEntry == null) {
|
||||
if (ItemConstants.getInventoryType(itemId).getType() == InventoryType.EQUIP.getType()) {
|
||||
ret = 1;
|
||||
@@ -364,12 +364,12 @@ public class MapleItemInformationProvider {
|
||||
if (getMesoCache.containsKey(itemId)) {
|
||||
return getMesoCache.get(itemId);
|
||||
}
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
if (item == null) {
|
||||
return -1;
|
||||
}
|
||||
int pEntry;
|
||||
MapleData pData = item.getChildByPath("info/meso");
|
||||
Data pData = item.getChildByPath("info/meso");
|
||||
if (pData == null) {
|
||||
return -1;
|
||||
}
|
||||
@@ -414,7 +414,7 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
private Pair<Integer, Double> getItemPriceData(int itemId) {
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
if (item == null) {
|
||||
wholePriceCache.put(itemId, -1);
|
||||
unitPriceCache.put(itemId, 0.0);
|
||||
@@ -422,7 +422,7 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
int pEntry = -1;
|
||||
MapleData pData = item.getChildByPath("info/price");
|
||||
Data pData = item.getChildByPath("info/price");
|
||||
if (pData != null) {
|
||||
pEntry = MapleDataTool.getInt(pData);
|
||||
}
|
||||
@@ -478,7 +478,7 @@ public class MapleItemInformationProvider {
|
||||
return replaceOnExpireCache.get(itemId);
|
||||
}
|
||||
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
int itemReplacement = MapleDataTool.getInt("info/replace/itemid", data, 0);
|
||||
String msg = MapleDataTool.getString("info/replace/msg", data, "");
|
||||
|
||||
@@ -495,13 +495,13 @@ public class MapleItemInformationProvider {
|
||||
|
||||
String ret = "";
|
||||
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
|
||||
if (item == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MapleData info = item.getChildByPath("info");
|
||||
Data info = item.getChildByPath("info");
|
||||
|
||||
if (info == null) {
|
||||
return null;
|
||||
@@ -519,15 +519,15 @@ public class MapleItemInformationProvider {
|
||||
return equipStatsCache.get(itemId);
|
||||
}
|
||||
Map<String, Integer> ret = new LinkedHashMap<>();
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
if (item == null) {
|
||||
return null;
|
||||
}
|
||||
MapleData info = item.getChildByPath("info");
|
||||
Data info = item.getChildByPath("info");
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
for (MapleData data : info.getChildren()) {
|
||||
for (Data data : info.getChildren()) {
|
||||
if (data.getName().startsWith("inc")) {
|
||||
ret.put(data.getName().substring(3), MapleDataTool.getIntConvert(data));
|
||||
}
|
||||
@@ -556,9 +556,9 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
if (item != null) {
|
||||
MapleData info = item.getChildByPath("info");
|
||||
Data info = item.getChildByPath("info");
|
||||
if (info != null) {
|
||||
ret = MapleDataTool.getInt("reqLevel", info, 0);
|
||||
}
|
||||
@@ -574,10 +574,10 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
List<Integer> ret = new ArrayList<>();
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
data = data.getChildByPath("req");
|
||||
if (data != null) {
|
||||
for (MapleData req : data.getChildren()) {
|
||||
for (Data req : data.getChildren()) {
|
||||
ret.add(MapleDataTool.getInt(req));
|
||||
}
|
||||
}
|
||||
@@ -1138,11 +1138,11 @@ public class MapleItemInformationProvider {
|
||||
public MapleStatEffect getItemEffect(int itemId) {
|
||||
MapleStatEffect ret = itemEffects.get(Integer.valueOf(itemId));
|
||||
if (ret == null) {
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
if (item == null) {
|
||||
return null;
|
||||
}
|
||||
MapleData spec = item.getChildByPath("specEx");
|
||||
Data spec = item.getChildByPath("specEx");
|
||||
if (spec == null) {
|
||||
spec = item.getChildByPath("spec");
|
||||
}
|
||||
@@ -1153,7 +1153,7 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
public int[][] getSummonMobs(int itemId) {
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
int theInt = data.getChildByPath("mob").getChildren().size();
|
||||
int[][] mobs2spawn = new int[theInt][2];
|
||||
for (int x = 0; x < theInt; x++) {
|
||||
@@ -1168,7 +1168,7 @@ public class MapleItemInformationProvider {
|
||||
if (atk != null) {
|
||||
return atk.intValue();
|
||||
}
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
atk = Integer.valueOf(MapleDataTool.getInt("info/incPAD", data, 0));
|
||||
projectileWatkCache.put(itemId, atk);
|
||||
return atk.intValue();
|
||||
@@ -1178,7 +1178,7 @@ public class MapleItemInformationProvider {
|
||||
if (nameCache.containsKey(itemId)) {
|
||||
return nameCache.get(itemId);
|
||||
}
|
||||
MapleData strings = getStringData(itemId);
|
||||
Data strings = getStringData(itemId);
|
||||
if (strings == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -1191,7 +1191,7 @@ public class MapleItemInformationProvider {
|
||||
if (msgCache.containsKey(itemId)) {
|
||||
return msgCache.get(itemId);
|
||||
}
|
||||
MapleData strings = getStringData(itemId);
|
||||
Data strings = getStringData(itemId);
|
||||
if (strings == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -1207,7 +1207,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
boolean bRestricted = false;
|
||||
if(itemId != 0) {
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
if (data != null) {
|
||||
bRestricted = MapleDataTool.getIntConvert("info/tradeBlock", data, 0) == 1;
|
||||
}
|
||||
@@ -1224,7 +1224,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
boolean bRestricted = false;
|
||||
if(itemId != 0) {
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
if (data != null) {
|
||||
bRestricted = MapleDataTool.getIntConvert("info/accountSharable", data, 0) == 1;
|
||||
}
|
||||
@@ -1241,7 +1241,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
boolean bRestricted = false;
|
||||
if(itemId != 0) {
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
if (data != null) {
|
||||
bRestricted = MapleDataTool.getIntConvert("info/tradeBlock", data, 0) == 1;
|
||||
if (!bRestricted) {
|
||||
@@ -1265,7 +1265,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
boolean bRestricted = false;
|
||||
if(itemId != 0) {
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
if (data != null) {
|
||||
bRestricted = MapleDataTool.getIntConvert("info/only", data, 0) == 1;
|
||||
}
|
||||
@@ -1275,19 +1275,19 @@ public class MapleItemInformationProvider {
|
||||
return bRestricted;
|
||||
}
|
||||
|
||||
private Pair<Map<String, Integer>, MapleData> getSkillStatsInternal(int itemId) {
|
||||
private Pair<Map<String, Integer>, Data> getSkillStatsInternal(int itemId) {
|
||||
Map<String, Integer> ret = skillUpgradeCache.get(itemId);
|
||||
MapleData retSkill = skillUpgradeInfoCache.get(itemId);
|
||||
Data retSkill = skillUpgradeInfoCache.get(itemId);
|
||||
|
||||
if(ret != null) return new Pair<>(ret, retSkill);
|
||||
|
||||
retSkill = null;
|
||||
ret = new LinkedHashMap<>();
|
||||
MapleData item = getItemData(itemId);
|
||||
Data item = getItemData(itemId);
|
||||
if (item != null) {
|
||||
MapleData info = item.getChildByPath("info");
|
||||
Data info = item.getChildByPath("info");
|
||||
if (info != null) {
|
||||
for (MapleData data : info.getChildren()) {
|
||||
for (Data data : info.getChildren()) {
|
||||
if (data.getName().startsWith("inc")) {
|
||||
ret.put(data.getName().substring(3), MapleDataTool.getIntConvert(data));
|
||||
}
|
||||
@@ -1306,11 +1306,11 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
public Map<String, Integer> getSkillStats(int itemId, double playerJob) {
|
||||
Pair<Map<String, Integer>, MapleData> retData = getSkillStatsInternal(itemId);
|
||||
Pair<Map<String, Integer>, Data> retData = getSkillStatsInternal(itemId);
|
||||
if(retData.getLeft().isEmpty()) return null;
|
||||
|
||||
Map<String, Integer> ret = new LinkedHashMap<>(retData.getLeft());
|
||||
MapleData skill = retData.getRight();
|
||||
Data skill = retData.getRight();
|
||||
int curskill;
|
||||
for (int i = 0; i < skill.getChildren().size(); i++) {
|
||||
curskill = MapleDataTool.getInt(Integer.toString(i), skill, 0);
|
||||
@@ -1335,10 +1335,10 @@ public class MapleItemInformationProvider {
|
||||
Set<Integer> pets = new HashSet<>(4);
|
||||
int inc = 1;
|
||||
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
if(data != null) {
|
||||
MapleData specData = data.getChildByPath("spec");
|
||||
for(MapleData specItem : specData.getChildren()) {
|
||||
Data specData = data.getChildByPath("spec");
|
||||
for(Data specItem : specData.getChildren()) {
|
||||
String itemName = specItem.getName();
|
||||
|
||||
try {
|
||||
@@ -1365,7 +1365,7 @@ public class MapleItemInformationProvider {
|
||||
if (isQuestItemCache.containsKey(itemId)) {
|
||||
return isQuestItemCache.get(itemId);
|
||||
}
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
boolean questItem = (data != null && MapleDataTool.getIntConvert("info/quest", data, 0) == 1);
|
||||
isQuestItemCache.put(itemId, questItem);
|
||||
return questItem;
|
||||
@@ -1375,7 +1375,7 @@ public class MapleItemInformationProvider {
|
||||
if (isPartyQuestItemCache.containsKey(itemId)) {
|
||||
return isPartyQuestItemCache.get(itemId);
|
||||
}
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
boolean partyquestItem = (data != null && MapleDataTool.getIntConvert("info/pquest", data, 0) == 1);
|
||||
isPartyQuestItemCache.put(itemId, partyquestItem);
|
||||
return partyquestItem;
|
||||
@@ -1413,7 +1413,7 @@ public class MapleItemInformationProvider {
|
||||
if ((itemId / 10000) != 243) {
|
||||
return null;
|
||||
}
|
||||
MapleData itemInfo = getItemData(itemId);
|
||||
Data itemInfo = getItemData(itemId);
|
||||
ScriptedItem script = new ScriptedItem(MapleDataTool.getInt("spec/npc", itemInfo, 0),
|
||||
MapleDataTool.getString("spec/script", itemInfo, ""),
|
||||
MapleDataTool.getInt("spec/runOnPickup", itemInfo, 0) == 1);
|
||||
@@ -1506,7 +1506,7 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
int totalprob = 0;
|
||||
List<RewardItem> rewards = new ArrayList<>();
|
||||
for (MapleData child : getItemData(itemId).getChildByPath("reward").getChildren()) {
|
||||
for (Data child : getItemData(itemId).getChildByPath("reward").getChildren()) {
|
||||
RewardItem reward = new RewardItem();
|
||||
reward.itemid = MapleDataTool.getInt("item", child, 0);
|
||||
reward.prob = (byte) MapleDataTool.getInt("prob", child, 0);
|
||||
@@ -1528,7 +1528,7 @@ public class MapleItemInformationProvider {
|
||||
if (consumeOnPickupCache.containsKey(itemId)) {
|
||||
return consumeOnPickupCache.get(itemId);
|
||||
}
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
boolean consume = MapleDataTool.getIntConvert("spec/consumeOnPickup", data, 0) == 1 || MapleDataTool.getIntConvert("specEx/consumeOnPickup", data, 0) == 1;
|
||||
consumeOnPickupCache.put(itemId, consume);
|
||||
return consume;
|
||||
@@ -1737,14 +1737,14 @@ public class MapleItemInformationProvider {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private MapleData getEquipLevelInfo(int itemId) {
|
||||
MapleData equipLevelData = equipLevelInfoCache.get(itemId);
|
||||
private Data getEquipLevelInfo(int itemId) {
|
||||
Data equipLevelData = equipLevelInfoCache.get(itemId);
|
||||
if (equipLevelData == null) {
|
||||
if (equipLevelInfoCache.containsKey(itemId)) return null;
|
||||
|
||||
MapleData iData = getItemData(itemId);
|
||||
Data iData = getItemData(itemId);
|
||||
if (iData != null) {
|
||||
MapleData data = iData.getChildByPath("info/level");
|
||||
Data data = iData.getChildByPath("info/level");
|
||||
if (data != null) {
|
||||
equipLevelData = data.getChildByPath("info");
|
||||
}
|
||||
@@ -1761,13 +1761,13 @@ public class MapleItemInformationProvider {
|
||||
if (eqLevel == null) {
|
||||
eqLevel = 1; // greater than 1 means that it was supposed to levelup on GMS
|
||||
|
||||
MapleData data = getEquipLevelInfo(itemId);
|
||||
Data data = getEquipLevelInfo(itemId);
|
||||
if (data != null) {
|
||||
if (getMaxLevel) {
|
||||
int curLevel = 1;
|
||||
|
||||
while (true) {
|
||||
MapleData data2 = data.getChildByPath(Integer.toString(curLevel));
|
||||
Data data2 = data.getChildByPath(Integer.toString(curLevel));
|
||||
if (data2 == null || data2.getChildren().size() <= 1) {
|
||||
eqLevel = curLevel;
|
||||
equipMaxLevelCache.put(itemId, eqLevel);
|
||||
@@ -1777,7 +1777,7 @@ public class MapleItemInformationProvider {
|
||||
curLevel++;
|
||||
}
|
||||
} else {
|
||||
MapleData data2 = data.getChildByPath("1");
|
||||
Data data2 = data.getChildByPath("1");
|
||||
if (data2 != null && data2.getChildren().size() > 1) {
|
||||
eqLevel = 2;
|
||||
}
|
||||
@@ -1790,11 +1790,11 @@ public class MapleItemInformationProvider {
|
||||
|
||||
public List<Pair<String, Integer>> getItemLevelupStats(int itemId, int level) {
|
||||
List<Pair<String, Integer>> list = new LinkedList<>();
|
||||
MapleData data = getEquipLevelInfo(itemId);
|
||||
Data data = getEquipLevelInfo(itemId);
|
||||
if (data != null) {
|
||||
MapleData data2 = data.getChildByPath(Integer.toString(level));
|
||||
Data data2 = data.getChildByPath(Integer.toString(level));
|
||||
if (data2 != null) {
|
||||
for (MapleData da : data2.getChildren()) {
|
||||
for (Data da : data2.getChildren()) {
|
||||
if (Math.random() < 0.9) {
|
||||
if (da.getName().startsWith("incDEXMin")) {
|
||||
list.add(new Pair<>("incDEX", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incDEXMax")))));
|
||||
@@ -2038,8 +2038,8 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
itemid = -1;
|
||||
for(MapleData md : etcData.getData("ItemMake.img").getChildren()) {
|
||||
MapleData me = md.getChildByPath(StringUtil.getLeftPaddedStr(Integer.toString(itemId), '0', 8));
|
||||
for(Data md : etcData.getData("ItemMake.img").getChildren()) {
|
||||
Data me = md.getChildByPath(StringUtil.getLeftPaddedStr(Integer.toString(itemId), '0', 8));
|
||||
|
||||
if(me != null) {
|
||||
itemid = MapleDataTool.getInt(me.getChildByPath("catalyst"), -1);
|
||||
@@ -2106,10 +2106,10 @@ public class MapleItemInformationProvider {
|
||||
if (questItemConsCache.containsKey(itemId)) {
|
||||
return questItemConsCache.get(itemId);
|
||||
}
|
||||
MapleData data = getItemData(itemId);
|
||||
Data data = getItemData(itemId);
|
||||
QuestConsItem qcItem = null;
|
||||
|
||||
MapleData infoData = data.getChildByPath("info");
|
||||
Data infoData = data.getChildByPath("info");
|
||||
if (infoData.getChildByPath("uiData") != null) {
|
||||
qcItem = new QuestConsItem();
|
||||
qcItem.exp = MapleDataTool.getInt("exp", infoData);
|
||||
@@ -2118,9 +2118,9 @@ public class MapleItemInformationProvider {
|
||||
qcItem.items = new HashMap<>(2);
|
||||
|
||||
Map<Integer, Integer> cItems = qcItem.items;
|
||||
MapleData ciData = infoData.getChildByPath("consumeItem");
|
||||
Data ciData = infoData.getChildByPath("consumeItem");
|
||||
if (ciData != null) {
|
||||
for (MapleData ciItem : ciData.getChildren()) {
|
||||
for (Data ciItem : ciData.getChildren()) {
|
||||
int itemid = MapleDataTool.getInt("0", ciItem);
|
||||
int qty = MapleDataTool.getInt("1", ciItem);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package server;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -80,12 +80,12 @@ public class MapleSkillbookInformationProvider {
|
||||
return itemid >= 4001107 && itemid <= 4001114 || itemid >= 4161015 && itemid <= 4161023;
|
||||
}
|
||||
|
||||
private static int fetchQuestbook(MapleData checkData, String quest) {
|
||||
MapleData questStartData = checkData.getChildByPath(quest).getChildByPath("0");
|
||||
private static int fetchQuestbook(Data checkData, String quest) {
|
||||
Data questStartData = checkData.getChildByPath(quest).getChildByPath("0");
|
||||
|
||||
MapleData startReqItemData = questStartData.getChildByPath("item");
|
||||
Data startReqItemData = questStartData.getChildByPath("item");
|
||||
if (startReqItemData != null) {
|
||||
for (MapleData itemData : startReqItemData.getChildren()) {
|
||||
for (Data itemData : startReqItemData.getChildren()) {
|
||||
int itemId = MapleDataTool.getInt("id", itemData, 0);
|
||||
if (isQuestBook(itemId)) {
|
||||
return itemId;
|
||||
@@ -93,11 +93,11 @@ public class MapleSkillbookInformationProvider {
|
||||
}
|
||||
}
|
||||
|
||||
MapleData startReqQuestData = questStartData.getChildByPath("quest");
|
||||
Data startReqQuestData = questStartData.getChildByPath("quest");
|
||||
if (startReqQuestData != null) {
|
||||
Set<Integer> reqQuests = new HashSet<>();
|
||||
|
||||
for (MapleData questStatusData : startReqQuestData.getChildren()) {
|
||||
for (Data questStatusData : startReqQuestData.getChildren()) {
|
||||
int reqQuest = MapleDataTool.getInt("id", questStatusData, 0);
|
||||
if (reqQuest > 0) {
|
||||
reqQuests.add(reqQuest);
|
||||
@@ -117,16 +117,16 @@ public class MapleSkillbookInformationProvider {
|
||||
|
||||
private static Map<Integer, SkillBookEntry> fetchSkillbooksFromQuests() {
|
||||
MapleDataProvider questDataProvider = MapleDataProviderFactory.getDataProvider(WZFiles.QUEST);
|
||||
MapleData actData = questDataProvider.getData("Act.img");
|
||||
MapleData checkData = questDataProvider.getData("Check.img");
|
||||
Data actData = questDataProvider.getData("Act.img");
|
||||
Data checkData = questDataProvider.getData("Check.img");
|
||||
|
||||
final Map<Integer, SkillBookEntry> loadedSkillbooks = new HashMap<>();
|
||||
for (MapleData questData : actData.getChildren()) {
|
||||
for (MapleData questStatusData : questData.getChildren()) {
|
||||
for (MapleData questNodeData : questStatusData.getChildren()) {
|
||||
for (Data questData : actData.getChildren()) {
|
||||
for (Data questStatusData : questData.getChildren()) {
|
||||
for (Data questNodeData : questStatusData.getChildren()) {
|
||||
String actNodeName = questNodeData.getName();
|
||||
if (actNodeName.contentEquals("item")) {
|
||||
for (MapleData questItemData : questNodeData.getChildren()) {
|
||||
for (Data questItemData : questNodeData.getChildren()) {
|
||||
int itemId = MapleDataTool.getInt("id", questItemData, 0);
|
||||
int itemCount = MapleDataTool.getInt("count", questItemData, 0);
|
||||
|
||||
@@ -140,7 +140,7 @@ public class MapleSkillbookInformationProvider {
|
||||
}
|
||||
}
|
||||
} else if (actNodeName.contentEquals("skill")) {
|
||||
for (MapleData questSkillData : questNodeData.getChildren()) {
|
||||
for (Data questSkillData : questNodeData.getChildren()) {
|
||||
int skillId = MapleDataTool.getInt("id", questSkillData, 0);
|
||||
if (is4thJobSkill(skillId)) {
|
||||
// negative itemids are skill rewards
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.packet.Packet;
|
||||
import net.server.Server;
|
||||
import net.server.world.Party;
|
||||
import net.server.world.PartyCharacter;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.life.MapleMonster;
|
||||
import server.life.MobSkill;
|
||||
@@ -146,11 +146,11 @@ public class MapleStatEffect {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static MapleStatEffect loadSkillEffectFromData(MapleData source, int skillid, boolean overtime) {
|
||||
public static MapleStatEffect loadSkillEffectFromData(Data source, int skillid, boolean overtime) {
|
||||
return loadFromData(source, skillid, true, overtime);
|
||||
}
|
||||
|
||||
public static MapleStatEffect loadItemEffectFromData(MapleData source, int itemid) {
|
||||
public static MapleStatEffect loadItemEffectFromData(Data source, int itemid) {
|
||||
return loadFromData(source, itemid, false, false);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public class MapleStatEffect {
|
||||
}
|
||||
}
|
||||
|
||||
private static MapleStatEffect loadFromData(MapleData source, int sourceid, boolean skill, boolean overTime) {
|
||||
private static MapleStatEffect loadFromData(Data source, int sourceid, boolean skill, boolean overTime) {
|
||||
MapleStatEffect ret = new MapleStatEffect();
|
||||
ret.duration = MapleDataTool.getIntConvert("time", source, -1);
|
||||
ret.hp = (short) MapleDataTool.getInt("hp", source, 0);
|
||||
@@ -210,7 +210,7 @@ public class MapleStatEffect {
|
||||
ret.fatigue = MapleDataTool.getInt("incFatigue", source, 0);
|
||||
ret.repeatEffect = MapleDataTool.getInt("repeatEffect", source, 0) > 0;
|
||||
|
||||
MapleData mdd = source.getChildByPath("0");
|
||||
Data mdd = source.getChildByPath("0");
|
||||
if (mdd != null && mdd.getChildren().size() > 0) {
|
||||
ret.mobSkill = (short) MapleDataTool.getInt("mobSkill", mdd, 0);
|
||||
ret.mobSkillLevel = (short) MapleDataTool.getInt("level", mdd, 0);
|
||||
@@ -221,7 +221,7 @@ public class MapleStatEffect {
|
||||
ret.target = 0;
|
||||
}
|
||||
|
||||
MapleData mdds = source.getChildByPath("mob");
|
||||
Data mdds = source.getChildByPath("mob");
|
||||
if (mdds != null) {
|
||||
if (mdds.getChildren()!= null && mdds.getChildren().size() > 0) {
|
||||
ret.mob = MapleDataTool.getInt("mob", mdds, 0);
|
||||
@@ -308,11 +308,11 @@ public class MapleStatEffect {
|
||||
List<Pair<Integer, Integer>> areas = null;
|
||||
boolean inParty = false;
|
||||
|
||||
MapleData con = source.getChildByPath("con");
|
||||
Data con = source.getChildByPath("con");
|
||||
if (con != null) {
|
||||
areas = new ArrayList<>(3);
|
||||
|
||||
for (MapleData conData : con.getChildren()) {
|
||||
for (Data conData : con.getChildren()) {
|
||||
int type = MapleDataTool.getInt("type", conData, -1);
|
||||
|
||||
if (type == 0) {
|
||||
@@ -395,7 +395,7 @@ public class MapleStatEffect {
|
||||
addBuffStatPairToListIfNotZero(statups, BuffStat.JUMP, (int) ret.jump);
|
||||
}
|
||||
|
||||
MapleData ltd = source.getChildByPath("lt");
|
||||
Data ltd = source.getChildByPath("lt");
|
||||
if (ltd != null) {
|
||||
ret.lt = (Point) ltd.getData();
|
||||
ret.rb = (Point) source.getChildByPath("rb").getData();
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.inventory.ItemFactory;
|
||||
import constants.game.GameConstants;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -311,7 +311,7 @@ public class MapleStorage {
|
||||
fee = 100;
|
||||
|
||||
MapleDataProvider npc = MapleDataProviderFactory.getDataProvider(WZFiles.NPC);
|
||||
MapleData npcData = npc.getData(npcId + ".img");
|
||||
Data npcData = npc.getData(npcId + ".img");
|
||||
if(npcData != null) {
|
||||
fee = MapleDataTool.getIntConvert("info/trunkPut", npcData, 100);
|
||||
}
|
||||
@@ -329,7 +329,7 @@ public class MapleStorage {
|
||||
fee = 0;
|
||||
|
||||
MapleDataProvider npc = MapleDataProviderFactory.getDataProvider(WZFiles.NPC);
|
||||
MapleData npcData = npc.getData(npcId + ".img");
|
||||
Data npcData = npc.getData(npcId + ".img");
|
||||
if(npcData != null) {
|
||||
fee = MapleDataTool.getIntConvert("info/trunkGet", npcData, 0);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package server.life;
|
||||
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -38,8 +38,8 @@ public class MapleLifeFactory {
|
||||
|
||||
private static MapleDataProvider data = MapleDataProviderFactory.getDataProvider(WZFiles.MOB);
|
||||
private final static MapleDataProvider stringDataWZ = MapleDataProviderFactory.getDataProvider(WZFiles.STRING);
|
||||
private static MapleData mobStringData = stringDataWZ.getData("Mob.img");
|
||||
private static MapleData npcStringData = stringDataWZ.getData("Npc.img");
|
||||
private static Data mobStringData = stringDataWZ.getData("Mob.img");
|
||||
private static Data npcStringData = stringDataWZ.getData("Npc.img");
|
||||
private static Map<Integer, MapleMonsterStats> monsterStats = new HashMap<>();
|
||||
private static Set<Integer> hpbarBosses = getHpBarBosses();
|
||||
|
||||
@@ -47,7 +47,7 @@ public class MapleLifeFactory {
|
||||
Set<Integer> ret = new HashSet<>();
|
||||
|
||||
MapleDataProvider uiDataWZ = MapleDataProviderFactory.getDataProvider(WZFiles.UI);
|
||||
for (MapleData bossData : uiDataWZ.getData("UIWindow.img").getChildByPath("MobGage/Mob").getChildren()) {
|
||||
for (Data bossData : uiDataWZ.getData("UIWindow.img").getChildByPath("MobGage/Mob").getChildren()) {
|
||||
ret.add(Integer.valueOf(bossData.getName()));
|
||||
}
|
||||
|
||||
@@ -91,11 +91,11 @@ public class MapleLifeFactory {
|
||||
}
|
||||
|
||||
private static Pair<MapleMonsterStats, List<MobAttackInfoHolder>> getMonsterStats(int mid) {
|
||||
MapleData monsterData = data.getData(StringUtil.getLeftPaddedStr(mid + ".img", '0', 11));
|
||||
Data monsterData = data.getData(StringUtil.getLeftPaddedStr(mid + ".img", '0', 11));
|
||||
if (monsterData == null) {
|
||||
return null;
|
||||
}
|
||||
MapleData monsterInfoData = monsterData.getChildByPath("info");
|
||||
Data monsterInfoData = monsterData.getChildByPath("info");
|
||||
|
||||
List<MobAttackInfoHolder> attackInfos = new LinkedList<>();
|
||||
MapleMonsterStats stats = new MapleMonsterStats();
|
||||
@@ -130,7 +130,7 @@ public class MapleLifeFactory {
|
||||
stats.setCP(MapleDataTool.getIntConvert("getCP", monsterInfoData, stats.getCP()));
|
||||
stats.setRemoveOnMiss(MapleDataTool.getIntConvert("removeOnMiss", monsterInfoData, stats.removeOnMiss() ? 1 : 0) > 0);
|
||||
|
||||
MapleData special = monsterInfoData.getChildByPath("coolDamage");
|
||||
Data special = monsterInfoData.getChildByPath("coolDamage");
|
||||
if (special != null) {
|
||||
int coolDmg = MapleDataTool.getIntConvert("coolDamage", monsterInfoData);
|
||||
int coolProb = MapleDataTool.getIntConvert("coolDamageProb", monsterInfoData, 0);
|
||||
@@ -138,7 +138,7 @@ public class MapleLifeFactory {
|
||||
}
|
||||
special = monsterInfoData.getChildByPath("loseItem");
|
||||
if (special != null) {
|
||||
for (MapleData liData : special.getChildren()) {
|
||||
for (Data liData : special.getChildren()) {
|
||||
stats.addLoseItem(new loseItem(MapleDataTool.getInt(liData.getChildByPath("id")), (byte) MapleDataTool.getInt(liData.getChildByPath("prop")), (byte) MapleDataTool.getInt(liData.getChildByPath("x"))));
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public class MapleLifeFactory {
|
||||
if (special != null) {
|
||||
stats.setSelfDestruction(new selfDestruction((byte) MapleDataTool.getInt(special.getChildByPath("action")), MapleDataTool.getIntConvert("removeAfter", special, -1), MapleDataTool.getIntConvert("hp", special, -1)));
|
||||
}
|
||||
MapleData firstAttackData = monsterInfoData.getChildByPath("firstAttack");
|
||||
Data firstAttackData = monsterInfoData.getChildByPath("firstAttack");
|
||||
int firstAttack = 0;
|
||||
if (firstAttackData != null) {
|
||||
if (firstAttackData.getType() == DataType.FLOAT) {
|
||||
@@ -163,19 +163,19 @@ public class MapleLifeFactory {
|
||||
stats.setTagColor(hpbarBoss ? MapleDataTool.getIntConvert("hpTagColor", monsterInfoData, 0) : 0);
|
||||
stats.setTagBgColor(hpbarBoss ? MapleDataTool.getIntConvert("hpTagBgcolor", monsterInfoData, 0) : 0);
|
||||
|
||||
for (MapleData idata : monsterData) {
|
||||
for (Data idata : monsterData) {
|
||||
if (!idata.getName().equals("info")) {
|
||||
int delay = 0;
|
||||
for (MapleData pic : idata.getChildren()) {
|
||||
for (Data pic : idata.getChildren()) {
|
||||
delay += MapleDataTool.getIntConvert("delay", pic, 0);
|
||||
}
|
||||
stats.setAnimationTime(idata.getName(), delay);
|
||||
}
|
||||
}
|
||||
MapleData reviveInfo = monsterInfoData.getChildByPath("revive");
|
||||
Data reviveInfo = monsterInfoData.getChildByPath("revive");
|
||||
if (reviveInfo != null) {
|
||||
List<Integer> revives = new LinkedList<>();
|
||||
for (MapleData data_ : reviveInfo) {
|
||||
for (Data data_ : reviveInfo) {
|
||||
revives.add(MapleDataTool.getInt(data_));
|
||||
}
|
||||
stats.setRevives(revives);
|
||||
@@ -183,7 +183,7 @@ public class MapleLifeFactory {
|
||||
decodeElementalString(stats, MapleDataTool.getString("elemAttr", monsterInfoData, ""));
|
||||
|
||||
MapleMonsterInformationProvider mi = MapleMonsterInformationProvider.getInstance();
|
||||
MapleData monsterSkillInfoData = monsterInfoData.getChildByPath("skill");
|
||||
Data monsterSkillInfoData = monsterInfoData.getChildByPath("skill");
|
||||
if (monsterSkillInfoData != null) {
|
||||
int i = 0;
|
||||
List<Pair<Integer, Integer>> skills = new ArrayList<>();
|
||||
@@ -192,10 +192,10 @@ public class MapleLifeFactory {
|
||||
int skillLv = MapleDataTool.getInt(i + "/level", monsterSkillInfoData, 0);
|
||||
skills.add(new Pair<>(skillId, skillLv));
|
||||
|
||||
MapleData monsterSkillData = monsterData.getChildByPath("skill" + (i + 1));
|
||||
Data monsterSkillData = monsterData.getChildByPath("skill" + (i + 1));
|
||||
if (monsterSkillData != null) {
|
||||
int animationTime = 0;
|
||||
for (MapleData effectEntry : monsterSkillData.getChildren()) {
|
||||
for (Data effectEntry : monsterSkillData.getChildren()) {
|
||||
animationTime += MapleDataTool.getIntConvert("delay", effectEntry, 0);
|
||||
}
|
||||
|
||||
@@ -209,10 +209,10 @@ public class MapleLifeFactory {
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
MapleData monsterAttackData;
|
||||
Data monsterAttackData;
|
||||
while ((monsterAttackData = monsterData.getChildByPath("attack" + (i + 1))) != null) {
|
||||
int animationTime = 0;
|
||||
for (MapleData effectEntry : monsterAttackData.getChildren()) {
|
||||
for (Data effectEntry : monsterAttackData.getChildren()) {
|
||||
animationTime += MapleDataTool.getIntConvert("delay", effectEntry, 0);
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public class MapleLifeFactory {
|
||||
i++;
|
||||
}
|
||||
|
||||
MapleData banishData = monsterInfoData.getChildByPath("ban");
|
||||
Data banishData = monsterInfoData.getChildByPath("ban");
|
||||
if (banishData != null) {
|
||||
stats.setBanishInfo(new BanishInfo(MapleDataTool.getString("banMsg", banishData), MapleDataTool.getInt("banMap/0/field", banishData, -1), MapleDataTool.getString("banMap/0/portal", banishData, "sp")));
|
||||
}
|
||||
@@ -262,11 +262,11 @@ public class MapleLifeFactory {
|
||||
try {
|
||||
MapleMonsterStats stats = monsterStats.get(mid);
|
||||
if (stats == null) {
|
||||
MapleData monsterData = data.getData(StringUtil.getLeftPaddedStr(mid + ".img", '0', 11));
|
||||
Data monsterData = data.getData(StringUtil.getLeftPaddedStr(mid + ".img", '0', 11));
|
||||
if (monsterData == null) {
|
||||
return -1;
|
||||
}
|
||||
MapleData monsterInfoData = monsterData.getChildByPath("info");
|
||||
Data monsterInfoData = monsterData.getChildByPath("info");
|
||||
return MapleDataTool.getIntConvert("level", monsterInfoData);
|
||||
} else {
|
||||
return stats.getLevel();
|
||||
|
||||
@@ -22,7 +22,7 @@ package server.life;
|
||||
|
||||
import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -229,9 +229,9 @@ public class MapleMonsterInformationProvider {
|
||||
public static ArrayList<Pair<Integer, String>> getMobsIDsFromName(String search) {
|
||||
MapleDataProvider dataProvider = MapleDataProviderFactory.getDataProvider(WZFiles.STRING);
|
||||
ArrayList<Pair<Integer, String>> retMobs = new ArrayList<>();
|
||||
MapleData data = dataProvider.getData("Mob.img");
|
||||
Data data = dataProvider.getData("Mob.img");
|
||||
List<Pair<Integer, String>> mobPairList = new LinkedList<>();
|
||||
for (MapleData mobIdData : data.getChildren()) {
|
||||
for (Data mobIdData : data.getChildren()) {
|
||||
int mobIdFromData = Integer.parseInt(mobIdData.getName());
|
||||
String mobNameFromData = MapleDataTool.getString(mobIdData.getChildByPath("name"), "NO-NAME");
|
||||
mobPairList.add(new Pair<>(mobIdFromData, mobNameFromData));
|
||||
@@ -268,7 +268,7 @@ public class MapleMonsterInformationProvider {
|
||||
String mobName = mobNameCache.get(id);
|
||||
if (mobName == null) {
|
||||
MapleDataProvider dataProvider = MapleDataProviderFactory.getDataProvider(WZFiles.STRING);
|
||||
MapleData mobData = dataProvider.getData("Mob.img");
|
||||
Data mobData = dataProvider.getData("Mob.img");
|
||||
|
||||
mobName = MapleDataTool.getString(mobData.getChildByPath(id + "/name"), "");
|
||||
mobNameCache.put(id, mobName);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package server.life;
|
||||
|
||||
import net.server.Server;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -47,7 +47,7 @@ public class MaplePlayerNPCFactory {
|
||||
}
|
||||
|
||||
private static void loadDeveloperRoomMetadata(MapleDataProvider npc) {
|
||||
MapleData thisData = npc.getData("9977777.img");
|
||||
Data thisData = npc.getData("9977777.img");
|
||||
if(thisData != null) {
|
||||
MapleDataProvider map = MapleDataProviderFactory.getDataProvider(WZFiles.MAP);
|
||||
|
||||
@@ -57,7 +57,7 @@ public class MaplePlayerNPCFactory {
|
||||
|
||||
thisData = sound.getData("Field.img");
|
||||
if(thisData != null) {
|
||||
MapleData md = thisData.getChildByPath("anthem/brazil");
|
||||
Data md = thisData.getChildByPath("anthem/brazil");
|
||||
if(md != null) {
|
||||
Server.getInstance().setAvailableDeveloperRoom();
|
||||
}
|
||||
@@ -71,9 +71,9 @@ public class MaplePlayerNPCFactory {
|
||||
loadDeveloperRoomMetadata(npc);
|
||||
|
||||
MapleDataProvider etc = MapleDataProviderFactory.getDataProvider(WZFiles.ETC);
|
||||
MapleData dnpcData = etc.getData("DeveloperNpc.img");
|
||||
Data dnpcData = etc.getData("DeveloperNpc.img");
|
||||
if(dnpcData != null) {
|
||||
for (MapleData data : dnpcData.getChildren()) {
|
||||
for (Data data : dnpcData.getChildren()) {
|
||||
int scriptId = Integer.parseInt(data.getName());
|
||||
|
||||
String name = MapleDataTool.getString("name", data, "");
|
||||
@@ -90,7 +90,7 @@ public class MaplePlayerNPCFactory {
|
||||
int CY = MapleDataTool.getIntConvert("cy", data, 0);
|
||||
|
||||
Map<Short, Integer> equips = new HashMap<>();
|
||||
for (MapleData edata : data.getChildByPath("equips").getChildren()) {
|
||||
for (Data edata : data.getChildByPath("equips").getChildren()) {
|
||||
short equippos = (short) MapleDataTool.getIntConvert("pos", edata);
|
||||
int equipid = MapleDataTool.getIntConvert("itemid", edata);
|
||||
|
||||
@@ -107,7 +107,7 @@ public class MaplePlayerNPCFactory {
|
||||
runningDeveloperOid++;
|
||||
}
|
||||
} else {
|
||||
MapleData thisData = npc.getData("9977777.img");
|
||||
Data thisData = npc.getData("9977777.img");
|
||||
|
||||
if(thisData != null) {
|
||||
byte[] encData = {0x52,0x6F,0x6E,0x61,0x6E};
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
package server.life;
|
||||
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -47,20 +47,20 @@ public class MobAttackInfoFactory {
|
||||
synchronized (mobAttacks) {
|
||||
ret = mobAttacks.get(mob.getId() + "" + attack);
|
||||
if (ret == null) {
|
||||
MapleData mobData = dataSource.getData(StringUtil.getLeftPaddedStr(mob.getId() + ".img", '0', 11));
|
||||
Data mobData = dataSource.getData(StringUtil.getLeftPaddedStr(mob.getId() + ".img", '0', 11));
|
||||
if (mobData != null) {
|
||||
// MapleData infoData = mobData.getChildByPath("info");
|
||||
String linkedmob = MapleDataTool.getString("link", mobData, "");
|
||||
if (!linkedmob.equals("")) {
|
||||
mobData = dataSource.getData(StringUtil.getLeftPaddedStr(linkedmob + ".img", '0', 11));
|
||||
}
|
||||
MapleData attackData = mobData.getChildByPath("attack" + (attack + 1) + "/info");
|
||||
Data attackData = mobData.getChildByPath("attack" + (attack + 1) + "/info");
|
||||
|
||||
if (attackData == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MapleData deadlyAttack = attackData.getChildByPath("deadlyAttack");
|
||||
Data deadlyAttack = attackData.getChildByPath("deadlyAttack");
|
||||
int mpBurn = MapleDataTool.getInt("mpBurn", attackData, 0);
|
||||
int disease = MapleDataTool.getInt("disease", attackData, 0);
|
||||
int level = MapleDataTool.getInt("level", attackData, 0);
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.server.audit.locks.MonitoredReentrantReadWriteLock;
|
||||
import net.server.audit.locks.MonitoredWriteLock;
|
||||
import net.server.audit.locks.factory.MonitoredReadLockFactory;
|
||||
import net.server.audit.locks.factory.MonitoredWriteLockFactory;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -47,7 +47,7 @@ public class MobSkillFactory {
|
||||
|
||||
private static Map<String, MobSkill> mobSkills = new HashMap<>();
|
||||
private final static MapleDataProvider dataSource = MapleDataProviderFactory.getDataProvider(WZFiles.SKILL);
|
||||
private static MapleData skillRoot = dataSource.getData("MobSkill.img");
|
||||
private static Data skillRoot = dataSource.getData("MobSkill.img");
|
||||
private final static MonitoredReentrantReadWriteLock dataLock = new MonitoredReentrantReadWriteLock(MonitoredLockType.MOBSKILL_FACTORY);
|
||||
private final static MonitoredReadLock rL = MonitoredReadLockFactory.createLock(dataLock);
|
||||
private final static MonitoredWriteLock wL = MonitoredWriteLockFactory.createLock(dataLock);
|
||||
@@ -68,7 +68,7 @@ public class MobSkillFactory {
|
||||
MobSkill ret;
|
||||
ret = mobSkills.get(key);
|
||||
if (ret == null) {
|
||||
MapleData skillData = skillRoot.getChildByPath(skillId + "/level/" + level);
|
||||
Data skillData = skillRoot.getChildByPath(skillId + "/level/" + level);
|
||||
if (skillData != null) {
|
||||
int mpCon = MapleDataTool.getInt(skillData.getChildByPath("mpCon"), 0);
|
||||
List<Integer> toSummon = new ArrayList<>();
|
||||
@@ -88,7 +88,7 @@ public class MobSkillFactory {
|
||||
int iprop = MapleDataTool.getInt("prop", skillData, 100);
|
||||
float prop = iprop / 100;
|
||||
int limit = MapleDataTool.getInt("limit", skillData, 0);
|
||||
MapleData ltd = skillData.getChildByPath("lt");
|
||||
Data ltd = skillData.getChildByPath("lt");
|
||||
Point lt = null;
|
||||
Point rb = null;
|
||||
if (ltd != null) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
package server.maps;
|
||||
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -43,7 +43,7 @@ import java.util.List;
|
||||
|
||||
public class MapleMapFactory {
|
||||
|
||||
private static MapleData nameData;
|
||||
private static Data nameData;
|
||||
private static MapleDataProvider mapSource;
|
||||
|
||||
static {
|
||||
@@ -51,8 +51,8 @@ public class MapleMapFactory {
|
||||
mapSource = MapleDataProviderFactory.getDataProvider(WZFiles.MAP);
|
||||
}
|
||||
|
||||
private static void loadLifeFromWz(MapleMap map, MapleData mapData) {
|
||||
for (MapleData life : mapData.getChildByPath("life")) {
|
||||
private static void loadLifeFromWz(MapleMap map, Data mapData) {
|
||||
for (Data life : mapData.getChildByPath("life")) {
|
||||
life.getName();
|
||||
String id = MapleDataTool.getString(life.getChildByPath("id"));
|
||||
String type = MapleDataTool.getString(life.getChildByPath("type"));
|
||||
@@ -65,7 +65,7 @@ public class MapleMapFactory {
|
||||
}
|
||||
}
|
||||
int cy = MapleDataTool.getInt(life.getChildByPath("cy"));
|
||||
MapleData dF = life.getChildByPath("f");
|
||||
Data dF = life.getChildByPath("f");
|
||||
int f = (dF != null) ? MapleDataTool.getInt(dF) : 0;
|
||||
int fh = MapleDataTool.getInt(life.getChildByPath("fh"));
|
||||
int rx0 = MapleDataTool.getInt(life.getChildByPath("rx0"));
|
||||
@@ -130,8 +130,8 @@ public class MapleMapFactory {
|
||||
MapleMap map;
|
||||
|
||||
String mapName = getMapName(mapid);
|
||||
MapleData mapData = mapSource.getData(mapName); // source.getData issue with giving nulls in rare ocasions found thanks to MedicOP
|
||||
MapleData infoData = mapData.getChildByPath("info");
|
||||
Data mapData = mapSource.getData(mapName); // source.getData issue with giving nulls in rare ocasions found thanks to MedicOP
|
||||
Data infoData = mapData.getChildByPath("info");
|
||||
|
||||
String link = MapleDataTool.getString(infoData.getChildByPath("link"), "");
|
||||
if (!link.equals("")) { //nexon made hundreds of dojo maps so to reduce the size they added links.
|
||||
@@ -139,7 +139,7 @@ public class MapleMapFactory {
|
||||
mapData = mapSource.getData(mapName);
|
||||
}
|
||||
float monsterRate = 0;
|
||||
MapleData mobRate = infoData.getChildByPath("mobRate");
|
||||
Data mobRate = infoData.getChildByPath("mobRate");
|
||||
if (mobRate != null) {
|
||||
monsterRate = (Float) mobRate.getData();
|
||||
}
|
||||
@@ -155,10 +155,10 @@ public class MapleMapFactory {
|
||||
map.setFieldLimit(MapleDataTool.getInt(infoData.getChildByPath("fieldLimit"), 0));
|
||||
map.setMobInterval((short) MapleDataTool.getInt(infoData.getChildByPath("createMobInterval"), 5000));
|
||||
MaplePortalFactory portalFactory = new MaplePortalFactory();
|
||||
for (MapleData portal : mapData.getChildByPath("portal")) {
|
||||
for (Data portal : mapData.getChildByPath("portal")) {
|
||||
map.addPortal(portalFactory.makePortal(MapleDataTool.getInt(portal.getChildByPath("pt")), portal));
|
||||
}
|
||||
MapleData timeMob = infoData.getChildByPath("timeMob");
|
||||
Data timeMob = infoData.getChildByPath("timeMob");
|
||||
if (timeMob != null) {
|
||||
map.setTimeMob(MapleDataTool.getInt(timeMob.getChildByPath("id")), MapleDataTool.getString(timeMob.getChildByPath("message")));
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public class MapleMapFactory {
|
||||
bounds[1] = MapleDataTool.getInt(infoData.getChildByPath("VRBottom"));
|
||||
|
||||
if (bounds[0] == bounds[1]) { // old-style baked map
|
||||
MapleData minimapData = mapData.getChildByPath("miniMap");
|
||||
Data minimapData = mapData.getChildByPath("miniMap");
|
||||
if (minimapData != null) {
|
||||
bounds[0] = MapleDataTool.getInt(minimapData.getChildByPath("centerX")) * -1;
|
||||
bounds[1] = MapleDataTool.getInt(minimapData.getChildByPath("centerY")) * -1;
|
||||
@@ -190,9 +190,9 @@ public class MapleMapFactory {
|
||||
List<MapleFoothold> allFootholds = new LinkedList<>();
|
||||
Point lBound = new Point();
|
||||
Point uBound = new Point();
|
||||
for (MapleData footRoot : mapData.getChildByPath("foothold")) {
|
||||
for (MapleData footCat : footRoot) {
|
||||
for (MapleData footHold : footCat) {
|
||||
for (Data footRoot : mapData.getChildByPath("foothold")) {
|
||||
for (Data footCat : footRoot) {
|
||||
for (Data footHold : footCat) {
|
||||
int x1 = MapleDataTool.getInt(footHold.getChildByPath("x1"));
|
||||
int y1 = MapleDataTool.getInt(footHold.getChildByPath("y1"));
|
||||
int x2 = MapleDataTool.getInt(footHold.getChildByPath("x2"));
|
||||
@@ -222,7 +222,7 @@ public class MapleMapFactory {
|
||||
}
|
||||
map.setFootholds(fTree);
|
||||
if (mapData.getChildByPath("area") != null) {
|
||||
for (MapleData area : mapData.getChildByPath("area")) {
|
||||
for (Data area : mapData.getChildByPath("area")) {
|
||||
int x1 = MapleDataTool.getInt(area.getChildByPath("x1"));
|
||||
int y1 = MapleDataTool.getInt(area.getChildByPath("y1"));
|
||||
int x2 = MapleDataTool.getInt(area.getChildByPath("x2"));
|
||||
@@ -261,28 +261,28 @@ public class MapleMapFactory {
|
||||
loadLifeFromDb(map);
|
||||
|
||||
if (map.isCPQMap()) {
|
||||
MapleData mcData = mapData.getChildByPath("monsterCarnival");
|
||||
Data mcData = mapData.getChildByPath("monsterCarnival");
|
||||
if (mcData != null) {
|
||||
map.setDeathCP(MapleDataTool.getIntConvert("deathCP", mcData, 0));
|
||||
map.setMaxMobs(MapleDataTool.getIntConvert("mobGenMax", mcData, 20)); // thanks Atoot for noticing CPQ1 bf. 3 and 4 not accepting spawns due to undefined limits, Lame for noticing a need to cap mob spawns even on such undefined limits
|
||||
map.setTimeDefault(MapleDataTool.getIntConvert("timeDefault", mcData, 0));
|
||||
map.setTimeExpand(MapleDataTool.getIntConvert("timeExpand", mcData, 0));
|
||||
map.setMaxReactors(MapleDataTool.getIntConvert("guardianGenMax", mcData, 16));
|
||||
MapleData guardianGenData = mcData.getChildByPath("guardianGenPos");
|
||||
for (MapleData node : guardianGenData.getChildren()) {
|
||||
Data guardianGenData = mcData.getChildByPath("guardianGenPos");
|
||||
for (Data node : guardianGenData.getChildren()) {
|
||||
GuardianSpawnPoint pt = new GuardianSpawnPoint(new Point(MapleDataTool.getIntConvert("x", node), MapleDataTool.getIntConvert("y", node)));
|
||||
pt.setTeam(MapleDataTool.getIntConvert("team", node, -1));
|
||||
pt.setTaken(false);
|
||||
map.addGuardianSpawnPoint(pt);
|
||||
}
|
||||
if (mcData.getChildByPath("skill") != null) {
|
||||
for (MapleData area : mcData.getChildByPath("skill")) {
|
||||
for (Data area : mcData.getChildByPath("skill")) {
|
||||
map.addSkillId(MapleDataTool.getInt(area));
|
||||
}
|
||||
}
|
||||
|
||||
if (mcData.getChildByPath("mob") != null) {
|
||||
for (MapleData area : mcData.getChildByPath("mob")) {
|
||||
for (Data area : mcData.getChildByPath("mob")) {
|
||||
map.addMobSpawn(MapleDataTool.getInt(area.getChildByPath("id")), MapleDataTool.getInt(area.getChildByPath("spendCP")));
|
||||
}
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public class MapleMapFactory {
|
||||
}
|
||||
|
||||
if (mapData.getChildByPath("reactor") != null) {
|
||||
for (MapleData reactor : mapData.getChildByPath("reactor")) {
|
||||
for (Data reactor : mapData.getChildByPath("reactor")) {
|
||||
String id = MapleDataTool.getString(reactor.getChildByPath("id"));
|
||||
if (id != null) {
|
||||
MapleReactor newReactor = loadReactor(reactor, id, (byte) MapleDataTool.getInt(reactor.getChildByPath("f"), 0));
|
||||
@@ -314,14 +314,14 @@ public class MapleMapFactory {
|
||||
map.setFieldType(MapleDataTool.getIntConvert("fieldType", infoData, 0));
|
||||
map.setMobCapacity(MapleDataTool.getIntConvert("fixedMobCapacity", infoData, 500));//Is there a map that contains more than 500 mobs?
|
||||
|
||||
MapleData recData = infoData.getChildByPath("recovery");
|
||||
Data recData = infoData.getChildByPath("recovery");
|
||||
if (recData != null) {
|
||||
map.setRecovery(MapleDataTool.getFloat(recData));
|
||||
}
|
||||
|
||||
HashMap<Integer, Integer> backTypes = new HashMap<>();
|
||||
try {
|
||||
for (MapleData layer : mapData.getChildByPath("back")) { // yolo
|
||||
for (Data layer : mapData.getChildByPath("back")) { // yolo
|
||||
int layerNum = Integer.parseInt(layer.getName());
|
||||
int btype = MapleDataTool.getInt(layer.getChildByPath("type"), 0);
|
||||
|
||||
@@ -352,7 +352,7 @@ public class MapleMapFactory {
|
||||
return myLife;
|
||||
}
|
||||
|
||||
private static MapleReactor loadReactor(MapleData reactor, String id, final byte FacingDirection) {
|
||||
private static MapleReactor loadReactor(Data reactor, String id, final byte FacingDirection) {
|
||||
MapleReactor myReactor = new MapleReactor(MapleReactorFactory.getReactor(Integer.parseInt(id)), Integer.parseInt(id));
|
||||
int x = MapleDataTool.getInt(reactor.getChildByPath("x"));
|
||||
int y = MapleDataTool.getInt(reactor.getChildByPath("y"));
|
||||
|
||||
@@ -21,12 +21,10 @@
|
||||
*/
|
||||
package server.maps;
|
||||
|
||||
import java.awt.Point;
|
||||
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.maps.MapleGenericPortal;
|
||||
import server.maps.MapleMapPortal;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class MaplePortalFactory {
|
||||
private int nextDoorPortal;
|
||||
@@ -35,7 +33,7 @@ public class MaplePortalFactory {
|
||||
nextDoorPortal = 0x80;
|
||||
}
|
||||
|
||||
public MaplePortal makePortal(int type, MapleData portal) {
|
||||
public MaplePortal makePortal(int type, Data portal) {
|
||||
MapleGenericPortal ret = null;
|
||||
if (type == MaplePortal.MAP_PORTAL) {
|
||||
ret = new MapleMapPortal();
|
||||
@@ -46,7 +44,7 @@ public class MaplePortalFactory {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void loadPortal(MapleGenericPortal myPortal, MapleData portal) {
|
||||
private void loadPortal(MapleGenericPortal myPortal, Data portal) {
|
||||
myPortal.setName(MapleDataTool.getString(portal.getChildByPath("pn")));
|
||||
myPortal.setTarget(MapleDataTool.getString(portal.getChildByPath("tn")));
|
||||
myPortal.setTargetMapId(MapleDataTool.getInt(portal.getChildByPath("tm")));
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
package server.maps;
|
||||
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -44,8 +44,8 @@ public class MapleReactorFactory {
|
||||
MapleReactorStats stats = reactorStats.get(rid);
|
||||
if (stats == null) {
|
||||
int infoId = rid;
|
||||
MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||
MapleData link = reactorData.getChildByPath("info/link");
|
||||
Data reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||
Data link = reactorData.getChildByPath("info/link");
|
||||
if (link != null) {
|
||||
infoId = MapleDataTool.getIntConvert("info/link", reactorData);
|
||||
stats = reactorStats.get(infoId);
|
||||
@@ -60,13 +60,13 @@ public class MapleReactorFactory {
|
||||
boolean areaSet = false;
|
||||
boolean foundState = false;
|
||||
for (byte i = 0; true; i++) {
|
||||
MapleData reactorD = reactorData.getChildByPath(String.valueOf(i));
|
||||
Data reactorD = reactorData.getChildByPath(String.valueOf(i));
|
||||
if (reactorD == null) {
|
||||
break;
|
||||
}
|
||||
MapleData reactorInfoData_ = reactorD.getChildByPath("event");
|
||||
Data reactorInfoData_ = reactorD.getChildByPath("event");
|
||||
if (reactorInfoData_ != null && reactorInfoData_.getChildByPath("0") != null) {
|
||||
MapleData reactorInfoData = reactorInfoData_.getChildByPath("0");
|
||||
Data reactorInfoData = reactorInfoData_.getChildByPath("0");
|
||||
Pair<Integer, Integer> reactItem = null;
|
||||
int type = MapleDataTool.getIntConvert("type", reactorInfoData);
|
||||
if (type == 100) { //reactor waits for item
|
||||
@@ -98,31 +98,31 @@ public class MapleReactorFactory {
|
||||
MapleReactorStats stats = reactorStats.get(rid);
|
||||
if (stats == null) {
|
||||
int infoId = rid;
|
||||
MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||
MapleData link = reactorData.getChildByPath("info/link");
|
||||
Data reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||
Data link = reactorData.getChildByPath("info/link");
|
||||
if (link != null) {
|
||||
infoId = MapleDataTool.getIntConvert("info/link", reactorData);
|
||||
stats = reactorStats.get(infoId);
|
||||
}
|
||||
MapleData activateOnTouch = reactorData.getChildByPath("info/activateByTouch");
|
||||
Data activateOnTouch = reactorData.getChildByPath("info/activateByTouch");
|
||||
boolean loadArea = false;
|
||||
if (activateOnTouch != null) {
|
||||
loadArea = MapleDataTool.getInt("info/activateByTouch", reactorData, 0) != 0;
|
||||
}
|
||||
if (stats == null) {
|
||||
reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||
MapleData reactorInfoData = reactorData.getChildByPath("0");
|
||||
Data reactorInfoData = reactorData.getChildByPath("0");
|
||||
stats = new MapleReactorStats();
|
||||
List<StateData> statedatas = new ArrayList<>();
|
||||
if (reactorInfoData != null) {
|
||||
boolean areaSet = false;
|
||||
byte i = 0;
|
||||
while (reactorInfoData != null) {
|
||||
MapleData eventData = reactorInfoData.getChildByPath("event");
|
||||
Data eventData = reactorInfoData.getChildByPath("event");
|
||||
if (eventData != null) {
|
||||
int timeOut = -1;
|
||||
|
||||
for (MapleData fknexon : eventData.getChildren()) {
|
||||
for (Data fknexon : eventData.getChildren()) {
|
||||
if (fknexon.getName().equalsIgnoreCase("timeOut")) {
|
||||
timeOut = MapleDataTool.getInt(fknexon);
|
||||
} else {
|
||||
@@ -136,11 +136,11 @@ public class MapleReactorFactory {
|
||||
areaSet = true;
|
||||
}
|
||||
}
|
||||
MapleData activeSkillID = fknexon.getChildByPath("activeSkillID");
|
||||
Data activeSkillID = fknexon.getChildByPath("activeSkillID");
|
||||
List<Integer> skillids = null;
|
||||
if (activeSkillID != null) {
|
||||
skillids = new ArrayList<>();
|
||||
for (MapleData skill : activeSkillID.getChildren()) {
|
||||
for (Data skill : activeSkillID.getChildren()) {
|
||||
skillids.add(MapleDataTool.getInt(skill));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package server.partyquest;
|
||||
|
||||
import client.Disease;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -40,7 +40,7 @@ public class MapleCarnivalFactory {
|
||||
if (skills.size() != 0) {
|
||||
return;
|
||||
}
|
||||
for (MapleData z : dataRoot.getData("MCSkill.img")) {
|
||||
for (Data z : dataRoot.getData("MCSkill.img")) {
|
||||
Integer id = Integer.parseInt(z.getName());
|
||||
MCSkill ms = new MCSkill(MapleDataTool.getInt("spendCP", z, 0), MapleDataTool.getInt("mobSkillID", z, 0), MapleDataTool.getInt("level", z, 0), MapleDataTool.getInt("target", z, 1) > 1);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class MapleCarnivalFactory {
|
||||
singleTargetedSkills.add(id);
|
||||
}
|
||||
}
|
||||
for (MapleData z : dataRoot.getData("MCGuardian.img")) {
|
||||
for (Data z : dataRoot.getData("MCGuardian.img")) {
|
||||
guardians.put(Integer.parseInt(z.getName()), new MCSkill(MapleDataTool.getInt("spendCP", z, 0), MapleDataTool.getInt("mobSkillID", z, 0), MapleDataTool.getInt("level", z, 0), true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.Character;
|
||||
import client.QuestStatus;
|
||||
import client.QuestStatus.Status;
|
||||
import config.YamlConfig;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
@@ -69,20 +69,20 @@ public class MapleQuest {
|
||||
private boolean repeatable = false;
|
||||
private String name = "", parent = "";
|
||||
private final static MapleDataProvider questData = MapleDataProviderFactory.getDataProvider(WZFiles.QUEST);
|
||||
private final static MapleData questInfo = questData.getData("QuestInfo.img");
|
||||
private final static MapleData questAct = questData.getData("Act.img");
|
||||
private final static MapleData questReq = questData.getData("Check.img");
|
||||
private final static Data questInfo = questData.getData("QuestInfo.img");
|
||||
private final static Data questAct = questData.getData("Act.img");
|
||||
private final static Data questReq = questData.getData("Check.img");
|
||||
|
||||
private MapleQuest(int id) {
|
||||
this.id = (short) id;
|
||||
|
||||
MapleData reqData = questReq.getChildByPath(String.valueOf(id));
|
||||
Data reqData = questReq.getChildByPath(String.valueOf(id));
|
||||
if (reqData == null) {//most likely infoEx
|
||||
return;
|
||||
}
|
||||
|
||||
if(questInfo != null) {
|
||||
MapleData reqInfo = questInfo.getChildByPath(String.valueOf(id));
|
||||
Data reqInfo = questInfo.getChildByPath(String.valueOf(id));
|
||||
if(reqInfo != null) {
|
||||
name = MapleDataTool.getString("name", reqInfo, "");
|
||||
parent = MapleDataTool.getString("parent", reqInfo, "");
|
||||
@@ -100,14 +100,14 @@ public class MapleQuest {
|
||||
}
|
||||
}
|
||||
|
||||
MapleData startReqData = reqData.getChildByPath("0");
|
||||
Data startReqData = reqData.getChildByPath("0");
|
||||
if (startReqData != null) {
|
||||
for (MapleData startReq : startReqData.getChildren()) {
|
||||
for (Data startReq : startReqData.getChildren()) {
|
||||
MapleQuestRequirementType type = MapleQuestRequirementType.getByWZName(startReq.getName());
|
||||
if (type.equals(MapleQuestRequirementType.INTERVAL)) {
|
||||
repeatable = true;
|
||||
} else if (type.equals(MapleQuestRequirementType.MOB)) {
|
||||
for (MapleData mob : startReq.getChildren()) {
|
||||
for (Data mob : startReq.getChildren()) {
|
||||
relevantMobs.add(MapleDataTool.getInt(mob.getChildByPath("id")));
|
||||
}
|
||||
}
|
||||
@@ -121,9 +121,9 @@ public class MapleQuest {
|
||||
}
|
||||
}
|
||||
|
||||
MapleData completeReqData = reqData.getChildByPath("1");
|
||||
Data completeReqData = reqData.getChildByPath("1");
|
||||
if (completeReqData != null) {
|
||||
for (MapleData completeReq : completeReqData.getChildren()) {
|
||||
for (Data completeReq : completeReqData.getChildren()) {
|
||||
MapleQuestRequirementType type = MapleQuestRequirementType.getByWZName(completeReq.getName());
|
||||
|
||||
MapleQuestRequirement req = this.getRequirement(type, completeReq);
|
||||
@@ -132,20 +132,20 @@ public class MapleQuest {
|
||||
}
|
||||
|
||||
if (type.equals(MapleQuestRequirementType.MOB)) {
|
||||
for (MapleData mob : completeReq.getChildren()) {
|
||||
for (Data mob : completeReq.getChildren()) {
|
||||
relevantMobs.add(MapleDataTool.getInt(mob.getChildByPath("id")));
|
||||
}
|
||||
}
|
||||
completeReqs.put(type, req);
|
||||
}
|
||||
}
|
||||
MapleData actData = questAct.getChildByPath(String.valueOf(id));
|
||||
Data actData = questAct.getChildByPath(String.valueOf(id));
|
||||
if (actData == null) {
|
||||
return;
|
||||
}
|
||||
final MapleData startActData = actData.getChildByPath("0");
|
||||
final Data startActData = actData.getChildByPath("0");
|
||||
if (startActData != null) {
|
||||
for (MapleData startAct : startActData.getChildren()) {
|
||||
for (Data startAct : startActData.getChildren()) {
|
||||
MapleQuestActionType questActionType = MapleQuestActionType.getByWZName(startAct.getName());
|
||||
MapleQuestAction act = this.getAction(questActionType, startAct);
|
||||
|
||||
@@ -155,9 +155,9 @@ public class MapleQuest {
|
||||
startActs.put(questActionType, act);
|
||||
}
|
||||
}
|
||||
MapleData completeActData = actData.getChildByPath("1");
|
||||
Data completeActData = actData.getChildByPath("1");
|
||||
if (completeActData != null) {
|
||||
for (MapleData completeAct : completeActData.getChildren()) {
|
||||
for (Data completeAct : completeActData.getChildren()) {
|
||||
MapleQuestActionType questActionType = MapleQuestActionType.getByWZName(completeAct.getName());
|
||||
MapleQuestAction act = this.getAction(questActionType, completeAct);
|
||||
|
||||
@@ -460,7 +460,7 @@ public class MapleQuest {
|
||||
quests.clear();
|
||||
}
|
||||
|
||||
private MapleQuestRequirement getRequirement(MapleQuestRequirementType type, MapleData data) {
|
||||
private MapleQuestRequirement getRequirement(MapleQuestRequirementType type, Data data) {
|
||||
MapleQuestRequirement ret = null;
|
||||
switch(type) {
|
||||
case END_DATE:
|
||||
@@ -534,7 +534,7 @@ public class MapleQuest {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private MapleQuestAction getAction(MapleQuestActionType type, MapleData data) {
|
||||
private MapleQuestAction getAction(MapleQuestActionType type, Data data) {
|
||||
MapleQuestAction ret = null;
|
||||
switch(type) {
|
||||
case BUFF:
|
||||
@@ -653,7 +653,7 @@ public class MapleQuest {
|
||||
final Map<Integer, MapleQuest> loadedQuests = new HashMap<>();
|
||||
final Map<Integer, Integer> loadedInfoNumberQuests = new HashMap<>();
|
||||
|
||||
for (MapleData quest : questInfo.getChildren()) {
|
||||
for (Data quest : questInfo.getChildren()) {
|
||||
int questID = Integer.parseInt(quest.getName());
|
||||
|
||||
MapleQuest q = new MapleQuest(questID);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.quest.MapleQuest;
|
||||
@@ -35,7 +35,7 @@ import server.quest.MapleQuestActionType;
|
||||
public class BuffAction extends MapleQuestAction {
|
||||
int itemEffect;
|
||||
|
||||
public BuffAction(MapleQuest quest, MapleData data) {
|
||||
public BuffAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.BUFF, quest);
|
||||
processData(data);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class BuffAction extends MapleQuestAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
itemEffect = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import config.YamlConfig;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -35,14 +35,14 @@ import server.quest.MapleQuestActionType;
|
||||
public class ExpAction extends MapleQuestAction {
|
||||
int exp;
|
||||
|
||||
public ExpAction(MapleQuest quest, MapleData data) {
|
||||
public ExpAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.EXP, quest);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
exp = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -34,7 +34,7 @@ import server.quest.MapleQuestActionType;
|
||||
public class FameAction extends MapleQuestAction {
|
||||
int fame;
|
||||
|
||||
public FameAction(MapleQuest quest, MapleData data) {
|
||||
public FameAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.FAME, quest);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
@@ -42,7 +42,7 @@ public class FameAction extends MapleQuestAction {
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
fame = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -34,14 +34,14 @@ public class InfoAction extends MapleQuestAction {
|
||||
private String info;
|
||||
private int questID;
|
||||
|
||||
public InfoAction(MapleQuest quest, MapleData data) {
|
||||
public InfoAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.INFO, quest);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
info = MapleDataTool.getString(data, "");
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.quest.MapleQuest;
|
||||
@@ -50,21 +50,21 @@ import java.util.List;
|
||||
public class ItemAction extends MapleQuestAction {
|
||||
List<ItemData> items = new ArrayList<>();
|
||||
|
||||
public ItemAction(MapleQuest quest, MapleData data) {
|
||||
public ItemAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.ITEM, quest);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
for (MapleData iEntry : data.getChildren()) {
|
||||
public void processData(Data data) {
|
||||
for (Data iEntry : data.getChildren()) {
|
||||
int id = MapleDataTool.getInt(iEntry.getChildByPath("id"));
|
||||
int count = MapleDataTool.getInt(iEntry.getChildByPath("count"), 1);
|
||||
int period = MapleDataTool.getInt(iEntry.getChildByPath("period"), 0);
|
||||
|
||||
Integer prop = null;
|
||||
MapleData propData = iEntry.getChildByPath("prop");
|
||||
Data propData = iEntry.getChildByPath("prop");
|
||||
if(propData != null)
|
||||
prop = MapleDataTool.getInt(propData);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
|
||||
@@ -40,7 +40,7 @@ public abstract class MapleQuestAction {
|
||||
}
|
||||
|
||||
public abstract void run(Character chr, Integer extSelection);
|
||||
public abstract void processData(MapleData data);
|
||||
public abstract void processData(Data data);
|
||||
|
||||
public boolean check(Character chr, Integer extSelection) {
|
||||
return true;
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import config.YamlConfig;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -35,7 +35,7 @@ import server.quest.MapleQuestActionType;
|
||||
public class MesoAction extends MapleQuestAction {
|
||||
int mesos;
|
||||
|
||||
public MesoAction(MapleQuest quest, MapleData data) {
|
||||
public MesoAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.MESO, quest);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
@@ -43,7 +43,7 @@ public class MesoAction extends MapleQuestAction {
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
mesos = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import client.QuestStatus;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -36,14 +36,14 @@ import tools.PacketCreator;
|
||||
public class NextQuestAction extends MapleQuestAction {
|
||||
int nextQuest;
|
||||
|
||||
public NextQuestAction(MapleQuest quest, MapleData data) {
|
||||
public NextQuestAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.NEXTQUEST, quest);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
nextQuest = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ package server.quest.actions;
|
||||
import client.Character;
|
||||
import client.QuestStatus;
|
||||
import constants.inventory.ItemConstants;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -36,7 +36,7 @@ import server.quest.MapleQuestActionType;
|
||||
public class PetSkillAction extends MapleQuestAction {
|
||||
int flag;
|
||||
|
||||
public PetSkillAction(MapleQuest quest, MapleData data) {
|
||||
public PetSkillAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.PETSKILL, quest);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
@@ -44,7 +44,7 @@ public class PetSkillAction extends MapleQuestAction {
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
flag = MapleDataTool.getInt("petskill", data);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ package server.quest.actions;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.inventory.Pet;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
|
||||
@@ -32,14 +32,14 @@ import server.quest.MapleQuestActionType;
|
||||
*/
|
||||
public class PetSpeedAction extends MapleQuestAction {
|
||||
|
||||
public PetSpeedAction(MapleQuest quest, MapleData data) {
|
||||
public PetSpeedAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.PETTAMENESS, quest);
|
||||
questID = quest.getId();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {}
|
||||
public void processData(Data data) {}
|
||||
|
||||
@Override
|
||||
public void run(Character chr, Integer extSelection) {
|
||||
|
||||
@@ -22,7 +22,7 @@ package server.quest.actions;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.inventory.Pet;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -34,7 +34,7 @@ import server.quest.MapleQuestActionType;
|
||||
public class PetTamenessAction extends MapleQuestAction {
|
||||
int tameness;
|
||||
|
||||
public PetTamenessAction(MapleQuest quest, MapleData data) {
|
||||
public PetTamenessAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.PETTAMENESS, quest);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
@@ -42,7 +42,7 @@ public class PetTamenessAction extends MapleQuestAction {
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
tameness = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import client.QuestStatus;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -39,7 +39,7 @@ public class QuestAction extends MapleQuestAction {
|
||||
int mesos;
|
||||
Map<Integer, Integer> quests = new HashMap<>();
|
||||
|
||||
public QuestAction(MapleQuest quest, MapleData data) {
|
||||
public QuestAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.QUEST, quest);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
@@ -47,8 +47,8 @@ public class QuestAction extends MapleQuestAction {
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
for (MapleData qEntry : data) {
|
||||
public void processData(Data data) {
|
||||
for (Data qEntry : data) {
|
||||
int questid = MapleDataTool.getInt(qEntry.getChildByPath("id"));
|
||||
int stat = MapleDataTool.getInt(qEntry.getChildByPath("state"));
|
||||
quests.put(questid, stat);
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.Character;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestActionType;
|
||||
@@ -43,26 +43,26 @@ public class SkillAction extends MapleQuestAction {
|
||||
int itemEffect;
|
||||
Map<Integer, SkillData> skillData = new HashMap<>();
|
||||
|
||||
public SkillAction(MapleQuest quest, MapleData data) {
|
||||
public SkillAction(MapleQuest quest, Data data) {
|
||||
super(MapleQuestActionType.SKILL, quest);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
for (MapleData sEntry : data) {
|
||||
public void processData(Data data) {
|
||||
for (Data sEntry : data) {
|
||||
byte skillLevel = 0;
|
||||
int skillid = MapleDataTool.getInt(sEntry.getChildByPath("id"));
|
||||
MapleData skillLevelData = sEntry.getChildByPath("skillLevel");
|
||||
Data skillLevelData = sEntry.getChildByPath("skillLevel");
|
||||
if(skillLevelData != null)
|
||||
skillLevel = (byte) MapleDataTool.getInt(skillLevelData);
|
||||
int masterLevel = MapleDataTool.getInt(sEntry.getChildByPath("masterLevel"));
|
||||
List<Integer> jobs = new ArrayList<>();
|
||||
|
||||
MapleData applicableJobs = sEntry.getChildByPath("job");
|
||||
Data applicableJobs = sEntry.getChildByPath("job");
|
||||
if(applicableJobs != null) {
|
||||
for (MapleData applicableJob : applicableJobs.getChildren()) {
|
||||
for (Data applicableJob : applicableJobs.getChildren()) {
|
||||
jobs.add(MapleDataTool.getInt(applicableJob));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -32,13 +32,13 @@ import server.quest.MapleQuestRequirementType;
|
||||
public class BuffExceptRequirement extends MapleQuestRequirement {
|
||||
private int buffId = -1;
|
||||
|
||||
public BuffExceptRequirement(MapleQuest quest, MapleData data) {
|
||||
public BuffExceptRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.BUFF);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
// item buffs are negative
|
||||
buffId = -1 * Integer.parseInt(MapleDataTool.getString(data));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -32,13 +32,13 @@ import server.quest.MapleQuestRequirementType;
|
||||
public class BuffRequirement extends MapleQuestRequirement {
|
||||
private int buffId = 1;
|
||||
|
||||
public BuffRequirement(MapleQuest quest, MapleData data) {
|
||||
public BuffRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.BUFF);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
// item buffs are negative
|
||||
buffId = -1 * Integer.parseInt(MapleDataTool.getString(data));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -35,13 +35,13 @@ public class CompletedQuestRequirement extends MapleQuestRequirement {
|
||||
private int reqQuest;
|
||||
|
||||
|
||||
public CompletedQuestRequirement(MapleQuest quest, MapleData data) {
|
||||
public CompletedQuestRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.COMPLETED_QUEST);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
reqQuest = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -37,7 +37,7 @@ public class EndDateRequirement extends MapleQuestRequirement {
|
||||
private String timeStr;
|
||||
|
||||
|
||||
public EndDateRequirement(MapleQuest quest, MapleData data) {
|
||||
public EndDateRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.END_DATE);
|
||||
processData(data);
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class EndDateRequirement extends MapleQuestRequirement {
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
timeStr = MapleDataTool.getString(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -35,14 +35,14 @@ public class FieldEnterRequirement extends MapleQuestRequirement {
|
||||
private int mapId = -1;
|
||||
|
||||
|
||||
public FieldEnterRequirement(MapleQuest quest, MapleData data) {
|
||||
public FieldEnterRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.FIELD_ENTER);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
MapleData zeroField = data.getChildByPath("0");
|
||||
public void processData(Data data) {
|
||||
Data zeroField = data.getChildByPath("0");
|
||||
if (zeroField != null) {
|
||||
mapId = MapleDataTool.getInt(zeroField);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -39,17 +39,17 @@ public class InfoExRequirement extends MapleQuestRequirement {
|
||||
private int questID;
|
||||
|
||||
|
||||
public InfoExRequirement(MapleQuest quest, MapleData data) {
|
||||
public InfoExRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.INFO_EX);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
// Because we have to...
|
||||
for(MapleData infoEx : data.getChildren()) {
|
||||
MapleData value = infoEx.getChildByPath("value");
|
||||
for(Data infoEx : data.getChildren()) {
|
||||
Data value = infoEx.getChildByPath("value");
|
||||
infoExpected.add(MapleDataTool.getString(value, ""));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -34,14 +34,14 @@ public class InfoNumberRequirement extends MapleQuestRequirement {
|
||||
private short infoNumber;
|
||||
private int questID;
|
||||
|
||||
public InfoNumberRequirement(MapleQuest quest, MapleData data) {
|
||||
public InfoNumberRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.INFO_NUMBER);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
infoNumber = (short) MapleDataTool.getIntConvert(data, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import client.QuestStatus;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -36,7 +36,7 @@ public class IntervalRequirement extends MapleQuestRequirement {
|
||||
private int interval = -1;
|
||||
private int questID;
|
||||
|
||||
public IntervalRequirement(MapleQuest quest, MapleData data) {
|
||||
public IntervalRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.INTERVAL);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
@@ -47,7 +47,7 @@ public class IntervalRequirement extends MapleQuestRequirement {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
interval = MapleDataTool.getInt(data) * 60 * 1000;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.Character;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import constants.inventory.ItemConstants;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.quest.MapleQuest;
|
||||
@@ -42,14 +42,14 @@ public class ItemRequirement extends MapleQuestRequirement {
|
||||
Map<Integer, Integer> items = new HashMap<>();
|
||||
|
||||
|
||||
public ItemRequirement(MapleQuest quest, MapleData data) {
|
||||
public ItemRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.ITEM);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
for (MapleData itemEntry : data.getChildren()) {
|
||||
public void processData(Data data) {
|
||||
for (Data itemEntry : data.getChildren()) {
|
||||
int itemId = MapleDataTool.getInt(itemEntry.getChildByPath("id"));
|
||||
int count = MapleDataTool.getInt(itemEntry.getChildByPath("count"), 0);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import client.Job;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -38,7 +38,7 @@ import java.util.List;
|
||||
public class JobRequirement extends MapleQuestRequirement {
|
||||
List<Integer> jobs = new ArrayList<>();
|
||||
|
||||
public JobRequirement(MapleQuest quest, MapleData data) {
|
||||
public JobRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.JOB);
|
||||
processData(data);
|
||||
}
|
||||
@@ -48,8 +48,8 @@ public class JobRequirement extends MapleQuestRequirement {
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
for (MapleData jobEntry : data.getChildren()) {
|
||||
public void processData(Data data) {
|
||||
for (Data jobEntry : data.getChildren()) {
|
||||
jobs.add(MapleDataTool.getInt(jobEntry));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ public abstract class MapleQuestRequirement {
|
||||
* Processes the data and stores it in the class for future use.
|
||||
* @param data The data to process.
|
||||
*/
|
||||
public abstract void processData(MapleData data);
|
||||
public abstract void processData(Data data);
|
||||
|
||||
public MapleQuestRequirementType getType() {
|
||||
return type;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -35,7 +35,7 @@ public class MaxLevelRequirement extends MapleQuestRequirement {
|
||||
private int maxLevel;
|
||||
|
||||
|
||||
public MaxLevelRequirement(MapleQuest quest, MapleData data) {
|
||||
public MaxLevelRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.MAX_LEVEL);
|
||||
processData(data);
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class MaxLevelRequirement extends MapleQuestRequirement {
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
maxLevel = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -32,13 +32,13 @@ import server.quest.MapleQuestRequirementType;
|
||||
public class MesoRequirement extends MapleQuestRequirement {
|
||||
private int meso = 0;
|
||||
|
||||
public MesoRequirement(MapleQuest quest, MapleData data) {
|
||||
public MesoRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.MESO);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
meso = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -35,14 +35,14 @@ public class MinLevelRequirement extends MapleQuestRequirement {
|
||||
private int minLevel;
|
||||
|
||||
|
||||
public MinLevelRequirement(MapleQuest quest, MapleData data) {
|
||||
public MinLevelRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.MIN_LEVEL);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
minLevel = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import client.inventory.Pet;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -36,7 +36,7 @@ public class MinTamenessRequirement extends MapleQuestRequirement {
|
||||
private int minTameness;
|
||||
|
||||
|
||||
public MinTamenessRequirement(MapleQuest quest, MapleData data) {
|
||||
public MinTamenessRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.MIN_PET_TAMENESS);
|
||||
processData(data);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class MinTamenessRequirement extends MapleQuestRequirement {
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
minTameness = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import client.QuestStatus;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -40,7 +40,7 @@ public class MobRequirement extends MapleQuestRequirement {
|
||||
Map<Integer, Integer> mobs = new HashMap<>();
|
||||
private int questID;
|
||||
|
||||
public MobRequirement(MapleQuest quest, MapleData data) {
|
||||
public MobRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.MOB);
|
||||
questID = quest.getId();
|
||||
processData(data);
|
||||
@@ -51,8 +51,8 @@ public class MobRequirement extends MapleQuestRequirement {
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
for (MapleData questEntry : data.getChildren()) {
|
||||
public void processData(Data data) {
|
||||
for (Data questEntry : data.getChildren()) {
|
||||
int mobID = MapleDataTool.getInt(questEntry.getChildByPath("id"));
|
||||
int countReq = MapleDataTool.getInt(questEntry.getChildByPath("count"));
|
||||
mobs.put(mobID, countReq);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -35,13 +35,13 @@ public class MonsterBookCountRequirement extends MapleQuestRequirement {
|
||||
private int reqCards;
|
||||
|
||||
|
||||
public MonsterBookCountRequirement(MapleQuest quest, MapleData data) {
|
||||
public MonsterBookCountRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.MONSTER_BOOK);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
reqCards = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -34,13 +34,13 @@ import server.quest.MapleQuestRequirementType;
|
||||
public class NpcRequirement extends MapleQuestRequirement {
|
||||
private int reqNPC;
|
||||
|
||||
public NpcRequirement(MapleQuest quest, MapleData data) {
|
||||
public NpcRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.NPC);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
reqNPC = MapleDataTool.getInt(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import client.inventory.Pet;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -39,15 +39,15 @@ public class PetRequirement extends MapleQuestRequirement {
|
||||
List<Integer> petIDs = new ArrayList<>();
|
||||
|
||||
|
||||
public PetRequirement(MapleQuest quest, MapleData data) {
|
||||
public PetRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.PET);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
for(MapleData petData : data.getChildren()) {
|
||||
public void processData(Data data) {
|
||||
for(Data petData : data.getChildren()) {
|
||||
petIDs.add(MapleDataTool.getInt(petData.getChildByPath("id")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import client.QuestStatus;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -35,7 +35,7 @@ import java.util.Map;
|
||||
public class QuestRequirement extends MapleQuestRequirement {
|
||||
Map<Integer, Integer> quests = new HashMap<>();
|
||||
|
||||
public QuestRequirement(MapleQuest quest, MapleData data) {
|
||||
public QuestRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.QUEST);
|
||||
processData(data);
|
||||
}
|
||||
@@ -45,8 +45,8 @@ public class QuestRequirement extends MapleQuestRequirement {
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
for (MapleData questEntry : data.getChildren()) {
|
||||
public void processData(Data data) {
|
||||
for (Data questEntry : data.getChildren()) {
|
||||
int questID = MapleDataTool.getInt(questEntry.getChildByPath("id"));
|
||||
int stateReq = MapleDataTool.getInt(questEntry.getChildByPath("state"));
|
||||
quests.put(questID, stateReq);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import provider.MapleData;
|
||||
import provider.Data;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
import server.quest.MapleQuestRequirementType;
|
||||
@@ -32,13 +32,13 @@ import server.quest.MapleQuestRequirementType;
|
||||
public class ScriptRequirement extends MapleQuestRequirement {
|
||||
private boolean reqScript;
|
||||
|
||||
public ScriptRequirement(MapleQuest quest, MapleData data) {
|
||||
public ScriptRequirement(MapleQuest quest, Data data) {
|
||||
super(MapleQuestRequirementType.BUFF);
|
||||
processData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processData(MapleData data) {
|
||||
public void processData(Data data) {
|
||||
reqScript = !MapleDataTool.getString(data, "").isEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.*;
|
||||
public class MonsterStatFetcher {
|
||||
private static final MapleDataProvider data = MapleDataProviderFactory.getDataProvider(WZFiles.MOB);
|
||||
private static final MapleDataProvider stringDataWZ = MapleDataProviderFactory.getDataProvider(WZFiles.STRING);
|
||||
private static final MapleData mobStringData = stringDataWZ.getData("Mob.img");
|
||||
private static final Data mobStringData = stringDataWZ.getData("Mob.img");
|
||||
private static final Map<Integer, MapleMonsterStats> monsterStats = new HashMap<>();
|
||||
|
||||
static Map<Integer, MapleMonsterStats> getAllMonsterStats() {
|
||||
@@ -28,14 +28,14 @@ public class MonsterStatFetcher {
|
||||
String fileName = mFile.getName();
|
||||
|
||||
//System.out.println("Parsing '" + fileName + "'");
|
||||
MapleData monsterData = data.getData(fileName);
|
||||
Data monsterData = data.getData(fileName);
|
||||
if (monsterData == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Integer mid = getMonsterId(fileName);
|
||||
|
||||
MapleData monsterInfoData = monsterData.getChildByPath("info");
|
||||
Data monsterInfoData = monsterData.getChildByPath("info");
|
||||
MapleMonsterStats stats = new MapleMonsterStats();
|
||||
stats.setHp(MapleDataTool.getIntConvert("maxHP", monsterInfoData));
|
||||
stats.setFriendly(MapleDataTool.getIntConvert("damagedByMob", monsterInfoData, 0) == 1);
|
||||
@@ -56,7 +56,7 @@ public class MonsterStatFetcher {
|
||||
stats.setCP(MapleDataTool.getIntConvert("getCP", monsterInfoData, 0));
|
||||
stats.setRemoveOnMiss(MapleDataTool.getIntConvert("removeOnMiss", monsterInfoData, 0) > 0);
|
||||
|
||||
MapleData special = monsterInfoData.getChildByPath("coolDamage");
|
||||
Data special = monsterInfoData.getChildByPath("coolDamage");
|
||||
if (special != null) {
|
||||
int coolDmg = MapleDataTool.getIntConvert("coolDamage", monsterInfoData);
|
||||
int coolProb = MapleDataTool.getIntConvert("coolDamageProb", monsterInfoData, 0);
|
||||
@@ -64,7 +64,7 @@ public class MonsterStatFetcher {
|
||||
}
|
||||
special = monsterInfoData.getChildByPath("loseItem");
|
||||
if (special != null) {
|
||||
for (MapleData liData : special.getChildren()) {
|
||||
for (Data liData : special.getChildren()) {
|
||||
stats.addLoseItem(new loseItem(MapleDataTool.getInt(liData.getChildByPath("id")), (byte) MapleDataTool.getInt(liData.getChildByPath("prop")), (byte) MapleDataTool.getInt(liData.getChildByPath("x"))));
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class MonsterStatFetcher {
|
||||
if (special != null) {
|
||||
stats.setSelfDestruction(new selfDestruction((byte) MapleDataTool.getInt(special.getChildByPath("action")), MapleDataTool.getIntConvert("removeAfter", special, -1), MapleDataTool.getIntConvert("hp", special, -1)));
|
||||
}
|
||||
MapleData firstAttackData = monsterInfoData.getChildByPath("firstAttack");
|
||||
Data firstAttackData = monsterInfoData.getChildByPath("firstAttack");
|
||||
int firstAttack = 0;
|
||||
if (firstAttackData != null) {
|
||||
if (firstAttackData.getType() == DataType.FLOAT) {
|
||||
@@ -87,25 +87,25 @@ public class MonsterStatFetcher {
|
||||
stats.setTagColor(MapleDataTool.getIntConvert("hpTagColor", monsterInfoData, 0));
|
||||
stats.setTagBgColor(MapleDataTool.getIntConvert("hpTagBgcolor", monsterInfoData, 0));
|
||||
|
||||
for (MapleData idata : monsterData) {
|
||||
for (Data idata : monsterData) {
|
||||
if (!idata.getName().equals("info")) {
|
||||
int delay = 0;
|
||||
for (MapleData pic : idata.getChildren()) {
|
||||
for (Data pic : idata.getChildren()) {
|
||||
delay += MapleDataTool.getIntConvert("delay", pic, 0);
|
||||
}
|
||||
stats.setAnimationTime(idata.getName(), delay);
|
||||
}
|
||||
}
|
||||
MapleData reviveInfo = monsterInfoData.getChildByPath("revive");
|
||||
Data reviveInfo = monsterInfoData.getChildByPath("revive");
|
||||
if (reviveInfo != null) {
|
||||
List<Integer> revives = new LinkedList<>();
|
||||
for (MapleData data_ : reviveInfo) {
|
||||
for (Data data_ : reviveInfo) {
|
||||
revives.add(MapleDataTool.getInt(data_));
|
||||
}
|
||||
stats.setRevives(revives);
|
||||
}
|
||||
decodeElementalString(stats, MapleDataTool.getString("elemAttr", monsterInfoData, ""));
|
||||
MapleData monsterSkillData = monsterInfoData.getChildByPath("skill");
|
||||
Data monsterSkillData = monsterInfoData.getChildByPath("skill");
|
||||
if (monsterSkillData != null) {
|
||||
int i = 0;
|
||||
List<Pair<Integer, Integer>> skills = new ArrayList<>();
|
||||
@@ -115,7 +115,7 @@ public class MonsterStatFetcher {
|
||||
}
|
||||
stats.setSkills(skills);
|
||||
}
|
||||
MapleData banishData = monsterInfoData.getChildByPath("ban");
|
||||
Data banishData = monsterInfoData.getChildByPath("ban");
|
||||
if (banishData != null) {
|
||||
stats.setBanishInfo(new BanishInfo(MapleDataTool.getString("banMsg", banishData), MapleDataTool.getInt("banMap/0/field", banishData, -1), MapleDataTool.getString("banMap/0/portal", banishData, "sp")));
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ public class NoItemNameFetcher {
|
||||
UNDEF, ACCESSORY, CAP, CAPE, COAT, FACE, GLOVE, HAIR, LONGCOAT, PANTS, PETEQUIP, RING, SHIELD, SHOES, TAMING, WEAPON
|
||||
}
|
||||
|
||||
private static void processStringSubdirectoryData(MapleData subdirData, String subdirPath) {
|
||||
for (MapleData md : subdirData.getChildren()) {
|
||||
private static void processStringSubdirectoryData(Data subdirData, String subdirPath) {
|
||||
for (Data md : subdirData.getChildren()) {
|
||||
try {
|
||||
MapleData nameData = md.getChildByPath("name");
|
||||
MapleData descData = md.getChildByPath("desc");
|
||||
Data nameData = md.getChildByPath("name");
|
||||
Data descData = md.getChildByPath("desc");
|
||||
|
||||
int itemId = Integer.parseInt(md.getName());
|
||||
if (nameData != null && descData != null) {
|
||||
@@ -64,9 +64,9 @@ public class NoItemNameFetcher {
|
||||
}
|
||||
}
|
||||
|
||||
private static void readStringSubdirectoryData(MapleData subdirData, int depth, String subdirPath) {
|
||||
private static void readStringSubdirectoryData(Data subdirData, int depth, String subdirPath) {
|
||||
if (depth > 0) {
|
||||
for (MapleData mDir : subdirData.getChildren()) {
|
||||
for (Data mDir : subdirData.getChildren()) {
|
||||
readStringSubdirectoryData(mDir, depth - 1, subdirPath + mDir.getName() + "/");
|
||||
}
|
||||
} else {
|
||||
@@ -74,7 +74,7 @@ public class NoItemNameFetcher {
|
||||
}
|
||||
}
|
||||
|
||||
private static void readStringSubdirectoryData(MapleData subdirData, int depth) {
|
||||
private static void readStringSubdirectoryData(Data subdirData, int depth) {
|
||||
readStringSubdirectoryData(subdirData, depth, "");
|
||||
}
|
||||
|
||||
@@ -82,22 +82,22 @@ public class NoItemNameFetcher {
|
||||
System.out.println("Parsing String.wz...");
|
||||
MapleDataProvider stringData = MapleDataProviderFactory.getDataProvider(WZFiles.STRING);
|
||||
|
||||
MapleData cashStringData = stringData.getData("Cash.img");
|
||||
Data cashStringData = stringData.getData("Cash.img");
|
||||
readStringSubdirectoryData(cashStringData, 0);
|
||||
|
||||
MapleData consumeStringData = stringData.getData("Consume.img");
|
||||
Data consumeStringData = stringData.getData("Consume.img");
|
||||
readStringSubdirectoryData(consumeStringData, 0);
|
||||
|
||||
MapleData eqpStringData = stringData.getData("Eqp.img");
|
||||
Data eqpStringData = stringData.getData("Eqp.img");
|
||||
readStringSubdirectoryData(eqpStringData, 2);
|
||||
|
||||
MapleData etcStringData = stringData.getData("Etc.img");
|
||||
Data etcStringData = stringData.getData("Etc.img");
|
||||
readStringSubdirectoryData(etcStringData, 1);
|
||||
|
||||
MapleData insStringData = stringData.getData("Ins.img");
|
||||
Data insStringData = stringData.getData("Ins.img");
|
||||
readStringSubdirectoryData(insStringData, 0);
|
||||
|
||||
MapleData petStringData = stringData.getData("Pet.img");
|
||||
Data petStringData = stringData.getData("Pet.img");
|
||||
readStringSubdirectoryData(petStringData, 0);
|
||||
}
|
||||
|
||||
@@ -178,8 +178,8 @@ public class NoItemNameFetcher {
|
||||
|
||||
if (!isAccessory(itemId) && !isTamingMob(itemId)) {
|
||||
try {
|
||||
MapleData fileData = data.getData(dirName + "/" + fileName);
|
||||
MapleData mdinfo = fileData.getChildByPath("info");
|
||||
Data fileData = data.getData(dirName + "/" + fileName);
|
||||
Data mdinfo = fileData.getChildByPath("info");
|
||||
if (mdinfo.getChildByPath("cash") == null) {
|
||||
equipsWithNoCashProperty.add(itemId);
|
||||
}
|
||||
@@ -227,8 +227,8 @@ public class NoItemNameFetcher {
|
||||
for (MapleDataFileEntry mFile : mDir.getFiles()) {
|
||||
String fileName = mFile.getName();
|
||||
|
||||
MapleData fileData = data.getData(dirName + "/" + fileName);
|
||||
for (MapleData mData : fileData.getChildren()) {
|
||||
Data fileData = data.getData(dirName + "/" + fileName);
|
||||
for (Data mData : fileData.getChildren()) {
|
||||
try {
|
||||
int itemId = Integer.parseInt(mData.getName());
|
||||
itemsWithNoNameProperty.put(itemId, curType);
|
||||
|
||||
Reference in New Issue
Block a user