Addition of the Chronos class.
This commit is contained in:
@@ -21,6 +21,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.MountType;
|
||||
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
|
||||
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
_antharas.setCurrentHpMp(curr_hp, curr_mp);
|
||||
addBoss(_antharas);
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
_lastAttack = Chronos.currentTimeMillis();
|
||||
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
|
||||
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
|
||||
break;
|
||||
}
|
||||
case DEAD:
|
||||
{
|
||||
final long remain = respawnTime - System.currentTimeMillis();
|
||||
final long remain = respawnTime - Chronos.currentTimeMillis();
|
||||
if (remain > 0)
|
||||
{
|
||||
startQuestTimer("CLEAR_STATUS", remain, null, null);
|
||||
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
|
||||
_antharas.setRandomWalking(false);
|
||||
_antharas.teleToLocation(181323, 114850, -7623, 32542);
|
||||
setStatus(IN_FIGHT);
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
_lastAttack = Chronos.currentTimeMillis();
|
||||
zone.broadcastPacket(new PlaySound("BS02_A"));
|
||||
startQuestTimer("CAMERA_1", 23, _antharas, null);
|
||||
break;
|
||||
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
|
||||
}
|
||||
case "CHECK_ATTACK":
|
||||
{
|
||||
if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
|
||||
if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
|
||||
{
|
||||
setStatus(ALIVE);
|
||||
for (Creature creature : zone.getCharactersInside())
|
||||
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
|
||||
{
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
_lastAttack = Chronos.currentTimeMillis();
|
||||
if (npc.getId() == BOMBER)
|
||||
{
|
||||
if (npc.calculateDistance3D(attacker) < 230)
|
||||
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
|
||||
|
||||
private void setRespawn(long respawnTime)
|
||||
{
|
||||
GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
||||
}
|
||||
|
||||
private final void refreshAiParams(PlayerInstance attacker, int damage)
|
||||
|
@@ -17,6 +17,7 @@
|
||||
package ai.bosses.Baium;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||
@@ -136,7 +137,7 @@ public class Baium extends AbstractNpcAI
|
||||
final int heading = info.getInt("heading");
|
||||
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
_baium.setCurrentHpMp(curr_hp, curr_mp);
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
_lastAttack = Chronos.currentTimeMillis();
|
||||
addBoss(_baium);
|
||||
|
||||
for (Location loc : ARCHANGEL_LOC)
|
||||
@@ -149,7 +150,7 @@ public class Baium extends AbstractNpcAI
|
||||
}
|
||||
case DEAD:
|
||||
{
|
||||
final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
||||
if (remain > 0)
|
||||
{
|
||||
startQuestTimer("CLEAR_STATUS", remain, null, null);
|
||||
@@ -209,7 +210,7 @@ public class Baium extends AbstractNpcAI
|
||||
_baium.disableCoreAI(true);
|
||||
_baium.setRandomWalking(false);
|
||||
addBoss(_baium);
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
_lastAttack = Chronos.currentTimeMillis();
|
||||
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
|
||||
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
|
||||
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
|
||||
@@ -375,7 +376,7 @@ public class Baium extends AbstractNpcAI
|
||||
}
|
||||
case "CHECK_ATTACK":
|
||||
{
|
||||
if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
|
||||
if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
|
||||
{
|
||||
notifyEvent("CLEAR_ZONE", null, null);
|
||||
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
|
||||
@@ -383,7 +384,7 @@ public class Baium extends AbstractNpcAI
|
||||
}
|
||||
else if (npc != null)
|
||||
{
|
||||
if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
|
||||
if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
|
||||
{
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(HEAL_OF_BAIUM.getSkill());
|
||||
@@ -484,7 +485,7 @@ public class Baium extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
|
||||
{
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
_lastAttack = Chronos.currentTimeMillis();
|
||||
if (npc.getId() == BAIUM)
|
||||
{
|
||||
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
|
||||
@@ -663,7 +664,7 @@ public class Baium extends AbstractNpcAI
|
||||
|
||||
private void setRespawn(long respawnTime)
|
||||
{
|
||||
GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
|
||||
}
|
||||
|
||||
private void manageSkills(Npc npc)
|
||||
|
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
@@ -88,7 +89,7 @@ public class Core extends AbstractNpcAI
|
||||
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
|
||||
{
|
||||
// Load the unlock date and time for Core from DB.
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
||||
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
{
|
||||
@@ -204,7 +205,7 @@ public class Core extends AbstractNpcAI
|
||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
||||
// Also save the respawn time so that the info is maintained past reboots.
|
||||
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatSet(CORE, info);
|
||||
startQuestTimer("despawn_minions", 20000, null, null);
|
||||
cancelQuestTimers("spawn_minion");
|
||||
|
@@ -20,6 +20,7 @@ import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
@@ -97,7 +98,7 @@ public class Orfen extends AbstractNpcAI
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for Orfen from DB
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
||||
// if Orfen is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
@@ -328,7 +329,7 @@ public class Orfen extends AbstractNpcAI
|
||||
startQuestTimer("orfen_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatSet(ORFEN, info);
|
||||
cancelQuestTimer("check_minion_loc", npc, null);
|
||||
cancelQuestTimer("check_orfen_pos", npc, null);
|
||||
|
@@ -20,6 +20,7 @@ import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for queen ant from DB
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
||||
// if queen ant is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
|
||||
cancelQuestTimer("heal", null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatSet(QUEEN, info);
|
||||
_nurses.clear();
|
||||
_larva.deleteMe();
|
||||
|
@@ -17,6 +17,7 @@
|
||||
package ai.bosses.Zaken;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@@ -53,7 +54,7 @@ public class Zaken extends AbstractNpcAI
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time from DB
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
||||
if (temp > 0)
|
||||
{
|
||||
startQuestTimer("zaken_unlock", temp, null, null);
|
||||
@@ -97,7 +98,7 @@ public class Zaken extends AbstractNpcAI
|
||||
startQuestTimer("zaken_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatSet info = GrandBossManager.getInstance().getStatSet(ZAKEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatSet(ZAKEN, info);
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
import org.l2jmobius.gameserver.model.siege.Castle;
|
||||
import org.l2jmobius.gameserver.model.siege.Fort;
|
||||
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
|
||||
import org.l2jmobius.gameserver.model.siege.Fort;
|
||||
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
|
||||
|
@@ -26,6 +26,7 @@ import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@@ -154,7 +155,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
|
||||
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
|
||||
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
|
||||
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
|
||||
htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
|
||||
htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -190,7 +191,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
|
||||
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
|
||||
final Clan owner = clanHall.getOwner();
|
||||
final long remainingTime = clanHallAuction.getRemaingTime();
|
||||
final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
|
||||
final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
|
||||
|
||||
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
|
||||
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
|
||||
@@ -248,7 +249,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
|
||||
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
|
||||
final Clan owner = clanHall.getOwner();
|
||||
final long remainingTime = clanHallAuction.getRemaingTime();
|
||||
final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
|
||||
final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
|
||||
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
|
||||
@@ -297,7 +298,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
|
||||
sb.append("\"><font color=\"ffffaa\">&%");
|
||||
sb.append(clanHall.getResidenceId());
|
||||
sb.append(";[0]</font></a></td><td width=50>");
|
||||
sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
|
||||
sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
|
||||
sb.append("</td><td width=70 align=right><font color=\"aaffff\">");
|
||||
sb.append(auction.getHighestBid());
|
||||
sb.append("</font></td></tr>");
|
||||
|
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
|
||||
if (resetTime > 0)
|
||||
{
|
||||
cancelQuestTimers(HALL_RESET_VAR + id);
|
||||
startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
|
||||
startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
|
||||
|
||||
for (int id : CLAN_HALLS.keySet())
|
||||
{
|
||||
if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
|
||||
if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
|
||||
{
|
||||
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
|
||||
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
|
||||
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
|
||||
clanHall.setOwner(player.getClan());
|
||||
}
|
||||
player.sendMessage("Congratulations! You now own a provisional clan hall!");
|
||||
startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
|
||||
startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
|
||||
else if (event.startsWith(HALL_RESET_VAR))
|
||||
{
|
||||
final String id = event.replace(HALL_RESET_VAR, "");
|
||||
if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
|
||||
if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
|
||||
{
|
||||
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
|
||||
if (clanId > 0)
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package events.HappyHours;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -39,7 +40,7 @@ public class HappyHours extends LongTimeEvent
|
||||
// Other
|
||||
private static final int MIN_LEVEL = 20;
|
||||
private static final int REWARD_INTERVAL = 60 * 60 * 1000; // 1 hour
|
||||
private static long _lastRewardTime = System.currentTimeMillis();
|
||||
private static long _lastRewardTime = Chronos.currentTimeMillis();
|
||||
|
||||
private HappyHours()
|
||||
{
|
||||
@@ -76,9 +77,9 @@ public class HappyHours extends LongTimeEvent
|
||||
{
|
||||
if (isEventPeriod())
|
||||
{
|
||||
if ((System.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
|
||||
if ((Chronos.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
|
||||
{
|
||||
_lastRewardTime = System.currentTimeMillis();
|
||||
_lastRewardTime = Chronos.currentTimeMillis();
|
||||
final ExShowScreenMessage screenMsg = new ExShowScreenMessage("You obtained 20 Sibi's coins.", ExShowScreenMessage.TOP_CENTER, 7000, 0, true, true);
|
||||
final SystemMessage systemMsg = new SystemMessage(SystemMessageId.YOU_OBTAINED_S1_SIBI_S_COINS);
|
||||
systemMsg.addInt(20);
|
||||
|
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
|
||||
import java.util.Collection;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
|
||||
import org.l2jmobius.gameserver.model.CursedWeapon;
|
||||
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
|
||||
{
|
||||
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
|
||||
}
|
||||
cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
|
||||
cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
|
||||
cw.reActivate();
|
||||
}
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
|
||||
import java.util.Calendar;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
|
||||
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
|
||||
{
|
||||
final Calendar nextChangeDate = Calendar.getInstance();
|
||||
nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
|
||||
nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
|
||||
html.replace("%sodtime%", nextChangeDate.getTime().toString());
|
||||
}
|
||||
else
|
||||
|
@@ -20,6 +20,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
@@ -117,7 +118,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
|
||||
int hours = 0;
|
||||
int minutes = 0;
|
||||
final int id = entry.getKey();
|
||||
final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
|
||||
final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
|
||||
if (remainingTime > 0)
|
||||
{
|
||||
hours = (int) (remainingTime / 3600);
|
||||
|
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
|
||||
long expirationTime = Integer.parseInt(exp);
|
||||
if (expirationTime > 0)
|
||||
{
|
||||
expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
|
||||
expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
|
||||
}
|
||||
|
||||
final PunishmentAffect affect = PunishmentAffect.getByName(af);
|
||||
|
@@ -24,6 +24,7 @@ import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.GameServer;
|
||||
import org.l2jmobius.gameserver.GameTimeController;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
||||
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
|
||||
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
|
||||
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
|
||||
html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
|
||||
html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
|
||||
html.replace("%serverUpTime%", getServerUpTime());
|
||||
html.replace("%onlineAll%", getPlayersCount("ALL"));
|
||||
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
|
||||
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
||||
|
||||
private String getServerUpTime()
|
||||
{
|
||||
long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
|
||||
long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
|
||||
|
||||
final long days = TimeUnit.MILLISECONDS.toDays(time);
|
||||
time -= TimeUnit.DAYS.toMillis(days);
|
||||
|
@@ -21,6 +21,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.handler.IBypassHandler;
|
||||
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
|
||||
player.setSpawnProtection(true);
|
||||
if (!player.isGM())
|
||||
{
|
||||
player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
|
||||
player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
|
||||
player.startPvPFlag();
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.dailymissionhandlers;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
|
||||
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
|
||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
|
||||
final long lastCompleted = entry.getLastCompleted();
|
||||
if (lastCompleted == 0) // Initial entry.
|
||||
{
|
||||
entry.setLastCompleted(System.currentTimeMillis());
|
||||
entry.setLastCompleted(Chronos.currentTimeMillis());
|
||||
}
|
||||
else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
|
||||
else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
|
||||
{
|
||||
entry.setProgress(1);
|
||||
entry.setStatus(DailyMissionStatus.AVAILABLE);
|
||||
|
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
|
||||
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
|
||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
|
||||
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
|
||||
final long lastCompleted = entry.getLastCompleted();
|
||||
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
|
||||
&& ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
|
||||
&& ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
|
||||
{
|
||||
entry.setProgress(1);
|
||||
entry.setStatus(DailyMissionStatus.AVAILABLE);
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.punishmenthandlers;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
|
||||
*/
|
||||
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
|
||||
{
|
||||
final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
|
||||
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
|
||||
if (delay > 0)
|
||||
{
|
||||
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
|
||||
|
@@ -17,6 +17,7 @@
|
||||
package handlers.punishmenthandlers;
|
||||
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
|
||||
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
|
||||
player.sendPacket(msg);
|
||||
if (task != null)
|
||||
{
|
||||
final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
|
||||
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
|
||||
if (delay > 0)
|
||||
{
|
||||
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.telnethandlers.player;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
||||
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
|
||||
if (Util.isDigit(token))
|
||||
{
|
||||
time = Integer.parseInt(token) * 60 * 1000;
|
||||
time += System.currentTimeMillis();
|
||||
time += Chronos.currentTimeMillis();
|
||||
}
|
||||
if (args.length > 2)
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.telnethandlers.player;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
||||
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
|
||||
if (Util.isDigit(token))
|
||||
{
|
||||
time = Integer.parseInt(token) * 60 * 1000;
|
||||
time += System.currentTimeMillis();
|
||||
time += Chronos.currentTimeMillis();
|
||||
}
|
||||
if (args.length > 2)
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.telnethandlers.player;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
||||
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
|
||||
if (Util.isDigit(token))
|
||||
{
|
||||
time = Integer.parseInt(token) * 60 * 1000;
|
||||
time += System.currentTimeMillis();
|
||||
time += Chronos.currentTimeMillis();
|
||||
}
|
||||
if (args.length > 2)
|
||||
{
|
||||
|
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
|
||||
final StringBuilder htmlContent = new StringBuilder(500);
|
||||
htmlContent.append("<html><body><center><table width=270 border=0 bgcolor=111111><tr><td width=170>Penalty</td><td width=100 align=center>Expiration Date</td></tr></table><table width=270 border=0><tr>");
|
||||
|
||||
if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
|
||||
if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
|
||||
{
|
||||
htmlContent.append("<td width=170>Unable to join a clan.</td><td width=100 align=center>");
|
||||
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
|
||||
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
|
||||
penalty = true;
|
||||
}
|
||||
|
||||
if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
|
||||
if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
|
||||
{
|
||||
htmlContent.append("<td width=170>Unable to create a clan.</td><td width=100 align=center>");
|
||||
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
|
||||
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
|
||||
penalty = true;
|
||||
}
|
||||
|
||||
if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
|
||||
if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
|
||||
{
|
||||
htmlContent.append("<td width=170>Unable to invite a clan member.</td><td width=100 align=center>");
|
||||
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
|
||||
|
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.GameTimeController;
|
||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
|
||||
player.sendPacket(sm);
|
||||
if (Config.DISPLAY_SERVER_TIME)
|
||||
{
|
||||
player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
|
||||
player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
||||
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
|
||||
PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
|
||||
if (expirationTime > 0)
|
||||
{
|
||||
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
|
||||
|
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
|
||||
html.append("<tr><td>Spoil Chance: <font color=\"LEVEL\">x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Spoil Amount: <font color=\"LEVEL\">x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Expires: <font color=\"00A5FF\">" + format.format(endDate) + "</font></td></tr>");
|
||||
html.append("<tr><td>Current Date: <font color=\"70FFCA\">" + format.format(System.currentTimeMillis()) + "<br><br></font></td></tr>");
|
||||
html.append("<tr><td>Current Date: <font color=\"70FFCA\">" + format.format(Chronos.currentTimeMillis()) + "<br><br></font></td></tr>");
|
||||
html.append("<tr><td><center>Premium Info & Rules<br></center></td></tr>");
|
||||
html.append("<tr><td><font color=\"70FFCA\">1. Premium accounts CAN NOT BE TRANSFERED.<br1></font></td></tr>");
|
||||
html.append("<tr><td><font color=\"70FFCA\">2. Premium does not effect party members.<br1></font></td></tr>");
|
||||
|
Reference in New Issue
Block a user