[Release] !randomstatsitem command

Junior Spellweaver
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 :
Code:
/**
 	     * Adds this monster to the controlled list. The monster must exist on the Map.
Above, add :
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);
 	        }
 	    }
In CommandProcessor.java (this is using the old command system, convert it to the new one by adding the commandDefinition) :
Search :
Code:
} else if (splitted[0].equals("!item")) {
Above, add :
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);
            }
Compile and you're done. Credits to me.
 
Add this above it.
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);
            }
To change the command change RandomStatsItem to whatever
 
i think i don't hv method isBullet(int) function in my MapleItemInformationProvider.java @.@




init:
deps-jar:
Compiling 2 source files to D:\Ms Pack\build\classes
D:\Ms Pack\Repack\Repack\src\net\sf\odinms\client\MapleCharacter.java:1833: cannot find symbol
symbol : method isBullet(int)
location: class net.sf.odinms.server.MapleItemInformationProvider
if (MapleItemInformationProvider.getInstance().getInventoryType(id).equals(MapleInventoryType.EQUIP) && !MapleItemInformationProvider.getInstance().isThrowingStar(MapleItemInformationProvider.getInstance().getEquipById(id).getItemId()) && !MapleItemInformationProvider.getInstance().isBullet(MapleItemInformationProvider.getInstance().getEquipById(id).getItemId())) {
^
1 error
 
Ahh all you have to do is rename randomstatsitem, how hard is that?
Oh and its a sexy release btw :]
 
♠Markii♠;4348346 said:
im With Blaze its Too Long Make it a Little Shorter
Code:
} else if (splitted[0].equals("![b][COLOR="Red"]randomstatsitem[/COLOR][/b]")) {
            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);
            }
 
Back