forked from MagicBane/Server
mob aggro issue
This commit is contained in:
@@ -727,7 +727,7 @@ public class MobAI {
|
||||
}
|
||||
}
|
||||
|
||||
private static void CheckForAggro(Mob aiAgent) {
|
||||
private static void CheckForAggro(Mob aiAgent, boolean pets) {
|
||||
|
||||
try {
|
||||
|
||||
@@ -735,7 +735,7 @@ public class MobAI {
|
||||
|
||||
if (!aiAgent.isAlive())
|
||||
return;
|
||||
|
||||
if(!pets) {
|
||||
ConcurrentHashMap<Integer, Float> loadedPlayers = aiAgent.playerAgroMap;
|
||||
|
||||
for (Entry playerEntry : loadedPlayers.entrySet()) {
|
||||
@@ -778,8 +778,7 @@ public class MobAI {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (aiAgent.getCombatTarget() == null) {
|
||||
} else{
|
||||
|
||||
//look for pets to aggro if no players found to aggro
|
||||
|
||||
@@ -952,7 +951,7 @@ public class MobAI {
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain))
|
||||
CheckForPlayerGuardAggro(mob);
|
||||
} else {
|
||||
CheckForAggro(mob);
|
||||
CheckForAggro(mob,false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1212,9 +1211,9 @@ public class MobAI {
|
||||
if (mob.behaviourType == Enum.MobBehaviourType.HamletGuard) {
|
||||
SafeGuardAggro(mob); //safehold guard
|
||||
}else {
|
||||
CheckForAggro(mob); //normal aggro
|
||||
CheckForAggro(mob,false); //normal aggro
|
||||
if(mob.combatTarget == null)
|
||||
SafeGuardAggro(mob); // look for pets if no players to aggro
|
||||
CheckForAggro(mob,true); // look for pets if no players to aggro
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user