Jump to content
  • 0
Sign in to follow this  
blackpeanut

667/704 new dragon armour problem.

Question

heey guys, i have a problem with the "new" dragon armour.
because i can wear the platebody but when i wanna wear the helm, boots and platelegs it sais : you cant wear that
please help me that.

(i have the same problem with the armadyl armour)

have a nice day

Share this post


Link to post
Share on other sites

19 answers to this question

Recommended Posts

  • 0
int targetSlot = Equipment.getItemSlot(itemId);
if (targetSlot == -1) {
player.getPackets().sendGameMessage("You can't wear that.");
return true;
}

It's because of that, since it's new items you need to change the wearing slot in your Item Definitions

Share this post


Link to post
Share on other sites
  • 0
ok here is the definitions

[CODE]package com.rs.cache.loaders;

import java.util.HashMap;

import com.alex.utils.Constants;
import com.rs.cache.Cache;
import com.rs.game.player.Equipment;
import com.rs.game.player.Skills;
import com.rs.io.InputStream;
import com.rs.utils.Utils;

@SuppressWarnings("unused")
public final class ItemDefinitions {

private static final ItemDefinitions[] itemsDefinitions;

static { // that's why this is here
itemsDefinitions = new ItemDefinitions[Utils.getItemDefinitionsSize()];
}

private int id;
private boolean loaded;

public int modelId;
private String name;

// model size information
private int modelZoom;
private int modelRotation1;
private int modelRotation2;
private int modelOffset1;
private int modelOffset2;

// extra information
private int stackable;
private int value;
private boolean membersOnly;

// wearing model information
private int maleEquip1;
private int femaleEquip1;
private int maleEquip2;
private int femaleEquip2;

// options
private String[] groundOptions;
public String[] inventoryOptions;

// model information
public int[] originalModelColors;
public int[] modifiedModelColors;
public short[] originalTextureColors;
private short[] modifiedTextureColors;
private byte[] unknownArray1;
private int[] unknownArray2;
// extra information, not used for newer items
private boolean unnoted;

private int maleEquipModelId3;
private int femaleEquipModelId3;
private int unknownInt1;
private int unknownInt2;
private int unknownInt3;
private int unknownInt4;
private int unknownInt5;
private int unknownInt6;
private int certId;
private int certTemplateId;
private int[] stackIds;
private int[] stackAmounts;
private int unknownInt7;
private int unknownInt8;
private int unknownInt9;
private int unknownInt10;
private int unknownInt11;
private int teamId;
private int lendId;
private int lendTemplateId;
private int unknownInt12;
private int unknownInt13;
private int unknownInt14;
private int unknownInt15;
private int unknownInt16;
private int unknownInt17;
private int unknownInt18;
private int unknownInt19;
private int unknownInt20;
private int unknownInt21;
private int unknownInt22;
private int unknownInt23;

// extra added
private boolean noted;
private boolean lended;

private HashMap<Integer, Object> clientScriptData;
private HashMap<Integer, Integer> itemRequiriments;

public static final ItemDefinitions getItemDefinitions(int itemId) {
if (itemId < 0 || itemId >= itemsDefinitions.length)
itemId = 0;
ItemDefinitions def = itemsDefinitions[itemId];
if (def == null)
itemsDefinitions[itemId] = def = new ItemDefinitions(itemId);
return def;
}

public static final void clearItemsDefinitions() {
for (int i = 0; i < itemsDefinitions.length; i++)
itemsDefinitions[i] = null;
}

public ItemDefinitions(int id) {
this.id = id;
setDefaultsVariableValues();
setDefaultOptions();
loadItemDefinitions();
}

public boolean isLoaded() {
return loaded;
}

private final void loadItemDefinitions() {
byte[] data = Cache.STORE.getIndexes()[Constants.ITEM_DEFINITIONS_INDEX]
.getFile(getArchiveId(), getFileId());
if (data == null) {
// System.out.println("Failed loading Item " + id+".");
return;
}
readOpcodeValues(new InputStream(data));
if (certTemplateId != -1)
toNote();
if (lendTemplateId != -1)
toLend();
if (unknownValue1 != -1)
toLendBind();
loaded = true;
}

private void toNote() {
// ItemDefinitions noteItem; //certTemplateId
ItemDefinitions realItem = getItemDefinitions(certId);
membersOnly = realItem.membersOnly;
value = realItem.value;
name = realItem.name;
stackable = 1;
noted = true;
}

private void toLendBind() {
// ItemDefinitions lendItem; //lendTemplateId
ItemDefinitions realItem = getItemDefinitions(unknownValue2);
originalModelColors = realItem.originalModelColors;
maleEquipModelId3 = realItem.maleEquipModelId3;
femaleEquipModelId3 = realItem.femaleEquipModelId3;
teamId = realItem.teamId;
value = 0;
membersOnly = realItem.membersOnly;
name = realItem.name;
inventoryOptions = new String[5];
groundOptions = realItem.groundOptions;
if (realItem.inventoryOptions != null)
for (int optionIndex = 0; optionIndex < 4; optionIndex++)
inventoryOptions[optionIndex] = realItem.inventoryOptions[optionIndex];
inventoryOptions[4] = "Discard";
maleEquip1 = realItem.maleEquip1;
maleEquip2 = realItem.maleEquip2;
femaleEquip1 = realItem.femaleEquip1;
femaleEquip2 = realItem.femaleEquip2;
clientScriptData = realItem.clientScriptData;
lended = true;
}

private void toLend() {
// ItemDefinitions lendItem; //lendTemplateId
ItemDefinitions realItem = getItemDefinitions(lendId);
originalModelColors = realItem.originalModelColors;
maleEquipModelId3 = realItem.maleEquipModelId3;
femaleEquipModelId3 = realItem.femaleEquipModelId3;
teamId = realItem.teamId;
value = 0;
membersOnly = realItem.membersOnly;
name = realItem.name;
inventoryOptions = new String[5];
groundOptions = realItem.groundOptions;
if (realItem.inventoryOptions != null)
for (int optionIndex = 0; optionIndex < 4; optionIndex++)
inventoryOptions[optionIndex] = realItem.inventoryOptions[optionIndex];
inventoryOptions[4] = "Discard";
maleEquip1 = realItem.maleEquip1;
maleEquip2 = realItem.maleEquip2;
femaleEquip1 = realItem.femaleEquip1;
femaleEquip2 = realItem.femaleEquip2;
clientScriptData = realItem.clientScriptData;
lended = true;
}

public int getArchiveId() {
return id >>> 8;
}

public int getFileId() {
return 0xff & id;
}

public boolean isDestroyItem() {
if (inventoryOptions == null)
return false;
for (String option : inventoryOptions) {
if (option == null)
continue;
if (option.equalsIgnoreCase("destroy"))
return true;
}
return false;
}

public boolean isWearItem() {
if (inventoryOptions == null)
return false;
for (String option : inventoryOptions) {
if (option == null)
continue;
if (option.equalsIgnoreCase("wield")
|| option.equalsIgnoreCase("wear")
|| option.equalsIgnoreCase("equip"))
return true;
}
return false;
}

public boolean isWearItem(boolean male) {
if (inventoryOptions == null)
return false;
if (Equipment.getItemSlot(id) != Equipment.SLOT_RING
&& Equipment.getItemSlot(id) != Equipment.SLOT_ARROWS
&& Equipment.getItemSlot(id) != Equipment.SLOT_AURA
&& (male ? getMaleWornModelId1() == -1
: getFemaleWornModelId1() == -1))
return false;
for (String option : inventoryOptions) {
if (option == null)
continue;
if (option.equalsIgnoreCase("wield")
|| option.equalsIgnoreCase("wear")
|| option.equalsIgnoreCase("equip"))
return true;
}
return false;
}

public boolean hasSpecialBar() {
if (clientScriptData == null)
return false;
Object specialBar = clientScriptData.get(686);
if (specialBar != null && specialBar instanceof Integer)
return (Integer) specialBar == 1;
return false;
}

public int getRenderAnimId() {
if (clientScriptData == null)
return 1426;
Object animId = clientScriptData.get(644);
if (animId != null && animId instanceof Integer)
return (Integer) animId;
return 1426;
}

public int getQuestId() {
if (clientScriptData == null)
return -1;
Object questId = clientScriptData.get(861);
if (questId != null && questId instanceof Integer)
return (Integer) questId;
return -1;
}

public HashMap<Integer, Integer> getCreateItemRequirements() {
if (clientScriptData == null)
return null;
HashMap<Integer, Integer> items = new HashMap<Integer, Integer>();
int requiredId = -1;
int requiredAmount = -1;
for (int key : clientScriptData.keySet()) {
Object value = clientScriptData.get(key);
if (value instanceof String)
continue;
if (key >= 538 && key <= 770) {
if (key % 2 == 0)
requiredId = (Integer) value;
else
requiredAmount = (Integer) value;
if (requiredId != -1 && requiredAmount != -1) {
items.put(requiredAmount, requiredId);
requiredId = -1;
requiredAmount = -1;
}
}
}
return items;
}

public HashMap<Integer, Object> getClientScriptData() {
return clientScriptData;
}

public HashMap<Integer, Integer> getWearingSkillRequiriments() {
if (clientScriptData == null)
return null;
if (itemRequiriments == null) {
HashMap<Integer, Integer> skills = new HashMap<Integer, Integer>();
for (int i = 0; i < 10; i++) {
Integer skill = (Integer) clientScriptData.get(749 + (i * 2));
if (skill != null) {
Integer level = (Integer) clientScriptData
.get(750 + (i * 2));
if (level != null)
skills.put(skill, level);
}
}
Integer maxedSkill = (Integer) clientScriptData.get(277);
if (maxedSkill != null)
skills.put(maxedSkill, id == 19709 ? 120 : 99);
itemRequiriments = skills;
if (id == 7462)
itemRequiriments.put(Skills.DEFENCE, 40);
else if (name.equals("Dragon defender")) {
itemRequiriments.put(Skills.ATTACK, 60);
itemRequiriments.put(Skills.DEFENCE, 60);
}
}

return itemRequiriments;
}

/*
* public HashMap<Integer, Integer> getWearingSkillRequiriments() { if
* (clientScriptData == null) return null; HashMap<Integer, Integer> skills
* = new HashMap<Integer, Integer>(); int nextLevel = -1; int nextSkill =
* -1; for (int key : clientScriptData.keySet()) { Object value =
* clientScriptData.get(key); if (value instanceof String) continue; if(key
* == 277) { skills.put((Integer) value, id == 19709 ? 120 : 99); }else if
* (key == 23 && id == 15241) { skills.put(4, (Integer) value);
* skills.put(11, 61); } else if (key >= 749 && key < 797) { if (key % 2 ==
* 0) nextLevel = (Integer) value; else nextSkill = (Integer) value; if
* (nextLevel != -1 && nextSkill != -1) { skills.put(nextSkill, nextLevel);
* nextLevel = -1; nextSkill = -1; } }
*
* } return skills; }
*/

private void setDefaultOptions() {
groundOptions = new String[] { null, null, "take", null, null };
inventoryOptions = new String[] { null, null, null, null, "drop" };
}

private void setDefaultsVariableValues() {
name = "null";
maleEquip1 = -1;
maleEquip2 = -1;
femaleEquip1 = -1;
femaleEquip2 = -1;
modelZoom = 2000;
lendId = -1;
lendTemplateId = -1;
certId = -1;
certTemplateId = -1;
unknownInt9 = 128;
value = 1;
maleEquipModelId3 = -1;
femaleEquipModelId3 = -1;
unknownValue1 = -1;
unknownValue2 = -1;
}

private final void readValues(InputStream stream, int opcode) {
if (opcode == 1)
modelId = stream.readBigSmart();
else if (opcode == 2) {
name = stream.readString();
if(id < 7593)
System.out.println(id+":"+name);
}
else if (opcode == 4)
modelZoom = stream.readUnsignedShort();
else if (opcode == 5)
modelRotation1 = stream.readUnsignedShort();
else if (opcode == 6)
modelRotation2 = stream.readUnsignedShort();
else if (opcode == 7) {
modelOffset1 = stream.readUnsignedShort();
if (modelOffset1 > 32767)
modelOffset1 -= 65536;
modelOffset1 <<= 0;
} else if (opcode == 8) {
modelOffset2 = stream.readUnsignedShort();
if (modelOffset2 > 32767)
modelOffset2 -= 65536;
modelOffset2 <<= 0;
} else if (opcode == 11)
stackable = 1;
else if (opcode == 12)
value = stream.readInt();
else if (opcode == 16)
membersOnly = true;
else if (opcode == 18) // added
stream.readUnsignedShort();
else if (opcode == 23)
maleEquip1 = stream.readBigSmart();
else if (opcode == 24)
maleEquip2 = stream.readBigSmart();
else if (opcode == 25)
femaleEquip1 = stream.readBigSmart();
else if (opcode == 26)
femaleEquip2 = stream.readBigSmart();
else if (opcode >= 30 && opcode < 35)
groundOptions[opcode - 30] = stream.readString();
else if (opcode >= 35 && opcode < 40)
inventoryOptions[opcode - 35] = stream.readString();
else if (opcode == 40) {
int length = stream.readUnsignedByte();
originalModelColors = new int[length];
modifiedModelColors = new int[length];
for (int index = 0; index < length; index++) {
originalModelColors[index] = stream.readUnsignedShort();
modifiedModelColors[index] = stream.readUnsignedShort();
}
} else if (opcode == 41) {
int length = stream.readUnsignedByte();
originalTextureColors = new short[length];
modifiedTextureColors = new short[length];
for (int index = 0; index < length; index++) {
originalTextureColors[index] = (short) stream
.readUnsignedShort();
modifiedTextureColors[index] = (short) stream
.readUnsignedShort();
}
} else if (opcode == 42) {
int length = stream.readUnsignedByte();
unknownArray1 = new byte[length];
for (int index = 0; index < length; index++)
unknownArray1[index] = (byte) stream.readByte();
} else if (opcode == 65)
unnoted = true;
else if (opcode == 78)
maleEquipModelId3 = stream.readBigSmart();
else if (opcode == 79)
femaleEquipModelId3 = stream.readBigSmart();
else if (opcode == 90)
unknownInt1 = stream.readBigSmart();
else if (opcode == 91)
unknownInt2 = stream.readBigSmart();
else if (opcode == 92)
unknownInt3 = stream.readBigSmart();
else if (opcode == 93)
unknownInt4 = stream.readBigSmart();
else if (opcode == 95)
unknownInt5 = stream.readUnsignedShort();
else if (opcode == 96)
unknownInt6 = stream.readUnsignedByte();
else if (opcode == 97)
certId = stream.readUnsignedShort();
else if (opcode == 98)
certTemplateId = stream.readUnsignedShort();
else if (opcode >= 100 && opcode < 110) {
if (stackIds == null) {
stackIds = new int[10];
stackAmounts = new int[10];
}
stackIds[opcode - 100] = stream.readUnsignedShort();
stackAmounts[opcode - 100] = stream.readUnsignedShort();
} else if (opcode == 110)
unknownInt7 = stream.readUnsignedShort();
else if (opcode == 111)
unknownInt8 = stream.readUnsignedShort();
else if (opcode == 112)
unknownInt9 = stream.readUnsignedShort();
else if (opcode == 113)
unknownInt10 = stream.readByte();
else if (opcode == 114)
unknownInt11 = stream.readByte() * 5;
else if (opcode == 115)
teamId = stream.readUnsignedByte();
else if (opcode == 121)
lendId = stream.readUnsignedShort();
else if (opcode == 122)
lendTemplateId = stream.readUnsignedShort();
else if (opcode == 125) {
unknownInt12 = stream.readByte() << 0;
unknownInt13 = stream.readByte() << 0;
unknownInt14 = stream.readByte() << 0;
} else if (opcode == 126) {
unknownInt15 = stream.readByte() << 0;
unknownInt16 = stream.readByte() << 0;
unknownInt17 = stream.readByte() << 0;
} else if (opcode == 127) {
unknownInt18 = stream.readUnsignedByte();
unknownInt19 = stream.readUnsignedShort();
} else if (opcode == 128) {
unknownInt20 = stream.readUnsignedByte();
unknownInt21 = stream.readUnsignedShort();
} else if (opcode == 129) {
unknownInt20 = stream.readUnsignedByte();
unknownInt21 = stream.readUnsignedShort();
} else if (opcode == 130) {
unknownInt22 = stream.readUnsignedByte();
unknownInt23 = stream.readUnsignedShort();
} else if (opcode == 132) {
int length = stream.readUnsignedByte();
unknownArray2 = new int[length];
for (int index = 0; index < length; index++)
unknownArray2[index] = stream.readUnsignedShort();
} else if (opcode == 134) {
int unknownValue = stream.readUnsignedByte();
} else if (opcode == 139) {
unknownValue2 = stream.readUnsignedShort();
} else if (opcode == 140) {
unknownValue1 = stream.readUnsignedShort();
} else if (opcode == 249) {
int length = stream.readUnsignedByte();
if (clientScriptData == null)
clientScriptData = new HashMap<Integer, Object>(length);
for (int index = 0; index < length; index++) {
boolean stringInstance = stream.readUnsignedByte() == 1;
int key = stream.read24BitInt();
Object value = stringInstance ? stream.readString() : stream
.readInt();
clientScriptData.put(key, value);
}
} else
throw new RuntimeException("MISSING OPCODE " + opcode
+ " FOR ITEM " + id);
}

private int unknownValue1;
private int unknownValue2;

private final void readOpcodeValues(InputStream stream) {
while (true) {
int opcode = stream.readUnsignedByte();
if (opcode == 0)
break;
readValues(stream, opcode);
}
}

public String getName() {
return name;
}

public int getFemaleWornModelId1() {
return femaleEquip1;
}

public int getFemaleWornModelId2() {
return femaleEquip2;
}

public int getMaleWornModelId1() {
return maleEquip1;
}

public int getMaleWornModelId2() {
return maleEquip2;
}

public boolean isLended() {
return lended;
}

public boolean isStackable() {
return stackable == 1;
}

public boolean isNoted() {
return noted;
}

public int getLendId() {
return lendId;
}

public int getCertId() {
return certId;
}

public int getValue() {
return value;
}

public void setValue(int value) {
this.value = value;
}

}
[/CODE]

