I learn some java yesterday and i make this
[php]
else if (splitted[0].equals("@str") || splitted[0].equals("@dex") || splitted[0].equals("@int") || splitted[0].equals("@luk")) {
int x = Integer.parseInt(splitted[1]), max = c.getChannelServer().getMaxStat();
if (x > 0 && x <= player.getRemainingAp() && x < max - 4) {
if (splitted[0].equals("@str") && x + player.getStr() < max) {
player.addStat(1, x);
} else if (splitted[0].equals("@dex") && x + player.getDex() < max) {
player.addStat(2, x);
} else if (splitted[0].equals("@int") && x + player.getInt() < max) {
player.addStat(3, x);
} else if (splitted[0].equals("@luk") && x + player.getLuk() < max) {
player.addStat(4, x);
} else {
player.message("Make sure the stat you are raising will not be over " + max + ".");
}
player.setRemainingAp(player.getRemainingAp() - x);
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
} else {
player.message("You do not have enough AP.");
}
} [/php]
this go in maplecharacter
[php]
public void addStat(int type, int up) {
if (type == 1) {
this.str = getStr() + up;
updateSingleStat(MapleStat.STR, getStr());
} else if (type == 2) {
this.dex = getDex() + up;
updateSingleStat(MapleStat.DEX, getDex());
} else if (type == 3) {
this.int_ = getInt() + up;
updateSingleStat(MapleStat.INT, getInt());
} else if (type == 4) {
this.luk = getLuk() + up;
updateSingleStat(MapleStat.LUK, getLuk());
}
}[/php]
this go in channelserver.java
[php]
public int getMaxStat() {
return maxStat;
}[/php]
[php]
private int maxStat[/php]
and add this 2 time
[php]
maxStat = Integer.parseInt(props.getProperty("net.sf.odinms.world.maxStat"));
[/php]
[php]
else if (splitted[0].equals("@str") || splitted[0].equals("@dex") || splitted[0].equals("@int") || splitted[0].equals("@luk")) {
int x = Integer.parseInt(splitted[1]), max = c.getChannelServer().getMaxStat();
if (x > 0 && x <= player.getRemainingAp() && x < max - 4) {
if (splitted[0].equals("@str") && x + player.getStr() < max) {
player.addStat(1, x);
} else if (splitted[0].equals("@dex") && x + player.getDex() < max) {
player.addStat(2, x);
} else if (splitted[0].equals("@int") && x + player.getInt() < max) {
player.addStat(3, x);
} else if (splitted[0].equals("@luk") && x + player.getLuk() < max) {
player.addStat(4, x);
} else {
player.message("Make sure the stat you are raising will not be over " + max + ".");
}
player.setRemainingAp(player.getRemainingAp() - x);
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
} else {
player.message("You do not have enough AP.");
}
} [/php]
this go in maplecharacter
[php]
public void addStat(int type, int up) {
if (type == 1) {
this.str = getStr() + up;
updateSingleStat(MapleStat.STR, getStr());
} else if (type == 2) {
this.dex = getDex() + up;
updateSingleStat(MapleStat.DEX, getDex());
} else if (type == 3) {
this.int_ = getInt() + up;
updateSingleStat(MapleStat.INT, getInt());
} else if (type == 4) {
this.luk = getLuk() + up;
updateSingleStat(MapleStat.LUK, getLuk());
}
}[/php]
this go in channelserver.java
[php]
public int getMaxStat() {
return maxStat;
}[/php]
[php]
private int maxStat[/php]
and add this 2 time
[php]
maxStat = Integer.parseInt(props.getProperty("net.sf.odinms.world.maxStat"));
[/php]