From 6bdc9eaa0bf7f7ac5bb901816196f9a71f20574e Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 4 Dec 2019 18:20:45 +0000 Subject: [PATCH] Monster aggression fix. Contributed by Edoo. --- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 29 ++++++++++++------- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- .../gameserver/model/actor/Attackable.java | 11 +++++-- 18 files changed, 171 insertions(+), 45 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java index e1eaf10033..5faf5549db 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1481,9 +1481,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 303090c8e4..bb09112554 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1427,9 +1427,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 303090c8e4..bb09112554 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1427,9 +1427,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 303090c8e4..bb09112554 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1427,9 +1427,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2a31621a1e..c987b0206b 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1416,9 +1416,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2a31621a1e..c987b0206b 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1416,9 +1416,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2a31621a1e..c987b0206b 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1416,9 +1416,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 4473469492..eea2ed2d60 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1424,9 +1424,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2b2022a302..8cdb5a6862 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -3083,19 +3083,26 @@ public class Attackable extends NpcInstance setWalking(); // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - if (this instanceof SiegeGuardInstance) + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) { - ((SiegeGuardAI) getAI()).stopAITask(); - } - else if (this instanceof FortSiegeGuardInstance) - { - ((FortSiegeGuardAI) getAI()).stopAITask(); - } - else - { - ((AttackableAI) getAI()).stopAITask(); + if (this instanceof SiegeGuardInstance) + { + ((SiegeGuardAI) getAI()).stopAITask(); + } + else if (this instanceof FortSiegeGuardInstance) + { + ((FortSiegeGuardAI) getAI()).stopAITask(); + } + else + { + ((AttackableAI) getAI()).stopAITask(); + } } } } diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 96aba82eea..107b8cf24d 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1444,9 +1444,16 @@ public class Attackable extends Npc setWalking(); // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 96aba82eea..107b8cf24d 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1444,9 +1444,16 @@ public class Attackable extends Npc setWalking(); // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 89a18463a4..545670f96c 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1417,9 +1417,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 89a18463a4..545670f96c 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1417,9 +1417,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 89a18463a4..545670f96c 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1417,9 +1417,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ee21e2f012..86e4ea1560 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1439,9 +1439,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ee21e2f012..86e4ea1560 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1439,9 +1439,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ee21e2f012..86e4ea1560 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1439,9 +1439,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 89a18463a4..545670f96c 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1417,9 +1417,16 @@ public class Attackable extends Npc _seederObjId = 0; // Check the region where this mob is, do not activate the AI if region is inactive. - if (hasAI() && !isInActiveRegion()) + if (hasAI()) { - getAI().stopAITask(); + // Set the intention of the Attackable to AI_INTENTION_ACTIVE + getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); + + // Check the region where this mob is, do not activate the AI if region is inactive. + if (!isInActiveRegion()) + { + getAI().stopAITask(); + } } }