Share this post


Link to post
Share on other sites
  • 0
and here is the equip

[CODE]package com.rs.game.player;

import java.io.Serializable;

import com.rs.cache.loaders.ItemDefinitions;
import com.rs.game.item.Item;
import com.rs.game.item.ItemsContainer;
import com.rs.game.player.content.Runecrafting;
import com.rs.utils.ItemExamines;

public final class Equipment implements Serializable {

private static final long serialVersionUID = -4147163237095647617L;

public static final byte SLOT_HAT = 0, SLOT_CAPE = 1, SLOT_AMULET = 2,
SLOT_WEAPON = 3, SLOT_CHEST = 4, SLOT_SHIELD = 5, SLOT_LEGS = 7,
SLOT_HANDS = 9, SLOT_FEET = 10, SLOT_RING = 12, SLOT_ARROWS = 13,
SLOT_AURA = 14;

private static String[] CAPES = { "cloak", "cape", "ava's" };

private static String[] HATS = { "visor", "ears", "goggles", "bearhead",
"tiara", "cowl", "druidic wreath", "halo", "Royal", "crown",
"sallet", "helm", "hood", "coif", "Coif", "partyhat", "hat", "cap",
" bandana", "full helm (t)", "full helm (g)", "full helm (or)", "cav", "boater",
"helmet", "afro", "beard", "gnome goggles", "mask",
"Helm of neitiznot", "mitre" };

private static String[] BOOTS = { "boots", "Boots", "shoes", "Shoes",
"flippers" };

private static String[] GLOVES = { "gloves", "gauntlets", "Gloves",
"vambraces", "vamb", "bracers", "brace" };

private static String[] AMULETS = { "stole", "amulet", "necklace",
"Amulet of", "scarf", "Super dominion medallion" };

private static String[] SHIELDS = { "tome of frost", "kiteshield",
"sq shield", "Toktz-ket", "books", "book", "kiteshield (t)",
"kiteshield (g)", "kiteshield(h)", "defender", "shield",
"deflector" };

private static String[] ARROWS = { "arrow", "arrows", "arrow(p)",
"arrow(+)", "arrow(s)", "bolt", "Bolt rack", "Opal bolts",
"Dragon bolts", "bolts (e)", "bolts", "Hand cannon shot" };

private static String[] RINGS = { "ring" };

private static String[] BODY = { "poncho", "apron", "robe top", "armour",
"hauberk", "platebody", "chainbody", "robetop", "leathertop",
"platemail", "top", "brassard", "body", "platebody (t)",
"platebody (g)", "body(g)", "body_(g)", "chestplate", "torso",
"shirt", "Rock-shell plate" };

private static String[] AURAS = { "poison purge", "runic accuracy",
"sharpshooter", "lumberjack", "quarrymaster", "call of the sea",
"reverence", "five finger discount", "resourceful", "equilibrium",
"inspiration", "vampyrism", "penance", "wisdom", "jack of trades" };

private static int[] BODY_LIST = { 21463, 21549, 544, 6107 };

private static int[] LEGS_LIST = { 542, 6108, 10340, 7398 };

private static String[] LEGS = { "leggings", "void knight robe",
"druidic robe", "cuisse", "pants", "platelegs", "platelegs (or)", "plateskirt",
"skirt", "bottoms", "chaps", "platelegs (t)", "platelegs (g)",
"bottom", "skirt", "skirt (g)", "skirt (t)", "chaps (g)",
"chaps (t)", "tassets", "legs", "trousers", "robe bottom" };

private static String[] WEAPONS = { "bolas", "blade", "Butterfly net",
"scythe", "rapier", "hatchet", "bow", "Hand cannon",
"Inferno adze", "Silverlight", "Darklight", "wand",
"Statius's warhammer", "anchor", "spear.", "Vesta's longsword.",
"scimitar", "longsword", "sword", "longbow", "shortbow", "dagger",
"mace", "halberd", "spear", "Abyssal whip", "Abyssal vine whip",
"Ornate katana", "axe", "flail", "crossbow", "Torags hammers",
"dagger(p)", "dagger (p++)", "dagger(+)", "dagger(s)", "spear(p)",
"spear(+)", "spear(s)", "spear(kp)", "maul", "dart", "dart(p)",
"javelin", "javelin(p)", "knife", "knife(p)", "Longbow",
"Shortbow", "Crossbow", "Toktz-xil", "Toktz-mej", "Tzhaar-ket",
"staff", "Staff", "godsword", "c'bow", "Crystal bow", "Dark bow",
"claws", "warhammer", "hammers", "adze", "hand", "Broomstick",
"Flowers", "flowers", "trident", "excalibur" };

private static String[] NOT_FULL_BODY = { "zombie shirt" };

private static String[] FULL_BODY = { "robe", "pernix body",
"vesta's chainbody", "armour", "hauberk", "top", "shirt",
"platebody", "Ahrims robetop", "Karils leathertop", "brassard",
"chestplate", "torso", "Morrigan's", "Zuriel's", "changshan jacket" };

private static String[] FULL_HAT = { "helm", "cowl", "sallet", "med helm",
"coif", "Dharoks helm", "Initiate helm", "Coif",
"Helm of neitiznot" };

private static String[] FULL_MASK = { "sallet", "full helm", "mask",
"Veracs helm", "Guthans helm", "Torags helm", "Karils coif",
"full helm (t)", "full helm (g)" };

private ItemsContainer<Item> items;

private transient Player player;
private transient int equipmentHpIncrease;

static final int[] DISABLED_SLOTS = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 0 };

