Fixed GardenWatchman AI spawn NPE.

This commit is contained in:
MobiusDevelopment 2019-09-21 08:25:44 +00:00
parent 8a156f63fc
commit 340338d820
7 changed files with 7 additions and 7 deletions

View File

@ -54,7 +54,7 @@ public class GardenWatchman extends AbstractNpcAI
{
case "SPAWN_TRAP":
{
if (!npc.isInCombat())
if ((npc != null) && npc.isSpawned() && !npc.isInCombat())
{
npc.doCast(TRAP_SETUP.getSkill());
final Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false);

View File

@ -54,7 +54,7 @@ public class GardenWatchman extends AbstractNpcAI
{
case "SPAWN_TRAP":
{
if (!npc.isInCombat())
if ((npc != null) && npc.isSpawned() && !npc.isInCombat())
{
npc.doCast(TRAP_SETUP.getSkill());
final Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false);

View File

@ -54,7 +54,7 @@ public class GardenWatchman extends AbstractNpcAI
{
case "SPAWN_TRAP":
{
if (!npc.isInCombat())
if ((npc != null) && npc.isSpawned() && !npc.isInCombat())
{
npc.doCast(TRAP_SETUP.getSkill());
final Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false);

View File

@ -54,7 +54,7 @@ public class GardenWatchman extends AbstractNpcAI
{
case "SPAWN_TRAP":
{
if (!npc.isInCombat())
if ((npc != null) && npc.isSpawned() && !npc.isInCombat())
{
npc.doCast(TRAP_SETUP.getSkill());
final Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false);

View File

@ -54,7 +54,7 @@ public class GardenWatchman extends AbstractNpcAI
{
case "SPAWN_TRAP":
{
if (!npc.isInCombat())
if ((npc != null) && npc.isSpawned() && !npc.isInCombat())
{
npc.doCast(TRAP_SETUP.getSkill());
final Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false);

View File

@ -54,7 +54,7 @@ public class GardenWatchman extends AbstractNpcAI
{
case "SPAWN_TRAP":
{
if (!npc.isInCombat())
if ((npc != null) && npc.isSpawned() && !npc.isInCombat())
{
npc.doCast(TRAP_SETUP.getSkill());
final Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false);

View File

@ -54,7 +54,7 @@ public class GardenWatchman extends AbstractNpcAI
{
case "SPAWN_TRAP":
{
if (!npc.isInCombat())
if ((npc != null) && npc.isSpawned() && !npc.isInCombat())
{
npc.doCast(TRAP_SETUP.getSkill());
final Npc trap = addSpawn((getRandom(10) < 5) ? GENESIS_TRAP_1 : GENESIS_TRAP_2, npc, true, 90000, false);