if (_henna[slot] == null)
{
return false;
}
L2HennaInstance henna = _henna[slot];
_henna[slot] = null;
java.sql.Connection con = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement(DELETE_CHAR_HENNA);
statement.setInt(1, getObjectId());
statement.setInt(2, slot + 1);
statement.setInt(3, getClassIndex());
statement.execute();
statement.close();
}
catch (Exception e)
{
_log.warning("could not remove char henna: " + e);
}
finally
{
try
{
con.close();
}
catch (Exception e)
{
}
}
// Calculate Henna modifiers of this L2PcInstance
recalcHennaStats();
// Send Server->Client HennaInfo packet to this L2PcInstance
sendPacket(new HennaInfo(this));
// Send Server->Client UserInfo packet to this L2PcInstance
sendPacket(new UserInfo(this));
// Add the recovered dyes to the player's inventory and notify them.
getInventory().addItem("Henna", henna.getItemIdDye(), henna.getAmountDyeRequire() / 2, this, null);
SystemMessage sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
sm.addItemName(henna.getItemIdDye());
sm.addNumber(henna.getAmountDyeRequire() / 2);
sendPacket(sm);
return true;
}