Added missing final modifiers.
This commit is contained in:
@@ -192,11 +192,11 @@ public class CharSummonTable
|
||||
Skill skill;
|
||||
while (rs.next())
|
||||
{
|
||||
int summonObjId = rs.getInt("summonId");
|
||||
int skillId = rs.getInt("summonSkillId");
|
||||
int curHp = rs.getInt("curHp");
|
||||
int curMp = rs.getInt("curMp");
|
||||
int time = rs.getInt("time");
|
||||
final int summonObjId = rs.getInt("summonId");
|
||||
final int skillId = rs.getInt("summonSkillId");
|
||||
final int curHp = rs.getInt("curHp");
|
||||
final int curMp = rs.getInt("curMp");
|
||||
final int time = rs.getInt("time");
|
||||
|
||||
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
||||
if ((skill == null) || !activeChar.hasServitor(summonObjId))
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ClanTable
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
int clanId = rs.getInt("clan_id");
|
||||
final int clanId = rs.getInt("clan_id");
|
||||
_clans.put(clanId, new L2Clan(clanId));
|
||||
clan = getClan(clanId);
|
||||
if (clan.getDissolvingExpiryTime() != 0)
|
||||
@@ -186,14 +186,14 @@ public class ClanTable
|
||||
if (null != getClanByName(clanName))
|
||||
{
|
||||
// clan name is already taken
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_ALREADY_EXISTS);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_ALREADY_EXISTS);
|
||||
sm.addString(clanName);
|
||||
player.sendPacket(sm);
|
||||
return null;
|
||||
}
|
||||
|
||||
L2Clan clan = new L2Clan(IdFactory.getInstance().getNextId(), clanName);
|
||||
L2ClanMember leader = new L2ClanMember(clan, player);
|
||||
final L2Clan clan = new L2Clan(IdFactory.getInstance().getNextId(), clanName);
|
||||
final L2ClanMember leader = new L2ClanMember(clan, player);
|
||||
clan.setLeader(leader);
|
||||
leader.setPlayerInstance(player);
|
||||
clan.store();
|
||||
@@ -217,14 +217,14 @@ public class ClanTable
|
||||
|
||||
public synchronized void destroyClan(int clanId)
|
||||
{
|
||||
L2Clan clan = getClan(clanId);
|
||||
final L2Clan clan = getClan(clanId);
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.CLAN_HAS_DISPERSED));
|
||||
int castleId = clan.getCastleId();
|
||||
final int castleId = clan.getCastleId();
|
||||
if (castleId == 0)
|
||||
{
|
||||
for (Siege siege : SiegeManager.getInstance().getSieges())
|
||||
@@ -233,7 +233,7 @@ public class ClanTable
|
||||
}
|
||||
}
|
||||
|
||||
int fortId = clan.getFortId();
|
||||
final int fortId = clan.getFortId();
|
||||
if (fortId == 0)
|
||||
{
|
||||
for (FortSiege siege : FortSiegeManager.getInstance().getSieges())
|
||||
@@ -242,7 +242,7 @@ public class ClanTable
|
||||
}
|
||||
}
|
||||
|
||||
int hallId = clan.getHideoutId();
|
||||
final int hallId = clan.getHideoutId();
|
||||
if (hallId == 0)
|
||||
{
|
||||
for (SiegableHall hall : CHSiegeManager.getInstance().getConquerableHalls().values())
|
||||
@@ -251,13 +251,13 @@ public class ClanTable
|
||||
}
|
||||
}
|
||||
|
||||
Auction auction = ClanHallAuctionManager.getInstance().getAuction(clan.getAuctionBiddedAt());
|
||||
final Auction auction = ClanHallAuctionManager.getInstance().getAuction(clan.getAuctionBiddedAt());
|
||||
if (auction != null)
|
||||
{
|
||||
auction.cancelBid(clan.getId());
|
||||
}
|
||||
|
||||
L2ClanMember leaderMember = clan.getLeader();
|
||||
final L2ClanMember leaderMember = clan.getLeader();
|
||||
if (leaderMember == null)
|
||||
{
|
||||
clan.getWarehouse().destroyAllItems("ClanRemove", null, null);
|
||||
@@ -325,10 +325,10 @@ public class ClanTable
|
||||
|
||||
if (fortId != 0)
|
||||
{
|
||||
Fort fort = FortManager.getInstance().getFortById(fortId);
|
||||
final Fort fort = FortManager.getInstance().getFortById(fortId);
|
||||
if (fort != null)
|
||||
{
|
||||
L2Clan owner = fort.getOwnerClan();
|
||||
final L2Clan owner = fort.getOwnerClan();
|
||||
if (clan == owner)
|
||||
{
|
||||
fort.removeOwner(true);
|
||||
@@ -338,7 +338,7 @@ public class ClanTable
|
||||
|
||||
if (hallId != 0)
|
||||
{
|
||||
SiegableHall hall = CHSiegeManager.getInstance().getSiegableHall(hallId);
|
||||
final SiegableHall hall = CHSiegeManager.getInstance().getSiegableHall(hallId);
|
||||
if ((hall != null) && (hall.getOwnerId() == clanId))
|
||||
{
|
||||
hall.free();
|
||||
@@ -424,8 +424,8 @@ public class ClanTable
|
||||
|
||||
public void deleteclanswars(int clanId1, int clanId2)
|
||||
{
|
||||
L2Clan clan1 = getClan(clanId1);
|
||||
L2Clan clan2 = getClan(clanId2);
|
||||
final L2Clan clan1 = getClan(clanId1);
|
||||
final L2Clan clan2 = getClan(clanId2);
|
||||
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarFinish(clan1, clan2));
|
||||
|
||||
@@ -508,7 +508,7 @@ public class ClanTable
|
||||
{
|
||||
for (L2Clan clan : _clans.values())
|
||||
{
|
||||
int allyId = clan.getAllyId();
|
||||
final int allyId = clan.getAllyId();
|
||||
if ((allyId != 0) && (clan.getId() != allyId))
|
||||
{
|
||||
if (!_clans.containsKey(allyId))
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class CrestTable
|
||||
public synchronized void load()
|
||||
{
|
||||
_crests.clear();
|
||||
Set<Integer> crestsInUse = new HashSet<>();
|
||||
final Set<Integer> crestsInUse = new HashSet<>();
|
||||
for (L2Clan clan : ClanTable.getInstance().getClans())
|
||||
{
|
||||
if (clan.getCrestId() != 0)
|
||||
@@ -80,7 +80,7 @@ public final class CrestTable
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
int id = rs.getInt("crest_id");
|
||||
final int id = rs.getInt("crest_id");
|
||||
|
||||
if (_nextId.get() <= id)
|
||||
{
|
||||
@@ -95,8 +95,8 @@ public final class CrestTable
|
||||
continue;
|
||||
}
|
||||
|
||||
byte[] data = rs.getBytes("data");
|
||||
CrestType crestType = CrestType.getById(rs.getInt("type"));
|
||||
final byte[] data = rs.getBytes("data");
|
||||
final CrestType crestType = CrestType.getById(rs.getInt("type"));
|
||||
if (crestType != null)
|
||||
{
|
||||
_crests.put(id, new L2Crest(id, data, crestType));
|
||||
|
||||
@@ -99,12 +99,12 @@ public class NpcBufferTable
|
||||
|
||||
while (rset.next())
|
||||
{
|
||||
int npcId = rset.getInt("npc_id");
|
||||
int skillId = rset.getInt("skill_id");
|
||||
int skillLevel = rset.getInt("skill_level");
|
||||
int skillFeeId = rset.getInt("skill_fee_id");
|
||||
int skillFeeAmount = rset.getInt("skill_fee_amount");
|
||||
int buffGroup = rset.getInt("buff_group");
|
||||
final int npcId = rset.getInt("npc_id");
|
||||
final int skillId = rset.getInt("skill_id");
|
||||
final int skillLevel = rset.getInt("skill_level");
|
||||
final int skillFeeId = rset.getInt("skill_fee_id");
|
||||
final int skillFeeAmount = rset.getInt("skill_fee_amount");
|
||||
final int buffGroup = rset.getInt("buff_group");
|
||||
|
||||
if (npcId != lastNpcId)
|
||||
{
|
||||
@@ -145,12 +145,12 @@ public class NpcBufferTable
|
||||
NpcBufferSkills skills = null;
|
||||
while (rset.next())
|
||||
{
|
||||
int npcId = rset.getInt("npc_id");
|
||||
int skillId = rset.getInt("skill_id");
|
||||
int skillLevel = rset.getInt("skill_level");
|
||||
int skillFeeId = rset.getInt("skill_fee_id");
|
||||
int skillFeeAmount = rset.getInt("skill_fee_amount");
|
||||
int buffGroup = rset.getInt("buff_group");
|
||||
final int npcId = rset.getInt("npc_id");
|
||||
final int skillId = rset.getInt("skill_id");
|
||||
final int skillLevel = rset.getInt("skill_level");
|
||||
final int skillFeeId = rset.getInt("skill_fee_id");
|
||||
final int skillFeeAmount = rset.getInt("skill_fee_amount");
|
||||
final int buffGroup = rset.getInt("buff_group");
|
||||
|
||||
if (npcId != lastNpcId)
|
||||
{
|
||||
|
||||
@@ -154,10 +154,10 @@ public class OfflineTradersTable
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
long time = rs.getLong("time");
|
||||
final long time = rs.getLong("time");
|
||||
if (Config.OFFLINE_MAX_DAYS > 0)
|
||||
{
|
||||
Calendar cal = Calendar.getInstance();
|
||||
final Calendar cal = Calendar.getInstance();
|
||||
cal.setTimeInMillis(time);
|
||||
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
|
||||
if (cal.getTimeInMillis() <= System.currentTimeMillis())
|
||||
@@ -166,7 +166,7 @@ public class OfflineTradersTable
|
||||
}
|
||||
}
|
||||
|
||||
PrivateStoreType type = PrivateStoreType.findById(rs.getInt("type"));
|
||||
final PrivateStoreType type = PrivateStoreType.findById(rs.getInt("type"));
|
||||
if (type == null)
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": PrivateStoreType with id " + rs.getInt("type") + " could not be found.");
|
||||
@@ -182,7 +182,7 @@ public class OfflineTradersTable
|
||||
|
||||
try
|
||||
{
|
||||
L2GameClient client = new L2GameClient(null);
|
||||
final L2GameClient client = new L2GameClient(null);
|
||||
client.setDetached(true);
|
||||
player = L2PcInstance.load(rs.getInt("charId"));
|
||||
client.setActiveChar(player);
|
||||
|
||||
@@ -48,7 +48,7 @@ public class PetNameTable
|
||||
PreparedStatement ps = con.prepareStatement("SELECT name FROM pets p, items i WHERE p.item_obj_id = i.object_id AND name=? AND i.item_id IN (?)"))
|
||||
{
|
||||
ps.setString(1, name);
|
||||
StringBuilder cond = new StringBuilder();
|
||||
final StringBuilder cond = new StringBuilder();
|
||||
if (!cond.toString().isEmpty())
|
||||
{
|
||||
cond.append(", ");
|
||||
@@ -87,7 +87,7 @@ public class PetNameTable
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Pet name pattern of config is wrong!");
|
||||
pattern = Pattern.compile(".*");
|
||||
}
|
||||
Matcher regexp = pattern.matcher(name);
|
||||
final Matcher regexp = pattern.matcher(name);
|
||||
if (!regexp.matches())
|
||||
{
|
||||
result = false;
|
||||
@@ -98,7 +98,7 @@ public class PetNameTable
|
||||
private boolean isAlphaNumeric(String text)
|
||||
{
|
||||
boolean result = true;
|
||||
char[] chars = text.toCharArray();
|
||||
final char[] chars = text.toCharArray();
|
||||
for (int i = 0; i < chars.length; i++)
|
||||
{
|
||||
if (!Character.isLetterOrDigit(chars[i]))
|
||||
|
||||
@@ -61,8 +61,8 @@ public class SummonSkillsTable
|
||||
_skillTrees.put(npcId, skillTree);
|
||||
}
|
||||
|
||||
int id = rs.getInt("skillId");
|
||||
int lvl = rs.getInt("skillLvl");
|
||||
final int id = rs.getInt("skillId");
|
||||
final int lvl = rs.getInt("skillLvl");
|
||||
skillTree.put(SkillData.getSkillHashCode(id, lvl + 1), new L2PetSkillLearn(id, lvl, rs.getInt("minLvl")));
|
||||
count++;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class SummonSkillsTable
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Pet id " + cha.getId() + " does not have any skills assigned.");
|
||||
return lvl;
|
||||
}
|
||||
Collection<L2PetSkillLearn> skills = _skillTrees.get(cha.getId()).values();
|
||||
final Collection<L2PetSkillLearn> skills = _skillTrees.get(cha.getId()).values();
|
||||
for (L2PetSkillLearn temp : skills)
|
||||
{
|
||||
if (temp.getId() != skillId)
|
||||
@@ -105,7 +105,7 @@ public class SummonSkillsTable
|
||||
}
|
||||
|
||||
// formula usable for skill that have 10 or more skill levels
|
||||
int maxLvl = SkillData.getInstance().getMaxLevel(temp.getId());
|
||||
final int maxLvl = SkillData.getInstance().getMaxLevel(temp.getId());
|
||||
if (lvl > maxLvl)
|
||||
{
|
||||
lvl = maxLvl;
|
||||
@@ -125,13 +125,13 @@ public class SummonSkillsTable
|
||||
|
||||
public List<Integer> getAvailableSkills(L2Summon cha)
|
||||
{
|
||||
List<Integer> skillIds = new ArrayList<>();
|
||||
final List<Integer> skillIds = new ArrayList<>();
|
||||
if (!_skillTrees.containsKey(cha.getId()))
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Pet id " + cha.getId() + " does not have any skills assigned.");
|
||||
return skillIds;
|
||||
}
|
||||
Collection<L2PetSkillLearn> skills = _skillTrees.get(cha.getId()).values();
|
||||
final Collection<L2PetSkillLearn> skills = _skillTrees.get(cha.getId()).values();
|
||||
for (L2PetSkillLearn temp : skills)
|
||||
{
|
||||
if (skillIds.contains(temp.getId()))
|
||||
|
||||
@@ -80,7 +80,7 @@ public class TerritoryTable
|
||||
{
|
||||
while (rset.next())
|
||||
{
|
||||
int terrId = rset.getInt("loc_id");
|
||||
final int terrId = rset.getInt("loc_id");
|
||||
L2Territory terr = _territory.get(terrId);
|
||||
if (terr == null)
|
||||
{
|
||||
|
||||
@@ -303,7 +303,7 @@ public final class AdminData implements IXmlReader
|
||||
|
||||
for (String name : getAllGmNames(player.isGM()))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.GM_C1);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.GM_C1);
|
||||
sm.addString(name);
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
|
||||
@@ -114,8 +114,8 @@ public final class ArmorSetsData implements IXmlReader
|
||||
}
|
||||
case "shield_skill":
|
||||
{
|
||||
int skillId = parseInteger(attrs, "id");
|
||||
int skillLevel = parseInteger(attrs, "level");
|
||||
final int skillId = parseInteger(attrs, "id");
|
||||
final int skillLevel = parseInteger(attrs, "level");
|
||||
set.addShieldSkill(new SkillHolder(skillId, skillLevel));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class BeautyShopData implements IXmlReader
|
||||
sex = parseEnum(att, Sex.class);
|
||||
}
|
||||
|
||||
BeautyData beautyData = new BeautyData();
|
||||
final BeautyData beautyData = new BeautyData();
|
||||
|
||||
for (Node a = b.getFirstChild(); a != null; a = a.getNextSibling())
|
||||
{
|
||||
@@ -99,7 +99,7 @@ public final class BeautyShopData implements IXmlReader
|
||||
att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
BeautyItem hair = new BeautyItem(set);
|
||||
final BeautyItem hair = new BeautyItem(set);
|
||||
|
||||
for (Node g = a.getFirstChild(); g != null; g = g.getNextSibling())
|
||||
{
|
||||
@@ -126,7 +126,7 @@ public final class BeautyShopData implements IXmlReader
|
||||
att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
BeautyItem face = new BeautyItem(set);
|
||||
final BeautyItem face = new BeautyItem(set);
|
||||
beautyData.addFace(face);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,10 +72,10 @@ public final class BuyListData implements IXmlReader
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
int buyListId = rs.getInt("buylist_id");
|
||||
int itemId = rs.getInt("item_id");
|
||||
long count = rs.getLong("count");
|
||||
long nextRestockTime = rs.getLong("next_restock_time");
|
||||
final int buyListId = rs.getInt("buylist_id");
|
||||
final int itemId = rs.getInt("item_id");
|
||||
final long count = rs.getLong("count");
|
||||
final long nextRestockTime = rs.getLong("next_restock_time");
|
||||
final L2BuyList buyList = getBuyList(buyListId);
|
||||
if (buyList == null)
|
||||
{
|
||||
@@ -121,7 +121,7 @@ public final class BuyListData implements IXmlReader
|
||||
long price = -1;
|
||||
long restockDelay = -1;
|
||||
long count = -1;
|
||||
NamedNodeMap attrs = list_node.getAttributes();
|
||||
final NamedNodeMap attrs = list_node.getAttributes();
|
||||
Node attr = attrs.getNamedItem("id");
|
||||
itemId = Integer.parseInt(attr.getNodeValue());
|
||||
attr = attrs.getNamedItem("price");
|
||||
@@ -155,7 +155,7 @@ public final class BuyListData implements IXmlReader
|
||||
{
|
||||
if ("npc".equalsIgnoreCase(npcs_node.getNodeName()))
|
||||
{
|
||||
int npcId = Integer.parseInt(npcs_node.getTextContent());
|
||||
final int npcId = Integer.parseInt(npcs_node.getTextContent());
|
||||
buyList.addAllowedNpc(npcId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class DailyMissionData implements IXmlReader
|
||||
{
|
||||
if ("mission".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
Node att;
|
||||
id = -1;
|
||||
clientId = 0;
|
||||
@@ -219,7 +219,7 @@ public class DailyMissionData implements IXmlReader
|
||||
*/
|
||||
public List<DailyMissionHolder> getDailyMissions(int classId)
|
||||
{
|
||||
List<DailyMissionHolder> missions = new ArrayList<>();
|
||||
final List<DailyMissionHolder> missions = new ArrayList<>();
|
||||
for (DailyMissionHolder mission : _dailyMissions)
|
||||
{
|
||||
if (mission.getAvailableClasses().contains(classId))
|
||||
@@ -237,7 +237,7 @@ public class DailyMissionData implements IXmlReader
|
||||
*/
|
||||
public List<DailyMissionHolder> getDailyLevelUpMissions(int classId)
|
||||
{
|
||||
List<DailyMissionHolder> missions = new ArrayList<>();
|
||||
final List<DailyMissionHolder> missions = new ArrayList<>();
|
||||
for (DailyMissionHolder mission : _dailyLevelUpMissions)
|
||||
{
|
||||
if (mission.getAvailableClasses().contains(classId))
|
||||
|
||||
@@ -119,8 +119,8 @@ public class DoorData implements IXmlReader
|
||||
private void makeDoor(StatsSet set)
|
||||
{
|
||||
insertCollisionData(set);
|
||||
L2DoorTemplate template = new L2DoorTemplate(set);
|
||||
L2DoorInstance door = new L2DoorInstance(template);
|
||||
final L2DoorTemplate template = new L2DoorTemplate(set);
|
||||
final L2DoorInstance door = new L2DoorInstance(template);
|
||||
door.setCurrentHp(door.getMaxHp());
|
||||
door.spawnMe(template.getX(), template.getY(), template.getZ());
|
||||
putDoor(door, MapRegionManager.getInstance().getMapRegionLocId(door));
|
||||
@@ -218,20 +218,20 @@ public class DoorData implements IXmlReader
|
||||
boolean intersectFace = false;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int j = (i + 1) < 4 ? i + 1 : 0;
|
||||
final int j = (i + 1) < 4 ? i + 1 : 0;
|
||||
// lower part of the multiplier fraction, if it is 0 we avoid an error and also know that the lines are parallel
|
||||
int denominator = ((ty - y) * (doorInst.getX(i) - doorInst.getX(j))) - ((tx - x) * (doorInst.getY(i) - doorInst.getY(j)));
|
||||
final int denominator = ((ty - y) * (doorInst.getX(i) - doorInst.getX(j))) - ((tx - x) * (doorInst.getY(i) - doorInst.getY(j)));
|
||||
if (denominator == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// multipliers to the equations of the lines. If they are lower than 0 or bigger than 1, we know that segments don't intersect
|
||||
float multiplier1 = (float) (((doorInst.getX(j) - doorInst.getX(i)) * (y - doorInst.getY(i))) - ((doorInst.getY(j) - doorInst.getY(i)) * (x - doorInst.getX(i)))) / denominator;
|
||||
float multiplier2 = (float) (((tx - x) * (y - doorInst.getY(i))) - ((ty - y) * (x - doorInst.getX(i)))) / denominator;
|
||||
final float multiplier1 = (float) (((doorInst.getX(j) - doorInst.getX(i)) * (y - doorInst.getY(i))) - ((doorInst.getY(j) - doorInst.getY(i)) * (x - doorInst.getX(i)))) / denominator;
|
||||
final float multiplier2 = (float) (((tx - x) * (y - doorInst.getY(i))) - ((ty - y) * (x - doorInst.getX(i)))) / denominator;
|
||||
if ((multiplier1 >= 0) && (multiplier1 <= 1) && (multiplier2 >= 0) && (multiplier2 <= 1))
|
||||
{
|
||||
int intersectZ = Math.round(z + (multiplier1 * (tz - z)));
|
||||
final int intersectZ = Math.round(z + (multiplier1 * (tz - z)));
|
||||
// now checking if the resulting point is between door's min and max z
|
||||
if ((intersectZ > doorInst.getZMin()) && (intersectZ < doorInst.getZMax()))
|
||||
{
|
||||
|
||||
@@ -75,13 +75,13 @@ public final class EnchantItemGroupsData implements IXmlReader
|
||||
{
|
||||
if ("current".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
String range = parseString(cd.getAttributes(), "enchant");
|
||||
double chance = parseDouble(cd.getAttributes(), "chance");
|
||||
final String range = parseString(cd.getAttributes(), "enchant");
|
||||
final double chance = parseDouble(cd.getAttributes(), "chance");
|
||||
int min = -1;
|
||||
int max = 0;
|
||||
if (range.contains("-"))
|
||||
{
|
||||
String[] split = range.split("-");
|
||||
final String[] split = range.split("-");
|
||||
if ((split.length == 2) && Util.isDigit(split[0]) && Util.isDigit(split[1]))
|
||||
{
|
||||
min = Integer.parseInt(split[0]);
|
||||
@@ -103,7 +103,7 @@ public final class EnchantItemGroupsData implements IXmlReader
|
||||
}
|
||||
else if ("enchantScrollGroup".equals(d.getNodeName()))
|
||||
{
|
||||
int id = parseInteger(d.getAttributes(), "id");
|
||||
final int id = parseInteger(d.getAttributes(), "id");
|
||||
final EnchantScrollGroup group = new EnchantScrollGroup(id);
|
||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ public class EnchantItemHPBonusData implements IXmlReader
|
||||
final Collection<Integer> armorIds = it.getAllArmorsId();
|
||||
for (Integer itemId : armorIds)
|
||||
{
|
||||
L2Item item = it.getTemplate(itemId);
|
||||
final L2Item item = it.getTemplate(itemId);
|
||||
if ((item != null) && (item.getCrystalType() != CrystalType.NONE))
|
||||
{
|
||||
switch (item.getBodyPart())
|
||||
|
||||
@@ -61,7 +61,7 @@ public class EnchantItemOptionsData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
int itemId = parseInteger(d.getAttributes(), "id");
|
||||
final int itemId = parseInteger(d.getAttributes(), "id");
|
||||
if (!_data.containsKey(itemId))
|
||||
{
|
||||
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
|
||||
|
||||
@@ -112,11 +112,11 @@ public class EnchantSkillGroupsData implements IXmlReader
|
||||
if ("enchant".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
attrs = b.getAttributes();
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node att = attrs.item(i);
|
||||
final Node att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
group.addEnchantDetail(new EnchantSkillHolder(set));
|
||||
|
||||
@@ -80,7 +80,7 @@ public final class ExperienceData implements IXmlReader
|
||||
{
|
||||
if ("experience".equals(n.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = n.getAttributes();
|
||||
final NamedNodeMap attrs = n.getAttributes();
|
||||
maxLevel = parseInteger(attrs, "level");
|
||||
if (maxLevel > Config.PLAYER_MAXIMUM_LEVEL)
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ public final class HitConditionBonusData implements IXmlReader
|
||||
{
|
||||
for (Node d = doc.getFirstChild().getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
switch (d.getNodeName())
|
||||
{
|
||||
case "front":
|
||||
|
||||
@@ -95,7 +95,7 @@ public final class InitialEquipmentData implements IXmlReader
|
||||
attrs = c.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node attr = attrs.item(i);
|
||||
final Node attr = attrs.item(i);
|
||||
set.set(attr.getNodeName(), attr.getNodeValue());
|
||||
}
|
||||
equipList.add(new PcItemTemplate(set));
|
||||
|
||||
@@ -66,7 +66,7 @@ public final class ItemCrystalizationData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = c.getAttributes();
|
||||
final NamedNodeMap attrs = c.getAttributes();
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final long itemCount = parseLong(attrs, "count");
|
||||
final double itemChance = parseDouble(attrs, "chance");
|
||||
|
||||
@@ -62,7 +62,7 @@ public class KarmaData implements IXmlReader
|
||||
if ("increase".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
int level = parseInteger(attrs, "lvl");
|
||||
final int level = parseInteger(attrs, "lvl");
|
||||
if (level >= Config.PLAYER_MAXIMUM_LEVEL)
|
||||
{
|
||||
break;
|
||||
|
||||
@@ -64,8 +64,8 @@ public class LuckyGameData implements IXmlReader
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
{
|
||||
NamedNodeMap at = n.getAttributes();
|
||||
Node attribute = at.getNamedItem("enabled");
|
||||
final NamedNodeMap at = n.getAttributes();
|
||||
final Node attribute = at.getNamedItem("enabled");
|
||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue())) // <list enabled="true"
|
||||
{
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
@@ -76,7 +76,7 @@ public class LuckyGameData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = b.getAttributes();
|
||||
final NamedNodeMap attrs = b.getAttributes();
|
||||
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final int count = parseInteger(attrs, "count");
|
||||
@@ -97,7 +97,7 @@ public class LuckyGameData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = b.getAttributes();
|
||||
final NamedNodeMap attrs = b.getAttributes();
|
||||
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final int count = parseInteger(attrs, "count");
|
||||
@@ -118,7 +118,7 @@ public class LuckyGameData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = b.getAttributes();
|
||||
final NamedNodeMap attrs = b.getAttributes();
|
||||
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final int count = parseInteger(attrs, "count");
|
||||
|
||||
@@ -84,7 +84,7 @@ public final class MultisellData implements IXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
int id = Integer.parseInt(f.getName().replaceAll(".xml", ""));
|
||||
final int id = Integer.parseInt(f.getName().replaceAll(".xml", ""));
|
||||
int entryId = 1;
|
||||
Node att;
|
||||
final ListContainer list = new ListContainer(id);
|
||||
@@ -132,7 +132,7 @@ public final class MultisellData implements IXmlReader
|
||||
{
|
||||
if ("item".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
Entry e = parseEntry(d, entryId++, list);
|
||||
final Entry e = parseEntry(d, entryId++, list);
|
||||
list.getEntries().add(e);
|
||||
}
|
||||
else if ("npcs".equalsIgnoreCase(d.getNodeName()))
|
||||
@@ -167,7 +167,7 @@ public final class MultisellData implements IXmlReader
|
||||
|
||||
private final Entry parseEntry(Node n, int entryId, ListContainer list)
|
||||
{
|
||||
Node first = n.getFirstChild();
|
||||
final Node first = n.getFirstChild();
|
||||
final Entry entry = new Entry(entryId);
|
||||
|
||||
NamedNodeMap attrs;
|
||||
@@ -234,7 +234,7 @@ public final class MultisellData implements IXmlReader
|
||||
*/
|
||||
public final void separateAndSend(int listId, L2PcInstance player, L2Npc npc, boolean inventoryOnly, double productMultiplier, double ingredientMultiplier)
|
||||
{
|
||||
ListContainer template = _entries.get(listId);
|
||||
final ListContainer template = _entries.get(listId);
|
||||
if (template == null)
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Cannot find list ID: " + listId + " requested by player: " + player.getName() + ", NPC ID:" + (npc != null ? npc.getId() : 0));
|
||||
@@ -330,14 +330,14 @@ public final class MultisellData implements IXmlReader
|
||||
case PC_BANG_POINTS: // PcBang points
|
||||
final int cost = player.getPcBangPoints() - (int) (amount);
|
||||
player.setPcBangPoints(cost);
|
||||
SystemMessage smsgpc = SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_USING_S1_POINT);
|
||||
final SystemMessage smsgpc = SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_USING_S1_POINT);
|
||||
smsgpc.addLong((int) amount);
|
||||
player.sendPacket(smsgpc);
|
||||
player.sendPacket(new ExPCCafePointInfo(player.getPcBangPoints(), (int) amount, 1));
|
||||
return true;
|
||||
case CLAN_REPUTATION:
|
||||
player.getClan().takeReputationScore((int) amount, true);
|
||||
SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
final SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
smsg.addLong(amount);
|
||||
player.sendPacket(smsg);
|
||||
return true;
|
||||
|
||||
@@ -236,7 +236,7 @@ public class NpcData implements IXmlReader
|
||||
{
|
||||
case "attack":
|
||||
{
|
||||
String attackAttributeType = parseString(attrs, "type");
|
||||
final String attackAttributeType = parseString(attrs, "type");
|
||||
switch (attackAttributeType.toUpperCase())
|
||||
{
|
||||
case "FIRE":
|
||||
@@ -441,7 +441,7 @@ public class NpcData implements IXmlReader
|
||||
dropLists = new EnumMap<>(DropListScope.class);
|
||||
}
|
||||
|
||||
List<IDropItem> dropList = new ArrayList<>();
|
||||
final List<IDropItem> dropList = new ArrayList<>();
|
||||
parseDropList(f, dropListsNode, dropListScope, dropList);
|
||||
dropLists.put(dropListScope, Collections.unmodifiableList(dropList));
|
||||
}
|
||||
@@ -629,19 +629,19 @@ public class NpcData implements IXmlReader
|
||||
{
|
||||
for (Node dropNode = dropListNode.getFirstChild(); dropNode != null; dropNode = dropNode.getNextSibling())
|
||||
{
|
||||
NamedNodeMap attrs = dropNode.getAttributes();
|
||||
final NamedNodeMap attrs = dropNode.getAttributes();
|
||||
switch (dropNode.getNodeName().toLowerCase())
|
||||
{
|
||||
case "group":
|
||||
{
|
||||
GroupedGeneralDropItem dropItem = dropListScope.newGroupedDropItem(parseDouble(attrs, "chance"));
|
||||
List<IDropItem> groupedDropList = new ArrayList<>(2);
|
||||
final GroupedGeneralDropItem dropItem = dropListScope.newGroupedDropItem(parseDouble(attrs, "chance"));
|
||||
final List<IDropItem> groupedDropList = new ArrayList<>(2);
|
||||
for (Node groupNode = dropNode.getFirstChild(); groupNode != null; groupNode = groupNode.getNextSibling())
|
||||
{
|
||||
parseDropListItem(groupNode, dropListScope, groupedDropList);
|
||||
}
|
||||
|
||||
List<GeneralDropItem> items = new ArrayList<>(groupedDropList.size());
|
||||
final List<GeneralDropItem> items = new ArrayList<>(groupedDropList.size());
|
||||
for (IDropItem item : groupedDropList)
|
||||
{
|
||||
if (item instanceof GeneralDropItem)
|
||||
@@ -669,7 +669,7 @@ public class NpcData implements IXmlReader
|
||||
|
||||
private void parseDropListItem(Node dropListItem, DropListScope dropListScope, List<IDropItem> drops)
|
||||
{
|
||||
NamedNodeMap attrs = dropListItem.getAttributes();
|
||||
final NamedNodeMap attrs = dropListItem.getAttributes();
|
||||
switch (dropListItem.getNodeName().toLowerCase())
|
||||
{
|
||||
case "item":
|
||||
@@ -707,7 +707,7 @@ public class NpcData implements IXmlReader
|
||||
*/
|
||||
public int getClanId(String clanName)
|
||||
{
|
||||
Integer id = _clans.get(clanName.toUpperCase());
|
||||
final Integer id = _clans.get(clanName.toUpperCase());
|
||||
return id != null ? id : -1;
|
||||
}
|
||||
|
||||
@@ -839,7 +839,7 @@ public class NpcData implements IXmlReader
|
||||
{
|
||||
final List<MinionHolder> minions = new ArrayList<>(1);
|
||||
NamedNodeMap attrs = listNode.getAttributes();
|
||||
int id = parseInteger(attrs, "id");
|
||||
final int id = parseInteger(attrs, "id");
|
||||
for (Node npcNode = listNode.getFirstChild(); npcNode != null; npcNode = npcNode.getNextSibling())
|
||||
{
|
||||
if ("minion".equals(npcNode.getNodeName()))
|
||||
|
||||
@@ -131,8 +131,8 @@ public class OptionData implements IXmlReader
|
||||
|
||||
private void parseFuncs(NamedNodeMap attrs, String functionName, Options op)
|
||||
{
|
||||
Stats stat = Stats.valueOfXml(parseString(attrs, "stat"));
|
||||
double val = parseDouble(attrs, "val");
|
||||
final Stats stat = Stats.valueOfXml(parseString(attrs, "stat"));
|
||||
final double val = parseDouble(attrs, "val");
|
||||
int order = -1;
|
||||
final Node orderNode = attrs.getNamedItem("order");
|
||||
if (orderNode != null)
|
||||
|
||||
@@ -60,21 +60,21 @@ public final class PetDataTable implements IXmlReader
|
||||
public void parseDocument(Document doc)
|
||||
{
|
||||
NamedNodeMap attrs;
|
||||
Node n = doc.getFirstChild();
|
||||
final Node n = doc.getFirstChild();
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
if (d.getNodeName().equals("pet"))
|
||||
{
|
||||
int npcId = parseInteger(d.getAttributes(), "id");
|
||||
int itemId = parseInteger(d.getAttributes(), "itemId");
|
||||
final int npcId = parseInteger(d.getAttributes(), "id");
|
||||
final int itemId = parseInteger(d.getAttributes(), "itemId");
|
||||
// index ignored for now
|
||||
L2PetData data = new L2PetData(npcId, itemId);
|
||||
final L2PetData data = new L2PetData(npcId, itemId);
|
||||
for (Node p = d.getFirstChild(); p != null; p = p.getNextSibling())
|
||||
{
|
||||
if (p.getNodeName().equals("set"))
|
||||
{
|
||||
attrs = p.getAttributes();
|
||||
String type = attrs.getNamedItem("name").getNodeValue();
|
||||
final String type = attrs.getNamedItem("name").getNodeValue();
|
||||
if ("food".equals(type))
|
||||
{
|
||||
for (String foodId : attrs.getNamedItem("val").getNodeValue().split(";"))
|
||||
|
||||
@@ -79,9 +79,9 @@ public final class PlayerTemplateData implements IXmlReader
|
||||
}
|
||||
else if ("staticData".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
set.set("classId", classId);
|
||||
List<Location> creationPoints = new ArrayList<>();
|
||||
final List<Location> creationPoints = new ArrayList<>();
|
||||
|
||||
for (Node nd = d.getFirstChild(); nd != null; nd = nd.getNextSibling())
|
||||
{
|
||||
@@ -152,10 +152,10 @@ public final class PlayerTemplateData implements IXmlReader
|
||||
if ("level".equalsIgnoreCase(lvlNode.getNodeName()))
|
||||
{
|
||||
attrs = lvlNode.getAttributes();
|
||||
int level = parseInteger(attrs, "val");
|
||||
final int level = parseInteger(attrs, "val");
|
||||
for (Node valNode = lvlNode.getFirstChild(); valNode != null; valNode = valNode.getNextSibling())
|
||||
{
|
||||
String nodeName = valNode.getNodeName();
|
||||
final String nodeName = valNode.getNodeName();
|
||||
|
||||
if ((level < Config.PLAYER_MAXIMUM_LEVEL) && (nodeName.startsWith("hp") || nodeName.startsWith("mp") || nodeName.startsWith("cp")) && _playerTemplates.containsKey(ClassId.getClassId(classId)))
|
||||
{
|
||||
|
||||
@@ -58,8 +58,8 @@ public final class PlayerXpPercentLostData implements IXmlReader
|
||||
{
|
||||
if ("xpLost".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
Integer level = parseInteger(attrs, "level");
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
final Integer level = parseInteger(attrs, "level");
|
||||
if (level > _maxlevel)
|
||||
{
|
||||
break;
|
||||
|
||||
@@ -71,8 +71,8 @@ public class PrimeShopData implements IXmlReader
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
{
|
||||
NamedNodeMap at = n.getAttributes();
|
||||
Node attribute = at.getNamedItem("enabled");
|
||||
final NamedNodeMap at = n.getAttributes();
|
||||
final Node attribute = at.getNamedItem("enabled");
|
||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue()))
|
||||
{
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
@@ -81,14 +81,14 @@ public class PrimeShopData implements IXmlReader
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
Node att;
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
|
||||
List<PrimeShopItem> items = new ArrayList<>();
|
||||
final List<PrimeShopItem> items = new ArrayList<>();
|
||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
||||
{
|
||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
||||
|
||||
@@ -76,11 +76,11 @@ public class RecipeData implements IXmlReader
|
||||
recipePartList.clear();
|
||||
recipeStatUseList.clear();
|
||||
recipeAltStatChangeList.clear();
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
Node att;
|
||||
int id = -1;
|
||||
boolean haveRare = false;
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
|
||||
att = attrs.getNamedItem("id");
|
||||
if (att == null)
|
||||
@@ -135,8 +135,8 @@ public class RecipeData implements IXmlReader
|
||||
{
|
||||
if ("statUse".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
String statName = c.getAttributes().getNamedItem("name").getNodeValue();
|
||||
int value = Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());
|
||||
final String statName = c.getAttributes().getNamedItem("name").getNodeValue();
|
||||
final int value = Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());
|
||||
try
|
||||
{
|
||||
recipeStatUseList.add(new L2RecipeStatInstance(statName, value));
|
||||
@@ -149,8 +149,8 @@ public class RecipeData implements IXmlReader
|
||||
}
|
||||
else if ("altStatChange".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
String statName = c.getAttributes().getNamedItem("name").getNodeValue();
|
||||
int value = Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());
|
||||
final String statName = c.getAttributes().getNamedItem("name").getNodeValue();
|
||||
final int value = Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());
|
||||
try
|
||||
{
|
||||
recipeAltStatChangeList.add(new L2RecipeStatInstance(statName, value));
|
||||
@@ -163,8 +163,8 @@ public class RecipeData implements IXmlReader
|
||||
}
|
||||
else if ("ingredient".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
int ingId = Integer.parseInt(c.getAttributes().getNamedItem("id").getNodeValue());
|
||||
int ingCount = Integer.parseInt(c.getAttributes().getNamedItem("count").getNodeValue());
|
||||
final int ingId = Integer.parseInt(c.getAttributes().getNamedItem("id").getNodeValue());
|
||||
final int ingCount = Integer.parseInt(c.getAttributes().getNamedItem("count").getNodeValue());
|
||||
recipePartList.add(new L2RecipeInstance(ingId, ingCount));
|
||||
}
|
||||
else if ("production".equalsIgnoreCase(c.getNodeName()))
|
||||
@@ -181,7 +181,7 @@ public class RecipeData implements IXmlReader
|
||||
}
|
||||
}
|
||||
|
||||
L2RecipeList recipeList = new L2RecipeList(set, haveRare);
|
||||
final L2RecipeList recipeList = new L2RecipeList(set, haveRare);
|
||||
for (L2RecipeInstance recipePart : recipePartList)
|
||||
{
|
||||
recipeList.addRecipe(recipePart);
|
||||
@@ -235,7 +235,7 @@ public class RecipeData implements IXmlReader
|
||||
*/
|
||||
public int[] getAllItemIds()
|
||||
{
|
||||
int[] idList = new int[_recipes.size()];
|
||||
final int[] idList = new int[_recipes.size()];
|
||||
int i = 0;
|
||||
for (L2RecipeList rec : _recipes.values())
|
||||
{
|
||||
@@ -252,7 +252,7 @@ public class RecipeData implements IXmlReader
|
||||
*/
|
||||
public L2RecipeList getValidRecipeList(L2PcInstance player, int id)
|
||||
{
|
||||
L2RecipeList recipeList = _recipes.get(id);
|
||||
final L2RecipeList recipeList = _recipes.get(id);
|
||||
if ((recipeList == null) || (recipeList.getRecipes().length == 0))
|
||||
{
|
||||
player.sendMessage(getClass().getSimpleName() + ": No recipe for: " + id);
|
||||
|
||||
@@ -110,7 +110,7 @@ public final class ShuttleData implements IXmlReader
|
||||
if ("stop".equalsIgnoreCase(a.getNodeName()))
|
||||
{
|
||||
attrs = a.getAttributes();
|
||||
L2ShuttleStop stop = new L2ShuttleStop(parseInteger(attrs, "id"));
|
||||
final L2ShuttleStop stop = new L2ShuttleStop(parseInteger(attrs, "id"));
|
||||
|
||||
for (Node z = a.getFirstChild(); z != null; z = z.getNextSibling())
|
||||
{
|
||||
@@ -131,7 +131,7 @@ public final class ShuttleData implements IXmlReader
|
||||
if ("route".equalsIgnoreCase(a.getNodeName()))
|
||||
{
|
||||
attrs = a.getAttributes();
|
||||
List<Location> locs = new ArrayList<>();
|
||||
final List<Location> locs = new ArrayList<>();
|
||||
for (Node z = a.getFirstChild(); z != null; z = z.getNextSibling())
|
||||
{
|
||||
if ("loc".equalsIgnoreCase(z.getNodeName()))
|
||||
@@ -141,7 +141,7 @@ public final class ShuttleData implements IXmlReader
|
||||
}
|
||||
}
|
||||
|
||||
VehiclePathPoint[] route = new VehiclePathPoint[locs.size()];
|
||||
final VehiclePathPoint[] route = new VehiclePathPoint[locs.size()];
|
||||
int i = 0;
|
||||
for (Location loc : locs)
|
||||
{
|
||||
|
||||
@@ -75,8 +75,8 @@ public class SiegeScheduleData implements IXmlReader
|
||||
final NamedNodeMap attrs = cd.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node node = attrs.item(i);
|
||||
String key = node.getNodeName();
|
||||
final Node node = attrs.item(i);
|
||||
final String key = node.getNodeName();
|
||||
String val = node.getNodeValue();
|
||||
if ("day".equals(key))
|
||||
{
|
||||
|
||||
@@ -773,13 +773,13 @@ public final class SkillTreesData implements IXmlReader
|
||||
public Collection<Skill> getAllAvailableSkills(L2PcInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||
{
|
||||
// Get available skills
|
||||
PlayerSkillHolder holder = new PlayerSkillHolder(player);
|
||||
final PlayerSkillHolder holder = new PlayerSkillHolder(player);
|
||||
List<L2SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
||||
while (learnable.size() > 0)
|
||||
{
|
||||
for (L2SkillLearn s : learnable)
|
||||
{
|
||||
Skill sk = SkillData.getInstance().getSkill(s.getSkillId(), s.getSkillLevel());
|
||||
final Skill sk = SkillData.getInstance().getSkill(s.getSkillId(), s.getSkillLevel());
|
||||
holder.addSkill(sk);
|
||||
}
|
||||
|
||||
@@ -894,7 +894,7 @@ public final class SkillTreesData implements IXmlReader
|
||||
public List<L2SkillLearn> getAvailableRevelationSkills(L2PcInstance player, SubclassType type)
|
||||
{
|
||||
final List<L2SkillLearn> result = new ArrayList<>();
|
||||
Map<Integer, L2SkillLearn> revelationSkills = _revelationSkillTree.get(type);
|
||||
final Map<Integer, L2SkillLearn> revelationSkills = _revelationSkillTree.get(type);
|
||||
|
||||
for (L2SkillLearn skill : revelationSkills.values())
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class StaticObjectData implements IXmlReader
|
||||
*/
|
||||
private void addObject(StatsSet set)
|
||||
{
|
||||
L2StaticObjectInstance obj = new L2StaticObjectInstance(new L2CharTemplate(new StatsSet()), set.getInt("id"));
|
||||
final L2StaticObjectInstance obj = new L2StaticObjectInstance(new L2CharTemplate(new StatsSet()), set.getInt("id"));
|
||||
obj.setType(set.getInt("type", 0));
|
||||
obj.setName(set.getString("name"));
|
||||
obj.setMap(set.getString("texture", "none"), set.getInt("map_x", 0), set.getInt("map_y", 0));
|
||||
|
||||
@@ -70,16 +70,16 @@ public final class TransformData implements IXmlReader
|
||||
if ("transform".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node att = attrs.item(i);
|
||||
final Node att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
final Transform transform = new Transform(set);
|
||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||
{
|
||||
boolean isMale = "Male".equalsIgnoreCase(cd.getNodeName());
|
||||
final boolean isMale = "Male".equalsIgnoreCase(cd.getNodeName());
|
||||
if ("Male".equalsIgnoreCase(cd.getNodeName()) || "Female".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
TransformTemplate templateData = null;
|
||||
@@ -103,7 +103,7 @@ public final class TransformData implements IXmlReader
|
||||
attrs = s.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node att = attrs.item(i);
|
||||
final Node att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
break;
|
||||
@@ -126,8 +126,8 @@ public final class TransformData implements IXmlReader
|
||||
if ("skill".equals(s.getNodeName()))
|
||||
{
|
||||
attrs = s.getAttributes();
|
||||
int skillId = parseInteger(attrs, "id");
|
||||
int skillLevel = parseInteger(attrs, "level");
|
||||
final int skillId = parseInteger(attrs, "id");
|
||||
final int skillLevel = parseInteger(attrs, "level");
|
||||
templateData.addSkill(new SkillHolder(skillId, skillLevel));
|
||||
}
|
||||
}
|
||||
@@ -157,9 +157,9 @@ public final class TransformData implements IXmlReader
|
||||
if ("skill".equals(s.getNodeName()))
|
||||
{
|
||||
attrs = s.getAttributes();
|
||||
int skillId = parseInteger(attrs, "id");
|
||||
int skillLevel = parseInteger(attrs, "level");
|
||||
int minLevel = parseInteger(attrs, "minLevel");
|
||||
final int skillId = parseInteger(attrs, "id");
|
||||
final int skillLevel = parseInteger(attrs, "level");
|
||||
final int minLevel = parseInteger(attrs, "minLevel");
|
||||
templateData.addAdditionalSkill(new AdditionalSkillHolder(skillId, skillLevel, minLevel));
|
||||
}
|
||||
}
|
||||
@@ -177,8 +177,8 @@ public final class TransformData implements IXmlReader
|
||||
if ("item".equals(s.getNodeName()))
|
||||
{
|
||||
attrs = s.getAttributes();
|
||||
int itemId = parseInteger(attrs, "id");
|
||||
boolean allowed = parseBoolean(attrs, "allowed");
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final boolean allowed = parseBoolean(attrs, "allowed");
|
||||
templateData.addAdditionalItem(new AdditionalItemHolder(itemId, allowed));
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public final class TransformData implements IXmlReader
|
||||
attrs = s.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
Node att = attrs.item(i);
|
||||
final Node att = attrs.item(i);
|
||||
levelsSet.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user