Browse Source

Name simplification for collection

combat-2
MagicBot 8 months ago
parent
commit
ac2403362e
  1. 2
      src/engine/Enum.java
  2. 2
      src/engine/db/handlers/dbItemHandler.java
  3. 2
      src/engine/devcmd/cmds/InfoCmd.java
  4. 4
      src/engine/devcmd/cmds/MakeItemCmd.java
  5. 2
      src/engine/devcmd/cmds/PrintBankCmd.java
  6. 2
      src/engine/devcmd/cmds/PrintBonusesCmd.java
  7. 2
      src/engine/devcmd/cmds/PrintInventoryCmd.java
  8. 2
      src/engine/devcmd/cmds/PrintVaultCmd.java
  9. 2
      src/engine/devcmd/cmds/SimulateBootyCmd.java
  10. 2
      src/engine/gameManager/BuildingManager.java
  11. 2
      src/engine/gameManager/ChatManager.java
  12. 6
      src/engine/gameManager/CombatManager.java
  13. 12
      src/engine/gameManager/LootManager.java
  14. 4
      src/engine/net/client/msg/ManageNPCMsg.java
  15. 6
      src/engine/objects/Item.java
  16. 6
      src/engine/objects/ItemBase.java
  17. 8
      src/engine/objects/ItemFactory.java
  18. 2
      src/engine/objects/ItemTemplate.java
  19. 10
      src/engine/objects/MobEquipment.java
  20. 2
      src/engine/objects/MobLoot.java
  21. 6
      src/engine/objects/NPC.java
  22. 6
      src/engine/objects/Warehouse.java

2
src/engine/Enum.java

