Browse Source

mob spawn revert

birdbane
FatBoy-DOTC 9 months ago
parent
commit
57b5cef021
  1. 8
      src/engine/mobileAI/MobAI.java
  2. 2
      src/engine/objects/Mob.java

8
src/engine/mobileAI/MobAI.java

@ -851,7 +851,7 @@ public class MobAI {
if (!aiAgent.despawned) { if (!aiAgent.despawned) {
if (aiAgent.getCharItemManager().getInventoryCount() > 0) { if (aiAgent.getCharItemManager().getInventoryCount() > 0) {
if (System.currentTimeMillis() > (aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER_WITH_LOOT) * 0.5f) { if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER_WITH_LOOT) {
aiAgent.despawn(); aiAgent.despawn();
aiAgent.deathTime = System.currentTimeMillis(); aiAgent.deathTime = System.currentTimeMillis();
return; return;
@ -860,21 +860,21 @@ public class MobAI {
} else { } else {
//Mob's Loot has been looted. //Mob's Loot has been looted.
if (aiAgent.isHasLoot()) { if (aiAgent.isHasLoot()) {
if (System.currentTimeMillis() > (aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER_ONCE_LOOTED) * 0.5f) { if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER_ONCE_LOOTED) {
aiAgent.despawn(); aiAgent.despawn();
aiAgent.deathTime = System.currentTimeMillis(); aiAgent.deathTime = System.currentTimeMillis();
return; return;
} }
//Mob never had Loot. //Mob never had Loot.
} else { } else {
if (System.currentTimeMillis() > (aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER) * 0.5f) { if (System.currentTimeMillis() > aiAgent.deathTime + MBServerStatics.DESPAWN_TIMER) {
aiAgent.despawn(); aiAgent.despawn();
aiAgent.deathTime = System.currentTimeMillis(); aiAgent.deathTime = System.currentTimeMillis();
return; return;
} }
} }
} }
} else if (System.currentTimeMillis() > (aiAgent.deathTime + (aiAgent.spawnTime * 1000) * 0.5f)) { } else if (System.currentTimeMillis() > aiAgent.deathTime + (aiAgent.spawnTime * 1000)) {
if (Zone.respawnQue.contains(aiAgent) == false) { if (Zone.respawnQue.contains(aiAgent) == false) {
Zone.respawnQue.add(aiAgent); Zone.respawnQue.add(aiAgent);

2
src/engine/objects/Mob.java

@ -195,7 +195,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.loadID = rs.getInt("mob_mobbaseID"); this.loadID = rs.getInt("mob_mobbaseID");
this.gridObjectType = GridObjectType.DYNAMIC; this.gridObjectType = GridObjectType.DYNAMIC;
this.spawnRadius = rs.getFloat("mob_spawnRadius"); this.spawnRadius = rs.getFloat("mob_spawnRadius");
this.spawnTime = (int)(rs.getInt("mob_spawnTime") * 0.5); this.spawnTime = rs.getInt("mob_spawnTime");
this.parentZone = null; this.parentZone = null;
this.statLat = rs.getFloat("mob_spawnX"); this.statLat = rs.getFloat("mob_spawnX");
this.statAlt = rs.getFloat("mob_spawnY"); this.statAlt = rs.getFloat("mob_spawnY");

Loading…
Cancel
Save