public Equipment() {
items = new ItemsContainer<Item>(15, false);
}

public void setPlayer(Player player) {
this.player = player;
}

public void init() {
player.getPackets().sendItems(94, items);
refresh(null);
}

public void refresh(int... slots) {
if (slots != null) {
player.getPackets().sendUpdateItems(94, items, slots);
player.getCombatDefinitions().checkAttackStyle();
}
player.getCombatDefinitions().refreshBonuses();
refreshConfigs(slots == null);
}

public void reset() {
items.reset();
init();
}

public Item getItem(int slot) {
return items.get(slot);
}

public void sendExamine(int slotId) {
Item item = items.get(slotId);
if (item == null)
return;
player.getPackets().sendGameMessage(ItemExamines.getExamine(item));
}

public void refreshConfigs(boolean init) {
double hpIncrease = 0;
for (int index = 0; index < items.getSize(); index++) {
Item item = items.get(index);
if (item == null)
continue;
int id = item.getId();
if (index == Equipment.SLOT_HAT) {
if (id == 20135 || id == 20137 // torva
|| id == 20147 || id == 20149 // pernix
|| id == 20159 || id == 20161 // virtus
)
hpIncrease += 66;
else if (id == Runecrafting.AIR_TIARA)
player.getPackets().sendConfig(491, 1);
else if (id == Runecrafting.EARTH_TIARA)
player.getPackets().sendConfig(491, 8);
else if (id == Runecrafting.FIRE_TIARA)
player.getPackets().sendConfig(491, 16);
else if (id == Runecrafting.WATER_TIARA)
player.getPackets().sendConfig(491, 4);
else if (id == Runecrafting.BODY_TIARA)
player.getPackets().sendConfig(491, 32);
else if (id == Runecrafting.MIND_TIARA)
player.getPackets().sendConfig(491, 2);
else if (id == Runecrafting.OMNI_TIARA)
player.getPackets().sendConfig(491, -1);

} else if (index == Equipment.SLOT_CHEST) {
if (id == 20139 || id == 20141 // torva
|| id == 20151 || id == 20153 // pernix
|| id == 20163 || id == 20165 // virtus
)
hpIncrease += 200;
} else if (index == Equipment.SLOT_LEGS) {
if (id == 20143 || id == 20145 // torva
|| id == 20155 || id == 20157 // pernix
|| id == 20167 || id == 20169 // virtus
)
hpIncrease += 134;
}

}
if (hpIncrease != equipmentHpIncrease) {
equipmentHpIncrease = (int) hpIncrease;
if (!init)
player.refreshHitPoints();
}
}

