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
# Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 1500
AggroDistanceCheckRange = 1500
@@ -107,6 +108,7 @@ AggroDistanceCheckRange = 1500
AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 3000
AggroDistanceCheckRaidRange = 3000

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -50,6 +50,7 @@
<xs:attribute name="count" type="xs:positiveInteger" use="optional" />
<xs:attribute name="respawnDelay" 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:simpleType>
<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))
{
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)))
{

View File

@@ -335,6 +335,11 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
}
if (attrs.getNamedItem("chaseRange") != null)
{
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
}
if (attrs.getNamedItem("periodOfDay") != null)
{
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.setHeading(spawnInfo.getInt("heading", -1));
spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0));
spawnDat.setChaseRange(spawnInfo.getInt("chaseRange", 0));
spawnDat.setLocationId(spawnInfo.getInt("locId", 0));
final String territoryName = spawnInfo.getString("territoryName", "");
final String spawnName = spawnInfo.getString("spawnName", "");

View File

@@ -71,6 +71,8 @@ public class Spawn extends Location implements IIdentifiable, INamable
private int _respawnMinDelay;
/** Maximum respawn delay */
private int _respawnMaxDelay;
/** Maximum distance monsters can be pulled away from spawn. */
private int _chaseRange;
/** The generic constructor of Npc managed by this Spawn */
private Constructor<? extends Npc> _constructor;
/** 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;
}
public void setChaseRange(int chaseRange)
{
_chaseRange = chaseRange;
}
public int getChaseRange()
{
return _chaseRange;
}
public void setSpawnTerritory(NpcSpawnTerritory territory)
{
_spawnTerritory = territory;

View File

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

View File

@@ -50,6 +50,7 @@
<xs:attribute name="count" type="xs:positiveInteger" use="optional" />
<xs:attribute name="respawnDelay" 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:simpleType>
<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))
{
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)))
{

View File

@@ -335,6 +335,11 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
}
if (attrs.getNamedItem("chaseRange") != null)
{
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
}
if (attrs.getNamedItem("periodOfDay") != null)
{
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.setHeading(spawnInfo.getInt("heading", -1));
spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0));
spawnDat.setChaseRange(spawnInfo.getInt("chaseRange", 0));
spawnDat.setLocationId(spawnInfo.getInt("locId", 0));
final String territoryName = spawnInfo.getString("territoryName", "");
final String spawnName = spawnInfo.getString("spawnName", "");

View File

@@ -71,6 +71,8 @@ public class Spawn extends Location implements IIdentifiable, INamable
private int _respawnMinDelay;
/** Maximum respawn delay */
private int _respawnMaxDelay;
/** Maximum distance monsters can be pulled away from spawn. */
private int _chaseRange;
/** The generic constructor of Npc managed by this Spawn */
private Constructor<? extends Npc> _constructor;
/** 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;
}
public void setChaseRange(int chaseRange)
{
_chaseRange = chaseRange;
}
public int getChaseRange()
{
return _chaseRange;
}
public void setSpawnTerritory(NpcSpawnTerritory territory)
{
_spawnTerritory = territory;

View File

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

View File

@@ -50,6 +50,7 @@
<xs:attribute name="count" type="xs:positiveInteger" use="optional" />
<xs:attribute name="respawnDelay" 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:simpleType>
<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))
{
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)))
{

View File

@@ -335,6 +335,11 @@ public class SpawnTable implements IXmlReader
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
}
if (attrs.getNamedItem("chaseRange") != null)
{
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
}
if (attrs.getNamedItem("periodOfDay") != null)
{
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.setHeading(spawnInfo.getInt("heading", -1));
spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0));
spawnDat.setChaseRange(spawnInfo.getInt("chaseRange", 0));
spawnDat.setLocationId(spawnInfo.getInt("locId", 0));
final String territoryName = spawnInfo.getString("territoryName", "");
final String spawnName = spawnInfo.getString("spawnName", "");

View File

@@ -71,6 +71,8 @@ public class Spawn extends Location implements IIdentifiable, INamable
private int _respawnMinDelay;
/** Maximum respawn delay */
private int _respawnMaxDelay;
/** Maximum distance monsters can be pulled away from spawn. */
private int _chaseRange;
/** The generic constructor of Npc managed by this Spawn */
private Constructor<? extends Npc> _constructor;
/** 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;
}
public void setChaseRange(int chaseRange)
{
_chaseRange = chaseRange;
}
public int getChaseRange()
{
return _chaseRange;
}
public void setSpawnTerritory(NpcSpawnTerritory territory)
{
_spawnTerritory = territory;

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

View File

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

View File

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

View File

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

View File

@@ -113,6 +113,7 @@
<xs:attribute type="xs:positiveInteger" name="count" />
<xs:attribute type="xs:string" name="respawnTime" />
<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="y" />
<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))
{
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()))
{

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