L2JMobius

Interlude Raidboss Back to Spawn with teleToLocation / minions do not attack

klz · 3 · 899

Offline klz

  • Heir
  • **
    • Posts: 19
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:

Code: [Select]
FixedDistanceRaidRange = 1500
This is the logic in AttackableAI.java on thinkAttack method:

Code: [Select]
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:

Code: [Select]
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?


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19655
NPC.ini
Code: [Select]
# 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