public static MapleNPC getNPC(final int nid) {
	if (nid >= 9901000 && nid <= 9901551) {
	    final MapleNPCStats stats = new MapleNPCStats("", true);
	    final MapleNPC npc = new MapleNPC(nid, stats);

	    PreparedStatement ps = null;
	    ResultSet rs = null;
	    try {
		Connection con = DatabaseConnection.getConnection();
		ps = con.prepareStatement("SELECT * FROM playernpcs WHERE npcid = ?");
		ps.setInt(1, nid);

		rs = ps.executeQuery();
		if (rs.next()) {
		    stats.setCY(rs.getInt("cy"));
		    stats.setName(rs.getString("name"));
		    stats.setHair(rs.getInt("hair"));
		    stats.setFace(rs.getInt("face"));
		    stats.setSkin(rs.getByte("skin"));
		    stats.setFH(rs.getInt("Foothold"));
		    stats.setRX0(rs.getInt("rx0"));
		    stats.setRX1(rs.getInt("rx1"));
		    npc.setPosition(new Point(rs.getInt("x"), stats.getCY()));
		    ps.close();
		    rs.close();

		    ps = con.prepareStatement("SELECT * FROM playernpcs_equip WHERE npcid = ?");
		    ps.setInt(1, rs.getInt("id"));
		    rs = ps.executeQuery();

		    Map<Byte, Integer> equips = new HashMap<Byte, Integer>();

		    while (rs.next()) {
			equips.put(rs.getByte("equippos"), rs.getInt("equipid"));
		    }
		    stats.setEquips(equips);
		    rs.close();
		    ps.close();
		}
	    } catch (SQLException ex) {
	    } finally {
		try {
		    if (ps != null) {
			ps.close();
		    }
		    if (rs != null) {
			rs.close();
		    }
		} catch (SQLException ignore) {
		}
	    }
	    return npc;
	} else {
	    final String name = MapleDataTool.getString(nid + "/name", npcStringData, "MISSINGNO");
	    return new MapleNPC(nid, new MapleNPCStats(name, false));
	}
    }