public static MapleShop createFromDB(int id, boolean isShopId) {
	MapleShop ret = null;
	int shopId;

	try {
	    Connection con = DatabaseConnection.getConnection();
	    PreparedStatement ps = con.prepareStatement(isShopId ? "SELECT * FROM shops WHERE shopid = ?" : "SELECT * FROM shops WHERE npcid = ?");

	    ps.setInt(1, id);
	    ResultSet rs = ps.executeQuery();
	    if (rs.next()) {
		shopId = rs.getInt("shopid");
		ret = new MapleShop(shopId, rs.getInt("npcid"));
		rs.close();
		ps.close();
	    } else {
		rs.close();
		ps.close();
		return null;
	    }
	    ps = con.prepareStatement("SELECT * FROM shopitems WHERE shopid = ? ORDER BY position ASC");
	    ps.setInt(1, shopId);
	    rs = ps.executeQuery();
	    List<Integer> recharges = new ArrayList<Integer>(rechargeableItems);
	    while (rs.next()) {
		if (InventoryConstants.isThrowingStar(rs.getInt("itemid")) || InventoryConstants.isBullet(rs.getInt("itemid"))) {
		    MapleShopItem starItem = new MapleShopItem((short) 1, rs.getInt("itemid"), rs.getInt("price"));
		    ret.addItem(starItem);
		    if (rechargeableItems.contains(starItem.getItemId())) {
			recharges.remove(Integer.valueOf(starItem.getItemId()));
		    }
		} else {
		    ret.addItem(new MapleShopItem((short) 1000, rs.getInt("itemid"), rs.getInt("price")));
		}
	    }
	    for (Integer recharge : recharges) {
		ret.addItem(new MapleShopItem((short) 1000, recharge.intValue(), 0));
	    }
	    rs.close();
	    ps.close();
	} catch (SQLException e) {
	    System.err.println("Could not load shop" + e);
	}
	return ret;
    }