|
|
@ -47,7 +47,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
public float drop_chance; |
|
|
|
public float drop_chance; |
|
|
|
public EnumSet<Enum.ItemFlags> flags = EnumSet.noneOf(ItemFlags.class); |
|
|
|
public EnumSet<Enum.ItemFlags> flags = EnumSet.noneOf(ItemFlags.class); |
|
|
|
public int numberOfItems; |
|
|
|
public int numberOfItems; |
|
|
|
public float durabilityCurrent; |
|
|
|
public float combat_health_current; |
|
|
|
public int chargesRemaining; |
|
|
|
public int chargesRemaining; |
|
|
|
public Enum.EquipSlotType equipSlot; |
|
|
|
public Enum.EquipSlotType equipSlot; |
|
|
|
private boolean canDestroy; |
|
|
|
private boolean canDestroy; |
|
|
@ -70,7 +70,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
this.templateID = templateID; |
|
|
|
this.templateID = templateID; |
|
|
|
this.template = ItemTemplate.templates.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.combat_health_current = this.template.combat_health_full; |
|
|
|
this.equipSlot = EquipSlotType.NONE; |
|
|
|
this.equipSlot = EquipSlotType.NONE; |
|
|
|
this.containerType = ItemContainerType.NONE; |
|
|
|
this.containerType = ItemContainerType.NONE; |
|
|
|
this.numberOfItems = 1; |
|
|
|
this.numberOfItems = 1; |
|
|
@ -128,7 +128,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
this.chargesRemaining = rs.getByte("item_chargesRemaining"); |
|
|
|
this.chargesRemaining = rs.getByte("item_chargesRemaining"); |
|
|
|
|
|
|
|
|
|
|
|
this.durabilityCurrent = rs.getShort("item_durabilityCurrent"); |
|
|
|
this.combat_health_current = rs.getShort("item_durabilityCurrent"); |
|
|
|
|
|
|
|
|
|
|
|
DbObjectType ownerType; |
|
|
|
DbObjectType ownerType; |
|
|
|
ownerType = DbManager.BuildingQueries.GET_UID_ENUM(this.ownerID); |
|
|
|
ownerType = DbManager.BuildingQueries.GET_UID_ENUM(this.ownerID); |
|
|
@ -232,7 +232,7 @@ public class Item extends AbstractWorldObject { |
|
|
|
writer.put((byte) 1); // End Datablock byte
|
|
|
|
writer.put((byte) 1); // End Datablock byte
|
|
|
|
|
|
|
|
|
|
|
|
writer.putFloat(item.template.item_health_full); |
|
|
|
writer.putFloat(item.template.item_health_full); |
|
|
|
writer.putFloat((float) item.durabilityCurrent); |
|
|
|
writer.putFloat((float) item.combat_health_current); |
|
|
|
|
|
|
|
|
|
|
|
writer.put((byte) 1); // End Datablock byte
|
|
|
|
writer.put((byte) 1); // End Datablock byte
|
|
|
|
|
|
|
|
|
|
|
@ -700,8 +700,8 @@ public class Item extends AbstractWorldObject { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setDurabilityCurrent(float value) { |
|
|
|
public void setCombat_health_current(float value) { |
|
|
|
this.durabilityCurrent = value; |
|
|
|
this.combat_health_current = value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isCanDestroy() { |
|
|
|
public boolean isCanDestroy() { |
|
|
|