Monster aggression fix.
Contributed by Edoo.
This commit is contained in:
@@ -1481,11 +1481,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1427,11 +1427,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1427,11 +1427,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1427,11 +1427,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1416,11 +1416,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1416,11 +1416,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1416,11 +1416,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1424,11 +1424,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -3083,7 +3083,13 @@ public class Attackable extends NpcInstance
|
|||||||
setWalking();
|
setWalking();
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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)
|
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.
|
* Sets state of the mob to seeded. Paramets needed to be set before.
|
||||||
|
@@ -1444,11 +1444,18 @@ public class Attackable extends Npc
|
|||||||
setWalking();
|
setWalking();
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if its spoiled.
|
* Checks if its spoiled.
|
||||||
|
@@ -1444,11 +1444,18 @@ public class Attackable extends Npc
|
|||||||
setWalking();
|
setWalking();
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if its spoiled.
|
* Checks if its spoiled.
|
||||||
|
@@ -1417,11 +1417,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1417,11 +1417,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1417,11 +1417,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1439,11 +1439,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1439,11 +1439,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1439,11 +1439,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
@@ -1417,11 +1417,18 @@ public class Attackable extends Npc
|
|||||||
_seederObjId = 0;
|
_seederObjId = 0;
|
||||||
|
|
||||||
// Check the region where this mob is, do not activate the AI if region is inactive.
|
// 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();
|
getAI().stopAITask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRespawn()
|
public void onRespawn()
|
||||||
|
Reference in New Issue
Block a user