Browse Source

top of the hour disc spawns

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
1567b22fe4
  1. 23
      src/engine/gameManager/LootManager.java
  2. 15
      src/engine/server/world/WorldServer.java

23
src/engine/gameManager/LootManager.java

@ -95,7 +95,7 @@ public enum LootManager {
ItemBase ib = it.getItemBase(); ItemBase ib = it.getItemBase();
if(ib == null) if(ib == null)
break; 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?"); 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.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
@ -113,6 +113,10 @@ public enum LootManager {
mob.firstSpawn = false; mob.firstSpawn = false;
mob.despawn(); 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 if(bse.itemBase == 3049)//disable clanwarden
return; return;
if((bse.itemBase == 3040 || bse.itemBase == 3021) && mob.level < 80){ int chance = 25;
mob.discDelay = 1;
} 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) { if(mob.parentZone.getSafeZone() == 1) {
return; return;
} }
int chanceRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1); int chanceRoll = ThreadLocalRandom.current().nextInt(1, 99);
//early exit, failed to hit minimum chance roll //early exit, failed to hit minimum chance roll
if (chanceRoll > bse.dropChance) if (chanceRoll > chance)
return; return;
MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true);

15
src/engine/server/world/WorldServer.java

@ -258,24 +258,9 @@ public class WorldServer {
if (LocalDateTime.now().isAfter(nextDiscSpawn)) { if (LocalDateTime.now().isAfter(nextDiscSpawn)) {
for(Mob dropper : Mob.disciplineDroppers) { for(Mob dropper : Mob.disciplineDroppers) {
if(dropper.isAlive() == false) { if(dropper.isAlive() == false) {
if(dropper.discDelay == 1) {
if (Zone.respawnQue.contains(dropper) == false) {
Zone.respawnQue.add(dropper); 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");
}
}
nextDiscSpawn = LocalDateTime.now().plusHours(1).withMinute(0).withSecond(0); nextDiscSpawn = LocalDateTime.now().plusHours(1).withMinute(0).withSecond(0);
} }
ThreadUtils.sleep(50); ThreadUtils.sleep(50);

Loading…
Cancel
Save