Variable renamed to conform with json
This commit is contained in:
@@ -65,7 +65,7 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
preparedStatement.setInt(1, toAdd.ownerID);
|
||||
preparedStatement.setInt(2, toAdd.getTemplateID());
|
||||
preparedStatement.setInt(3, (byte) toAdd.chargesRemaining);
|
||||
preparedStatement.setInt(4, (short) toAdd.durabilityCurrent);
|
||||
preparedStatement.setInt(4, (short) toAdd.combat_health_current);
|
||||
preparedStatement.setInt(5, (int) toAdd.template.item_health_full);
|
||||
|
||||
if (toAdd.getNumOfItems() < 1)
|
||||
@@ -401,7 +401,7 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
|
||||
preparedStatement.setInt(1, value);
|
||||
preparedStatement.setLong(2, item.getObjectUUID());
|
||||
preparedStatement.setInt(3, (short) item.durabilityCurrent);
|
||||
preparedStatement.setInt(3, (short) item.combat_health_current);
|
||||
|
||||
return (preparedStatement.executeUpdate() > 0);
|
||||
|
||||
|
||||
@@ -352,7 +352,7 @@ public enum LootManager {
|
||||
|
||||
if (ml != null && dropCount < 1) {
|
||||
ml.flags.add(Enum.ItemFlags.Identified);
|
||||
ml.setDurabilityCurrent((short) ((short) ml.durabilityCurrent - ThreadLocalRandom.current().nextInt(5) + 1));
|
||||
ml.setCombat_health_current((short) ((short) ml.combat_health_current - ThreadLocalRandom.current().nextInt(5) + 1));
|
||||
mob.charItemManager.addItemToInventory(ml);
|
||||
dropCount = 1;
|
||||
//break; // Exit on first successful roll.
|
||||
|
||||
@@ -85,7 +85,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
//make sure item is damaged and not destroyed
|
||||
|
||||
short dur = (short) toRepair.durabilityCurrent;
|
||||
short dur = (short) toRepair.combat_health_current;
|
||||
short max = (short) toRepair.template.item_health_full;
|
||||
|
||||
//account for durability modifications
|
||||
@@ -95,7 +95,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
if (dur >= max || dur < 1) {
|
||||
//redundancy message to clear item from window in client
|
||||
toRepair.setDurabilityCurrent(max);
|
||||
toRepair.setCombat_health_current(max);
|
||||
repairMsg.setupRepairAck(max - dur);
|
||||
dispatch = Dispatch.borrow(player, repairMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
@@ -142,7 +142,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
//repair the item
|
||||
|
||||
toRepair.setDurabilityCurrent(max);
|
||||
toRepair.setCombat_health_current(max);
|
||||
|
||||
//send repair msg
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class VendorSellMsgHandler extends AbstractClientMsgHandler {
|
||||
cost = sell.template.item_value;
|
||||
|
||||
//apply damaged value reduction
|
||||
float damagedModifier = sell.durabilityCurrent / sell.template.item_health_full;
|
||||
float damagedModifier = sell.combat_health_current / sell.template.item_health_full;
|
||||
cost *= damagedModifier;
|
||||
|
||||
float bargain = player.getBargain();
|
||||
|
||||
@@ -2339,7 +2339,7 @@ public class CharacterItemManager {
|
||||
if (!item.isCanDestroy())
|
||||
return;
|
||||
|
||||
int dur = (int) (short) item.durabilityCurrent;
|
||||
int dur = (int) (short) item.combat_health_current;
|
||||
|
||||
if (dur - amount <= 0) {
|
||||
//destroy the item
|
||||
@@ -2352,7 +2352,7 @@ public class CharacterItemManager {
|
||||
dur -= amount;
|
||||
if (!DbManager.ItemQueries.SET_DURABILITY(item, dur))
|
||||
return;
|
||||
item.setDurabilityCurrent((short) dur);
|
||||
item.setCombat_health_current((short) dur);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class Item extends AbstractWorldObject {
|
||||
public float drop_chance;
|
||||
public EnumSet<Enum.ItemFlags> flags = EnumSet.noneOf(ItemFlags.class);
|
||||
public int numberOfItems;
|
||||
public float durabilityCurrent;
|
||||
public float combat_health_current;
|
||||
public int chargesRemaining;
|
||||
public Enum.EquipSlotType equipSlot;
|
||||
private boolean canDestroy;
|
||||
@@ -70,7 +70,7 @@ public class Item extends AbstractWorldObject {
|
||||
this.templateID = templateID;
|
||||
this.template = ItemTemplate.templates.get(templateID);
|
||||
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.containerType = ItemContainerType.NONE;
|
||||
this.numberOfItems = 1;
|
||||
@@ -128,7 +128,7 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
this.chargesRemaining = rs.getByte("item_chargesRemaining");
|
||||
|
||||
this.durabilityCurrent = rs.getShort("item_durabilityCurrent");
|
||||
this.combat_health_current = rs.getShort("item_durabilityCurrent");
|
||||
|
||||
DbObjectType ownerType;
|
||||
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.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
|
||||
|
||||
@@ -700,8 +700,8 @@ public class Item extends AbstractWorldObject {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setDurabilityCurrent(float value) {
|
||||
this.durabilityCurrent = value;
|
||||
public void setCombat_health_current(float value) {
|
||||
this.combat_health_current = value;
|
||||
}
|
||||
|
||||
public boolean isCanDestroy() {
|
||||
|
||||
Reference in New Issue
Block a user