From 6a62f93cbad56c566458a82bef853ea5e92b3505 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 25 Mar 2024 05:29:15 -0400 Subject: [PATCH] combat_health_full used from json --- src/engine/db/handlers/dbItemHandler.java | 2 +- src/engine/net/client/handlers/RepairMsgHandler.java | 2 +- src/engine/net/client/handlers/VendorSellMsgHandler.java | 2 +- src/engine/objects/CharacterItemManager.java | 2 +- src/engine/objects/Item.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/db/handlers/dbItemHandler.java b/src/engine/db/handlers/dbItemHandler.java index 51aac5ab..c041b88d 100644 --- a/src/engine/db/handlers/dbItemHandler.java +++ b/src/engine/db/handlers/dbItemHandler.java @@ -66,7 +66,7 @@ public class dbItemHandler extends dbHandlerBase { preparedStatement.setInt(2, toAdd.getTemplateID()); preparedStatement.setInt(3, (byte) toAdd.chargesRemaining); preparedStatement.setInt(4, (short) toAdd.combat_health_current); - preparedStatement.setInt(5, (int) toAdd.template.item_health_full); + preparedStatement.setInt(5, (int) toAdd.template.combat_health_full); if (toAdd.getNumOfItems() < 1) preparedStatement.setInt(6, 1); diff --git a/src/engine/net/client/handlers/RepairMsgHandler.java b/src/engine/net/client/handlers/RepairMsgHandler.java index 12abbbb6..66bd860f 100644 --- a/src/engine/net/client/handlers/RepairMsgHandler.java +++ b/src/engine/net/client/handlers/RepairMsgHandler.java @@ -86,7 +86,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler { //make sure item is damaged and not destroyed short dur = (short) toRepair.combat_health_current; - short max = (short) toRepair.template.item_health_full; + short max = (short) toRepair.template.combat_health_full; //account for durability modifications diff --git a/src/engine/net/client/handlers/VendorSellMsgHandler.java b/src/engine/net/client/handlers/VendorSellMsgHandler.java index dcd5b496..c26cfb70 100644 --- a/src/engine/net/client/handlers/VendorSellMsgHandler.java +++ b/src/engine/net/client/handlers/VendorSellMsgHandler.java @@ -108,7 +108,7 @@ public class VendorSellMsgHandler extends AbstractClientMsgHandler { cost = sell.template.item_value; //apply damaged value reduction - float damagedModifier = sell.combat_health_current / sell.template.item_health_full; + float damagedModifier = sell.combat_health_current / sell.template.combat_health_full; cost *= damagedModifier; float bargain = player.getBargain(); diff --git a/src/engine/objects/CharacterItemManager.java b/src/engine/objects/CharacterItemManager.java index 20b0b3ff..61d5ac8a 100644 --- a/src/engine/objects/CharacterItemManager.java +++ b/src/engine/objects/CharacterItemManager.java @@ -2333,7 +2333,7 @@ public class CharacterItemManager { return; //don't damage noob gear, hair or beards. - if (item.template.item_health_full == 0) + if (item.template.combat_health_full == 0) return; if (!item.isCanDestroy()) diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index 039204aa..bd4a2c86 100644 --- a/src/engine/objects/Item.java +++ b/src/engine/objects/Item.java @@ -231,7 +231,7 @@ public class Item extends AbstractWorldObject { writer.putString(item.name); // Unknown. pad? writer.put((byte) 1); // End Datablock byte - writer.putFloat(item.template.item_health_full); + writer.putFloat(item.template.combat_health_full); writer.putFloat((float) item.combat_health_current); writer.put((byte) 1); // End Datablock byte