Addition of AggroDistanceCheckRaidRange configuration.

This commit is contained in:
MobiusDevelopment
2020-06-07 21:53:21 +00:00
parent ed6274df0e
commit 56872c8693
54 changed files with 163 additions and 36 deletions

View File

@@ -638,6 +638,7 @@ public class Config
public static boolean AGGRO_DISTANCE_CHECK_ENABLED;
public static int AGGRO_DISTANCE_CHECK_RANGE;
public static boolean AGGRO_DISTANCE_CHECK_RAIDS;
public static int AGGRO_DISTANCE_CHECK_RAID_RANGE;
public static boolean AGGRO_DISTANCE_CHECK_INSTANCES;
public static boolean AGGRO_DISTANCE_CHECK_RESTORE_LIFE;
public static boolean GUARD_ATTACK_AGGRO_MOB;
@@ -2045,6 +2046,7 @@ public class Config
AGGRO_DISTANCE_CHECK_ENABLED = NPC.getBoolean("AggroDistanceCheckEnabled", true);
AGGRO_DISTANCE_CHECK_RANGE = NPC.getInt("AggroDistanceCheckRange", 1500);
AGGRO_DISTANCE_CHECK_RAIDS = NPC.getBoolean("AggroDistanceCheckRaids", false);
AGGRO_DISTANCE_CHECK_RAID_RANGE = NPC.getInt("AggroDistanceCheckRaidRange", 3000);
AGGRO_DISTANCE_CHECK_INSTANCES = NPC.getBoolean("AggroDistanceCheckInstances", false);
AGGRO_DISTANCE_CHECK_RESTORE_LIFE = NPC.getBoolean("AggroDistanceCheckRestoreLife", true);
GUARD_ATTACK_AGGRO_MOB = NPC.getBoolean("GuardAttackAggroMob", false);

View File

@@ -601,10 +601,10 @@ public class AttackableAI extends CreatureAI
return;
}
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker())
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBossInstance))
{
final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > Config.AGGRO_DISTANCE_CHECK_RANGE))
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE)))
{
if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{