|
|
@ -708,7 +708,7 @@ public class MobAI { |
|
|
|
if (!aiAgent.isAlive()) |
|
|
|
if (!aiAgent.isAlive()) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
ConcurrentHashMap<Integer, Boolean> loadedPlayers = aiAgent.playerAgroMap; |
|
|
|
ConcurrentHashMap<Integer, Float> loadedPlayers = aiAgent.playerAgroMap; |
|
|
|
|
|
|
|
|
|
|
|
for (Entry playerEntry : loadedPlayers.entrySet()) { |
|
|
|
for (Entry playerEntry : loadedPlayers.entrySet()) { |
|
|
|
|
|
|
|
|
|
|
@ -956,8 +956,8 @@ public class MobAI { |
|
|
|
PowersManager.useMobPower(mob, mob, recall, 40); |
|
|
|
PowersManager.useMobPower(mob, mob, recall, 40); |
|
|
|
mob.setCombatTarget(null); |
|
|
|
mob.setCombatTarget(null); |
|
|
|
|
|
|
|
|
|
|
|
for (Entry playerEntry : mob.playerAgroMap.entrySet()) |
|
|
|
for (Integer playerEntry : mob.playerAgroMap.keySet()) |
|
|
|
PlayerCharacter.getFromCache((int) playerEntry.getKey()).setHateValue(0); |
|
|
|
mob.playerAgroMap.put(playerEntry,0f); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckToSendMobHome" + " " + e.getMessage()); |
|
|
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: CheckToSendMobHome" + " " + e.getMessage()); |
|
|
@ -1204,7 +1204,7 @@ public class MobAI { |
|
|
|
if (!mob.isAlive()) |
|
|
|
if (!mob.isAlive()) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
ConcurrentHashMap<Integer, Boolean> loadedPlayers = mob.playerAgroMap; |
|
|
|
ConcurrentHashMap<Integer, Float> loadedPlayers = mob.playerAgroMap; |
|
|
|
|
|
|
|
|
|
|
|
for (Entry playerEntry : loadedPlayers.entrySet()) { |
|
|
|
for (Entry playerEntry : loadedPlayers.entrySet()) { |
|
|
|
|
|
|
|
|
|
|
@ -1364,7 +1364,7 @@ public class MobAI { |
|
|
|
float CurrentHateValue = 0; |
|
|
|
float CurrentHateValue = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (mob.getCombatTarget() != null && mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) |
|
|
|
if (mob.getCombatTarget() != null && mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) |
|
|
|
CurrentHateValue = ((PlayerCharacter) mob.getCombatTarget()).getHateValue(); |
|
|
|
CurrentHateValue = mob.playerAgroMap.get(mob.combatTarget.getObjectUUID()).floatValue(); |
|
|
|
|
|
|
|
|
|
|
|
AbstractWorldObject mostHatedTarget = null; |
|
|
|
AbstractWorldObject mostHatedTarget = null; |
|
|
|
|
|
|
|
|
|
|
@ -1375,8 +1375,8 @@ public class MobAI { |
|
|
|
if (potentialTarget.equals(mob.getCombatTarget())) |
|
|
|
if (potentialTarget.equals(mob.getCombatTarget())) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
if (potentialTarget != null && potentialTarget.getHateValue() > CurrentHateValue && MovementUtilities.inRangeToAggro(mob, potentialTarget)) { |
|
|
|
if (potentialTarget != null && mob.playerAgroMap.get(potentialTarget.getObjectUUID()).floatValue() > CurrentHateValue && MovementUtilities.inRangeToAggro(mob, potentialTarget)) { |
|
|
|
CurrentHateValue = potentialTarget.getHateValue(); |
|
|
|
CurrentHateValue = mob.playerAgroMap.get(potentialTarget.getObjectUUID()).floatValue(); |
|
|
|
mostHatedTarget = potentialTarget; |
|
|
|
mostHatedTarget = potentialTarget; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|