|
|
|
@ -40,6 +40,7 @@ public class MobRespawnThread implements Runnable {
@@ -40,6 +40,7 @@ public class MobRespawnThread implements Runnable {
|
|
|
|
|
try { |
|
|
|
|
for (Zone zone : ZoneManager.getAllZones()) { |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
if (zone.respawnQue.size() > ZoneLevel.queueLengthToLevelUp) { |
|
|
|
|
zone.setCampLvl(zone.getCamplvl() + 1); |
|
|
|
|
} |
|
|
|
@ -48,6 +49,42 @@ public class MobRespawnThread implements Runnable {
@@ -48,6 +49,42 @@ public class MobRespawnThread implements Runnable {
|
|
|
|
|
zone.getCamplvl() > 0) { |
|
|
|
|
zone.setCampLvl(zone.getCamplvl() - 1); |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
int deadCount = 0; |
|
|
|
|
for (Mob mob : zone.zoneMobSet) { |
|
|
|
|
if (!mob.isAlive()) { |
|
|
|
|
deadCount = deadCount + 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (deadCount > Math.floor(zone.zoneMobSet.size() / 2.0)) { |
|
|
|
|
if (zone.levelUpTimer == 0) { |
|
|
|
|
zone.levelUpTimer = System.currentTimeMillis(); |
|
|
|
|
} |
|
|
|
|
else if (zone.levelUpTimer + ZoneLevel.msTolevelUp < System.currentTimeMillis()) { |
|
|
|
|
zone.setCampLvl(zone.getCampLvl() + 1); |
|
|
|
|
|
|
|
|
|
zone.levelUpTimer = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (deadCount == 0) { |
|
|
|
|
|
|
|
|
|
if (zone.levelDownTimer == 0) { |
|
|
|
|
zone.levelDownTimer = System.currentTimeMillis(); |
|
|
|
|
} |
|
|
|
|
else if (zone.levelDownTimer + ZoneLevel.msToLevelDown < System.currentTimeMillis()) { |
|
|
|
|
if (zone.getCampLvl() > 0) { |
|
|
|
|
zone.setCampLvl(zone.getCampLvl() + 1); |
|
|
|
|
|
|
|
|
|
zone.levelDownTimer = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
zone.levelUpTimer = 0; |
|
|
|
|
zone.levelDownTimer = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (zone.respawnQue.isEmpty() == false && zone.lastRespawn + 100 < System.currentTimeMillis()) { |
|
|
|
|
|
|
|
|
|