slot--;
if (_henna[slot] == null)
{
return false;
}
final Henna henna = _henna[slot];
final int dyeID = henna.getDyeId();
_henna[slot] = null;
Connection con = null;
PreparedStatement statement = null;
try
{
con = DatabaseFactory.getInstance().getConnection();
statement = con.prepareStatement("DELETE FROM character_hennas where char_obj_id=? and slot=? and class_index=?");
statement.setInt(1, getObjectId());
statement.setInt(2, slot + 1);
statement.setInt(3, getActiveClassId());
statement.execute();
}
catch (final Exception e)
{
_log.warn("could not remove char henna: " + e, e);
}
finally
{
DbUtils.closeQuietly(con, statement);
}
if (henna.getSkillId() > 0)
{
removeSkillById(henna.getSkillId());
}
recalcHennaStats();
sendPacket(new HennaInfo(this));
sendUserInfo();
ItemFunctions.addItem(this, dyeID, henna.getDrawCount() / 2, true);
return true;
}