Aran skill & mount quests + New player IDs + MapleSkillMakerFetcher

Aran skill and mount questlines fixed.
Player ID starts counting from 20mil now, preventing clashes with map objects oid's (trying to solve the NPC disappearing issue).
New tool: MapleSkillMakerFetcher. It compiles a SQL script file containing updated Maker data info from the inputted ItemMake.wz.xml.
Updated Maker tables on the DB.
This commit is contained in:
ronancpl
2017-11-14 16:55:37 -02:00
parent 6fbd23f903
commit bc482ee0d2
72 changed files with 41495 additions and 18673 deletions

View File

@@ -3,4 +3,4 @@ do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\USER\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
user.properties.file=C:\\Users\\RonanLana\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties

View File

@@ -2,6 +2,8 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
<group>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/tools/MapleQuestItemFetcher/src/maplequestitemfetcher/MapleQuestItemFetcher.java</file>
</group>
</open-files>
</project-private>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
build.xml.data.CRC32=25dbbb1c
build.xml.script.CRC32=3f07a01f
build.xml.stylesheet.CRC32=8064a381@1.75.2.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=25dbbb1c
nbproject/build-impl.xml.script.CRC32=325afaef
nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48

View File

@@ -0,0 +1,73 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processor.options=
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# Os arquivos em build.classes.dir que devem ser exclu\u00eddos do jar de distribui\u00e7\u00e3o
dist.archive.excludes=
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/MapleSkillMakerFetcher.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
includes=**
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.7
javac.target=1.7
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=mapleskillmakerfetcher.MapleSkillMakerFetcher
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=JDK_1.7
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project.
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-prop.name=value:
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>MapleSkillMakerFetcher</name>
<explicit-platform explicit-source-supported="true"/>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>

View File

@@ -0,0 +1,64 @@
/*
This file is part of the MapleSolaxiaV2 Maple Story Server
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package mapleskillmakerfetcher;
import java.util.List;
/**
*
* @author RonanLana
*/
public class MapleMakerItemEntry {
public int id = -1;
public int itemid = -1;
public int reqLevel = -1;
public int reqMakerLevel = -1;
public int reqItem = -1;
public int reqMeso = -1;
public int reqEquip = -1;
public int catalyst = -1;
public int quantity = -1;
public int tuc = -1;
public int recipeCount = -1;
public int recipeItem = -1;
public List<int[]> recipeList = null;
public List<int[]> randomList = null;
public MapleMakerItemEntry(int id, int itemid, int reqLevel, int reqMakerLevel, int reqItem, int reqMeso, int reqEquip, int catalyst, int quantity, int tuc, int recipeCount, int recipeItem, List<int[]> recipeList, List<int[]> randomList) {
this.id = id;
this.itemid = itemid;
this.reqLevel = reqLevel;
//System.out.println("id " + id + "rq" + reqLevel);
this.reqMakerLevel = reqMakerLevel;
this.reqItem = reqItem;
this.reqMeso = reqMeso;
this.reqEquip = reqEquip;
this.catalyst = catalyst;
this.quantity = quantity;
this.tuc = tuc;
this.recipeCount = recipeCount;
this.recipeItem = recipeItem;
this.recipeList = recipeList;
this.randomList = randomList;
}
}

View File

