Browse Source

usage of AIAgentType for default patrol points

combat-2
FatBoy-DOTC 1 year ago
parent
commit
5c3c552288
  1. 2
      src/engine/Enum.java
  2. 7
      src/engine/objects/Mob.java

2
src/engine/Enum.java

@ -2879,6 +2879,8 @@ public class Enum { @@ -2879,6 +2879,8 @@ public class Enum {
MOBILE,
PET,
CHARMED,
SIEGEENGINE,
GUARD;
}
}

7
src/engine/objects/Mob.java

@ -71,6 +71,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -71,6 +71,7 @@ public class Mob extends AbstractIntelligenceAgent {
private int currentID;
//TODO implement feared object system
public AbstractWorldObject fearedObject = null;
private long lastAttackTime = 0;
private int lastMobPowerToken = 0;
@ -87,6 +88,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -87,6 +88,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.currentID = MBServerStatics.NO_DB_ROW_ASSIGNED_YET;
this.bindLoc = Vector3fImmutable.ZERO;
this.gridObjectType = GridObjectType.DYNAMIC;
this.agentType = AIAgentType.MOBILE;
}
@ -153,6 +155,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -153,6 +155,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.currentID = this.dbID;
this.agentType = AIAgentType.MOBILE;
} catch (Exception e) {
Logger.error(e + " " + this.dbID);
}
@ -429,6 +432,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -429,6 +432,7 @@ public class Mob extends AbstractIntelligenceAgent {
Mob mob;
mobile.agentType = AIAgentType.GUARD;
try {
mob = DbManager.MobQueries.PERSIST(mobile);
@ -518,6 +522,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -518,6 +522,7 @@ public class Mob extends AbstractIntelligenceAgent {
siegeMinion.guardCaptain = artyCaptain;
siegeMinion.parentZoneUUID = artyCaptain.parentZoneUUID;
siegeMinion.behaviourType = MobBehaviourType.SiegeEngine;
siegeMinion.agentType = AIAgentType.SIEGEENGINE;
siegeMinion.bindLoc = Vector3fImmutable.ZERO;
//siegeMinion.spawnTime = (60 * 15);
siegeMinion.spawnTime = 15;
@ -1715,7 +1720,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1715,7 +1720,7 @@ public class Mob extends AbstractIntelligenceAgent {
//assign 5 random patrol points for regular mobs
if (this.guardCaptain == null && this.isPlayerGuard == false && !isPet() == false && isNecroPet() == false) {
if (this.agentType.equals(AIAgentType.MOBILE)) {
NPCManager.AssignPatrolPoints(this);
}

Loading…
Cancel
Save