diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index ece98240..f6cc0023 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -398,8 +398,11 @@ public enum LootManager { MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); - if (lootItem != null) + if (lootItem != null) { mob.getCharItemManager().addItemToInventory(lootItem); + if(lootItem.getItemBase().isDiscRune() && !Mob.discDroppers.contains(mob)) + Mob.discDroppers.add(mob); + } } public static void peddleFate(PlayerCharacter playerCharacter, Item gift) { diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 794dcb6e..01c1fa96 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -871,10 +871,12 @@ public class MobAI { } } } - } else if (System.currentTimeMillis() > (aiAgent.deathTime + (aiAgent.spawnTime * 1000))) { + } else if (System.currentTimeMillis() > (aiAgent.deathTime + (aiAgent.spawnTime * 1000L))) { + if(Mob.discDroppers.contains(aiAgent)) + return; - if (Zone.respawnQue.contains(aiAgent) == false) { + if (!Zone.respawnQue.contains(aiAgent)) { Zone.respawnQue.add(aiAgent); } } diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index 8db25f9a..932ada84 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -1411,6 +1411,7 @@ public class ClientMessagePump implements NetMsgHandler { bargain = 0; break; case 900: + cost = (int)(Warehouse.getCostForResource(ib.getUUID()) * Warehouse.getSellStackSize(ib.getUUID()) * 0.5f); bargain = 0; break; } @@ -1419,9 +1420,6 @@ public class ClientMessagePump implements NetMsgHandler { profit -= 1.0f; if (profit < 1) profit = 1; - if(npc.getContractID() == 900){ - cost = (int)(Warehouse.getCostForResource(ib.getUUID()) * Warehouse.getSellStackSize(ib.getUUID()) * 0.5f); - } cost *= profit; if (gold.getNumOfItems() - cost < 0) { //dont' have enough goldItem exit! diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 3268f241..6cb12663 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -48,6 +48,7 @@ import static engine.net.client.msg.ErrorPopupMsg.sendErrorPopup; public class Mob extends AbstractIntelligenceAgent { + public static ArrayList discDroppers = new ArrayList<>(); private static final ReentrantReadWriteLock createLock = new ReentrantReadWriteLock(); private static final ConcurrentHashMap mobMapByDBID = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); // Variables NOT to be stored in db diff --git a/src/engine/workthreads/HourlyJobThread.java b/src/engine/workthreads/HourlyJobThread.java index 56be92ce..309bb721 100644 --- a/src/engine/workthreads/HourlyJobThread.java +++ b/src/engine/workthreads/HourlyJobThread.java @@ -68,6 +68,21 @@ public class HourlyJobThread implements Runnable { } } + switch(LocalDateTime.now().getHour()){ + case 3: + case 6: + case 9: + case 12: + case 15: + case 18: + case 21: + case 0: + for(Mob mob : Mob.discDroppers) + if(!mob.isAlive()) + Zone.respawnQue.add(mob); + break; + } + // Log metrics to console Logger.info(WorldServer.getUptimeString()); Logger.info(SimulationManager.getPopulationString());