@@ -0,0 +1,360 @@
/*
This file is part of the MapleSolaxiaV2 Maple Story Server
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package mapleskillmakerfetcher;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.io.*;
import static mapleskillmakerfetcher.MapleSkillMakerFetcher.id;
/**
* @author RonanLana
*
* The objective of this program is to uncover all maker data from the
* ItemMaker.wz.xml files and generate a SQL file with every data info
* for the Maker DB tables.
*
*/
public class MapleSkillMakerFetcher {
static String host = "jdbc:mysql://localhost:3306/maplesolaxia";
static String driver = "com.mysql.jdbc.Driver";
static String username = "root";
static String password = "";
static String fileName = "lib/ItemMake.img.xml";
static String newFile = "lib/MakerData.sql";
static PrintWriter printWriter = null;
static InputStreamReader fileReader = null;
static BufferedReader bufferedReader = null;
static byte status = 0;
static byte state = 0;
static int initialStringLength = 50;
// maker data fields
static int id = -1;
static int itemid = -1;
static int reqLevel = -1;
static int reqMakerLevel = -1;
static int reqItem = -1;
static int reqMeso = -1;
static int reqEquip = -1;
static int catalyst = -1;
static int quantity = -1;
static int tuc = -1;
static int recipePos = -1;
static int recipeProb = -1;
static int recipeCount = -1;
static int recipeItem = -1;
static List<int[]> recipeList = null;
static List<int[]> randomList = null;
static List<MapleMakerItemEntry> makerList = new ArrayList<>(100);
private static void resetMakerDataFields() {
reqLevel = 0;
reqMakerLevel = 0;
reqItem = 0;
reqMeso = 0;
reqEquip = 0;
catalyst = 0;
quantity = 0;
tuc = 0;
recipePos = 0;
recipeProb = 0;
recipeCount = 0;
recipeItem = 0;
recipeList = null;
randomList = null;
}
private static String getName(String token) {
int i, j;
char[] dest;
String d;
i = token.lastIndexOf("name");
i = token.indexOf("\"", i) + 1; //lower bound of the string
j = token.indexOf("\"", i); //upper bound
dest = new char[initialStringLength];
token.getChars(i, j, dest, 0);
d = new String(dest);
String s = d.trim();
s.replaceFirst("^0+(?!$)", "");
return(s);
}
private static String getValue(String token) {
int i, j;
char[] dest;
String d;
i = token.lastIndexOf("value");
i = token.indexOf("\"", i) + 1; //lower bound of the string
j = token.indexOf("\"", i); //upper bound
dest = new char[initialStringLength];
token.getChars(i, j, dest, 0);
d = new String(dest);
String s = d.trim();
s.replaceFirst("^0+(?!$)", "");
return(s);
}
private static int[] generateRecipeItem() {
int pair[] = new int[2];
pair[0] = recipeItem;
pair[1] = recipeCount;
return pair;
}
private static int[] generateRandomItem() {
int tuple[] = new int[3];
tuple[0] = recipeItem;
tuple[1] = recipeCount;
tuple[2] = recipeProb;
return tuple;
}
private static void simpleToken(String token) {
if(token.contains("/imgdir")) {
status -= 1;
}
else if(token.contains("imgdir")) {
status += 1;
}
}
private static void forwardCursor(int st) {
String line = null;
try {
while(status >= st && (line = bufferedReader.readLine()) != null) {
simpleToken(line);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
private static void translateToken(String token) {
String d;
if(token.contains("/imgdir")) {
status -= 1;
if(status == 2) { //close item maker data
makerList.add(new MapleMakerItemEntry(id, itemid, reqLevel, reqMakerLevel, reqItem, reqMeso, reqEquip, catalyst, quantity, tuc, recipeCount, recipeItem, recipeList, randomList));
resetMakerDataFields();
} else if(status == 4) { //close recipe/random item
if(state == 0) recipeList.add(generateRecipeItem());
else if(state == 1) randomList.add(generateRandomItem());
}
}
else if(token.contains("imgdir")) {
if(status == 1) { //getting id
d = getName(token);
id = Integer.parseInt(d);
System.out.println("Parsing maker id " + id);
}
else if(status == 2) { //getting target item id
d = getName(token);
itemid = Integer.parseInt(d);
}
else if(status == 3) {
d = getName(token);
switch(d) {
case "recipe":
recipeList = new LinkedList<>();
state = 0;
break;
case "randomReward":
randomList = new LinkedList<>();
state = 1;
break;
default:
forwardCursor(3); // unused content, read until end of block
break;
}
}
else if(status == 4) { // inside recipe/random
d = getName(token);
recipePos = Integer.parseInt(d);
}
status += 1;
} else {
if(status == 3) {
d = getName(token);
switch(d) {
case "itemNum":
quantity = Integer.valueOf(getValue(token));
break;
case "meso":
reqMeso = Integer.valueOf(getValue(token));
break;
case "reqItem":
reqItem = Integer.valueOf(getValue(token));
break;
case "reqLevel":
reqLevel = Integer.valueOf(getValue(token));
break;
case "reqSkillLevel":
reqMakerLevel = Integer.valueOf(getValue(token));
break;
case "tuc":
tuc = Integer.valueOf(getValue(token));
break;
case "catalyst":
catalyst = Integer.valueOf(getValue(token));
break;
case "reqEquip":
reqEquip = Integer.valueOf(getValue(token));
break;
default:
System.out.println("Unhandled case: '" + d + "'");
state = 2;
break;
}
}
else if(status == 5) { // inside recipe/random item
d = getName(token);
if(d.equals("item")) {
recipeItem = Integer.parseInt(getValue(token));
} else {
if(state == 0) {
recipeCount = Integer.parseInt(getValue(token));
} else {
if(d.equals("itemNum")) {
recipeCount = Integer.parseInt(getValue(token));
} else {
recipeProb = Integer.parseInt(getValue(token));
}
}
}
}
}
}
private static void WriteMakerTableFile() {
printWriter.println(" # SQL File autogenerated from the MapleSkillMakerFetcher feature by Ronan Lana.");
printWriter.println(" # Generated data is conformant with the ItemMake.img.xml file used to compile this.");
printWriter.println();
StringBuilder sb_create = new StringBuilder("INSERT IGNORE INTO `makercreatedata` (`id`, `itemid`, `req_level`, `req_maker_level`, `req_meso`, `req_item`, `req_equip`, `catalyst`, `quantity`, `tuc`) VALUES\r\n");
StringBuilder sb_recipe = new StringBuilder("INSERT IGNORE INTO `makerrecipedata` (`itemid`, `req_item`, `count`) VALUES\r\n");
StringBuilder sb_reward = new StringBuilder("INSERT IGNORE INTO `makerrewarddata` (`itemid`, `rewardid`, `quantity`, `prob`) VALUES\r\n");
for(MapleMakerItemEntry it : makerList) {
sb_create.append(" (" + it.id + ", " + it.itemid + ", " + it.reqLevel + ", " + it.reqMakerLevel + ", " + it.reqMeso + ", " + it.reqItem + ", " + it.reqEquip + ", " + it.catalyst + ", " + it.quantity + ", " + it.tuc + "),\r\n");
if(it.recipeList != null) {
for(int[] rit : it.recipeList) {
sb_recipe.append(" (" + it.itemid + ", " + rit[0] + ", " + rit[1] + "),\r\n");
}
}
if(it.randomList != null) {
for(int[] rit : it.randomList) {
sb_reward.append(" (" + it.itemid + ", " + rit[0] + ", " + rit[1] + ", " + rit[2] + "),\r\n");
}
}
}
sb_create.setLength(sb_create.length() - 3);
sb_create.append(";\r\n");
sb_recipe.setLength(sb_recipe.length() - 3);
sb_recipe.append(";\r\n");
sb_reward.setLength(sb_reward.length() - 3);
sb_reward.append(";\r\n");
printWriter.println(sb_create);
printWriter.println(sb_recipe);
printWriter.println(sb_reward);
}
private static void WriteMakerTableData() {
// This will reference one line at a time
String line = null;
try {
printWriter = new PrintWriter(newFile, "UTF-8");
fileReader = new InputStreamReader(new FileInputStream(fileName), "UTF-8");
bufferedReader = new BufferedReader(fileReader);
resetMakerDataFields();
while((line = bufferedReader.readLine()) != null) {
translateToken(line);
}
WriteMakerTableFile();
printWriter.close();
bufferedReader.close();
fileReader.close();
}
catch(FileNotFoundException ex) {
System.out.println("Unable to open file '" + fileName + "'");
}
catch(IOException ex) {
System.out.println("Error reading file '" + fileName + "'");
}
catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
WriteMakerTableData();
}
}

View File

@@ -3,4 +3,4 @@ do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\USER\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
user.properties.file=C:\\Users\\RonanLana\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties

View File

@@ -2,6 +2,8 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
<group>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/tools/MobBookUpdate/src/mobbookupdate/MobBookUpdate.java</file>
</group>
</open-files>
</project-private>