Browse Source

Parse offering info.

combat-2
MagicBot 8 months ago
parent
commit
5476d238fa
  1. 12
      src/engine/objects/ItemTemplate.java

12
src/engine/objects/ItemTemplate.java

@ -177,13 +177,13 @@ public class ItemTemplate { @@ -177,13 +177,13 @@ public class ItemTemplate {
// Reading offering data
JSONObject item_offering_info = (JSONObject) jsonObject.get("item_offering_info");
JSONArray offering_data = (JSONArray) jsonObject.get("item_offering_info");
for (Object key : item_offering_info.keySet()) {
String shrineType = (String) key;
shrineType = shrineType.replaceAll("-", ""); // For half-giant
int value = ((Double) item_offering_info.get(key)).intValue();
item_offering_info.put(shrineType, value);
for (Object entry : offering_data) {
JSONObject offering_entry = (JSONObject) entry;
String offering_type = ((String) offering_entry.get("offering_type")).replaceAll("-", "");
int offering_value = ((Double) offering_entry.get("offering_value")).intValue();
item_offering_info.put(offering_type, offering_value);
}
// Fields only present for ARMOR

Loading…
Cancel
Save