use of eidolons.client.cc.logic.items.ItemGenerator in project Eidolons by IDemiurge.
the class ContainerMaster method generateJewelry.
private List<ObjType> generateJewelry(ITEM_RARITY rarity, List<ObjType> group) {
ItemGenerator generator = ItemGenerator.getDefaultGenerator();
JEWELRY_ITEM_TRAIT[] traits = getJewelryTraits(rarity);
MAGICAL_ITEM_LEVEL[] levels = getJewelryLevels(rarity);
for (ObjType sub : new ArrayList<>(group)) for (MAGICAL_ITEM_LEVEL level : levels) for (JEWELRY_ITEM_TRAIT trait : traits) group.add(generator.getOrCreateJewelry(sub, trait, level));
return group;
}
use of eidolons.client.cc.logic.items.ItemGenerator in project Eidolons by IDemiurge.
the class ContainerMaster method generateTypes.
private List<ObjType> generateTypes(CONTAINER_CONTENTS c, ITEM_RARITY rarity, List<ObjType> group) {
if (c == CONTAINER_CONTENTS.POTIONS || group.get(0).getGroup().equalsIgnoreCase("Alchemy")) {
return DataManager.getTypesGroup(DC_TYPE.ITEMS, "Alchemy");
// return DataManager.gettype;
}
if (c == CONTAINER_CONTENTS.JEWELRY || group.get(0).getOBJ_TYPE_ENUM() == DC_TYPE.JEWELRY) {
if (!ItemGenerator.isJewelryOn())
return null;
return generateJewelry(rarity, group);
}
ItemGenerator generator = ItemGenerator.getDefaultGenerator();
MATERIAL[] materials = getMaterials(rarity);
QUALITY_LEVEL[] qualityLevels = getQualityLevels(rarity);
for (ObjType type : new ArrayList<>(group)) {
if (type.isGenerated()) {
continue;
}
for (MATERIAL material : materials) {
if (!ItemMaster.checkMaterial(type, material))
continue;
for (QUALITY_LEVEL quality : qualityLevels) {
boolean weapon = type.getOBJ_TYPE_ENUM() == DC_TYPE.WEAPONS;
String name = ItemGenerator.generateName(quality, material, type);
ObjType newType = DataManager.getType(name, type.getOBJ_TYPE());
if (newType == null)
newType = generator.generateItem(weapon, quality, material, type);
group.add(newType);
}
}
}
return group;
}
Aggregations