Since I couldn't find this anywhere on the forums, I decided to release it. Instead of resetting your whole ap from an npc, you can choose how much to reset what with a command. Credits goes to me for creating this and airflow0 for creating @setstats command. *Note* This method is assuming you have @str @int @dex @luk commands in your server.
First, open CommandProcessor.java. Make sure you have this import, if not add it.
After that, find
Above it, add
You can still add this if you don't have @str commands. Just add the above code anywhere you like in the commands. Tested and working.
First, open CommandProcessor.java. Make sure you have this import, if not add it.
Code:
import net.sf.odinms.client.MapleStat;
Code:
} else if (splitted[0].equals("@str")) {
Code:
} else if (splitted[0].equals("@resetstr")) {
int down;
down = Integer.parseInt(splitted[1]);
if ( player.getStr() < 4 || player.getStr() - down <= 4) {
mc.dropMessage("Reached minimum str.");
} else if ( player.getStr() < down) {
mc.dropMessage("Not enough str to reset");
} else {
player.setStr(player.getStr() - down);
player.setRemainingAp(player.getRemainingAp() + down);
player.updateSingleStat(MapleStat.STR, player.getStr());
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
}
//INT
}else if (splitted[0].equals("@resetint")) {
int down;
down = Integer.parseInt(splitted[1]);
if ( player.getInt() < 4 || player.getInt() - down <= 4) {
mc.dropMessage("Reached minimum int.");
} else if ( player.getInt() < down) {
mc.dropMessage("Not enough int to reset");
} else {
player.setInt(player.getInt() - down);
player.setRemainingAp(player.getRemainingAp() + down);
player.updateSingleStat(MapleStat.INT, player.getInt());
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
}
//DEX
}else if (splitted[0].equals("@resetdex")) {
int down;
down = Integer.parseInt(splitted[1]);
if ( player.getDex() < 4 || player.getDex() - down <= 4) {
mc.dropMessage("Reached minimum dex.");
} else if ( player.getDex() < down) {
mc.dropMessage("Not enough dex to reset");
} else {
player.setDex(player.getDex() - down);
player.setRemainingAp(player.getRemainingAp() + down);
player.updateSingleStat(MapleStat.DEX, player.getDex());
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
}
//LUCK
}else if (splitted[0].equals("@resetluk")) {
int down;
down = Integer.parseInt(splitted[1]);
if ( player.getLuk() < 4 || player.getLuk() - down <= 4) {
mc.dropMessage("Reached minimum luk.");
} else if ( player.getLuk() < down) {
mc.dropMessage("Not enough luk to reset");
} else {
player.setLuk(player.getLuk() - down);
player.setRemainingAp(player.getRemainingAp() + down);
player.updateSingleStat(MapleStat.LUK, player.getLuk());
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
}