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