From d621877e8c51f6401032f2468f0046be877dbb3e Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 2 Apr 2024 14:11:01 -0400 Subject: [PATCH] Begin rune parsing --- src/engine/objects/ItemTemplate.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 59349cea..4fcedc2a 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -98,6 +98,11 @@ public class ItemTemplate { public boolean deed_custom_city; public int deed_structure_id; + // Rune related fields + + public HashMap rune_attr_adj = new HashMap<>(); + public HashMap rune_max_attr_adj = new HashMap<>(); + public ItemTemplate(JSONObject jsonObject) { try { @@ -401,6 +406,19 @@ public class ItemTemplate { deed_structure_id = ((Long) jsonObject.get("deed_structure_id")).intValue(); } + if (item_type.equals(Enum.ItemType.RUNE)) { + + JSONObject attr_adj_json = (JSONObject) jsonObject.get("rune_attr_adj"); + + for (Object key : attr_adj_json.keySet()) { + Enum.AttributeType attributeType = Enum.AttributeType.valueOf((String) key); + int value = ((Long) resist_json.get(key)).intValue(); + rune_attr_adj.put(attributeType, value); + } + + } + + } catch (Exception e) { Logger.error(e); }