hate value fix

This commit is contained in:
2023-08-29 21:01:00 -05:00
parent db5b988275
commit 69fdddfc71
8 changed files with 17 additions and 68 deletions
+1 -26
View File
@@ -45,7 +45,7 @@ public class Mob extends AbstractIntelligenceAgent {
private static int staticID = 0;
//mob specific
public final ConcurrentHashMap<Integer, Boolean> playerAgroMap = new ConcurrentHashMap<>();
public final ConcurrentHashMap<Integer, Float> playerAgroMap = new ConcurrentHashMap<>(); //key = Player value = hate value
public final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
public long nextCastTime = 0;
@@ -589,28 +589,6 @@ public class Mob extends AbstractIntelligenceAgent {
return skill.getModifiedAmount();
}
public static void HandleAssistedAggro(PlayerCharacter source, PlayerCharacter target) {
HashSet<AbstractWorldObject> mobsInRange = WorldGrid.getObjectsInRangePartial(source, MobAIThread.AI_DROP_AGGRO_RANGE, MBServerStatics.MASK_MOB);
for (AbstractWorldObject awo : mobsInRange) {
Mob mob = (Mob) awo;
//Mob is not attacking anyone, skip.
if (mob.getCombatTarget() == null)
continue;
//Mob not attacking target's target, let's not be failmu and skip this target.
if (mob.getCombatTarget() != target)
continue;
//target is mob's combat target, LETS GO.
if (source.getHateValue() > target.getHateValue())
mob.setCombatTarget(source);
}
}
public static void submitUpgradeJob(Mob mob) {
if (mob.getUpgradeDateTime() == null) {
@@ -1792,9 +1770,6 @@ public class Mob extends AbstractIntelligenceAgent {
if (player.getObjectUUID() == this.getCombatTarget().getObjectUUID())
return;
if (this.getCombatTarget().getObjectType() == GameObjectType.PlayerCharacter)
if (ac.getHateValue() > ((PlayerCharacter) this.getCombatTarget()).getHateValue())
this.setCombatTarget(player);
}
public void setRank(int newRank) {