From fa37e1bcca40571a625d2ef8cc28cefc1c84675d Mon Sep 17 00:00:00 2001 From: fatboy Date: Sat, 20 Apr 2024 00:24:47 -0500 Subject: [PATCH] disc dropper time delay --- src/engine/gameManager/LootManager.java | 2 +- src/engine/objects/Mob.java | 1 + src/engine/server/world/WorldServer.java | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 07792d40..64016935 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -456,7 +456,7 @@ public enum LootManager { return; if((bse.itemBase == 3040 || bse.itemBase == 3021) && mob.level < 80){ - mob.setSpawnTime(3600); + mob.discDelay = 1; } if(mob.parentZone.getSafeZone() == 1) { diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 1661d9cf..9aa9d42f 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -80,6 +80,7 @@ public class Mob extends AbstractIntelligenceAgent { private DeferredPowerJob weaponPower; private DateTime upgradeDateTime = null; private boolean lootSync = false; + public int discDelay = 6; // New Mobile constructor. Fill in the blanks and then call // PERSIST. diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index b5772abf..4030c364 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -256,12 +256,16 @@ public class WorldServer { } if (LocalDateTime.now().isAfter(nextDiscSpawn)) { - for(Mob dropper : Mob.disciplineDroppers){ - if(dropper.isAlive() == false){ + for(Mob dropper : Mob.disciplineDroppers) { + if (dropper.discDelay == 6 && (LocalDateTime.now().getHour() == 6 || LocalDateTime.now().getHour() == 12 || LocalDateTime.now().getHour() == 18 || LocalDateTime.now().getHour() == 0)) { + if (!dropper.isAlive()) { + dropper.respawn(); + } + } else if (!dropper.isAlive()) { dropper.respawn(); } } - nextDiscSpawn = LocalDateTime.now().plusHours(6).withMinute(0).withSecond(0); + nextDiscSpawn = LocalDateTime.now().plusHours(1).withMinute(0).withSecond(0); } ThreadUtils.sleep(50); }