L2JMobius
Public Development => General Discussion => Topic started by: klz on March 10, 2025, 04:02:33 PM
-
Hi guys, i'm working on a feature to spawn back to original spawn a raid boss if calculateDistance2D is > than a fixed configuration option i created:
FixedDistanceRaidRange = 1500
This is the logic in AttackableAI.java on thinkAttack method:
if ((spawn != null) && npc.isRaid())
{
if ((Config.FIXED_DISTANCE_CHECK_RAID_RANGE > 0) && (npc.calculateDistance2D(spawn.getSpawnLocation()) > Config.FIXED_DISTANCE_CHECK_RAID_RANGE))
{
npc.abortAttack();
npc.clearAggroList();
npc.getAttackByList().clear();
setIntention(AI_INTENTION_ACTIVE);
npc.teleToLocation(spawn.getLocation(), false);
return;
}
}
However when npc.teleToLocation is executed, if i go back to hit the raid boss, minions do not attack me, they just stand still.
I was wondering if someone could give me a hint on how to manage this, tried this:
if (_actor.asMonster().hasMinions())
{
for (Monster minion : _actor.asMonster().getMinionList().getSpawnedMinions())
{
minion.abortAttack();
minion.clearAggroList();
minion.getAttackByList().clear();
minion.teleToLocation(spawn.getLocation(), true);
}
}
but it ain't working. Could this be related to the instanceId of the raid boss?
-
NPC.ini
# Enable monster aggro distance check.
# When enabled monsters will lose aggro if pulled far away from spawn.
# Default: False
AggroDistanceCheckEnabled = False
# Maximum distance monsters can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 2000
AggroDistanceCheckRange = 2000
# Use maximum aggro distance check for raids.
# Grandbosses are excluded.
# Default: False
AggroDistanceCheckRaids = False
# Maximum distance raids can be pulled away from spawn.
# Overridden by Spawn chaseRange parameter.
# Default: 4000
AggroDistanceCheckRaidRange = 4000
# Use maximum aggro distance check in instances.
# Default: False
AggroDistanceCheckInstances = False
# Restore monster HP and MP when aggro is reset by distance.
# Default: True
AggroDistanceCheckRestoreLife = True
-
I'm so dumb. Thank you!!