Check if NPC equipment exists.

This commit is contained in:
MobiusDevelopment
2019-07-20 17:16:40 +00:00
parent fbab81de50
commit 817bb6f740
12 changed files with 192 additions and 0 deletions

View File

@@ -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);