From 1567b22fe49c01429be68ba0416e8ee0019ab8b1 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 22 Apr 2024 19:23:08 -0500 Subject: [PATCH] top of the hour disc spawns --- src/engine/gameManager/LootManager.java | 23 +++++++++++++++++------ src/engine/server/world/WorldServer.java | 19 ++----------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index b545acd4..a62a13af 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -95,7 +95,7 @@ public enum LootManager { ItemBase ib = it.getItemBase(); if(ib == null) break; - if (ib.isDiscRune() || ib.getName().toLowerCase().contains("of the gods")) { + if (ib.getName().toLowerCase().contains("of the gods")) { ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?"); chatMsg.setMessageType(10); chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); @@ -113,6 +113,10 @@ public enum LootManager { mob.firstSpawn = false; mob.despawn(); } + ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " may have found the " + ib.getName() + ". Are you tough enough to take it?"); + chatMsg.setMessageType(10); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); } } @@ -459,19 +463,26 @@ public enum LootManager { if(bse.itemBase == 3049)//disable clanwarden return; - if((bse.itemBase == 3040 || bse.itemBase == 3021) && mob.level < 80){ - mob.discDelay = 1; - } + int chance = 25; + + if(ItemBase.getItemBase(bse.itemBase).isDiscRune() == false) + chance = (int)bse.dropChance; + else + chance = 25; + + //if((bse.itemBase == 3040 || bse.itemBase == 3021) && mob.level < 80){ + // chance = 100; + //} if(mob.parentZone.getSafeZone() == 1) { return; } - int chanceRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1); + int chanceRoll = ThreadLocalRandom.current().nextInt(1, 99); //early exit, failed to hit minimum chance roll - if (chanceRoll > bse.dropChance) + if (chanceRoll > chance) return; MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index e5aa12cc..e4ce05e0 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -257,23 +257,8 @@ public class WorldServer { if (LocalDateTime.now().isAfter(nextDiscSpawn)) { for(Mob dropper : Mob.disciplineDroppers) { - if(dropper.isAlive() == false){ - if(dropper.discDelay == 1) { - if (Zone.respawnQue.contains(dropper) == false) { - Zone.respawnQue.add(dropper); - } - } - } else if(dropper.discDelay == 6){ - switch(LocalDateTime.now().getHour()){ - case 3: - case 9: - case 15: - case 21: - Zone.respawnQue.add(dropper); - break; - } - } else{ - Logger.error(dropper.getName() + " Disc Delay Not Set As 1 or 6"); + if(dropper.isAlive() == false) { + Zone.respawnQue.add(dropper); } } nextDiscSpawn = LocalDateTime.now().plusHours(1).withMinute(0).withSecond(0);