Bump > New Thread
|
|
The title says the problem, I've added them to equipment.java, and itemdefinitions.xml. Any ideas? Heres a thread I made on it a while ago. Mostly look at the pic.
[Only registered and activated users can see links. ]
Help please, I've looked through the source files but can't find anything relating to max equip id or anything.
FIXED ITThe issue was that itemDefinitions.XML wasn't being packed into itemDefinitions.DAT, so I added this to GameEngine.java
All taken from itemxmltobinary.java, and then deleted the itemdef.dat file I already had and presto it worked.Code:File itemDefs = new File("data/itemDefinitions.dat"); if(!itemDefs.exists()) { System.out.println("Loading..."); List<ItemDefinition> defs = (List<ItemDefinition>) XStreamUtil.getXStream().fromXML(new FileInputStream("data/itemDefinitions.xml")); System.out.println("Done."); System.gc(); System.out.println("Saving..."); RandomAccessFile raf = new RandomAccessFile(new File("data/itemDefinitions.dat"), "rw"); raf.writeInt(defs.size()); for(ItemDefinition def : defs) { raf.writeShort(def.getId()); raf.writeShort(def.getEquipId()); raf.writeBoolean(def.isNoted()); raf.writeBoolean(def.isStackable()); raf.writeInt(def.getPrice().getNormalPrice()); raf.writeInt(def.getPrice().getMinimumPrice()); raf.writeInt(def.getPrice().getMaximumPrice()); for(int i = 0; i < 13; i++) { raf.writeShort(def.getBonus(i)); } raf.writeBytes(def.getName()); raf.writeByte(0); raf.writeBytes(def.getExamine()); raf.writeByte(0); if(def.getId() % 100 == 0) { System.out.println(def.getId() + "/" + defs.size()); } } raf.close(); System.out.println("Done."); }Just need the equip id for dragon claws now, atm they equip as a d plate
![]()
Item.java equipment.java add the ids![]()
Like I said the ids are in equipment.java. And where do I add them in here?
package com.rs2hd.model;
/**
* Represents a single item.
*
* Immutable.
* @author Graham
*
*/
public class Item {
private int id;
private transient ItemDefinition itemDefinition;
private int amount;
public int getId() {
return id;
}
public Item clone() {
return new Item(id, amount);
}
public Item(int id) {
this.id = id;
this.itemDefinition = ItemDefinition.forId(id);
this.amount = 1;
}
public Item(int id, int amount) {
this.id = id;
this.itemDefinition = ItemDefinition.forId(id);
this.amount = amount;
if(this.amount <= 0) {
this.amount = 1;
}
}
public ItemDefinition getDefinition() {
return itemDefinition;
}
public int getAmount() {
return amount;
}
public Object readResolve() {
this.itemDefinition = ItemDefinition.forId(id);
return this;
}
/**
* ONLY CALL THIS FROM THE SHOPITEM CLASS.
* @param amount
*/
protected void setAmount(int amount) {
this.amount = amount;
}
}
Add into these for example inCode:public class Equipment implements Packet { private String[] capes = {}; private String[] hats = {}; private String[] boots = {}; private String[] gloves = { }; private String[] shields = {}; private String[] amulets = {}; private String[] arrows = {}; private String[] rings = {}; private String[] body = {}; private String[] legs = {}; private String[] weapons = {}; private String[] fullbody = {}; private String[] fullhat = { }; private String[] fullmask = { };Then everything thing with scimtar in its name will be equiped to the weapon slot, Make sure to use comma's aswell.Code:private String[] weapons = {"scimitar"};
Hope this helped.

What is your problem exactly?

I can spawn 525 items like claws, but can't equip them. I spawn them, then click wear and nothing happens. I can equip them by messing around with my characters file, but the don't appear.thats what the problem is, hope that helps you help me.
| « z508 MagicVsNPC. | $5 for help » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |