Alright I fixed the code, I've tested it and it works.
Code:
public void changeSkillXp(int skill, int amount, boolean divide) {
int newXp = divide ? client.playerXP[skill] / amount : client.playerXP[skill] * amount;
client.playerXP[skill] = newXp;
client.playerLevel[skill] = client.getPlayerAssistant().getLevelForXP(client.playerXP[skill]);
refreshSkill(skill);
}
If you would like to add a command for this also this should work:
Code:
if (playerCommand.startsWith("changeskillxp")) {
try {
String[] args = playerCommand.split(" ");
int skill = Integer.parseInt(args[1]);
int amount = Integer.parseInt(args[2]);
boolean divide = Boolean.parseBoolean(args[3]);
c.getPlayerAssistant().changeSkillXp(skill, amount, divide);
} catch (Exception e) {
}
}