Implemented Spawn chaseRange parameter.

This commit is contained in:
MobiusDevelopment
2022-08-07 21:05:53 +00:00
parent b47ac4b571
commit 0eebada4bd
142 changed files with 579 additions and 116 deletions

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = True AggroDistanceCheckEnabled = True
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = True AggroDistanceCheckEnabled = True
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = True AggroDistanceCheckEnabled = True
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = True AggroDistanceCheckEnabled = True
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = True AggroDistanceCheckEnabled = True
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,6 +98,7 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = True AggroDistanceCheckEnabled = True
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500 # Default: 1500
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000 # Default: 3000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -572,8 +572,8 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Default: 2000
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -581,8 +581,8 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Default: 4000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -600,8 +600,8 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Default: 2000
AggroDistanceCheckRange = 1500 AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -609,8 +609,8 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Default: 4000
AggroDistanceCheckRaidRange = 3000 AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -111,8 +111,9 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRange = 1500 # Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -120,8 +121,9 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRaidRange = 3000 # Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -50,6 +50,7 @@
<xs:attribute name="count" type="xs:positiveInteger" use="optional" /> <xs:attribute name="count" type="xs:positiveInteger" use="optional" />
<xs:attribute name="respawnDelay" type="xs:nonNegativeInteger" use="optional" /> <xs:attribute name="respawnDelay" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="respawnRandom" type="xs:nonNegativeInteger" use="optional" /> <xs:attribute name="respawnRandom" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="chaseRange" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="periodOfDay" use="optional"> <xs:attribute name="periodOfDay" use="optional">
<xs:simpleType> <xs:simpleType>
<xs:restriction base="xs:token"> <xs:restriction base="xs:token">

View File

@@ -733,7 +733,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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.getInstanceId() == 0))) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || (npc.getInstanceId() == 0)))
{ {

View File

@@ -335,6 +335,11 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom")); spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
} }
if (attrs.getNamedItem("chaseRange") != null)
{
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
}
if (attrs.getNamedItem("periodOfDay") != null) if (attrs.getNamedItem("periodOfDay") != null)
{ {
final String period = attrs.getNamedItem("periodOfDay").getNodeValue(); final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
@@ -371,6 +376,7 @@ public class SpawnTable implements IXmlReader
spawnDat.setXYZ(spawnInfo.getInt("x", 0), spawnInfo.getInt("y", 0), spawnInfo.getInt("z", 0)); spawnDat.setXYZ(spawnInfo.getInt("x", 0), spawnInfo.getInt("y", 0), spawnInfo.getInt("z", 0));
spawnDat.setHeading(spawnInfo.getInt("heading", -1)); spawnDat.setHeading(spawnInfo.getInt("heading", -1));
spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0)); spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0));
spawnDat.setChaseRange(spawnInfo.getInt("chaseRange", 0));
spawnDat.setLocationId(spawnInfo.getInt("locId", 0)); spawnDat.setLocationId(spawnInfo.getInt("locId", 0));
final String territoryName = spawnInfo.getString("territoryName", ""); final String territoryName = spawnInfo.getString("territoryName", "");
final String spawnName = spawnInfo.getString("spawnName", ""); final String spawnName = spawnInfo.getString("spawnName", "");

View File

