From ce279555a09d233a9a61a42ba1c8781b9fcc7c03 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 31 Aug 2017 03:22:42 +0000 Subject: [PATCH] Fixed NPC action shift when spawn group is null. --- .../handlers/actionshifthandlers/L2NpcActionShift.java | 6 +++--- .../handlers/actionshifthandlers/L2NpcActionShift.java | 6 +++--- .../handlers/actionshifthandlers/L2NpcActionShift.java | 6 +++--- .../handlers/actionshifthandlers/L2NpcActionShift.java | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java index 3e1ac09aea..e008602fc2 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java @@ -116,7 +116,7 @@ public class L2NpcActionShift implements IActionShiftHandler final String fileName = template.getSpawnTemplate().getFile().getAbsolutePath().substring(Config.DATAPACK_ROOT.getAbsolutePath().length() + 1).replace('\\', '/'); html.replace("%spawnfile%", fileName); html.replace("%spawnname%", template.getSpawnTemplate().getName()); - html.replace("%spawngroup%", template.getGroup().getName()); + html.replace("%spawngroup%", String.valueOf(template.getGroup().getName())); // used String.valueOf because it can be null if (template.getSpawnTemplate().getAI() != null) { final Quest script = QuestManager.getInstance().getQuest(template.getSpawnTemplate().getAI()); @@ -137,11 +137,11 @@ public class L2NpcActionShift implements IActionShiftHandler } else if (npc.getSpawn().hasRespawnRandom()) { - html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"); + html.replace("%resp%", (npc.getSpawn().getRespawnMinDelay() / 1000) + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"); } else { - html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + " sec"); + html.replace("%resp%", (npc.getSpawn().getRespawnMinDelay() / 1000) + " sec"); } } else diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java index 3e1ac09aea..e008602fc2 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java @@ -116,7 +116,7 @@ public class L2NpcActionShift implements IActionShiftHandler final String fileName = template.getSpawnTemplate().getFile().getAbsolutePath().substring(Config.DATAPACK_ROOT.getAbsolutePath().length() + 1).replace('\\', '/'); html.replace("%spawnfile%", fileName); html.replace("%spawnname%", template.getSpawnTemplate().getName()); - html.replace("%spawngroup%", template.getGroup().getName()); + html.replace("%spawngroup%", String.valueOf(template.getGroup().getName())); // used String.valueOf because it can be null if (template.getSpawnTemplate().getAI() != null) { final Quest script = QuestManager.getInstance().getQuest(template.getSpawnTemplate().getAI()); @@ -137,11 +137,11 @@ public class L2NpcActionShift implements IActionShiftHandler } else if (npc.getSpawn().hasRespawnRandom()) { - html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"); + html.replace("%resp%", (npc.getSpawn().getRespawnMinDelay() / 1000) + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"); } else { - html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + " sec"); + html.replace("%resp%", (npc.getSpawn().getRespawnMinDelay() / 1000) + " sec"); } } else diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java index 3e1ac09aea..e008602fc2 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java @@ -116,7 +116,7 @@ public class L2NpcActionShift implements IActionShiftHandler final String fileName = template.getSpawnTemplate().getFile().getAbsolutePath().substring(Config.DATAPACK_ROOT.getAbsolutePath().length() + 1).replace('\\', '/'); html.replace("%spawnfile%", fileName); html.replace("%spawnname%", template.getSpawnTemplate().getName()); - html.replace("%spawngroup%", template.getGroup().getName()); + html.replace("%spawngroup%", String.valueOf(template.getGroup().getName())); // used String.valueOf because it can be null if (template.getSpawnTemplate().getAI() != null) { final Quest script = QuestManager.getInstance().getQuest(template.getSpawnTemplate().getAI()); @@ -137,11 +137,11 @@ public class L2NpcActionShift implements IActionShiftHandler } else if (npc.getSpawn().hasRespawnRandom()) { - html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"); + html.replace("%resp%", (npc.getSpawn().getRespawnMinDelay() / 1000) + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"); } else { - html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + " sec"); + html.replace("%resp%", (npc.getSpawn().getRespawnMinDelay() / 1000) + " sec"); } } else diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java index 3e1ac09aea..e008602fc2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java @@ -116,7 +116,7 @@ public class L2NpcActionShift implements IActionShiftHandler final String fileName = template.getSpawnTemplate().getFile().getAbsolutePath().substring(Config.DATAPACK_ROOT.getAbsolutePath().length() + 1).replace('\\', '/'); html.replace("%spawnfile%", fileName); html.replace("%spawnname%", template.getSpawnTemplate().getName()); - html.replace("%spawngroup%", template.getGroup().getName()); + html.replace("%spawngroup%", String.valueOf(template.getGroup().getName())); // used String.valueOf because it can be null if (template.getSpawnTemplate().getAI() != null) { final Quest script = QuestManager.getInstance().getQuest(template.getSpawnTemplate().getAI()); @@ -137,11 +137,11 @@ public class L2NpcActionShift implements IActionShiftHandler } else if (npc.getSpawn().hasRespawnRandom()) { - html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"); + html.replace("%resp%", (npc.getSpawn().getRespawnMinDelay() / 1000) + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"); } else { - html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + " sec"); + html.replace("%resp%", (npc.getSpawn().getRespawnMinDelay() / 1000) + " sec"); } } else