- Joined
- Oct 15, 2008
- Messages
- 188
- Reaction score
- 0
Lol. I did this cos im sick of tired of hunting stuff to get an above average stats to scroll, and end up booming it. So heres a command I made that can get me an above average stats item with just !randomstatsitem.
In MapleCharacter.java :
Search :
Above, add :
In CommandProcessor.java (this is using the old command system, convert it to the new one by adding the commandDefinition) :
Search :
Above, add :
Compile and you're done. Credits to me.
In MapleCharacter.java :
Search :
Code:
/**
* Adds this monster to the controlled list. The monster must exist on the Map.
Code:
public void gainRandomStatsItem(int id, short quantity) {
if (quantity >= 0) {
StringBuilder logInfo = new StringBuilder(client.getPlayer().getName());
if (MapleItemInformationProvider.getInstance().getInventoryType(id).equals(MapleInventoryType.EQUIP) && !MapleItemInformationProvider.getInstance().isThrowingStar(MapleItemInformationProvider.getInstance().getEquipById(id).getItemId()) && !MapleItemInformationProvider.getInstance().isBullet(MapleItemInformationProvider.getInstance().getEquipById(id).getItemId())) {
MapleInventoryManipulator.addFromDrop(client, MapleItemInformationProvider.getInstance().randomizeStats((Equip) MapleItemInformationProvider.getInstance().getEquipById(id)), logInfo.toString());
} else {
MapleInventoryManipulator.addById(client, id, quantity, logInfo.toString());
}
} else {
MapleInventoryManipulator.removeById(client, MapleItemInformationProvider.getInstance().getInventoryType(id), id, -quantity, true, false);
}
}
Search :
Code:
} else if (splitted[0].equals("!item")) {
Code:
} else if (splitted[0].equals("!randomstatsitem")) {
short quantity = (short) getOptionalIntArg(splitted, 2, 1);
int id = Integer.parseInt(splitted[1]);
if (quantity < 0) {
mc.dropMessage("Please enter a positive amount.");
}
else if (!MapleItemInformationProvider.getInstance().getInventoryType(id).equals(MapleInventoryType.EQUIP)) {
mc.dropMessage("Command can only be used for equips.");
}
else {
c.getPlayer().gainRandomStatsItem(id, quantity);
}