in net.sf.odinms.tools create a file called MonsterDropCreator.java
put this in it:
Then compilePHP Code:package net.sf.odinms.tools;
import java.sql.Connection;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.rmi.NotBoundException;
import java.sql.SQLException;
import java.util.Properties;
import javax.management.InstanceAlreadyExistsException;
import javax.management.MBeanRegistrationException;
import javax.management.MalformedObjectNameException;
import javax.management.NotCompliantMBeanException;
import net.sf.odinms.database.DatabaseConnection;
import net.sf.odinms.provider.MapleData;
import net.sf.odinms.provider.MapleDataProviderFactory;
import net.sf.odinms.provider.MapleDataTool;
/**
*
* @author Bassoe
*
*/
public class MonsterDropCreator {
public static void main(String args[]) throws FileNotFoundException, IOException, NotBoundException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, MalformedObjectNameException {
//start the dump
MapleData data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("net.sf.odinms.wzpath") + "/String.wz")).getData("MonsterBook.img");
boolean first;
Properties dbProp = new Properties();
FileReader fr = new FileReader("db.properties");
dbProp.load(fr);
fr.close();
DatabaseConnection.setProps(dbProp);
Connection con = DatabaseConnection.getConnection();
for (MapleData dataz : data.getChildren()) {
int monsterId = Integer.parseInt(dataz.getName());
String Query = "INSERT INTO monsterdrops VALUES ";
first = true;
for (MapleData drop : dataz.getChildByPath("reward")) {
int itemid = MapleDataTool.getInt(drop);
if (first) {
Query += "(DEFAULT, " + monsterId + ", " + itemid + ", " + getChance(itemid) + ")";
first = false;
} else
Query += ", (DEFAULT, " + monsterId + ", " + itemid + ", " + getChance(itemid) + ")";
}
try {
con.prepareStatement(Query).executeUpdate();
} catch (SQLException e) {}
}
}
public static int getChance(int id) {
switch (id / 10000) {
case 413:
return 1000;
case 204:
return 12000;
case 400:
switch (id / 1000) {
case 4000:
case 4001:
return 5;
case 4003:
return 200;
case 4004:
case 4006:
return 1500;
case 4005:
return 100;
}
case 401:
case 402:
case 416:
return 600;
case 403:
return 300;
}
switch (id / 1000000) {
case 1:
return 2400;
case 2:
switch (id) {
case 2000000:
case 2000002:
case 2000003:
case 2000004:
case 2000005:
case 2000006:
case 2001001:
case 2002000:
case 2002001:
case 2002003:
case 2002004:
case 2002006:
case 2002011:
case 2010009:
case 2012001:
case 2012002:
case 2022001:
case 2020013:
case 2020014:
case 2020015:
case 2022142:
case 2022186:
return 100;
case 2060000:
case 2061000:
case 2060001:
case 2061001:
return 200;
case 2070000:
case 2070001:
case 2070002:
case 2070003:
case 2070004:
case 2070005:
case 2070006:
case 2070007:
case 2070008:
case 2070009:
case 2070010:
return 10000;
default:
return 400;
}
}
return 0;
}
}
After you did that find launch_world.bat
in that directory make a new file called DumpMonsterDrops.bat
put this in it:
Then (after you deleted all your monsterdrops) run it and.. VOILA! =]Code:@echo off set CLASSPATH=.;dist\odinms.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-jdk14.jar;dist\mysql-connector-java-bin.jar java -Dnet.sf.odinms.recvops=recvops.properties -Dnet.sf.odinms.sendops=sendops.properties -Dnet.sf.odinms.wzpath=wz\ -Dnet.sf.odinms.channel.config=channel.properties -Djavax.net.ssl.keyStore=channel.keystore -Djavax.net.ssl.keyStorePassword=passwd -Djavax.net.ssl.trustStore=channel.truststore -Djavax.net.ssl.trustStorePassword=passwd net.sf.odinms.tools.MonsterDropCreator -Dcom.sun.management.jmxremote.port=13373 -Dcom.sun.management.jmxremote.password.file=jmxremote.password -Dcom.sun.management.jmxremote.access.file=jmxremote.access
When it's done processing the bat file will close and you will have 100% gms-like monsterdrops
Full credits to me.
PS:
This can be done for every version, as long as you have MonsterBook.img.xml in your String.wz
PS2:
To delete your previous monsterdrops (to prevent double drops) use
Code:DELETE FROM monsterdrops;



![[Release] 100% GMS-Like monsterdrops, EVERY VERSION!](http://ragezone.com/hyper728.png)


