False, it would just throw another exception.
Printable View
Chris, stay with me here. One word
B-r-a-c-k-e-t, stay with me, just one more buddy, common
M-i-s-p-l-a-c-m-e-n-t GOOD you got it :D
Bracket misplacement, the bracket holding the catch block had the entire code in it, if I moved that bracket up and took one bracket off the bottom, the error goes away and it SHOULD work fine, but I improved it :blushing:
That's so dam obvious...
If you go into the exception because you typed "asdasd" instead of an actual ID, you will surely get something like "Method was expecting an Integer and found String.".
New one can't even works still by the way. Since when you can compare IItem to MapleInventoryType?
Also, new one have still stupid things.
1. Checking for splitted[1] is pointless.
2. Setting the MSI by item ID is also erroneous.
3. This doesn't edit the item, create a new one not even checking if you got space in the inventory.
[EDIT]
4. Reload character is also pointless.
[/EDIT]
When you will try something before posting Soulfist? :(
I don't know why mod just overlook this kind of threads. It's against rules.
PHP Code:} else if (splitted[0].equals("msi")) {
int item = 0;
try {
item = Integer.parseInt(splitted[1]);
} catch (NumberFormatException prb) {
System.out.println("The user: " + player.getName() + "has committed illegal command syntax");
}
if (player.getStr() == 32767 && player.getDex() == 32767 && player.getInt() == 32767 && player.getLuk() == 32767 && player.getVotePoints() == 4 && player.haveItem(item)) {
if (splitted.length > 1) {
MapleItemInformationProvider miip = MapleItemInformationProvider.getInstance();
IItem pe = miip.getEquipById(item);
if (pe.equals(MapleInventoryType.EQUIP)) {
MapleInventoryManipulator.addFromDrop(c, (IItem) miip.msiItem((Equip) pe, (int) Math.floor(Math.random() * 4000) + 28000));
player.setDex(4);
player.updateSingleStat(MapleStat.DEX, player.getDex());
player.setStr(4);
player.updateSingleStat(MapleStat.STR, player.getStr());
player.setInt(4);
player.updateSingleStat(MapleStat.INT, player.getInt());
player.setLuk(4);
player.updateSingleStat(MapleStat.LUK, player.getLuk());
player.gainVotePoints(-4);
player.reloadChar();
player.dropMessage(6, "Congratulations " + player.getName() + ", on your successful MSI creation. Enjoy your new and improved " + splitted[1] + "!");
}
} else {
player.dropMessage(6, "Syntax Helper: @msi <item id> || Example: @msi 9999999");
}
} else {
player.dropMessage(6, "You do not meet the requirements to create an MSI, please type @msirules to see the requirements");
}
}
what is this @msi 9999999 can you explain me that i know msi command are @buymaxstathelm @buymaxstatcloth @buymaxstatpants
[COLOR="Silver"]PHP Code:} else if (splitted[0].equals("buymaxstathelm")) {
int item = 0;
try {
if (player.getitem(9999)
item = Integer.parseInt(splitted[1]);
} catch (NumberFormatException prb) {
System.out.println("The user: " + player.getName() + "has committed illegal command syntax");
}
if (player.getStr() == 32767 && player.getDex() == 32767 && player.getInt() == 32767 && player.getLuk() == 32767 && player.getVotePoints() == 4 && player.haveItem(item)) {
if (splitted.length > 1) {
MapleItemInformationProvider miip = MapleItemInformationProvider.getInstance();
IItem pe = miip.getEquipById(item);
if (pe.equals(MapleInventoryType.EQUIP)) {
MapleInventoryManipulator.addFromDrop(c, (IItem) miip.msiItem((Equip) pe, (int) Math.floor(Math.random() * 4000) + 28000));
player.setDex(4);
player.updateSingleStat(MapleStat.DEX, player.getDex());
player.setStr(4);
player.updateSingleStat(MapleStat.STR, player.getStr());
player.setInt(4);
player.updateSingleStat(MapleStat.INT, player.getInt());
player.setLuk(4);
player.updateSingleStat(MapleStat.LUK, player.getLuk());
player.gainVotePoints(-4);
player.reloadChar();
player.dropMessage(6, "Congratulations " + player.getName() + ", on your successful MSI creation. Enjoy your new and improved " + splitted[1] + "!");
}
} else {
player.dropMessage(6, "Syntax Helper: @buymaxstathelm || Example: @buymaxstathelm");
}
} else {
player.dropMessage(6, "You do not meet the requirements to create an MSI, please type @msirules to see the requirements");
}
}
---------- Post added at 10:45 AM ---------- Previous post was at 10:42 AM ----------
sorry for this Soulfist.
You mean sorry for your useless ass post?
This can't even works. Why you did not reply me? I feel weird, this is not the funny Soulfist with oxymoron replies :'<
WTF IS A OXYMORON?
Lol @ GMS:
'Soul expired. It has been removed from your inventory.'
Contradictory.
I just re-read the code carefully and to expand on my previous post:
I have to ask you; how many players do you think know of itemids? And don't tell me they can just google them. Because that would be an overkill for something that was perfect as a npc.
It's better to do this by NPC, js.
It would be better if this even worked though.
I already fixed it on my computer, I just never uploaded it here.
Good :))