item_value refactored to template

This commit is contained in:
2024-03-03 13:18:16 -05:00
parent 70f331d025
commit f11fcc535a
5 changed files with 20 additions and 32 deletions
+4 -4
View File
@@ -234,7 +234,7 @@ public class Item extends AbstractWorldObject {
} else
writer.putInt(item.numberOfItems); // Amount of gold
} else
writer.putInt(item.getItemBase().getBaseValue());
writer.putInt(item.template.item_value);
writer.putInt(item.getValue());
@@ -1049,7 +1049,7 @@ public class Item extends AbstractWorldObject {
public final void loadEnchantments() {
//dont load mobloot enchantments, they arent in db.
if (this.getObjectType().equals(GameObjectType.MobLoot)) {
this.magicValue = this.getItemBase().getBaseValue() + calcMagicValue();
this.magicValue = this.template.item_value + calcMagicValue();
return;
}
@@ -1063,7 +1063,7 @@ public class Item extends AbstractWorldObject {
}
}
this.magicValue = this.getItemBase().getBaseValue() + calcMagicValue();
this.magicValue = this.template.item_value + calcMagicValue();
}
public HashMap<Integer, Integer> getBakedInStats() {
@@ -1226,7 +1226,7 @@ public class Item extends AbstractWorldObject {
public int getValue() {
if (this.value == 0)
if (this.template.item_flags.contains(ItemFlags.Identified)) {
if (this.isID()) {
return this.getMagicValue();
} else
return this.template.item_value;