public static boolean isFullBody(Item item) {
String itemName = item.getDefinitions().getName();
if (itemName == null)
return false;
itemName = itemName.toLowerCase();
for (int i = 0; i < NOT_FULL_BODY.length; i++)
if (itemName.contains(NOT_FULL_BODY[i].toLowerCase()))
return false;
for (int i = 0; i < FULL_BODY.length; i++)
if (itemName.contains(FULL_BODY[i].toLowerCase()))
return true;
return false;
}

public static boolean isFullHat(Item item) {
String itemName = item.getDefinitions().getName();
if (itemName == null)
return false;
itemName = itemName.toLowerCase();
for (int i = 0; i < FULL_HAT.length; i++) {
if (itemName.contains(FULL_HAT[i].toLowerCase())) {
return true;
}
}
return false;
}

public static boolean isFullMask(Item item) {
String itemName = item.getDefinitions().getName();
if (itemName == null)
return false;
itemName = itemName.toLowerCase();
for (int i = 0; i < FULL_MASK.length; i++)
if (itemName.contains(FULL_MASK[i].toLowerCase()))
return true;
return false;
}

public static int getItemSlot(int itemId) {
for (int i = 0; i < BODY_LIST.length; i++)
if (itemId == BODY_LIST[i])
return 4;
for (int i = 0; i < LEGS_LIST.length; i++)
if (itemId == LEGS_LIST[i])
return 7;
String item = ItemDefinitions.getItemDefinitions(itemId).getName()
.toLowerCase();
if (item == null)
return -1;
for (int i = 0; i < CAPES.length; i++)
if (item.contains(CAPES[i].toLowerCase()))
return 1;
for (int i = 0; i < BOOTS.length; i++)
if (item.contains(BOOTS[i].toLowerCase()))
return 10;
for (int i = 0; i < GLOVES.length; i++)
if (item.contains(GLOVES[i].toLowerCase()))
return 9;
for (int i = 0; i < SHIELDS.length; i++)
if (item.contains(SHIELDS[i].toLowerCase()))
return 5;
for (int i = 0; i < AMULETS.length; i++)
if (item.contains(AMULETS[i].toLowerCase()))
return 2;
for (int i = 0; i < ARROWS.length; i++)
if (item.contains(ARROWS[i].toLowerCase()))
return 13;
for (int i = 0; i < RINGS.length; i++)
if (item.contains(RINGS[i].toLowerCase()))
return 12;
for (int i = 0; i < WEAPONS.length; i++)
if (item.contains(WEAPONS[i].toLowerCase()))
return 3;
for (int i = 0; i < HATS.length; i++)
if (item.contains(HATS[i].toLowerCase()))
return 0;
for (int i = 0; i < BODY.length; i++)
if (item.contains(BODY[i].toLowerCase()))
return 4;
for (int i = 0; i < LEGS.length; i++)
if (item.contains(LEGS[i].toLowerCase()))
return 7;
for (int i = 0; i < AURAS.length; i++)
if (item.contains(AURAS[i].toLowerCase()))
return SLOT_AURA;
return -1;
}

