Sync with L2jServer HighFive Mar 1st 2015.

This commit is contained in:
mobius
2015-03-01 22:48:14 +00:00
parent f14af24b41
commit 6fa0ed56e3
116 changed files with 971 additions and 676 deletions

View File

@ -72,8 +72,6 @@ public final class AdminData implements IXmlReader
NamedNodeMap attrs;
Node attr;
StatsSet set;
L2AccessLevel level;
L2AdminCommandAccessRight command;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -89,7 +87,7 @@ public final class AdminData implements IXmlReader
attr = attrs.item(i);
set.set(attr.getNodeName(), attr.getNodeValue());
}
level = new L2AccessLevel(set);
final L2AccessLevel level = new L2AccessLevel(set);
if (level.getLevel() > _highestLevel)
{
_highestLevel = level.getLevel();
@ -105,7 +103,7 @@ public final class AdminData implements IXmlReader
attr = attrs.item(i);
set.set(attr.getNodeName(), attr.getNodeValue());
}
command = new L2AdminCommandAccessRight(set);
final L2AdminCommandAccessRight command = new L2AdminCommandAccessRight(set);
_adminCommandAccessRights.put(command.getAdminCommand(), command);
}
}

View File

@ -74,9 +74,6 @@ public class AppearanceItemData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
StatsSet set;
Node att;
NamedNodeMap attrs;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -85,11 +82,11 @@ public class AppearanceItemData implements IXmlReader
{
if ("appearance_stone".equalsIgnoreCase(d.getNodeName()))
{
attrs = d.getAttributes();
set = new StatsSet();
final NamedNodeMap attrs = d.getAttributes();
final StatsSet set = new StatsSet();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
final Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}

View File

@ -57,8 +57,6 @@ public final class ArmorSetsData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
L2ArmorSet set;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -67,13 +65,13 @@ public final class ArmorSetsData implements IXmlReader
{
if ("set".equalsIgnoreCase(d.getNodeName()))
{
set = new L2ArmorSet();
final L2ArmorSet set = new L2ArmorSet();
set.setIsVisual(parseBoolean(d.getAttributes(), "visual", false));
set.setMinimumPieces(parseInteger(d.getAttributes(), "minimumPieces"));
for (Node a = d.getFirstChild(); a != null; a = a.getNextSibling())
{
attrs = a.getAttributes();
final NamedNodeMap attrs = a.getAttributes();
switch (a.getNodeName())
{
case "chest":

View File

@ -56,26 +56,21 @@ public final class ClassListData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
Node attr;
ClassId classId;
String className;
ClassId parentClassId;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equals(n.getNodeName()))
{
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
attrs = d.getAttributes();
final NamedNodeMap attrs = d.getAttributes();
if ("class".equals(d.getNodeName()))
{
attr = attrs.getNamedItem("classId");
classId = ClassId.getClassId(parseInteger(attr));
Node attr = attrs.getNamedItem("classId");
final ClassId classId = ClassId.getClassId(parseInteger(attr));
attr = attrs.getNamedItem("name");
className = attr.getNodeValue();
final String className = attr.getNodeValue();
attr = attrs.getNamedItem("parentClassId");
parentClassId = (attr != null) ? ClassId.getClassId(parseInteger(attr)) : null;
final ClassId parentClassId = (attr != null) ? ClassId.getClassId(parseInteger(attr)) : null;
_classData.put(classId, new ClassInfo(classId, className, parentClassId));
}
}
@ -85,7 +80,7 @@ public final class ClassListData implements IXmlReader
/**
* Gets the class list.
* @return the complete class list.
* @return the complete class list
*/
public Map<ClassId, ClassInfo> getClassList()
{
@ -94,8 +89,8 @@ public final class ClassListData implements IXmlReader
/**
* Gets the class info.
* @param classId the class Id.
* @return the class info related to the given {@code classId}.
* @param classId the class ID
* @return the class info related to the given {@code classId}
*/
public ClassInfo getClass(ClassId classId)
{
@ -104,8 +99,8 @@ public final class ClassListData implements IXmlReader
/**
* Gets the class info.
* @param classId the class Id as integer.
* @return the class info related to the given {@code classId}.
* @param classId the class Id as integer
* @return the class info related to the given {@code classId}
*/
public ClassInfo getClass(int classId)
{
@ -126,4 +121,4 @@ public final class ClassListData implements IXmlReader
{
protected static final ClassListData _instance = new ClassListData();
}
}
}

View File

@ -66,9 +66,6 @@ public class DoorData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
Node att;
StatsSet set;
for (Node a = doc.getFirstChild(); a != null; a = a.getNextSibling())
{
if ("list".equalsIgnoreCase(a.getNodeName()))
@ -77,12 +74,12 @@ public class DoorData implements IXmlReader
{
if ("door".equalsIgnoreCase(b.getNodeName()))
{
attrs = b.getAttributes();
set = new StatsSet();
final NamedNodeMap attrs = b.getAttributes();
final StatsSet set = new StatsSet();
set.set("baseHpMax", 1); // Avoid doors without HP value created dead due to default value 0 in L2CharTemplate
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
final Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
makeDoor(set);

View File

@ -69,7 +69,7 @@ public final class EnchantItemGroupsData implements IXmlReader
{
if ("enchantRateGroup".equalsIgnoreCase(d.getNodeName()))
{
String name = parseString(d.getAttributes(), "name");
final String name = parseString(d.getAttributes(), "name");
final EnchantItemGroup group = new EnchantItemGroup(name);
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@ -65,12 +65,12 @@ public class EnchantItemHPBonusData implements IXmlReader
{
if ("enchantHP".equalsIgnoreCase(d.getNodeName()))
{
List<Integer> bonuses = new ArrayList<>();
final List<Integer> bonuses = new ArrayList<>(12);
for (Node e = d.getFirstChild(); e != null; e = e.getNextSibling())
{
if ("bonus".equalsIgnoreCase(e.getNodeName()))
{
bonuses.add(Integer.valueOf(e.getTextContent()));
bonuses.add(Integer.parseInt(e.getTextContent()));
}
}
_armorHPBonuses.put(parseEnum(d.getAttributes(), CrystalType.class, "grade"), bonuses);
@ -82,12 +82,11 @@ public class EnchantItemHPBonusData implements IXmlReader
if (!_armorHPBonuses.isEmpty())
{
final ItemTable it = ItemTable.getInstance();
L2Item item;
// Armors
final Collection<Integer> armorIds = it.getAllArmorsId();
for (Integer itemId : armorIds)
{
item = it.getTemplate(itemId);
L2Item item = it.getTemplate(itemId);
if ((item != null) && (item.getCrystalType() != CrystalType.NONE))
{
switch (item.getBodyPart())

View File

@ -52,9 +52,7 @@ public class EnchantItemOptionsData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
Node att = null;
int counter = 0;
EnchantOptions op = null;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -72,12 +70,12 @@ public class EnchantItemOptionsData implements IXmlReader
{
if ("options".equalsIgnoreCase(cd.getNodeName()))
{
op = new EnchantOptions(parseInteger(cd.getAttributes(), "level"));
final EnchantOptions op = new EnchantOptions(parseInteger(cd.getAttributes(), "level"));
_data.get(itemId).put(op.getLevel(), op);
for (byte i = 0; i < 3; i++)
{
att = cd.getAttributes().getNamedItem("option" + (i + 1));
final Node att = cd.getAttributes().getNamedItem("option" + (i + 1));
if ((att != null) && Util.isDigit(att.getNodeValue()))
{
op.setOption(i, parseInteger(att));

View File

@ -77,11 +77,6 @@ public class EnchantSkillGroupsData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
StatsSet set;
Node att;
int id = 0;
L2EnchantSkillGroup group;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -90,10 +85,9 @@ public class EnchantSkillGroupsData implements IXmlReader
{
if ("group".equalsIgnoreCase(d.getNodeName()))
{
attrs = d.getAttributes();
id = parseInteger(attrs, "id");
group = _enchantSkillGroups.get(id);
NamedNodeMap attrs = d.getAttributes();
final int id = parseInteger(attrs, "id");
L2EnchantSkillGroup group = _enchantSkillGroups.get(id);
if (group == null)
{
group = new L2EnchantSkillGroup(id);
@ -105,11 +99,11 @@ public class EnchantSkillGroupsData implements IXmlReader
if ("enchant".equalsIgnoreCase(b.getNodeName()))
{
attrs = b.getAttributes();
set = new StatsSet();
StatsSet set = new StatsSet();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
group.addEnchantDetail(new EnchantSkillHolder(set));

View File

@ -65,12 +65,11 @@ public final class ExperienceData implements IXmlReader
MAX_LEVEL = (byte) (Byte.parseByte(tableAttr.getNamedItem("maxLevel").getNodeValue()) + 1);
MAX_PET_LEVEL = (byte) (Byte.parseByte(tableAttr.getNamedItem("maxPetLevel").getNodeValue()) + 1);
NamedNodeMap attrs;
for (Node n = table.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("experience".equals(n.getNodeName()))
{
attrs = n.getAttributes();
NamedNodeMap attrs = n.getAttributes();
_expTable.put(parseInteger(attrs, "level"), parseLong(attrs, "tolevel"));
}
}

View File

@ -62,10 +62,6 @@ public final class FishData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
Node att;
L2Fish fish;
StatsSet set;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -74,15 +70,16 @@ public final class FishData implements IXmlReader
{
if ("fish".equalsIgnoreCase(d.getNodeName()))
{
attrs = d.getAttributes();
final NamedNodeMap attrs = d.getAttributes();
set = new StatsSet();
final StatsSet set = new StatsSet();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
final Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
fish = new L2Fish(set);
final L2Fish fish = new L2Fish(set);
switch (fish.getFishGrade())
{
case 0:

View File

@ -56,10 +56,6 @@ public final class FishingMonstersData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
Node att;
L2FishingMonster fishingMonster;
StatsSet set;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -69,15 +65,15 @@ public final class FishingMonstersData implements IXmlReader
if ("fishingMonster".equalsIgnoreCase(d.getNodeName()))
{
attrs = d.getAttributes();
set = new StatsSet();
final NamedNodeMap attrs = d.getAttributes();
final StatsSet set = new StatsSet();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
final Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
fishingMonster = new L2FishingMonster(set);
final L2FishingMonster fishingMonster = new L2FishingMonster(set);
_fishingMonstersData.put(fishingMonster.getFishingMonsterId(), fishingMonster);
}
}

View File

@ -56,10 +56,6 @@ public final class FishingRodsData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
Node att;
L2FishingRod fishingRod;
StatsSet set;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -68,16 +64,15 @@ public final class FishingRodsData implements IXmlReader
{
if ("fishingRod".equalsIgnoreCase(d.getNodeName()))
{
attrs = d.getAttributes();
set = new StatsSet();
final NamedNodeMap attrs = d.getAttributes();
final StatsSet set = new StatsSet();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
final Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
fishingRod = new L2FishingRod(set);
final L2FishingRod fishingRod = new L2FishingRod(set);
_fishingRods.put(fishingRod.getFishingRodItemId(), fishingRod);
}
}

View File

@ -87,7 +87,6 @@ public final class HennaData implements IXmlReader
final List<ClassId> wearClassIds = new ArrayList<>();
NamedNodeMap attrs = d.getAttributes();
Node attr;
String name;
for (int i = 0; i < attrs.getLength(); i++)
{
attr = attrs.item(i);
@ -96,7 +95,7 @@ public final class HennaData implements IXmlReader
for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling())
{
name = c.getNodeName();
final String name = c.getNodeName();
attrs = c.getAttributes();
switch (name)
{

View File

@ -51,7 +51,6 @@ public class KarmaData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("pcKarmaIncrease".equalsIgnoreCase(n.getNodeName()))
@ -60,7 +59,7 @@ public class KarmaData implements IXmlReader
{
if ("increase".equalsIgnoreCase(d.getNodeName()))
{
attrs = d.getAttributes();
final NamedNodeMap attrs = d.getAttributes();
_karmaTable.put(parseInteger(attrs, "lvl"), parseDouble(attrs, "val"));
}
}

View File

@ -57,8 +57,6 @@ public class OptionData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
int id;
Options op;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -67,8 +65,8 @@ public class OptionData implements IXmlReader
{
if ("option".equalsIgnoreCase(d.getNodeName()))
{
id = parseInteger(d.getAttributes(), "id");
op = new Options(id);
final int id = parseInteger(d.getAttributes(), "id");
final Options op = new Options(id);
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@ -58,9 +58,6 @@ public final class StaticObjectData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
Node att;
StatsSet set;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -69,11 +66,11 @@ public final class StaticObjectData implements IXmlReader
{
if ("object".equalsIgnoreCase(d.getNodeName()))
{
attrs = d.getAttributes();
set = new StatsSet();
final NamedNodeMap attrs = d.getAttributes();
final StatsSet set = new StatsSet();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
final Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
addObject(set);

View File

@ -60,9 +60,6 @@ public final class TransformData implements IXmlReader
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
Node att;
StatsSet set;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
@ -71,11 +68,11 @@ public final class TransformData implements IXmlReader
{
if ("transform".equalsIgnoreCase(d.getNodeName()))
{
attrs = d.getAttributes();
set = new StatsSet();
NamedNodeMap attrs = d.getAttributes();
StatsSet set = new StatsSet();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
final Transform transform = new Transform(set);
@ -105,7 +102,7 @@ public final class TransformData implements IXmlReader
attrs = s.getAttributes();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
Node att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
break;
@ -202,7 +199,7 @@ public final class TransformData implements IXmlReader
attrs = s.getAttributes();
for (int i = 0; i < attrs.getLength(); i++)
{
att = attrs.item(i);
Node att = attrs.item(i);
levelsSet.set(att.getNodeName(), att.getNodeValue());
}
}