Read named grant keys and signed values from new COBJECTS JSON
Grant pair lists now carry name strings ("HLR-021", "Unarmed Combat")
instead of integer hashes, so they are stored as name -> value maps.
Unresolved hashes are kept as their decimal string and logged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b56d4ee243
commit
1ac5a248db
5 files changed
+52
-32
No files matched your search
@@ -10,24 +10,18 @@ package engine.parsers.objects;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
// One entry of item_power_grant.
|
||||
//
|
||||
// power_granted_skills and power_granted_powers entries look like
|
||||
// [hash, value] pairs (first element is a 32-bit string hash, some
|
||||
// exceed Integer.MAX_VALUE in the JSON and are stored wrapped to int).
|
||||
// This reading is from the data only and has not been confirmed in the client.
|
||||
//
|
||||
// power_granted_attrs and power_monster_types are empty in every DEED and
|
||||
// RUNE file, so their shape is unknown and they are kept as raw JSON.
|
||||
// The granted lists are [key, value] pairs, unsigned key and signed value (sb.exe 0x6D7640).
|
||||
// power_monster_types is empty in every DEED and RUNE file, so it is kept as raw JSON.
|
||||
|
||||
public class PowerGrant {
|
||||
|
||||
public String power_type;
|
||||
public int power_value;
|
||||
public JSONArray power_granted_attrs;
|
||||
public final ArrayList<int[]> power_granted_skills = new ArrayList<>();
|
||||
public final ArrayList<int[]> power_granted_powers = new ArrayList<>();
|
||||
public final LinkedHashMap<String, Integer> power_granted_attrs = new LinkedHashMap<>();
|
||||
public final LinkedHashMap<String, Integer> power_granted_skills = new LinkedHashMap<>();
|
||||
public final LinkedHashMap<String, Integer> power_granted_powers = new LinkedHashMap<>();
|
||||
public JSONArray power_monster_types;
|
||||
}
|
||||
Reference in new issue
Block a user