Shared cooldown for transcendent instances.

This commit is contained in:
MobiusDevelopment
2021-09-25 08:26:56 +00:00
parent fce88c2895
commit 5d718a43b7
2 changed files with 24 additions and 8 deletions

View File

@@ -107,14 +107,22 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
final long currentTime = Chronos.currentTimeMillis();
final int instanceId = holder.getInstanceId(); 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."); // Shared cooldown for all Transcendent instances.
return; // 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); long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId);
final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0); final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0);
if ((lastEntryTime + holder.getResetDelay()) < currentTime) if ((lastEntryTime + holder.getResetDelay()) < currentTime)

View File

@@ -107,14 +107,22 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
final long currentTime = Chronos.currentTimeMillis();
final int instanceId = holder.getInstanceId(); 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."); // Shared cooldown for all Transcendent instances.
return; // 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); long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId);
final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0); final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0);
if ((lastEntryTime + holder.getResetDelay()) < currentTime) if ((lastEntryTime + holder.getResetDelay()) < currentTime)