Value is set as items as used or damaged. Not calculated on the fly.
This commit is contained in:
@@ -2358,7 +2358,9 @@ public class CharacterItemManager {
|
||||
if (!DbManager.ItemQueries.SET_DURABILITY(item, dur))
|
||||
return;
|
||||
item.setCombat_health_current((short) dur);
|
||||
|
||||
item.value = (int) (item.template.item_value * (item.combat_health_current / item.template.combat_health_full));
|
||||
if (!DbManager.ItemQueries.UPDATE_VALUE(item, item.value))
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.absCharacter.getObjectType().equals(GameObjectType.PlayerCharacter) == false)
|
||||
|
||||
@@ -52,7 +52,7 @@ public class Item extends AbstractWorldObject {
|
||||
public Enum.EquipSlotType equipSlot;
|
||||
private boolean canDestroy;
|
||||
private boolean isRandom = false;
|
||||
private int value;
|
||||
public int value;
|
||||
public OwnerType ownerType;
|
||||
public int templateID;
|
||||
private long dateToUpgrade;
|
||||
@@ -781,6 +781,8 @@ public class Item extends AbstractWorldObject {
|
||||
if (this.chargesRemaining < 0)
|
||||
this.chargesRemaining = 0;
|
||||
DbManager.ItemQueries.UPDATE_REMAINING_CHARGES(this);
|
||||
this.value = this.value * (this.chargesRemaining / this.template.item_initial_charges);
|
||||
DbManager.ItemQueries.UPDATE_VALUE(this, this.value);
|
||||
}
|
||||
|
||||
public void zeroItem() {
|
||||
|
||||
Reference in New Issue
Block a user