@@ -71,6 +71,8 @@ public class Spawn extends Location implements IIdentifiable, INamable
private int _respawnMinDelay; private int _respawnMinDelay;
/** Maximum respawn delay */ /** Maximum respawn delay */
private int _respawnMaxDelay; private int _respawnMaxDelay;
/** Maximum distance monsters can be pulled away from spawn. */
private int _chaseRange;
/** The generic constructor of Npc managed by this Spawn */ /** The generic constructor of Npc managed by this Spawn */
private Constructor<? extends Npc> _constructor; private Constructor<? extends Npc> _constructor;
/** If True an Npc is respawned each time that another is killed */ /** If True an Npc is respawned each time that another is killed */
@@ -546,6 +548,16 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public void setChaseRange(int chaseRange)
{
_chaseRange = chaseRange;
}
public int getChaseRange()
{
return _chaseRange;
}
public void setSpawnTerritory(NpcSpawnTerritory territory) public void setSpawnTerritory(NpcSpawnTerritory territory)
{ {
_spawnTerritory = territory; _spawnTerritory = territory;

View File

@@ -111,8 +111,9 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRange = 1500 # Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -120,8 +121,9 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRaidRange = 3000 # Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -50,6 +50,7 @@
<xs:attribute name="count" type="xs:positiveInteger" use="optional" /> <xs:attribute name="count" type="xs:positiveInteger" use="optional" />
<xs:attribute name="respawnDelay" type="xs:nonNegativeInteger" use="optional" /> <xs:attribute name="respawnDelay" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="respawnRandom" type="xs:nonNegativeInteger" use="optional" /> <xs:attribute name="respawnRandom" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="chaseRange" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="periodOfDay" use="optional"> <xs:attribute name="periodOfDay" use="optional">
<xs:simpleType> <xs:simpleType>
<xs:restriction base="xs:token"> <xs:restriction base="xs:token">

View File

@@ -733,7 +733,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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.getInstanceId() == 0))) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || (npc.getInstanceId() == 0)))
{ {

View File

@@ -335,6 +335,11 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom")); spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
} }
if (attrs.getNamedItem("chaseRange") != null)
{
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
}
if (attrs.getNamedItem("periodOfDay") != null) if (attrs.getNamedItem("periodOfDay") != null)
{ {
final String period = attrs.getNamedItem("periodOfDay").getNodeValue(); final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
@@ -371,6 +376,7 @@ public class SpawnTable implements IXmlReader
spawnDat.setXYZ(spawnInfo.getInt("x", 0), spawnInfo.getInt("y", 0), spawnInfo.getInt("z", 0)); spawnDat.setXYZ(spawnInfo.getInt("x", 0), spawnInfo.getInt("y", 0), spawnInfo.getInt("z", 0));
spawnDat.setHeading(spawnInfo.getInt("heading", -1)); spawnDat.setHeading(spawnInfo.getInt("heading", -1));
spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0)); spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0));
spawnDat.setChaseRange(spawnInfo.getInt("chaseRange", 0));
spawnDat.setLocationId(spawnInfo.getInt("locId", 0)); spawnDat.setLocationId(spawnInfo.getInt("locId", 0));
final String territoryName = spawnInfo.getString("territoryName", ""); final String territoryName = spawnInfo.getString("territoryName", "");
final String spawnName = spawnInfo.getString("spawnName", ""); final String spawnName = spawnInfo.getString("spawnName", "");

View File

