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,11 +1481,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1427,11 +1427,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1427,11 +1427,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1427,11 +1427,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1416,11 +1416,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1416,11 +1416,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1416,11 +1416,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1424,11 +1424,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -3083,7 +3083,13 @@ 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())
{
// 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())
{
if (this instanceof SiegeGuardInstance)
{
@@ -3099,6 +3105,7 @@ public class Attackable extends NpcInstance
}
}
}
}
/**
* Sets state of the mob to seeded. Paramets needed to be set before.

View File

@@ -1444,11 +1444,18 @@ 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())
{
// 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();
}
}
}
/**
* Checks if its spoiled.

View File

@@ -1444,11 +1444,18 @@ 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())
{
// 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();
}
}
}
/**
* Checks if its spoiled.

View File

@@ -1417,11 +1417,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1417,11 +1417,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1417,11 +1417,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1439,11 +1439,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1439,11 +1439,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1439,11 +1439,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()

View File

@@ -1417,11 +1417,18 @@ 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())
{
// 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();
}
}
}
@Override
public void onRespawn()