Fixed OctavisWarzone MINION_CALL NPE.
This commit is contained in:
parent
2c3542d363
commit
62e9521556
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
@ -370,10 +370,10 @@ public class OctavisWarzone extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "MINION_CALL":
|
case "MINION_CALL":
|
||||||
{
|
{
|
||||||
final Player mostHated = ((Attackable) npc).getMostHated().getActingPlayer();
|
final Creature mostHated = ((Attackable) npc).getMostHated();
|
||||||
if ((mostHated != null) && (mostHated.calculateDistance3D(npc) < 5000))
|
if ((mostHated != null) && mostHated.isPlayer() && (npc.calculateDistance3D(npc) < 5000))
|
||||||
{
|
{
|
||||||
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, mostHated, 23));
|
World.getInstance().getVisibleObjectsInRange(npc, Attackable.class, 4000, obj -> CommonUtil.contains(BEASTS_MINIONS, obj.getId()) || CommonUtil.contains(GLADIATORS, obj.getId())).forEach(minion -> addAttackPlayerDesire(minion, (Player) mostHated, 23));
|
||||||
}
|
}
|
||||||
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
getTimers().addTimer("MINION_CALL", 5000 + (getRandom(5) * 1000), npc, null);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user