private static final void deleteBBSReply(final MapleClient c, final int replyid) {
	if (c.getPlayer().getGuildId() <= 0) {
	    return;
	}

	int threadid;
	Connection con = DatabaseConnection.getConnection();
	try {
	    PreparedStatement ps = con.prepareStatement("SELECT postercid, threadid FROM bbs_replies WHERE replyid = ?");
	    ps.setInt(1, replyid);
	    ResultSet rs = ps.executeQuery();

	    if (!rs.next()) {
		rs.close();
		ps.close();
		return; // thread no longer exists, deleted?
	    }
	    if (c.getPlayer().getId() != rs.getInt("postercid") && c.getPlayer().getGuildRank() > 2) {
		rs.close();
		ps.close();
		return; // [hax] deleting a reply that he didn't make
	    }
	    threadid = rs.getInt("threadid");
	    rs.close();
	    ps.close();

	    ps = con.prepareStatement("DELETE FROM bbs_replies WHERE replyid = ?");
	    ps.setInt(1, replyid);
	    ps.execute();
	    ps.close();

	    ps = con.prepareStatement("UPDATE bbs_threads SET replycount = replycount - 1 WHERE threadid = ?");
	    ps.setInt(1, threadid);
	    ps.execute();
	    ps.close();

	    displayThread(c, threadid, false);
	} catch (SQLException se) {
	    System.err.println("SQLException: " + se.getLocalizedMessage() + se);
	}
    }