Monster aggression fix.

Contributed by Edoo.
This commit is contained in:
MobiusDevelopment
2019-12-04 18:20:45 +00:00
parent 8db95b85f4
commit 6bdc9eaa0b
18 changed files with 171 additions and 45 deletions

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}