Browse Source

Begin rune parsing

combat-2
MagicBot 8 months ago
parent
commit
d621877e8c
  1. 18
      src/engine/objects/ItemTemplate.java

18
src/engine/objects/ItemTemplate.java

@ -98,6 +98,11 @@ public class ItemTemplate { @@ -98,6 +98,11 @@ public class ItemTemplate {
public boolean deed_custom_city;
public int deed_structure_id;
// Rune related fields
public HashMap<Enum.AttributeType, Integer> rune_attr_adj = new HashMap<>();
public HashMap<Enum.AttributeType, Integer> rune_max_attr_adj = new HashMap<>();
public ItemTemplate(JSONObject jsonObject) {
try {
@ -401,6 +406,19 @@ public class ItemTemplate { @@ -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);
}

Loading…
Cancel
Save