use of delta.games.lotro.lore.quests.index.QuestCategory in project lotro-companion by dmorcellet.
the class QuestsCompletionStats method loadQuestIdentifiers.
private void loadQuestIdentifiers() {
QuestsManager qm = QuestsManager.getInstance();
QuestsIndex index = qm.getIndex();
if (index != null) {
QuestCategory category = index.getCategory(_category);
if (category != null) {
QuestSummary[] summaries = category.getQuests();
for (QuestSummary summary : summaries) {
int id = summary.getIdentifier();
QuestDescription q = qm.getQuest(id);
if (q != null) {
boolean useIt = true;
if (USE_CLASS_RESTRICTIONS) {
List<String> classes = q.getRequiredClasses();
if ((classes != null) && (classes.size() > 0)) {
CharacterClass cClass = _character.getCharacterClass();
String className = cClass.getKey();
if (classes.contains(className)) {
useIt = true;
} else {
String key = q.getKey();
if (_logger.isInfoEnabled()) {
_logger.info("Ignored quest [" + key + "]. Class=" + className + ", Required:" + classes);
}
useIt = false;
}
}
}
if (USE_RACE_RESTRICTIONS) {
List<String> races = q.getRequiredRaces();
if ((races != null) && (races.size() > 0)) {
Race cRace = _character.getRace();
String raceName = cRace.getLabel();
if (races.contains(raceName)) {
useIt = true;
} else {
String key = q.getKey();
if (_logger.isInfoEnabled()) {
_logger.info("Ignored quest [" + key + "]. Race=" + raceName + ", Required:" + races);
}
useIt = false;
}
}
}
if (!USE_INSTANCES) {
boolean instanced = q.isInstanced();
if (instanced) {
useIt = false;
}
}
if (useIt) {
_expectedIds.add(Integer.valueOf(id));
}
}
}
_nbExpectedQuests = _expectedIds.size();
}
}
}
use of delta.games.lotro.lore.quests.index.QuestCategory in project lotro-tools by dmorcellet.
the class QuestsItemsLoader method doIt.
private void doIt() {
List<QuestDescription> storage = new ArrayList<QuestDescription>();
QuestsManager qm = QuestsManager.getInstance();
QuestsIndex index = qm.getIndex();
if (index != null) {
String[] categories = index.getCategories();
System.out.println(Arrays.deepToString(categories));
for (String category : categories) {
QuestCategory c = index.getCategory(category);
QuestSummary[] quests = c.getQuests();
int indexQ = 0;
for (QuestSummary questSum : quests) {
int id = questSum.getIdentifier();
QuestDescription q = qm.getQuest(id);
handleQuest(indexQ, q);
storage.add(q);
indexQ++;
}
}
System.out.println("Resolved: " + _resolved + ", missed: " + _missed);
writeQuestsDatabase(storage);
} else {
_logger.error("Cannot gets quests index file!");
}
}
use of delta.games.lotro.lore.quests.index.QuestCategory in project lotro-tools by dmorcellet.
the class QuestsLoader method loadQuestsForCategory.
private void loadQuestsForCategory(String categoryName) {
System.out.println("Category [" + categoryName + "]");
QuestCategory category = _index.getCategory(categoryName);
QuestSummary[] summaries = category.getQuests();
int nbQuestsToLoad = summaries.length;
int nbQuestsLoaded = 0;
for (String key : category.getKeys()) {
int nbQuests = loadQuestsDefinition(key);
nbQuestsLoaded += nbQuests;
}
_totalNbQuestsToLoad += nbQuestsToLoad;
_totalNbQuestsLoaded += nbQuestsLoaded;
System.out.println("Category [" + categoryName + "]: " + nbQuestsLoaded + "/" + nbQuestsToLoad + ".");
}
Aggregations