use of delta.games.lotro.lore.items.Item in project lotro-tools by dmorcellet.
the class MainItemStatsSheetTemplateGenerator method buildTemplate.
private void buildTemplate(List<Item> items) {
StringBuilder sb = new StringBuilder();
// Headers
List<String> headers = new ArrayList<String>();
for (String cell : EssenceStatsInjector.CELLS) {
headers.add(cell);
}
putLine(headers, sb);
// Items
List<String> cells = new ArrayList<String>(headers);
for (Item item : items) {
int id = item.getIdentifier();
cells.set(0, String.valueOf(id));
String name = item.getName();
cells.set(1, name);
putLine(cells, sb);
}
System.out.println(sb);
}
use of delta.games.lotro.lore.items.Item in project lotro-tools by dmorcellet.
the class LotroPlanMordorRelicsLoader method loadGorgorothRelics.
/**
* Load Gorgoroth relics.
* @return A list of relics.
*/
public List<Relic> loadGorgorothRelics() {
List<Relic> relics = new ArrayList<Relic>();
LotroPlanItemsDbLoader tableLoader = new LotroPlanItemsDbLoader();
List<Item> items = tableLoader.loadTable("mordor_relics.txt");
for (Item item : items) {
Relic relic = itemToRelic(item);
relics.add(relic);
}
return relics;
}
use of delta.games.lotro.lore.items.Item in project lotro-tools by dmorcellet.
the class ItemNormalization method removeTestItems.
private Item removeTestItems(Item item) {
Item ret = item;
String name = item.getName();
if (name != null) {
if ((name.startsWith("DNT")) || (name.contains("TBD"))) {
ret = null;
}
if (name.contains("Tester")) {
ret = null;
}
if (name.contains("Barter Test")) {
ret = null;
}
}
String tulkasCategory = item.getProperty(ItemPropertyNames.TULKAS_CATEGORY);
// Test armours (medium, heavy, light)
if ("230".equals(tulkasCategory))
return null;
if ("231".equals(tulkasCategory))
return null;
if ("232".equals(tulkasCategory))
return null;
return ret;
}
use of delta.games.lotro.lore.items.Item in project lotro-tools by dmorcellet.
the class ItemNormalization method normalizeArmours.
private Item normalizeArmours(Item item) {
int id = item.getIdentifier();
String category = item.getSubCategory();
Armour armour = null;
if ("Heavy Armour".equals(category)) {
armour = checkArmour(item);
ArmourType previous = armour.getArmourType();
if ((previous != null) && (previous != ArmourType.HEAVY)) {
System.out.println("ID: " + id + ": armour type conflict: was=" + previous + ", should be=" + ArmourType.HEAVY);
}
armour.setArmourType(ArmourType.HEAVY);
armour.setSubCategory(null);
} else if ("Medium Armour".equals(category)) {
armour = checkArmour(item);
ArmourType previous = armour.getArmourType();
if ((previous != null) && (previous != ArmourType.MEDIUM)) {
System.out.println("ID: " + id + ": armour type conflict: was=" + previous + ", should be=" + ArmourType.MEDIUM);
}
armour.setArmourType(ArmourType.MEDIUM);
armour.setSubCategory(null);
} else if ("Light Armour".equals(category)) {
armour = checkArmour(item);
ArmourType previous = armour.getArmourType();
if ((previous != null) && (previous != ArmourType.LIGHT)) {
System.out.println("ID: " + id + ": armour type conflict: was=" + previous + ", should be=" + ArmourType.LIGHT);
}
armour.setArmourType(ArmourType.LIGHT);
armour.setSubCategory(null);
} else if ("Shield".equals(category)) {
armour = checkArmour(item);
ArmourType previous = armour.getArmourType();
if ((previous == ArmourType.LIGHT) || (previous == null)) {
armour.setArmourType(ArmourType.SHIELD);
}
armour.setSubCategory(null);
armour.setEquipmentLocation(EquipmentLocation.OFF_HAND);
armour.removeProperty(ItemPropertyNames.LEGACY_CATEGORY);
armour.removeProperty(ItemPropertyNames.TULKAS_CATEGORY);
} else if ("Heavy Shield".equals(category)) {
armour = checkArmour(item);
armour.setArmourType(ArmourType.HEAVY_SHIELD);
armour.setSubCategory(null);
armour.setEquipmentLocation(EquipmentLocation.OFF_HAND);
armour.removeProperty(ItemPropertyNames.LEGACY_CATEGORY);
armour.removeProperty(ItemPropertyNames.TULKAS_CATEGORY);
} else if ("Warden's Shield".equals(category)) {
armour = checkArmour(item);
armour.setArmourType(ArmourType.WARDEN_SHIELD);
armour.setSubCategory(null);
armour.setEquipmentLocation(EquipmentLocation.OFF_HAND);
armour.removeProperty(ItemPropertyNames.LEGACY_CATEGORY);
armour.removeProperty(ItemPropertyNames.TULKAS_CATEGORY);
} else if ("33".equals(category)) {
armour = checkArmour(item);
ArmourType type = armour.getArmourType();
if (type == null) {
String name = armour.getName();
if (name.toLowerCase().contains("warden")) {
armour.setArmourType(ArmourType.WARDEN_SHIELD);
} else if ((name.indexOf("Heavy Shield") != -1) || (name.indexOf("Bulwark") != -1) || (name.indexOf("Battle-shield") != -1)) {
armour.setArmourType(ArmourType.HEAVY_SHIELD);
} else {
// Default as shield
armour.setArmourType(ArmourType.SHIELD);
}
}
type = armour.getArmourType();
if (type != null) {
armour.setSubCategory(null);
armour.setEquipmentLocation(EquipmentLocation.OFF_HAND);
armour.removeProperty(ItemPropertyNames.LEGACY_CATEGORY);
armour.removeProperty(ItemPropertyNames.TULKAS_CATEGORY);
if (type == ArmourType.WARDEN_SHIELD) {
armour.setRequiredClass(CharacterClass.WARDEN);
}
}
}
Item ret = (armour != null) ? armour : item;
ret = normalizeArmour(ret, "3", "Chest", EquipmentLocation.CHEST);
ret = normalizeArmour(ret, "5", "Hands", EquipmentLocation.HAND);
ret = normalizeArmour(ret, "6", "Shoulders", EquipmentLocation.SHOULDER);
ret = normalizeArmour(ret, "7", "Head", EquipmentLocation.HEAD);
ret = normalizeArmour(ret, "15", "Leggings", EquipmentLocation.LEGS);
ret = normalizeArmour(ret, "23", "Boots", EquipmentLocation.FEET);
ret = normalizeArmour(ret, "45", "Cloak", EquipmentLocation.BACK);
// => Shield (any type)
return ret;
}
use of delta.games.lotro.lore.items.Item in project lotro-tools by dmorcellet.
the class ItemNormalization method filterItems.
/**
* Filter items that are accessible within LotroCompanion.
* @param items List to filter.
* @return a list that contains the filtered items.
*/
private List<Item> filterItems(List<Item> items) {
ItemsManager manager = new ItemsManager(items);
Set<Integer> selectedIds = new HashSet<Integer>();
// Iterate on classes then on slots to find all reachable items
for (CharacterClass cClass : CharacterClass.ALL_CLASSES) {
CharacterData c = new CharacterData();
c.setCharacterClass(cClass);
c.setLevel(105);
for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
List<Item> selectedItems = manager.getItems(c, slot);
for (Item selectedItem : selectedItems) {
selectedIds.add(Integer.valueOf(selectedItem.getIdentifier()));
}
}
}
// Essences
List<Item> essences = manager.getEssences();
for (Item essence : essences) {
selectedIds.add(Integer.valueOf(essence.getIdentifier()));
}
// Build final list
List<Item> selectedItems = new ArrayList<Item>();
for (Item item : items) {
if (selectedIds.contains(Integer.valueOf(item.getIdentifier()))) {
selectedItems.add(item);
}
}
return selectedItems;
}
Aggregations