public boolean hasTwoHandedWeapon() {
Item item = items.get(SLOT_WEAPON);
if (item == null)
return false;
return isTwoHandedWeapon(item);
}

public static boolean isTwoHandedWeapon(Item item) {
int itemId = item.getId();
if (itemId == 4212)
return true;
else if (itemId == 4214)
return true;
else if (itemId == 20281)
return true;
String wepEquiped = item.getDefinitions().getName().toLowerCase();
if (wepEquiped == null)
return false;
else if (wepEquiped.endsWith("claws"))
return true;
else if (wepEquiped.endsWith("anchor"))
return true;
else if (wepEquiped.contains("2h sword"))
return true;
else if (wepEquiped.contains("katana"))
return true;
else if (wepEquiped.equals("seercull"))
return true;
else if (wepEquiped.contains("shortbow"))
return true;
else if (wepEquiped.contains("longbow"))
return true;
else if (wepEquiped.contains("shortbow"))
return true;
else if (wepEquiped.contains("bow full"))
return true;
else if (wepEquiped.equals("zaryte bow"))
return true;
else if (wepEquiped.equals("dark bow"))
return true;
else if (wepEquiped.endsWith("halberd"))
return true;
else if (wepEquiped.contains("maul"))
return true;
else if (wepEquiped.equals("karil's crossbow"))
return true;
else if (wepEquiped.equals("torag's hammers"))
return true;
else if (wepEquiped.equals("verac's flail"))
return true;
else if (wepEquiped.contains("greataxe"))
return true;
else if (wepEquiped.contains("spear"))
return true;
else if (wepEquiped.equals("tzhaar-ket-om"))
return true;
else if (wepEquiped.contains("godsword"))
return true;
else if (wepEquiped.equals("saradomin sword"))
return true;
else if (wepEquiped.equals("hand cannon"))
return true;
return false;
}

public int getWeaponRenderEmote() {
Item weapon = items.get(3);
if (weapon == null)
return 1426;
return weapon.getDefinitions().getRenderAnimId();
}

public boolean hasShield() {
return items.get(5) != null;
}

public int getWeaponId() {
Item item = items.get(SLOT_WEAPON);
if (item == null)
return -1;
return item.getId();
}

public int getChestId() {
Item item = items.get(SLOT_CHEST);
if (item == null)
return -1;
return item.getId();
}

public int getHatId() {
Item item = items.get(SLOT_HAT);
if (item == null)
return -1;
return item.getId();
}

public int getShieldId() {
Item item = items.get(SLOT_SHIELD);
if (item == null)
return -1;
return item.getId();
}

public int getLegsId() {
Item item = items.get(SLOT_LEGS);
if (item == null)
return -1;
return item.getId();
}

public void removeAmmo(int ammoId, int ammount) {
if (ammount == -1) {
items.remove(SLOT_WEAPON, new Item(ammoId, 1));
refresh(SLOT_WEAPON);
} else {
items.remove(SLOT_ARROWS, new Item(ammoId, ammount));
refresh(SLOT_ARROWS);
}
}

public int getAuraId() {
Item item = items.get(SLOT_AURA);
if (item == null)
return -1;
return item.getId();
}

public int getCapeId() {
Item item = items.get(SLOT_CAPE);
if (item == null)
return -1;
return item.getId();
}

public int getRingId() {
Item item = items.get(SLOT_RING);
if (item == null)
return -1;
return item.getId();
}

public int getAmmoId() {
Item item = items.get(SLOT_ARROWS);
if (item == null)
return -1;
return item.getId();
}

public void deleteItem(int itemId, int amount) {
Item[] itemsBefore = items.getItemsCopy();
items.remove(new Item(itemId, amount));
refreshItems(itemsBefore);
}

public void refreshItems(Item[] itemsBefore) {
int[] changedSlots = new int[itemsBefore.length];
int count = 0;
for (int index = 0; index < itemsBefore.length; index++) {
if (itemsBefore[index] != items.getItems()[index])
changedSlots[count++] = index;
}
int[] finalChangedSlots = new int[count];
System.arraycopy(changedSlots, 0, finalChangedSlots, 0, count);
refresh(finalChangedSlots);
}

public int getBootsId() {
Item item = items.get(SLOT_FEET);
if (item == null)
return -1;
return item.getId();
}

public int getGlovesId() {
Item item = items.get(SLOT_HANDS);
if (item == null)
return -1;
return item.getId();
}

public ItemsContainer<Item> getItems() {
return items;
}

