Added missing final modifiers.
This commit is contained in:
@@ -53,7 +53,7 @@ public class AirShipManager
|
||||
|
||||
protected AirShipManager()
|
||||
{
|
||||
StatsSet npcDat = new StatsSet();
|
||||
final StatsSet npcDat = new StatsSet();
|
||||
npcDat.set("npcId", 9);
|
||||
npcDat.set("level", 0);
|
||||
npcDat.set("jClass", "boat");
|
||||
@@ -223,7 +223,7 @@ public class AirShipManager
|
||||
return;
|
||||
}
|
||||
|
||||
int dockId = ship.getDockId();
|
||||
final int dockId = ship.getDockId();
|
||||
if (!_teleports.containsKey(dockId))
|
||||
{
|
||||
return;
|
||||
@@ -292,7 +292,7 @@ public class AirShipManager
|
||||
|
||||
private void storeInDb(int ownerId)
|
||||
{
|
||||
StatsSet info = _airShipsInfo.get(ownerId);
|
||||
final StatsSet info = _airShipsInfo.get(ownerId);
|
||||
if (info == null)
|
||||
{
|
||||
return;
|
||||
|
@@ -59,7 +59,7 @@ public class BoatManager
|
||||
return null;
|
||||
}
|
||||
|
||||
StatsSet npcDat = new StatsSet();
|
||||
final StatsSet npcDat = new StatsSet();
|
||||
npcDat.set("npcId", boatId);
|
||||
npcDat.set("level", 0);
|
||||
npcDat.set("jClass", "boat");
|
||||
|
@@ -64,7 +64,7 @@ public final class CHSiegeManager
|
||||
{
|
||||
final int id = rs.getInt("clanHallId");
|
||||
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
|
||||
set.set("id", id);
|
||||
set.set("name", rs.getString("name"));
|
||||
@@ -74,7 +74,7 @@ public final class CHSiegeManager
|
||||
set.set("nextSiege", rs.getLong("nextSiege"));
|
||||
set.set("siegeLenght", rs.getLong("siegeLenght"));
|
||||
set.set("scheduleConfig", rs.getString("schedule_config"));
|
||||
SiegableHall hall = new SiegableHall(set);
|
||||
final SiegableHall hall = new SiegableHall(set);
|
||||
_siegableHalls.put(id, hall);
|
||||
ClanHallManager.addClanHall(hall);
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public final class CHSiegeManager
|
||||
|
||||
public final ClanHallSiegeEngine getSiege(L2Character character)
|
||||
{
|
||||
SiegableHall hall = getNearbyClanHall(character);
|
||||
final SiegableHall hall = getNearbyClanHall(character);
|
||||
if (hall == null)
|
||||
{
|
||||
return null;
|
||||
@@ -134,7 +134,7 @@ public final class CHSiegeManager
|
||||
}
|
||||
else if (hall.isWaitingBattle())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DEADLINE_TO_REGISTER_FOR_THE_SIEGE_OF_S1_HAS_PASSED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DEADLINE_TO_REGISTER_FOR_THE_SIEGE_OF_S1_HAS_PASSED);
|
||||
sm.addString(hall.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
|
@@ -225,8 +225,8 @@ public final class CastleManager implements InstanceListManager
|
||||
{
|
||||
return;
|
||||
}
|
||||
L2PcInstance player = member.getPlayerInstance();
|
||||
int circletId = getCircletByCastleId(castleId);
|
||||
final L2PcInstance player = member.getPlayerInstance();
|
||||
final int circletId = getCircletByCastleId(castleId);
|
||||
|
||||
if (circletId != 0)
|
||||
{
|
||||
@@ -235,7 +235,7 @@ public final class CastleManager implements InstanceListManager
|
||||
{
|
||||
try
|
||||
{
|
||||
L2ItemInstance circlet = player.getInventory().getItemByItemId(circletId);
|
||||
final L2ItemInstance circlet = player.getInventory().getItemByItemId(circletId);
|
||||
if (circlet != null)
|
||||
{
|
||||
if (circlet.isEquipped())
|
||||
@@ -293,7 +293,7 @@ public final class CastleManager implements InstanceListManager
|
||||
@Override
|
||||
public void activateInstances()
|
||||
{
|
||||
for (final Castle castle : _castles)
|
||||
for (Castle castle : _castles)
|
||||
{
|
||||
castle.activateInstance();
|
||||
}
|
||||
|
@@ -118,7 +118,7 @@ public final class ClanHallAuctionManager
|
||||
|
||||
public final Auction getAuction(int auctionId)
|
||||
{
|
||||
int index = getAuctionIndex(auctionId);
|
||||
final int index = getAuctionIndex(auctionId);
|
||||
if (index >= 0)
|
||||
{
|
||||
return _auctions.get(index);
|
||||
|
@@ -71,7 +71,7 @@ public final class ClanHallManager
|
||||
int id, ownerId, lease;
|
||||
while (rs.next())
|
||||
{
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
|
||||
id = rs.getInt("id");
|
||||
ownerId = rs.getInt("ownerId");
|
||||
@@ -86,7 +86,7 @@ public final class ClanHallManager
|
||||
set.set("paidUntil", rs.getLong("paidUntil"));
|
||||
set.set("grade", rs.getInt("Grade"));
|
||||
set.set("paid", rs.getBoolean("paid"));
|
||||
AuctionableHall ch = new AuctionableHall(set);
|
||||
final AuctionableHall ch = new AuctionableHall(set);
|
||||
_allAuctionableClanHalls.put(id, ch);
|
||||
addClanHall(ch);
|
||||
|
||||
@@ -97,7 +97,7 @@ public final class ClanHallManager
|
||||
}
|
||||
_freeClanHall.put(id, ch);
|
||||
|
||||
Auction auc = ClanHallAuctionManager.getInstance().getAuction(id);
|
||||
final Auction auc = ClanHallAuctionManager.getInstance().getAuction(id);
|
||||
if ((auc == null) && (lease > 0))
|
||||
{
|
||||
ClanHallAuctionManager.getInstance().initNPC(id);
|
||||
|
@@ -71,7 +71,7 @@ public final class CoupleManager
|
||||
|
||||
public final Couple getCouple(int coupleId)
|
||||
{
|
||||
int index = getCoupleIndex(coupleId);
|
||||
final int index = getCoupleIndex(coupleId);
|
||||
if (index >= 0)
|
||||
{
|
||||
return getCouples().get(index);
|
||||
@@ -85,10 +85,10 @@ public final class CoupleManager
|
||||
{
|
||||
if ((player1.getPartnerId() == 0) && (player2.getPartnerId() == 0))
|
||||
{
|
||||
int player1id = player1.getObjectId();
|
||||
int player2id = player2.getObjectId();
|
||||
final int player1id = player1.getObjectId();
|
||||
final int player2id = player2.getObjectId();
|
||||
|
||||
Couple couple = new Couple(player1, player2);
|
||||
final Couple couple = new Couple(player1, player2);
|
||||
getCouples().add(couple);
|
||||
player1.setPartnerId(player2id);
|
||||
player2.setPartnerId(player1id);
|
||||
@@ -100,12 +100,12 @@ public final class CoupleManager
|
||||
|
||||
public void deleteCouple(int coupleId)
|
||||
{
|
||||
int index = getCoupleIndex(coupleId);
|
||||
Couple couple = getCouples().get(index);
|
||||
final int index = getCoupleIndex(coupleId);
|
||||
final Couple couple = getCouples().get(index);
|
||||
if (couple != null)
|
||||
{
|
||||
L2PcInstance player1 = L2World.getInstance().getPlayer(couple.getPlayer1Id());
|
||||
L2PcInstance player2 = L2World.getInstance().getPlayer(couple.getPlayer2Id());
|
||||
final L2PcInstance player1 = L2World.getInstance().getPlayer(couple.getPlayer1Id());
|
||||
final L2PcInstance player2 = L2World.getInstance().getPlayer(couple.getPlayer2Id());
|
||||
if (player1 != null)
|
||||
{
|
||||
player1.setPartnerId(0);
|
||||
|
@@ -92,18 +92,18 @@ public final class CursedWeaponsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setValidating(false);
|
||||
factory.setIgnoringComments(true);
|
||||
|
||||
File file = new File(Config.DATAPACK_ROOT + "/cursedWeapons.xml");
|
||||
final File file = new File(Config.DATAPACK_ROOT + "/cursedWeapons.xml");
|
||||
if (!file.exists())
|
||||
{
|
||||
_log.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't find " + file.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
Document doc = factory.newDocumentBuilder().parse(file);
|
||||
final Document doc = factory.newDocumentBuilder().parse(file);
|
||||
|
||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
||||
{
|
||||
@@ -114,11 +114,11 @@ public final class CursedWeaponsManager
|
||||
if ("item".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
int id = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
|
||||
int skillId = Integer.parseInt(attrs.getNamedItem("skillId").getNodeValue());
|
||||
String name = attrs.getNamedItem("name").getNodeValue();
|
||||
final int id = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
|
||||
final int skillId = Integer.parseInt(attrs.getNamedItem("skillId").getNodeValue());
|
||||
final String name = attrs.getNamedItem("name").getNodeValue();
|
||||
|
||||
CursedWeapon cw = new CursedWeapon(id, skillId, name);
|
||||
final CursedWeapon cw = new CursedWeapon(id, skillId, name);
|
||||
|
||||
int val;
|
||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||
@@ -284,10 +284,10 @@ public final class CursedWeaponsManager
|
||||
|
||||
public void activate(L2PcInstance player, L2ItemInstance item)
|
||||
{
|
||||
CursedWeapon cw = _cursedWeapons.get(item.getId());
|
||||
final CursedWeapon cw = _cursedWeapons.get(item.getId());
|
||||
if (player.isCursedWeaponEquipped()) // cannot own 2 cursed swords
|
||||
{
|
||||
CursedWeapon cw2 = _cursedWeapons.get(player.getCursedWeaponEquippedId());
|
||||
final CursedWeapon cw2 = _cursedWeapons.get(player.getCursedWeaponEquippedId());
|
||||
// TODO: give the bonus level in a more appropriate manner.
|
||||
// The following code adds "_stageKills" levels. This will also show in the char status.
|
||||
// I do not have enough info to know if the bonus should be shown in the pk count, or if it
|
||||
@@ -308,21 +308,21 @@ public final class CursedWeaponsManager
|
||||
|
||||
public void drop(int itemId, L2Character killer)
|
||||
{
|
||||
CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
final CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
|
||||
cw.dropIt(killer);
|
||||
}
|
||||
|
||||
public void increaseKills(int itemId)
|
||||
{
|
||||
CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
final CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
|
||||
cw.increaseKills();
|
||||
}
|
||||
|
||||
public int getLevel(int itemId)
|
||||
{
|
||||
CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
final CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
|
||||
return cw.getLevel();
|
||||
}
|
||||
@@ -348,7 +348,7 @@ public final class CursedWeaponsManager
|
||||
cw.giveSkill();
|
||||
player.setCursedWeaponEquippedId(cw.getItemId());
|
||||
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
|
||||
sm.addString(cw.getName());
|
||||
// sm.addItemName(cw.getItemId());
|
||||
sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
|
||||
|
@@ -102,7 +102,7 @@ public final class DayNightSpawnManager
|
||||
}
|
||||
|
||||
spawn.stopRespawn();
|
||||
L2Npc last = spawn.getLastSpawn();
|
||||
final L2Npc last = spawn.getLastSpawn();
|
||||
if (last != null)
|
||||
{
|
||||
last.deleteMe();
|
||||
@@ -249,7 +249,7 @@ public final class DayNightSpawnManager
|
||||
|
||||
if (GameTimeController.getInstance().isNight())
|
||||
{
|
||||
L2RaidBossInstance raidboss = (L2RaidBossInstance) spawnDat.doSpawn();
|
||||
final L2RaidBossInstance raidboss = (L2RaidBossInstance) spawnDat.doSpawn();
|
||||
_bosses.put(spawnDat, raidboss);
|
||||
|
||||
return raidboss;
|
||||
|
@@ -54,7 +54,7 @@ public final class DuelManager
|
||||
}
|
||||
|
||||
// return if a player has PvPFlag
|
||||
String engagedInPvP = "The duel was canceled because a duelist engaged in PvP combat.";
|
||||
final String engagedInPvP = "The duel was canceled because a duelist engaged in PvP combat.";
|
||||
if (partyDuel)
|
||||
{
|
||||
boolean playerInPvP = false;
|
||||
@@ -234,7 +234,7 @@ public final class DuelManager
|
||||
|
||||
if (reason != null)
|
||||
{
|
||||
SystemMessage msg = SystemMessage.getSystemMessage(reason);
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(reason);
|
||||
msg.addString(target.getName());
|
||||
player.sendPacket(msg);
|
||||
return false;
|
||||
|
@@ -87,7 +87,7 @@ public class FishingChampionshipManager
|
||||
|
||||
protected void setEndOfChamp()
|
||||
{
|
||||
Calendar finishtime = Calendar.getInstance();
|
||||
final Calendar finishtime = Calendar.getInstance();
|
||||
finishtime.setTimeInMillis(_enddate);
|
||||
finishtime.set(Calendar.MINUTE, 0);
|
||||
finishtime.set(Calendar.SECOND, 0);
|
||||
@@ -103,11 +103,11 @@ public class FishingChampionshipManager
|
||||
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
{
|
||||
PreparedStatement statement = con.prepareStatement(SELECT);
|
||||
ResultSet rs = statement.executeQuery();
|
||||
final PreparedStatement statement = con.prepareStatement(SELECT);
|
||||
final ResultSet rs = statement.executeQuery();
|
||||
while (rs.next())
|
||||
{
|
||||
int rewarded = rs.getInt("rewarded");
|
||||
final int rewarded = rs.getInt("rewarded");
|
||||
if (rewarded == 0)
|
||||
{
|
||||
_tmpPlayers.add(new Fisher(rs.getString("player_name"), rs.getDouble("fish_length"), 0));
|
||||
|
@@ -191,7 +191,7 @@ public final class FortManager implements InstanceListManager
|
||||
@Override
|
||||
public void activateInstances()
|
||||
{
|
||||
for (final Fort fort : _forts)
|
||||
for (Fort fort : _forts)
|
||||
{
|
||||
fort.activateInstance();
|
||||
}
|
||||
|
@@ -143,8 +143,8 @@ public final class FortSiegeManager
|
||||
|
||||
for (Fort fort : FortManager.getInstance().getForts())
|
||||
{
|
||||
List<FortSiegeSpawn> commanderSpawns = new ArrayList<>();
|
||||
List<CombatFlag> flagSpawns = new ArrayList<>();
|
||||
final List<FortSiegeSpawn> commanderSpawns = new ArrayList<>();
|
||||
final List<CombatFlag> flagSpawns = new ArrayList<>();
|
||||
for (int i = 1; i < 5; i++)
|
||||
{
|
||||
final String _spawnParams = siegeSettings.getProperty(fort.getName().replace(" ", "") + "Commander" + i, "");
|
||||
@@ -156,11 +156,11 @@ public final class FortSiegeManager
|
||||
|
||||
try
|
||||
{
|
||||
int x = Integer.parseInt(st.nextToken());
|
||||
int y = Integer.parseInt(st.nextToken());
|
||||
int z = Integer.parseInt(st.nextToken());
|
||||
int heading = Integer.parseInt(st.nextToken());
|
||||
int npc_id = Integer.parseInt(st.nextToken());
|
||||
final int x = Integer.parseInt(st.nextToken());
|
||||
final int y = Integer.parseInt(st.nextToken());
|
||||
final int z = Integer.parseInt(st.nextToken());
|
||||
final int heading = Integer.parseInt(st.nextToken());
|
||||
final int npc_id = Integer.parseInt(st.nextToken());
|
||||
|
||||
commanderSpawns.add(new FortSiegeSpawn(fort.getResidenceId(), x, y, z, heading, npc_id, i));
|
||||
}
|
||||
@@ -183,10 +183,10 @@ public final class FortSiegeManager
|
||||
|
||||
try
|
||||
{
|
||||
int x = Integer.parseInt(st.nextToken());
|
||||
int y = Integer.parseInt(st.nextToken());
|
||||
int z = Integer.parseInt(st.nextToken());
|
||||
int flag_id = Integer.parseInt(st.nextToken());
|
||||
final int x = Integer.parseInt(st.nextToken());
|
||||
final int y = Integer.parseInt(st.nextToken());
|
||||
final int z = Integer.parseInt(st.nextToken());
|
||||
final int flag_id = Integer.parseInt(st.nextToken());
|
||||
|
||||
flagSpawns.add(new CombatFlag(fort.getResidenceId(), x, y, z, 0, flag_id));
|
||||
}
|
||||
|
@@ -201,7 +201,7 @@ public final class FourSepulchersManager
|
||||
protected void timeSelector()
|
||||
{
|
||||
timeCalculator();
|
||||
long currentTime = Calendar.getInstance().getTimeInMillis();
|
||||
final long currentTime = Calendar.getInstance().getTimeInMillis();
|
||||
// if current time >= time of entry beginning and if current time < time of entry beginning + time of entry end
|
||||
if ((currentTime >= _coolDownTimeEnd) && (currentTime < _entryTimeEnd)) // entry time check
|
||||
{
|
||||
@@ -232,7 +232,7 @@ public final class FourSepulchersManager
|
||||
// phase end times calculator
|
||||
protected void timeCalculator()
|
||||
{
|
||||
Calendar tmp = Calendar.getInstance();
|
||||
final Calendar tmp = Calendar.getInstance();
|
||||
if (tmp.get(Calendar.MINUTE) < _newCycleMin)
|
||||
{
|
||||
tmp.set(Calendar.HOUR, Calendar.getInstance().get(Calendar.HOUR) - 1);
|
||||
@@ -253,7 +253,7 @@ public final class FourSepulchersManager
|
||||
LOG.warning("[" + i + "] is not inside " + _startHallSpawns);
|
||||
continue;
|
||||
}
|
||||
int[] Location = _startHallSpawns.get(i);
|
||||
final int[] Location = _startHallSpawns.get(i);
|
||||
GrandBossManager.getInstance().getZone(Location[0], Location[1], Location[2]).oustAllPlayers();
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ public final class FourSepulchersManager
|
||||
spawnDat.setHeading(rs.getInt("heading"));
|
||||
spawnDat.setRespawnDelay(rs.getInt("respawn_delay"));
|
||||
SpawnTable.getInstance().addNewSpawn(spawnDat, false);
|
||||
int keyNpcId = rs.getInt("key_npc_id");
|
||||
final int keyNpcId = rs.getInt("key_npc_id");
|
||||
_mysteriousBoxSpawns.put(keyNpcId, spawnDat);
|
||||
}
|
||||
}
|
||||
@@ -477,7 +477,7 @@ public final class FourSepulchersManager
|
||||
{
|
||||
while (rs1.next())
|
||||
{
|
||||
int keyNpcId = rs1.getInt("key_npc_id");
|
||||
final int keyNpcId = rs1.getInt("key_npc_id");
|
||||
|
||||
ps2.setInt(1, keyNpcId);
|
||||
ps2.setInt(2, 1);
|
||||
@@ -524,7 +524,7 @@ public final class FourSepulchersManager
|
||||
{
|
||||
while (rs1.next())
|
||||
{
|
||||
int keyNpcId = rs1.getInt("key_npc_id");
|
||||
final int keyNpcId = rs1.getInt("key_npc_id");
|
||||
|
||||
ps2.setInt(1, keyNpcId);
|
||||
ps2.setInt(2, 2);
|
||||
@@ -573,7 +573,7 @@ public final class FourSepulchersManager
|
||||
{
|
||||
while (rs1.next())
|
||||
{
|
||||
int keyNpcId = rs1.getInt("key_npc_id");
|
||||
final int keyNpcId = rs1.getInt("key_npc_id");
|
||||
|
||||
ps2.setInt(1, keyNpcId);
|
||||
ps2.setInt(2, 5);
|
||||
@@ -624,7 +624,7 @@ public final class FourSepulchersManager
|
||||
{
|
||||
while (rs1.next())
|
||||
{
|
||||
int keyNpcId = rs1.getInt("key_npc_id");
|
||||
final int keyNpcId = rs1.getInt("key_npc_id");
|
||||
|
||||
ps2.setInt(1, keyNpcId);
|
||||
ps2.setInt(2, 6);
|
||||
@@ -660,7 +660,7 @@ public final class FourSepulchersManager
|
||||
|
||||
protected void initLocationShadowSpawns()
|
||||
{
|
||||
int locNo = Rnd.get(4);
|
||||
final int locNo = Rnd.get(4);
|
||||
final int[] gateKeeper =
|
||||
{
|
||||
31929,
|
||||
@@ -841,13 +841,13 @@ public final class FourSepulchersManager
|
||||
|
||||
public synchronized void tryEntry(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
Quest hostQuest = QuestManager.getInstance().getQuest(QUEST_ID);
|
||||
final Quest hostQuest = QuestManager.getInstance().getQuest(QUEST_ID);
|
||||
if (hostQuest == null)
|
||||
{
|
||||
LOG.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't find quest: " + QUEST_ID);
|
||||
return;
|
||||
}
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
switch (npcId)
|
||||
{
|
||||
// ID ok
|
||||
@@ -888,7 +888,7 @@ public final class FourSepulchersManager
|
||||
|
||||
for (L2PcInstance mem : player.getParty().getMembers())
|
||||
{
|
||||
QuestState qs = mem.getQuestState(hostQuest.getName());
|
||||
final QuestState qs = mem.getQuestState(hostQuest.getName());
|
||||
if ((qs == null) || (!qs.isStarted() && !qs.isCompleted()))
|
||||
{
|
||||
showHtmlFile(player, npcId + "-NS.htm", npc, mem);
|
||||
@@ -916,7 +916,7 @@ public final class FourSepulchersManager
|
||||
}
|
||||
for (L2PcInstance mem : player.getParty().getMembers())
|
||||
{
|
||||
QuestState qs = mem.getQuestState(hostQuest.getName());
|
||||
final QuestState qs = mem.getQuestState(hostQuest.getName());
|
||||
if ((qs == null) || (!qs.isStarted() && !qs.isCompleted()))
|
||||
{
|
||||
showHtmlFile(player, npcId + "-NS.htm", npc, mem);
|
||||
@@ -937,7 +937,7 @@ public final class FourSepulchersManager
|
||||
}
|
||||
else
|
||||
{
|
||||
QuestState qs = player.getQuestState(hostQuest.getName());
|
||||
final QuestState qs = player.getQuestState(hostQuest.getName());
|
||||
if ((qs == null) || (!qs.isStarted() && !qs.isCompleted()))
|
||||
{
|
||||
showHtmlFile(player, npcId + "-NS.htm", npc, player);
|
||||
@@ -969,7 +969,7 @@ public final class FourSepulchersManager
|
||||
|
||||
private void entry(int npcId, L2PcInstance player)
|
||||
{
|
||||
int[] Location = _startHallSpawns.get(npcId);
|
||||
final int[] Location = _startHallSpawns.get(npcId);
|
||||
int driftx;
|
||||
int drifty;
|
||||
|
||||
@@ -996,7 +996,7 @@ public final class FourSepulchersManager
|
||||
mem.addItem("Quest", USED_PASS, 1, mem, true);
|
||||
}
|
||||
|
||||
L2ItemInstance hallsKey = mem.getInventory().getItemByItemId(CHAPEL_KEY);
|
||||
final L2ItemInstance hallsKey = mem.getInventory().getItemByItemId(CHAPEL_KEY);
|
||||
if (hallsKey != null)
|
||||
{
|
||||
mem.destroyItemByItemId("Quest", CHAPEL_KEY, hallsKey.getCount(), mem, true);
|
||||
@@ -1030,7 +1030,7 @@ public final class FourSepulchersManager
|
||||
mem.addItem("Quest", USED_PASS, 1, mem, true);
|
||||
}
|
||||
|
||||
L2ItemInstance hallsKey = mem.getInventory().getItemByItemId(CHAPEL_KEY);
|
||||
final L2ItemInstance hallsKey = mem.getInventory().getItemByItemId(CHAPEL_KEY);
|
||||
if (hallsKey != null)
|
||||
{
|
||||
mem.destroyItemByItemId("Quest", CHAPEL_KEY, hallsKey.getCount(), mem, true);
|
||||
@@ -1053,7 +1053,7 @@ public final class FourSepulchersManager
|
||||
player.addItem("Quest", USED_PASS, 1, player, true);
|
||||
}
|
||||
|
||||
L2ItemInstance hallsKey = player.getInventory().getItemByItemId(CHAPEL_KEY);
|
||||
final L2ItemInstance hallsKey = player.getInventory().getItemByItemId(CHAPEL_KEY);
|
||||
if (hallsKey != null)
|
||||
{
|
||||
player.destroyItemByItemId("Quest", CHAPEL_KEY, hallsKey.getCount(), player, true);
|
||||
@@ -1072,7 +1072,7 @@ public final class FourSepulchersManager
|
||||
return;
|
||||
}
|
||||
|
||||
L2Spawn spawnDat = _mysteriousBoxSpawns.get(npcId);
|
||||
final L2Spawn spawnDat = _mysteriousBoxSpawns.get(npcId);
|
||||
if (spawnDat != null)
|
||||
{
|
||||
_allMobs.add(spawnDat.doSpawn());
|
||||
@@ -1194,7 +1194,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public synchronized boolean isViscountMobsAnnihilated(int npcId)
|
||||
{
|
||||
List<L2SepulcherMonsterInstance> mobs = _viscountMobs.get(npcId);
|
||||
final List<L2SepulcherMonsterInstance> mobs = _viscountMobs.get(npcId);
|
||||
if (mobs == null)
|
||||
{
|
||||
return true;
|
||||
@@ -1213,7 +1213,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public synchronized boolean isDukeMobsAnnihilated(int npcId)
|
||||
{
|
||||
List<L2SepulcherMonsterInstance> mobs = _dukeMobs.get(npcId);
|
||||
final List<L2SepulcherMonsterInstance> mobs = _dukeMobs.get(npcId);
|
||||
if (mobs == null)
|
||||
{
|
||||
return true;
|
||||
@@ -1237,7 +1237,7 @@ public final class FourSepulchersManager
|
||||
return;
|
||||
}
|
||||
|
||||
L2Spawn spawnDat = _keyBoxSpawns.get(activeChar.getId());
|
||||
final L2Spawn spawnDat = _keyBoxSpawns.get(activeChar.getId());
|
||||
if (spawnDat != null)
|
||||
{
|
||||
spawnDat.setAmount(1);
|
||||
@@ -1258,7 +1258,7 @@ public final class FourSepulchersManager
|
||||
return;
|
||||
}
|
||||
|
||||
L2Spawn spawnDat = _executionerSpawns.get(activeChar.getId());
|
||||
final L2Spawn spawnDat = _executionerSpawns.get(activeChar.getId());
|
||||
if (spawnDat != null)
|
||||
{
|
||||
spawnDat.setAmount(1);
|
||||
@@ -1284,12 +1284,12 @@ public final class FourSepulchersManager
|
||||
return;
|
||||
}
|
||||
|
||||
List<L2Spawn> monsterList = _dukeFinalMobs.get(npcId);
|
||||
final List<L2Spawn> monsterList = _dukeFinalMobs.get(npcId);
|
||||
if (monsterList != null)
|
||||
{
|
||||
for (L2Spawn spawnDat : monsterList)
|
||||
{
|
||||
L2SepulcherMonsterInstance mob = (L2SepulcherMonsterInstance) spawnDat.doSpawn();
|
||||
final L2SepulcherMonsterInstance mob = (L2SepulcherMonsterInstance) spawnDat.doSpawn();
|
||||
spawnDat.stopRespawn();
|
||||
|
||||
if (mob != null)
|
||||
@@ -1309,7 +1309,7 @@ public final class FourSepulchersManager
|
||||
return;
|
||||
}
|
||||
|
||||
List<L2Spawn> monsterList = _emperorsGraveNpcs.get(npcId);
|
||||
final List<L2Spawn> monsterList = _emperorsGraveNpcs.get(npcId);
|
||||
if (monsterList != null)
|
||||
{
|
||||
for (L2Spawn spawnDat : monsterList)
|
||||
@@ -1322,7 +1322,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public void locationShadowSpawns()
|
||||
{
|
||||
int locNo = Rnd.get(4);
|
||||
final int locNo = Rnd.get(4);
|
||||
final int[] gateKeeper =
|
||||
{
|
||||
31929,
|
||||
@@ -1333,8 +1333,8 @@ public final class FourSepulchersManager
|
||||
|
||||
for (int i = 0; i <= 3; i++)
|
||||
{
|
||||
int keyNpcId = gateKeeper[i];
|
||||
L2Spawn spawnDat = _shadowSpawns.get(keyNpcId);
|
||||
final int keyNpcId = gateKeeper[i];
|
||||
final L2Spawn spawnDat = _shadowSpawns.get(keyNpcId);
|
||||
spawnDat.setX(_shadowSpawnLoc[locNo][i][1]);
|
||||
spawnDat.setY(_shadowSpawnLoc[locNo][i][2]);
|
||||
spawnDat.setZ(_shadowSpawnLoc[locNo][i][3]);
|
||||
@@ -1350,10 +1350,10 @@ public final class FourSepulchersManager
|
||||
return;
|
||||
}
|
||||
|
||||
L2Spawn spawnDat = _shadowSpawns.get(npcId);
|
||||
final L2Spawn spawnDat = _shadowSpawns.get(npcId);
|
||||
if (spawnDat != null)
|
||||
{
|
||||
L2SepulcherMonsterInstance mob = (L2SepulcherMonsterInstance) spawnDat.doSpawn();
|
||||
final L2SepulcherMonsterInstance mob = (L2SepulcherMonsterInstance) spawnDat.doSpawn();
|
||||
spawnDat.stopRespawn();
|
||||
|
||||
if (mob != null)
|
||||
@@ -1390,7 +1390,7 @@ public final class FourSepulchersManager
|
||||
{
|
||||
try
|
||||
{
|
||||
L2DoorInstance door = DoorData.getInstance().getDoor(doorId);
|
||||
final L2DoorInstance door = DoorData.getInstance().getDoor(doorId);
|
||||
if (door != null)
|
||||
{
|
||||
door.closeMe();
|
||||
@@ -1528,8 +1528,8 @@ public final class FourSepulchersManager
|
||||
|
||||
else if (_inEntryTime)
|
||||
{
|
||||
NpcStringId msg1 = NpcStringId.YOU_MAY_NOW_ENTER_THE_SEPULCHER;
|
||||
NpcStringId msg2 = NpcStringId.IF_YOU_PLACE_YOUR_HAND_ON_THE_STONE_STATUE_IN_FRONT_OF_EACH_SEPULCHER_YOU_WILL_BE_ABLE_TO_ENTER;
|
||||
final NpcStringId msg1 = NpcStringId.YOU_MAY_NOW_ENTER_THE_SEPULCHER;
|
||||
final NpcStringId msg2 = NpcStringId.IF_YOU_PLACE_YOUR_HAND_ON_THE_STONE_STATUE_IN_FRONT_OF_EACH_SEPULCHER_YOU_WILL_BE_ABLE_TO_ENTER;
|
||||
for (L2Spawn temp : _managers)
|
||||
{
|
||||
if (temp == null)
|
||||
|
@@ -95,7 +95,7 @@ public final class GraciaSeedsManager
|
||||
break;
|
||||
case 2:
|
||||
// Conquest Complete state, if too much time is passed than change to defense state
|
||||
long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
|
||||
final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
|
||||
if (timePast >= Config.SOD_STAGE_2_LENGTH)
|
||||
{
|
||||
// change to Attack state because Defend statet is not implemented
|
||||
@@ -138,7 +138,7 @@ public final class GraciaSeedsManager
|
||||
setSoDState(2, false);
|
||||
}
|
||||
saveData(SODTYPE);
|
||||
Quest esQuest = QuestManager.getInstance().getQuest(ENERGY_SEEDS);
|
||||
final Quest esQuest = QuestManager.getInstance().getQuest(ENERGY_SEEDS);
|
||||
if (esQuest == null)
|
||||
{
|
||||
_log.warning(getClass().getSimpleName() + ": missing EnergySeeds Quest!");
|
||||
|
@@ -83,20 +83,20 @@ public final class GrandBossManager implements IStorable
|
||||
{
|
||||
// Read all info from DB, and store it for AI to read and decide what to do
|
||||
// faster than accessing DB in real time
|
||||
StatsSet info = new StatsSet();
|
||||
int bossId = rs.getInt("boss_id");
|
||||
final StatsSet info = new StatsSet();
|
||||
final int bossId = rs.getInt("boss_id");
|
||||
info.set("loc_x", rs.getInt("loc_x"));
|
||||
info.set("loc_y", rs.getInt("loc_y"));
|
||||
info.set("loc_z", rs.getInt("loc_z"));
|
||||
info.set("heading", rs.getInt("heading"));
|
||||
info.set("respawn_time", rs.getLong("respawn_time"));
|
||||
double HP = rs.getDouble("currentHP"); // jython doesn't recognize doubles
|
||||
int true_HP = (int) HP; // so use java's ability to type cast
|
||||
final double HP = rs.getDouble("currentHP"); // jython doesn't recognize doubles
|
||||
final int true_HP = (int) HP; // so use java's ability to type cast
|
||||
info.set("currentHP", true_HP); // to convert double to int
|
||||
double MP = rs.getDouble("currentMP");
|
||||
int true_MP = (int) MP;
|
||||
final double MP = rs.getDouble("currentMP");
|
||||
final int true_MP = (int) MP;
|
||||
info.set("currentMP", true_MP);
|
||||
int status = rs.getInt("status");
|
||||
final int status = rs.getInt("status");
|
||||
_bossStatus.put(bossId, status);
|
||||
_storedInfo.put(bossId, info);
|
||||
_log.info(getClass().getSimpleName() + ": " + NpcData.getInstance().getTemplate(bossId).getName() + "(" + bossId + ") status is " + status + ".");
|
||||
@@ -135,8 +135,8 @@ public final class GrandBossManager implements IStorable
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
int id = rs.getInt("player_id");
|
||||
int zoneId = rs.getInt("zone");
|
||||
final int id = rs.getInt("player_id");
|
||||
final int zoneId = rs.getInt("zone");
|
||||
zones.get(zoneId).add(id);
|
||||
}
|
||||
_log.info(getClass().getSimpleName() + ": Initialized " + _zones.size() + " Grand Boss Zones");
|
||||
@@ -246,7 +246,7 @@ public final class GrandBossManager implements IStorable
|
||||
{
|
||||
for (Entry<Integer, L2BossZone> e : _zones.entrySet())
|
||||
{
|
||||
List<Integer> list = e.getValue().getAllowedPlayers();
|
||||
final List<Integer> list = e.getValue().getAllowedPlayers();
|
||||
if ((list == null) || list.isEmpty())
|
||||
{
|
||||
continue;
|
||||
@@ -263,7 +263,7 @@ public final class GrandBossManager implements IStorable
|
||||
for (Entry<Integer, StatsSet> e : _storedInfo.entrySet())
|
||||
{
|
||||
final L2GrandBossInstance boss = BOSSES.get(e.getKey());
|
||||
StatsSet info = e.getValue();
|
||||
final StatsSet info = e.getValue();
|
||||
if ((boss == null) || (info == null))
|
||||
{
|
||||
try (PreparedStatement update = con.prepareStatement(UPDATE_GRAND_BOSS_DATA2))
|
||||
@@ -312,8 +312,8 @@ public final class GrandBossManager implements IStorable
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
{
|
||||
L2GrandBossInstance boss = BOSSES.get(bossId);
|
||||
StatsSet info = _storedInfo.get(bossId);
|
||||
final L2GrandBossInstance boss = BOSSES.get(bossId);
|
||||
final StatsSet info = _storedInfo.get(bossId);
|
||||
|
||||
if (statusOnly || (boss == null) || (info == null))
|
||||
{
|
||||
|
@@ -74,8 +74,8 @@ public final class HandysBlockCheckerManager
|
||||
*/
|
||||
public synchronized void increaseArenaVotes(int arena)
|
||||
{
|
||||
int newVotes = _arenaVotes.get(arena) + 1;
|
||||
ArenaParticipantsHolder holder = _arenaPlayers[arena];
|
||||
final int newVotes = _arenaVotes.get(arena) + 1;
|
||||
final ArenaParticipantsHolder holder = _arenaPlayers[arena];
|
||||
|
||||
if ((newVotes > (holder.getAllPlayers().size() / 2)) && !holder.getEvent().isStarted())
|
||||
{
|
||||
@@ -149,7 +149,7 @@ public final class HandysBlockCheckerManager
|
||||
*/
|
||||
public boolean addPlayerToArena(L2PcInstance player, int arenaId)
|
||||
{
|
||||
ArenaParticipantsHolder holder = _arenaPlayers[arenaId];
|
||||
final ArenaParticipantsHolder holder = _arenaPlayers[arenaId];
|
||||
|
||||
synchronized (holder)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ public final class HandysBlockCheckerManager
|
||||
{
|
||||
if (_arenaPlayers[i].getAllPlayers().contains(player))
|
||||
{
|
||||
SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_ALREADY_REGISTERED_ON_THE_MATCH_WAITING_LIST);
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_ALREADY_REGISTERED_ON_THE_MATCH_WAITING_LIST);
|
||||
msg.addCharName(player);
|
||||
player.sendPacket(msg);
|
||||
return false;
|
||||
@@ -224,16 +224,16 @@ public final class HandysBlockCheckerManager
|
||||
*/
|
||||
public void removePlayer(L2PcInstance player, int arenaId, int team)
|
||||
{
|
||||
ArenaParticipantsHolder holder = _arenaPlayers[arenaId];
|
||||
final ArenaParticipantsHolder holder = _arenaPlayers[arenaId];
|
||||
synchronized (holder)
|
||||
{
|
||||
boolean isRed = team == 0 ? true : false;
|
||||
final boolean isRed = team == 0 ? true : false;
|
||||
|
||||
holder.removePlayer(player, team);
|
||||
holder.broadCastPacketToTeam(new ExCubeGameRemovePlayer(player, isRed));
|
||||
|
||||
// End event if theres an empty team
|
||||
int teamSize = isRed ? holder.getRedTeamSize() : holder.getBlueTeamSize();
|
||||
final int teamSize = isRed ? holder.getRedTeamSize() : holder.getBlueTeamSize();
|
||||
if (teamSize == 0)
|
||||
{
|
||||
holder.getEvent().endEventAbnormally();
|
||||
@@ -252,11 +252,11 @@ public final class HandysBlockCheckerManager
|
||||
*/
|
||||
public void changePlayerToTeam(L2PcInstance player, int arena, int team)
|
||||
{
|
||||
ArenaParticipantsHolder holder = _arenaPlayers[arena];
|
||||
final ArenaParticipantsHolder holder = _arenaPlayers[arena];
|
||||
|
||||
synchronized (holder)
|
||||
{
|
||||
boolean isFromRed = holder.getRedPlayers().contains(player);
|
||||
final boolean isFromRed = holder.getRedPlayers().contains(player);
|
||||
|
||||
if (isFromRed && (holder.getBlueTeamSize() == 6))
|
||||
{
|
||||
@@ -269,7 +269,7 @@ public final class HandysBlockCheckerManager
|
||||
return;
|
||||
}
|
||||
|
||||
int futureTeam = isFromRed ? 1 : 0;
|
||||
final int futureTeam = isFromRed ? 1 : 0;
|
||||
holder.addPlayer(player, futureTeam);
|
||||
|
||||
if (isFromRed)
|
||||
@@ -331,8 +331,8 @@ public final class HandysBlockCheckerManager
|
||||
*/
|
||||
public void onDisconnect(L2PcInstance player)
|
||||
{
|
||||
int arena = player.getBlockCheckerArena();
|
||||
int team = getHolder(arena).getPlayerTeam(player);
|
||||
final int arena = player.getBlockCheckerArena();
|
||||
final int team = getHolder(arena).getPlayerTeam(player);
|
||||
HandysBlockCheckerManager.getInstance().removePlayer(player, arena, team);
|
||||
if (player.getTeam() != Team.NONE)
|
||||
{
|
||||
@@ -341,16 +341,16 @@ public final class HandysBlockCheckerManager
|
||||
player.setTeam(Team.NONE);
|
||||
|
||||
// Remove the event items
|
||||
PcInventory inv = player.getInventory();
|
||||
final PcInventory inv = player.getInventory();
|
||||
|
||||
if (inv.getItemByItemId(13787) != null)
|
||||
{
|
||||
long count = inv.getInventoryItemCount(13787, 0);
|
||||
final long count = inv.getInventoryItemCount(13787, 0);
|
||||
inv.destroyItemByItemId("Handys Block Checker", 13787, count, player, player);
|
||||
}
|
||||
if (inv.getItemByItemId(13788) != null)
|
||||
{
|
||||
long count = inv.getInventoryItemCount(13788, 0);
|
||||
final long count = inv.getInventoryItemCount(13788, 0);
|
||||
inv.destroyItemByItemId("Handys Block Checker", 13788, count, player, player);
|
||||
}
|
||||
player.setInsideZone(ZoneId.PVP, false);
|
||||
|
@@ -177,8 +177,8 @@ public final class InstanceManager implements IXmlReader
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
int id = rs.getInt("instanceId");
|
||||
long time = rs.getLong("time");
|
||||
final int id = rs.getInt("instanceId");
|
||||
final long time = rs.getLong("time");
|
||||
if (time < System.currentTimeMillis())
|
||||
{
|
||||
deleteInstanceTime(playerObjId, id);
|
||||
|
@@ -69,7 +69,7 @@ public final class ItemAuctionManager
|
||||
_auctionIds.set(rs.getInt(1) + 1);
|
||||
}
|
||||
}
|
||||
catch (final SQLException e)
|
||||
catch (SQLException e)
|
||||
{
|
||||
_log.log(Level.SEVERE, getClass().getSimpleName() + ": Failed loading auctions.", e);
|
||||
}
|
||||
|
@@ -105,10 +105,10 @@ public class JumpManager
|
||||
public void load()
|
||||
{
|
||||
_tracks.clear();
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setValidating(false);
|
||||
factory.setIgnoringComments(true);
|
||||
File file = new File(Config.DATAPACK_ROOT, "JumpTrack.xml");
|
||||
final File file = new File(Config.DATAPACK_ROOT, "JumpTrack.xml");
|
||||
Document doc = null;
|
||||
|
||||
if (file.exists())
|
||||
@@ -122,13 +122,13 @@ public class JumpManager
|
||||
_log.log(Level.WARNING, "Could not parse JumpTrack.xml file: " + e.getMessage(), e);
|
||||
return;
|
||||
}
|
||||
Node root = doc.getFirstChild();
|
||||
final Node root = doc.getFirstChild();
|
||||
for (Node t = root.getFirstChild(); t != null; t = t.getNextSibling())
|
||||
{
|
||||
if (t.getNodeName().equals("track"))
|
||||
{
|
||||
Track track = new Track();
|
||||
int trackId = Integer.parseInt(t.getAttributes().getNamedItem("trackId").getNodeValue());
|
||||
final Track track = new Track();
|
||||
final int trackId = Integer.parseInt(t.getAttributes().getNamedItem("trackId").getNodeValue());
|
||||
try
|
||||
{
|
||||
track.x = Integer.parseInt(t.getAttributes().getNamedItem("ToX").getNodeValue());
|
||||
@@ -143,17 +143,17 @@ public class JumpManager
|
||||
{
|
||||
if (w.getNodeName().equals("way"))
|
||||
{
|
||||
JumpWay jw = new JumpWay();
|
||||
int wayId = Integer.parseInt(w.getAttributes().getNamedItem("id").getNodeValue());
|
||||
final JumpWay jw = new JumpWay();
|
||||
final int wayId = Integer.parseInt(w.getAttributes().getNamedItem("id").getNodeValue());
|
||||
for (Node j = w.getFirstChild(); j != null; j = j.getNextSibling())
|
||||
{
|
||||
if (j.getNodeName().equals("jumpLoc"))
|
||||
{
|
||||
NamedNodeMap attrs = j.getAttributes();
|
||||
int next = Integer.parseInt(attrs.getNamedItem("next").getNodeValue());
|
||||
int x = Integer.parseInt(attrs.getNamedItem("x").getNodeValue());
|
||||
int y = Integer.parseInt(attrs.getNamedItem("y").getNodeValue());
|
||||
int z = Integer.parseInt(attrs.getNamedItem("z").getNodeValue());
|
||||
final NamedNodeMap attrs = j.getAttributes();
|
||||
final int next = Integer.parseInt(attrs.getNamedItem("next").getNodeValue());
|
||||
final int x = Integer.parseInt(attrs.getNamedItem("x").getNodeValue());
|
||||
final int y = Integer.parseInt(attrs.getNamedItem("y").getNodeValue());
|
||||
final int z = Integer.parseInt(attrs.getNamedItem("z").getNodeValue());
|
||||
jw.add(new JumpNode(x, y, z, next));
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class JumpManager
|
||||
|
||||
public JumpWay getJumpWay(int trackId, int wayId)
|
||||
{
|
||||
Track t = _tracks.get(trackId);
|
||||
final Track t = _tracks.get(trackId);
|
||||
if (t != null)
|
||||
{
|
||||
return t.get(wayId);
|
||||
@@ -205,12 +205,12 @@ public class JumpManager
|
||||
{
|
||||
return;
|
||||
}
|
||||
JumpWay jw = getJumpWay(player.getJumpTrackId(), 0);
|
||||
final JumpWay jw = getJumpWay(player.getJumpTrackId(), 0);
|
||||
if (jw == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Track t = getTrack(player.getJumpTrackId());
|
||||
final Track t = getTrack(player.getJumpTrackId());
|
||||
if (!((t.x == 0) && (t.y == 0) && (t.z == 0)))
|
||||
{
|
||||
player.broadcastPacket(new FlyToLocation(player, t.x, t.y, t.z, FlyType.DUMMY));
|
||||
@@ -226,14 +226,14 @@ public class JumpManager
|
||||
return;
|
||||
}
|
||||
|
||||
JumpWay jw = getJumpWay(player.getJumpTrackId(), nextId);
|
||||
final JumpWay jw = getJumpWay(player.getJumpTrackId(), nextId);
|
||||
if (jw == null)
|
||||
{
|
||||
player.enableAllSkills(); // unlock player skills
|
||||
return;
|
||||
}
|
||||
player.sendPacket(new ExFlyMove(player.getObjectId(), player.getJumpTrackId(), jw));
|
||||
JumpNode n = jw.get(0);
|
||||
final JumpNode n = jw.get(0);
|
||||
player.setXYZ(n.getX(), n.getY(), n.getZ());
|
||||
}
|
||||
|
||||
|
@@ -67,12 +67,12 @@ public final class MailManager
|
||||
|
||||
final Message msg = new Message(rs);
|
||||
|
||||
int msgId = msg.getId();
|
||||
final int msgId = msg.getId();
|
||||
_messages.put(msgId, msg);
|
||||
|
||||
count++;
|
||||
|
||||
long expiration = msg.getExpiration();
|
||||
final long expiration = msg.getExpiration();
|
||||
|
||||
if (expiration < System.currentTimeMillis())
|
||||
{
|
||||
|
@@ -90,19 +90,19 @@ public final class MapRegionManager implements IXmlReader
|
||||
castle = parseInteger(attrs, "castle");
|
||||
bbs = parseInteger(attrs, "bbs");
|
||||
|
||||
L2MapRegion region = new L2MapRegion(name, town, locId, castle, bbs);
|
||||
final L2MapRegion region = new L2MapRegion(name, town, locId, castle, bbs);
|
||||
for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling())
|
||||
{
|
||||
attrs = c.getAttributes();
|
||||
if ("respawnPoint".equalsIgnoreCase(c.getNodeName()))
|
||||
{
|
||||
int spawnX = parseInteger(attrs, "X");
|
||||
int spawnY = parseInteger(attrs, "Y");
|
||||
int spawnZ = parseInteger(attrs, "Z");
|
||||
final int spawnX = parseInteger(attrs, "X");
|
||||
final int spawnY = parseInteger(attrs, "Y");
|
||||
final int spawnZ = parseInteger(attrs, "Z");
|
||||
|
||||
boolean other = parseBoolean(attrs, "isOther", false);
|
||||
boolean chaotic = parseBoolean(attrs, "isChaotic", false);
|
||||
boolean banish = parseBoolean(attrs, "isBanish", false);
|
||||
final boolean other = parseBoolean(attrs, "isOther", false);
|
||||
final boolean chaotic = parseBoolean(attrs, "isChaotic", false);
|
||||
final boolean banish = parseBoolean(attrs, "isBanish", false);
|
||||
|
||||
if (other)
|
||||
{
|
||||
@@ -161,7 +161,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
*/
|
||||
public final int getMapRegionLocId(int locX, int locY)
|
||||
{
|
||||
L2MapRegion region = getMapRegion(locX, locY);
|
||||
final L2MapRegion region = getMapRegion(locX, locY);
|
||||
if (region != null)
|
||||
{
|
||||
return region.getLocId();
|
||||
@@ -212,7 +212,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
*/
|
||||
public String getClosestTownName(L2Character activeChar)
|
||||
{
|
||||
L2MapRegion region = getMapRegion(activeChar);
|
||||
final L2MapRegion region = getMapRegion(activeChar);
|
||||
|
||||
if (region == null)
|
||||
{
|
||||
@@ -228,7 +228,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
*/
|
||||
public int getAreaCastle(L2Character activeChar)
|
||||
{
|
||||
L2MapRegion region = getMapRegion(activeChar);
|
||||
final L2MapRegion region = getMapRegion(activeChar);
|
||||
|
||||
if (region == null)
|
||||
{
|
||||
@@ -263,7 +263,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
clanhall = ClanHallManager.getInstance().getAbstractHallByOwner(player.getClan());
|
||||
if (clanhall != null)
|
||||
{
|
||||
L2ClanHallZone zone = clanhall.getZone();
|
||||
final L2ClanHallZone zone = clanhall.getZone();
|
||||
if ((zone != null) && !player.isFlyingMounted())
|
||||
{
|
||||
if (player.getReputation() < 0)
|
||||
@@ -336,7 +336,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
if (castle.getSiege().isInProgress())
|
||||
{
|
||||
// Check if player's clan is attacker
|
||||
List<L2Npc> flags = castle.getSiege().getFlag(player.getClan());
|
||||
final List<L2Npc> flags = castle.getSiege().getFlag(player.getClan());
|
||||
if ((flags != null) && !flags.isEmpty())
|
||||
{
|
||||
// Spawn to flag - Need more work to get player to the nearest flag
|
||||
@@ -350,7 +350,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
if (fort.getSiege().isInProgress())
|
||||
{
|
||||
// Check if player's clan is attacker
|
||||
List<L2Npc> flags = fort.getSiege().getFlag(player.getClan());
|
||||
final List<L2Npc> flags = fort.getSiege().getFlag(player.getClan());
|
||||
if ((flags != null) && !flags.isEmpty())
|
||||
{
|
||||
// Spawn to flag - Need more work to get player to the nearest flag
|
||||
@@ -360,8 +360,8 @@ public final class MapRegionManager implements IXmlReader
|
||||
}
|
||||
else if ((clanhall != null) && clanhall.isSiegableHall())
|
||||
{
|
||||
SiegableHall sHall = (SiegableHall) clanhall;
|
||||
List<L2Npc> flags = sHall.getSiege().getFlag(player.getClan());
|
||||
final SiegableHall sHall = (SiegableHall) clanhall;
|
||||
final List<L2Npc> flags = sHall.getSiege().getFlag(player.getClan());
|
||||
if ((flags != null) && !flags.isEmpty())
|
||||
{
|
||||
return flags.get(0).getLocation();
|
||||
@@ -375,7 +375,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
L2RespawnZone zone = ZoneManager.getInstance().getZone(player, L2RespawnZone.class);
|
||||
final L2RespawnZone zone = ZoneManager.getInstance().getZone(player, L2RespawnZone.class);
|
||||
if (zone != null)
|
||||
{
|
||||
return getRestartRegion(activeChar, zone.getRespawnPoint((L2PcInstance) activeChar)).getChaoticSpawnLoc();
|
||||
@@ -409,7 +409,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
// Checking if in an instance
|
||||
if (player.getInstanceId() > 0)
|
||||
{
|
||||
Instance inst = InstanceManager.getInstance().getInstance(player.getInstanceId());
|
||||
final Instance inst = InstanceManager.getInstance().getInstance(player.getInstanceId());
|
||||
if (inst != null)
|
||||
{
|
||||
loc = inst.getExitLoc();
|
||||
@@ -436,7 +436,7 @@ public final class MapRegionManager implements IXmlReader
|
||||
// Get the nearest town
|
||||
try
|
||||
{
|
||||
L2RespawnZone zone = ZoneManager.getInstance().getZone(activeChar, L2RespawnZone.class);
|
||||
final L2RespawnZone zone = ZoneManager.getInstance().getZone(activeChar, L2RespawnZone.class);
|
||||
if (zone != null)
|
||||
{
|
||||
return getRestartRegion(activeChar, zone.getRespawnPoint((L2PcInstance) activeChar)).getSpawnLoc();
|
||||
@@ -459,8 +459,8 @@ public final class MapRegionManager implements IXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
L2PcInstance player = ((L2PcInstance) activeChar);
|
||||
L2MapRegion region = _regions.get(point);
|
||||
final L2PcInstance player = ((L2PcInstance) activeChar);
|
||||
final L2MapRegion region = _regions.get(point);
|
||||
|
||||
if (region.getBannedRace().containsKey(player.getRace()))
|
||||
{
|
||||
|
@@ -154,7 +154,7 @@ public final class MercTicketManager
|
||||
int npcId;
|
||||
int itemId;
|
||||
int x, y, z;
|
||||
int mercPlaced[] = new int[20];
|
||||
final int mercPlaced[] = new int[20];
|
||||
// start index to begin the search for the itemId corresponding to this NPC
|
||||
// this will help with:
|
||||
// a) skip unnecessary iterations in the search loop
|
||||
@@ -167,7 +167,7 @@ public final class MercTicketManager
|
||||
x = rs.getInt("x");
|
||||
y = rs.getInt("y");
|
||||
z = rs.getInt("z");
|
||||
Castle castle = CastleManager.getInstance().getCastle(x, y, z);
|
||||
final Castle castle = CastleManager.getInstance().getCastle(x, y, z);
|
||||
if (castle != null)
|
||||
{
|
||||
if (mercPlaced[castle.getResidenceId() - 1] >= MERCS_MAX_PER_CASTLE[castle.getResidenceId() - 1])
|
||||
@@ -188,7 +188,7 @@ public final class MercTicketManager
|
||||
{
|
||||
itemId = ITEM_IDS[i];
|
||||
// create the ticket in the gameworld
|
||||
L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
|
||||
final L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
|
||||
dropticket.setItemLocation(ItemLocation.VOID);
|
||||
dropticket.dropMe(null, x, y, z);
|
||||
dropticket.setDropTime(0); // avoids it from being removed by the auto item destroyer
|
||||
@@ -255,12 +255,12 @@ public final class MercTicketManager
|
||||
*/
|
||||
public boolean isAtCasleLimit(int itemId)
|
||||
{
|
||||
int castleId = getTicketCastleId(itemId);
|
||||
final int castleId = getTicketCastleId(itemId);
|
||||
if (castleId <= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
int limit = MERCS_MAX_PER_CASTLE[castleId - 1];
|
||||
final int limit = MERCS_MAX_PER_CASTLE[castleId - 1];
|
||||
if (limit <= 0)
|
||||
{
|
||||
return true;
|
||||
@@ -290,9 +290,9 @@ public final class MercTicketManager
|
||||
{
|
||||
for (L2ItemInstance item : DROPPED_TICKETS)
|
||||
{
|
||||
double dx = x - item.getX();
|
||||
double dy = y - item.getY();
|
||||
double dz = z - item.getZ();
|
||||
final double dx = x - item.getX();
|
||||
final double dy = y - item.getY();
|
||||
final double dz = z - item.getZ();
|
||||
|
||||
if (((dx * dx) + (dy * dy) + (dz * dz)) < (25 * 25))
|
||||
{
|
||||
@@ -311,12 +311,12 @@ public final class MercTicketManager
|
||||
*/
|
||||
public int addTicket(int itemId, L2PcInstance activeChar)
|
||||
{
|
||||
int x = activeChar.getX();
|
||||
int y = activeChar.getY();
|
||||
int z = activeChar.getZ();
|
||||
int heading = activeChar.getHeading();
|
||||
final int x = activeChar.getX();
|
||||
final int y = activeChar.getY();
|
||||
final int z = activeChar.getZ();
|
||||
final int heading = activeChar.getHeading();
|
||||
|
||||
Castle castle = CastleManager.getInstance().getCastle(activeChar);
|
||||
final Castle castle = CastleManager.getInstance().getCastle(activeChar);
|
||||
if (castle == null)
|
||||
{
|
||||
return -1;
|
||||
@@ -332,7 +332,7 @@ public final class MercTicketManager
|
||||
castle.getSiege().getSiegeGuardManager().hireMerc(x, y, z, heading, NPC_IDS[i]);
|
||||
|
||||
// create the ticket in the gameworld
|
||||
L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
|
||||
final L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
|
||||
dropticket.setItemLocation(ItemLocation.VOID);
|
||||
dropticket.dropMe(null, x, y, z);
|
||||
dropticket.setDropTime(0); // avoids it from beeing removed by the auto item destroyer
|
||||
@@ -348,7 +348,7 @@ public final class MercTicketManager
|
||||
|
||||
private void spawnMercenary(int npcId, int x, int y, int z, int despawnDelay)
|
||||
{
|
||||
L2NpcTemplate template = NpcData.getInstance().getTemplate(npcId);
|
||||
final L2NpcTemplate template = NpcData.getInstance().getTemplate(npcId);
|
||||
if (template != null)
|
||||
{
|
||||
final L2DefenderInstance npc = new L2DefenderInstance(template);
|
||||
@@ -386,7 +386,7 @@ public final class MercTicketManager
|
||||
*/
|
||||
public void removeTicket(L2ItemInstance item)
|
||||
{
|
||||
int itemId = item.getId();
|
||||
final int itemId = item.getId();
|
||||
int npcId = -1;
|
||||
|
||||
// find the FIRST ticket itemId with spawns the saved NPC in the saved location
|
||||
@@ -399,7 +399,7 @@ public final class MercTicketManager
|
||||
}
|
||||
}
|
||||
// find the castle where this item is
|
||||
Castle castle = CastleManager.getInstance().getCastleById(getTicketCastleId(itemId));
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(getTicketCastleId(itemId));
|
||||
|
||||
if ((npcId > 0) && (castle != null))
|
||||
{
|
||||
|
@@ -420,7 +420,7 @@ public final class PetitionManager
|
||||
{
|
||||
// Create a new petition instance and add it to the list of pending petitions.
|
||||
final Petition newPetition = new Petition(petitioner, petitionText, petitionType);
|
||||
int newPetitionId = newPetition.getId();
|
||||
final int newPetitionId = newPetition.getId();
|
||||
getPendingPetitions().put(newPetitionId, newPetition);
|
||||
|
||||
// Notify all GMs that a new petition has been submitted.
|
||||
|
@@ -40,9 +40,9 @@ public class PremiumManager
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
{
|
||||
PreparedStatement statement = con.prepareStatement("SELECT premium_service,enddate FROM account_premium WHERE account_name=?");
|
||||
final PreparedStatement statement = con.prepareStatement("SELECT premium_service,enddate FROM account_premium WHERE account_name=?");
|
||||
statement.setString(1, accountName);
|
||||
ResultSet rset = statement.executeQuery();
|
||||
final ResultSet rset = statement.executeQuery();
|
||||
while (rset.next())
|
||||
{
|
||||
if (Config.PREMIUM_SYSTEM_ENABLED)
|
||||
@@ -74,12 +74,12 @@ public class PremiumManager
|
||||
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
{
|
||||
Calendar endDate = Calendar.getInstance();
|
||||
final Calendar endDate = Calendar.getInstance();
|
||||
endDate.setTimeInMillis(System.currentTimeMillis() + remainingTime);
|
||||
endDate.set(Calendar.SECOND, 0);
|
||||
endDate.add(Calendar.MONTH, months);
|
||||
|
||||
PreparedStatement statement = con.prepareStatement("UPDATE account_premium SET premium_service=?,enddate=? WHERE account_name=?");
|
||||
final PreparedStatement statement = con.prepareStatement("UPDATE account_premium SET premium_service=?,enddate=? WHERE account_name=?");
|
||||
statement.setInt(1, 1);
|
||||
statement.setLong(2, endDate.getTimeInMillis());
|
||||
statement.setString(3, accountName);
|
||||
@@ -104,7 +104,7 @@ public class PremiumManager
|
||||
// TODO: Add check if account exists. XD
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
{
|
||||
PreparedStatement statement = con.prepareStatement("INSERT INTO account_premium (account_name,premium_service,enddate) values(?,?,?) ON DUPLICATE KEY UPDATE premium_service = ?, enddate = ?");
|
||||
final PreparedStatement statement = con.prepareStatement("INSERT INTO account_premium (account_name,premium_service,enddate) values(?,?,?) ON DUPLICATE KEY UPDATE premium_service = ?, enddate = ?");
|
||||
statement.setString(1, accountName);
|
||||
statement.setInt(2, 0);
|
||||
statement.setLong(3, 0);
|
||||
|
@@ -356,7 +356,7 @@ public class RaidBossSpawnManager
|
||||
continue;
|
||||
}
|
||||
|
||||
L2RaidBossInstance boss = _bosses.get(bossId);
|
||||
final L2RaidBossInstance boss = _bosses.get(bossId);
|
||||
|
||||
if (boss == null)
|
||||
{
|
||||
@@ -368,7 +368,7 @@ public class RaidBossSpawnManager
|
||||
updateStatus(boss, false);
|
||||
}
|
||||
|
||||
StatsSet info = _storedInfo.get(bossId);
|
||||
final StatsSet info = _storedInfo.get(bossId);
|
||||
|
||||
if (info == null)
|
||||
{
|
||||
@@ -415,7 +415,7 @@ public class RaidBossSpawnManager
|
||||
|
||||
for (int i : _bosses.keySet())
|
||||
{
|
||||
L2RaidBossInstance boss = _bosses.get(i);
|
||||
final L2RaidBossInstance boss = _bosses.get(i);
|
||||
|
||||
msg[index++] = boss.getName() + ": " + boss.getRaidStatus().name();
|
||||
}
|
||||
@@ -539,7 +539,7 @@ public class RaidBossSpawnManager
|
||||
{
|
||||
for (Integer bossId : _schedules.keySet())
|
||||
{
|
||||
ScheduledFuture<?> f = _schedules.get(bossId);
|
||||
final ScheduledFuture<?> f = _schedules.get(bossId);
|
||||
f.cancel(true);
|
||||
}
|
||||
_schedules.clear();
|
||||
|
@@ -145,8 +145,9 @@ public final class SiegeGuardManager
|
||||
{
|
||||
try
|
||||
{
|
||||
int hiredCount = 0, hiredMax = MercTicketManager.getInstance().getMaxAllowedMerc(_castle.getResidenceId());
|
||||
boolean isHired = (getCastle().getOwnerId() > 0) ? true : false;
|
||||
int hiredCount = 0;
|
||||
final int hiredMax = MercTicketManager.getInstance().getMaxAllowedMerc(_castle.getResidenceId());
|
||||
final boolean isHired = (getCastle().getOwnerId() > 0) ? true : false;
|
||||
loadSiegeGuard();
|
||||
for (L2Spawn spawn : _siegeGuardSpawn)
|
||||
{
|
||||
|
@@ -268,7 +268,7 @@ public final class SiegeManager
|
||||
|
||||
public final List<Siege> getSieges()
|
||||
{
|
||||
List<Siege> sieges = new ArrayList<>();
|
||||
final List<Siege> sieges = new ArrayList<>();
|
||||
for (Castle castle : CastleManager.getInstance().getCastles())
|
||||
{
|
||||
sieges.add(castle.getSiege());
|
||||
|
@@ -53,11 +53,11 @@ public final class TownManager
|
||||
|
||||
public static final boolean townHasCastleInSiege(int townId)
|
||||
{
|
||||
int castleIndex = getTownCastle(townId);
|
||||
final int castleIndex = getTownCastle(townId);
|
||||
|
||||
if (castleIndex > 0)
|
||||
{
|
||||
Castle castle = CastleManager.getInstance().getCastles().get(CastleManager.getInstance().getCastleIndex(castleIndex));
|
||||
final Castle castle = CastleManager.getInstance().getCastles().get(CastleManager.getInstance().getCastleIndex(castleIndex));
|
||||
if (castle != null)
|
||||
{
|
||||
return castle.getSiege().isInProgress();
|
||||
|
@@ -81,14 +81,14 @@ public final class WalkingManager implements IXmlReader
|
||||
@Override
|
||||
public void parseDocument(Document doc)
|
||||
{
|
||||
Node n = doc.getFirstChild();
|
||||
final Node n = doc.getFirstChild();
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
if (d.getNodeName().equals("route"))
|
||||
{
|
||||
final String routeName = parseString(d.getAttributes(), "name");
|
||||
boolean repeat = parseBoolean(d.getAttributes(), "repeat");
|
||||
String repeatStyle = d.getAttributes().getNamedItem("repeatStyle").getNodeValue();
|
||||
final boolean repeat = parseBoolean(d.getAttributes(), "repeat");
|
||||
final String repeatStyle = d.getAttributes().getNamedItem("repeatStyle").getNodeValue();
|
||||
byte repeatType;
|
||||
if (repeatStyle.equalsIgnoreCase("back"))
|
||||
{
|
||||
@@ -116,12 +116,12 @@ public final class WalkingManager implements IXmlReader
|
||||
{
|
||||
if (r.getNodeName().equals("point"))
|
||||
{
|
||||
NamedNodeMap attrs = r.getAttributes();
|
||||
int x = parseInteger(attrs, "X");
|
||||
int y = parseInteger(attrs, "Y");
|
||||
int z = parseInteger(attrs, "Z");
|
||||
int delay = parseInteger(attrs, "delay");
|
||||
boolean run = parseBoolean(attrs, "run");
|
||||
final NamedNodeMap attrs = r.getAttributes();
|
||||
final int x = parseInteger(attrs, "X");
|
||||
final int y = parseInteger(attrs, "Y");
|
||||
final int z = parseInteger(attrs, "Z");
|
||||
final int delay = parseInteger(attrs, "delay");
|
||||
final boolean run = parseBoolean(attrs, "run");
|
||||
NpcStringId npcString = null;
|
||||
String chatString = null;
|
||||
|
||||
@@ -161,15 +161,15 @@ public final class WalkingManager implements IXmlReader
|
||||
|
||||
else if (r.getNodeName().equals("target"))
|
||||
{
|
||||
NamedNodeMap attrs = r.getAttributes();
|
||||
final NamedNodeMap attrs = r.getAttributes();
|
||||
try
|
||||
{
|
||||
int npcId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
|
||||
int x = Integer.parseInt(attrs.getNamedItem("spawnX").getNodeValue());
|
||||
int y = Integer.parseInt(attrs.getNamedItem("spawnY").getNodeValue());
|
||||
int z = Integer.parseInt(attrs.getNamedItem("spawnZ").getNodeValue());
|
||||
final int npcId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
|
||||
final int x = Integer.parseInt(attrs.getNamedItem("spawnX").getNodeValue());
|
||||
final int y = Integer.parseInt(attrs.getNamedItem("spawnY").getNodeValue());
|
||||
final int z = Integer.parseInt(attrs.getNamedItem("spawnZ").getNodeValue());
|
||||
|
||||
NpcRoutesHolder holder = _routesToAttach.containsKey(npcId) ? _routesToAttach.get(npcId) : new NpcRoutesHolder();
|
||||
final NpcRoutesHolder holder = _routesToAttach.containsKey(npcId) ? _routesToAttach.get(npcId) : new NpcRoutesHolder();
|
||||
holder.addRoute(routeName, new Location(x, y, z));
|
||||
_routesToAttach.put(npcId, holder);
|
||||
}
|
||||
|
@@ -209,7 +209,7 @@ public final class ZoneManager implements IXmlReader
|
||||
if ("node".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
attrs = cd.getAttributes();
|
||||
int[] point = new int[2];
|
||||
final int[] point = new int[2];
|
||||
point[0] = parseInteger(attrs, "X");
|
||||
point[1] = parseInteger(attrs, "Y");
|
||||
rs.add(point);
|
||||
@@ -316,25 +316,25 @@ public final class ZoneManager implements IXmlReader
|
||||
if ("stat".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
attrs = cd.getAttributes();
|
||||
String name = attrs.getNamedItem("name").getNodeValue();
|
||||
String val = attrs.getNamedItem("val").getNodeValue();
|
||||
final String name = attrs.getNamedItem("name").getNodeValue();
|
||||
final String val = attrs.getNamedItem("val").getNodeValue();
|
||||
|
||||
temp.setParameter(name, val);
|
||||
}
|
||||
else if ("spawn".equalsIgnoreCase(cd.getNodeName()) && (temp instanceof L2ZoneRespawn))
|
||||
{
|
||||
attrs = cd.getAttributes();
|
||||
int spawnX = Integer.parseInt(attrs.getNamedItem("X").getNodeValue());
|
||||
int spawnY = Integer.parseInt(attrs.getNamedItem("Y").getNodeValue());
|
||||
int spawnZ = Integer.parseInt(attrs.getNamedItem("Z").getNodeValue());
|
||||
Node val = attrs.getNamedItem("type");
|
||||
final int spawnX = Integer.parseInt(attrs.getNamedItem("X").getNodeValue());
|
||||
final int spawnY = Integer.parseInt(attrs.getNamedItem("Y").getNodeValue());
|
||||
final int spawnZ = Integer.parseInt(attrs.getNamedItem("Z").getNodeValue());
|
||||
final Node val = attrs.getNamedItem("type");
|
||||
((L2ZoneRespawn) temp).parseLoc(spawnX, spawnY, spawnZ, val == null ? null : val.getNodeValue());
|
||||
}
|
||||
else if ("race".equalsIgnoreCase(cd.getNodeName()) && (temp instanceof L2RespawnZone))
|
||||
{
|
||||
attrs = cd.getAttributes();
|
||||
String race = attrs.getNamedItem("name").getNodeValue();
|
||||
String point = attrs.getNamedItem("point").getNodeValue();
|
||||
final String race = attrs.getNamedItem("name").getNodeValue();
|
||||
final String point = attrs.getNamedItem("point").getNodeValue();
|
||||
|
||||
((L2RespawnZone) temp).addRaceRespawnPoint(race, point);
|
||||
}
|
||||
@@ -605,7 +605,7 @@ public final class ZoneManager implements IXmlReader
|
||||
*/
|
||||
public List<NpcSpawnTerritory> getSpawnTerritories(L2Object object)
|
||||
{
|
||||
List<NpcSpawnTerritory> temp = new ArrayList<>();
|
||||
final List<NpcSpawnTerritory> temp = new ArrayList<>();
|
||||
for (NpcSpawnTerritory territory : _spawnTerritories.values())
|
||||
{
|
||||
if (territory.isInsideZone(object.getX(), object.getY(), object.getZ()))
|
||||
@@ -678,7 +678,7 @@ public final class ZoneManager implements IXmlReader
|
||||
double closestdis = Double.MAX_VALUE;
|
||||
for (T temp : (Collection<T>) _classZones.get(type).values())
|
||||
{
|
||||
double distance = temp.getDistanceToZone(obj);
|
||||
final double distance = temp.getDistanceToZone(obj);
|
||||
if (distance < closestdis)
|
||||
{
|
||||
closestdis = distance;
|
||||
|
@@ -180,7 +180,7 @@ public class Lottery
|
||||
_isStarted = true;
|
||||
|
||||
Broadcast.toAllOnlinePlayers("Lottery tickets are now available for Lucky Lottery #" + getId() + ".");
|
||||
Calendar finishtime = Calendar.getInstance();
|
||||
final Calendar finishtime = Calendar.getInstance();
|
||||
finishtime.setTimeInMillis(_enddate);
|
||||
finishtime.set(Calendar.MINUTE, 0);
|
||||
finishtime.set(Calendar.SECOND, 0);
|
||||
@@ -253,7 +253,7 @@ public class Lottery
|
||||
_log.info("Lottery: Ending lottery #" + getId() + ".");
|
||||
}
|
||||
|
||||
int[] luckynums = new int[5];
|
||||
final int[] luckynums = new int[5];
|
||||
int luckynum = 0;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
@@ -327,14 +327,14 @@ public class Lottery
|
||||
|
||||
for (int i = 1; i <= 16; i++)
|
||||
{
|
||||
int val = curenchant / 2;
|
||||
final int val = curenchant / 2;
|
||||
|
||||
if (val != Math.round((double) curenchant / 2))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
int val2 = curtype2 / 2;
|
||||
final int val2 = curtype2 / 2;
|
||||
|
||||
if (val2 != ((double) curtype2 / 2))
|
||||
{
|
||||
@@ -369,7 +369,7 @@ public class Lottery
|
||||
_log.log(Level.WARNING, "Lottery: Could restore lottery data: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
long prize4 = count4 * Config.ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
|
||||
final long prize4 = count4 * Config.ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
|
||||
long prize1 = 0;
|
||||
long prize2 = 0;
|
||||
long prize3 = 0;
|
||||
@@ -397,7 +397,7 @@ public class Lottery
|
||||
_log.info("Lottery: " + count4 + " players with ONE or TWO numbers each win " + prize4 + ".");
|
||||
}
|
||||
|
||||
long newprize = getPrize() - (prize1 + prize2 + prize3 + prize4);
|
||||
final long newprize = getPrize() - (prize1 + prize2 + prize3 + prize4);
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
_log.info("Lottery: Jackpot for next lottery is " + newprize + ".");
|
||||
@@ -449,13 +449,13 @@ public class Lottery
|
||||
|
||||
public int[] decodeNumbers(int enchant, int type2)
|
||||
{
|
||||
int res[] = new int[5];
|
||||
final int res[] = new int[5];
|
||||
int id = 0;
|
||||
int nr = 1;
|
||||
|
||||
while (enchant > 0)
|
||||
{
|
||||
int val = enchant / 2;
|
||||
final int val = enchant / 2;
|
||||
if (val != Math.round((double) enchant / 2))
|
||||
{
|
||||
res[id++] = nr;
|
||||
@@ -468,7 +468,7 @@ public class Lottery
|
||||
|
||||
while (type2 > 0)
|
||||
{
|
||||
int val = type2 / 2;
|
||||
final int val = type2 / 2;
|
||||
if (val != ((double) type2 / 2))
|
||||
{
|
||||
res[id++] = nr;
|
||||
@@ -487,7 +487,7 @@ public class Lottery
|
||||
|
||||
public long[] checkTicket(int id, int enchant, int type2)
|
||||
{
|
||||
long res[] =
|
||||
final long res[] =
|
||||
{
|
||||
0,
|
||||
0
|
||||
@@ -512,12 +512,12 @@ public class Lottery
|
||||
|
||||
for (int i = 1; i <= 16; i++)
|
||||
{
|
||||
int val = curenchant / 2;
|
||||
final int val = curenchant / 2;
|
||||
if (val != Math.round((double) curenchant / 2))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
int val2 = curtype2 / 2;
|
||||
final int val2 = curtype2 / 2;
|
||||
if (val2 != ((double) curtype2 / 2))
|
||||
{
|
||||
count++;
|
||||
|
@@ -54,7 +54,7 @@ public final class FourSepulchersChangeCoolDownTimeTask implements Runnable
|
||||
manager.setIsFirstTimeRun(false);
|
||||
}
|
||||
|
||||
long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
final long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
|
||||
manager.setChangeEntryTimeTask(ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeEntryTimeTask(), interval));
|
||||
final ScheduledFuture<?> changeCoolDownTimeTask = manager.getChangeCoolDownTimeTask();
|
||||
|
@@ -73,7 +73,7 @@ public final class MessageDeletionTask implements Runnable
|
||||
final L2PcInstance receiver = L2World.getInstance().getPlayer(msg.getReceiverId());
|
||||
if (receiver != null)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_MAIL_WAS_RETURNED_DUE_TO_THE_EXCEEDED_WAITING_TIME);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_MAIL_WAS_RETURNED_DUE_TO_THE_EXCEEDED_WAITING_TIME);
|
||||
// sm.addString(msg.getReceiverName());
|
||||
receiver.sendPacket(sm);
|
||||
}
|
||||
|
Reference in New Issue
Block a user