forked from MagicBane/Server
uniform disc dropper respawns
This commit is contained in:
@@ -102,6 +102,9 @@ public enum LootManager {
|
||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
||||
}
|
||||
if (ib.isDiscRune() && mob.level < 60){
|
||||
if(Mob.disciplineDroppers.contains(mob) == false){
|
||||
Mob.disciplineDroppers.add(mob);
|
||||
}
|
||||
mob.level = 60;
|
||||
mob.healthMax = 7500;
|
||||
mob.setHealth(7500);
|
||||
|
||||
@@ -846,7 +846,9 @@ public class MobAI {
|
||||
private static void CheckForRespawn(Mob aiAgent) {
|
||||
|
||||
try {
|
||||
|
||||
if(Mob.disciplineDroppers.contains(aiAgent) == true){
|
||||
return; // disc dropper respawns handled elsewhere
|
||||
}
|
||||
if (aiAgent.deathTime == 0) {
|
||||
aiAgent.setDeathTime(System.currentTimeMillis());
|
||||
return;
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -42,7 +43,7 @@ import static engine.net.client.msg.ErrorPopupMsg.sendErrorPopup;
|
||||
public class Mob extends AbstractIntelligenceAgent {
|
||||
|
||||
private static int staticID = 0;
|
||||
|
||||
public static ArrayList<Mob> disciplineDroppers = new ArrayList<>();
|
||||
public static HashMap<Integer,Mob> dynamic_pets = new HashMap<>();
|
||||
//mob specific
|
||||
public final ConcurrentHashMap<Integer, Float> playerAgroMap = new ConcurrentHashMap<>(); //key = Player value = hate value
|
||||
|
||||
@@ -203,6 +203,7 @@ public class WorldServer {
|
||||
LocalDateTime nextFlashTrashCheckTime = LocalDateTime.now();
|
||||
LocalDateTime nextHourlyJobTime = LocalDateTime.now().withMinute(0).withSecond(0).plusHours(1);
|
||||
LocalDateTime nextWareHousePushTime = LocalDateTime.now();
|
||||
LocalDateTime nextDiscSpawn = LocalDateTime.now().withMinute(0).withSecond(0).plusHours(1);
|
||||
|
||||
// Begin execution of main game loop
|
||||
|
||||
@@ -245,6 +246,14 @@ public class WorldServer {
|
||||
nextWareHousePushTime = LocalDateTime.now().plusMinutes(15);
|
||||
}
|
||||
|
||||
if (LocalDateTime.now().isAfter(nextDiscSpawn)) {
|
||||
for(Mob dropper : Mob.disciplineDroppers){
|
||||
if(dropper.isAlive() == false){
|
||||
dropper.respawn();
|
||||
}
|
||||
}
|
||||
nextDiscSpawn = LocalDateTime.now().plusHours(3).withMinute(0).withSecond(0);
|
||||
}
|
||||
ThreadUtils.sleep(50);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user