Problem with !item command
Ok...not sure if it's because there's a new way to input this in the game or my command just doesn't work properly.
So, here's my problem. I'm running the XeonMS v97 repack since apparently it's the "cleanest" (cleanest as in a repack with the least amount of custom things in it) that I can find. I was just testing commands and things out when I got to the !item command. I am confused by it because every time I put an item ID in it (for example !item 01302013) it says "Sorry there's no item with the name:". After messing around it for a while, I believe the parameters of the command are (c, item) (c = player and item = name of item) and I'm pretty sure I'm wrong but...yeah. I try putting in this !item [mycharactername] red whip and nothing happens. I try adding a quantity # after red whip and then it repeats the first error of not finding the item. This is really frustrating me because this is a very important command. I'm even trying to figure this out as I type this out. If anyone can help me I'd be unbelievably happy and grateful to you.
Thanks.
Also, if needed, here's the part of the code in GMCommand with !item:
Code:
} else if (splitted[0].equalsIgnoreCase("item") || splitted[0].equalsIgnoreCase("drop")) {
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
if ((Object) splitted[1] instanceof Integer && (Object) splitted[2] instanceof Integer) {
if (splitted[0].equalsIgnoreCase("item")) {
int itemId = Integer.parseInt(splitted[1]);
if (itemId >= 5000000 && itemId < 5000065) {
MaplePet.createPet(itemId);
} else {
MapleInventoryManipulator.addById(c, itemId, Short.parseShort(splitted[2]), player.getName(), -1);
}
} else {
int itemId = Integer.parseInt(splitted[1]);
IItem toDrop;
if (ii.getInventoryType(itemId) == MapleInventoryType.EQUIP) {
toDrop = ii.getEquipById(itemId);
} else {
toDrop = new Item(itemId, (byte) 0, (short) StringUtil.getOptionalIntArg(splitted, 2, 1));
}
toDrop.setOwner(player.getName());
c.getPlayer().getMap().spawnItemDrop(player, player, toDrop, player.getPosition(), true, true);
}
} else {
List<Pair<Integer, String>> itemPairs = new LinkedList<Pair<Integer, String>>();
for (Pair<Integer, String> allitems : ii.getAllItems()) {
if (allitems.getRight().toLowerCase().equals(joinStringFrom(splitted, 2).toLowerCase())) {
itemPairs.add(new Pair(allitems.getLeft(), allitems.getRight()));
}
}
if (itemPairs.isEmpty()) {
player.dropMessage(" Sorry there is no item with the name: " + joinStringFrom(splitted, 2));
} else {
String name = "Null Name";
Short quantity = 0;
for (Pair<Integer, String> itemsToAdd : itemPairs) {
int itemid = itemsToAdd.getLeft();
name = itemsToAdd.getRight();
quantity = (short) Integer.parseInt(splitted[1]);
if (splitted[0].equalsIgnoreCase("item")) {
if (itemid >= 5000000 && itemid < 5000065) {
MaplePet.createPet(itemid);
} else if (ii.getInventoryType(itemid) == MapleInventoryType.EQUIP) {
int i = 1;
do {
MapleInventoryManipulator.addById(c, itemid, (short) 1);
i++;
} while (i <= quantity && player.getInventory(MapleInventoryType.EQUIP).getNextFreeSlot() != -1);
} else {
if (player.getInventory(MapleInventoryType.EQUIP).getNextFreeSlot() != -1) {
MapleInventoryManipulator.addById(c, itemid, quantity);
} else {
player.dropMessage(" No free space. ");
}
return false;
}
Re: Problem with !item command
Bump...I really need help with this.
Re: Problem with !item command
Take out the 0. If your using the command like !item 01302620 take out the 0 in the beginning it should only be 1302620.
Re: Problem with !item command
I wish it was that simple but that's not the problem. It just says that it doesn't exist if i did put in that. :l
Re: Problem with !item command
Re: Problem with !item command
Maybe the item doesn't exist in your version maplestory.
Try !item 1302000
Re: Problem with !item command
I tried that already and I know that the item exists in this version. It's just a red whip lol.
Here's a picture of what's going on if it helps: This is what happens after I use !item 1302000
Re: Problem with !item command
Bump. I can't let this thread die.
Re: Problem with !item command
Yeah...so I fixed it...after completely changing (ripping) the code. So this thread can be closed.