Browse Source

uniform disc dropper times

lakebane-new
FatBoy-DOTC 6 months ago
parent
commit
b30f04046d
  1. 5
      src/engine/gameManager/LootManager.java
  2. 6
      src/engine/mobileAI/MobAI.java
  3. 4
      src/engine/net/client/ClientMessagePump.java
  4. 1
      src/engine/objects/Mob.java
  5. 15
      src/engine/workthreads/HourlyJobThread.java

5
src/engine/gameManager/LootManager.java

@ -398,8 +398,11 @@ public enum LootManager { @@ -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) {

6
src/engine/mobileAI/MobAI.java

@ -871,10 +871,12 @@ public class MobAI { @@ -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);
}
}

4
src/engine/net/client/ClientMessagePump.java

@ -1411,6 +1411,7 @@ public class ClientMessagePump implements NetMsgHandler { @@ -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 { @@ -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!

1
src/engine/objects/Mob.java

@ -48,6 +48,7 @@ import static engine.net.client.msg.ErrorPopupMsg.sendErrorPopup; @@ -48,6 +48,7 @@ import static engine.net.client.msg.ErrorPopupMsg.sendErrorPopup;
public class Mob extends AbstractIntelligenceAgent {
public static ArrayList<Mob> discDroppers = new ArrayList<>();
private static final ReentrantReadWriteLock createLock = new ReentrantReadWriteLock();
private static final ConcurrentHashMap<Integer, Mob> mobMapByDBID = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
// Variables NOT to be stored in db

15
src/engine/workthreads/HourlyJobThread.java

@ -68,6 +68,21 @@ public class HourlyJobThread implements Runnable { @@ -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());

Loading…
Cancel
Save