Search in sources :

Example 11 with Rewards

use of delta.games.lotro.common.Rewards 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);
    }
}
Also used : Element(net.htmlparser.jericho.Element) Rewards(delta.games.lotro.common.Rewards) RewardsHTMLParser(delta.games.lotro.tools.lore.common.RewardsHTMLParser)

Aggregations

Rewards (delta.games.lotro.common.Rewards)11 ObjectsSet (delta.games.lotro.common.objects.ObjectsSet)6 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)5 ObjectItem (delta.games.lotro.common.objects.ObjectItem)4 DeedsManager (delta.games.lotro.lore.deeds.DeedsManager)3 ArrayList (java.util.ArrayList)3 CharacterLogItem (delta.games.lotro.character.log.CharacterLogItem)2 Title (delta.games.lotro.common.Title)2 Virtue (delta.games.lotro.common.Virtue)2 VirtueId (delta.games.lotro.common.VirtueId)2 DeedProxy (delta.games.lotro.lore.deeds.DeedProxy)2 Item (delta.games.lotro.lore.items.Item)2 List (java.util.List)2 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharacterLog (delta.games.lotro.character.log.CharacterLog)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 Emote (delta.games.lotro.common.Emote)1 ReputationItem (delta.games.lotro.common.ReputationItem)1 Trait (delta.games.lotro.common.Trait)1 QuestDescription (delta.games.lotro.lore.quests.QuestDescription)1