From ddaa505c6a5fb9bb5d89d199486fc3cc223880b0 Mon Sep 17 00:00:00 2001 From: Jesse Woolsey Date: Mon, 15 Feb 2016 20:23:45 -0500 Subject: [PATCH] * Fix Several Items that were glitched when worn. * Fix items that were not able to be worn due to the name. * Added prayer check in due to one of the items using it during 377 --- .../apollo/cache/def/EquipmentDefinition.java | 63 +++++++++--------- .../apollo/cache/tools/EquipmentUpdater.java | 32 ++++++++- data/equipment-377.dat | Bin 25625 -> 28378 bytes .../game/io/EquipmentDefinitionParser.java | 3 +- 4 files changed, 65 insertions(+), 33 deletions(-) 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 7926545959e19fdb24c43eec960db04ed4e2cf44..4eaac5489308568052ffa14c6a9c405594fc100d 100644 GIT binary patch literal 28378 zcmeI4%aYtS3`Nt4Q>nO;oj2Je+o@D#*JcMT*v=k1&i#w;txNA16dl_-P!1;FD{4&pzAdD+a+#e~>0?G{ zam2$iau>8t1$Hf2kS-?e^zw?POWPVpuU87Gf#F0miy; z3`FQagd<#^Rpz-U0Igk-nuQOwAg;q4x>-A&fVuNY3d|i!Qef^|lA@b&&h|*NW2^Dg z35cWuF#te>gCKJZDPABt59ufK?D+-0m^EZwrs@iJ1*)5F45)6p6sQil6!@h|f$E#< zI(oR0UV$E@EC4-7Nr4`uq(Fp&AWf&lOEe$e3%SDq_#UWm+%8bvbSY5XbSY5XbSY57 z;!>aqi}WBONFag)B1j;D6mCAkt?SCI8w1L%OM!ChQlQf0QlL8NQeYC^D)e`3454&~-d!kCmS1MfBK!VsEO4 z_)aX{r5u~sBi$F=9?P*Vrbn!By%a8{7}tN-EDlO)SZaV51M!l7xqX4rIuXCQOwG`Q z-`;3Ge9QKuz%HI|2U@KCJqvJ~eKY`WYkN1Xjm5F>kN1~1MR$Y21TJE*%h-3XH<9mCgc?!oZ5bzXb!SZo1Q`WL9k+R^c<-!h0`zj1F7U>k^qHoC z>`_DJQlN&+r3-{r{?`+aOPRB@iD3_38mwyyo9XK5+D&txu4G#)b%N{fw@#i0;9Wxv3mZ zrn>i07{7Gi><=4qQ{+MC;4PW=0?P*hn?$FR(8tww%(6=eU3Y=Lx=IT4ftM8MB_%2F zd-jG&v=x7~0qAwLB==IwWFXb9*z0Onbg8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