@@ -71,6 +71,8 @@ public class Spawn extends Location implements IIdentifiable, INamable
private int _respawnMinDelay; private int _respawnMinDelay;
/** Maximum respawn delay */ /** Maximum respawn delay */
private int _respawnMaxDelay; private int _respawnMaxDelay;
/** Maximum distance monsters can be pulled away from spawn. */
private int _chaseRange;
/** The generic constructor of Npc managed by this Spawn */ /** The generic constructor of Npc managed by this Spawn */
private Constructor<? extends Npc> _constructor; private Constructor<? extends Npc> _constructor;
/** If True an Npc is respawned each time that another is killed */ /** If True an Npc is respawned each time that another is killed */
@@ -540,6 +542,16 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public void setChaseRange(int chaseRange)
{
_chaseRange = chaseRange;
}
public int getChaseRange()
{
return _chaseRange;
}
public void setSpawnTerritory(NpcSpawnTerritory territory) public void setSpawnTerritory(NpcSpawnTerritory territory)
{ {
_spawnTerritory = territory; _spawnTerritory = territory;

View File

@@ -111,8 +111,9 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRange = 1500 # Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -120,8 +121,9 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRaidRange = 3000 # Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -50,6 +50,7 @@
<xs:attribute name="count" type="xs:positiveInteger" use="optional" /> <xs:attribute name="count" type="xs:positiveInteger" use="optional" />
<xs:attribute name="respawnDelay" type="xs:nonNegativeInteger" use="optional" /> <xs:attribute name="respawnDelay" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="respawnRandom" type="xs:nonNegativeInteger" use="optional" /> <xs:attribute name="respawnRandom" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="chaseRange" type="xs:nonNegativeInteger" use="optional" />
<xs:attribute name="periodOfDay" use="optional"> <xs:attribute name="periodOfDay" use="optional">
<xs:simpleType> <xs:simpleType>
<xs:restriction base="xs:token"> <xs:restriction base="xs:token">

View File

@@ -733,7 +733,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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.getInstanceId() == 0))) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || (npc.getInstanceId() == 0)))
{ {

View File

@@ -335,6 +335,11 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom")); spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
} }
if (attrs.getNamedItem("chaseRange") != null)
{
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
}
if (attrs.getNamedItem("periodOfDay") != null) if (attrs.getNamedItem("periodOfDay") != null)
{ {
final String period = attrs.getNamedItem("periodOfDay").getNodeValue(); final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
@@ -371,6 +376,7 @@ public class SpawnTable implements IXmlReader
spawnDat.setXYZ(spawnInfo.getInt("x", 0), spawnInfo.getInt("y", 0), spawnInfo.getInt("z", 0)); spawnDat.setXYZ(spawnInfo.getInt("x", 0), spawnInfo.getInt("y", 0), spawnInfo.getInt("z", 0));
spawnDat.setHeading(spawnInfo.getInt("heading", -1)); spawnDat.setHeading(spawnInfo.getInt("heading", -1));
spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0)); spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0));
spawnDat.setChaseRange(spawnInfo.getInt("chaseRange", 0));
spawnDat.setLocationId(spawnInfo.getInt("locId", 0)); spawnDat.setLocationId(spawnInfo.getInt("locId", 0));
final String territoryName = spawnInfo.getString("territoryName", ""); final String territoryName = spawnInfo.getString("territoryName", "");
final String spawnName = spawnInfo.getString("spawnName", ""); final String spawnName = spawnInfo.getString("spawnName", "");

View File