public int getEquipmentHpIncrease() {
return equipmentHpIncrease;
}

public void setEquipmentHpIncrease(int hp) {
this.equipmentHpIncrease = hp;
}

public boolean wearingArmour() {
if (getItem(SLOT_HAT) != null || getItem(SLOT_CAPE) != null
|| getItem(SLOT_AMULET) != null || getItem(SLOT_WEAPON) != null
|| getItem(SLOT_CHEST) != null || getItem(SLOT_SHIELD) != null
|| getItem(SLOT_LEGS) != null || getItem(SLOT_HANDS) != null
|| getItem(SLOT_FEET) != null || getItem(SLOT_RING) != null)
return false;
return true;
}

public int getAmuletId() {
Item item = items.get(SLOT_AMULET);
if (item == null)
return -1;
return item.getId();
}

}
[/CODE]

Share this post


Link to post
Share on other sites
  • 0
Add the names of the new items to the proper places in equipment.java, and make sure the item list has the items in it as well or else the server can't find the items that you've added, for an example of what to add say you were adding a rune plate body, you would go to [code]private static string FULL_BODY = {[/code] And at the end after [code]"jacket"[/code] you would add [code], "rune platebody"[/code] or [code], "platebody"[/code] which is also acceptable because when the array is read they look for terms containing that string, this would cover any item that contains platebody.

Share this post


Link to post
Share on other sites
  • 0
This is why people shouldn't download shit that they know nothing about, just because they want a private server that has all the newest things that runescape has.

Share this post


Link to post
Share on other sites
  • 0
Its reading as a null apparently, the items must be added to the source incorrectly.

Go through your files in which items are added and see if they are actually there or even in the correct spots.
As you can see... this is reading "Null/noted" items.
[code] public static boolean sendWear(Player player, int slotId, int itemId) {
if (player.hasFinished() || player.isDead())
return false;
Item item = player.getInventory().getItem(slotId);
if (item == null || item.getId() != itemId)
return false;
if (item.getDefinitions().isNoted()) {
player.getPackets().sendGameMessage("You can't wear that.");
return true;
}[/code]

Share this post


Link to post
Share on other sites
Sign in to follow this  

×