I'm trying to edit my @item command to give the player a pet properly.
With this code, it successfully adds to the "pets" table and the "inventoryitems" table in my database. The problem is that I need it to also add an expiration value in the "inventoryitems" table as well. What can I add to make it do this?
Also, is there a way to make it always set the expiry date 3 months from the time it was spawned? Or even permanent?
Script:
I know it looks disgustingly messy (i'll try and clean it up)
With this code, it successfully adds to the "pets" table and the "inventoryitems" table in my database. The problem is that I need it to also add an expiration value in the "inventoryitems" table as well. What can I add to make it do this?
Also, is there a way to make it always set the expiry date 3 months from the time it was spawned? Or even permanent?
Script:
PHP:
try {
quantity = Short.parseShort(sub[2]);
} catch (Exception e) {
}
if (sub[0].equals("item")) {
int petid = -1;
if (ItemConstants.isPet(itemId)) {
petid = MaplePet.createPet(itemId);
}
MapleInventoryManipulator.addById(c, itemId, quantity, player.getName(), petid, -1);
break;
}
I know it looks disgustingly messy (i'll try and clean it up)
Last edited: