Additional checks for monster teleport to spawn.
This commit is contained in:
parent
5831dedf05
commit
b5e45cea48
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -811,7 +811,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && (npc.getInstanceId() == 0))
|
if (npc.isMonster() && (npc.getSpawn() != null) && (npc.getInstanceId() == 0) && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Monster teleport to spawn
|
// Monster teleport to spawn
|
||||||
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance())
|
if (npc.isMonster() && (npc.getSpawn() != null) && !npc.isInInstance() && (npc.isInCombat() || World.getInstance().getVisibleObjects(npc, PlayerInstance.class).isEmpty()))
|
||||||
{
|
{
|
||||||
npc.teleToLocation(npc.getSpawn(), false);
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user