Prevent Lindvior scene missing spawn NPE.

This commit is contained in:
MobiusDevelopment
2022-03-15 17:26:36 +00:00
parent fcdf6b8146
commit 04f3df9e93
14 changed files with 261 additions and 77 deletions

View File

@@ -23,6 +23,7 @@ import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
@@ -85,13 +86,26 @@ public class LindviorScene extends AbstractNpcAI
}
case "start":
{
final Npc lindviorCamera = SpawnTable.getInstance().getAnySpawn(LINDVIOR_CAMERA).getLastSpawn();
final Npc tomaris = SpawnTable.getInstance().getAnySpawn(TOMARIS).getLastSpawn();
final Npc artius = SpawnTable.getInstance().getAnySpawn(ARTIUS).getLastSpawn();
final Spawn cameraSpawn = SpawnTable.getInstance().getAnySpawn(LINDVIOR_CAMERA);
final Spawn tomarisSpawn = SpawnTable.getInstance().getAnySpawn(TOMARIS);
final Spawn artiusSpawn = SpawnTable.getInstance().getAnySpawn(ARTIUS);
if ((cameraSpawn == null) || (tomarisSpawn == null) || (artiusSpawn == null))
{
break;
}
final Npc camera = cameraSpawn.getLastSpawn();
final Npc tomaris = tomarisSpawn.getLastSpawn();
final Npc artius = artiusSpawn.getLastSpawn();
if ((camera == null) || (tomaris == null) || (artius == null))
{
break;
}
startQuestTimer("tomaris_shout1", 1000, tomaris, null);
startQuestTimer("artius_shout", 60000, artius, null);
startQuestTimer("tomaris_shout2", 90000, tomaris, null);
startQuestTimer("lindvior_scene", 120000, lindviorCamera, null);
startQuestTimer("lindvior_scene", 120000, camera, null);
scheduleNextLindviorVisit();
break;
}