@ -2694,7 +2694,7 @@ public class Enum {
ResourceType(int templateID, int hash, int deposit_limit, int mine_production) { ResourceType(int templateID, int hash, int deposit_limit, int mine_production) {
this.templateID = templateID; this.templateID = templateID;
this.template = ItemTemplate.itemTemplates.get(this.templateID); this.template = ItemTemplate.templates.get(this.templateID);
this.hash = hash; this.hash = hash;
this.deposit_limit = deposit_limit; this.deposit_limit = deposit_limit;
this.mine_production = mine_production; this.mine_production = mine_production;

2
src/engine/db/handlers/dbItemHandler.java

@ -180,7 +180,7 @@ public class dbItemHandler extends dbHandlerBase {
JSONObject jsonObject = (JSONObject) jsonParser.parse(rs.getString("template")); JSONObject jsonObject = (JSONObject) jsonParser.parse(rs.getString("template"));
ItemTemplate itemTemplate = new ItemTemplate(jsonObject); ItemTemplate itemTemplate = new ItemTemplate(jsonObject);
itemTemplate.template_id = templateID; itemTemplate.template_id = templateID;
ItemTemplate.itemTemplates.put(templateID, itemTemplate); ItemTemplate.templates.put(templateID, itemTemplate);
} }
} catch (Exception e) { } catch (Exception e) {

2
src/engine/devcmd/cmds/InfoCmd.java

@ -505,7 +505,7 @@ public class InfoCmd extends AbstractDevCmd {
case Item: //intentional passthrough case Item: //intentional passthrough
case MobLoot: case MobLoot:
Item item = (Item) target; Item item = (Item) target;
ItemTemplate template = ItemTemplate.itemTemplates.get(item.getTemplateID()); ItemTemplate template = ItemTemplate.templates.get(item.getTemplateID());
output += StringUtils.addWS("ItemBase: " + template.template_id, 20); output += StringUtils.addWS("ItemBase: " + template.template_id, 20);
output += "Weight: " + template.item_wt; output += "Weight: " + template.item_wt;
output += newline; output += newline;

4
src/engine/devcmd/cmds/MakeItemCmd.java

@ -62,7 +62,7 @@ public class MakeItemCmd extends AbstractDevCmd {
ItemTemplate template; ItemTemplate template;
try { try {
templateID = Integer.parseInt(words[0]); templateID = Integer.parseInt(words[0]);
template = ItemTemplate.itemTemplates.get(words[0].toLowerCase()); template = ItemTemplate.templates.get(words[0].toLowerCase());
if (template == null) { if (template == null) {
throwbackError(pc, "Supplied type " + words[0] throwbackError(pc, "Supplied type " + words[0]
@ -132,7 +132,7 @@ public class MakeItemCmd extends AbstractDevCmd {
return; return;
} }
} }
template = ItemTemplate.itemTemplates.get(templateID); template = ItemTemplate.templates.get(templateID);
if (template == null) { if (template == null) {
throwbackError(pc, "Unable to find template " + templateID); throwbackError(pc, "Unable to find template " + templateID);

2
src/engine/devcmd/cmds/PrintBankCmd.java

@ -52,7 +52,7 @@ public class PrintBankCmd extends AbstractDevCmd {
throwbackInfo(pc, "Bank for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')'); throwbackInfo(pc, "Bank for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
for (Item item : list) { for (Item item : list) {
ItemTemplate template = ItemTemplate.itemTemplates.get(item.getTemplateID()); ItemTemplate template = ItemTemplate.templates.get(item.getTemplateID());
throwbackInfo(pc, " " + template.item_base_name + ", count: " + item.getNumOfItems()); throwbackInfo(pc, " " + template.item_base_name + ", count: " + item.getNumOfItems());
} }

2
src/engine/devcmd/cmds/PrintBonusesCmd.java

@ -33,7 +33,7 @@ public class PrintBonusesCmd extends AbstractDevCmd {
if (target instanceof Item) { if (target instanceof Item) {
type = "Item"; type = "Item";
tar = (Item) target; tar = (Item) target;
ItemTemplate template = ItemTemplate.itemTemplates.get(((Item) tar).getTemplateID()); ItemTemplate template = ItemTemplate.templates.get(((Item) tar).getTemplateID());
name = template.item_base_name; name = template.item_base_name;
} else if (target instanceof AbstractCharacter) { } else if (target instanceof AbstractCharacter) {
tar = (AbstractCharacter) target; tar = (AbstractCharacter) target;

2
src/engine/devcmd/cmds/PrintInventoryCmd.java

@ -75,7 +75,7 @@ public class PrintInventoryCmd extends AbstractDevCmd {
int goldCount = 0; int goldCount = 0;
for (Item item : inventory) { for (Item item : inventory) {
ItemTemplate template = ItemTemplate.itemTemplates.get(item.templateID); ItemTemplate template = ItemTemplate.templates.get(item.templateID);
if (item.template.item_type.equals(ItemType.GOLD) == false) { if (item.template.item_type.equals(ItemType.GOLD) == false) {

2
src/engine/devcmd/cmds/PrintVaultCmd.java

@ -50,7 +50,7 @@ public class PrintVaultCmd extends AbstractDevCmd {
ArrayList<Item> list = cim.getVault(); ArrayList<Item> list = cim.getVault();
throwbackInfo(pc, "Vault for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')'); throwbackInfo(pc, "Vault for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
for (Item item : list) { for (Item item : list) {
ItemTemplate template = ItemTemplate.itemTemplates.get(item.getTemplateID()); ItemTemplate template = ItemTemplate.templates.get(item.getTemplateID());
throwbackInfo(pc, " " + template.item_base_name + ", count: " + item.getNumOfItems()); throwbackInfo(pc, " " + template.item_base_name + ", count: " + item.getNumOfItems());
} }
Item gold = cim.getGoldVault(); Item gold = cim.getGoldVault();

2
src/engine/devcmd/cmds/SimulateBootyCmd.java

@ -34,7 +34,7 @@ public class SimulateBootyCmd extends AbstractDevCmd {
if (mob.bootySet != 0) { if (mob.bootySet != 0) {
for (BootySetEntry entry : LootManager._bootySetMap.get(mob.bootySet)) { for (BootySetEntry entry : LootManager._bootySetMap.get(mob.bootySet)) {
ItemTemplate template = ItemTemplate.itemTemplates.get(entry.templateID); ItemTemplate template = ItemTemplate.templates.get(entry.templateID);
if (template != null) if (template != null)
output += "[" + entry.bootyType + "] " + template.item_base_name + " [Chance] " + entry.dropChance + newline; output += "[" + entry.bootyType + "] " + template.item_base_name + " [Chance] " + entry.dropChance + newline;

2
src/engine/gameManager/BuildingManager.java

@ -207,7 +207,7 @@ public enum BuildingManager {
return false; return false;
} }
ItemTemplate template = ItemTemplate.itemTemplates.get(1705032); // Elan Stone ItemTemplate template = ItemTemplate.templates.get(1705032); // Elan Stone
if (!player.getCharItemManager().hasRoomInventory(template.item_wt)) if (!player.getCharItemManager().hasRoomInventory(template.item_wt))
return false; return false;

2
src/engine/gameManager/ChatManager.java

@ -612,7 +612,7 @@ public enum ChatManager {
name = amount + " gold "; name = amount + " gold ";
else { else {
String vowels = "aeiou"; String vowels = "aeiou";
ItemTemplate template = ItemTemplate.itemTemplates.get(item.getTemplateID()); ItemTemplate template = ItemTemplate.templates.get(item.getTemplateID());
String iName = template.item_base_name; String iName = template.item_base_name;
if (iName.length() > 0) if (iName.length() > 0)
if (vowels.indexOf(iName.substring(0, 1).toLowerCase()) >= 0) if (vowels.indexOf(iName.substring(0, 1).toLowerCase()) >= 0)

6
src/engine/gameManager/CombatManager.java

@ -595,7 +595,7 @@ public enum CombatManager {
// Apply Weapon power effect if any. don't try to apply twice if // Apply Weapon power effect if any. don't try to apply twice if
// dual wielding. Perform after passive test for sync purposes. // dual wielding. Perform after passive test for sync purposes.
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID()); ItemTemplate template = ItemTemplate.templates.get(wb.getUUID());
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || ItemTemplate.isTwoHanded(template))) { if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || ItemTemplate.isTwoHanded(template))) {
@ -813,7 +813,7 @@ public enum CombatManager {
// Apply Weapon power effect if any. // Apply Weapon power effect if any.
// don't try to apply twice if dual wielding. // don't try to apply twice if dual wielding.
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID()); ItemTemplate template = ItemTemplate.templates.get(wb.getUUID());
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || ItemTemplate.isTwoHanded(template))) { if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || ItemTemplate.isTwoHanded(template))) {
dpj = ((PlayerCharacter) attacker).getWeaponPower(); dpj = ((PlayerCharacter) attacker).getWeaponPower();
@ -982,7 +982,7 @@ public enum CombatManager {
if (wb == null) if (wb == null)
return 75; return 75;
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID()); ItemTemplate template = ItemTemplate.templates.get(wb.getUUID());
if (mainHand) { if (mainHand) {
if (template.weapon_attack_anim_right.size() > 0) { if (template.weapon_attack_anim_right.size() > 0) {

12
src/engine/gameManager/LootManager.java

@ -87,7 +87,7 @@ public enum LootManager {
if (ib == null) if (ib == null)
break; break;
ItemTemplate template = ItemTemplate.itemTemplates.get(it.getTemplateID()); ItemTemplate template = ItemTemplate.templates.get(it.getTemplateID());
if (ib.isDiscRune() || template.item_base_name.toLowerCase().contains("of the gods")) { if (ib.isDiscRune() || template.item_base_name.toLowerCase().contains("of the gods")) {
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + template.item_base_name + ". Are you tough enough to take it?"); ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + template.item_base_name + ". Are you tough enough to take it?");
@ -175,12 +175,12 @@ public enum LootManager {
if (itemUUID == 0) if (itemUUID == 0)
return null; return null;
if (ItemTemplate.itemTemplates.get(itemUUID).item_type.equals(Enum.ItemType.RESOURCE)) { if (ItemTemplate.templates.get(itemUUID).item_type.equals(Enum.ItemType.RESOURCE)) {
int amount = ThreadLocalRandom.current().nextInt(tableRow.minSpawn, tableRow.maxSpawn + 1); int amount = ThreadLocalRandom.current().nextInt(tableRow.minSpawn, tableRow.maxSpawn + 1);
return new MobLoot(mob, ItemTemplate.itemTemplates.get(itemUUID), amount, false); return new MobLoot(mob, ItemTemplate.templates.get(itemUUID), amount, false);
} }
outItem = new MobLoot(mob, ItemTemplate.itemTemplates.get(itemUUID), false); outItem = new MobLoot(mob, ItemTemplate.templates.get(itemUUID), false);
if(selectedRow.pModTable != 0){ if(selectedRow.pModTable != 0){
try { try {
@ -369,7 +369,7 @@ public enum LootManager {
if (chanceRoll > bse.dropChance) if (chanceRoll > bse.dropChance)
return; return;
MobLoot lootItem = new MobLoot(mob, ItemTemplate.itemTemplates.get(bse.templateID), true); MobLoot lootItem = new MobLoot(mob, ItemTemplate.templates.get(bse.templateID), true);
if (lootItem != null) if (lootItem != null)
mob.getCharItemManager().addItemToInventory(lootItem); mob.getCharItemManager().addItemToInventory(lootItem);
@ -417,7 +417,7 @@ public enum LootManager {
//create the item from the table, quantity is always 1 //create the item from the table, quantity is always 1
MobLoot winnings = new MobLoot(playerCharacter, ItemTemplate.itemTemplates.get(selectedItem.cacheID), 1, false); MobLoot winnings = new MobLoot(playerCharacter, ItemTemplate.templates.get(selectedItem.cacheID), 1, false);
if (winnings == null) if (winnings == null)
return; return;

4
src/engine/net/client/msg/ManageNPCMsg.java

@ -423,7 +423,7 @@ public class ManageNPCMsg extends ClientNetMsg {
for (int templateID : rollableSet) { for (int templateID : rollableSet) {
ItemBase item = ItemBase.getItemBase(templateID); ItemBase item = ItemBase.getItemBase(templateID);
ItemTemplate template = ItemTemplate.itemTemplates.get(templateID); ItemTemplate template = ItemTemplate.templates.get(templateID);
writer.put((byte) 1); writer.put((byte) 1);
writer.putInt(0); writer.putInt(0);
writer.putInt(templateID); //itemID writer.putInt(templateID); //itemID
@ -444,7 +444,7 @@ public class ManageNPCMsg extends ClientNetMsg {
for (Item i : itemList) { for (Item i : itemList) {
ItemBase ib = i.getItemBase(); ItemBase ib = i.getItemBase();
ItemTemplate template = ItemTemplate.itemTemplates.get(ib); ItemTemplate template = ItemTemplate.templates.get(ib);
writer.put((byte) 0); // ? Unknown45 writer.put((byte) 0); // ? Unknown45
writer.putInt(i.getObjectType().ordinal()); writer.putInt(i.getObjectType().ordinal());
writer.putInt(i.getObjectUUID()); writer.putInt(i.getObjectUUID());

6
src/engine/objects/Item.java

@ -68,7 +68,7 @@ public class Item extends AbstractWorldObject {
public Item(int templateID) { public Item(int templateID) {
super(); super();
this.templateID = templateID; this.templateID = templateID;
this.template = ItemTemplate.itemTemplates.get(templateID); this.template = ItemTemplate.templates.get(templateID);
this.chargesRemaining = this.template.item_initial_charges; this.chargesRemaining = this.template.item_initial_charges;
this.durabilityCurrent = this.template.combat_health_full; this.durabilityCurrent = this.template.combat_health_full;
this.equipSlot = EquipSlotType.NONE; this.equipSlot = EquipSlotType.NONE;
@ -85,7 +85,7 @@ public class Item extends AbstractWorldObject {
super(rs); super(rs);
this.templateID = rs.getInt("item_itemBaseID"); this.templateID = rs.getInt("item_itemBaseID");
this.template = ItemTemplate.itemTemplates.get(this.templateID); this.template = ItemTemplate.templates.get(this.templateID);
if (this.template == null) if (this.template == null)
Logger.error("Null template of " + this.templateID) Logger.error("Null template of " + this.templateID)
@ -1012,7 +1012,7 @@ public class Item extends AbstractWorldObject {
if (this.customName.isEmpty() == false) if (this.customName.isEmpty() == false)
return this.customName; return this.customName;
ItemTemplate template = ItemTemplate.itemTemplates.get(this.getTemplateID()); ItemTemplate template = ItemTemplate.templates.get(this.getTemplateID());
return template.item_base_name; return template.item_base_name;
} }

6
src/engine/objects/ItemBase.java

@ -57,7 +57,7 @@ public class ItemBase {
this.mastery = rs.getString("mastery"); this.mastery = rs.getString("mastery");
damageType = Enum.SourceType.valueOf(rs.getString("damageType").toUpperCase()); damageType = Enum.SourceType.valueOf(rs.getString("damageType").toUpperCase());
ItemTemplate template = ItemTemplate.itemTemplates.get(this.getUUID()); ItemTemplate template = ItemTemplate.templates.get(this.getUUID());
if (template == null) if (template == null)
Logger.error(this.getUUID() + " null template"); Logger.error(this.getUUID() + " null template");
@ -68,10 +68,10 @@ public class ItemBase {
_itemBaseByUUID.put(itemBase.uuid, itemBase); _itemBaseByUUID.put(itemBase.uuid, itemBase);
if (ItemTemplate.itemTemplates.get(itemBase.uuid).item_type.equals(ItemType.RESOURCE)) if (ItemTemplate.templates.get(itemBase.uuid).item_type.equals(ItemType.RESOURCE))
_resourceList.add(itemBase); _resourceList.add(itemBase);
ItemTemplate template = ItemTemplate.itemTemplates.get(itemBase.uuid); ItemTemplate template = ItemTemplate.templates.get(itemBase.uuid);
if (template == null) if (template == null)
Logger.error("Null template for: " + itemBase.uuid); Logger.error("Null template for: " + itemBase.uuid);

8
src/engine/objects/ItemFactory.java

@ -38,7 +38,7 @@ public class ItemFactory {
int max = 20; int max = 20;
CharacterItemManager itemManager = pc.getCharItemManager(); CharacterItemManager itemManager = pc.getCharItemManager();
ItemTemplate template = ItemTemplate.itemTemplates.get(templateID); ItemTemplate template = ItemTemplate.templates.get(templateID);
if (count > max) if (count > max)
count = max; count = max;
@ -86,7 +86,7 @@ public class ItemFactory {
boolean useWarehouse = false; boolean useWarehouse = false;
ItemTemplate template = ItemTemplate.itemTemplates.get(templateID); ItemTemplate template = ItemTemplate.templates.get(templateID);
if (template == null) if (template == null)
return null; return null;
@ -641,7 +641,7 @@ public class ItemFactory {
ModTableEntry suffixEntry = null; ModTableEntry suffixEntry = null;
ItemBase ib = ItemBase.getItemBase(itemBaseID); ItemBase ib = ItemBase.getItemBase(itemBaseID);
ItemTemplate template = ItemTemplate.itemTemplates.get(itemBaseID); ItemTemplate template = ItemTemplate.templates.get(itemBaseID);
if (template == null) if (template == null)
return null; return null;
@ -766,7 +766,7 @@ public class ItemFactory {
if (npc == null) if (npc == null)
return null; return null;
ItemTemplate template = ItemTemplate.itemTemplates.get(templateID); ItemTemplate template = ItemTemplate.templates.get(templateID);
Building forge = npc.getBuilding(); Building forge = npc.getBuilding();

2
src/engine/objects/ItemTemplate.java

@ -22,7 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class ItemTemplate { public class ItemTemplate {
// Global template lookup // Global template lookup
public static HashMap<Integer, ItemTemplate> itemTemplates = new HashMap<>(); public static HashMap<Integer, ItemTemplate> templates = new HashMap<>();
public int template_id; public int template_id;

10
src/engine/objects/MobEquipment.java

@ -45,7 +45,7 @@ public class MobEquipment extends AbstractGameObject {
super(MobEquipment.getNewID()); super(MobEquipment.getNewID());
this.itemBase = itemBase; this.itemBase = itemBase;
this.templateID = this.itemBase.getUUID(); this.templateID = this.itemBase.getUUID();
this.template = ItemTemplate.itemTemplates.get(templateID); this.template = ItemTemplate.templates.get(templateID);
this.slot = slot; this.slot = slot;
this.parentID = parentID; this.parentID = parentID;
this.enchanted = false; this.enchanted = false;
@ -59,7 +59,7 @@ public class MobEquipment extends AbstractGameObject {
public MobEquipment(int itemBaseID, float dropChance) { public MobEquipment(int itemBaseID, float dropChance) {
super(MobEquipment.getNewID()); super(MobEquipment.getNewID());
this.itemBase = ItemBase.getItemBase(itemBaseID); this.itemBase = ItemBase.getItemBase(itemBaseID);
this.template = ItemTemplate.itemTemplates.get(itemBaseID); this.template = ItemTemplate.templates.get(itemBaseID);
Enum.EquipSlotType equipSlot = template.item_eq_slots_and.iterator().next(); Enum.EquipSlotType equipSlot = template.item_eq_slots_and.iterator().next();
@ -184,17 +184,17 @@ public class MobEquipment extends AbstractGameObject {
if (mobEquipment.itemBase == null) if (mobEquipment.itemBase == null)
name = eb.getName(); name = eb.getName();
else else
name = eb.getName() + ' ' + ItemTemplate.itemTemplates.get(mobEquipment.itemBase.getUUID()).item_base_name; name = eb.getName() + ' ' + ItemTemplate.templates.get(mobEquipment.itemBase.getUUID()).item_base_name;
} else if (eb.isSuffix()) { } else if (eb.isSuffix()) {
if (mobEquipment.itemBase == null) if (mobEquipment.itemBase == null)
name = eb.getName(); name = eb.getName();
else else
name = ItemTemplate.itemTemplates.get(mobEquipment.itemBase.getUUID()).item_base_name + ' ' + eb.getName(); name = ItemTemplate.templates.get(mobEquipment.itemBase.getUUID()).item_base_name + ' ' + eb.getName();
} else { } else {
if (mobEquipment.itemBase == null) if (mobEquipment.itemBase == null)
name = ""; name = "";
else else
name = ItemTemplate.itemTemplates.get(mobEquipment.itemBase.getUUID()).item_base_name; name = ItemTemplate.templates.get(mobEquipment.itemBase.getUUID()).item_base_name;
} }
writer.putInt(eb.getToken()); writer.putInt(eb.getToken());

2
src/engine/objects/MobLoot.java

@ -38,7 +38,7 @@ public final class MobLoot extends Item {
} }
public MobLoot(AbstractCharacter mob, int qtyOfGold) { public MobLoot(AbstractCharacter mob, int qtyOfGold) {
this(mob, ItemTemplate.itemTemplates.get(Enum.ResourceType.GOLD.templateID), qtyOfGold, false); this(mob, ItemTemplate.templates.get(Enum.ResourceType.GOLD.templateID), qtyOfGold, false);
} }
public MobLoot(AbstractCharacter mob, ItemTemplate template, int quantity, boolean noSteal) { public MobLoot(AbstractCharacter mob, ItemTemplate template, int quantity, boolean noSteal) {

6
src/engine/objects/NPC.java

@ -920,7 +920,7 @@ public class NPC extends AbstractCharacter {
DbManager.NPCQueries.LOAD_ALL_ITEMS_TO_PRODUCE(this); DbManager.NPCQueries.LOAD_ALL_ITEMS_TO_PRODUCE(this);
for (ProducedItem producedItem : this.forgedItems) { for (ProducedItem producedItem : this.forgedItems) {
MobLoot ml = new MobLoot(this, ItemTemplate.itemTemplates.get(producedItem.getItemBaseID()), false); MobLoot ml = new MobLoot(this, ItemTemplate.templates.get(producedItem.getItemBaseID()), false);
DbManager.NPCQueries.UPDATE_ITEM_ID(producedItem.getID(), currentID, ml.getObjectUUID()); DbManager.NPCQueries.UPDATE_ITEM_ID(producedItem.getID(), currentID, ml.getObjectUUID());
@ -1070,7 +1070,7 @@ public class NPC extends AbstractCharacter {
ItemBase itemBase; ItemBase itemBase;
for (Integer itemID : fullItemList) { for (Integer itemID : fullItemList) {
itemBase = ItemBase.getItemBase(itemID); itemBase = ItemBase.getItemBase(itemID);
boolean exclude = itemBase.getPercentRequired() == 0 && ItemTemplate.itemTemplates.get(itemID).item_type == ItemType.WEAPON; boolean exclude = itemBase.getPercentRequired() == 0 && ItemTemplate.templates.get(itemID).item_type == ItemType.WEAPON;
if (itemBase.getPercentRequired() <= maxSkill && !exclude) if (itemBase.getPercentRequired() <= maxSkill && !exclude)
filteredItemList.add(itemID); filteredItemList.add(itemID);
} }
@ -1095,7 +1095,7 @@ public class NPC extends AbstractCharacter {
if (ib == null) if (ib == null)
return 0; return 0;
if (ItemTemplate.itemTemplates.get(itemID).item_type == ItemType.SCROLL) if (ItemTemplate.templates.get(itemID).item_type == ItemType.SCROLL)
return this.getRank() * 60 * 60 * 3; return this.getRank() * 60 * 60 * 3;
float time; float time;

6
src/engine/objects/Warehouse.java

@ -294,7 +294,7 @@ public class Warehouse extends AbstractWorldObject {
if (resource.template.item_type.equals(Enum.ItemType.GOLD)) if (resource.template.item_type.equals(Enum.ItemType.GOLD))
resourceType = Enum.ResourceType.GOLD; resourceType = Enum.ResourceType.GOLD;
else else
resourceType = Enum.ResourceType.valueOf(ItemTemplate.itemTemplates.get(resource.getTemplateID()).item_base_name.toUpperCase()); resourceType = Enum.ResourceType.valueOf(ItemTemplate.templates.get(resource.getTemplateID()).item_base_name.toUpperCase());
if (transaction) if (transaction)
AddTransactionToWarehouse(warehouse, pc.getObjectType(), pc.getObjectUUID(), Enum.TransactionType.DEPOSIT, resourceType, amount); AddTransactionToWarehouse(warehouse, pc.getObjectType(), pc.getObjectUUID(), Enum.TransactionType.DEPOSIT, resourceType, amount);
@ -596,7 +596,7 @@ public class Warehouse extends AbstractWorldObject {
if (pc == null) if (pc == null)
return false; return false;
ItemTemplate template = ItemTemplate.itemTemplates.get(resourceType.templateID); ItemTemplate template = ItemTemplate.templates.get(resourceType.templateID);
if (warehouse.resources.get(resourceType) == null) if (warehouse.resources.get(resourceType) == null)
return false; return false;
@ -678,7 +678,7 @@ public class Warehouse extends AbstractWorldObject {
if (pc == null) if (pc == null)
return false; return false;
ItemTemplate template = ItemTemplate.itemTemplates.get(resourceType); ItemTemplate template = ItemTemplate.templates.get(resourceType);
if (template == null) if (template == null)
return false; return false;

Loading…
Cancel
Save