Browse Source

mob respawn fix actual

master
FatBoy-DOTC 2 years ago
parent
commit
5299da784a
  1. 10
      src/engine/ai/MobileFSM.java
  2. 2
      src/engine/server/MBServerStatics.java

10
src/engine/ai/MobileFSM.java

@ -453,10 +453,11 @@ public class MobileFSM {
} }
//handles checking for respawn of dead mobs even when no players have mob loaded //handles checking for respawn of dead mobs even when no players have mob loaded
//Despawn Timer with Loot currently in inventory. //Despawn Timer with Loot currently in inventory.
if(aiAgent.despawned == false) {
if (aiAgent.getCharItemManager().getInventoryCount() > 0) { if (aiAgent.getCharItemManager().getInventoryCount() > 0) {
if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER_WITH_LOOT) { if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER_WITH_LOOT) {
aiAgent.despawn(); aiAgent.despawn();
return; aiAgent.deathTime = System.currentTimeMillis();
} }
//No items in inventory. //No items in inventory.
} else { } else {
@ -464,18 +465,17 @@ public class MobileFSM {
if (aiAgent.isHasLoot()) { if (aiAgent.isHasLoot()) {
if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER_ONCE_LOOTED) { if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER_ONCE_LOOTED) {
aiAgent.despawn(); aiAgent.despawn();
return; aiAgent.deathTime = System.currentTimeMillis();
} }
//Mob never had Loot. //Mob never had Loot.
} else { } else {
if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER) { if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER) {
aiAgent.despawn(); aiAgent.despawn();
return; aiAgent.deathTime = System.currentTimeMillis();
} }
} }
} }
if (System.currentTimeMillis() > aiAgent.deathTime + (aiAgent.spawnTime * 1000)) { }else if (System.currentTimeMillis() > aiAgent.deathTime + (aiAgent.spawnTime * 1000)) {
aiAgent.despawn();
aiAgent.respawn(); aiAgent.respawn();
} }
} }

2
src/engine/server/MBServerStatics.java

@ -679,7 +679,7 @@ public class MBServerStatics {
public static final int LEVEL_CON_WHITE = 7; public static final int LEVEL_CON_WHITE = 7;
public static final int RESPAWN_TIMER = 90 * 1000; public static final int RESPAWN_TIMER = 90 * 1000;
public static final int DESPAWN_TIMER = 12 * 1000; public static final int DESPAWN_TIMER = 12 * 1000;
public static final int DESPAWN_TIMER_WITH_LOOT = 90 * 1000; public static final int DESPAWN_TIMER_WITH_LOOT = 60 * 1000;
public static final int DESPAWN_TIMER_ONCE_LOOTED = 5 * 1000; public static final int DESPAWN_TIMER_ONCE_LOOTED = 5 * 1000;
public static final int MAX_COMBAT_HITBOX_RADIUS = 80; public static final int MAX_COMBAT_HITBOX_RADIUS = 80;
public static final int PROC_CHANCE = 5; // %chance to proc public static final int PROC_CHANCE = 5; // %chance to proc

Loading…
Cancel
Save