damageType = item.damageType;
susceptibilities = item.susceptibilities;
}
public static void generateRPClass() {
final RPClass entity = new RPClass("item");
entity.isA("entity");
// class, sword/armor/...
entity.addAttribute("class", Type.STRING);
// subclass, long sword/leather/armor/...
entity.addAttribute("subclass", Type.STRING);
// name of item (ie 'Kings Sword')
entity.addAttribute("name", Type.STRING);
// Some items have attack values
entity.addAttribute("atk", Type.SHORT, Definition.HIDDEN);
// Some items indicate how often you can attack.
entity.addAttribute("rate", Type.SHORT, Definition.HIDDEN);
// Some items have defense values
entity.addAttribute("def", Type.SHORT, Definition.HIDDEN);
//Some items can be damaged in combat or during use. This rises the degree of deterioration
entity.addAttribute("deterioration", Type.INT, (byte) (Definition.HIDDEN | Definition.VOLATILE));
// Some items(food) have amount of something
// (a bottle, a piece of meat).
entity.addAttribute("amount", Type.INT);
// Some items (range weapons, ammunition, missiles)
// have a range.
entity.addAttribute("range", Type.SHORT, Definition.HIDDEN);
// Some items(food) have regeneration
entity.addAttribute("regen", Type.INT, Definition.HIDDEN);
// Some items(food) have regeneration speed
entity.addAttribute("frequency", Type.INT, Definition.HIDDEN);
// Some items(Stackable) have quantity
entity.addAttribute("quantity", Type.INT);
// Some items (Stackable) have maximum quantity
entity.addAttribute("max_quantity", Type.INT, Definition.HIDDEN);
// Some items have minimum level to prevent spoiling
// the fun for new players
entity.addAttribute("min_level", Type.INT, Definition.HIDDEN);
// To store addAttributeitional info with an item
entity.addAttribute("infostring", Type.STRING, Definition.HIDDEN);
// Some items have individual values
entity.addAttribute("persistent", Type.SHORT, Definition.HIDDEN);
// Some items have lifesteal values
entity.addAttribute("lifesteal", Type.FLOAT, Definition.HIDDEN);
// Some items are quest rewards that other players
// don't deserve.
entity.addAttribute("bound", Type.STRING, Definition.HIDDEN);
// Some items should not be dropped on death
entity.addAttribute("undroppableondeath", Type.SHORT, Definition.HIDDEN);
// Unique database ID for logging
entity.addAttribute("logid", Type.INT, Definition.HIDDEN);
// Name of the container slot, if the item has one
entity.addAttribute("slot_name", Type.STRING, (byte) (Definition.HIDDEN | Definition.VOLATILE));
// Container slot
entity.addRPSlot("content", 8, Definition.PRIVATE);
}