diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 54bf12ad..322a8ef7 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -71,6 +71,9 @@ public class ItemTemplate { public Enum.SexType item_sex_req; public HashMap item_user_power_action = new HashMap<>(); + public static HashMap item_power_grant = new HashMap<>(); + + public ItemTemplate(JSONObject jsonObject) { try { @@ -274,6 +277,16 @@ public class ItemTemplate { int[] arguments = {((Long) args.get(0)).intValue(), ((Long) args.get(1)).intValue()}; item_user_power_action.put(power, arguments); } + + JSONArray powerGrants = (JSONArray) jsonObject.get("item_power_grant"); + for (Object o : powerGrants) { + JSONObject powerGrantEntry = (JSONObject) o; + String power_type = (String) powerGrantEntry.get("power_type"); + int power_value = ((Long) powerGrantEntry.get("power_value")).intValue(); + item_power_grant.put(power_type, power_value); + } + + } catch (Exception e) { Logger.error(e); }