/** * Gets the fishing monster. * * @param lvl the fisherman level * @return a fishing monster given the fisherman level */ public L2FishingMonster getFishingMonster(int lvl) { for (L2FishingMonster fishingMonster : _fishingMonstersData.values()) { if ((lvl >= fishingMonster.getUserMinLevel()) && (lvl <= fishingMonster.getUserMaxLevel())) { return fishingMonster; } } return null; }
@Override public void parseDocument(Document doc) { for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling()) { if ("list".equalsIgnoreCase(n.getNodeName())) { for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling()) { if ("fishingMonster".equalsIgnoreCase(d.getNodeName())) { final NamedNodeMap attrs = d.getAttributes(); final StatsSet set = new StatsSet(); for (int i = 0; i < attrs.getLength(); i++) { final Node att = attrs.item(i); set.set(att.getNodeName(), att.getNodeValue()); } final L2FishingMonster fishingMonster = new L2FishingMonster(set); _fishingMonstersData.put(fishingMonster.getFishingMonsterId(), fishingMonster); } } } } }