Rename and clean up MapleDataTool
This commit is contained in:
@@ -62,8 +62,8 @@ public class SkillFactory {
|
|||||||
private static Skill loadFromData(int id, Data 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 = DataTool.getInt("skillType", data, -1);
|
||||||
String elem = MapleDataTool.getString("elemAttr", data, null);
|
String elem = DataTool.getString("elemAttr", data, null);
|
||||||
if (elem != null) {
|
if (elem != null) {
|
||||||
ret.setElement(Element.getFromChar(elem.charAt(0)));
|
ret.setElement(Element.getFromChar(elem.charAt(0)));
|
||||||
} else {
|
} else {
|
||||||
@@ -95,7 +95,7 @@ public class SkillFactory {
|
|||||||
Data hit = data.getChildByPath("hit");
|
Data hit = data.getChildByPath("hit");
|
||||||
Data 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 && DataTool.getString("0", action_, "").equals("alert2");
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case Hero.RUSH:
|
case Hero.RUSH:
|
||||||
case Paladin.RUSH:
|
case Paladin.RUSH:
|
||||||
@@ -323,7 +323,7 @@ public class SkillFactory {
|
|||||||
ret.setAnimationTime(0);
|
ret.setAnimationTime(0);
|
||||||
if (effect != null) {
|
if (effect != null) {
|
||||||
for (Data effectEntry : effect) {
|
for (Data effectEntry : effect) {
|
||||||
ret.incAnimationTime(MapleDataTool.getIntConvert("delay", effectEntry, 0));
|
ret.incAnimationTime(DataTool.getIntConvert("delay", effectEntry, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -340,7 +340,7 @@ public class SkillFactory {
|
|||||||
if (data.getChildByPath(skill.toString()) != null) {
|
if (data.getChildByPath(skill.toString()) != null) {
|
||||||
for (Data 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 DataTool.getString(skilldata, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import client.command.Command;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
@@ -86,7 +86,7 @@ public class SearchCommand extends Command {
|
|||||||
|
|
||||||
if (searchType == 0) {
|
if (searchType == 0) {
|
||||||
for (Data searchData : data.getChildren()) {
|
for (Data searchData : data.getChildren()) {
|
||||||
name = MapleDataTool.getString(searchData.getChildByPath("name"), "NO-NAME");
|
name = DataTool.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");
|
||||||
}
|
}
|
||||||
@@ -96,8 +96,8 @@ public class SearchCommand extends Command {
|
|||||||
|
|
||||||
for (Data searchDataDir : data.getChildren()) {
|
for (Data searchDataDir : data.getChildren()) {
|
||||||
for (Data searchData : searchDataDir.getChildren()) {
|
for (Data searchData : searchDataDir.getChildren()) {
|
||||||
mapName = MapleDataTool.getString(searchData.getChildByPath("mapName"), "NO-NAME");
|
mapName = DataTool.getString(searchData.getChildByPath("mapName"), "NO-NAME");
|
||||||
streetName = MapleDataTool.getString(searchData.getChildByPath("streetName"), "NO-NAME");
|
streetName = DataTool.getString(searchData.getChildByPath("streetName"), "NO-NAME");
|
||||||
|
|
||||||
if (mapName.toLowerCase().contains(search.toLowerCase()) || streetName.toLowerCase().contains(search.toLowerCase())) {
|
if (mapName.toLowerCase().contains(search.toLowerCase()) || streetName.toLowerCase().contains(search.toLowerCase())) {
|
||||||
sb.append("#b").append(Integer.parseInt(searchData.getName())).append("#k - #r").append(streetName).append(" - ").append(mapName).append("\r\n");
|
sb.append("#b").append(Integer.parseInt(searchData.getName())).append("#k - #r").append(streetName).append(" - ").append(mapName).append("\r\n");
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package client.inventory;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -51,8 +51,8 @@ public class PetDataFactory {
|
|||||||
int prob = 0;
|
int prob = 0;
|
||||||
int inc = 0;
|
int inc = 0;
|
||||||
if (skillData != null) {
|
if (skillData != null) {
|
||||||
prob = MapleDataTool.getInt("interact/" + skillId + "/prob", skillData, 0);
|
prob = DataTool.getInt("interact/" + skillId + "/prob", skillData, 0);
|
||||||
inc = MapleDataTool.getInt("interact/" + skillId + "/inc", skillData, 0);
|
inc = DataTool.getInt("interact/" + skillId + "/inc", skillData, 0);
|
||||||
}
|
}
|
||||||
ret = new PetCommand(petId, skillId, prob, inc);
|
ret = new PetCommand(petId, skillId, prob, inc);
|
||||||
petCommands.put(petId + "" + skillId, ret);
|
petCommands.put(petId + "" + skillId, ret);
|
||||||
@@ -69,7 +69,7 @@ public class PetDataFactory {
|
|||||||
synchronized (petHunger) {
|
synchronized (petHunger) {
|
||||||
ret = petHunger.get(petId);
|
ret = petHunger.get(petId);
|
||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
ret = MapleDataTool.getInt(dataRoot.getData("Pet/" + petId + ".img").getChildByPath("info/hungry"), 1);
|
ret = DataTool.getInt(dataRoot.getData("Pet/" + petId + ".img").getChildByPath("info/hungry"), 1);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import client.inventory.Pet;
|
|||||||
import client.inventory.manipulator.InventoryManipulator;
|
import client.inventory.manipulator.InventoryManipulator;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.PacketCreator;
|
import tools.PacketCreator;
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public class SpawnPetProcessor {
|
|||||||
c.sendPacket(PacketCreator.enableActions());
|
c.sendPacket(PacketCreator.enableActions());
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
int evolveid = MapleDataTool.getInt("info/evol1", dataRoot.getData("Pet/" + petid + ".img"));
|
int evolveid = DataTool.getInt("info/evol1", dataRoot.getData("Pet/" + petid + ".img"));
|
||||||
int petId = Pet.createPet(evolveid);
|
int petId = Pet.createPet(evolveid);
|
||||||
if (petId == -1) {
|
if (petId == -1) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -689,7 +689,7 @@ public class GameConstants {
|
|||||||
for (Data l0 : mapSource.getData(objData.getName() + "/" + obj.getName()).getChildren()) {
|
for (Data l0 : mapSource.getData(objData.getName() + "/" + obj.getName()).getChildren()) {
|
||||||
for (Data l1 : l0.getChildren()) {
|
for (Data l1 : l0.getChildren()) {
|
||||||
for (Data l2 : l1.getChildren()) {
|
for (Data l2 : l1.getChildren()) {
|
||||||
int objDmg = MapleDataTool.getIntConvert("s1/mobdamage", l2, 0);
|
int objDmg = DataTool.getIntConvert("s1/mobdamage", l2, 0);
|
||||||
if (maxMobDmg < objDmg) {
|
if (maxMobDmg < objDmg) {
|
||||||
maxMobDmg = objDmg;
|
maxMobDmg = objDmg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import net.server.coordinator.world.InviteCoordinator.InviteType;
|
|||||||
import net.server.world.Party;
|
import net.server.world.Party;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.PacketCreator;
|
import tools.PacketCreator;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
@@ -76,7 +76,7 @@ public class PartySearchCoordinator {
|
|||||||
mapLinks.put(mapid, neighborMaps);
|
mapLinks.put(mapid, neighborMaps);
|
||||||
|
|
||||||
for (Data neighbordata : mapdata.getChildren()) {
|
for (Data neighbordata : mapdata.getChildren()) {
|
||||||
int neighborid = MapleDataTool.getInt(neighbordata, 999999999);
|
int neighborid = DataTool.getInt(neighbordata, 999999999);
|
||||||
|
|
||||||
if (neighborid != 999999999) {
|
if (neighborid != 999999999) {
|
||||||
neighborMaps.add(neighborid);
|
neighborMaps.add(neighborid);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import provider.wz.DataType;
|
|||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class MapleDataTool {
|
public class DataTool {
|
||||||
public static String getString(Data data) {
|
public static String getString(Data data) {
|
||||||
return ((String) data.getData());
|
return ((String) data.getData());
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.DatabaseConnection;
|
import tools.DatabaseConnection;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
@@ -154,12 +154,12 @@ 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 (Data item : etc.getData("Commodity.img").getChildren()) {
|
for (Data item : etc.getData("Commodity.img").getChildren()) {
|
||||||
int sn = MapleDataTool.getIntConvert("SN", item);
|
int sn = DataTool.getIntConvert("SN", item);
|
||||||
int itemId = MapleDataTool.getIntConvert("ItemId", item);
|
int itemId = DataTool.getIntConvert("ItemId", item);
|
||||||
int price = MapleDataTool.getIntConvert("Price", item, 0);
|
int price = DataTool.getIntConvert("Price", item, 0);
|
||||||
long period = MapleDataTool.getIntConvert("Period", item, 1);
|
long period = DataTool.getIntConvert("Period", item, 1);
|
||||||
short count = (short) MapleDataTool.getIntConvert("Count", item, 1);
|
short count = (short) DataTool.getIntConvert("Count", item, 1);
|
||||||
boolean onSale = MapleDataTool.getIntConvert("OnSale", item, 0) == 1;
|
boolean onSale = DataTool.getIntConvert("OnSale", item, 0) == 1;
|
||||||
loadedItems.put(sn, new CashItem(sn, itemId, price, period, count, onSale));
|
loadedItems.put(sn, new CashItem(sn, itemId, price, period, count, onSale));
|
||||||
|
|
||||||
if (onSale) {
|
if (onSale) {
|
||||||
|
|||||||
@@ -141,29 +141,29 @@ public class MapleItemInformationProvider {
|
|||||||
Data itemsData;
|
Data itemsData;
|
||||||
itemsData = stringData.getData("Cash.img");
|
itemsData = stringData.getData("Cash.img");
|
||||||
for (Data 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()), DataTool.getString("name", itemFolder, "NO-NAME")));
|
||||||
}
|
}
|
||||||
itemsData = stringData.getData("Consume.img");
|
itemsData = stringData.getData("Consume.img");
|
||||||
for (Data 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()), DataTool.getString("name", itemFolder, "NO-NAME")));
|
||||||
}
|
}
|
||||||
itemsData = stringData.getData("Eqp.img").getChildByPath("Eqp");
|
itemsData = stringData.getData("Eqp.img").getChildByPath("Eqp");
|
||||||
for (Data eqpType : itemsData.getChildren()) {
|
for (Data eqpType : itemsData.getChildren()) {
|
||||||
for (Data 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()), DataTool.getString("name", itemFolder, "NO-NAME")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
itemsData = stringData.getData("Etc.img").getChildByPath("Etc");
|
itemsData = stringData.getData("Etc.img").getChildByPath("Etc");
|
||||||
for (Data 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()), DataTool.getString("name", itemFolder, "NO-NAME")));
|
||||||
}
|
}
|
||||||
itemsData = stringData.getData("Ins.img");
|
itemsData = stringData.getData("Ins.img");
|
||||||
for (Data 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()), DataTool.getString("name", itemFolder, "NO-NAME")));
|
||||||
}
|
}
|
||||||
itemsData = stringData.getData("Pet.img");
|
itemsData = stringData.getData("Pet.img");
|
||||||
for (Data 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()), DataTool.getString("name", itemFolder, "NO-NAME")));
|
||||||
}
|
}
|
||||||
return itemPairs;
|
return itemPairs;
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ public class MapleItemInformationProvider {
|
|||||||
|
|
||||||
itemsData = stringData.getData("Etc.img").getChildByPath("Etc");
|
itemsData = stringData.getData("Etc.img").getChildByPath("Etc");
|
||||||
for (Data 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()), DataTool.getString("name", itemFolder, "NO-NAME")));
|
||||||
}
|
}
|
||||||
return itemPairs;
|
return itemPairs;
|
||||||
}
|
}
|
||||||
@@ -263,7 +263,7 @@ public class MapleItemInformationProvider {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean blockMouse = MapleDataTool.getIntConvert("info/noCancelMouse", item, 0) == 1;
|
boolean blockMouse = DataTool.getIntConvert("info/noCancelMouse", item, 0) == 1;
|
||||||
noCancelMouseCache.put(itemId, blockMouse);
|
noCancelMouseCache.put(itemId, blockMouse);
|
||||||
return blockMouse;
|
return blockMouse;
|
||||||
}
|
}
|
||||||
@@ -352,7 +352,7 @@ public class MapleItemInformationProvider {
|
|||||||
ret = 100;
|
ret = 100;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = (short) MapleDataTool.getInt(smEntry);
|
ret = (short) DataTool.getInt(smEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (pData == null) {
|
if (pData == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
pEntry = MapleDataTool.getInt(pData);
|
pEntry = DataTool.getInt(pData);
|
||||||
getMesoCache.put(itemId, pEntry);
|
getMesoCache.put(itemId, pEntry);
|
||||||
return pEntry;
|
return pEntry;
|
||||||
}
|
}
|
||||||
@@ -424,16 +424,16 @@ public class MapleItemInformationProvider {
|
|||||||
int pEntry = -1;
|
int pEntry = -1;
|
||||||
Data pData = item.getChildByPath("info/price");
|
Data pData = item.getChildByPath("info/price");
|
||||||
if (pData != null) {
|
if (pData != null) {
|
||||||
pEntry = MapleDataTool.getInt(pData);
|
pEntry = DataTool.getInt(pData);
|
||||||
}
|
}
|
||||||
|
|
||||||
double fEntry = 0.0f;
|
double fEntry = 0.0f;
|
||||||
pData = item.getChildByPath("info/unitPrice");
|
pData = item.getChildByPath("info/unitPrice");
|
||||||
if (pData != null) {
|
if (pData != null) {
|
||||||
try {
|
try {
|
||||||
fEntry = getRoundedUnitPrice(MapleDataTool.getDouble(pData), 5);
|
fEntry = getRoundedUnitPrice(DataTool.getDouble(pData), 5);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
fEntry = (double) MapleDataTool.getInt(pData);
|
fEntry = (double) DataTool.getInt(pData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,8 +479,8 @@ public class MapleItemInformationProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Data data = getItemData(itemId);
|
Data data = getItemData(itemId);
|
||||||
int itemReplacement = MapleDataTool.getInt("info/replace/itemid", data, 0);
|
int itemReplacement = DataTool.getInt("info/replace/itemid", data, 0);
|
||||||
String msg = MapleDataTool.getString("info/replace/msg", data, "");
|
String msg = DataTool.getString("info/replace/msg", data, "");
|
||||||
|
|
||||||
Pair<Integer, String> ret = new Pair<>(itemReplacement, msg);
|
Pair<Integer, String> ret = new Pair<>(itemReplacement, msg);
|
||||||
replaceOnExpireCache.put(itemId, ret);
|
replaceOnExpireCache.put(itemId, ret);
|
||||||
@@ -507,7 +507,7 @@ public class MapleItemInformationProvider {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = MapleDataTool.getString("islot", info, "");
|
ret = DataTool.getString("islot", info, "");
|
||||||
|
|
||||||
equipmentSlotCache.put(itemId, ret);
|
equipmentSlotCache.put(itemId, ret);
|
||||||
|
|
||||||
@@ -529,23 +529,23 @@ public class MapleItemInformationProvider {
|
|||||||
}
|
}
|
||||||
for (Data 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), DataTool.getIntConvert(data));
|
||||||
}
|
}
|
||||||
/*else if (data.getName().startsWith("req"))
|
/*else if (data.getName().startsWith("req"))
|
||||||
ret.put(data.getName(), MapleDataTool.getInt(data.getName(), info, 0));*/
|
ret.put(data.getName(), DataTool.getInt(data.getName(), info, 0));*/
|
||||||
}
|
}
|
||||||
ret.put("reqJob", MapleDataTool.getInt("reqJob", info, 0));
|
ret.put("reqJob", DataTool.getInt("reqJob", info, 0));
|
||||||
ret.put("reqLevel", MapleDataTool.getInt("reqLevel", info, 0));
|
ret.put("reqLevel", DataTool.getInt("reqLevel", info, 0));
|
||||||
ret.put("reqDEX", MapleDataTool.getInt("reqDEX", info, 0));
|
ret.put("reqDEX", DataTool.getInt("reqDEX", info, 0));
|
||||||
ret.put("reqSTR", MapleDataTool.getInt("reqSTR", info, 0));
|
ret.put("reqSTR", DataTool.getInt("reqSTR", info, 0));
|
||||||
ret.put("reqINT", MapleDataTool.getInt("reqINT", info, 0));
|
ret.put("reqINT", DataTool.getInt("reqINT", info, 0));
|
||||||
ret.put("reqLUK", MapleDataTool.getInt("reqLUK", info, 0));
|
ret.put("reqLUK", DataTool.getInt("reqLUK", info, 0));
|
||||||
ret.put("reqPOP", MapleDataTool.getInt("reqPOP", info, 0));
|
ret.put("reqPOP", DataTool.getInt("reqPOP", info, 0));
|
||||||
ret.put("cash", MapleDataTool.getInt("cash", info, 0));
|
ret.put("cash", DataTool.getInt("cash", info, 0));
|
||||||
ret.put("tuc", MapleDataTool.getInt("tuc", info, 0));
|
ret.put("tuc", DataTool.getInt("tuc", info, 0));
|
||||||
ret.put("cursed", MapleDataTool.getInt("cursed", info, 0));
|
ret.put("cursed", DataTool.getInt("cursed", info, 0));
|
||||||
ret.put("success", MapleDataTool.getInt("success", info, 0));
|
ret.put("success", DataTool.getInt("success", info, 0));
|
||||||
ret.put("fs", MapleDataTool.getInt("fs", info, 0));
|
ret.put("fs", DataTool.getInt("fs", info, 0));
|
||||||
equipStatsCache.put(itemId, ret);
|
equipStatsCache.put(itemId, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -560,7 +560,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (item != null) {
|
if (item != null) {
|
||||||
Data info = item.getChildByPath("info");
|
Data info = item.getChildByPath("info");
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
ret = MapleDataTool.getInt("reqLevel", info, 0);
|
ret = DataTool.getInt("reqLevel", info, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -578,7 +578,7 @@ public class MapleItemInformationProvider {
|
|||||||
data = data.getChildByPath("req");
|
data = data.getChildByPath("req");
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
for (Data req : data.getChildren()) {
|
for (Data req : data.getChildren()) {
|
||||||
ret.add(MapleDataTool.getInt(req));
|
ret.add(DataTool.getInt(req));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1157,8 +1157,8 @@ public class MapleItemInformationProvider {
|
|||||||
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++) {
|
||||||
mobs2spawn[x][0] = MapleDataTool.getIntConvert("mob/" + x + "/id", data);
|
mobs2spawn[x][0] = DataTool.getIntConvert("mob/" + x + "/id", data);
|
||||||
mobs2spawn[x][1] = MapleDataTool.getIntConvert("mob/" + x + "/prob", data);
|
mobs2spawn[x][1] = DataTool.getIntConvert("mob/" + x + "/prob", data);
|
||||||
}
|
}
|
||||||
return mobs2spawn;
|
return mobs2spawn;
|
||||||
}
|
}
|
||||||
@@ -1169,7 +1169,7 @@ public class MapleItemInformationProvider {
|
|||||||
return atk.intValue();
|
return atk.intValue();
|
||||||
}
|
}
|
||||||
Data data = getItemData(itemId);
|
Data data = getItemData(itemId);
|
||||||
atk = Integer.valueOf(MapleDataTool.getInt("info/incPAD", data, 0));
|
atk = Integer.valueOf(DataTool.getInt("info/incPAD", data, 0));
|
||||||
projectileWatkCache.put(itemId, atk);
|
projectileWatkCache.put(itemId, atk);
|
||||||
return atk.intValue();
|
return atk.intValue();
|
||||||
}
|
}
|
||||||
@@ -1182,7 +1182,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (strings == null) {
|
if (strings == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String ret = MapleDataTool.getString("name", strings, null);
|
String ret = DataTool.getString("name", strings, null);
|
||||||
nameCache.put(itemId, ret);
|
nameCache.put(itemId, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1195,7 +1195,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (strings == null) {
|
if (strings == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String ret = MapleDataTool.getString("msg", strings, null);
|
String ret = DataTool.getString("msg", strings, null);
|
||||||
msgCache.put(itemId, ret);
|
msgCache.put(itemId, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1209,7 +1209,7 @@ public class MapleItemInformationProvider {
|
|||||||
if(itemId != 0) {
|
if(itemId != 0) {
|
||||||
Data data = getItemData(itemId);
|
Data data = getItemData(itemId);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
bRestricted = MapleDataTool.getIntConvert("info/tradeBlock", data, 0) == 1;
|
bRestricted = DataTool.getIntConvert("info/tradeBlock", data, 0) == 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1226,7 +1226,7 @@ public class MapleItemInformationProvider {
|
|||||||
if(itemId != 0) {
|
if(itemId != 0) {
|
||||||
Data data = getItemData(itemId);
|
Data data = getItemData(itemId);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
bRestricted = MapleDataTool.getIntConvert("info/accountSharable", data, 0) == 1;
|
bRestricted = DataTool.getIntConvert("info/accountSharable", data, 0) == 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1243,7 +1243,7 @@ public class MapleItemInformationProvider {
|
|||||||
if(itemId != 0) {
|
if(itemId != 0) {
|
||||||
Data data = getItemData(itemId);
|
Data data = getItemData(itemId);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
bRestricted = MapleDataTool.getIntConvert("info/tradeBlock", data, 0) == 1;
|
bRestricted = DataTool.getIntConvert("info/tradeBlock", data, 0) == 1;
|
||||||
if (!bRestricted) {
|
if (!bRestricted) {
|
||||||
bRestricted = isAccountRestricted(itemId);
|
bRestricted = isAccountRestricted(itemId);
|
||||||
}
|
}
|
||||||
@@ -1267,7 +1267,7 @@ public class MapleItemInformationProvider {
|
|||||||
if(itemId != 0) {
|
if(itemId != 0) {
|
||||||
Data data = getItemData(itemId);
|
Data data = getItemData(itemId);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
bRestricted = MapleDataTool.getIntConvert("info/only", data, 0) == 1;
|
bRestricted = DataTool.getIntConvert("info/only", data, 0) == 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1289,12 +1289,12 @@ public class MapleItemInformationProvider {
|
|||||||
if (info != null) {
|
if (info != null) {
|
||||||
for (Data 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), DataTool.getIntConvert(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret.put("masterLevel", MapleDataTool.getInt("masterLevel", info, 0));
|
ret.put("masterLevel", DataTool.getInt("masterLevel", info, 0));
|
||||||
ret.put("reqSkillLevel", MapleDataTool.getInt("reqSkillLevel", info, 0));
|
ret.put("reqSkillLevel", DataTool.getInt("reqSkillLevel", info, 0));
|
||||||
ret.put("success", MapleDataTool.getInt("success", info, 0));
|
ret.put("success", DataTool.getInt("success", info, 0));
|
||||||
|
|
||||||
retSkill = info.getChildByPath("skill");
|
retSkill = info.getChildByPath("skill");
|
||||||
}
|
}
|
||||||
@@ -1313,7 +1313,7 @@ public class MapleItemInformationProvider {
|
|||||||
Data 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 = DataTool.getInt(Integer.toString(i), skill, 0);
|
||||||
if (curskill == 0) {
|
if (curskill == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1344,11 +1344,11 @@ public class MapleItemInformationProvider {
|
|||||||
try {
|
try {
|
||||||
Integer.parseInt(itemName); // check if it's a petid node
|
Integer.parseInt(itemName); // check if it's a petid node
|
||||||
|
|
||||||
Integer petid = MapleDataTool.getInt(specItem, 0);
|
Integer petid = DataTool.getInt(specItem, 0);
|
||||||
pets.add(petid);
|
pets.add(petid);
|
||||||
} catch(NumberFormatException npe) {
|
} catch(NumberFormatException npe) {
|
||||||
if(itemName.contentEquals("inc")) {
|
if(itemName.contentEquals("inc")) {
|
||||||
inc = MapleDataTool.getInt(specItem, 1);
|
inc = DataTool.getInt(specItem, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1366,7 +1366,7 @@ public class MapleItemInformationProvider {
|
|||||||
return isQuestItemCache.get(itemId);
|
return isQuestItemCache.get(itemId);
|
||||||
}
|
}
|
||||||
Data data = getItemData(itemId);
|
Data data = getItemData(itemId);
|
||||||
boolean questItem = (data != null && MapleDataTool.getIntConvert("info/quest", data, 0) == 1);
|
boolean questItem = (data != null && DataTool.getIntConvert("info/quest", data, 0) == 1);
|
||||||
isQuestItemCache.put(itemId, questItem);
|
isQuestItemCache.put(itemId, questItem);
|
||||||
return questItem;
|
return questItem;
|
||||||
}
|
}
|
||||||
@@ -1376,7 +1376,7 @@ public class MapleItemInformationProvider {
|
|||||||
return isPartyQuestItemCache.get(itemId);
|
return isPartyQuestItemCache.get(itemId);
|
||||||
}
|
}
|
||||||
Data data = getItemData(itemId);
|
Data data = getItemData(itemId);
|
||||||
boolean partyquestItem = (data != null && MapleDataTool.getIntConvert("info/pquest", data, 0) == 1);
|
boolean partyquestItem = (data != null && DataTool.getIntConvert("info/pquest", data, 0) == 1);
|
||||||
isPartyQuestItemCache.put(itemId, partyquestItem);
|
isPartyQuestItemCache.put(itemId, partyquestItem);
|
||||||
return partyquestItem;
|
return partyquestItem;
|
||||||
}
|
}
|
||||||
@@ -1401,7 +1401,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (onEquipUntradeableCache.containsKey(itemId)) {
|
if (onEquipUntradeableCache.containsKey(itemId)) {
|
||||||
return onEquipUntradeableCache.get(itemId);
|
return onEquipUntradeableCache.get(itemId);
|
||||||
}
|
}
|
||||||
boolean untradeableOnEquip = MapleDataTool.getIntConvert("info/equipTradeBlock", getItemData(itemId), 0) > 0;
|
boolean untradeableOnEquip = DataTool.getIntConvert("info/equipTradeBlock", getItemData(itemId), 0) > 0;
|
||||||
onEquipUntradeableCache.put(itemId, untradeableOnEquip);
|
onEquipUntradeableCache.put(itemId, untradeableOnEquip);
|
||||||
return untradeableOnEquip;
|
return untradeableOnEquip;
|
||||||
}
|
}
|
||||||
@@ -1414,9 +1414,9 @@ public class MapleItemInformationProvider {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Data itemInfo = getItemData(itemId);
|
Data itemInfo = getItemData(itemId);
|
||||||
ScriptedItem script = new ScriptedItem(MapleDataTool.getInt("spec/npc", itemInfo, 0),
|
ScriptedItem script = new ScriptedItem(DataTool.getInt("spec/npc", itemInfo, 0),
|
||||||
MapleDataTool.getString("spec/script", itemInfo, ""),
|
DataTool.getString("spec/script", itemInfo, ""),
|
||||||
MapleDataTool.getInt("spec/runOnPickup", itemInfo, 0) == 1);
|
DataTool.getInt("spec/runOnPickup", itemInfo, 0) == 1);
|
||||||
scriptedItemCache.put(itemId, script);
|
scriptedItemCache.put(itemId, script);
|
||||||
return scriptedItemCache.get(itemId);
|
return scriptedItemCache.get(itemId);
|
||||||
}
|
}
|
||||||
@@ -1425,7 +1425,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (karmaCache.containsKey(itemId)) {
|
if (karmaCache.containsKey(itemId)) {
|
||||||
return karmaCache.get(itemId);
|
return karmaCache.get(itemId);
|
||||||
}
|
}
|
||||||
boolean bRestricted = MapleDataTool.getIntConvert("info/tradeAvailable", getItemData(itemId), 0) > 0;
|
boolean bRestricted = DataTool.getIntConvert("info/tradeAvailable", getItemData(itemId), 0) > 0;
|
||||||
karmaCache.put(itemId, bRestricted);
|
karmaCache.put(itemId, bRestricted);
|
||||||
return bRestricted;
|
return bRestricted;
|
||||||
}
|
}
|
||||||
@@ -1434,7 +1434,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (triggerItemCache.containsKey(itemId)) {
|
if (triggerItemCache.containsKey(itemId)) {
|
||||||
return triggerItemCache.get(itemId);
|
return triggerItemCache.get(itemId);
|
||||||
} else {
|
} else {
|
||||||
int triggerItem = MapleDataTool.getIntConvert("info/stateChangeItem", getItemData(itemId), 0);
|
int triggerItem = DataTool.getIntConvert("info/stateChangeItem", getItemData(itemId), 0);
|
||||||
triggerItemCache.put(itemId, triggerItem);
|
triggerItemCache.put(itemId, triggerItem);
|
||||||
return triggerItem;
|
return triggerItem;
|
||||||
}
|
}
|
||||||
@@ -1444,7 +1444,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (createItem.containsKey(itemId)) {
|
if (createItem.containsKey(itemId)) {
|
||||||
return createItem.get(itemId);
|
return createItem.get(itemId);
|
||||||
} else {
|
} else {
|
||||||
int itemFrom = MapleDataTool.getIntConvert("info/create", getItemData(itemId), 0);
|
int itemFrom = DataTool.getIntConvert("info/create", getItemData(itemId), 0);
|
||||||
createItem.put(itemId, itemFrom);
|
createItem.put(itemId, itemFrom);
|
||||||
return itemFrom;
|
return itemFrom;
|
||||||
}
|
}
|
||||||
@@ -1454,7 +1454,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (mobItem.containsKey(itemId)) {
|
if (mobItem.containsKey(itemId)) {
|
||||||
return mobItem.get(itemId);
|
return mobItem.get(itemId);
|
||||||
} else {
|
} else {
|
||||||
int mobItemCatch = MapleDataTool.getIntConvert("info/mob", getItemData(itemId), 0);
|
int mobItemCatch = DataTool.getIntConvert("info/mob", getItemData(itemId), 0);
|
||||||
mobItem.put(itemId, mobItemCatch);
|
mobItem.put(itemId, mobItemCatch);
|
||||||
return mobItemCatch;
|
return mobItemCatch;
|
||||||
}
|
}
|
||||||
@@ -1464,7 +1464,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (useDelay.containsKey(itemId)) {
|
if (useDelay.containsKey(itemId)) {
|
||||||
return useDelay.get(itemId);
|
return useDelay.get(itemId);
|
||||||
} else {
|
} else {
|
||||||
int mobUseDelay = MapleDataTool.getIntConvert("info/useDelay", getItemData(itemId), 0);
|
int mobUseDelay = DataTool.getIntConvert("info/useDelay", getItemData(itemId), 0);
|
||||||
useDelay.put(itemId, mobUseDelay);
|
useDelay.put(itemId, mobUseDelay);
|
||||||
return mobUseDelay;
|
return mobUseDelay;
|
||||||
}
|
}
|
||||||
@@ -1474,7 +1474,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (mobHP.containsKey(itemId)) {
|
if (mobHP.containsKey(itemId)) {
|
||||||
return mobHP.get(itemId);
|
return mobHP.get(itemId);
|
||||||
} else {
|
} else {
|
||||||
int mobHPItem = MapleDataTool.getIntConvert("info/mobHP", getItemData(itemId), 0);
|
int mobHPItem = DataTool.getIntConvert("info/mobHP", getItemData(itemId), 0);
|
||||||
mobHP.put(itemId, mobHPItem);
|
mobHP.put(itemId, mobHPItem);
|
||||||
return mobHPItem;
|
return mobHPItem;
|
||||||
}
|
}
|
||||||
@@ -1484,7 +1484,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (expCache.containsKey(itemId)) {
|
if (expCache.containsKey(itemId)) {
|
||||||
return expCache.get(itemId);
|
return expCache.get(itemId);
|
||||||
} else {
|
} else {
|
||||||
int exp = MapleDataTool.getIntConvert("spec/exp", getItemData(itemId), 0);
|
int exp = DataTool.getIntConvert("spec/exp", getItemData(itemId), 0);
|
||||||
expCache.put(itemId, exp);
|
expCache.put(itemId, exp);
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
@@ -1494,7 +1494,7 @@ public class MapleItemInformationProvider {
|
|||||||
if (levelCache.containsKey(itemId)) {
|
if (levelCache.containsKey(itemId)) {
|
||||||
return levelCache.get(itemId);
|
return levelCache.get(itemId);
|
||||||
} else {
|
} else {
|
||||||
int level = MapleDataTool.getIntConvert("info/maxLevel", getItemData(itemId), 256);
|
int level = DataTool.getIntConvert("info/maxLevel", getItemData(itemId), 256);
|
||||||
levelCache.put(itemId, level);
|
levelCache.put(itemId, level);
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
@@ -1508,12 +1508,12 @@ public class MapleItemInformationProvider {
|
|||||||
List<RewardItem> rewards = new ArrayList<>();
|
List<RewardItem> rewards = new ArrayList<>();
|
||||||
for (Data 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 = DataTool.getInt("item", child, 0);
|
||||||
reward.prob = (byte) MapleDataTool.getInt("prob", child, 0);
|
reward.prob = (byte) DataTool.getInt("prob", child, 0);
|
||||||
reward.quantity = (short) MapleDataTool.getInt("count", child, 0);
|
reward.quantity = (short) DataTool.getInt("count", child, 0);
|
||||||
reward.effect = MapleDataTool.getString("Effect", child, "");
|
reward.effect = DataTool.getString("Effect", child, "");
|
||||||
reward.worldmsg = MapleDataTool.getString("worldMsg", child, null);
|
reward.worldmsg = DataTool.getString("worldMsg", child, null);
|
||||||
reward.period = MapleDataTool.getInt("period", child, -1);
|
reward.period = DataTool.getInt("period", child, -1);
|
||||||
|
|
||||||
totalprob += reward.prob;
|
totalprob += reward.prob;
|
||||||
|
|
||||||
@@ -1529,7 +1529,7 @@ public class MapleItemInformationProvider {
|
|||||||
return consumeOnPickupCache.get(itemId);
|
return consumeOnPickupCache.get(itemId);
|
||||||
}
|
}
|
||||||
Data 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 = DataTool.getIntConvert("spec/consumeOnPickup", data, 0) == 1 || DataTool.getIntConvert("specEx/consumeOnPickup", data, 0) == 1;
|
||||||
consumeOnPickupCache.put(itemId, consume);
|
consumeOnPickupCache.put(itemId, consume);
|
||||||
return consume;
|
return consume;
|
||||||
}
|
}
|
||||||
@@ -1797,33 +1797,33 @@ public class MapleItemInformationProvider {
|
|||||||
for (Data 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(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incDEXMax")))));
|
||||||
} else if (da.getName().startsWith("incSTRMin")) {
|
} else if (da.getName().startsWith("incSTRMin")) {
|
||||||
list.add(new Pair<>("incSTR", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incSTRMax")))));
|
list.add(new Pair<>("incSTR", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incSTRMax")))));
|
||||||
} else if (da.getName().startsWith("incINTMin")) {
|
} else if (da.getName().startsWith("incINTMin")) {
|
||||||
list.add(new Pair<>("incINT", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incINTMax")))));
|
list.add(new Pair<>("incINT", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incINTMax")))));
|
||||||
} else if (da.getName().startsWith("incLUKMin")) {
|
} else if (da.getName().startsWith("incLUKMin")) {
|
||||||
list.add(new Pair<>("incLUK", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incLUKMax")))));
|
list.add(new Pair<>("incLUK", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incLUKMax")))));
|
||||||
} else if (da.getName().startsWith("incMHPMin")) {
|
} else if (da.getName().startsWith("incMHPMin")) {
|
||||||
list.add(new Pair<>("incMHP", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incMHPMax")))));
|
list.add(new Pair<>("incMHP", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incMHPMax")))));
|
||||||
} else if (da.getName().startsWith("incMMPMin")) {
|
} else if (da.getName().startsWith("incMMPMin")) {
|
||||||
list.add(new Pair<>("incMMP", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incMMPMax")))));
|
list.add(new Pair<>("incMMP", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incMMPMax")))));
|
||||||
} else if (da.getName().startsWith("incPADMin")) {
|
} else if (da.getName().startsWith("incPADMin")) {
|
||||||
list.add(new Pair<>("incPAD", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incPADMax")))));
|
list.add(new Pair<>("incPAD", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incPADMax")))));
|
||||||
} else if (da.getName().startsWith("incMADMin")) {
|
} else if (da.getName().startsWith("incMADMin")) {
|
||||||
list.add(new Pair<>("incMAD", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incMADMax")))));
|
list.add(new Pair<>("incMAD", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incMADMax")))));
|
||||||
} else if (da.getName().startsWith("incPDDMin")) {
|
} else if (da.getName().startsWith("incPDDMin")) {
|
||||||
list.add(new Pair<>("incPDD", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incPDDMax")))));
|
list.add(new Pair<>("incPDD", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incPDDMax")))));
|
||||||
} else if (da.getName().startsWith("incMDDMin")) {
|
} else if (da.getName().startsWith("incMDDMin")) {
|
||||||
list.add(new Pair<>("incMDD", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incMDDMax")))));
|
list.add(new Pair<>("incMDD", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incMDDMax")))));
|
||||||
} else if (da.getName().startsWith("incACCMin")) {
|
} else if (da.getName().startsWith("incACCMin")) {
|
||||||
list.add(new Pair<>("incACC", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incACCMax")))));
|
list.add(new Pair<>("incACC", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incACCMax")))));
|
||||||
} else if (da.getName().startsWith("incEVAMin")) {
|
} else if (da.getName().startsWith("incEVAMin")) {
|
||||||
list.add(new Pair<>("incEVA", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incEVAMax")))));
|
list.add(new Pair<>("incEVA", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incEVAMax")))));
|
||||||
} else if (da.getName().startsWith("incSpeedMin")) {
|
} else if (da.getName().startsWith("incSpeedMin")) {
|
||||||
list.add(new Pair<>("incSpeed", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incSpeedMax")))));
|
list.add(new Pair<>("incSpeed", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incSpeedMax")))));
|
||||||
} else if (da.getName().startsWith("incJumpMin")) {
|
} else if (da.getName().startsWith("incJumpMin")) {
|
||||||
list.add(new Pair<>("incJump", Randomizer.rand(MapleDataTool.getInt(da), MapleDataTool.getInt(data2.getChildByPath("incJumpMax")))));
|
list.add(new Pair<>("incJump", Randomizer.rand(DataTool.getInt(da), DataTool.getInt(data2.getChildByPath("incJumpMax")))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2042,7 +2042,7 @@ public class MapleItemInformationProvider {
|
|||||||
Data 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 = DataTool.getInt(me.getChildByPath("catalyst"), -1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2112,17 +2112,17 @@ public class MapleItemInformationProvider {
|
|||||||
Data 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 = DataTool.getInt("exp", infoData);
|
||||||
qcItem.grade = MapleDataTool.getInt("grade", infoData);
|
qcItem.grade = DataTool.getInt("grade", infoData);
|
||||||
qcItem.questid = MapleDataTool.getInt("questId", infoData);
|
qcItem.questid = DataTool.getInt("questId", infoData);
|
||||||
qcItem.items = new HashMap<>(2);
|
qcItem.items = new HashMap<>(2);
|
||||||
|
|
||||||
Map<Integer, Integer> cItems = qcItem.items;
|
Map<Integer, Integer> cItems = qcItem.items;
|
||||||
Data ciData = infoData.getChildByPath("consumeItem");
|
Data ciData = infoData.getChildByPath("consumeItem");
|
||||||
if (ciData != null) {
|
if (ciData != null) {
|
||||||
for (Data ciItem : ciData.getChildren()) {
|
for (Data ciItem : ciData.getChildren()) {
|
||||||
int itemid = MapleDataTool.getInt("0", ciItem);
|
int itemid = DataTool.getInt("0", ciItem);
|
||||||
int qty = MapleDataTool.getInt("1", ciItem);
|
int qty = DataTool.getInt("1", ciItem);
|
||||||
|
|
||||||
cItems.put(itemid, qty);
|
cItems.put(itemid, qty);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import client.Character;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.DatabaseConnection;
|
import tools.DatabaseConnection;
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ public class MapleSkillbookInformationProvider {
|
|||||||
Data startReqItemData = questStartData.getChildByPath("item");
|
Data startReqItemData = questStartData.getChildByPath("item");
|
||||||
if (startReqItemData != null) {
|
if (startReqItemData != null) {
|
||||||
for (Data itemData : startReqItemData.getChildren()) {
|
for (Data itemData : startReqItemData.getChildren()) {
|
||||||
int itemId = MapleDataTool.getInt("id", itemData, 0);
|
int itemId = DataTool.getInt("id", itemData, 0);
|
||||||
if (isQuestBook(itemId)) {
|
if (isQuestBook(itemId)) {
|
||||||
return itemId;
|
return itemId;
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ public class MapleSkillbookInformationProvider {
|
|||||||
Set<Integer> reqQuests = new HashSet<>();
|
Set<Integer> reqQuests = new HashSet<>();
|
||||||
|
|
||||||
for (Data questStatusData : startReqQuestData.getChildren()) {
|
for (Data questStatusData : startReqQuestData.getChildren()) {
|
||||||
int reqQuest = MapleDataTool.getInt("id", questStatusData, 0);
|
int reqQuest = DataTool.getInt("id", questStatusData, 0);
|
||||||
if (reqQuest > 0) {
|
if (reqQuest > 0) {
|
||||||
reqQuests.add(reqQuest);
|
reqQuests.add(reqQuest);
|
||||||
}
|
}
|
||||||
@@ -127,8 +127,8 @@ public class MapleSkillbookInformationProvider {
|
|||||||
String actNodeName = questNodeData.getName();
|
String actNodeName = questNodeData.getName();
|
||||||
if (actNodeName.contentEquals("item")) {
|
if (actNodeName.contentEquals("item")) {
|
||||||
for (Data questItemData : questNodeData.getChildren()) {
|
for (Data questItemData : questNodeData.getChildren()) {
|
||||||
int itemId = MapleDataTool.getInt("id", questItemData, 0);
|
int itemId = DataTool.getInt("id", questItemData, 0);
|
||||||
int itemCount = MapleDataTool.getInt("count", questItemData, 0);
|
int itemCount = DataTool.getInt("count", questItemData, 0);
|
||||||
|
|
||||||
if (isSkillBook(itemId) && itemCount > 0) {
|
if (isSkillBook(itemId) && itemCount > 0) {
|
||||||
int questbook = fetchQuestbook(checkData, questData.getName());
|
int questbook = fetchQuestbook(checkData, questData.getName());
|
||||||
@@ -141,7 +141,7 @@ public class MapleSkillbookInformationProvider {
|
|||||||
}
|
}
|
||||||
} else if (actNodeName.contentEquals("skill")) {
|
} else if (actNodeName.contentEquals("skill")) {
|
||||||
for (Data questSkillData : questNodeData.getChildren()) {
|
for (Data questSkillData : questNodeData.getChildren()) {
|
||||||
int skillId = MapleDataTool.getInt("id", questSkillData, 0);
|
int skillId = DataTool.getInt("id", questSkillData, 0);
|
||||||
if (is4thJobSkill(skillId)) {
|
if (is4thJobSkill(skillId)) {
|
||||||
// negative itemids are skill rewards
|
// negative itemids are skill rewards
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ 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.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.life.MapleMonster;
|
import server.life.MapleMonster;
|
||||||
import server.life.MobSkill;
|
import server.life.MobSkill;
|
||||||
import server.life.MobSkillFactory;
|
import server.life.MobSkillFactory;
|
||||||
@@ -172,49 +172,49 @@ public class MapleStatEffect {
|
|||||||
|
|
||||||
private static MapleStatEffect loadFromData(Data 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 = DataTool.getIntConvert("time", source, -1);
|
||||||
ret.hp = (short) MapleDataTool.getInt("hp", source, 0);
|
ret.hp = (short) DataTool.getInt("hp", source, 0);
|
||||||
ret.hpR = MapleDataTool.getInt("hpR", source, 0) / 100.0;
|
ret.hpR = DataTool.getInt("hpR", source, 0) / 100.0;
|
||||||
ret.mp = (short) MapleDataTool.getInt("mp", source, 0);
|
ret.mp = (short) DataTool.getInt("mp", source, 0);
|
||||||
ret.mpR = MapleDataTool.getInt("mpR", source, 0) / 100.0;
|
ret.mpR = DataTool.getInt("mpR", source, 0) / 100.0;
|
||||||
ret.mpCon = (short) MapleDataTool.getInt("mpCon", source, 0);
|
ret.mpCon = (short) DataTool.getInt("mpCon", source, 0);
|
||||||
ret.hpCon = (short) MapleDataTool.getInt("hpCon", source, 0);
|
ret.hpCon = (short) DataTool.getInt("hpCon", source, 0);
|
||||||
int iprop = MapleDataTool.getInt("prop", source, 100);
|
int iprop = DataTool.getInt("prop", source, 100);
|
||||||
ret.prop = iprop / 100.0;
|
ret.prop = iprop / 100.0;
|
||||||
|
|
||||||
ret.cp = MapleDataTool.getInt("cp", source, 0);
|
ret.cp = DataTool.getInt("cp", source, 0);
|
||||||
List<Disease> cure = new ArrayList<>(5);
|
List<Disease> cure = new ArrayList<>(5);
|
||||||
if (MapleDataTool.getInt("poison", source, 0) > 0) {
|
if (DataTool.getInt("poison", source, 0) > 0) {
|
||||||
cure.add(Disease.POISON);
|
cure.add(Disease.POISON);
|
||||||
}
|
}
|
||||||
if (MapleDataTool.getInt("seal", source, 0) > 0) {
|
if (DataTool.getInt("seal", source, 0) > 0) {
|
||||||
cure.add(Disease.SEAL);
|
cure.add(Disease.SEAL);
|
||||||
}
|
}
|
||||||
if (MapleDataTool.getInt("darkness", source, 0) > 0) {
|
if (DataTool.getInt("darkness", source, 0) > 0) {
|
||||||
cure.add(Disease.DARKNESS);
|
cure.add(Disease.DARKNESS);
|
||||||
}
|
}
|
||||||
if (MapleDataTool.getInt("weakness", source, 0) > 0) {
|
if (DataTool.getInt("weakness", source, 0) > 0) {
|
||||||
cure.add(Disease.WEAKEN);
|
cure.add(Disease.WEAKEN);
|
||||||
cure.add(Disease.SLOW);
|
cure.add(Disease.SLOW);
|
||||||
}
|
}
|
||||||
if (MapleDataTool.getInt("curse", source, 0) > 0) {
|
if (DataTool.getInt("curse", source, 0) > 0) {
|
||||||
cure.add(Disease.CURSE);
|
cure.add(Disease.CURSE);
|
||||||
}
|
}
|
||||||
ret.cureDebuffs = cure;
|
ret.cureDebuffs = cure;
|
||||||
ret.nuffSkill = MapleDataTool.getInt("nuffSkill", source, 0);
|
ret.nuffSkill = DataTool.getInt("nuffSkill", source, 0);
|
||||||
|
|
||||||
ret.mobCount = MapleDataTool.getInt("mobCount", source, 1);
|
ret.mobCount = DataTool.getInt("mobCount", source, 1);
|
||||||
ret.cooldown = MapleDataTool.getInt("cooltime", source, 0);
|
ret.cooldown = DataTool.getInt("cooltime", source, 0);
|
||||||
ret.morphId = MapleDataTool.getInt("morph", source, 0);
|
ret.morphId = DataTool.getInt("morph", source, 0);
|
||||||
ret.ghost = MapleDataTool.getInt("ghost", source, 0);
|
ret.ghost = DataTool.getInt("ghost", source, 0);
|
||||||
ret.fatigue = MapleDataTool.getInt("incFatigue", source, 0);
|
ret.fatigue = DataTool.getInt("incFatigue", source, 0);
|
||||||
ret.repeatEffect = MapleDataTool.getInt("repeatEffect", source, 0) > 0;
|
ret.repeatEffect = DataTool.getInt("repeatEffect", source, 0) > 0;
|
||||||
|
|
||||||
Data 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) DataTool.getInt("mobSkill", mdd, 0);
|
||||||
ret.mobSkillLevel = (short) MapleDataTool.getInt("level", mdd, 0);
|
ret.mobSkillLevel = (short) DataTool.getInt("level", mdd, 0);
|
||||||
ret.target = MapleDataTool.getInt("target", mdd, 0);
|
ret.target = DataTool.getInt("target", mdd, 0);
|
||||||
} else {
|
} else {
|
||||||
ret.mobSkill = 0;
|
ret.mobSkill = 0;
|
||||||
ret.mobSkillLevel = 0;
|
ret.mobSkillLevel = 0;
|
||||||
@@ -224,7 +224,7 @@ public class MapleStatEffect {
|
|||||||
Data 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 = DataTool.getInt("mob", mdds, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret.sourceid = sourceid;
|
ret.sourceid = sourceid;
|
||||||
@@ -237,17 +237,17 @@ public class MapleStatEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<Pair<BuffStat, Integer>> statups = new ArrayList<>();
|
ArrayList<Pair<BuffStat, Integer>> statups = new ArrayList<>();
|
||||||
ret.watk = (short) MapleDataTool.getInt("pad", source, 0);
|
ret.watk = (short) DataTool.getInt("pad", source, 0);
|
||||||
ret.wdef = (short) MapleDataTool.getInt("pdd", source, 0);
|
ret.wdef = (short) DataTool.getInt("pdd", source, 0);
|
||||||
ret.matk = (short) MapleDataTool.getInt("mad", source, 0);
|
ret.matk = (short) DataTool.getInt("mad", source, 0);
|
||||||
ret.mdef = (short) MapleDataTool.getInt("mdd", source, 0);
|
ret.mdef = (short) DataTool.getInt("mdd", source, 0);
|
||||||
ret.acc = (short) MapleDataTool.getIntConvert("acc", source, 0);
|
ret.acc = (short) DataTool.getIntConvert("acc", source, 0);
|
||||||
ret.avoid = (short) MapleDataTool.getInt("eva", source, 0);
|
ret.avoid = (short) DataTool.getInt("eva", source, 0);
|
||||||
|
|
||||||
ret.speed = (short) MapleDataTool.getInt("speed", source, 0);
|
ret.speed = (short) DataTool.getInt("speed", source, 0);
|
||||||
ret.jump = (short) MapleDataTool.getInt("jump", source, 0);
|
ret.jump = (short) DataTool.getInt("jump", source, 0);
|
||||||
|
|
||||||
ret.barrier = MapleDataTool.getInt("barrier", source, 0);
|
ret.barrier = DataTool.getInt("barrier", source, 0);
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.AURA, ret.barrier);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.AURA, ret.barrier);
|
||||||
|
|
||||||
ret.mapProtection = mapProtection(sourceid);
|
ret.mapProtection = mapProtection(sourceid);
|
||||||
@@ -256,23 +256,23 @@ public class MapleStatEffect {
|
|||||||
if (ret.overTime && ret.getSummonMovementType() == null) {
|
if (ret.overTime && ret.getSummonMovementType() == null) {
|
||||||
if (!skill) {
|
if (!skill) {
|
||||||
if (isPyramidBuff(sourceid)) {
|
if (isPyramidBuff(sourceid)) {
|
||||||
ret.berserk = MapleDataTool.getInt("berserk", source, 0);
|
ret.berserk = DataTool.getInt("berserk", source, 0);
|
||||||
ret.booster = MapleDataTool.getInt("booster", source, 0);
|
ret.booster = DataTool.getInt("booster", source, 0);
|
||||||
|
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.BERSERK, ret.berserk);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.BERSERK, ret.berserk);
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.BOOSTER, ret.booster);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.BOOSTER, ret.booster);
|
||||||
|
|
||||||
} else if (isDojoBuff(sourceid) || isHpMpRecovery(sourceid)) {
|
} else if (isDojoBuff(sourceid) || isHpMpRecovery(sourceid)) {
|
||||||
ret.mhpR = (byte) MapleDataTool.getInt("mhpR", source, 0);
|
ret.mhpR = (byte) DataTool.getInt("mhpR", source, 0);
|
||||||
ret.mhpRRate = (short) (MapleDataTool.getInt("mhpRRate", source, 0) * 100);
|
ret.mhpRRate = (short) (DataTool.getInt("mhpRRate", source, 0) * 100);
|
||||||
ret.mmpR = (byte) MapleDataTool.getInt("mmpR", source, 0);
|
ret.mmpR = (byte) DataTool.getInt("mmpR", source, 0);
|
||||||
ret.mmpRRate = (short) (MapleDataTool.getInt("mmpRRate", source, 0) * 100);
|
ret.mmpRRate = (short) (DataTool.getInt("mmpRRate", source, 0) * 100);
|
||||||
|
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.HPREC, (int) ret.mhpR);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.HPREC, (int) ret.mhpR);
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.MPREC, (int) ret.mmpR);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.MPREC, (int) ret.mmpR);
|
||||||
|
|
||||||
} else if (isRateCoupon(sourceid)) {
|
} else if (isRateCoupon(sourceid)) {
|
||||||
switch (MapleDataTool.getInt("expR", source, 0)) {
|
switch (DataTool.getInt("expR", source, 0)) {
|
||||||
case 1:
|
case 1:
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.COUPON_EXP1, 1);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.COUPON_EXP1, 1);
|
||||||
break;
|
break;
|
||||||
@@ -290,7 +290,7 @@ public class MapleStatEffect {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (MapleDataTool.getInt("drpR", source, 0)) {
|
switch (DataTool.getInt("drpR", source, 0)) {
|
||||||
case 1:
|
case 1:
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.COUPON_DRP1, 1);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.COUPON_DRP1, 1);
|
||||||
break;
|
break;
|
||||||
@@ -313,11 +313,11 @@ public class MapleStatEffect {
|
|||||||
areas = new ArrayList<>(3);
|
areas = new ArrayList<>(3);
|
||||||
|
|
||||||
for (Data conData : con.getChildren()) {
|
for (Data conData : con.getChildren()) {
|
||||||
int type = MapleDataTool.getInt("type", conData, -1);
|
int type = DataTool.getInt("type", conData, -1);
|
||||||
|
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
int startMap = MapleDataTool.getInt("sMap", conData, 0);
|
int startMap = DataTool.getInt("sMap", conData, 0);
|
||||||
int endMap = MapleDataTool.getInt("eMap", conData, 0);
|
int endMap = DataTool.getInt("eMap", conData, 0);
|
||||||
|
|
||||||
areas.add(new Pair<>(startMap, endMap));
|
areas.add(new Pair<>(startMap, endMap));
|
||||||
} else if (type == 2) {
|
} else if (type == 2) {
|
||||||
@@ -330,51 +330,51 @@ public class MapleStatEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MapleDataTool.getInt("mesoupbyitem", source, 0) != 0) {
|
if (DataTool.getInt("mesoupbyitem", source, 0) != 0) {
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.MESO_UP_BY_ITEM, 4);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.MESO_UP_BY_ITEM, 4);
|
||||||
prob = MapleDataTool.getInt("prob", source, 1);
|
prob = DataTool.getInt("prob", source, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int itemupType = MapleDataTool.getInt("itemupbyitem", source, 0);
|
int itemupType = DataTool.getInt("itemupbyitem", source, 0);
|
||||||
if (itemupType != 0) {
|
if (itemupType != 0) {
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.ITEM_UP_BY_ITEM, 4);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.ITEM_UP_BY_ITEM, 4);
|
||||||
prob = MapleDataTool.getInt("prob", source, 1);
|
prob = DataTool.getInt("prob", source, 1);
|
||||||
|
|
||||||
switch (itemupType) {
|
switch (itemupType) {
|
||||||
case 2:
|
case 2:
|
||||||
itemupCode = MapleDataTool.getInt("itemCode", source, 1);
|
itemupCode = DataTool.getInt("itemCode", source, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
itemupCode = MapleDataTool.getInt("itemRange", source, 1); // 3 digits
|
itemupCode = DataTool.getInt("itemRange", source, 1); // 3 digits
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MapleDataTool.getInt("respectPimmune", source, 0) != 0) {
|
if (DataTool.getInt("respectPimmune", source, 0) != 0) {
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.RESPECT_PIMMUNE, 4);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.RESPECT_PIMMUNE, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MapleDataTool.getInt("respectMimmune", source, 0) != 0) {
|
if (DataTool.getInt("respectMimmune", source, 0) != 0) {
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.RESPECT_MIMMUNE, 4);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.RESPECT_MIMMUNE, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MapleDataTool.getString("defenseAtt", source, null) != null) {
|
if (DataTool.getString("defenseAtt", source, null) != null) {
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.DEFENSE_ATT, 4);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.DEFENSE_ATT, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MapleDataTool.getString("defenseState", source, null) != null) {
|
if (DataTool.getString("defenseState", source, null) != null) {
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.DEFENSE_STATE, 4);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.DEFENSE_STATE, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
int thaw = MapleDataTool.getInt("thaw", source, 0);
|
int thaw = DataTool.getInt("thaw", source, 0);
|
||||||
if (thaw != 0) {
|
if (thaw != 0) {
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.MAP_PROTECTION, thaw > 0 ? 1 : 2);
|
addBuffStatPairToListIfNotZero(statups, BuffStat.MAP_PROTECTION, thaw > 0 ? 1 : 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.cardStats = new CardItemupStats(itemupCode, prob, areas, inParty);
|
ret.cardStats = new CardItemupStats(itemupCode, prob, areas, inParty);
|
||||||
} else if (isExpIncrease(sourceid)) {
|
} else if (isExpIncrease(sourceid)) {
|
||||||
addBuffStatPairToListIfNotZero(statups, BuffStat.EXP_INCREASE, MapleDataTool.getInt("expinc", source, 0));
|
addBuffStatPairToListIfNotZero(statups, BuffStat.EXP_INCREASE, DataTool.getInt("expinc", source, 0));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isMapChair(sourceid)) {
|
if (isMapChair(sourceid)) {
|
||||||
@@ -406,23 +406,23 @@ public class MapleStatEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = MapleDataTool.getInt("x", source, 0);
|
int x = DataTool.getInt("x", source, 0);
|
||||||
|
|
||||||
if ((sourceid == Beginner.RECOVERY || sourceid == Noblesse.RECOVERY || sourceid == Evan.RECOVERY || sourceid == Legend.RECOVERY) && YamlConfig.config.server.USE_ULTRA_RECOVERY == true) {
|
if ((sourceid == Beginner.RECOVERY || sourceid == Noblesse.RECOVERY || sourceid == Evan.RECOVERY || sourceid == Legend.RECOVERY) && YamlConfig.config.server.USE_ULTRA_RECOVERY == true) {
|
||||||
x *= 10;
|
x *= 10;
|
||||||
}
|
}
|
||||||
ret.x = x;
|
ret.x = x;
|
||||||
ret.y = MapleDataTool.getInt("y", source, 0);
|
ret.y = DataTool.getInt("y", source, 0);
|
||||||
|
|
||||||
ret.damage = MapleDataTool.getIntConvert("damage", source, 100);
|
ret.damage = DataTool.getIntConvert("damage", source, 100);
|
||||||
ret.fixdamage = MapleDataTool.getIntConvert("fixdamage", source, -1);
|
ret.fixdamage = DataTool.getIntConvert("fixdamage", source, -1);
|
||||||
ret.attackCount = MapleDataTool.getIntConvert("attackCount", source, 1);
|
ret.attackCount = DataTool.getIntConvert("attackCount", source, 1);
|
||||||
ret.bulletCount = (short) MapleDataTool.getIntConvert("bulletCount", source, 1);
|
ret.bulletCount = (short) DataTool.getIntConvert("bulletCount", source, 1);
|
||||||
ret.bulletConsume = (short) MapleDataTool.getIntConvert("bulletConsume", source, 0);
|
ret.bulletConsume = (short) DataTool.getIntConvert("bulletConsume", source, 0);
|
||||||
ret.moneyCon = MapleDataTool.getIntConvert("moneyCon", source, 0);
|
ret.moneyCon = DataTool.getIntConvert("moneyCon", source, 0);
|
||||||
ret.itemCon = MapleDataTool.getInt("itemCon", source, 0);
|
ret.itemCon = DataTool.getInt("itemCon", source, 0);
|
||||||
ret.itemConNo = MapleDataTool.getInt("itemConNo", source, 0);
|
ret.itemConNo = DataTool.getInt("itemConNo", source, 0);
|
||||||
ret.moveTo = MapleDataTool.getInt("moveTo", source, -1);
|
ret.moveTo = DataTool.getInt("moveTo", source, -1);
|
||||||
Map<MonsterStatus, Integer> monsterStatus = new ArrayMap<>();
|
Map<MonsterStatus, Integer> monsterStatus = new ArrayMap<>();
|
||||||
if (skill) {
|
if (skill) {
|
||||||
switch (sourceid) {
|
switch (sourceid) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.DatabaseConnection;
|
import tools.DatabaseConnection;
|
||||||
import tools.FilePrinter;
|
import tools.FilePrinter;
|
||||||
@@ -313,7 +313,7 @@ public class MapleStorage {
|
|||||||
DataProvider npc = DataProviderFactory.getDataProvider(WZFiles.NPC);
|
DataProvider npc = DataProviderFactory.getDataProvider(WZFiles.NPC);
|
||||||
Data 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 = DataTool.getIntConvert("info/trunkPut", npcData, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
trunkPutCache.put(npcId, fee);
|
trunkPutCache.put(npcId, fee);
|
||||||
@@ -331,7 +331,7 @@ public class MapleStorage {
|
|||||||
DataProvider npc = DataProviderFactory.getDataProvider(WZFiles.NPC);
|
DataProvider npc = DataProviderFactory.getDataProvider(WZFiles.NPC);
|
||||||
Data 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 = DataTool.getIntConvert("info/trunkGet", npcData, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
trunkGetCache.put(npcId, fee);
|
trunkGetCache.put(npcId, fee);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.events.gm;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import server.TimerManager;
|
import server.TimerManager;
|
||||||
import server.maps.MapleMap;
|
import server.maps.MapleMap;
|
||||||
@@ -104,6 +104,6 @@ public final class MapleOxQuiz {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int getOXAnswer(int imgdir, int id) {
|
private static int getOXAnswer(int imgdir, int id) {
|
||||||
return MapleDataTool.getInt(stringData.getData("OXQuiz.img").getChildByPath("" + imgdir + "").getChildByPath("" + id + "").getChildByPath("a"));
|
return DataTool.getInt(stringData.getData("OXQuiz.img").getChildByPath("" + imgdir + "").getChildByPath("" + id + "").getChildByPath("a"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.life;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.DataType;
|
import provider.wz.DataType;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
@@ -100,7 +100,7 @@ public class MapleLifeFactory {
|
|||||||
List<MobAttackInfoHolder> attackInfos = new LinkedList<>();
|
List<MobAttackInfoHolder> attackInfos = new LinkedList<>();
|
||||||
MapleMonsterStats stats = new MapleMonsterStats();
|
MapleMonsterStats stats = new MapleMonsterStats();
|
||||||
|
|
||||||
int linkMid = MapleDataTool.getIntConvert("link", monsterInfoData, 0);
|
int linkMid = DataTool.getIntConvert("link", monsterInfoData, 0);
|
||||||
if (linkMid != 0) {
|
if (linkMid != 0) {
|
||||||
Pair<MapleMonsterStats, List<MobAttackInfoHolder>> linkStats = getMonsterStats(linkMid);
|
Pair<MapleMonsterStats, List<MobAttackInfoHolder>> linkStats = getMonsterStats(linkMid);
|
||||||
if (linkStats == null) {
|
if (linkStats == null) {
|
||||||
@@ -111,63 +111,63 @@ public class MapleLifeFactory {
|
|||||||
attackInfos.addAll(linkStats.getRight());
|
attackInfos.addAll(linkStats.getRight());
|
||||||
}
|
}
|
||||||
|
|
||||||
stats.setHp(MapleDataTool.getIntConvert("maxHP", monsterInfoData));
|
stats.setHp(DataTool.getIntConvert("maxHP", monsterInfoData));
|
||||||
stats.setFriendly(MapleDataTool.getIntConvert("damagedByMob", monsterInfoData, stats.isFriendly() ? 1 : 0) == 1);
|
stats.setFriendly(DataTool.getIntConvert("damagedByMob", monsterInfoData, stats.isFriendly() ? 1 : 0) == 1);
|
||||||
stats.setPADamage(MapleDataTool.getIntConvert("PADamage", monsterInfoData));
|
stats.setPADamage(DataTool.getIntConvert("PADamage", monsterInfoData));
|
||||||
stats.setPDDamage(MapleDataTool.getIntConvert("PDDamage", monsterInfoData));
|
stats.setPDDamage(DataTool.getIntConvert("PDDamage", monsterInfoData));
|
||||||
stats.setMADamage(MapleDataTool.getIntConvert("MADamage", monsterInfoData));
|
stats.setMADamage(DataTool.getIntConvert("MADamage", monsterInfoData));
|
||||||
stats.setMDDamage(MapleDataTool.getIntConvert("MDDamage", monsterInfoData));
|
stats.setMDDamage(DataTool.getIntConvert("MDDamage", monsterInfoData));
|
||||||
stats.setMp(MapleDataTool.getIntConvert("maxMP", monsterInfoData, stats.getMp()));
|
stats.setMp(DataTool.getIntConvert("maxMP", monsterInfoData, stats.getMp()));
|
||||||
stats.setExp(MapleDataTool.getIntConvert("exp", monsterInfoData, stats.getExp()));
|
stats.setExp(DataTool.getIntConvert("exp", monsterInfoData, stats.getExp()));
|
||||||
stats.setLevel(MapleDataTool.getIntConvert("level", monsterInfoData));
|
stats.setLevel(DataTool.getIntConvert("level", monsterInfoData));
|
||||||
stats.setRemoveAfter(MapleDataTool.getIntConvert("removeAfter", monsterInfoData, stats.removeAfter()));
|
stats.setRemoveAfter(DataTool.getIntConvert("removeAfter", monsterInfoData, stats.removeAfter()));
|
||||||
stats.setBoss(MapleDataTool.getIntConvert("boss", monsterInfoData, stats.isBoss() ? 1 : 0) > 0);
|
stats.setBoss(DataTool.getIntConvert("boss", monsterInfoData, stats.isBoss() ? 1 : 0) > 0);
|
||||||
stats.setExplosiveReward(MapleDataTool.getIntConvert("explosiveReward", monsterInfoData, stats.isExplosiveReward() ? 1 : 0) > 0);
|
stats.setExplosiveReward(DataTool.getIntConvert("explosiveReward", monsterInfoData, stats.isExplosiveReward() ? 1 : 0) > 0);
|
||||||
stats.setFfaLoot(MapleDataTool.getIntConvert("publicReward", monsterInfoData, stats.isFfaLoot() ? 1 : 0) > 0);
|
stats.setFfaLoot(DataTool.getIntConvert("publicReward", monsterInfoData, stats.isFfaLoot() ? 1 : 0) > 0);
|
||||||
stats.setUndead(MapleDataTool.getIntConvert("undead", monsterInfoData, stats.isUndead() ? 1 : 0) > 0);
|
stats.setUndead(DataTool.getIntConvert("undead", monsterInfoData, stats.isUndead() ? 1 : 0) > 0);
|
||||||
stats.setName(MapleDataTool.getString(mid + "/name", mobStringData, "MISSINGNO"));
|
stats.setName(DataTool.getString(mid + "/name", mobStringData, "MISSINGNO"));
|
||||||
stats.setBuffToGive(MapleDataTool.getIntConvert("buff", monsterInfoData, stats.getBuffToGive()));
|
stats.setBuffToGive(DataTool.getIntConvert("buff", monsterInfoData, stats.getBuffToGive()));
|
||||||
stats.setCP(MapleDataTool.getIntConvert("getCP", monsterInfoData, stats.getCP()));
|
stats.setCP(DataTool.getIntConvert("getCP", monsterInfoData, stats.getCP()));
|
||||||
stats.setRemoveOnMiss(MapleDataTool.getIntConvert("removeOnMiss", monsterInfoData, stats.removeOnMiss() ? 1 : 0) > 0);
|
stats.setRemoveOnMiss(DataTool.getIntConvert("removeOnMiss", monsterInfoData, stats.removeOnMiss() ? 1 : 0) > 0);
|
||||||
|
|
||||||
Data special = monsterInfoData.getChildByPath("coolDamage");
|
Data special = monsterInfoData.getChildByPath("coolDamage");
|
||||||
if (special != null) {
|
if (special != null) {
|
||||||
int coolDmg = MapleDataTool.getIntConvert("coolDamage", monsterInfoData);
|
int coolDmg = DataTool.getIntConvert("coolDamage", monsterInfoData);
|
||||||
int coolProb = MapleDataTool.getIntConvert("coolDamageProb", monsterInfoData, 0);
|
int coolProb = DataTool.getIntConvert("coolDamageProb", monsterInfoData, 0);
|
||||||
stats.setCool(new Pair<>(coolDmg, coolProb));
|
stats.setCool(new Pair<>(coolDmg, coolProb));
|
||||||
}
|
}
|
||||||
special = monsterInfoData.getChildByPath("loseItem");
|
special = monsterInfoData.getChildByPath("loseItem");
|
||||||
if (special != null) {
|
if (special != null) {
|
||||||
for (Data 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(DataTool.getInt(liData.getChildByPath("id")), (byte) DataTool.getInt(liData.getChildByPath("prop")), (byte) DataTool.getInt(liData.getChildByPath("x"))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
special = monsterInfoData.getChildByPath("selfDestruction");
|
special = monsterInfoData.getChildByPath("selfDestruction");
|
||||||
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) DataTool.getInt(special.getChildByPath("action")), DataTool.getIntConvert("removeAfter", special, -1), DataTool.getIntConvert("hp", special, -1)));
|
||||||
}
|
}
|
||||||
Data 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) {
|
||||||
firstAttack = Math.round(MapleDataTool.getFloat(firstAttackData));
|
firstAttack = Math.round(DataTool.getFloat(firstAttackData));
|
||||||
} else {
|
} else {
|
||||||
firstAttack = MapleDataTool.getInt(firstAttackData);
|
firstAttack = DataTool.getInt(firstAttackData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.setFirstAttack(firstAttack > 0);
|
stats.setFirstAttack(firstAttack > 0);
|
||||||
stats.setDropPeriod(MapleDataTool.getIntConvert("dropItemPeriod", monsterInfoData, stats.getDropPeriod() / 10000) * 10000);
|
stats.setDropPeriod(DataTool.getIntConvert("dropItemPeriod", monsterInfoData, stats.getDropPeriod() / 10000) * 10000);
|
||||||
|
|
||||||
// thanks yuxaij, Riizade, Z1peR, Anesthetic for noticing some bosses crashing players due to missing requirements
|
// thanks yuxaij, Riizade, Z1peR, Anesthetic for noticing some bosses crashing players due to missing requirements
|
||||||
boolean hpbarBoss = stats.isBoss() && hpbarBosses.contains(mid);
|
boolean hpbarBoss = stats.isBoss() && hpbarBosses.contains(mid);
|
||||||
stats.setTagColor(hpbarBoss ? MapleDataTool.getIntConvert("hpTagColor", monsterInfoData, 0) : 0);
|
stats.setTagColor(hpbarBoss ? DataTool.getIntConvert("hpTagColor", monsterInfoData, 0) : 0);
|
||||||
stats.setTagBgColor(hpbarBoss ? MapleDataTool.getIntConvert("hpTagBgcolor", monsterInfoData, 0) : 0);
|
stats.setTagBgColor(hpbarBoss ? DataTool.getIntConvert("hpTagBgcolor", monsterInfoData, 0) : 0);
|
||||||
|
|
||||||
for (Data idata : monsterData) {
|
for (Data idata : monsterData) {
|
||||||
if (!idata.getName().equals("info")) {
|
if (!idata.getName().equals("info")) {
|
||||||
int delay = 0;
|
int delay = 0;
|
||||||
for (Data pic : idata.getChildren()) {
|
for (Data pic : idata.getChildren()) {
|
||||||
delay += MapleDataTool.getIntConvert("delay", pic, 0);
|
delay += DataTool.getIntConvert("delay", pic, 0);
|
||||||
}
|
}
|
||||||
stats.setAnimationTime(idata.getName(), delay);
|
stats.setAnimationTime(idata.getName(), delay);
|
||||||
}
|
}
|
||||||
@@ -176,11 +176,11 @@ public class MapleLifeFactory {
|
|||||||
if (reviveInfo != null) {
|
if (reviveInfo != null) {
|
||||||
List<Integer> revives = new LinkedList<>();
|
List<Integer> revives = new LinkedList<>();
|
||||||
for (Data data_ : reviveInfo) {
|
for (Data data_ : reviveInfo) {
|
||||||
revives.add(MapleDataTool.getInt(data_));
|
revives.add(DataTool.getInt(data_));
|
||||||
}
|
}
|
||||||
stats.setRevives(revives);
|
stats.setRevives(revives);
|
||||||
}
|
}
|
||||||
decodeElementalString(stats, MapleDataTool.getString("elemAttr", monsterInfoData, ""));
|
decodeElementalString(stats, DataTool.getString("elemAttr", monsterInfoData, ""));
|
||||||
|
|
||||||
MapleMonsterInformationProvider mi = MapleMonsterInformationProvider.getInstance();
|
MapleMonsterInformationProvider mi = MapleMonsterInformationProvider.getInstance();
|
||||||
Data monsterSkillInfoData = monsterInfoData.getChildByPath("skill");
|
Data monsterSkillInfoData = monsterInfoData.getChildByPath("skill");
|
||||||
@@ -188,15 +188,15 @@ public class MapleLifeFactory {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
List<Pair<Integer, Integer>> skills = new ArrayList<>();
|
List<Pair<Integer, Integer>> skills = new ArrayList<>();
|
||||||
while (monsterSkillInfoData.getChildByPath(Integer.toString(i)) != null) {
|
while (monsterSkillInfoData.getChildByPath(Integer.toString(i)) != null) {
|
||||||
int skillId = MapleDataTool.getInt(i + "/skill", monsterSkillInfoData, 0);
|
int skillId = DataTool.getInt(i + "/skill", monsterSkillInfoData, 0);
|
||||||
int skillLv = MapleDataTool.getInt(i + "/level", monsterSkillInfoData, 0);
|
int skillLv = DataTool.getInt(i + "/level", monsterSkillInfoData, 0);
|
||||||
skills.add(new Pair<>(skillId, skillLv));
|
skills.add(new Pair<>(skillId, skillLv));
|
||||||
|
|
||||||
Data 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 (Data effectEntry : monsterSkillData.getChildren()) {
|
for (Data effectEntry : monsterSkillData.getChildren()) {
|
||||||
animationTime += MapleDataTool.getIntConvert("delay", effectEntry, 0);
|
animationTime += DataTool.getIntConvert("delay", effectEntry, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
MobSkill skill = MobSkillFactory.getMobSkill(skillId, skillLv);
|
MobSkill skill = MobSkillFactory.getMobSkill(skillId, skillLv);
|
||||||
@@ -213,23 +213,23 @@ public class MapleLifeFactory {
|
|||||||
while ((monsterAttackData = monsterData.getChildByPath("attack" + (i + 1))) != null) {
|
while ((monsterAttackData = monsterData.getChildByPath("attack" + (i + 1))) != null) {
|
||||||
int animationTime = 0;
|
int animationTime = 0;
|
||||||
for (Data effectEntry : monsterAttackData.getChildren()) {
|
for (Data effectEntry : monsterAttackData.getChildren()) {
|
||||||
animationTime += MapleDataTool.getIntConvert("delay", effectEntry, 0);
|
animationTime += DataTool.getIntConvert("delay", effectEntry, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mpCon = MapleDataTool.getIntConvert("info/conMP", monsterAttackData, 0);
|
int mpCon = DataTool.getIntConvert("info/conMP", monsterAttackData, 0);
|
||||||
int coolTime = MapleDataTool.getIntConvert("info/attackAfter", monsterAttackData, 0);
|
int coolTime = DataTool.getIntConvert("info/attackAfter", monsterAttackData, 0);
|
||||||
attackInfos.add(new MobAttackInfoHolder(i, mpCon, coolTime, animationTime));
|
attackInfos.add(new MobAttackInfoHolder(i, mpCon, coolTime, animationTime));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Data 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(DataTool.getString("banMsg", banishData), DataTool.getInt("banMap/0/field", banishData, -1), DataTool.getString("banMap/0/portal", banishData, "sp")));
|
||||||
}
|
}
|
||||||
|
|
||||||
int noFlip = MapleDataTool.getInt("noFlip", monsterInfoData, 0);
|
int noFlip = DataTool.getInt("noFlip", monsterInfoData, 0);
|
||||||
if (noFlip > 0) {
|
if (noFlip > 0) {
|
||||||
Point origin = MapleDataTool.getPoint("stand/0/origin", monsterData, null);
|
Point origin = DataTool.getPoint("stand/0/origin", monsterData, null);
|
||||||
if (origin != null) {
|
if (origin != null) {
|
||||||
stats.setFixedStance(origin.getX() < 1 ? 5 : 4); // fixed left/right
|
stats.setFixedStance(origin.getX() < 1 ? 5 : 4); // fixed left/right
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@ public class MapleLifeFactory {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Data monsterInfoData = monsterData.getChildByPath("info");
|
Data monsterInfoData = monsterData.getChildByPath("info");
|
||||||
return MapleDataTool.getIntConvert("level", monsterInfoData);
|
return DataTool.getIntConvert("level", monsterInfoData);
|
||||||
} else {
|
} else {
|
||||||
return stats.getLevel();
|
return stats.getLevel();
|
||||||
}
|
}
|
||||||
@@ -286,11 +286,11 @@ public class MapleLifeFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MapleNPC getNPC(int nid) {
|
public static MapleNPC getNPC(int nid) {
|
||||||
return new MapleNPC(nid, new MapleNPCStats(MapleDataTool.getString(nid + "/name", npcStringData, "MISSINGNO")));
|
return new MapleNPC(nid, new MapleNPCStats(DataTool.getString(nid + "/name", npcStringData, "MISSINGNO")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getNPCDefaultTalk(int nid) {
|
public static String getNPCDefaultTalk(int nid) {
|
||||||
return MapleDataTool.getString(nid + "/d0", npcStringData, "(...)");
|
return DataTool.getString(nid + "/d0", npcStringData, "(...)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class BanishInfo {
|
public static class BanishInfo {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import constants.inventory.ItemConstants;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
import tools.DatabaseConnection;
|
import tools.DatabaseConnection;
|
||||||
@@ -233,7 +233,7 @@ public class MapleMonsterInformationProvider {
|
|||||||
List<Pair<Integer, String>> mobPairList = new LinkedList<>();
|
List<Pair<Integer, String>> mobPairList = new LinkedList<>();
|
||||||
for (Data 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 = DataTool.getString(mobIdData.getChildByPath("name"), "NO-NAME");
|
||||||
mobPairList.add(new Pair<>(mobIdFromData, mobNameFromData));
|
mobPairList.add(new Pair<>(mobIdFromData, mobNameFromData));
|
||||||
}
|
}
|
||||||
for (Pair<Integer, String> mobPair : mobPairList) {
|
for (Pair<Integer, String> mobPair : mobPairList) {
|
||||||
@@ -270,7 +270,7 @@ public class MapleMonsterInformationProvider {
|
|||||||
DataProvider dataProvider = DataProviderFactory.getDataProvider(WZFiles.STRING);
|
DataProvider dataProvider = DataProviderFactory.getDataProvider(WZFiles.STRING);
|
||||||
Data mobData = dataProvider.getData("Mob.img");
|
Data mobData = dataProvider.getData("Mob.img");
|
||||||
|
|
||||||
mobName = MapleDataTool.getString(mobData.getChildByPath(id + "/name"), "");
|
mobName = DataTool.getString(mobData.getChildByPath(id + "/name"), "");
|
||||||
mobNameCache.put(id, mobName);
|
mobNameCache.put(id, mobName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import net.server.Server;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -76,23 +76,23 @@ public class MaplePlayerNPCFactory {
|
|||||||
for (Data 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 = DataTool.getString("name", data, "");
|
||||||
int face = MapleDataTool.getIntConvert("face", data, 20000);
|
int face = DataTool.getIntConvert("face", data, 20000);
|
||||||
int hair = MapleDataTool.getIntConvert("hair", data, 30000);
|
int hair = DataTool.getIntConvert("hair", data, 30000);
|
||||||
int gender = MapleDataTool.getIntConvert("gender", data, 0);
|
int gender = DataTool.getIntConvert("gender", data, 0);
|
||||||
byte skin = (byte) MapleDataTool.getIntConvert("skin", data, 0);
|
byte skin = (byte) DataTool.getIntConvert("skin", data, 0);
|
||||||
int dir = MapleDataTool.getIntConvert("dir", data, 0);
|
int dir = DataTool.getIntConvert("dir", data, 0);
|
||||||
int mapid = MapleDataTool.getIntConvert("map", data, 0);
|
int mapid = DataTool.getIntConvert("map", data, 0);
|
||||||
int FH = MapleDataTool.getIntConvert("fh", data, 0);
|
int FH = DataTool.getIntConvert("fh", data, 0);
|
||||||
int RX0 = MapleDataTool.getIntConvert("rx0", data, 0);
|
int RX0 = DataTool.getIntConvert("rx0", data, 0);
|
||||||
int RX1 = MapleDataTool.getIntConvert("rx1", data, 0);
|
int RX1 = DataTool.getIntConvert("rx1", data, 0);
|
||||||
int CX = MapleDataTool.getIntConvert("cx", data, 0);
|
int CX = DataTool.getIntConvert("cx", data, 0);
|
||||||
int CY = MapleDataTool.getIntConvert("cy", data, 0);
|
int CY = DataTool.getIntConvert("cy", data, 0);
|
||||||
|
|
||||||
Map<Short, Integer> equips = new HashMap<>();
|
Map<Short, Integer> equips = new HashMap<>();
|
||||||
for (Data edata : data.getChildByPath("equips").getChildren()) {
|
for (Data edata : data.getChildByPath("equips").getChildren()) {
|
||||||
short equippos = (short) MapleDataTool.getIntConvert("pos", edata);
|
short equippos = (short) DataTool.getIntConvert("pos", edata);
|
||||||
int equipid = MapleDataTool.getIntConvert("itemid", edata);
|
int equipid = DataTool.getIntConvert("itemid", edata);
|
||||||
|
|
||||||
equips.put(equippos, equipid);
|
equips.put(equippos, equipid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.life;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.StringUtil;
|
import tools.StringUtil;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public class MobAttackInfoFactory {
|
|||||||
Data 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 = DataTool.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));
|
||||||
}
|
}
|
||||||
@@ -61,10 +61,10 @@ public class MobAttackInfoFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Data deadlyAttack = attackData.getChildByPath("deadlyAttack");
|
Data deadlyAttack = attackData.getChildByPath("deadlyAttack");
|
||||||
int mpBurn = MapleDataTool.getInt("mpBurn", attackData, 0);
|
int mpBurn = DataTool.getInt("mpBurn", attackData, 0);
|
||||||
int disease = MapleDataTool.getInt("disease", attackData, 0);
|
int disease = DataTool.getInt("disease", attackData, 0);
|
||||||
int level = MapleDataTool.getInt("level", attackData, 0);
|
int level = DataTool.getInt("level", attackData, 0);
|
||||||
int mpCon = MapleDataTool.getInt("conMP", attackData, 0);
|
int mpCon = DataTool.getInt("conMP", attackData, 0);
|
||||||
ret = new MobAttackInfo(mob.getId(), attack);
|
ret = new MobAttackInfo(mob.getId(), attack);
|
||||||
ret.setDeadlyAttack(deadlyAttack != null);
|
ret.setDeadlyAttack(deadlyAttack != null);
|
||||||
ret.setMpBurn(mpBurn);
|
ret.setMpBurn(mpBurn);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import net.server.audit.locks.factory.MonitoredWriteLockFactory;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@@ -70,24 +70,24 @@ public class MobSkillFactory {
|
|||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
Data 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 = DataTool.getInt(skillData.getChildByPath("mpCon"), 0);
|
||||||
List<Integer> toSummon = new ArrayList<>();
|
List<Integer> toSummon = new ArrayList<>();
|
||||||
for (int i = 0; i > -1; i++) {
|
for (int i = 0; i > -1; i++) {
|
||||||
if (skillData.getChildByPath(String.valueOf(i)) == null) {
|
if (skillData.getChildByPath(String.valueOf(i)) == null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
toSummon.add(MapleDataTool.getInt(skillData.getChildByPath(String.valueOf(i)), 0));
|
toSummon.add(DataTool.getInt(skillData.getChildByPath(String.valueOf(i)), 0));
|
||||||
}
|
}
|
||||||
int effect = MapleDataTool.getInt("summonEffect", skillData, 0);
|
int effect = DataTool.getInt("summonEffect", skillData, 0);
|
||||||
int hp = MapleDataTool.getInt("hp", skillData, 100);
|
int hp = DataTool.getInt("hp", skillData, 100);
|
||||||
int x = MapleDataTool.getInt("x", skillData, 1);
|
int x = DataTool.getInt("x", skillData, 1);
|
||||||
int y = MapleDataTool.getInt("y", skillData, 1);
|
int y = DataTool.getInt("y", skillData, 1);
|
||||||
int count = MapleDataTool.getInt("count", skillData, 1);
|
int count = DataTool.getInt("count", skillData, 1);
|
||||||
long duration = MapleDataTool.getInt("time", skillData, 0) * 1000;
|
long duration = DataTool.getInt("time", skillData, 0) * 1000;
|
||||||
long cooltime = MapleDataTool.getInt("interval", skillData, 0) * 1000;
|
long cooltime = DataTool.getInt("interval", skillData, 0) * 1000;
|
||||||
int iprop = MapleDataTool.getInt("prop", skillData, 100);
|
int iprop = DataTool.getInt("prop", skillData, 100);
|
||||||
float prop = iprop / 100;
|
float prop = iprop / 100;
|
||||||
int limit = MapleDataTool.getInt("limit", skillData, 0);
|
int limit = DataTool.getInt("limit", skillData, 0);
|
||||||
Data ltd = skillData.getChildByPath("lt");
|
Data ltd = skillData.getChildByPath("lt");
|
||||||
Point lt = null;
|
Point lt = null;
|
||||||
Point rb = null;
|
Point rb = null;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.maps;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import scripting.event.EventInstanceManager;
|
import scripting.event.EventInstanceManager;
|
||||||
import server.life.*;
|
import server.life.*;
|
||||||
@@ -54,9 +54,9 @@ public class MapleMapFactory {
|
|||||||
private static void loadLifeFromWz(MapleMap map, Data mapData) {
|
private static void loadLifeFromWz(MapleMap map, Data mapData) {
|
||||||
for (Data life : mapData.getChildByPath("life")) {
|
for (Data life : mapData.getChildByPath("life")) {
|
||||||
life.getName();
|
life.getName();
|
||||||
String id = MapleDataTool.getString(life.getChildByPath("id"));
|
String id = DataTool.getString(life.getChildByPath("id"));
|
||||||
String type = MapleDataTool.getString(life.getChildByPath("type"));
|
String type = DataTool.getString(life.getChildByPath("type"));
|
||||||
int team = MapleDataTool.getInt("team", life, -1);
|
int team = DataTool.getInt("team", life, -1);
|
||||||
if (map.isCPQMap2() && type.equals("m")) {
|
if (map.isCPQMap2() && type.equals("m")) {
|
||||||
if ((Integer.parseInt(life.getName()) % 2) == 0) {
|
if ((Integer.parseInt(life.getName()) % 2) == 0) {
|
||||||
team = 0;
|
team = 0;
|
||||||
@@ -64,16 +64,16 @@ public class MapleMapFactory {
|
|||||||
team = 1;
|
team = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int cy = MapleDataTool.getInt(life.getChildByPath("cy"));
|
int cy = DataTool.getInt(life.getChildByPath("cy"));
|
||||||
Data dF = life.getChildByPath("f");
|
Data dF = life.getChildByPath("f");
|
||||||
int f = (dF != null) ? MapleDataTool.getInt(dF) : 0;
|
int f = (dF != null) ? DataTool.getInt(dF) : 0;
|
||||||
int fh = MapleDataTool.getInt(life.getChildByPath("fh"));
|
int fh = DataTool.getInt(life.getChildByPath("fh"));
|
||||||
int rx0 = MapleDataTool.getInt(life.getChildByPath("rx0"));
|
int rx0 = DataTool.getInt(life.getChildByPath("rx0"));
|
||||||
int rx1 = MapleDataTool.getInt(life.getChildByPath("rx1"));
|
int rx1 = DataTool.getInt(life.getChildByPath("rx1"));
|
||||||
int x = MapleDataTool.getInt(life.getChildByPath("x"));
|
int x = DataTool.getInt(life.getChildByPath("x"));
|
||||||
int y = MapleDataTool.getInt(life.getChildByPath("y"));
|
int y = DataTool.getInt(life.getChildByPath("y"));
|
||||||
int hide = MapleDataTool.getInt("hide", life, 0);
|
int hide = DataTool.getInt("hide", life, 0);
|
||||||
int mobTime = MapleDataTool.getInt("mobTime", life, 0);
|
int mobTime = DataTool.getInt("mobTime", life, 0);
|
||||||
|
|
||||||
loadLifeRaw(map, Integer.parseInt(id), type, cy, f, fh, rx0, rx1, x, y, hide, mobTime, team);
|
loadLifeRaw(map, Integer.parseInt(id), type, cy, f, fh, rx0, rx1, x, y, hide, mobTime, team);
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ public class MapleMapFactory {
|
|||||||
Data 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
|
||||||
Data infoData = mapData.getChildByPath("info");
|
Data infoData = mapData.getChildByPath("info");
|
||||||
|
|
||||||
String link = MapleDataTool.getString(infoData.getChildByPath("link"), "");
|
String link = DataTool.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.
|
||||||
mapName = getMapName(Integer.parseInt(link));
|
mapName = getMapName(Integer.parseInt(link));
|
||||||
mapData = mapSource.getData(mapName);
|
mapData = mapSource.getData(mapName);
|
||||||
@@ -143,37 +143,37 @@ public class MapleMapFactory {
|
|||||||
if (mobRate != null) {
|
if (mobRate != null) {
|
||||||
monsterRate = (Float) mobRate.getData();
|
monsterRate = (Float) mobRate.getData();
|
||||||
}
|
}
|
||||||
map = new MapleMap(mapid, world, channel, MapleDataTool.getInt("returnMap", infoData), monsterRate);
|
map = new MapleMap(mapid, world, channel, DataTool.getInt("returnMap", infoData), monsterRate);
|
||||||
map.setEventInstance(event);
|
map.setEventInstance(event);
|
||||||
|
|
||||||
String onFirstEnter = MapleDataTool.getString(infoData.getChildByPath("onFirstUserEnter"), String.valueOf(mapid));
|
String onFirstEnter = DataTool.getString(infoData.getChildByPath("onFirstUserEnter"), String.valueOf(mapid));
|
||||||
map.setOnFirstUserEnter(onFirstEnter.equals("") ? String.valueOf(mapid) : onFirstEnter);
|
map.setOnFirstUserEnter(onFirstEnter.equals("") ? String.valueOf(mapid) : onFirstEnter);
|
||||||
|
|
||||||
String onEnter = MapleDataTool.getString(infoData.getChildByPath("onUserEnter"), String.valueOf(mapid));
|
String onEnter = DataTool.getString(infoData.getChildByPath("onUserEnter"), String.valueOf(mapid));
|
||||||
map.setOnUserEnter(onEnter.equals("") ? String.valueOf(mapid) : onEnter);
|
map.setOnUserEnter(onEnter.equals("") ? String.valueOf(mapid) : onEnter);
|
||||||
|
|
||||||
map.setFieldLimit(MapleDataTool.getInt(infoData.getChildByPath("fieldLimit"), 0));
|
map.setFieldLimit(DataTool.getInt(infoData.getChildByPath("fieldLimit"), 0));
|
||||||
map.setMobInterval((short) MapleDataTool.getInt(infoData.getChildByPath("createMobInterval"), 5000));
|
map.setMobInterval((short) DataTool.getInt(infoData.getChildByPath("createMobInterval"), 5000));
|
||||||
MaplePortalFactory portalFactory = new MaplePortalFactory();
|
MaplePortalFactory portalFactory = new MaplePortalFactory();
|
||||||
for (Data portal : mapData.getChildByPath("portal")) {
|
for (Data portal : mapData.getChildByPath("portal")) {
|
||||||
map.addPortal(portalFactory.makePortal(MapleDataTool.getInt(portal.getChildByPath("pt")), portal));
|
map.addPortal(portalFactory.makePortal(DataTool.getInt(portal.getChildByPath("pt")), portal));
|
||||||
}
|
}
|
||||||
Data 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(DataTool.getInt(timeMob.getChildByPath("id")), DataTool.getString(timeMob.getChildByPath("message")));
|
||||||
}
|
}
|
||||||
|
|
||||||
int[] bounds = new int[4];
|
int[] bounds = new int[4];
|
||||||
bounds[0] = MapleDataTool.getInt(infoData.getChildByPath("VRTop"));
|
bounds[0] = DataTool.getInt(infoData.getChildByPath("VRTop"));
|
||||||
bounds[1] = MapleDataTool.getInt(infoData.getChildByPath("VRBottom"));
|
bounds[1] = DataTool.getInt(infoData.getChildByPath("VRBottom"));
|
||||||
|
|
||||||
if (bounds[0] == bounds[1]) { // old-style baked map
|
if (bounds[0] == bounds[1]) { // old-style baked map
|
||||||
Data 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] = DataTool.getInt(minimapData.getChildByPath("centerX")) * -1;
|
||||||
bounds[1] = MapleDataTool.getInt(minimapData.getChildByPath("centerY")) * -1;
|
bounds[1] = DataTool.getInt(minimapData.getChildByPath("centerY")) * -1;
|
||||||
bounds[2] = MapleDataTool.getInt(minimapData.getChildByPath("height"));
|
bounds[2] = DataTool.getInt(minimapData.getChildByPath("height"));
|
||||||
bounds[3] = MapleDataTool.getInt(minimapData.getChildByPath("width"));
|
bounds[3] = DataTool.getInt(minimapData.getChildByPath("width"));
|
||||||
|
|
||||||
map.setMapPointBoundings(bounds[0], bounds[1], bounds[2], bounds[3]);
|
map.setMapPointBoundings(bounds[0], bounds[1], bounds[2], bounds[3]);
|
||||||
} else {
|
} else {
|
||||||
@@ -181,8 +181,8 @@ public class MapleMapFactory {
|
|||||||
map.setMapPointBoundings(-dist / 2, -dist / 2, dist, dist);
|
map.setMapPointBoundings(-dist / 2, -dist / 2, dist, dist);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bounds[2] = MapleDataTool.getInt(infoData.getChildByPath("VRLeft"));
|
bounds[2] = DataTool.getInt(infoData.getChildByPath("VRLeft"));
|
||||||
bounds[3] = MapleDataTool.getInt(infoData.getChildByPath("VRRight"));
|
bounds[3] = DataTool.getInt(infoData.getChildByPath("VRRight"));
|
||||||
|
|
||||||
map.setMapLineBoundings(bounds[0], bounds[1], bounds[2], bounds[3]);
|
map.setMapLineBoundings(bounds[0], bounds[1], bounds[2], bounds[3]);
|
||||||
}
|
}
|
||||||
@@ -193,13 +193,13 @@ public class MapleMapFactory {
|
|||||||
for (Data footRoot : mapData.getChildByPath("foothold")) {
|
for (Data footRoot : mapData.getChildByPath("foothold")) {
|
||||||
for (Data footCat : footRoot) {
|
for (Data footCat : footRoot) {
|
||||||
for (Data footHold : footCat) {
|
for (Data footHold : footCat) {
|
||||||
int x1 = MapleDataTool.getInt(footHold.getChildByPath("x1"));
|
int x1 = DataTool.getInt(footHold.getChildByPath("x1"));
|
||||||
int y1 = MapleDataTool.getInt(footHold.getChildByPath("y1"));
|
int y1 = DataTool.getInt(footHold.getChildByPath("y1"));
|
||||||
int x2 = MapleDataTool.getInt(footHold.getChildByPath("x2"));
|
int x2 = DataTool.getInt(footHold.getChildByPath("x2"));
|
||||||
int y2 = MapleDataTool.getInt(footHold.getChildByPath("y2"));
|
int y2 = DataTool.getInt(footHold.getChildByPath("y2"));
|
||||||
MapleFoothold fh = new MapleFoothold(new Point(x1, y1), new Point(x2, y2), Integer.parseInt(footHold.getName()));
|
MapleFoothold fh = new MapleFoothold(new Point(x1, y1), new Point(x2, y2), Integer.parseInt(footHold.getName()));
|
||||||
fh.setPrev(MapleDataTool.getInt(footHold.getChildByPath("prev")));
|
fh.setPrev(DataTool.getInt(footHold.getChildByPath("prev")));
|
||||||
fh.setNext(MapleDataTool.getInt(footHold.getChildByPath("next")));
|
fh.setNext(DataTool.getInt(footHold.getChildByPath("next")));
|
||||||
if (fh.getX1() < lBound.x) {
|
if (fh.getX1() < lBound.x) {
|
||||||
lBound.x = fh.getX1();
|
lBound.x = fh.getX1();
|
||||||
}
|
}
|
||||||
@@ -223,10 +223,10 @@ public class MapleMapFactory {
|
|||||||
map.setFootholds(fTree);
|
map.setFootholds(fTree);
|
||||||
if (mapData.getChildByPath("area") != null) {
|
if (mapData.getChildByPath("area") != null) {
|
||||||
for (Data area : mapData.getChildByPath("area")) {
|
for (Data area : mapData.getChildByPath("area")) {
|
||||||
int x1 = MapleDataTool.getInt(area.getChildByPath("x1"));
|
int x1 = DataTool.getInt(area.getChildByPath("x1"));
|
||||||
int y1 = MapleDataTool.getInt(area.getChildByPath("y1"));
|
int y1 = DataTool.getInt(area.getChildByPath("y1"));
|
||||||
int x2 = MapleDataTool.getInt(area.getChildByPath("x2"));
|
int x2 = DataTool.getInt(area.getChildByPath("x2"));
|
||||||
int y2 = MapleDataTool.getInt(area.getChildByPath("y2"));
|
int y2 = DataTool.getInt(area.getChildByPath("y2"));
|
||||||
map.addMapleArea(new Rectangle(x1, y1, (x2 - x1), (y2 - y1)));
|
map.addMapleArea(new Rectangle(x1, y1, (x2 - x1), (y2 - y1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -263,27 +263,27 @@ public class MapleMapFactory {
|
|||||||
if (map.isCPQMap()) {
|
if (map.isCPQMap()) {
|
||||||
Data mcData = mapData.getChildByPath("monsterCarnival");
|
Data mcData = mapData.getChildByPath("monsterCarnival");
|
||||||
if (mcData != null) {
|
if (mcData != null) {
|
||||||
map.setDeathCP(MapleDataTool.getIntConvert("deathCP", mcData, 0));
|
map.setDeathCP(DataTool.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(DataTool.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(DataTool.getIntConvert("timeDefault", mcData, 0));
|
||||||
map.setTimeExpand(MapleDataTool.getIntConvert("timeExpand", mcData, 0));
|
map.setTimeExpand(DataTool.getIntConvert("timeExpand", mcData, 0));
|
||||||
map.setMaxReactors(MapleDataTool.getIntConvert("guardianGenMax", mcData, 16));
|
map.setMaxReactors(DataTool.getIntConvert("guardianGenMax", mcData, 16));
|
||||||
Data guardianGenData = mcData.getChildByPath("guardianGenPos");
|
Data guardianGenData = mcData.getChildByPath("guardianGenPos");
|
||||||
for (Data 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(DataTool.getIntConvert("x", node), DataTool.getIntConvert("y", node)));
|
||||||
pt.setTeam(MapleDataTool.getIntConvert("team", node, -1));
|
pt.setTeam(DataTool.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 (Data area : mcData.getChildByPath("skill")) {
|
for (Data area : mcData.getChildByPath("skill")) {
|
||||||
map.addSkillId(MapleDataTool.getInt(area));
|
map.addSkillId(DataTool.getInt(area));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcData.getChildByPath("mob") != null) {
|
if (mcData.getChildByPath("mob") != null) {
|
||||||
for (Data area : mcData.getChildByPath("mob")) {
|
for (Data area : mcData.getChildByPath("mob")) {
|
||||||
map.addMobSpawn(MapleDataTool.getInt(area.getChildByPath("id")), MapleDataTool.getInt(area.getChildByPath("spendCP")));
|
map.addMobSpawn(DataTool.getInt(area.getChildByPath("id")), DataTool.getInt(area.getChildByPath("spendCP")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -292,9 +292,9 @@ public class MapleMapFactory {
|
|||||||
|
|
||||||
if (mapData.getChildByPath("reactor") != null) {
|
if (mapData.getChildByPath("reactor") != null) {
|
||||||
for (Data reactor : mapData.getChildByPath("reactor")) {
|
for (Data reactor : mapData.getChildByPath("reactor")) {
|
||||||
String id = MapleDataTool.getString(reactor.getChildByPath("id"));
|
String id = DataTool.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) DataTool.getInt(reactor.getChildByPath("f"), 0));
|
||||||
map.spawnReactor(newReactor);
|
map.spawnReactor(newReactor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,26 +304,26 @@ public class MapleMapFactory {
|
|||||||
map.setStreetName(loadStreetName(mapid));
|
map.setStreetName(loadStreetName(mapid));
|
||||||
|
|
||||||
map.setClock(mapData.getChildByPath("clock") != null);
|
map.setClock(mapData.getChildByPath("clock") != null);
|
||||||
map.setEverlast(MapleDataTool.getIntConvert("everlast", infoData, 0) != 0); // thanks davidlafriniere for noticing value 0 accounting as true
|
map.setEverlast(DataTool.getIntConvert("everlast", infoData, 0) != 0); // thanks davidlafriniere for noticing value 0 accounting as true
|
||||||
map.setTown(MapleDataTool.getIntConvert("town", infoData, 0) != 0);
|
map.setTown(DataTool.getIntConvert("town", infoData, 0) != 0);
|
||||||
map.setHPDec(MapleDataTool.getIntConvert("decHP", infoData, 0));
|
map.setHPDec(DataTool.getIntConvert("decHP", infoData, 0));
|
||||||
map.setHPDecProtect(MapleDataTool.getIntConvert("protectItem", infoData, 0));
|
map.setHPDecProtect(DataTool.getIntConvert("protectItem", infoData, 0));
|
||||||
map.setForcedReturnMap(MapleDataTool.getInt(infoData.getChildByPath("forcedReturn"), 999999999));
|
map.setForcedReturnMap(DataTool.getInt(infoData.getChildByPath("forcedReturn"), 999999999));
|
||||||
map.setBoat(mapData.getChildByPath("shipObj") != null);
|
map.setBoat(mapData.getChildByPath("shipObj") != null);
|
||||||
map.setTimeLimit(MapleDataTool.getIntConvert("timeLimit", infoData, -1));
|
map.setTimeLimit(DataTool.getIntConvert("timeLimit", infoData, -1));
|
||||||
map.setFieldType(MapleDataTool.getIntConvert("fieldType", infoData, 0));
|
map.setFieldType(DataTool.getIntConvert("fieldType", infoData, 0));
|
||||||
map.setMobCapacity(MapleDataTool.getIntConvert("fixedMobCapacity", infoData, 500));//Is there a map that contains more than 500 mobs?
|
map.setMobCapacity(DataTool.getIntConvert("fixedMobCapacity", infoData, 500));//Is there a map that contains more than 500 mobs?
|
||||||
|
|
||||||
Data recData = infoData.getChildByPath("recovery");
|
Data recData = infoData.getChildByPath("recovery");
|
||||||
if (recData != null) {
|
if (recData != null) {
|
||||||
map.setRecovery(MapleDataTool.getFloat(recData));
|
map.setRecovery(DataTool.getFloat(recData));
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMap<Integer, Integer> backTypes = new HashMap<>();
|
HashMap<Integer, Integer> backTypes = new HashMap<>();
|
||||||
try {
|
try {
|
||||||
for (Data 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 = DataTool.getInt(layer.getChildByPath("type"), 0);
|
||||||
|
|
||||||
backTypes.put(layerNum, btype);
|
backTypes.put(layerNum, btype);
|
||||||
}
|
}
|
||||||
@@ -354,12 +354,12 @@ public class MapleMapFactory {
|
|||||||
|
|
||||||
private static MapleReactor loadReactor(Data 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 = DataTool.getInt(reactor.getChildByPath("x"));
|
||||||
int y = MapleDataTool.getInt(reactor.getChildByPath("y"));
|
int y = DataTool.getInt(reactor.getChildByPath("y"));
|
||||||
myReactor.setFacingDirection(FacingDirection);
|
myReactor.setFacingDirection(FacingDirection);
|
||||||
myReactor.setPosition(new Point(x, y));
|
myReactor.setPosition(new Point(x, y));
|
||||||
myReactor.setDelay(MapleDataTool.getInt(reactor.getChildByPath("reactorTime")) * 1000);
|
myReactor.setDelay(DataTool.getInt(reactor.getChildByPath("reactorTime")) * 1000);
|
||||||
myReactor.setName(MapleDataTool.getString(reactor.getChildByPath("name"), ""));
|
myReactor.setName(DataTool.getString(reactor.getChildByPath("name"), ""));
|
||||||
myReactor.resetReactorActions(0);
|
myReactor.resetReactorActions(0);
|
||||||
return myReactor;
|
return myReactor;
|
||||||
}
|
}
|
||||||
@@ -417,7 +417,7 @@ public class MapleMapFactory {
|
|||||||
|
|
||||||
public static String loadPlaceName(int mapid) {
|
public static String loadPlaceName(int mapid) {
|
||||||
try {
|
try {
|
||||||
return MapleDataTool.getString("mapName", nameData.getChildByPath(getMapStringName(mapid)), "");
|
return DataTool.getString("mapName", nameData.getChildByPath(getMapStringName(mapid)), "");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -425,7 +425,7 @@ public class MapleMapFactory {
|
|||||||
|
|
||||||
public static String loadStreetName(int mapid) {
|
public static String loadStreetName(int mapid) {
|
||||||
try {
|
try {
|
||||||
return MapleDataTool.getString("streetName", nameData.getChildByPath(getMapStringName(mapid)), "");
|
return DataTool.getString("streetName", nameData.getChildByPath(getMapStringName(mapid)), "");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
package server.maps;
|
package server.maps;
|
||||||
|
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
@@ -45,13 +45,13 @@ public class MaplePortalFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadPortal(MapleGenericPortal myPortal, Data portal) {
|
private void loadPortal(MapleGenericPortal myPortal, Data portal) {
|
||||||
myPortal.setName(MapleDataTool.getString(portal.getChildByPath("pn")));
|
myPortal.setName(DataTool.getString(portal.getChildByPath("pn")));
|
||||||
myPortal.setTarget(MapleDataTool.getString(portal.getChildByPath("tn")));
|
myPortal.setTarget(DataTool.getString(portal.getChildByPath("tn")));
|
||||||
myPortal.setTargetMapId(MapleDataTool.getInt(portal.getChildByPath("tm")));
|
myPortal.setTargetMapId(DataTool.getInt(portal.getChildByPath("tm")));
|
||||||
int x = MapleDataTool.getInt(portal.getChildByPath("x"));
|
int x = DataTool.getInt(portal.getChildByPath("x"));
|
||||||
int y = MapleDataTool.getInt(portal.getChildByPath("y"));
|
int y = DataTool.getInt(portal.getChildByPath("y"));
|
||||||
myPortal.setPosition(new Point(x, y));
|
myPortal.setPosition(new Point(x, y));
|
||||||
String script = MapleDataTool.getString("script", portal, null);
|
String script = DataTool.getString("script", portal, null);
|
||||||
if (script != null && script.equals("")) {
|
if (script != null && script.equals("")) {
|
||||||
script = null;
|
script = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.maps;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import server.maps.MapleReactorStats.StateData;
|
import server.maps.MapleReactorStats.StateData;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
@@ -47,7 +47,7 @@ public class MapleReactorFactory {
|
|||||||
Data reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
Data reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||||
Data link = reactorData.getChildByPath("info/link");
|
Data link = reactorData.getChildByPath("info/link");
|
||||||
if (link != null) {
|
if (link != null) {
|
||||||
infoId = MapleDataTool.getIntConvert("info/link", reactorData);
|
infoId = DataTool.getIntConvert("info/link", reactorData);
|
||||||
stats = reactorStats.get(infoId);
|
stats = reactorStats.get(infoId);
|
||||||
}
|
}
|
||||||
if (stats == null) {
|
if (stats == null) {
|
||||||
@@ -56,7 +56,7 @@ public class MapleReactorFactory {
|
|||||||
if (reactorData == null) {
|
if (reactorData == null) {
|
||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
boolean canTouch = MapleDataTool.getInt("info/activateByTouch", reactorData, 0) > 0;
|
boolean canTouch = DataTool.getInt("info/activateByTouch", reactorData, 0) > 0;
|
||||||
boolean areaSet = false;
|
boolean areaSet = false;
|
||||||
boolean foundState = false;
|
boolean foundState = false;
|
||||||
for (byte i = 0; true; i++) {
|
for (byte i = 0; true; i++) {
|
||||||
@@ -68,17 +68,17 @@ public class MapleReactorFactory {
|
|||||||
if (reactorInfoData_ != null && reactorInfoData_.getChildByPath("0") != null) {
|
if (reactorInfoData_ != null && reactorInfoData_.getChildByPath("0") != null) {
|
||||||
Data 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 = DataTool.getIntConvert("type", reactorInfoData);
|
||||||
if (type == 100) { //reactor waits for item
|
if (type == 100) { //reactor waits for item
|
||||||
reactItem = new Pair<>(MapleDataTool.getIntConvert("0", reactorInfoData), MapleDataTool.getIntConvert("1", reactorInfoData, 1));
|
reactItem = new Pair<>(DataTool.getIntConvert("0", reactorInfoData), DataTool.getIntConvert("1", reactorInfoData, 1));
|
||||||
if (!areaSet) { //only set area of effect for item-triggered reactors once
|
if (!areaSet) { //only set area of effect for item-triggered reactors once
|
||||||
stats.setTL(MapleDataTool.getPoint("lt", reactorInfoData));
|
stats.setTL(DataTool.getPoint("lt", reactorInfoData));
|
||||||
stats.setBR(MapleDataTool.getPoint("rb", reactorInfoData));
|
stats.setBR(DataTool.getPoint("rb", reactorInfoData));
|
||||||
areaSet = true;
|
areaSet = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foundState = true;
|
foundState = true;
|
||||||
stats.addState(i, type, reactItem, (byte) MapleDataTool.getIntConvert("state", reactorInfoData), MapleDataTool.getIntConvert("timeOut", reactorInfoData_, -1), (byte) (canTouch ? 2 : (MapleDataTool.getIntConvert("2", reactorInfoData, 0) > 0 || reactorInfoData.getChildByPath("clickArea") != null || type == 9 ? 1 : 0)));
|
stats.addState(i, type, reactItem, (byte) DataTool.getIntConvert("state", reactorInfoData), DataTool.getIntConvert("timeOut", reactorInfoData_, -1), (byte) (canTouch ? 2 : (DataTool.getIntConvert("2", reactorInfoData, 0) > 0 || reactorInfoData.getChildByPath("clickArea") != null || type == 9 ? 1 : 0)));
|
||||||
} else {
|
} else {
|
||||||
stats.addState(i, 999, null, (byte) (foundState ? -1 : (i + 1)), 0, (byte) 0);
|
stats.addState(i, 999, null, (byte) (foundState ? -1 : (i + 1)), 0, (byte) 0);
|
||||||
}
|
}
|
||||||
@@ -101,13 +101,13 @@ public class MapleReactorFactory {
|
|||||||
Data reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
Data reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
|
||||||
Data link = reactorData.getChildByPath("info/link");
|
Data link = reactorData.getChildByPath("info/link");
|
||||||
if (link != null) {
|
if (link != null) {
|
||||||
infoId = MapleDataTool.getIntConvert("info/link", reactorData);
|
infoId = DataTool.getIntConvert("info/link", reactorData);
|
||||||
stats = reactorStats.get(infoId);
|
stats = reactorStats.get(infoId);
|
||||||
}
|
}
|
||||||
Data 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 = DataTool.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));
|
||||||
@@ -124,15 +124,15 @@ public class MapleReactorFactory {
|
|||||||
|
|
||||||
for (Data fknexon : eventData.getChildren()) {
|
for (Data fknexon : eventData.getChildren()) {
|
||||||
if (fknexon.getName().equalsIgnoreCase("timeOut")) {
|
if (fknexon.getName().equalsIgnoreCase("timeOut")) {
|
||||||
timeOut = MapleDataTool.getInt(fknexon);
|
timeOut = DataTool.getInt(fknexon);
|
||||||
} else {
|
} else {
|
||||||
Pair<Integer, Integer> reactItem = null;
|
Pair<Integer, Integer> reactItem = null;
|
||||||
int type = MapleDataTool.getIntConvert("type", fknexon);
|
int type = DataTool.getIntConvert("type", fknexon);
|
||||||
if (type == 100) { //reactor waits for item
|
if (type == 100) { //reactor waits for item
|
||||||
reactItem = new Pair<>(MapleDataTool.getIntConvert("0", fknexon), MapleDataTool.getIntConvert("1", fknexon));
|
reactItem = new Pair<>(DataTool.getIntConvert("0", fknexon), DataTool.getIntConvert("1", fknexon));
|
||||||
if (!areaSet || loadArea) { //only set area of effect for item-triggered reactors once
|
if (!areaSet || loadArea) { //only set area of effect for item-triggered reactors once
|
||||||
stats.setTL(MapleDataTool.getPoint("lt", fknexon));
|
stats.setTL(DataTool.getPoint("lt", fknexon));
|
||||||
stats.setBR(MapleDataTool.getPoint("rb", fknexon));
|
stats.setBR(DataTool.getPoint("rb", fknexon));
|
||||||
areaSet = true;
|
areaSet = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,10 +141,10 @@ public class MapleReactorFactory {
|
|||||||
if (activeSkillID != null) {
|
if (activeSkillID != null) {
|
||||||
skillids = new ArrayList<>();
|
skillids = new ArrayList<>();
|
||||||
for (Data skill : activeSkillID.getChildren()) {
|
for (Data skill : activeSkillID.getChildren()) {
|
||||||
skillids.add(MapleDataTool.getInt(skill));
|
skillids.add(DataTool.getInt(skill));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
byte nextState = (byte) MapleDataTool.getIntConvert("state", fknexon);
|
byte nextState = (byte) DataTool.getIntConvert("state", fknexon);
|
||||||
statedatas.add(new StateData(type, reactItem, skillids, nextState));
|
statedatas.add(new StateData(type, reactItem, skillids, nextState));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import client.Disease;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import server.life.MobSkill;
|
import server.life.MobSkill;
|
||||||
import server.life.MobSkillFactory;
|
import server.life.MobSkillFactory;
|
||||||
@@ -42,7 +42,7 @@ public class MapleCarnivalFactory {
|
|||||||
}
|
}
|
||||||
for (Data 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(DataTool.getInt("spendCP", z, 0), DataTool.getInt("mobSkillID", z, 0), DataTool.getInt("level", z, 0), DataTool.getInt("target", z, 1) > 1);
|
||||||
|
|
||||||
skills.put(id, ms);
|
skills.put(id, ms);
|
||||||
if (ms.targetsAll) {
|
if (ms.targetsAll) {
|
||||||
@@ -52,7 +52,7 @@ public class MapleCarnivalFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Data 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(DataTool.getInt("spendCP", z, 0), DataTool.getInt("mobSkillID", z, 0), DataTool.getInt("level", z, 0), true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import config.YamlConfig;
|
|||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import server.quest.actions.*;
|
import server.quest.actions.*;
|
||||||
import server.quest.requirements.*;
|
import server.quest.requirements.*;
|
||||||
@@ -84,16 +84,16 @@ public class MapleQuest {
|
|||||||
if(questInfo != null) {
|
if(questInfo != null) {
|
||||||
Data 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 = DataTool.getString("name", reqInfo, "");
|
||||||
parent = MapleDataTool.getString("parent", reqInfo, "");
|
parent = DataTool.getString("parent", reqInfo, "");
|
||||||
|
|
||||||
timeLimit = MapleDataTool.getInt("timeLimit", reqInfo, 0);
|
timeLimit = DataTool.getInt("timeLimit", reqInfo, 0);
|
||||||
timeLimit2 = MapleDataTool.getInt("timeLimit2", reqInfo, 0);
|
timeLimit2 = DataTool.getInt("timeLimit2", reqInfo, 0);
|
||||||
autoStart = MapleDataTool.getInt("autoStart", reqInfo, 0) == 1;
|
autoStart = DataTool.getInt("autoStart", reqInfo, 0) == 1;
|
||||||
autoPreComplete = MapleDataTool.getInt("autoPreComplete", reqInfo, 0) == 1;
|
autoPreComplete = DataTool.getInt("autoPreComplete", reqInfo, 0) == 1;
|
||||||
autoComplete = MapleDataTool.getInt("autoComplete", reqInfo, 0) == 1;
|
autoComplete = DataTool.getInt("autoComplete", reqInfo, 0) == 1;
|
||||||
|
|
||||||
int medalid = MapleDataTool.getInt("viewMedalItem", reqInfo, 0);
|
int medalid = DataTool.getInt("viewMedalItem", reqInfo, 0);
|
||||||
if(medalid != 0) medals.put(this.id, medalid);
|
if(medalid != 0) medals.put(this.id, medalid);
|
||||||
} else {
|
} else {
|
||||||
System.out.println("no data " + id);
|
System.out.println("no data " + id);
|
||||||
@@ -108,7 +108,7 @@ public class MapleQuest {
|
|||||||
repeatable = true;
|
repeatable = true;
|
||||||
} else if (type.equals(MapleQuestRequirementType.MOB)) {
|
} else if (type.equals(MapleQuestRequirementType.MOB)) {
|
||||||
for (Data mob : startReq.getChildren()) {
|
for (Data mob : startReq.getChildren()) {
|
||||||
relevantMobs.add(MapleDataTool.getInt(mob.getChildByPath("id")));
|
relevantMobs.add(DataTool.getInt(mob.getChildByPath("id")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ public class MapleQuest {
|
|||||||
|
|
||||||
if (type.equals(MapleQuestRequirementType.MOB)) {
|
if (type.equals(MapleQuestRequirementType.MOB)) {
|
||||||
for (Data mob : completeReq.getChildren()) {
|
for (Data mob : completeReq.getChildren()) {
|
||||||
relevantMobs.add(MapleDataTool.getInt(mob.getChildByPath("id")));
|
relevantMobs.add(DataTool.getInt(mob.getChildByPath("id")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
completeReqs.put(type, req);
|
completeReqs.put(type, req);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.actions;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
@@ -47,7 +47,7 @@ public class BuffAction extends MapleQuestAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
itemEffect = MapleDataTool.getInt(data);
|
itemEffect = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.actions;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public class ExpAction extends MapleQuestAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
exp = MapleDataTool.getInt(data);
|
exp = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.actions;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public class FameAction extends MapleQuestAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
fame = MapleDataTool.getInt(data);
|
fame = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package server.quest.actions;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ public class InfoAction extends MapleQuestAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
info = MapleDataTool.getString(data, "");
|
info = DataTool.getString(data, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import client.inventory.Item;
|
|||||||
import client.inventory.manipulator.InventoryManipulator;
|
import client.inventory.manipulator.InventoryManipulator;
|
||||||
import constants.inventory.ItemConstants;
|
import constants.inventory.ItemConstants;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
@@ -59,22 +59,22 @@ public class ItemAction extends MapleQuestAction {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
for (Data iEntry : data.getChildren()) {
|
for (Data iEntry : data.getChildren()) {
|
||||||
int id = MapleDataTool.getInt(iEntry.getChildByPath("id"));
|
int id = DataTool.getInt(iEntry.getChildByPath("id"));
|
||||||
int count = MapleDataTool.getInt(iEntry.getChildByPath("count"), 1);
|
int count = DataTool.getInt(iEntry.getChildByPath("count"), 1);
|
||||||
int period = MapleDataTool.getInt(iEntry.getChildByPath("period"), 0);
|
int period = DataTool.getInt(iEntry.getChildByPath("period"), 0);
|
||||||
|
|
||||||
Integer prop = null;
|
Integer prop = null;
|
||||||
Data propData = iEntry.getChildByPath("prop");
|
Data propData = iEntry.getChildByPath("prop");
|
||||||
if(propData != null)
|
if(propData != null)
|
||||||
prop = MapleDataTool.getInt(propData);
|
prop = DataTool.getInt(propData);
|
||||||
|
|
||||||
int gender = 2;
|
int gender = 2;
|
||||||
if (iEntry.getChildByPath("gender") != null)
|
if (iEntry.getChildByPath("gender") != null)
|
||||||
gender = MapleDataTool.getInt(iEntry.getChildByPath("gender"));
|
gender = DataTool.getInt(iEntry.getChildByPath("gender"));
|
||||||
|
|
||||||
int job = -1;
|
int job = -1;
|
||||||
if (iEntry.getChildByPath("job") != null)
|
if (iEntry.getChildByPath("job") != null)
|
||||||
job = MapleDataTool.getInt(iEntry.getChildByPath("job"));
|
job = DataTool.getInt(iEntry.getChildByPath("job"));
|
||||||
|
|
||||||
items.add(new ItemData(Integer.parseInt(iEntry.getName()), id, count, prop, job, gender, period));
|
items.add(new ItemData(Integer.parseInt(iEntry.getName()), id, count, prop, job, gender, period));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.actions;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ public class MesoAction extends MapleQuestAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
mesos = MapleDataTool.getInt(data);
|
mesos = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.actions;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import client.QuestStatus;
|
import client.QuestStatus;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
import tools.PacketCreator;
|
import tools.PacketCreator;
|
||||||
@@ -44,7 +44,7 @@ public class NextQuestAction extends MapleQuestAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
nextQuest = MapleDataTool.getInt(data);
|
nextQuest = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import client.Character;
|
|||||||
import client.QuestStatus;
|
import client.QuestStatus;
|
||||||
import constants.inventory.ItemConstants;
|
import constants.inventory.ItemConstants;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ public class PetSkillAction extends MapleQuestAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
flag = MapleDataTool.getInt("petskill", data);
|
flag = DataTool.getInt("petskill", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import client.Character;
|
|||||||
import client.Client;
|
import client.Client;
|
||||||
import client.inventory.Pet;
|
import client.inventory.Pet;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public class PetTamenessAction extends MapleQuestAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
tameness = MapleDataTool.getInt(data);
|
tameness = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.actions;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import client.QuestStatus;
|
import client.QuestStatus;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
|
|
||||||
@@ -49,8 +49,8 @@ public class QuestAction extends MapleQuestAction {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
for (Data qEntry : data) {
|
for (Data qEntry : data) {
|
||||||
int questid = MapleDataTool.getInt(qEntry.getChildByPath("id"));
|
int questid = DataTool.getInt(qEntry.getChildByPath("id"));
|
||||||
int stat = MapleDataTool.getInt(qEntry.getChildByPath("state"));
|
int stat = DataTool.getInt(qEntry.getChildByPath("state"));
|
||||||
quests.put(questid, stat);
|
quests.put(questid, stat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import client.Job;
|
|||||||
import client.Skill;
|
import client.Skill;
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestActionType;
|
import server.quest.MapleQuestActionType;
|
||||||
|
|
||||||
@@ -53,17 +53,17 @@ public class SkillAction extends MapleQuestAction {
|
|||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
for (Data sEntry : data) {
|
for (Data sEntry : data) {
|
||||||
byte skillLevel = 0;
|
byte skillLevel = 0;
|
||||||
int skillid = MapleDataTool.getInt(sEntry.getChildByPath("id"));
|
int skillid = DataTool.getInt(sEntry.getChildByPath("id"));
|
||||||
Data skillLevelData = sEntry.getChildByPath("skillLevel");
|
Data skillLevelData = sEntry.getChildByPath("skillLevel");
|
||||||
if(skillLevelData != null)
|
if(skillLevelData != null)
|
||||||
skillLevel = (byte) MapleDataTool.getInt(skillLevelData);
|
skillLevel = (byte) DataTool.getInt(skillLevelData);
|
||||||
int masterLevel = MapleDataTool.getInt(sEntry.getChildByPath("masterLevel"));
|
int masterLevel = DataTool.getInt(sEntry.getChildByPath("masterLevel"));
|
||||||
List<Integer> jobs = new ArrayList<>();
|
List<Integer> jobs = new ArrayList<>();
|
||||||
|
|
||||||
Data applicableJobs = sEntry.getChildByPath("job");
|
Data applicableJobs = sEntry.getChildByPath("job");
|
||||||
if(applicableJobs != null) {
|
if(applicableJobs != null) {
|
||||||
for (Data applicableJob : applicableJobs.getChildren()) {
|
for (Data applicableJob : applicableJobs.getChildren()) {
|
||||||
jobs.add(MapleDataTool.getInt(applicableJob));
|
jobs.add(DataTool.getInt(applicableJob));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ public class BuffExceptRequirement extends MapleQuestRequirement {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data 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(DataTool.getString(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ public class BuffRequirement extends MapleQuestRequirement {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data 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(DataTool.getString(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ public class CompletedQuestRequirement extends MapleQuestRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
reqQuest = MapleDataTool.getInt(data);
|
reqQuest = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ public class EndDateRequirement extends MapleQuestRequirement {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
timeStr = MapleDataTool.getString(data);
|
timeStr = DataTool.getString(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ public class FieldEnterRequirement extends MapleQuestRequirement {
|
|||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
Data zeroField = data.getChildByPath("0");
|
Data zeroField = data.getChildByPath("0");
|
||||||
if (zeroField != null) {
|
if (zeroField != null) {
|
||||||
mapId = MapleDataTool.getInt(zeroField);
|
mapId = DataTool.getInt(zeroField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public class InfoExRequirement extends MapleQuestRequirement {
|
|||||||
// Because we have to...
|
// Because we have to...
|
||||||
for(Data infoEx : data.getChildren()) {
|
for(Data infoEx : data.getChildren()) {
|
||||||
Data value = infoEx.getChildByPath("value");
|
Data value = infoEx.getChildByPath("value");
|
||||||
infoExpected.add(MapleDataTool.getString(value, ""));
|
infoExpected.add(DataTool.getString(value, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ public class InfoNumberRequirement extends MapleQuestRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
infoNumber = (short) MapleDataTool.getIntConvert(data, 0);
|
infoNumber = (short) DataTool.getIntConvert(data, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.requirements;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import client.QuestStatus;
|
import client.QuestStatus;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ public class IntervalRequirement extends MapleQuestRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
interval = MapleDataTool.getInt(data) * 60 * 1000;
|
interval = DataTool.getInt(data) * 60 * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getIntervalTimeLeft(Character chr, IntervalRequirement r) {
|
private static String getIntervalTimeLeft(Character chr, IntervalRequirement r) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import client.inventory.InventoryType;
|
|||||||
import client.inventory.Item;
|
import client.inventory.Item;
|
||||||
import constants.inventory.ItemConstants;
|
import constants.inventory.ItemConstants;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
@@ -50,8 +50,8 @@ public class ItemRequirement extends MapleQuestRequirement {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
for (Data itemEntry : data.getChildren()) {
|
for (Data itemEntry : data.getChildren()) {
|
||||||
int itemId = MapleDataTool.getInt(itemEntry.getChildByPath("id"));
|
int itemId = DataTool.getInt(itemEntry.getChildByPath("id"));
|
||||||
int count = MapleDataTool.getInt(itemEntry.getChildByPath("count"), 0);
|
int count = DataTool.getInt(itemEntry.getChildByPath("count"), 0);
|
||||||
|
|
||||||
items.put(itemId, count);
|
items.put(itemId, count);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.requirements;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import client.Job;
|
import client.Job;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public class JobRequirement extends MapleQuestRequirement {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
for (Data jobEntry : data.getChildren()) {
|
for (Data jobEntry : data.getChildren()) {
|
||||||
jobs.add(MapleDataTool.getInt(jobEntry));
|
jobs.add(DataTool.getInt(jobEntry));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ public class MaxLevelRequirement extends MapleQuestRequirement {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
maxLevel = MapleDataTool.getInt(data);
|
maxLevel = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class MesoRequirement extends MapleQuestRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
meso = MapleDataTool.getInt(data);
|
meso = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public class MinLevelRequirement extends MapleQuestRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
minLevel = MapleDataTool.getInt(data);
|
minLevel = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.requirements;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import client.inventory.Pet;
|
import client.inventory.Pet;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ public class MinTamenessRequirement extends MapleQuestRequirement {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
minTameness = MapleDataTool.getInt(data);
|
minTameness = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.requirements;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import client.QuestStatus;
|
import client.QuestStatus;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
import tools.FilePrinter;
|
import tools.FilePrinter;
|
||||||
@@ -53,8 +53,8 @@ public class MobRequirement extends MapleQuestRequirement {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
for (Data questEntry : data.getChildren()) {
|
for (Data questEntry : data.getChildren()) {
|
||||||
int mobID = MapleDataTool.getInt(questEntry.getChildByPath("id"));
|
int mobID = DataTool.getInt(questEntry.getChildByPath("id"));
|
||||||
int countReq = MapleDataTool.getInt(questEntry.getChildByPath("count"));
|
int countReq = DataTool.getInt(questEntry.getChildByPath("count"));
|
||||||
mobs.put(mobID, countReq);
|
mobs.put(mobID, countReq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ public class MonsterBookCountRequirement extends MapleQuestRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
reqCards = MapleDataTool.getInt(data);
|
reqCards = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ public class NpcRequirement extends MapleQuestRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
reqNPC = MapleDataTool.getInt(data);
|
reqNPC = DataTool.getInt(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package server.quest.requirements;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import client.inventory.Pet;
|
import client.inventory.Pet;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ public class PetRequirement extends MapleQuestRequirement {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
for(Data petData : data.getChildren()) {
|
for(Data petData : data.getChildren()) {
|
||||||
petIDs.add(MapleDataTool.getInt(petData.getChildByPath("id")));
|
petIDs.add(DataTool.getInt(petData.getChildByPath("id")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package server.quest.requirements;
|
|||||||
import client.Character;
|
import client.Character;
|
||||||
import client.QuestStatus;
|
import client.QuestStatus;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -47,8 +47,8 @@ public class QuestRequirement extends MapleQuestRequirement {
|
|||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
for (Data questEntry : data.getChildren()) {
|
for (Data questEntry : data.getChildren()) {
|
||||||
int questID = MapleDataTool.getInt(questEntry.getChildByPath("id"));
|
int questID = DataTool.getInt(questEntry.getChildByPath("id"));
|
||||||
int stateReq = MapleDataTool.getInt(questEntry.getChildByPath("state"));
|
int stateReq = DataTool.getInt(questEntry.getChildByPath("state"));
|
||||||
quests.put(questID, stateReq);
|
quests.put(questID, stateReq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ package server.quest.requirements;
|
|||||||
|
|
||||||
import client.Character;
|
import client.Character;
|
||||||
import provider.Data;
|
import provider.Data;
|
||||||
import provider.MapleDataTool;
|
import provider.DataTool;
|
||||||
import server.quest.MapleQuest;
|
import server.quest.MapleQuest;
|
||||||
import server.quest.MapleQuestRequirementType;
|
import server.quest.MapleQuestRequirementType;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class ScriptRequirement extends MapleQuestRequirement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(Data data) {
|
public void processData(Data data) {
|
||||||
reqScript = !MapleDataTool.getString(data, "").isEmpty();
|
reqScript = !DataTool.getString(data, "").isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,61 +37,61 @@ public class MonsterStatFetcher {
|
|||||||
|
|
||||||
Data 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(DataTool.getIntConvert("maxHP", monsterInfoData));
|
||||||
stats.setFriendly(MapleDataTool.getIntConvert("damagedByMob", monsterInfoData, 0) == 1);
|
stats.setFriendly(DataTool.getIntConvert("damagedByMob", monsterInfoData, 0) == 1);
|
||||||
stats.setPADamage(MapleDataTool.getIntConvert("PADamage", monsterInfoData));
|
stats.setPADamage(DataTool.getIntConvert("PADamage", monsterInfoData));
|
||||||
stats.setPDDamage(MapleDataTool.getIntConvert("PDDamage", monsterInfoData));
|
stats.setPDDamage(DataTool.getIntConvert("PDDamage", monsterInfoData));
|
||||||
stats.setMADamage(MapleDataTool.getIntConvert("MADamage", monsterInfoData));
|
stats.setMADamage(DataTool.getIntConvert("MADamage", monsterInfoData));
|
||||||
stats.setMDDamage(MapleDataTool.getIntConvert("MDDamage", monsterInfoData));
|
stats.setMDDamage(DataTool.getIntConvert("MDDamage", monsterInfoData));
|
||||||
stats.setMp(MapleDataTool.getIntConvert("maxMP", monsterInfoData, 0));
|
stats.setMp(DataTool.getIntConvert("maxMP", monsterInfoData, 0));
|
||||||
stats.setExp(MapleDataTool.getIntConvert("exp", monsterInfoData, 0));
|
stats.setExp(DataTool.getIntConvert("exp", monsterInfoData, 0));
|
||||||
stats.setLevel(MapleDataTool.getIntConvert("level", monsterInfoData));
|
stats.setLevel(DataTool.getIntConvert("level", monsterInfoData));
|
||||||
stats.setRemoveAfter(MapleDataTool.getIntConvert("removeAfter", monsterInfoData, 0));
|
stats.setRemoveAfter(DataTool.getIntConvert("removeAfter", monsterInfoData, 0));
|
||||||
stats.setBoss(MapleDataTool.getIntConvert("boss", monsterInfoData, 0) > 0);
|
stats.setBoss(DataTool.getIntConvert("boss", monsterInfoData, 0) > 0);
|
||||||
stats.setExplosiveReward(MapleDataTool.getIntConvert("explosiveReward", monsterInfoData, 0) > 0);
|
stats.setExplosiveReward(DataTool.getIntConvert("explosiveReward", monsterInfoData, 0) > 0);
|
||||||
stats.setFfaLoot(MapleDataTool.getIntConvert("publicReward", monsterInfoData, 0) > 0);
|
stats.setFfaLoot(DataTool.getIntConvert("publicReward", monsterInfoData, 0) > 0);
|
||||||
stats.setUndead(MapleDataTool.getIntConvert("undead", monsterInfoData, 0) > 0);
|
stats.setUndead(DataTool.getIntConvert("undead", monsterInfoData, 0) > 0);
|
||||||
stats.setName(MapleDataTool.getString(mid + "/name", mobStringData, "MISSINGNO"));
|
stats.setName(DataTool.getString(mid + "/name", mobStringData, "MISSINGNO"));
|
||||||
stats.setBuffToGive(MapleDataTool.getIntConvert("buff", monsterInfoData, -1));
|
stats.setBuffToGive(DataTool.getIntConvert("buff", monsterInfoData, -1));
|
||||||
stats.setCP(MapleDataTool.getIntConvert("getCP", monsterInfoData, 0));
|
stats.setCP(DataTool.getIntConvert("getCP", monsterInfoData, 0));
|
||||||
stats.setRemoveOnMiss(MapleDataTool.getIntConvert("removeOnMiss", monsterInfoData, 0) > 0);
|
stats.setRemoveOnMiss(DataTool.getIntConvert("removeOnMiss", monsterInfoData, 0) > 0);
|
||||||
|
|
||||||
Data special = monsterInfoData.getChildByPath("coolDamage");
|
Data special = monsterInfoData.getChildByPath("coolDamage");
|
||||||
if (special != null) {
|
if (special != null) {
|
||||||
int coolDmg = MapleDataTool.getIntConvert("coolDamage", monsterInfoData);
|
int coolDmg = DataTool.getIntConvert("coolDamage", monsterInfoData);
|
||||||
int coolProb = MapleDataTool.getIntConvert("coolDamageProb", monsterInfoData, 0);
|
int coolProb = DataTool.getIntConvert("coolDamageProb", monsterInfoData, 0);
|
||||||
stats.setCool(new Pair<>(coolDmg, coolProb));
|
stats.setCool(new Pair<>(coolDmg, coolProb));
|
||||||
}
|
}
|
||||||
special = monsterInfoData.getChildByPath("loseItem");
|
special = monsterInfoData.getChildByPath("loseItem");
|
||||||
if (special != null) {
|
if (special != null) {
|
||||||
for (Data 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(DataTool.getInt(liData.getChildByPath("id")), (byte) DataTool.getInt(liData.getChildByPath("prop")), (byte) DataTool.getInt(liData.getChildByPath("x"))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
special = monsterInfoData.getChildByPath("selfDestruction");
|
special = monsterInfoData.getChildByPath("selfDestruction");
|
||||||
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) DataTool.getInt(special.getChildByPath("action")), DataTool.getIntConvert("removeAfter", special, -1), DataTool.getIntConvert("hp", special, -1)));
|
||||||
}
|
}
|
||||||
Data 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) {
|
||||||
firstAttack = Math.round(MapleDataTool.getFloat(firstAttackData));
|
firstAttack = Math.round(DataTool.getFloat(firstAttackData));
|
||||||
} else {
|
} else {
|
||||||
firstAttack = MapleDataTool.getInt(firstAttackData);
|
firstAttack = DataTool.getInt(firstAttackData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.setFirstAttack(firstAttack > 0);
|
stats.setFirstAttack(firstAttack > 0);
|
||||||
stats.setDropPeriod(MapleDataTool.getIntConvert("dropItemPeriod", monsterInfoData, 0) * 10000);
|
stats.setDropPeriod(DataTool.getIntConvert("dropItemPeriod", monsterInfoData, 0) * 10000);
|
||||||
|
|
||||||
stats.setTagColor(MapleDataTool.getIntConvert("hpTagColor", monsterInfoData, 0));
|
stats.setTagColor(DataTool.getIntConvert("hpTagColor", monsterInfoData, 0));
|
||||||
stats.setTagBgColor(MapleDataTool.getIntConvert("hpTagBgcolor", monsterInfoData, 0));
|
stats.setTagBgColor(DataTool.getIntConvert("hpTagBgcolor", monsterInfoData, 0));
|
||||||
|
|
||||||
for (Data idata : monsterData) {
|
for (Data idata : monsterData) {
|
||||||
if (!idata.getName().equals("info")) {
|
if (!idata.getName().equals("info")) {
|
||||||
int delay = 0;
|
int delay = 0;
|
||||||
for (Data pic : idata.getChildren()) {
|
for (Data pic : idata.getChildren()) {
|
||||||
delay += MapleDataTool.getIntConvert("delay", pic, 0);
|
delay += DataTool.getIntConvert("delay", pic, 0);
|
||||||
}
|
}
|
||||||
stats.setAnimationTime(idata.getName(), delay);
|
stats.setAnimationTime(idata.getName(), delay);
|
||||||
}
|
}
|
||||||
@@ -100,24 +100,24 @@ public class MonsterStatFetcher {
|
|||||||
if (reviveInfo != null) {
|
if (reviveInfo != null) {
|
||||||
List<Integer> revives = new LinkedList<>();
|
List<Integer> revives = new LinkedList<>();
|
||||||
for (Data data_ : reviveInfo) {
|
for (Data data_ : reviveInfo) {
|
||||||
revives.add(MapleDataTool.getInt(data_));
|
revives.add(DataTool.getInt(data_));
|
||||||
}
|
}
|
||||||
stats.setRevives(revives);
|
stats.setRevives(revives);
|
||||||
}
|
}
|
||||||
decodeElementalString(stats, MapleDataTool.getString("elemAttr", monsterInfoData, ""));
|
decodeElementalString(stats, DataTool.getString("elemAttr", monsterInfoData, ""));
|
||||||
Data 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<>();
|
||||||
while (monsterSkillData.getChildByPath(Integer.toString(i)) != null) {
|
while (monsterSkillData.getChildByPath(Integer.toString(i)) != null) {
|
||||||
skills.add(new Pair<>(MapleDataTool.getInt(i + "/skill", monsterSkillData, 0), MapleDataTool.getInt(i + "/level", monsterSkillData, 0)));
|
skills.add(new Pair<>(DataTool.getInt(i + "/skill", monsterSkillData, 0), DataTool.getInt(i + "/level", monsterSkillData, 0)));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
stats.setSkills(skills);
|
stats.setSkills(skills);
|
||||||
}
|
}
|
||||||
Data 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(DataTool.getString("banMsg", banishData), DataTool.getInt("banMap/0/field", banishData, -1), DataTool.getString("banMap/0/portal", banishData, "sp")));
|
||||||
}
|
}
|
||||||
|
|
||||||
monsterStats.put(mid, stats);
|
monsterStats.put(mid, stats);
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ public class NoItemNameFetcher {
|
|||||||
itemsWithNoNameProperty.remove(itemId);
|
itemsWithNoNameProperty.remove(itemId);
|
||||||
} else {
|
} else {
|
||||||
if (nameData != null) {
|
if (nameData != null) {
|
||||||
nameContentCache.put(itemId, MapleDataTool.getString("name", md));
|
nameContentCache.put(itemId, DataTool.getString("name", md));
|
||||||
} else if (descData != null) {
|
} else if (descData != null) {
|
||||||
descContentCache.put(itemId, MapleDataTool.getString("desc", md));
|
descContentCache.put(itemId, DataTool.getString("desc", md));
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("Found itemid on String.wz with no full property: " + subdirPath + subdirData.getName() + "/" + md.getName());
|
System.out.println("Found itemid on String.wz with no full property: " + subdirPath + subdirData.getName() + "/" + md.getName());
|
||||||
|
|||||||
Reference in New Issue
Block a user