uniform disc dropper times

This commit is contained in:
2024-07-04 19:14:00 -05:00
parent 9bd03c7d43
commit b30f04046d
5 changed files with 25 additions and 6 deletions
+4 -1
View File
@@ -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) {
+4 -2
View File
@@ -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);
}
}
+1 -3
View File
@@ -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!
+1
View File
@@ -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
@@ -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());