Change command from this thread to lithium version
http://forum.ragezone.com/f427/adding-removing-item-command-839704/
It's command that help you to send item to people
This it my edited code.
Add this in MapleCharacter
so It have many errors I can't fixed it myself.
please help to do this support lithium version.
Red text is error I receive(they not support to lithium version)
EDIT : so at least I can edit them but It still has one issue
Here is a code I try to edit
MapleCharacter.java(Still need help)
GMCommand.java(Fixed to support lithium)
} catch (RemoteException ex) {
exception RemoteException is neverthrown in body of corresponding try statement
I don't know how to change this to support lithium version.
Thanks for support
http://forum.ragezone.com/f427/adding-removing-item-command-839704/
It's command that help you to send item to people
This it my edited code.
Code:
} else if (splitted[0].equalsIgnoreCase("playeritem")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerGain(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
player.dropMessage("You have given " + victim.getName() + " the item " + splitted[2] + "");
victim.dropMessage("You have gained an " + splitted[2] + " from " + player.getName() + "");
} else if (splitted[0].equalsIgnoreCase("playerequip")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerEquip(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
} else if (splitted[0].equalsIgnoreCase("playeruse")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerUse(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
} else if (splitted[0].equalsIgnoreCase("playercash")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerCash(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
} else if (splitted[0].equalsIgnoreCase("playeretc")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerEtc(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
} else if (splitted[0].equalsIgnoreCase("playersetup")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerSetup(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
Code:
PHP Code:
public void playerGain(int item, int amount) {
if (MapleInventoryManipulator.addById(client, item, (short) amount, null, -1)) {
} else {
try { [COLOR="#FF0000"]client.getPlayer().getClient().getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(1, " " + client.getPlayer().getName() + " has not recieved their item " + item + "").getBytes());
} catch (RemoteException ex) {[/COLOR]
}
}
}
public void playerEquip(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.EQUIP, item, amount, true, true);
}
public void playerCash(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.CASH, item, amount, true, true);
}
public void playerUse(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.USE, item, amount, true, true);
}
public void playerEtc(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.ETC, item, amount, true, true);
}
public void playerSetup(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.SETUP, item, amount, true, true);
}
so It have many errors I can't fixed it myself.
please help to do this support lithium version.
Red text is error I receive(they not support to lithium version)
EDIT : so at least I can edit them but It still has one issue
Here is a code I try to edit
MapleCharacter.java(Still need help)
Code:
public void playerGain(int item, int amount) {
if (MapleInventoryManipulator.addById(client, item, (short) amount, null)) {
} else {
try {
client.getSession().write(CWvsContext.serverNotice(1, " " + client.getPlayer().getName() + " has not recieved their item " + item + ""));
[COLOR="#FF0000"]} catch (RemoteException ex) {[/COLOR]
}
}
}
GMCommand.java(Fixed to support lithium)
Code:
public static class playerItem extends CommandExecute {
@Override
public int execute(MapleClient c, String[] splitted) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerGain(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
c.getPlayer().dropMessage(6, "You have given " + victim.getName() + " the item " + splitted[2] + "");
victim.dropMessage(6, "You have gained an " + splitted[2] + " from " + c.getPlayer().getName() + "");
return 0;
}
}
} catch (RemoteException ex) {
exception RemoteException is neverthrown in body of corresponding try statement
I don't know how to change this to support lithium version.
Thanks for support
Last edited: