Note that this is for your Player's to use, it was made completely by me to replace the 'MSI NPC' found in most FMs :)
Enjoy.
It's kind of self explanatory but if you need help I'm all ears.
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);
MapleInventoryType type = MapleInventoryType.getInstance();
if (type.equals(MapleInventoryType.EQUIP)) {
MapleInventoryManipulator.addFromDrop(c, (IItem) miip.msiItem((Equip) pe, (int) Math.ceil(Math.random() * 4000) + 28000), (int) Math.ceil(Math.random() * 50) + 50));
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");
}
}
I also made this nifty little explanation command to go with it :)
PHP Code:} else if (splitted[0].equalsIgnoreCase("msirules")) {
player.dropMessage("To create an MSI you must have 4 votepoints, and 32767 stats in every stat. When this is done, type @msi <equipid> and you shall"
+ "receive your msi. [Note]: You must have the item you want to make an MSI out of, in your inventory!");
}
Edit: For those of you that don't have it. Here is the 'reloadChar' method.
MethodPHP Code:public void reloadChar() {
getClient().getSession().write(MaplePacketCreator.getCharInfo(this));
getMap().removePlayer(this);
getMap().addPlayer(this);
}
This is the method I promised you guys. ^PHP Code:public Equip msiItem(Equip equip, int stat, int watk) {
equip.setStr((short) stat);
equip.setDex((short) stat);
equip.setInt((short) stat);
equip.setLuk((short) stat);
equip.setWatk((short) watk);
return equip;
}
Edit: I fixed up and changed the command when I had time.
(I didn't make the method).
Have fun with it :mellow:

