From 817bb6f7403a553c620d2068e0551835286a2690 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 20 Jul 2019 17:16:40 +0000 Subject: [PATCH] Check if NPC equipment exists. --- .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ .../model/actor/templates/NpcTemplate.java | 16 ++++++++++++++++ 12 files changed, 192 insertions(+) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index dde9bb1469..aa31542e1b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index dde9bb1469..aa31542e1b 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index dde9bb1469..aa31542e1b 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index dde9bb1469..aa31542e1b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index dde9bb1469..aa31542e1b 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index dde9bb1469..aa31542e1b 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index dde9bb1469..aa31542e1b 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index 2813a06e63..5d17c76695 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index 2813a06e63..5d17c76695 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index 2813a06e63..5d17c76695 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -52,6 +53,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -143,8 +146,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _sex = set.getEnum("sex", Sex.class, Sex.ETC); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index 3b38557c75..3f2cc53f81 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -53,6 +54,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -149,8 +152,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _elementalType = set.getEnum("elementalType", ElementalType.class, ElementalType.NONE); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index 3b38557c75..3f2cc53f81 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; @@ -53,6 +54,8 @@ import org.l2jmobius.gameserver.util.Util; */ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable { + private static final Logger LOGGER = Logger.getLogger(NpcTemplate.class.getName()); + private int _id; private int _displayId; private byte _level; @@ -149,8 +152,21 @@ public final class NpcTemplate extends CreatureTemplate implements IIdentifiable _elementalType = set.getEnum("elementalType", ElementalType.class, ElementalType.NONE); _chestId = set.getInt("chestId", 0); + if ((_chestId > 0) && (ItemTable.getInstance().getTemplate(_chestId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for chestId with id " + _chestId + "."); + } _rhandId = set.getInt("rhandId", 0); + if ((_rhandId > 0) && (ItemTable.getInstance().getTemplate(_rhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for rhandId with id " + _rhandId + "."); + } _lhandId = set.getInt("lhandId", 0); + if ((_lhandId > 0) && (ItemTable.getInstance().getTemplate(_lhandId) == null)) + { + LOGGER.warning("NpcTemplate " + _id + ": Could not find item for lhandId with id " + _lhandId + "."); + } + _weaponEnchant = set.getInt("weaponEnchant", 0); _exp = set.getDouble("exp", 0);