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