diff --git a/cache/src/main/org/apollo/cache/def/EquipmentDefinition.java b/cache/src/main/org/apollo/cache/def/EquipmentDefinition.java index 9ef71226..9af643ad 100644 --- a/cache/src/main/org/apollo/cache/def/EquipmentDefinition.java +++ b/cache/src/main/org/apollo/cache/def/EquipmentDefinition.java @@ -147,26 +147,6 @@ public final class EquipmentDefinition { return levels[HITPOINTS]; } - /** - * Gets the id. - * - * @return The id. - */ - public int getId() { - return id; - } - - /** - * Gets the minimum level required to equip this item for a specific skill. - * - * @param skill The skill id. - * @return The level. - */ - public int getLevel(int skill) { - Preconditions.checkArgument(skill >= ATTACK && skill <= MAGIC, "Skill id out of bounds."); - return levels[skill]; - } - /** * Gets the minimum magic level required to equip this item. * @@ -194,15 +174,6 @@ public final class EquipmentDefinition { return levels[RANGED]; } - /** - * Gets the target slot. - * - * @return The target slot. - */ - public int getSlot() { - return slot; - } - /** * Gets the minimum strength level required to equip this item. * @@ -212,6 +183,35 @@ public final class EquipmentDefinition { return levels[STRENGTH]; } + /** + * Gets the id. + * + * @return The id. + */ + public int getId() { + return id; + } + + /** + * Gets the minimum level required to equip this item for a specific skill. + * + * @param skill The skill id. + * @return The level. + */ + public int getLevel(int skill) { + Preconditions.checkArgument(skill >= ATTACK && skill <= MAGIC, "Skill id out of bounds."); + return levels[skill]; + } + + /** + * Gets the target slot. + * + * @return The target slot. + */ + public int getSlot() { + return slot; + } + /** * Checks if this equipment is a full body. * @@ -270,10 +270,11 @@ public final class EquipmentDefinition { * @param strength The required strength level. * @param defence The required defence level. * @param ranged The required ranged level. + * @param prayer The required prayer level. * @param magic The required magic level. */ - public void setLevels(int attack, int strength, int defence, int ranged, int magic) { - setLevels(attack, strength, defence, 1, ranged, 1, magic); + public void setLevels(int attack, int strength, int defence, int ranged, int prayer, int magic) { + setLevels(attack, strength, defence, 1, ranged, prayer, magic); } /** diff --git a/cache/src/main/org/apollo/cache/tools/EquipmentUpdater.java b/cache/src/main/org/apollo/cache/tools/EquipmentUpdater.java index 847245a1..7345704c 100644 --- a/cache/src/main/org/apollo/cache/tools/EquipmentUpdater.java +++ b/cache/src/main/org/apollo/cache/tools/EquipmentUpdater.java @@ -31,7 +31,7 @@ public final class EquipmentUpdater { String release = args[0]; try (DataOutputStream os = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("data/equipment-" + release + ".dat"))); - IndexedFileSystem fs = new IndexedFileSystem(Paths.get("data/fs/", release), true)) { + IndexedFileSystem fs = new IndexedFileSystem(Paths.get("data/fs/", release), true)) { ItemDefinitionDecoder decoder = new ItemDefinitionDecoder(fs); decoder.run(); @@ -52,6 +52,7 @@ public final class EquipmentUpdater { os.writeByte(getStrengthRequirement(definition)); os.writeByte(getDefenceRequirement(definition)); os.writeByte(getRangedRequirement(definition)); + os.writeByte(getPrayerRequirement(definition)); os.writeByte(getMagicRequirement(definition)); } } @@ -254,6 +255,12 @@ public final class EquipmentUpdater { return 1; } else if (id == 7456) { return 1; + } else if (id == 2661) { + return 40; + } else if (id == 2667) { + return 40; + } else if (id == 3479) { + return 40; } else if (name.equals("White med helm")) { return 10; } else if (name.equals("White chainbody")) { @@ -587,8 +594,29 @@ public final class EquipmentUpdater { return 30; } else if (name.equals("Fire battlestaff")) { return 30; + } else if (name.equals("Toktz-mej-tal")) { + return 60; } + return 1; + } + /** + * Gets the prayer requirement. + * + * @param definition the item. + * @return The required level. + */ + private static int getPrayerRequirement(ItemDefinition definition) { + String name = definition.getName(); + if (name == null) { + name = "null"; + } + if (name.contains("Initiate")) { + return 10; + } + if (name.contains("Proselyte")) { + return 20; + } return 1; } @@ -886,6 +914,8 @@ public final class EquipmentUpdater { return true; } else if (id == 4214) { return true; + } else if (id == 6526) { + return true; } else if (name.endsWith("2h sword")) { return true; } else if (name.endsWith("longbow")) { diff --git a/data/equipment-377.dat b/data/equipment-377.dat index 79265459..4eaac548 100644 Binary files a/data/equipment-377.dat and b/data/equipment-377.dat differ diff --git a/game/src/main/org/apollo/game/io/EquipmentDefinitionParser.java b/game/src/main/org/apollo/game/io/EquipmentDefinitionParser.java index 07e6b0a3..19a79e71 100644 --- a/game/src/main/org/apollo/game/io/EquipmentDefinitionParser.java +++ b/game/src/main/org/apollo/game/io/EquipmentDefinitionParser.java @@ -63,10 +63,11 @@ public final class EquipmentDefinitionParser implements Runnable { int strength = in.readByte() & 0xFF; int defence = in.readByte() & 0xFF; int ranged = in.readByte() & 0xFF; + int prayer = in.readByte() & 0xFF; int magic = in.readByte() & 0xFF; EquipmentDefinition definition = new EquipmentDefinition(id); - definition.setLevels(attack, strength, defence, ranged, magic); + definition.setLevels(attack, strength, defence, ranged, prayer, magic); definition.setSlot(slot); definition.setFlags(twoHanded, fullBody, fullHat, fullMask);