Read template health, charges and flags through the bridge

Consumers of the legacy ItemTemplate combat_health_full,
item_initial_charges and item_flags now read getCombatHealthFull(),
getItemInitialCharges() and getItemFlags() on template.cacheTemplate.
No consumer read the template's combat_health_current; the
combat_health_current reads are the Item's own field.

Parity (offline, scripts/p14.py, 7586 templates): 0 differences in
combat_health_current, combat_health_full, item_initial_charges and
item_flags ("None" dropped on both sides). No value changes expected.

JSON-Refactor-Plan Task 1.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-19 12:45:17 -04:00
1 parent dc4a9ee08a
commit d197f62c1f
6 files changed
+14 -14

No files matched your search

+2 -2
View File
@@ -1105,7 +1105,7 @@ public class CharacterItemManager {
// Reset value
purchasedItem.value = (int) (purchasedItem.template.cacheTemplate.getItemValue() * (purchasedItem.combat_health_current / purchasedItem.template.combat_health_full));
purchasedItem.value = (int) (purchasedItem.template.cacheTemplate.getItemValue() * (purchasedItem.combat_health_current / purchasedItem.template.cacheTemplate.getCombatHealthFull()));
purchasedItem.magicValue = purchasedItem.template.cacheTemplate.getItemValue() + purchasedItem.calcMagicValue();
// db transfer successfully, remove from this character
@@ -1932,7 +1932,7 @@ public class CharacterItemManager {
return;
//don't damage noob gear, hair or beards.
if (item.template.combat_health_full == 0)
if (item.template.cacheTemplate.getCombatHealthFull() == 0)
return;
if (!item.isCanDestroy())