L2JMobius

Public Development => Bug Reports => Topic started by: gamelike85 on November 19, 2025, 11:30:02 PM

Title: Auto-Hunting
Post by: gamelike85 on November 19, 2025, 11:30:02 PM
There's a bug that causes the target to be canceled when you activate "Auto-Hunting". This happens when fighting the bosses:

Code: [Select]
<npc id="29197" level="99" type="GrandBoss" name="Earth Wyrm Trasken" title="Hell's Gate">
 and

Code: [Select]
<npc id="29200" level="99" type="Monster" name="Earth Wyrm Tail">
I'm not sure if it's normal, but it happens...

 :)
Title: Re: Auto-Hunting
Post by: Mobius on November 19, 2025, 11:45:30 PM
Change target type in auto play settings?
Title: Re: Auto-Hunting
Post by: gamelike85 on November 19, 2025, 11:52:00 PM
I've already tried everything, I thought it was an instance problem or a boss collision issue.

Any Target
Monsters
Characters
NPC

In any of them, it cancels...
Title: Re: Auto-Hunting
Post by: Mobius on November 20, 2025, 12:50:12 AM
99% sure GrandBoss to Monster will cause issues.
Title: Re: Auto-Hunting
Post by: gamelike85 on November 20, 2025, 01:49:43 AM
99% sure GrandBoss to Monster will cause issues.

I was thinking the same thing, it's probably related, although the same thing happens with type="Monster" and type="GrandBoss", now I don't know what's going on there...  :(
Title: Re: Auto-Hunting
Post by: Mobius on November 20, 2025, 01:50:18 PM
I was thinking the same thing, it's probably related, although the same thing happens with type="Monster" and type="GrandBoss", now I don't know what's going on there...  :(
Check AutoPlayTaskManager.
Prety sure someone retported that, that is how it works on retail.
Title: Re: Auto-Hunting
Post by: gamelike85 on November 20, 2025, 03:22:23 PM
Code: [Select]
private boolean isTargetModeValid(int mode, Player player, Creature creature)
{
if (!creature.isTargetable() || (creature.isNpc() && (creature.isInvul() || !creature.asNpc().isShowName())))
{
return false;
}

switch (mode)
{
case 1: // Monster
{
return creature.isMonster() && !creature.isRaid() && creature.isAutoAttackable(player);
}
case 2: // Characters
{
return creature.isPlayable() && creature.isAutoAttackable(player);
}
case 3: // NPC
{
return creature.isNpc() && !creature.isMonster() && !creature.isInsideZone(ZoneId.PEACE);
}
default: // Any Target
{
return (creature.isNpc() && !creature.isInsideZone(ZoneId.PEACE)) || (creature.isPlayable() && creature.isAutoAttackable(player));
}
}
}
}

If that's how it is in the official server, the developer must have been high as a kite the size of a building; it makes no sense that it can't be used against bosses. Well, that settles the matter then, although I haven't seen anything related to it or that it's actually like that. I'll have to join an official server to clear up any doubts.

IA:

Quote
Auto-hunting can't be used with Raid Bosses in Lineage 2 because they are often a specific type of target that the auto-hunt system can't be set to automatically engage. Unlike regular mobs, you must manually target and attack Raid Bosses. It's likely a system design choice to prevent characters from using the auto-hunt macro on high-priority, boss-level enemies, which is often considered a more manual and skill-based activity.

An alternative "Custom" configuration could be added to allow it to be used against Raidboss, since it's rather tedious to spend 4 hours hitting a monster manually.
Title: Re: Auto-Hunting
Post by: gigilo1968 on November 20, 2025, 06:38:30 PM
Replace it with this

Code: [Select]
                                case 1: // Monster
{
return creature.isMonster()/* &&!creature.isRaid() */  && creature.isAutoAttackable(player); // add RB in target
}
Title: Re: Auto-Hunting
Post by: gamelike85 on November 22, 2025, 06:17:15 AM
 ;D ;D ;D tyyy
Title: Re: Auto-Hunting
Post by: GuruGel on November 23, 2025, 06:31:56 PM
I solved it this way:
Config.java
(Decide for yourself where to write the config file)
Code: [Select]
public static String RAID_ATACK;
----------------------------------------------

RAID_ATACK = custom.getString("RaidAutoAtack", "ON_RB");

AutoPlayTaskManager.java
Code: [Select]
private boolean isTargetModeValid(int mode, Player player, Creature creature)
{
if (Config.RAID_ATACK.equalsIgnoreCase("OFF_RB"))
{
if (!creature.isTargetable() || (creature.isNpc() && (creature.isInvul() || !creature.asNpc().isShowName())))
{
return false;
}
}

switch (mode)
{
case 1: // Monster
{
if (Config.RAID_ATACK.equalsIgnoreCase("ON_RB"))
{
return creature.isMonster() && creature.isAutoAttackable(player);
}
return creature.isMonster() && !creature.isRaid() && creature.isAutoAttackable(player);
}
case 2: // Characters
{
return creature.isPlayable() && creature.isAutoAttackable(player);
}
case 3: // NPC
{
return creature.isNpc() && !creature.isMonster() && !creature.isInsideZone(ZoneId.PEACE);
}
default: // Any Target
{
return (creature.isNpc() && !creature.isInsideZone(ZoneId.PEACE)) || (creature.isPlayable() && creature.isAutoAttackable(player));
}
}
}