use of delta.games.lotro.tools.lore.common.RewardsHTMLParser in project lotro-tools by dmorcellet.
the class QuestPageParser method parseQuestDescription.
private void parseQuestDescription(Element officialSection) {
// Title
String title = null;
Element titleElement = JerichoHtmlUtils.findElementByTagNameAndAttributeValue(officialSection, HTMLElementName.DIV, "class", "lorebooktitle");
if (titleElement != null) {
title = CharacterReference.decodeCollapseWhiteSpace(titleElement.getContent());
if (title != null) {
if (title.startsWith(QUEST_SEED)) {
title = title.substring(QUEST_SEED.length()).trim();
}
}
}
_quest.setTitle(title);
// Quest attributes
// System.out.println("Title: "+title);
List<Element> questFields = JerichoHtmlUtils.findElementsByTagNameAndAttributeValue(officialSection, HTMLElementName.DIV, "class", "questfield");
for (Element questField : questFields) {
parseQuestField(questField);
}
// Rewards
// <table class="questrewards">
Element rewardsTable = JerichoHtmlUtils.findElementByTagNameAndAttributeValue(officialSection, HTMLElementName.TABLE, "class", "questrewards");
if (rewardsTable != null) {
Rewards rewards = _quest.getQuestRewards();
RewardsHTMLParser parser = new RewardsHTMLParser("Quest [" + _key + "]");
parser.parseRewards(rewardsTable, rewards);
}
}
Aggregations