From d33de60869fdcfa9363bd15c3057d62c488c5da6 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 28 Mar 2024 19:01:16 -0500 Subject: [PATCH] create saetor shrine object --- src/engine/db/handlers/dbItemBaseHandler.java | 9 ++++++++- src/engine/objects/ItemBase.java | 13 +++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/engine/db/handlers/dbItemBaseHandler.java b/src/engine/db/handlers/dbItemBaseHandler.java index bf12b434..d474a2c0 100644 --- a/src/engine/db/handlers/dbItemBaseHandler.java +++ b/src/engine/db/handlers/dbItemBaseHandler.java @@ -87,12 +87,19 @@ public class dbItemBaseHandler extends dbHandlerBase { recordsRead++; itemBase = new ItemBase(rs); ItemBase.addToCache(itemBase); + + //copy the vampire shrine for saetor and change uuid and name + if(itemBase.getName().contains("Vampire Shrine")){ + ItemBase saetorShrine = new ItemBase(rs); + saetorShrine.setUUID(1035); + saetorShrine.setName(saetorShrine.getName().replace("Vampire","Saetor")); + ItemBase.addToCache(saetorShrine); + } } } catch (SQLException e) { Logger.error(e); } - Logger.info("read: " + recordsRead + " cached: " + ItemBase.getUUIDCache().size()); } diff --git a/src/engine/objects/ItemBase.java b/src/engine/objects/ItemBase.java index aea53915..e5832b3e 100644 --- a/src/engine/objects/ItemBase.java +++ b/src/engine/objects/ItemBase.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.concurrent.ConcurrentHashMap; -public class ItemBase { +public class ItemBase{ public static final byte GOLD_BASE_TYPE = 4; public static ItemBase GOLD_ITEM_BASE = null; @@ -36,8 +36,8 @@ public class ItemBase { private static HashMap itemHashIDMap = new HashMap<>(); private static HashMap _IDsByNames = new HashMap<>(); private static ArrayList _resourceList = new ArrayList<>(); - private final int uuid; - private final String name; + private int uuid; + private String name; private float durability; private int value; private short weight; @@ -723,7 +723,12 @@ public class ItemBase { public final int getUUID() { return uuid; } - + public void setUUID(int id) { + this.uuid = id; + } + public void setName(String name) { + this.name = name; + } public boolean isRing() { return ((this.equipFlag & (64 | 128 | 192)) != 0); }