uniform disc dropper respawns

This commit is contained in:
2024-03-10 16:29:12 -05:00
parent 13a4ba6e0e
commit b2a3eb3e6e
4 changed files with 17 additions and 2 deletions
+3
View File
@@ -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);
+3 -1
View File
@@ -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;
+2 -1
View File
@@ -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
+9
View File
@@ -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);
}
}