use of delta.games.lotro.common.CharacterClass in project lotro-companion by dmorcellet.
the class CharacterSummaryDialogController method okImpl.
@Override
protected void okImpl() {
String toonName = _toonName.getText();
_data.setName(toonName);
String server = _server.getSelectedItem();
_data.setServer(server);
CharacterClass cClass = _class.getSelectedItem();
_data.setCharacterClass(cClass);
Race race = _race.getSelectedItem();
_data.setRace(race);
CharacterSex sex = _sex.getSelectedItem();
_data.setCharacterSex(sex);
String region = _region.getComboBoxController().getSelectedItem();
_data.setRegion(region);
int level = _level.getSelectedItem().intValue();
_data.setLevel(level);
}
use of delta.games.lotro.common.CharacterClass in project lotro-companion by dmorcellet.
the class CharacterSummaryDialogController method initData.
private void initData() {
// Toon name
String name = _data.getName();
_toonName.setText(name);
// Server
String server = _data.getServer();
_server.selectItem(server);
// Class
CharacterClass characterClass = _data.getCharacterClass();
_class.selectItem(characterClass);
// Race
Race race = _data.getRace();
_race.selectItem(race);
_region.setRace(race);
// Sex
CharacterSex sex = _data.getCharacterSex();
_sex.selectItem(sex);
// Region
String region = _data.getRegion();
_region.getComboBoxController().selectItem(region);
// Level
int level = _data.getLevel();
_level.selectItem(Integer.valueOf(level));
}
use of delta.games.lotro.common.CharacterClass in project lotro-tools by dmorcellet.
the class TraitPointsRegistryBuilder method checks.
private void checks() {
for (CharacterClass cClass : CharacterClass.ALL_CLASSES) {
List<TraitPoint> points = _registry.getPointsForClass(cClass);
Collections.sort(points, new TraitPointLabelComparator());
System.out.println(cClass + ":" + points.size());
for (TraitPoint point : points) {
System.out.println("\t" + point.getLabel() + " -- " + point.getId());
}
}
List<TraitPoint> all = _registry.getAll();
System.out.println("All:" + all.size());
}
use of delta.games.lotro.common.CharacterClass in project lotro-tools by dmorcellet.
the class TraitPointsRegistryBuilder method buildClassPoints.
private void buildClassPoints() {
int classIndex = 0;
for (CharacterClass cClass : CharacterClass.ALL_CLASSES) {
String category = TraitPointCategories.CLASS;
String key = cClass.getKey();
String book1 = BOOK_NAMES[classIndex][0];
initPoint(key + ":LegendaryBook1", category, "Complete Legendary Book Pages '" + book1 + "'", cClass);
String book2 = BOOK_NAMES[classIndex][1];
initPoint(key + ":LegendaryBook2", category, "Complete Legendary Book Pages '" + book2 + "'", cClass);
String book3 = BOOK_NAMES[classIndex][2];
initPoint(key + ":LegendaryBook3", category, "Complete Legendary Book Pages '" + book3 + "'", cClass);
String chain1 = CLASS_QUESTS_CHAIN_NAMES[classIndex][0];
initPoint(key + ":ClassQuests50", category, "Complete the Level 50 Class Quest Chain '" + chain1 + "'", cClass);
String chain2 = CLASS_QUESTS_CHAIN_NAMES[classIndex][1];
initPoint(key + ":ClassQuests58", category, "Complete the Level 58 Class Quest Chain '" + chain2 + "'", cClass);
if (cClass != CharacterClass.BEORNING) {
String dwarfBook = IRON_GARNISON_GUARDS_BOOKS[classIndex];
initPoint(key + ":ReadGuardsBook", category, "Read book of Iron Garrison Guards: '" + dwarfBook + "'", cClass);
}
classIndex++;
}
// Epic
TraitPoint epicVol2Book6 = initPoint("EpicVol2Book6", TraitPointCategories.EPIC, "Complete Volume II, Book 6 (Moria)", null);
for (CharacterClass characterClass : CharacterClass.ALL_CLASSES) {
if (characterClass != CharacterClass.BEORNING) {
epicVol2Book6.addRequiredClass(characterClass);
}
}
// Add Beorning specifics
initPoint("Beorning:ClassQuests15", TraitPointCategories.CLASS, "Complete the Level 15 Class Quest Chain 'The Speech of Animals'", CharacterClass.BEORNING);
initPoint("Beorning:ClassQuests30", TraitPointCategories.CLASS, "Complete the Level 30 Class Quest Chain 'Hatred of Bear and Man'", CharacterClass.BEORNING);
}
use of delta.games.lotro.common.CharacterClass in project lotro-tools by dmorcellet.
the class LotroPlanItemsDbLoader method buildItemFromLine.
private Item buildItemFromLine(LotroPlanTable table, String line) {
String[] fieldsTrimmed = StringSplitter.split(line.trim(), '\t');
if (line.startsWith("#")) {
System.out.println("Ignored: " + line);
return null;
}
if (fieldsTrimmed.length < 2) {
_section = line.trim();
System.out.println("Section: " + _section);
return null;
}
String[] fields = StringSplitter.split(line, '\t');
// Item level
int itemLevel = NumericTools.parseInt(fields[LotroPlanTable.ITEM_LEVEL_INDEX], -1);
// Stats
ItemStatsProvider provider = table.loadStats(fields);
BasicStatsSet stats = provider.getStats(itemLevel);
FixedDecimalsInteger armorStat = stats.getStat(STAT.ARMOUR);
Item item = null;
Armour armour = null;
if (armorStat != null) {
armour = new Armour();
item = armour;
armour.setArmourValue(armorStat.intValue());
stats.removeStat(STAT.ARMOUR);
} else {
item = new Item();
}
// ID
String idStr = "";
int notesIndex = table.getNotesIndex();
if (fields.length >= notesIndex) {
idStr = fields[notesIndex].trim();
}
int id = 0;
if (idStr.startsWith("ID:")) {
idStr = idStr.substring(3).trim();
}
id = NumericTools.parseInt(idStr, -1);
if (id != -1) {
item.setIdentifier(id);
}
// Name
String name = fields[LotroPlanTable.NAME_INDEX];
if (name.startsWith("(")) {
int index = name.indexOf(')');
idStr = name.substring(1, index).trim();
id = NumericTools.parseInt(idStr, -1);
item.setIdentifier(id);
name = name.substring(index + 1).trim();
}
if (name.endsWith(":")) {
name = name.substring(0, name.length() - 1);
}
name = name.replace(' ', ' ');
if (name.endsWith("s)")) {
name = name.substring(0, name.length() - 2);
int index = name.lastIndexOf('(');
int nbSlots = NumericTools.parseInt(name.substring(index + 1), 0);
name = name.substring(0, index).trim();
item.setEssenceSlots(nbSlots);
}
if (name.endsWith(")")) {
String newName = name.substring(0, name.length() - 1);
int index = newName.lastIndexOf('(');
String valueStr = newName.substring(index + 1);
int minLevel;
if ("TBD".equals(valueStr)) {
minLevel = -1;
} else {
minLevel = NumericTools.parseInt(valueStr, -1);
name = newName.substring(0, index).trim();
}
if (minLevel > 0) {
item.setMinLevel(Integer.valueOf(minLevel));
}
}
name = name.trim();
item.setName(name);
// Item level
if (itemLevel != -1) {
item.setItemLevel(Integer.valueOf(itemLevel));
}
// Stats
item.getStats().setStats(stats);
String slices = provider.toPersistableString();
int nbSlices = ((SlicesBasedItemStatsProvider) provider).getSlices();
if (nbSlices > 0) {
item.setProperty(ItemPropertyNames.FORMULAS, slices);
}
// Slot
EquipmentLocation slot = null;
if ("Head".equals(_section))
slot = EquipmentLocation.HEAD;
else if ("Shoulders".equals(_section))
slot = EquipmentLocation.SHOULDER;
else if ("Chest".equals(_section))
slot = EquipmentLocation.CHEST;
else if ("Hands".equals(_section))
slot = EquipmentLocation.HAND;
else if ("Legs".equals(_section))
slot = EquipmentLocation.LEGS;
else if ("Feet".equals(_section))
slot = EquipmentLocation.FEET;
else if ("Shields".equals(_section))
slot = EquipmentLocation.OFF_HAND;
else if ("Ears".equals(_section))
slot = EquipmentLocation.EAR;
else if ("Neck".equals(_section))
slot = EquipmentLocation.NECK;
else if ("Wrists".equals(_section))
slot = EquipmentLocation.WRIST;
else if ("Fingers".equals(_section))
slot = EquipmentLocation.FINGER;
else if ("Pockets".equals(_section))
slot = EquipmentLocation.POCKET;
if (slot == null) {
int categoryIndex = table.getCategoryIndex();
if ((categoryIndex > 0) && (fields.length >= categoryIndex)) {
String category = fields[categoryIndex];
slot = getSlotFromCategory(category);
}
}
// Class requirement
String classRequirementStr = "";
int classesIndex = table.getClassesIndex();
if ((classesIndex != -1) && (fields.length >= classesIndex)) {
classRequirementStr = fields[classesIndex].trim();
}
CharacterClass classRequirement = getClassRequirement(classRequirementStr);
if (classRequirement != null) {
item.setRequiredClass(classRequirement);
}
if ("Burglar Signals".equals(_section)) {
item.setSubCategory("Burglar:Signal");
slot = EquipmentLocation.RANGED_ITEM;
item.setRequiredClass(CharacterClass.BURGLAR);
} else if ("Captain Standards".equals(_section)) {
item.setSubCategory("Captain:Standard");
slot = EquipmentLocation.RANGED_ITEM;
item.setRequiredClass(CharacterClass.CAPTAIN);
} else if ("Hunter Tomes".equals(_section)) {
String subCategory = "Tome";
if (name.contains("Wind-rider"))
subCategory = "Wind-rider";
if (name.contains("Whisper-draw"))
subCategory = "Whisper-draw";
item.setSubCategory("Hunter:" + subCategory);
slot = EquipmentLocation.CLASS_SLOT;
item.setRequiredClass(CharacterClass.HUNTER);
} else if ("Lore-master Brooches".equals(_section)) {
item.setSubCategory("Lore-master:Stickpin");
slot = EquipmentLocation.RANGED_ITEM;
item.setRequiredClass(CharacterClass.LORE_MASTER);
} else if ("Minstrel Instruments".equals(_section)) {
item.setSubCategory("Instrument");
slot = EquipmentLocation.RANGED_ITEM;
item.setRequiredClass(CharacterClass.MINSTREL);
} else if ("Rune-keeper Chisels".equals(_section)) {
String subCategory = "Other";
if (name.contains("Riffler"))
subCategory = "Riffler";
if (name.contains("Chisel"))
subCategory = "Chisel";
item.setSubCategory("Rune-keeper:" + subCategory);
slot = EquipmentLocation.RANGED_ITEM;
item.setRequiredClass(CharacterClass.RUNE_KEEPER);
} else if ("Warden Carvings".equals(_section)) {
item.setSubCategory("Warden:Carving");
slot = EquipmentLocation.CLASS_SLOT;
item.setRequiredClass(CharacterClass.WARDEN);
}
if (slot != null) {
item.setEquipmentLocation(slot);
}
return item;
}
Aggregations