@@ -71,6 +71,8 @@ public class Spawn extends Location implements IIdentifiable, INamable
private int _respawnMinDelay; private int _respawnMinDelay;
/** Maximum respawn delay */ /** Maximum respawn delay */
private int _respawnMaxDelay; private int _respawnMaxDelay;
/** Maximum distance monsters can be pulled away from spawn. */
private int _chaseRange;
/** The generic constructor of Npc managed by this Spawn */ /** The generic constructor of Npc managed by this Spawn */
private Constructor<? extends Npc> _constructor; private Constructor<? extends Npc> _constructor;
/** If True an Npc is respawned each time that another is killed */ /** If True an Npc is respawned each time that another is killed */
@@ -546,6 +548,16 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public void setChaseRange(int chaseRange)
{
_chaseRange = chaseRange;
}
public int getChaseRange()
{
return _chaseRange;
}
public void setSpawnTerritory(NpcSpawnTerritory territory) public void setSpawnTerritory(NpcSpawnTerritory territory)
{ {
_spawnTerritory = territory; _spawnTerritory = territory;

View File

@@ -98,8 +98,9 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRange = 1500 # Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -107,8 +108,9 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRaidRange = 3000 # Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,8 +98,9 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRange = 1500 # Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -107,8 +108,9 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRaidRange = 3000 # Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,8 +98,9 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRange = 1500 # Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -107,8 +108,9 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRaidRange = 3000 # Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,8 +98,9 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRange = 1500 # Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -107,8 +108,9 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRaidRange = 3000 # Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

View File

@@ -517,6 +517,11 @@ public class Spawn extends Location implements IIdentifiable, INamable
return _respawnMinDelay != _respawnMaxDelay; return _respawnMinDelay != _respawnMaxDelay;
} }
public int getChaseRange()
{
return _spawnTemplate.getChaseRange();
}
public Npc getLastSpawn() public Npc getLastSpawn()
{ {
if (!_spawnedNpcs.isEmpty()) if (!_spawnedNpcs.isEmpty())

View File

@@ -54,6 +54,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
private final int _count; private final int _count;
private final Duration _respawnTime; private final Duration _respawnTime;
private final Duration _respawnTimeRandom; private final Duration _respawnTimeRandom;
private final int _chaseRange;
private List<ChanceLocation> _locations; private List<ChanceLocation> _locations;
private SpawnTerritory _zone; private SpawnTerritory _zone;
private StatSet _parameters; private StatSet _parameters;
@@ -73,6 +74,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = template._count; _count = template._count;
_respawnTime = template._respawnTime; _respawnTime = template._respawnTime;
_respawnTimeRandom = template._respawnTimeRandom; _respawnTimeRandom = template._respawnTimeRandom;
_chaseRange = template._chaseRange;
_spawnAnimation = template._spawnAnimation; _spawnAnimation = template._spawnAnimation;
_saveInDB = template._saveInDB; _saveInDB = template._saveInDB;
_dbName = template._dbName; _dbName = template._dbName;
@@ -90,6 +92,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
_count = set.getInt("count", 1); _count = set.getInt("count", 1);
_respawnTime = set.getDuration("respawnTime", null); _respawnTime = set.getDuration("respawnTime", null);
_respawnTimeRandom = set.getDuration("respawnRandom", null); _respawnTimeRandom = set.getDuration("respawnRandom", null);
_chaseRange = set.getInt("chaseRange", 0);
_spawnAnimation = set.getBoolean("spawnAnimation", false); _spawnAnimation = set.getBoolean("spawnAnimation", false);
_saveInDB = set.getBoolean("dbSave", false); _saveInDB = set.getBoolean("dbSave", false);
_dbName = set.getString("dbName", null); _dbName = set.getString("dbName", null);
@@ -195,6 +198,11 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
return _respawnTimeRandom; return _respawnTimeRandom;
} }
public int getChaseRange()
{
return _chaseRange;
}
public List<ChanceLocation> getLocation() public List<ChanceLocation> getLocation()
{ {
return _locations; return _locations;

View File

@@ -98,8 +98,9 @@ MaxDriftRange = 300
AggroDistanceCheckEnabled = False AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn. # Maximum distance monsters can be pulled away from spawn.
# Default: 1500 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRange = 1500 # Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids. # Use maximum aggro distance check for raids.
# Grandbosses are excluded. # Grandbosses are excluded.
@@ -107,8 +108,9 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn. # Maximum distance raids can be pulled away from spawn.
# Default: 3000 # Overridden by Spawn chaseRange parameter.
AggroDistanceCheckRaidRange = 3000 # Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances. # Use maximum aggro distance check in instances.
# Default: False # Default: False

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" /> <xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" /> <xs:attribute type="xs:string" name="respawnTime" />
<xs:attribute type="xs:string" name="respawnRandom" /> <xs:attribute type="xs:string" name="respawnRandom" />
<xs:attribute type="xs:integer" name="chaseRange" />
<xs:attribute type="xs:integer" name="x" /> <xs:attribute type="xs:integer" name="x" />
<xs:attribute type="xs:integer" name="y" /> <xs:attribute type="xs:integer" name="y" />
<xs:attribute type="xs:integer" name="z" /> <xs:attribute type="xs:integer" name="z" />

View File

@@ -608,7 +608,7 @@ public class AttackableAI extends CreatureAI
if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss)) if (Config.AGGRO_DISTANCE_CHECK_ENABLED && npc.isMonster() && !npc.isWalker() && !(npc instanceof GrandBoss))
{ {
final Spawn spawn = npc.getSpawn(); final Spawn spawn = npc.getSpawn();
if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (npc.isRaid() ? Config.AGGRO_DISTANCE_CHECK_RAID_RANGE : Config.AGGRO_DISTANCE_CHECK_RANGE))) if ((spawn != null) && (npc.calculateDistance3D(spawn.getLocation()) > (spawn.getChaseRange() > 0 ? Math.max(Config.MAX_DRIFT_RANGE, spawn.getChaseRange()) : (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())) if ((Config.AGGRO_DISTANCE_CHECK_RAIDS || !npc.isRaid()) && (Config.AGGRO_DISTANCE_CHECK_INSTANCES || !npc.isInInstance()))
{ {

Some files were not shown because too many files have changed in this diff Show More