Added missing final modifiers.
This commit is contained in:
@@ -226,7 +226,7 @@ public class Auction
|
||||
/** Task Manage */
|
||||
private void startAutoTask()
|
||||
{
|
||||
long currentTime = System.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
long taskDelay = 0;
|
||||
if (_endDate <= currentTime)
|
||||
{
|
||||
@@ -463,7 +463,7 @@ public class Auction
|
||||
/**
|
||||
* If seller haven't sell ClanHall, auction removed, THIS MUST BE CONFIRMED
|
||||
*/
|
||||
int aucId = ClanHallAuctionManager.getInstance().getAuctionIndex(_id);
|
||||
final int aucId = ClanHallAuctionManager.getInstance().getAuctionIndex(_id);
|
||||
ClanHallAuctionManager.getInstance().getAuctions().remove(aucId);
|
||||
return;
|
||||
}
|
||||
@@ -473,7 +473,7 @@ public class Auction
|
||||
returnItem(_sellerClanName, ClanHallManager.getInstance().getAuctionableHallById(_itemId).getLease(), false);
|
||||
}
|
||||
deleteAuctionFromDB();
|
||||
L2Clan Clan = ClanTable.getInstance().getClanByName(_bidders.get(_highestBidderId).getClanName());
|
||||
final L2Clan Clan = ClanTable.getInstance().getClanByName(_bidders.get(_highestBidderId).getClanName());
|
||||
_bidders.remove(_highestBidderId);
|
||||
Clan.setAuctionBiddedAt(0, true);
|
||||
removeBids();
|
||||
|
||||
@@ -242,14 +242,14 @@ public final class BlockCheckerEngine
|
||||
|
||||
if (team == 0)
|
||||
{
|
||||
int points = _redTeamPoints.get(player) + 1;
|
||||
final int points = _redTeamPoints.get(player) + 1;
|
||||
_redTeamPoints.put(player, points);
|
||||
_redPoints++;
|
||||
_bluePoints--;
|
||||
}
|
||||
else
|
||||
{
|
||||
int points = _blueTeamPoints.get(player) + 1;
|
||||
final int points = _blueTeamPoints.get(player) + 1;
|
||||
_blueTeamPoints.put(player, points);
|
||||
_bluePoints++;
|
||||
_redPoints--;
|
||||
@@ -361,7 +361,7 @@ public final class BlockCheckerEngine
|
||||
}
|
||||
|
||||
// Send the secret client packet set up
|
||||
boolean isRed = _holder.getRedPlayers().contains(player);
|
||||
final boolean isRed = _holder.getRedPlayers().contains(player);
|
||||
|
||||
clientSetUp = new ExCubeGameExtendedChangePoints(300, _bluePoints, _redPoints, isRed, player, 0);
|
||||
player.sendPacket(clientSetUp);
|
||||
@@ -371,10 +371,10 @@ public final class BlockCheckerEngine
|
||||
// Teleport Player - Array access
|
||||
// Team 0 * 2 = 0; 0 = 0, 0 + 1 = 1.
|
||||
// Team 1 * 2 = 2; 2 = 2, 2 + 1 = 3
|
||||
int tc = _holder.getPlayerTeam(player) * 2;
|
||||
final int tc = _holder.getPlayerTeam(player) * 2;
|
||||
// Get x and y coordinates
|
||||
int x = _arenaCoordinates[_arena][tc];
|
||||
int y = _arenaCoordinates[_arena][tc + 1];
|
||||
final int x = _arenaCoordinates[_arena][tc];
|
||||
final int y = _arenaCoordinates[_arena][tc + 1];
|
||||
player.teleToLocation(x, y, _zCoord);
|
||||
// Set the player team
|
||||
if (isRed)
|
||||
@@ -493,7 +493,7 @@ public final class BlockCheckerEngine
|
||||
spawn.setRespawnDelay(1);
|
||||
SpawnTable.getInstance().addNewSpawn(spawn, false);
|
||||
spawn.init();
|
||||
L2BlockInstance block = (L2BlockInstance) spawn.getLastSpawn();
|
||||
final L2BlockInstance block = (L2BlockInstance) spawn.getLastSpawn();
|
||||
// switch color
|
||||
if ((random % 2) == 0)
|
||||
{
|
||||
@@ -541,8 +541,8 @@ public final class BlockCheckerEngine
|
||||
_redPoints += _numOfBoxes / 2;
|
||||
_bluePoints += _numOfBoxes / 2;
|
||||
|
||||
int timeLeft = (int) ((getStarterTime() - System.currentTimeMillis()) / 1000);
|
||||
ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
|
||||
final int timeLeft = (int) ((getStarterTime() - System.currentTimeMillis()) / 1000);
|
||||
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
|
||||
getHolder().broadCastPacketToTeam(changePoints);
|
||||
}
|
||||
}
|
||||
@@ -627,7 +627,7 @@ public final class BlockCheckerEngine
|
||||
{
|
||||
rewardAsWinner(true);
|
||||
rewardAsLooser(false);
|
||||
SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.THE_C1_TEAM_HAS_WON);
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.THE_C1_TEAM_HAS_WON);
|
||||
msg.addString("Red Team");
|
||||
_holder.broadCastPacketToTeam(msg);
|
||||
}
|
||||
@@ -635,7 +635,7 @@ public final class BlockCheckerEngine
|
||||
{
|
||||
rewardAsWinner(false);
|
||||
rewardAsLooser(true);
|
||||
SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.THE_C1_TEAM_HAS_WON);
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.THE_C1_TEAM_HAS_WON);
|
||||
msg.addString("Blue Team");
|
||||
_holder.broadCastPacketToTeam(msg);
|
||||
}
|
||||
@@ -652,7 +652,7 @@ public final class BlockCheckerEngine
|
||||
*/
|
||||
private void rewardAsWinner(boolean isRed)
|
||||
{
|
||||
Map<L2PcInstance, Integer> tempPoints = isRed ? _redTeamPoints : _blueTeamPoints;
|
||||
final Map<L2PcInstance, Integer> tempPoints = isRed ? _redTeamPoints : _blueTeamPoints;
|
||||
|
||||
// Main give
|
||||
for (Entry<L2PcInstance, Integer> points : tempPoints.entrySet())
|
||||
@@ -676,8 +676,8 @@ public final class BlockCheckerEngine
|
||||
L2PcInstance winner1 = null, winner2 = null;
|
||||
for (Entry<L2PcInstance, Integer> entry : tempPoints.entrySet())
|
||||
{
|
||||
L2PcInstance pc = entry.getKey();
|
||||
int pcPoints = entry.getValue();
|
||||
final L2PcInstance pc = entry.getKey();
|
||||
final int pcPoints = entry.getValue();
|
||||
if (pcPoints > first)
|
||||
{
|
||||
// Move old data
|
||||
@@ -709,11 +709,11 @@ public final class BlockCheckerEngine
|
||||
*/
|
||||
private void rewardAsLooser(boolean isRed)
|
||||
{
|
||||
Map<L2PcInstance, Integer> tempPoints = isRed ? _redTeamPoints : _blueTeamPoints;
|
||||
final Map<L2PcInstance, Integer> tempPoints = isRed ? _redTeamPoints : _blueTeamPoints;
|
||||
|
||||
for (Entry<L2PcInstance, Integer> entry : tempPoints.entrySet())
|
||||
{
|
||||
L2PcInstance player = entry.getKey();
|
||||
final L2PcInstance player = entry.getKey();
|
||||
if ((player != null) && (entry.getValue() >= 10))
|
||||
{
|
||||
player.addItem("Block Checker", 13067, 2, player, true);
|
||||
@@ -741,15 +741,15 @@ public final class BlockCheckerEngine
|
||||
// Set default arena
|
||||
player.setBlockCheckerArena(DEFAULT_ARENA);
|
||||
// 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);
|
||||
}
|
||||
broadcastRelationChanged(player);
|
||||
|
||||
@@ -164,7 +164,7 @@ public final class Castle extends AbstractResidence
|
||||
{
|
||||
return;
|
||||
}
|
||||
long currentTime = System.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (_endDate > currentTime)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new FunctionTask(cwh), _endDate - currentTime);
|
||||
@@ -466,7 +466,7 @@ public final class Castle extends AbstractResidence
|
||||
return;
|
||||
}
|
||||
|
||||
L2DoorInstance door = getDoor(doorId);
|
||||
final L2DoorInstance door = getDoor(doorId);
|
||||
if (door != null)
|
||||
{
|
||||
if (open)
|
||||
@@ -498,7 +498,7 @@ public final class Castle extends AbstractResidence
|
||||
// Remove old owner
|
||||
if ((getOwnerId() > 0) && ((clan == null) || (clan.getId() != getOwnerId())))
|
||||
{
|
||||
L2Clan oldOwner = ClanTable.getInstance().getClan(getOwnerId()); // Try to find clan instance
|
||||
final L2Clan oldOwner = ClanTable.getInstance().getClan(getOwnerId()); // Try to find clan instance
|
||||
if (oldOwner != null)
|
||||
{
|
||||
if (_formerOwner == null)
|
||||
@@ -511,7 +511,7 @@ public final class Castle extends AbstractResidence
|
||||
}
|
||||
try
|
||||
{
|
||||
L2PcInstance oldleader = oldOwner.getLeader().getPlayerInstance();
|
||||
final L2PcInstance oldleader = oldOwner.getLeader().getPlayerInstance();
|
||||
if (oldleader != null)
|
||||
{
|
||||
if (oldleader.getMountType() == MountType.WYVERN)
|
||||
@@ -734,7 +734,7 @@ public final class Castle extends AbstractResidence
|
||||
}
|
||||
else
|
||||
{
|
||||
int diffLease = lease - _function.get(type).getLease();
|
||||
final int diffLease = lease - _function.get(type).getLease();
|
||||
if (diffLease > 0)
|
||||
{
|
||||
_function.remove(type);
|
||||
@@ -997,9 +997,9 @@ public final class Castle extends AbstractResidence
|
||||
{
|
||||
if (_formerOwner != ClanTable.getInstance().getClan(getOwnerId()))
|
||||
{
|
||||
int maxreward = Math.max(0, _formerOwner.getReputationScore());
|
||||
final int maxreward = Math.max(0, _formerOwner.getReputationScore());
|
||||
_formerOwner.takeReputationScore(Config.LOOSE_CASTLE_POINTS, true);
|
||||
L2Clan owner = ClanTable.getInstance().getClan(getOwnerId());
|
||||
final L2Clan owner = ClanTable.getInstance().getClan(getOwnerId());
|
||||
if (owner != null)
|
||||
{
|
||||
owner.addReputationScore(Math.min(Config.TAKE_CASTLE_POINTS, maxreward), true);
|
||||
@@ -1012,7 +1012,7 @@ public final class Castle extends AbstractResidence
|
||||
}
|
||||
else
|
||||
{
|
||||
L2Clan owner = ClanTable.getInstance().getClan(getOwnerId());
|
||||
final L2Clan owner = ClanTable.getInstance().getClan(getOwnerId());
|
||||
if (owner != null)
|
||||
{
|
||||
owner.addReputationScore(Config.TAKE_CASTLE_POINTS, true);
|
||||
|
||||
@@ -130,7 +130,7 @@ public abstract class ClanHall
|
||||
{
|
||||
return;
|
||||
}
|
||||
long currentTime = System.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (_endDate > currentTime)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new FunctionTask(cwh), _endDate - currentTime);
|
||||
@@ -216,7 +216,7 @@ public abstract class ClanHall
|
||||
|
||||
if (_ownerId > 0)
|
||||
{
|
||||
L2Clan clan = ClanTable.getInstance().getClan(_ownerId);
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(_ownerId);
|
||||
if (clan != null)
|
||||
{
|
||||
clan.setHideoutId(getId());
|
||||
@@ -509,7 +509,7 @@ public abstract class ClanHall
|
||||
}
|
||||
else
|
||||
{
|
||||
int diffLease = lease - _functions.get(type).getLease();
|
||||
final int diffLease = lease - _functions.get(type).getLease();
|
||||
if (diffLease > 0)
|
||||
{
|
||||
_functions.remove(type);
|
||||
|
||||
@@ -75,8 +75,8 @@ public class Couple
|
||||
|
||||
public Couple(L2PcInstance player1, L2PcInstance player2)
|
||||
{
|
||||
int _tempPlayer1Id = player1.getObjectId();
|
||||
int _tempPlayer2Id = player2.getObjectId();
|
||||
final int _tempPlayer1Id = player1.getObjectId();
|
||||
final int _tempPlayer2Id = player2.getObjectId();
|
||||
|
||||
_player1Id = _tempPlayer1Id;
|
||||
_player2Id = _tempPlayer2Id;
|
||||
|
||||
@@ -496,12 +496,12 @@ public class Duel
|
||||
|
||||
_duelInstanceId = InstanceManager.getInstance().createDynamicInstance("PartyDuel.xml");
|
||||
|
||||
Instance instance = InstanceManager.getInstance().getInstance(_duelInstanceId);
|
||||
final Instance instance = InstanceManager.getInstance().getInstance(_duelInstanceId);
|
||||
|
||||
int i = 0;
|
||||
for (L2PcInstance player : _teamA)
|
||||
{
|
||||
Location loc = instance.getEnterLocs().get(i++);
|
||||
final Location loc = instance.getEnterLocs().get(i++);
|
||||
|
||||
player.teleToLocation(loc.getX(), loc.getY(), loc.getZ(), 0, _duelInstanceId, 0);
|
||||
}
|
||||
@@ -509,7 +509,7 @@ public class Duel
|
||||
i = 9;
|
||||
for (L2PcInstance player : _teamB)
|
||||
{
|
||||
Location loc = instance.getEnterLocs().get(i++);
|
||||
final Location loc = instance.getEnterLocs().get(i++);
|
||||
player.teleToLocation(loc.getX(), loc.getY(), loc.getZ(), 0, _duelInstanceId, 0);
|
||||
}
|
||||
}
|
||||
@@ -553,7 +553,7 @@ public class Duel
|
||||
*/
|
||||
private void playKneelAnimation()
|
||||
{
|
||||
List<L2PcInstance> looser = getLooser();
|
||||
final List<L2PcInstance> looser = getLooser();
|
||||
|
||||
if (looser == null)
|
||||
{
|
||||
@@ -791,7 +791,7 @@ public class Duel
|
||||
}
|
||||
if (teamdefeated)
|
||||
{
|
||||
List<L2PcInstance> winners = (isInTeamA ? _teamB : _teamA);
|
||||
final List<L2PcInstance> winners = (isInTeamA ? _teamB : _teamA);
|
||||
for (L2PcInstance temp : winners)
|
||||
{
|
||||
temp.setDuelState(DuelState.WINNER);
|
||||
|
||||
@@ -165,7 +165,7 @@ public final class Fort extends AbstractResidence
|
||||
{
|
||||
return;
|
||||
}
|
||||
long currentTime = System.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (_endDate > currentTime)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new FunctionTask(cwh), _endDate - currentTime);
|
||||
@@ -347,7 +347,7 @@ public final class Fort extends AbstractResidence
|
||||
return;
|
||||
}
|
||||
|
||||
L2DoorInstance door = getDoor(doorId);
|
||||
final L2DoorInstance door = getDoor(doorId);
|
||||
if (door != null)
|
||||
{
|
||||
if (open)
|
||||
@@ -392,7 +392,7 @@ public final class Fort extends AbstractResidence
|
||||
updateClansReputation(oldowner, true);
|
||||
try
|
||||
{
|
||||
L2PcInstance oldleader = oldowner.getLeader().getPlayerInstance();
|
||||
final L2PcInstance oldleader = oldowner.getLeader().getPlayerInstance();
|
||||
if (oldleader != null)
|
||||
{
|
||||
if (oldleader.getMountType() == MountType.WYVERN)
|
||||
@@ -449,7 +449,7 @@ public final class Fort extends AbstractResidence
|
||||
|
||||
public void removeOwner(boolean updateDB)
|
||||
{
|
||||
L2Clan clan = getOwnerClan();
|
||||
final L2Clan clan = getOwnerClan();
|
||||
if (clan != null)
|
||||
{
|
||||
for (L2PcInstance member : clan.getOnlineMembers(0))
|
||||
@@ -513,7 +513,7 @@ public final class Fort extends AbstractResidence
|
||||
*/
|
||||
public void setVisibleFlag(boolean val)
|
||||
{
|
||||
L2StaticObjectInstance flagPole = getFlagPole();
|
||||
final L2StaticObjectInstance flagPole = getFlagPole();
|
||||
if (flagPole != null)
|
||||
{
|
||||
flagPole.setMeshIndex(val ? 1 : 0);
|
||||
@@ -547,7 +547,7 @@ public final class Fort extends AbstractResidence
|
||||
// This method upgrade door
|
||||
public void upgradeDoor(int doorId, int hp, int pDef, int mDef)
|
||||
{
|
||||
L2DoorInstance door = getDoor(doorId);
|
||||
final L2DoorInstance door = getDoor(doorId);
|
||||
if (door != null)
|
||||
{
|
||||
door.setCurrentHp(door.getMaxHp() + hp);
|
||||
@@ -585,10 +585,10 @@ public final class Fort extends AbstractResidence
|
||||
}
|
||||
if (ownerId > 0)
|
||||
{
|
||||
L2Clan clan = ClanTable.getInstance().getClan(ownerId); // Try to find clan instance
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(ownerId); // Try to find clan instance
|
||||
clan.setFortId(getResidenceId());
|
||||
setOwnerClan(clan);
|
||||
int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
|
||||
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
|
||||
long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
|
||||
while (initial > (Config.FS_UPDATE_FRQ * 60000L))
|
||||
{
|
||||
@@ -697,7 +697,7 @@ public final class Fort extends AbstractResidence
|
||||
}
|
||||
else
|
||||
{
|
||||
int diffLease = lease - _function.get(type).getLease();
|
||||
final int diffLease = lease - _function.get(type).getLease();
|
||||
if (diffLease > 0)
|
||||
{
|
||||
_function.remove(type);
|
||||
@@ -801,7 +801,7 @@ public final class Fort extends AbstractResidence
|
||||
|
||||
private void updateOwnerInDB()
|
||||
{
|
||||
L2Clan clan = getOwnerClan();
|
||||
final L2Clan clan = getOwnerClan();
|
||||
int clanId = 0;
|
||||
if (clan != null)
|
||||
{
|
||||
@@ -1166,7 +1166,7 @@ public final class Fort extends AbstractResidence
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
L2Spawn spawnDat = new L2Spawn(rs.getInt("npcId"));
|
||||
final L2Spawn spawnDat = new L2Spawn(rs.getInt("npcId"));
|
||||
spawnDat.setAmount(1);
|
||||
spawnDat.setX(rs.getInt("x"));
|
||||
spawnDat.setY(rs.getInt("y"));
|
||||
|
||||
@@ -546,7 +546,7 @@ public class FortSiege implements Siegable
|
||||
final List<L2PcInstance> players = new LinkedList<>();
|
||||
for (L2SiegeClan siegeclan : getAttackerClans())
|
||||
{
|
||||
L2Clan clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
|
||||
for (L2PcInstance player : clan.getOnlineMembers(0))
|
||||
{
|
||||
if (player.isInSiege())
|
||||
@@ -574,7 +574,7 @@ public class FortSiege implements Siegable
|
||||
final List<L2PcInstance> players = new LinkedList<>();
|
||||
if (getFort().getOwnerClan() != null)
|
||||
{
|
||||
L2Clan clan = ClanTable.getInstance().getClan(getFort().getOwnerClan().getId());
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(getFort().getOwnerClan().getId());
|
||||
if (clan != getFort().getOwnerClan())
|
||||
{
|
||||
return null;
|
||||
@@ -600,10 +600,10 @@ public class FortSiege implements Siegable
|
||||
{
|
||||
if (!_commanders.isEmpty() && (getFort() != null))
|
||||
{
|
||||
L2Spawn spawn = instance.getSpawn();
|
||||
final L2Spawn spawn = instance.getSpawn();
|
||||
if (spawn != null)
|
||||
{
|
||||
List<FortSiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getResidenceId());
|
||||
final List<FortSiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getResidenceId());
|
||||
for (FortSiegeSpawn spawn2 : commanders)
|
||||
{
|
||||
if (spawn2.getId() == spawn.getId())
|
||||
@@ -953,7 +953,7 @@ public class FortSiege implements Siegable
|
||||
|
||||
private void setSiegeDateTime(boolean merchant)
|
||||
{
|
||||
Calendar newDate = Calendar.getInstance();
|
||||
final Calendar newDate = Calendar.getInstance();
|
||||
if (merchant)
|
||||
{
|
||||
newDate.add(Calendar.MINUTE, FortSiegeManager.getInstance().getSuspiciousMerchantRespawnDelay());
|
||||
@@ -1179,7 +1179,7 @@ public class FortSiege implements Siegable
|
||||
{
|
||||
if (clan != null)
|
||||
{
|
||||
L2SiegeClan sc = getAttackerClan(clan);
|
||||
final L2SiegeClan sc = getAttackerClan(clan);
|
||||
if (sc != null)
|
||||
{
|
||||
return sc.getFlag();
|
||||
|
||||
@@ -119,8 +119,8 @@ public class Hero
|
||||
{
|
||||
while (rset.next())
|
||||
{
|
||||
StatsSet hero = new StatsSet();
|
||||
int charId = rset.getInt(Olympiad.CHAR_ID);
|
||||
final StatsSet hero = new StatsSet();
|
||||
final int charId = rset.getInt(Olympiad.CHAR_ID);
|
||||
hero.set(Olympiad.CHAR_NAME, rset.getString(Olympiad.CHAR_NAME));
|
||||
hero.set(Olympiad.CLASS_ID, rset.getInt(Olympiad.CLASS_ID));
|
||||
hero.set(COUNT, rset.getInt(COUNT));
|
||||
@@ -138,8 +138,8 @@ public class Hero
|
||||
|
||||
while (rset2.next())
|
||||
{
|
||||
StatsSet hero = new StatsSet();
|
||||
int charId = rset2.getInt(Olympiad.CHAR_ID);
|
||||
final StatsSet hero = new StatsSet();
|
||||
final int charId = rset2.getInt(Olympiad.CHAR_ID);
|
||||
hero.set(Olympiad.CHAR_NAME, rset2.getString(Olympiad.CHAR_NAME));
|
||||
hero.set(Olympiad.CLASS_ID, rset2.getInt(Olympiad.CLASS_ID));
|
||||
hero.set(COUNT, rset2.getInt(COUNT));
|
||||
@@ -167,8 +167,8 @@ public class Hero
|
||||
{
|
||||
if (rs.next())
|
||||
{
|
||||
int clanId = rs.getInt("clanid");
|
||||
int allyId = rs.getInt("allyId");
|
||||
final int clanId = rs.getInt("clanid");
|
||||
final int allyId = rs.getInt("allyId");
|
||||
String clanName = "";
|
||||
String allyName = "";
|
||||
int clanCrest = 0;
|
||||
@@ -194,11 +194,11 @@ public class Hero
|
||||
|
||||
private String calcFightTime(long FightTime)
|
||||
{
|
||||
String format = String.format("%%0%dd", 2);
|
||||
final String format = String.format("%%0%dd", 2);
|
||||
FightTime = FightTime / 1000;
|
||||
String seconds = String.format(format, FightTime % 60);
|
||||
String minutes = String.format(format, (FightTime % 3600) / 60);
|
||||
String time = minutes + ":" + seconds;
|
||||
final String seconds = String.format(format, FightTime % 60);
|
||||
final String minutes = String.format(format, (FightTime % 3600) / 60);
|
||||
final String time = minutes + ":" + seconds;
|
||||
return time;
|
||||
}
|
||||
|
||||
@@ -238,18 +238,18 @@ public class Hero
|
||||
{
|
||||
while (rset.next())
|
||||
{
|
||||
StatsSet _diaryentry = new StatsSet();
|
||||
final StatsSet _diaryentry = new StatsSet();
|
||||
|
||||
long time = rset.getLong("time");
|
||||
int action = rset.getInt("action");
|
||||
int param = rset.getInt("param");
|
||||
final long time = rset.getLong("time");
|
||||
final int action = rset.getInt("action");
|
||||
final int param = rset.getInt("param");
|
||||
|
||||
String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(time));
|
||||
final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(time));
|
||||
_diaryentry.set("date", date);
|
||||
|
||||
if (action == ACTION_RAID_KILLED)
|
||||
{
|
||||
L2NpcTemplate template = NpcData.getInstance().getTemplate(param);
|
||||
final L2NpcTemplate template = NpcData.getInstance().getTemplate(param);
|
||||
if (template != null)
|
||||
{
|
||||
_diaryentry.set("action", template.getName() + " was defeated");
|
||||
@@ -261,7 +261,7 @@ public class Hero
|
||||
}
|
||||
else if (action == ACTION_CASTLE_TAKEN)
|
||||
{
|
||||
Castle castle = CastleManager.getInstance().getCastleById(param);
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(param);
|
||||
if (castle != null)
|
||||
{
|
||||
_diaryentry.set("action", castle.getName() + " Castle was successfuly taken");
|
||||
@@ -284,14 +284,14 @@ public class Hero
|
||||
public void loadFights(int charId)
|
||||
{
|
||||
final List<StatsSet> fights = new ArrayList<>();
|
||||
StatsSet heroCountData = new StatsSet();
|
||||
Calendar data = Calendar.getInstance();
|
||||
final StatsSet heroCountData = new StatsSet();
|
||||
final Calendar data = Calendar.getInstance();
|
||||
data.set(Calendar.DAY_OF_MONTH, 1);
|
||||
data.set(Calendar.HOUR_OF_DAY, 0);
|
||||
data.set(Calendar.MINUTE, 0);
|
||||
data.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
long from = data.getTimeInMillis();
|
||||
final long from = data.getTimeInMillis();
|
||||
int numberoffights = 0;
|
||||
int _victorys = 0;
|
||||
int _losses = 0;
|
||||
@@ -326,16 +326,16 @@ public class Hero
|
||||
|
||||
if (charId == charOneId)
|
||||
{
|
||||
String name = CharNameTable.getInstance().getNameById(charTwoId);
|
||||
String cls = ClassListData.getInstance().getClass(charTwoClass).getClientCode();
|
||||
final String name = CharNameTable.getInstance().getNameById(charTwoId);
|
||||
final String cls = ClassListData.getInstance().getClass(charTwoClass).getClientCode();
|
||||
if ((name != null) && (cls != null))
|
||||
{
|
||||
StatsSet fight = new StatsSet();
|
||||
final StatsSet fight = new StatsSet();
|
||||
fight.set("oponent", name);
|
||||
fight.set("oponentclass", cls);
|
||||
|
||||
fight.set("time", calcFightTime(time));
|
||||
String date = (new SimpleDateFormat("yyyy-MM-dd HH:mm")).format(new Date(start));
|
||||
final String date = (new SimpleDateFormat("yyyy-MM-dd HH:mm")).format(new Date(start));
|
||||
fight.set("start", date);
|
||||
|
||||
fight.set("classed", classed);
|
||||
@@ -362,16 +362,16 @@ public class Hero
|
||||
}
|
||||
else if (charId == charTwoId)
|
||||
{
|
||||
String name = CharNameTable.getInstance().getNameById(charOneId);
|
||||
String cls = ClassListData.getInstance().getClass(charOneClass).getClientCode();
|
||||
final String name = CharNameTable.getInstance().getNameById(charOneId);
|
||||
final String cls = ClassListData.getInstance().getClass(charOneClass).getClientCode();
|
||||
if ((name != null) && (cls != null))
|
||||
{
|
||||
StatsSet fight = new StatsSet();
|
||||
final StatsSet fight = new StatsSet();
|
||||
fight.set("oponent", name);
|
||||
fight.set("oponentclass", cls);
|
||||
|
||||
fight.set("time", calcFightTime(time));
|
||||
String date = (new SimpleDateFormat("yyyy-MM-dd HH:mm")).format(new Date(start));
|
||||
final String date = (new SimpleDateFormat("yyyy-MM-dd HH:mm")).format(new Date(start));
|
||||
fight.set("start", date);
|
||||
|
||||
fight.set("classed", classed);
|
||||
@@ -468,7 +468,7 @@ public class Hero
|
||||
for (int i = ((page - 1) * perpage); i < list.size(); i++)
|
||||
{
|
||||
breakat = i;
|
||||
StatsSet diaryEntry = list.get(i);
|
||||
final StatsSet diaryEntry = list.get(i);
|
||||
StringUtil.append(fList, "<tr><td>");
|
||||
if (color)
|
||||
{
|
||||
@@ -556,7 +556,7 @@ public class Hero
|
||||
for (int i = ((page - 1) * perpage); i < heroFights.size(); i++)
|
||||
{
|
||||
breakat = i;
|
||||
StatsSet fight = heroFights.get(i);
|
||||
final StatsSet fight = heroFights.get(i);
|
||||
StringUtil.append(fList, "<tr><td>");
|
||||
if (color)
|
||||
{
|
||||
@@ -630,7 +630,7 @@ public class Hero
|
||||
|
||||
for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
|
||||
{
|
||||
L2ItemInstance equippedItem = player.getInventory().getPaperdollItem(i);
|
||||
final L2ItemInstance equippedItem = player.getInventory().getPaperdollItem(i);
|
||||
if ((equippedItem != null) && equippedItem.isHeroItem())
|
||||
{
|
||||
player.getInventory().unEquipItemInSlot(i);
|
||||
@@ -666,12 +666,12 @@ public class Hero
|
||||
|
||||
for (StatsSet hero : newHeroes)
|
||||
{
|
||||
int charId = hero.getInt(Olympiad.CHAR_ID);
|
||||
final int charId = hero.getInt(Olympiad.CHAR_ID);
|
||||
|
||||
if (COMPLETE_HEROS.containsKey(charId))
|
||||
{
|
||||
StatsSet oldHero = COMPLETE_HEROS.get(charId);
|
||||
int count = oldHero.getInt(COUNT);
|
||||
final StatsSet oldHero = COMPLETE_HEROS.get(charId);
|
||||
final int count = oldHero.getInt(COUNT);
|
||||
oldHero.set(COUNT, count + 1);
|
||||
oldHero.set(PLAYED, 1);
|
||||
oldHero.set(CLAIMED, false);
|
||||
@@ -679,7 +679,7 @@ public class Hero
|
||||
}
|
||||
else
|
||||
{
|
||||
StatsSet newHero = new StatsSet();
|
||||
final StatsSet newHero = new StatsSet();
|
||||
newHero.set(Olympiad.CHAR_NAME, hero.getString(Olympiad.CHAR_NAME));
|
||||
newHero.set(Olympiad.CLASS_ID, hero.getInt(Olympiad.CLASS_ID));
|
||||
newHero.set(COUNT, 1);
|
||||
@@ -731,8 +731,8 @@ public class Hero
|
||||
{
|
||||
if (rset.next())
|
||||
{
|
||||
int clanId = rset.getInt("clanid");
|
||||
int allyId = rset.getInt("allyId");
|
||||
final int clanId = rset.getInt("clanid");
|
||||
final int allyId = rset.getInt("allyId");
|
||||
|
||||
String clanName = "";
|
||||
String allyName = "";
|
||||
|
||||
@@ -409,7 +409,7 @@ public final class Instance
|
||||
{
|
||||
if (door != null)
|
||||
{
|
||||
L2WorldRegion region = door.getWorldRegion();
|
||||
final L2WorldRegion region = door.getWorldRegion();
|
||||
door.decayMe();
|
||||
|
||||
if (region != null)
|
||||
@@ -453,11 +453,11 @@ public final class Instance
|
||||
public void loadInstanceTemplate(String filename)
|
||||
{
|
||||
Document doc = null;
|
||||
File xml = new File(Config.DATAPACK_ROOT, "instances/" + filename);
|
||||
final File xml = new File(Config.DATAPACK_ROOT, "instances/" + filename);
|
||||
|
||||
try
|
||||
{
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setValidating(false);
|
||||
factory.setIgnoringComments(true);
|
||||
doc = factory.newDocumentBuilder().parse(xml);
|
||||
@@ -493,7 +493,7 @@ public final class Instance
|
||||
{
|
||||
_allowRandomWalk = Boolean.parseBoolean(a.getNodeValue());
|
||||
}
|
||||
Node first = n.getFirstChild();
|
||||
final Node first = n.getFirstChild();
|
||||
for (n = first; n != null; n = n.getNextSibling())
|
||||
{
|
||||
switch (n.getNodeName().toLowerCase())
|
||||
@@ -562,15 +562,15 @@ public final class Instance
|
||||
if ("door".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
doorId = Integer.parseInt(d.getAttributes().getNamedItem("doorId").getNodeValue());
|
||||
StatsSet set = new StatsSet();
|
||||
final StatsSet set = new StatsSet();
|
||||
set.add(DoorData.getInstance().getDoorTemplate(doorId));
|
||||
for (Node bean = d.getFirstChild(); bean != null; bean = bean.getNextSibling())
|
||||
{
|
||||
if ("set".equalsIgnoreCase(bean.getNodeName()))
|
||||
{
|
||||
NamedNodeMap attrs = bean.getAttributes();
|
||||
String setname = attrs.getNamedItem("name").getNodeValue();
|
||||
String value = attrs.getNamedItem("val").getNodeValue();
|
||||
final NamedNodeMap attrs = bean.getAttributes();
|
||||
final String setname = attrs.getNamedItem("name").getNodeValue();
|
||||
final String value = attrs.getNamedItem("val").getNodeValue();
|
||||
set.set(setname, value);
|
||||
}
|
||||
}
|
||||
@@ -585,8 +585,8 @@ public final class Instance
|
||||
{
|
||||
if ("group".equalsIgnoreCase(group.getNodeName()))
|
||||
{
|
||||
String spawnGroup = group.getAttributes().getNamedItem("name").getNodeValue();
|
||||
List<L2Spawn> manualSpawn = new ArrayList<>();
|
||||
final String spawnGroup = group.getAttributes().getNamedItem("name").getNodeValue();
|
||||
final List<L2Spawn> manualSpawn = new ArrayList<>();
|
||||
for (Node d = group.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
int npcId = 0, x = 0, y = 0, z = 0, heading = 0, respawn = 0, respawnRandom = 0, delay = -1;
|
||||
@@ -686,9 +686,9 @@ public final class Instance
|
||||
}
|
||||
case "exitpoint":
|
||||
{
|
||||
int x = Integer.parseInt(n.getAttributes().getNamedItem("x").getNodeValue());
|
||||
int y = Integer.parseInt(n.getAttributes().getNamedItem("y").getNodeValue());
|
||||
int z = Integer.parseInt(n.getAttributes().getNamedItem("z").getNodeValue());
|
||||
final int x = Integer.parseInt(n.getAttributes().getNamedItem("x").getNodeValue());
|
||||
final int y = Integer.parseInt(n.getAttributes().getNamedItem("y").getNodeValue());
|
||||
final int z = Integer.parseInt(n.getAttributes().getNamedItem("z").getNodeValue());
|
||||
_exitLocation = new Location(x, y, z);
|
||||
break;
|
||||
}
|
||||
@@ -701,9 +701,9 @@ public final class Instance
|
||||
{
|
||||
try
|
||||
{
|
||||
int x = Integer.parseInt(loc.getAttributes().getNamedItem("x").getNodeValue());
|
||||
int y = Integer.parseInt(loc.getAttributes().getNamedItem("y").getNodeValue());
|
||||
int z = Integer.parseInt(loc.getAttributes().getNamedItem("z").getNodeValue());
|
||||
final int x = Integer.parseInt(loc.getAttributes().getNamedItem("x").getNodeValue());
|
||||
final int y = Integer.parseInt(loc.getAttributes().getNamedItem("y").getNodeValue());
|
||||
final int z = Integer.parseInt(loc.getAttributes().getNamedItem("z").getNodeValue());
|
||||
_enterLocations.add(new Location(x, y, z));
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -806,7 +806,7 @@ public final class Instance
|
||||
else if (_players.isEmpty() && (_emptyDestroyTime > 0))
|
||||
{
|
||||
|
||||
Long emptyTimeLeft = (_lastLeft + _emptyDestroyTime) - System.currentTimeMillis();
|
||||
final Long emptyTimeLeft = (_lastLeft + _emptyDestroyTime) - System.currentTimeMillis();
|
||||
if (emptyTimeLeft <= 0)
|
||||
{
|
||||
interval = 0;
|
||||
@@ -837,7 +837,7 @@ public final class Instance
|
||||
{
|
||||
timeLeft = remaining / 60000;
|
||||
interval = 300000;
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES);
|
||||
sm.addString(Integer.toString(timeLeft));
|
||||
Broadcast.toPlayersInInstance(sm, getId());
|
||||
remaining = remaining - 300000;
|
||||
@@ -846,7 +846,7 @@ public final class Instance
|
||||
{
|
||||
timeLeft = remaining / 60000;
|
||||
interval = 60000;
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES);
|
||||
sm.addString(Integer.toString(timeLeft));
|
||||
Broadcast.toPlayersInInstance(sm, getId());
|
||||
remaining = remaining - 60000;
|
||||
|
||||
@@ -202,7 +202,7 @@ public class L2Event
|
||||
{
|
||||
SpawnTable.getInstance().forEachSpawn(spawn ->
|
||||
{
|
||||
L2Npc npc = spawn.getLastSpawn();
|
||||
final L2Npc npc = spawn.getLastSpawn();
|
||||
if ((npc != null) && npc.isEventMob())
|
||||
{
|
||||
npc.deleteMe();
|
||||
@@ -289,9 +289,9 @@ public class L2Event
|
||||
player.getPoly().setPolyInfo(null, "1");
|
||||
player.decayMe();
|
||||
player.spawnMe(player.getX(), player.getY(), player.getZ());
|
||||
CharInfo info1 = new CharInfo(player);
|
||||
final CharInfo info1 = new CharInfo(player);
|
||||
player.broadcastPacket(info1);
|
||||
UserInfo info2 = new UserInfo(player);
|
||||
final UserInfo info2 = new UserInfo(player);
|
||||
player.sendPacket(info2);
|
||||
|
||||
player.stopTransformation(true);
|
||||
@@ -305,7 +305,7 @@ public class L2Event
|
||||
player.setEventStatus(null);
|
||||
|
||||
_registeredPlayers.remove(player);
|
||||
int teamId = getPlayerTeamId(player);
|
||||
final int teamId = getPlayerTeamId(player);
|
||||
if (_teams.containsKey(teamId))
|
||||
{
|
||||
_teams.get(teamId).remove(player);
|
||||
@@ -379,7 +379,7 @@ public class L2Event
|
||||
_eventInfo = br.readLine();
|
||||
}
|
||||
|
||||
List<L2PcInstance> temp = new LinkedList<>();
|
||||
final List<L2PcInstance> temp = new LinkedList<>();
|
||||
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
||||
{
|
||||
if (!player.isOnline())
|
||||
|
||||
@@ -218,7 +218,7 @@ public class Message
|
||||
|
||||
public static final PreparedStatement getStatement(Message msg, Connection con) throws SQLException
|
||||
{
|
||||
PreparedStatement stmt = con.prepareStatement("INSERT INTO messages (messageId, senderId, receiverId, subject, content, expiration, reqAdena, hasAttachments, isUnread, isDeletedBySender, isDeletedByReceiver, sendBySystem, isReturned, itemId, enchantLvl, elementals) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
final PreparedStatement stmt = con.prepareStatement("INSERT INTO messages (messageId, senderId, receiverId, subject, content, expiration, reqAdena, hasAttachments, isUnread, isDeletedBySender, isDeletedByReceiver, sendBySystem, isReturned, itemId, enchantLvl, elementals) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
|
||||
stmt.setInt(1, msg._messageId);
|
||||
stmt.setInt(2, msg._senderId);
|
||||
|
||||
@@ -99,38 +99,38 @@ public class Siege implements Siegable
|
||||
|
||||
try
|
||||
{
|
||||
long timeRemaining = _siegeEndDate.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
final long timeRemaining = _siegeEndDate.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
if (timeRemaining > 3600000)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HOUR_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HOUR_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
|
||||
sm.addInt(2);
|
||||
announceToPlayer(sm, true);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 3600000); // Prepare task for 1 hr left.
|
||||
}
|
||||
else if ((timeRemaining <= 3600000) && (timeRemaining > 600000))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
|
||||
sm.addInt((int) timeRemaining / 60000);
|
||||
announceToPlayer(sm, true);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 600000); // Prepare task for 10 minute left.
|
||||
}
|
||||
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
|
||||
sm.addInt((int) timeRemaining / 60000);
|
||||
announceToPlayer(sm, true);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 300000); // Prepare task for 5 minute left.
|
||||
}
|
||||
else if ((timeRemaining <= 300000) && (timeRemaining > 10000))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
|
||||
sm.addInt((int) timeRemaining / 60000);
|
||||
announceToPlayer(sm, true);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 10000); // Prepare task for 10 seconds count down
|
||||
}
|
||||
else if ((timeRemaining <= 10000) && (timeRemaining > 0))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_CASTLE_SIEGE_WILL_END_IN_S1_SECOND_S);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_CASTLE_SIEGE_WILL_END_IN_S1_SECOND_S);
|
||||
sm.addInt((int) timeRemaining / 1000);
|
||||
announceToPlayer(sm, true);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleEndSiegeTask(_castleInst), timeRemaining); // Prepare task for second count down
|
||||
@@ -169,7 +169,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
if (!getIsTimeRegistrationOver())
|
||||
{
|
||||
long regTimeRemaining = getTimeRegistrationOverDate().getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
final long regTimeRemaining = getTimeRegistrationOverDate().getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
if (regTimeRemaining > 0)
|
||||
{
|
||||
_scheduledStartSiegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleStartSiegeTask(_castleInst), regTimeRemaining);
|
||||
@@ -178,14 +178,14 @@ public class Siege implements Siegable
|
||||
endTimeRegistration(true);
|
||||
}
|
||||
|
||||
long timeRemaining = getSiegeDate().getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
final long timeRemaining = getSiegeDate().getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
if (timeRemaining > 86400000)
|
||||
{
|
||||
_scheduledStartSiegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 86400000); // Prepare task for 24 before siege start to end registration
|
||||
}
|
||||
else if ((timeRemaining <= 86400000) && (timeRemaining > 13600000))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_REGISTRATION_TERM_FOR_S1_HAS_ENDED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_REGISTRATION_TERM_FOR_S1_HAS_ENDED);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
_isRegistrationOver = true;
|
||||
@@ -256,7 +256,7 @@ public class Siege implements Siegable
|
||||
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
{
|
||||
L2Clan clan = ClanTable.getInstance().getClan(getCastle().getOwnerId());
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(getCastle().getOwnerId());
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CLAN_S1_IS_VICTORIOUS_OVER_S2_S_CASTLE_SIEGE);
|
||||
sm.addString(clan.getName());
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
@@ -274,7 +274,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
if (member != null)
|
||||
{
|
||||
L2PcInstance player = member.getPlayerInstance();
|
||||
final L2PcInstance player = member.getPlayerInstance();
|
||||
if ((player != null) && player.isNoble())
|
||||
{
|
||||
Hero.getInstance().setCastleTaken(player.getObjectId(), getCastle().getResidenceId());
|
||||
@@ -400,7 +400,7 @@ public class Siege implements Siegable
|
||||
(getAttackerClans().size() == 1 // Only 1 attacker
|
||||
))
|
||||
{
|
||||
L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
removeAttacker(sc_newowner);
|
||||
addDefender(sc_newowner, SiegeClanType.OWNER);
|
||||
endSiege();
|
||||
@@ -408,7 +408,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
{
|
||||
int allyId = ClanTable.getInstance().getClan(getCastle().getOwnerId()).getAllyId();
|
||||
final int allyId = ClanTable.getInstance().getClan(getCastle().getOwnerId()).getAllyId();
|
||||
if (getDefenderClans().isEmpty()) // If defender doesn't exist (Pc vs Npc)
|
||||
// and only an alliance attacks
|
||||
{
|
||||
@@ -428,7 +428,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
if (allinsamealliance)
|
||||
{
|
||||
L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
removeAttacker(sc_newowner);
|
||||
addDefender(sc_newowner, SiegeClanType.OWNER);
|
||||
endSiege();
|
||||
@@ -446,7 +446,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
}
|
||||
|
||||
L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
removeAttacker(sc_newowner);
|
||||
addDefender(sc_newowner, SiegeClanType.OWNER);
|
||||
|
||||
@@ -529,7 +529,7 @@ public class Siege implements Siegable
|
||||
_siegeEndDate.add(Calendar.MINUTE, SiegeManager.getInstance().getSiegeLength());
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleEndSiegeTask(getCastle()), 1000); // Prepare auto end task
|
||||
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_S1_SIEGE_HAS_STARTED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_S1_SIEGE_HAS_STARTED);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
|
||||
@@ -548,7 +548,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
for (L2SiegeClan siegeClans : getDefenderClans())
|
||||
{
|
||||
L2Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||
for (L2PcInstance member : clan.getOnlineMembers(0))
|
||||
{
|
||||
member.sendPacket(message);
|
||||
@@ -559,7 +559,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
for (L2SiegeClan siegeClans : getAttackerClans())
|
||||
{
|
||||
L2Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(siegeClans.getClanId());
|
||||
for (L2PcInstance member : clan.getOnlineMembers(0))
|
||||
{
|
||||
if (member != null)
|
||||
@@ -612,7 +612,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
|
||||
final int relation = member.getRelation(player);
|
||||
Integer oldrelation = member.getKnownList().getKnownRelations().get(player.getObjectId());
|
||||
final Integer oldrelation = member.getKnownList().getKnownRelations().get(player.getObjectId());
|
||||
if ((oldrelation == null) || (oldrelation != relation))
|
||||
{
|
||||
final RelationChanged rc = new RelationChanged();
|
||||
@@ -679,7 +679,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
|
||||
final int relation = member.getRelation(player);
|
||||
Integer oldrelation = member.getKnownList().getKnownRelations().get(player.getObjectId());
|
||||
final Integer oldrelation = member.getKnownList().getKnownRelations().get(player.getObjectId());
|
||||
if ((oldrelation == null) || (oldrelation != relation))
|
||||
{
|
||||
final RelationChanged rc = new RelationChanged();
|
||||
@@ -819,7 +819,7 @@ public class Siege implements Siegable
|
||||
@Override
|
||||
public List<L2PcInstance> getAttackersInZone()
|
||||
{
|
||||
List<L2PcInstance> players = new ArrayList<>();
|
||||
final List<L2PcInstance> players = new ArrayList<>();
|
||||
L2Clan clan;
|
||||
for (L2SiegeClan siegeclan : getAttackerClans())
|
||||
{
|
||||
@@ -848,7 +848,7 @@ public class Siege implements Siegable
|
||||
*/
|
||||
public List<L2PcInstance> getOwnersInZone()
|
||||
{
|
||||
List<L2PcInstance> players = new ArrayList<>();
|
||||
final List<L2PcInstance> players = new ArrayList<>();
|
||||
L2Clan clan;
|
||||
for (L2SiegeClan siegeclan : getDefenderClans())
|
||||
{
|
||||
@@ -873,7 +873,7 @@ public class Siege implements Siegable
|
||||
*/
|
||||
public List<L2PcInstance> getSpectatorsInZone()
|
||||
{
|
||||
List<L2PcInstance> players = new ArrayList<>();
|
||||
final List<L2PcInstance> players = new ArrayList<>();
|
||||
|
||||
for (L2PcInstance player : getCastle().getZone().getPlayersInside())
|
||||
{
|
||||
@@ -1193,7 +1193,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
if (getIsRegistrationOver())
|
||||
{
|
||||
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.addCastleId(getCastle().getResidenceId());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
@@ -1518,7 +1518,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
}
|
||||
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_ANNOUNCED_THE_NEXT_CASTLE_SIEGE_TIME);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_ANNOUNCED_THE_NEXT_CASTLE_SIEGE_TIME);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
|
||||
@@ -1596,7 +1596,7 @@ public class Siege implements Siegable
|
||||
continue;
|
||||
}
|
||||
|
||||
double distance = ct.calculateDistance(spawn, true, true);
|
||||
final double distance = ct.calculateDistance(spawn, true, true);
|
||||
|
||||
if (distance < distanceClosest)
|
||||
{
|
||||
@@ -1757,7 +1757,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
if (clan != null)
|
||||
{
|
||||
L2SiegeClan sc = getAttackerClan(clan);
|
||||
final L2SiegeClan sc = getAttackerClan(clan);
|
||||
if (sc != null)
|
||||
{
|
||||
return sc.getFlag();
|
||||
|
||||
@@ -175,7 +175,7 @@ public class TvTEvent
|
||||
setState(EventState.STARTING);
|
||||
|
||||
// Randomize and balance team distribution
|
||||
Map<Integer, L2PcInstance> allParticipants = new HashMap<>();
|
||||
final Map<Integer, L2PcInstance> allParticipants = new HashMap<>();
|
||||
allParticipants.putAll(_teams[0].getParticipatedPlayers());
|
||||
allParticipants.putAll(_teams[1].getParticipatedPlayers());
|
||||
_teams[0].cleanMe();
|
||||
@@ -196,11 +196,12 @@ public class TvTEvent
|
||||
}
|
||||
}
|
||||
|
||||
int balance[] =
|
||||
final int balance[] =
|
||||
{
|
||||
0,
|
||||
0
|
||||
}, priority = 0, highestLevelPlayerId;
|
||||
};
|
||||
int priority = 0, highestLevelPlayerId;
|
||||
L2PcInstance highestLevelPlayer;
|
||||
// TODO: allParticipants should be sorted by level instead of using highestLevelPcInstanceOf for every fetch
|
||||
while (!allParticipants.isEmpty())
|
||||
@@ -346,7 +347,7 @@ public class TvTEvent
|
||||
setState(EventState.REWARDING);
|
||||
|
||||
// Get team which has more points
|
||||
TvTEventTeam team = _teams[_teams[0].getPoints() > _teams[1].getPoints() ? 0 : 1];
|
||||
final TvTEventTeam team = _teams[_teams[0].getPoints() > _teams[1].getPoints() ? 0 : 1];
|
||||
rewardTeam(team);
|
||||
|
||||
// Notify to scripts.
|
||||
@@ -370,7 +371,7 @@ public class TvTEvent
|
||||
// Iterate over all tvt event rewards
|
||||
for (int[] reward : Config.TVT_EVENT_REWARDS)
|
||||
{
|
||||
PcInventory inv = playerInstance.getInventory();
|
||||
final PcInventory inv = playerInstance.getInventory();
|
||||
|
||||
// Check for stackable item, non stackabe items need to be added one by one
|
||||
if (ItemTable.getInstance().getTemplate(reward[0]).isStackable())
|
||||
@@ -496,7 +497,7 @@ public class TvTEvent
|
||||
public static boolean removeParticipant(int playerObjectId)
|
||||
{
|
||||
// Get the teamId of the player
|
||||
byte teamId = getParticipantTeamId(playerObjectId);
|
||||
final byte teamId = getParticipantTeamId(playerObjectId);
|
||||
|
||||
// Check if the player is participant
|
||||
if (teamId != -1)
|
||||
@@ -532,8 +533,8 @@ public class TvTEvent
|
||||
|
||||
public static String getParticipationFee()
|
||||
{
|
||||
int itemId = Config.TVT_EVENT_PARTICIPATION_FEE[0];
|
||||
int itemNum = Config.TVT_EVENT_PARTICIPATION_FEE[1];
|
||||
final int itemId = Config.TVT_EVENT_PARTICIPATION_FEE[0];
|
||||
final int itemNum = Config.TVT_EVENT_PARTICIPATION_FEE[1];
|
||||
|
||||
if ((itemId == 0) || (itemNum == 0))
|
||||
{
|
||||
@@ -645,7 +646,7 @@ public class TvTEvent
|
||||
return;
|
||||
}
|
||||
|
||||
byte teamId = getParticipantTeamId(playerInstance.getObjectId());
|
||||
final byte teamId = getParticipantTeamId(playerInstance.getObjectId());
|
||||
|
||||
if (teamId == -1)
|
||||
{
|
||||
@@ -691,8 +692,8 @@ public class TvTEvent
|
||||
return true;
|
||||
}
|
||||
|
||||
byte playerTeamId = getParticipantTeamId(playerInstance.getObjectId());
|
||||
byte targetedPlayerTeamId = getParticipantTeamId(targetedPlayerObjectId);
|
||||
final byte playerTeamId = getParticipantTeamId(playerInstance.getObjectId());
|
||||
final byte targetedPlayerTeamId = getParticipantTeamId(targetedPlayerObjectId);
|
||||
|
||||
if (((playerTeamId != -1) && (targetedPlayerTeamId == -1)) || ((playerTeamId == -1) && (targetedPlayerTeamId != -1)))
|
||||
{
|
||||
@@ -801,7 +802,7 @@ public class TvTEvent
|
||||
return;
|
||||
}
|
||||
|
||||
byte killedTeamId = getParticipantTeamId(killedPlayerInstance.getObjectId());
|
||||
final byte killedTeamId = getParticipantTeamId(killedPlayerInstance.getObjectId());
|
||||
|
||||
if (killedTeamId == -1)
|
||||
{
|
||||
@@ -835,15 +836,15 @@ public class TvTEvent
|
||||
return;
|
||||
}
|
||||
|
||||
byte killerTeamId = getParticipantTeamId(killerPlayerInstance.getObjectId());
|
||||
final byte killerTeamId = getParticipantTeamId(killerPlayerInstance.getObjectId());
|
||||
|
||||
if ((killerTeamId != -1) && (killedTeamId != -1) && (killerTeamId != killedTeamId))
|
||||
{
|
||||
TvTEventTeam killerTeam = _teams[killerTeamId];
|
||||
final TvTEventTeam killerTeam = _teams[killerTeamId];
|
||||
|
||||
killerTeam.increasePoints();
|
||||
|
||||
CreatureSay cs = new CreatureSay(killerPlayerInstance.getObjectId(), ChatType.WHISPER, killerPlayerInstance.getName(), "I have killed " + killedPlayerInstance.getName() + "!");
|
||||
final CreatureSay cs = new CreatureSay(killerPlayerInstance.getObjectId(), ChatType.WHISPER, killerPlayerInstance.getName(), "I have killed " + killedPlayerInstance.getName() + "!");
|
||||
|
||||
for (L2PcInstance playerInstance : _teams[killerTeamId].getParticipatedPlayers().values())
|
||||
{
|
||||
@@ -875,7 +876,7 @@ public class TvTEvent
|
||||
{
|
||||
for (Entry<Integer, Integer> e : Config.TVT_EVENT_MAGE_BUFFS.entrySet())
|
||||
{
|
||||
Skill skill = SkillData.getInstance().getSkill(e.getKey(), e.getValue());
|
||||
final Skill skill = SkillData.getInstance().getSkill(e.getKey(), e.getValue());
|
||||
if (skill != null)
|
||||
{
|
||||
skill.applyEffects(playerInstance, playerInstance);
|
||||
@@ -889,7 +890,7 @@ public class TvTEvent
|
||||
{
|
||||
for (Entry<Integer, Integer> e : Config.TVT_EVENT_FIGHTER_BUFFS.entrySet())
|
||||
{
|
||||
Skill skill = SkillData.getInstance().getSkill(e.getKey(), e.getValue());
|
||||
final Skill skill = SkillData.getInstance().getSkill(e.getKey(), e.getValue());
|
||||
if (skill != null)
|
||||
{
|
||||
skill.applyEffects(playerInstance, playerInstance);
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TvTEventTeleporter implements Runnable
|
||||
_coordinates = coordinates;
|
||||
_adminRemove = adminRemove;
|
||||
|
||||
long delay = (TvTEvent.isStarted() ? Config.TVT_EVENT_RESPAWN_TELEPORT_DELAY : Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY) * 1000;
|
||||
final long delay = (TvTEvent.isStarted() ? Config.TVT_EVENT_RESPAWN_TELEPORT_DELAY : Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY) * 1000;
|
||||
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, fastSchedule ? 0 : delay);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class TvTEventTeleporter implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
L2Summon summon = _playerInstance.getPet();
|
||||
final L2Summon summon = _playerInstance.getPet();
|
||||
|
||||
if (summon != null)
|
||||
{
|
||||
@@ -88,7 +88,7 @@ public class TvTEventTeleporter implements Runnable
|
||||
_playerInstance.setDuelState(DuelState.INTERRUPTED);
|
||||
}
|
||||
|
||||
int TvTInstance = TvTEvent.getTvTEventInstance();
|
||||
final int TvTInstance = TvTEvent.getTvTEventInstance();
|
||||
if (TvTInstance != 0)
|
||||
{
|
||||
if (TvTEvent.isStarted() && !_adminRemove)
|
||||
@@ -111,7 +111,7 @@ public class TvTEventTeleporter implements Runnable
|
||||
|
||||
if (TvTEvent.isStarted() && !_adminRemove)
|
||||
{
|
||||
int teamId = TvTEvent.getParticipantTeamId(_playerInstance.getObjectId()) + 1;
|
||||
final int teamId = TvTEvent.getParticipantTeamId(_playerInstance.getObjectId()) + 1;
|
||||
switch (teamId)
|
||||
{
|
||||
case 0:
|
||||
|
||||
@@ -71,7 +71,7 @@ public class TvTManager
|
||||
{
|
||||
try
|
||||
{
|
||||
Calendar currentTime = Calendar.getInstance();
|
||||
final Calendar currentTime = Calendar.getInstance();
|
||||
Calendar nextStartTime = null;
|
||||
Calendar testStartTime = null;
|
||||
for (String timeOfDay : Config.TVT_EVENT_INTERVAL)
|
||||
@@ -79,7 +79,7 @@ public class TvTManager
|
||||
// Creating a Calendar object from the specified interval value
|
||||
testStartTime = Calendar.getInstance();
|
||||
testStartTime.setLenient(true);
|
||||
String[] splitTimeOfDay = timeOfDay.split(":");
|
||||
final String[] splitTimeOfDay = timeOfDay.split(":");
|
||||
testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0]));
|
||||
testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1]));
|
||||
// If the date is in the past, make it the next day (Example: Checking for "1:00", when the time is 23:57.)
|
||||
@@ -189,7 +189,7 @@ public class TvTManager
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
int delay = (int) Math.round((_startTime - System.currentTimeMillis()) / 1000.0);
|
||||
final int delay = (int) Math.round((_startTime - System.currentTimeMillis()) / 1000.0);
|
||||
|
||||
if (delay > 0)
|
||||
{
|
||||
|
||||
@@ -110,7 +110,7 @@ public final class AuctionableHall extends ClanHall
|
||||
*/
|
||||
private final void initialyzeTask(boolean forced)
|
||||
{
|
||||
long currentTime = System.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (_paidUntil > currentTime)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new FeeTask(), _paidUntil - currentTime);
|
||||
@@ -142,7 +142,7 @@ public final class AuctionableHall extends ClanHall
|
||||
{
|
||||
try
|
||||
{
|
||||
long _time = System.currentTimeMillis();
|
||||
final long _time = System.currentTimeMillis();
|
||||
|
||||
if (isFree())
|
||||
{
|
||||
@@ -155,7 +155,7 @@ public final class AuctionableHall extends ClanHall
|
||||
return;
|
||||
}
|
||||
|
||||
L2Clan Clan = ClanTable.getInstance().getClan(getOwnerId());
|
||||
final L2Clan Clan = ClanTable.getInstance().getClan(getOwnerId());
|
||||
if (ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().getAdena() >= getLease())
|
||||
{
|
||||
if (_paidUntil != 0)
|
||||
@@ -193,7 +193,7 @@ public final class AuctionableHall extends ClanHall
|
||||
else
|
||||
{
|
||||
updateDb();
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
|
||||
sm.addInt(getLease());
|
||||
Clan.broadcastToOnlineMembers(sm);
|
||||
if ((_time + (3600000 * 24)) <= (_paidUntil + _chRate))
|
||||
|
||||
@@ -102,7 +102,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
while (rset.next())
|
||||
{
|
||||
final int id = rset.getInt("attacker_id");
|
||||
L2SiegeClan clan = new L2SiegeClan(id, SiegeClanType.ATTACKER);
|
||||
final L2SiegeClan clan = new L2SiegeClan(id, SiegeClanType.ATTACKER);
|
||||
_attackers.put(id, clan);
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
public List<L2Npc> getFlag(L2Clan clan)
|
||||
{
|
||||
List<L2Npc> result = null;
|
||||
L2SiegeClan sClan = getAttackerClan(clan);
|
||||
final L2SiegeClan sClan = getAttackerClan(clan);
|
||||
if (sClan != null)
|
||||
{
|
||||
result = sClan.getFlag();
|
||||
@@ -291,7 +291,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
|
||||
_hall.free();
|
||||
_hall.banishForeigners();
|
||||
SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.THE_REGISTRATION_TERM_FOR_S1_HAS_ENDED);
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.THE_REGISTRATION_TERM_FOR_S1_HAS_ENDED);
|
||||
msg.addString(getName());
|
||||
Broadcast.toAllOnlinePlayers(msg);
|
||||
_hall.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
|
||||
@@ -309,7 +309,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
_hall.updateNextSiege();
|
||||
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new PrepareOwner(), _hall.getSiegeDate().getTimeInMillis());
|
||||
_hall.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_SIEGE_OF_S1_HAS_BEEN_CANCELED_DUE_TO_LACK_OF_INTEREST);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_SIEGE_OF_S1_HAS_BEEN_CANCELED_DUE_TO_LACK_OF_INTEREST);
|
||||
sm.addString(_hall.getName());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
return;
|
||||
@@ -345,11 +345,11 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
@Override
|
||||
public void endSiege()
|
||||
{
|
||||
SystemMessage end = SystemMessage.getSystemMessage(SystemMessageId.THE_S1_SIEGE_HAS_FINISHED);
|
||||
final SystemMessage end = SystemMessage.getSystemMessage(SystemMessageId.THE_S1_SIEGE_HAS_FINISHED);
|
||||
end.addString(_hall.getName());
|
||||
Broadcast.toAllOnlinePlayers(end);
|
||||
|
||||
L2Clan winner = getWinner();
|
||||
final L2Clan winner = getWinner();
|
||||
SystemMessage finalMsg = null;
|
||||
if (_missionAccomplished && (winner != null))
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ public final class SiegableHall extends ClanHall
|
||||
{
|
||||
super(set);
|
||||
_siegeLength = set.getLong("siegeLenght");
|
||||
String[] rawSchConfig = set.getString("scheduleConfig").split(";");
|
||||
final String[] rawSchConfig = set.getString("scheduleConfig").split(";");
|
||||
if (rawSchConfig.length == 5)
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
@@ -83,7 +83,7 @@ public final class SiegableHall extends ClanHall
|
||||
}
|
||||
|
||||
_nextSiege = Calendar.getInstance();
|
||||
long nextSiege = set.getLong("nextSiege");
|
||||
final long nextSiege = set.getLong("nextSiege");
|
||||
if ((nextSiege - System.currentTimeMillis()) < 0)
|
||||
{
|
||||
updateNextSiege();
|
||||
@@ -184,7 +184,7 @@ public final class SiegableHall extends ClanHall
|
||||
|
||||
public final void updateNextSiege()
|
||||
{
|
||||
Calendar c = Calendar.getInstance();
|
||||
final Calendar c = Calendar.getInstance();
|
||||
c.add(Calendar.DAY_OF_YEAR, _scheduleConfig[0]);
|
||||
c.add(Calendar.MONTH, _scheduleConfig[1]);
|
||||
c.add(Calendar.YEAR, _scheduleConfig[2]);
|
||||
|
||||
Reference in New Issue
Block a user