Browse Source

uniform disc dropper respawns

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
b2a3eb3e6e
  1. 3
      src/engine/gameManager/LootManager.java
  2. 4
      src/engine/mobileAI/MobAI.java
  3. 3
      src/engine/objects/Mob.java
  4. 9
      src/engine/server/world/WorldServer.java

3
src/engine/gameManager/LootManager.java

@ -102,6 +102,9 @@ public enum LootManager { @@ -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);

4
src/engine/mobileAI/MobAI.java

@ -846,7 +846,9 @@ public class MobAI { @@ -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;

3
src/engine/objects/Mob.java

@ -32,6 +32,7 @@ import org.pmw.tinylog.Logger; @@ -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; @@ -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
src/engine/server/world/WorldServer.java

@ -203,6 +203,7 @@ public class WorldServer { @@ -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 { @@ -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);
}
}

Loading…
Cancel
Save