From 5d718a43b77a9a551a3c0abea171769b4fdc0912 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 25 Sep 2021 08:26:56 +0000 Subject: [PATCH] Shared cooldown for transcendent instances. --- .../huntingzones/ExTimedHuntingZoneEnter.java | 16 ++++++++++++---- .../huntingzones/ExTimedHuntingZoneEnter.java | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java index f874df6924..c4268ecfd2 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java @@ -107,14 +107,22 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket return; } + final long currentTime = Chronos.currentTimeMillis(); final int instanceId = holder.getInstanceId(); - if ((instanceId > 0) && holder.isSoloInstance() && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis())) + if ((instanceId > 0) && holder.isSoloInstance()) { - player.sendMessage("This transcendent instance has not reset yet."); - return; + // Shared cooldown for all Transcendent instances. + // TODO: Move shared instance cooldown to XML. + for (int instId = 1101; instId < 1108; instId++) + { + if (InstanceManager.getInstance().getInstanceTime(player, instId) > currentTime) + { + player.sendMessage("The transcendent instance has not reset yet."); + return; + } + } } - final long currentTime = Chronos.currentTimeMillis(); long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId); final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0); if ((lastEntryTime + holder.getResetDelay()) < currentTime) diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java index f874df6924..c4268ecfd2 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/huntingzones/ExTimedHuntingZoneEnter.java @@ -107,14 +107,22 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket return; } + final long currentTime = Chronos.currentTimeMillis(); final int instanceId = holder.getInstanceId(); - if ((instanceId > 0) && holder.isSoloInstance() && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis())) + if ((instanceId > 0) && holder.isSoloInstance()) { - player.sendMessage("This transcendent instance has not reset yet."); - return; + // Shared cooldown for all Transcendent instances. + // TODO: Move shared instance cooldown to XML. + for (int instId = 1101; instId < 1108; instId++) + { + if (InstanceManager.getInstance().getInstanceTime(player, instId) > currentTime) + { + player.sendMessage("The transcendent instance has not reset yet."); + return; + } + } } - final long currentTime = Chronos.currentTimeMillis(); long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId); final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0); if ((lastEntryTime + holder.getResetDelay()) < currentTime)