Author Topic: Interlude Guards keep attacking monsters  (Read 51 times)

Online G-hamsteR

  • Elder
  • ****
  • Posts: 126
Guards keep attacking monsters
« on: September 16, 2020, 07:35:28 AM »
Hello,

Even if you change the following config, guards keep hitting monsters with agro.

Code: [Select]
# If you wish to disable the use of guards against aggressive monsters.
# Default is False.
AllowGuards = False


Online G-hamsteR

  • Elder
  • ****
  • Posts: 126
Re: Guards keep attacking monsters
« Reply #1 on: September 16, 2020, 08:18:49 AM »
This fixed the problem:

Code: [Select]
diff --git java/org/l2jmobius/gameserver/model/actor/knownlist/GuardKnownList.java java/org/l2jmobius/gameserver/model/actor/knownlist/GuardKnownList.java
index d56cc8e..e5ef687 100644
--- java/org/l2jmobius/gameserver/model/actor/knownlist/GuardKnownList.java
+++ java/org/l2jmobius/gameserver/model/actor/knownlist/GuardKnownList.java
@@ -41,6 +40,10 @@
  @Override
  public boolean addKnownObject(WorldObject object, Creature dropper)
  {
+ if (!Config.ALLOW_GUARDS && (object instanceof MonsterInstance))
+ {
+ return false;
+ }
  if (!super.addKnownObject(object, dropper))
  {
  return false;
  return true;
  }
 

Online Mobius

  • Administrator
  • Distinguished King
  • *****
  • Posts: 7700