Search in sources :

Example 36 with Item

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);
}
Also used : Item(delta.games.lotro.lore.items.Item) ArrayList(java.util.ArrayList)

Example 37 with Item

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;
}
Also used : Relic(delta.games.lotro.lore.items.legendary.relics.Relic) Item(delta.games.lotro.lore.items.Item) ArrayList(java.util.ArrayList) LotroPlanItemsDbLoader(delta.games.lotro.tools.lore.items.lotroplan.LotroPlanItemsDbLoader)

Example 38 with Item

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;
}
Also used : LegendaryItem(delta.games.lotro.lore.items.legendary.LegendaryItem) Item(delta.games.lotro.lore.items.Item)

Example 39 with Item

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;
}
Also used : LegendaryItem(delta.games.lotro.lore.items.legendary.LegendaryItem) Item(delta.games.lotro.lore.items.Item) ArmourType(delta.games.lotro.lore.items.ArmourType) Armour(delta.games.lotro.lore.items.Armour)

Example 40 with Item

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;
}
Also used : FixedDecimalsInteger(delta.games.lotro.utils.FixedDecimalsInteger) LegendaryItem(delta.games.lotro.lore.items.legendary.LegendaryItem) Item(delta.games.lotro.lore.items.Item) ItemsManager(delta.games.lotro.lore.items.ItemsManager) CharacterData(delta.games.lotro.character.CharacterData) EQUIMENT_SLOT(delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT) ArrayList(java.util.ArrayList) CharacterClass(delta.games.lotro.common.CharacterClass) HashSet(java.util.HashSet)

Aggregations

Item (delta.games.lotro.lore.items.Item)105 ArrayList (java.util.ArrayList)29 HashMap (java.util.HashMap)19 File (java.io.File)17 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)16 Armour (delta.games.lotro.lore.items.Armour)15 LegendaryItem (delta.games.lotro.lore.items.legendary.LegendaryItem)12 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)11 ArmourType (delta.games.lotro.lore.items.ArmourType)8 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)8 Weapon (delta.games.lotro.lore.items.Weapon)8 JMenuItem (javax.swing.JMenuItem)8 EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)7 CharacterClass (delta.games.lotro.common.CharacterClass)7 ItemsManager (delta.games.lotro.lore.items.ItemsManager)7 CharacterEquipment (delta.games.lotro.character.CharacterEquipment)6 ItemsStash (delta.games.lotro.character.storage.ItemsStash)6 WeaponType (delta.games.lotro.lore.items.WeaponType)6 ItemQuality (delta.games.lotro.lore.items.ItemQuality)5 List (java.util.List)5