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 {
// Reading offering data // 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()) { for (Object entry : offering_data) {
String shrineType = (String) key; JSONObject offering_entry = (JSONObject) entry;
shrineType = shrineType.replaceAll("-", ""); // For half-giant String offering_type = ((String) offering_entry.get("offering_type")).replaceAll("-", "");
int value = ((Double) item_offering_info.get(key)).intValue(); int offering_value = ((Double) offering_entry.get("offering_value")).intValue();
item_offering_info.put(shrineType, value); item_offering_info.put(offering_type, offering_value);
} }
// Fields only present for ARMOR // Fields only present for ARMOR

Loading…
Cancel
Save