Browse Source

Parsing power_granted_skills

combat-2
MagicBot 8 months ago
parent
commit
772e7f7f29
  1. 17
      src/engine/objects/ItemTemplate.java

17
src/engine/objects/ItemTemplate.java

@ -362,6 +362,15 @@ public class ItemTemplate { @@ -362,6 +362,15 @@ public class ItemTemplate {
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);
JSONArray skill_granted_array = (JSONArray) powerGrantEntry.get("power_granted_skills");
for (Object skillGrantEntry : skill_granted_array) {
JSONArray skill_entry = (JSONArray) skillGrantEntry;
String skill_type = (String) skill_entry.get(0);
int skill_level = ((Long) skill_entry.get(1)).intValue();
skill_granted_skills.put(skill_type, skill_level);
}
}
}
@ -431,16 +440,16 @@ public class ItemTemplate { @@ -431,16 +440,16 @@ public class ItemTemplate {
JSONArray skill_grant_json = (JSONArray) jsonObject.get("rune_skill_grant");
if (skill_grant_json.isEmpty() == false)
for (Object o : skill_grant_json) {
JSONObject skill_granted = (JSONObject) o;
for (Object runeSkillEntry : skill_grant_json) {
JSONObject skill_granted = (JSONObject) runeSkillEntry;
String typeString = (String) skill_granted.get("skill_type");
int skill_level = ((Long) skill_granted.get("skill_value")).intValue();
rune_skill_grant.put(typeString, skill_level);
JSONArray skill_granted_array = (JSONArray) skill_granted.get("skill_granted_skills");
for (Object oo : skill_granted_array) {
JSONArray skill_entry = (JSONArray) oo;
for (Object skillGrantEntry : skill_granted_array) {
JSONArray skill_entry = (JSONArray) skillGrantEntry;
typeString = (String) skill_entry.get(0);
skill_level = ((Long) skill_entry.get(1)).intValue();
skill_granted_skills.put(typeString, skill_level);

Loading…
Cancel
Save