forked from MagicBane/Server
Auto-leveling camps
This commit is contained in:
@@ -11,6 +11,7 @@ package engine.mobileAI.Threads;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.Zone;
|
||||
import engine.util.ZoneLevel;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
/**
|
||||
@@ -39,6 +40,15 @@ public class MobRespawnThread implements Runnable {
|
||||
try {
|
||||
for (Zone zone : ZoneManager.getAllZones()) {
|
||||
|
||||
if (zone.respawnQue.size() > ZoneLevel.queueLengthToLevelUp) {
|
||||
zone.setCampLvl(zone.getCamplvl() + 1);
|
||||
}
|
||||
else if (zone.respawnQue.isEmpty() &&
|
||||
(zone.lastRespawn + ZoneLevel.msToLevelDown < System.currentTimeMillis()) &&
|
||||
zone.getCamplvl() > 0) {
|
||||
zone.setCampLvl(zone.getCamplvl() - 1);
|
||||
}
|
||||
|
||||
if (zone.respawnQue.isEmpty() == false && zone.lastRespawn + 100 < System.currentTimeMillis()) {
|
||||
|
||||
Mob respawner = zone.respawnQue.iterator().next();
|
||||
|
||||
Reference in New Issue
Block a user