This works for rev 206 or higher :
Go to :
src\client\command\CommandProcessor.java
PHP Code:
if (s.charAt(0) == '!' && c.getPlayer().isGM()) {
String[] sp = s.split(" ");
sp[0] = sp[0].toLowerCase().substring(1);
c.getPlayer().addCommandToList(s);
if (GMCommand.execute(c, sp, '!'))
return true;
else if (c.getPlayer().gmLevel() > 3)
AdminCommand.execute(c, sp, '!');
return true;
}
if (s.charAt(0) == '@') {
String[] sp = s.split(" ");
sp[0] = sp[0].toLowerCase().substring(1);
PlayerCommand.execute(c, sp, '@');
return true;
}
return false;
}
}
}
Add a file in the same folder and name it PlayerCommand.java
Add this code in the folder
PHP Code:
package client.command;
import client.ISkill;
import client.MapleCharacter;
import client.MapleClient;
import client.MapleStat;
import client.SkillFactory;
import java.io.File;
import net.channel.ChannelServer;
import provider.MapleData;
import provider.MapleDataProviderFactory;
import scripting.npc.NPCScriptManager;
import tools.MaplePacketCreator;
/**
*
* @author HaruTheHero
*/
public class PlayerCommand {
static void execute(MapleClient c, String[] splitted, char heading) {
ChannelServer cserv = c.getChannelServer();
MapleCharacter player = c.getPlayer();
if (splitted[0].equals("str") || splitted[0].equals("int") || splitted[0].equals("luk") || splitted[0].equals("dex")) {
int amount = Integer.parseInt(splitted[1]);
boolean str = splitted[0].equals("str");
boolean Int = splitted[0].equals("int");
boolean luk = splitted[0].equals("luk");
boolean dex = splitted[0].equals("dex");
if(amount > 0 && amount <= player.getRemainingAp() && amount <= 32763 || amount < 0 && amount >= -32763 && Math.abs(amount) + player.getRemainingAp() <= 32767) {
if (str && amount + player.getStr() <= 32767 && amount + player.getStr() >= 4) {
player.setStr(player.getStr() + amount);
player.updateSingleStat(MapleStat.STR, player.getStr());
player.setRemainingAp(player.getRemainingAp() - amount);
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
} else if (Int && amount + player.getInt() <= 32767 && amount + player.getInt() >= 4) {
player.setInt(player.getInt() + amount);
player.updateSingleStat(MapleStat.INT, player.getInt());
player.setRemainingAp(player.getRemainingAp() - amount);
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
} else if (luk && amount + player.getLuk() <= 32767 && amount + player.getLuk() >= 4) {
player.setLuk(player.getLuk() + amount);
player.updateSingleStat(MapleStat.LUK, player.getLuk());
player.setRemainingAp(player.getRemainingAp() - amount);
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
} else if (dex && amount + player.getDex() <= 32767 && amount + player.getDex() >= 4) {
player.setDex(player.getDex() + amount);
player.updateSingleStat(MapleStat.DEX, player.getDex());
player.setRemainingAp(player.getRemainingAp() - amount);
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
} else {
player.dropMessage("Please make sure the stat you are trying to raise is not over ***767 or under 4.");
}
} else {
player.dropMessage("Please make sure your AP is not over ***767 and you have enough to distribute.");
}
} else if (splitted[0].equals("expfix")) {
player.setExp(0);
player.updateSingleStat(MapleStat.EXP, player.getExp());
player.dropMessage("Your exp has been fixed~!");
} else if (splitted[0].equals("dispose")) {
NPCScriptManager.getInstance().dispose(c);
c.getSession().write(MaplePacketCreator.enableActions());
player.message("Done.");
} else if (splitted[0].equals("save")) {
player.saveToDB(true);
player.dropMessage("Save complete, have fun in HaruMS!");
} else if (splitted[0].equals("emo")) {
player.setHp(0);
player.updateSingleStat(MapleStat.HP, 0);
player.dropMessage("Congratulations, You Have Just Killed YourSelf");
} else if (splitted[0].equals("commands") || splitted[0].equals("help")) {
player.dropMessage("@fmnpc - Use this to talk to the fmnpc.");
player.dropMessage("@dispose - Use this if you cannot tlk to npc.");
player.dropMessage("@emo - Stuck In Map? Use This.");
player.dropMessage("@str/@dex/@int/@luk - Helps you to add your stats faster!");
player.dropMessage("@expfix - Sets your exp to 0.");
} else{
player.message("Command " + heading + splitted[0] + " does not exist.");
}
}
}
At general chat handler : replace with this
PHP Code:
package net.channel.handler;
import client.command.CommandProcessor;
import tools.MaplePacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
import client.MapleClient;
public final class GeneralchatHandler extends net.AbstractMaplePacketHandler {
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
String text = slea.readMapleAsciiString();
if (!CommandProcessor.processCommand(c, text)) {
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text, c.getPlayer().getGMChat(), slea.readByte()));
}
}
}
To Add Commands Dun Add With '@'.
credit : HARUTHEHERO...