Sex sex = Sex.valueOf(element.attributeValue("sex").toUpperCase());
ClassType classtype = ClassType.valueOf(element.attributeValue("type").toUpperCase());
StatAttributes min_attr = null;
StatAttributes max_attr = null;
StatAttributes base_attr = null;
BaseArmorDefence arm_defence = null;
BaseJewelDefence jewl_defence = null;
StatsSet stats_set = new StatsSet();
List<StartItem> start_items = new ArrayList<>();
List<Location> start_locations = new ArrayList<>();
TIntObjectHashMap<LvlUpData> lvl_up_data = new TIntObjectHashMap<>();
for (Iterator<Element> subIterator = element.elementIterator(); subIterator.hasNext();)
{
Element subElement = subIterator.next();
if ("creation_data".equalsIgnoreCase(subElement.getName()))
{
for (Element e : subElement.elements())
{
if ("start_equipments".equalsIgnoreCase(e.getName()))
{
for (Element e2 : e.elements())
{
if ("equipment".equalsIgnoreCase(e2.getName()))
{
int item_id = Integer.parseInt(e2.attributeValue("item_id"));
long count = Long.parseLong(e2.attributeValue("count"));
boolean equiped = Boolean.parseBoolean(e2.attributeValue("equiped"));
start_items.add(new StartItem(item_id, count, equiped));
}
}
}
else if ("start_points".equalsIgnoreCase(e.getName()))
{
for (Element e2 : e.elements())
{
if ("point".equalsIgnoreCase(e2.getName()))
{
start_locations.add(Location.parse(e2));
}
}
}
}
}
else if ("stats_data".equalsIgnoreCase(subElement.getName()))
{
for (Element e : subElement.elements())
{
if (("min_attributes".equalsIgnoreCase(e.getName())) || ("max_attributes".equalsIgnoreCase(e.getName())) || ("base_attributes".equalsIgnoreCase(e.getName())))
{
int _int = Integer.parseInt(e.attributeValue("int"));
int str = Integer.parseInt(e.attributeValue("str"));
int con = Integer.parseInt(e.attributeValue("con"));
int men = Integer.parseInt(e.attributeValue("men"));
int dex = Integer.parseInt(e.attributeValue("dex"));
int wit = Integer.parseInt(e.attributeValue("wit"));
StatAttributes attr = new StatAttributes(_int, str, con, men, dex, wit);
if ("min_attributes".equalsIgnoreCase(e.getName()))
{
min_attr = attr;
}
else if ("max_attributes".equalsIgnoreCase(e.getName()))
{
max_attr = attr;
}
else if ("base_attributes".equalsIgnoreCase(e.getName()))
{
base_attr = attr;
}
}
else if ("armor_defence".equalsIgnoreCase(e.getName()))
{
int chest = Integer.parseInt(e.attributeValue("chest"));
int legs = Integer.parseInt(e.attributeValue("legs"));
int helmet = Integer.parseInt(e.attributeValue("helmet"));
int boots = Integer.parseInt(e.attributeValue("boots"));
int gloves = Integer.parseInt(e.attributeValue("gloves"));
int underwear = Integer.parseInt(e.attributeValue("underwear"));
int cloak = Integer.parseInt(e.attributeValue("cloak"));
arm_defence = new BaseArmorDefence(chest, legs, helmet, boots, gloves, underwear, cloak);
}
else if ("jewel_defence".equalsIgnoreCase(e.getName()))
{
int r_earring = Integer.parseInt(e.attributeValue("r_earring"));
int l_earring = Integer.parseInt(e.attributeValue("l_earring"));