package deversity.version508.world.items;
import deversity.version508.util.Constants.*;
/**
* Created by IntelliJ IDEA.
* Author : Serenity
* From : Rune-server.org
* Date : 2-feb-2010
* Time : 13:07:58
* Package : Deversity.rs2.world.items
*/
public class EquipmentDefinition {
private int itemId = 0;
private int equipId = 0;
private equipmentSlot slot;
private int[][] skillRequirements = null;
private int[] bonus = new int[14];
private int crushEmote =0;
private int stabEmote =0;
private int slashEmote =0;
private int blockEmote = 0;
private int attackSpeed = 0;
private boolean isMelee = true;
public int getItemId() {
return itemId;
}
public int getEquipId() {
return equipId;
}
public equipmentSlot getSlot() {
return slot;
}
public int[][] getSkillRequirements() {
return skillRequirements;
}
public int[] getBonus() {
return bonus;
}
public int getCrushEmote() {
return crushEmote;
}
public int getStabEmote() {
return stabEmote;
}
public int getSlashEmote() {
return slashEmote;
}
public int getBlockEmote() {
return blockEmote;
}
public int getAttackSpeed() {
return attackSpeed;
}
public boolean isMelee() {
return isMelee;
}
public EquipmentDefinition(int itemId, int equipId, equipmentSlot slot, int[][] skillRequirements, int[] bonus,
int crushEmote, int stabEmote, int slashEmote, int blockEmote, int attackSpeed, boolean isMelee) {
this.itemId = itemId;
this.equipId = equipId;
this.slot = slot;
this.skillRequirements = skillRequirements;
this.bonus = bonus;
this.crushEmote = crushEmote;
this.stabEmote = stabEmote;
this.slashEmote = slashEmote;
this.blockEmote = blockEmote;
this.attackSpeed = attackSpeed;
this.isMelee = isMelee;
}
}
Spoiler for GrandExchangePrices:
Code:
package deversity.version508.world.items;
/**
* Created by IntelliJ IDEA.
* Author : Serenity
* From : Rune-server.org
* Date : 2-feb-2010
* Time : 14:11:52
* Package : deversity.version508.world.items
*/
public class GrandExchangePrices {
private int ItemId = 0;
private int lowPrice = 0;
private int midPrice = 1;
private int highPrice = 2;
public GrandExchangePrices(int itemId, int lowPrice, int midPrice, int highPrice) {
ItemId = itemId;
this.lowPrice = lowPrice;
this.midPrice = midPrice;
this.highPrice = highPrice;
}
public int getItemId() {
return ItemId;
}
public int getLowPrice() {
return lowPrice;
}
public int getMidPrice() {
return midPrice;
}
public int getHighPrice() {
return highPrice;
}
}
Spoiler for GroundItem:
Code:
/*
* Class GroundItem
*
* Version 1.0
*
* Tuesday, August 19, 2008
*
* Created by Palidino76
*/
package deversity.version508.world.items;
import deversity.version508.world.Location;
public class GroundItem {
private Item groundItem = new Item(0, 0);
private Location loc = new Location(0, 0, 0);
private String belongsTo = "";
private int itemGroundTime = 240;
private int index;
public GroundItem(int index,Item groundItem, Location loc, String belongsTo) {
this.index = index;
this.groundItem = groundItem;
this.loc = loc;
this.belongsTo = belongsTo;
}
public int getIndex(){
return index;
}
public Item getGroundItem() {
return groundItem;
}
public void setGroundItem(Item groundItem) {
this.groundItem = groundItem;
}
public Location getLoc() {
return loc;
}
public void setLoc(Location loc) {
this.loc = loc;
}
public String getBelongsTo() {
return belongsTo;
}
public void setBelongsTo(String belongsTo) {
this.belongsTo = belongsTo;
}
public int getItemGroundTime() {
return itemGroundTime;
}
public void setItemGroundTime(int itemGroundTime) {
this.itemGroundTime = itemGroundTime;
}
}
Spoiler for Item:
Code:
package deversity.version508.world.items;
/**
* Created by IntelliJ IDEA.
* Author : Serenity
* From : Rune-server.org
* Date : 2-feb-2010
* Time : 13:25:28
* Package : Deversity.rs2.world.items
*/
public class Item {
private int itemId = 0;
private int amount = 1;
public Item(int itemId, int amount) {
this.itemId = itemId;
this.amount = amount;
}
public Item(int itemId) {
this.itemId = itemId;
}
public int getItemId() {
return itemId;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
public ItemDefinition getItemDefinition() {
return ItemMananger.itemDefinitions[itemId];
}
public EquipmentDefinition getEquipmentDefinition() {
return ItemMananger.equipmentDefinition[itemId];
}
public GrandExchangePrices getGrandExchangePrices() {
return ItemMananger.grandExchangePrices[itemId];
}
public static boolean contains(Item[] itemArray, Item item) {
int amount = item.getAmount();
for (Item data : itemArray) {
if (data.getItemId() == item.getItemId()) {
amount -= item.getAmount();
if (amount <= 0)
return true;
}
}
return false;
}
}
Spoiler for ItemDefinition:
Code:
/*
* Class ItemDefinition
*
* Version 1.0
*
* Sunday, August 17, 2008
*
* Created by Palidino76
*/
package deversity.version508.world.items;
public class ItemDefinition {
private int itemId =0;
private String itemName ="";
private String itemExamine = "Item : "+itemId;
private boolean noted;
private boolean stackAble;
private boolean members;
private boolean tradeAble;
private int parentId;
private int noteId;
private int shopValue;
private int lowAlchValue;
private int highAlchValue;
private int weight;
public ItemDefinition(int itemId, String itemName, String itemExamine, boolean noted, boolean stackAble,
boolean members, boolean tradeAble, int parentId, int noteId, int shopValue, int lowAlchValue, int highAlchValue, int weight) {
this.itemId = itemId;
this.itemName = itemName;
this.itemExamine = itemExamine;
this.noted = noted;
this.stackAble = stackAble;
this.members = members;
this.tradeAble = tradeAble;
this.parentId = parentId;
this.noteId = noteId;
this.shopValue = shopValue;
this.lowAlchValue = lowAlchValue;
this.highAlchValue = highAlchValue;
this.weight = weight;
}
public int getItemId() {
return itemId;
}
public String getItemName() {
return itemName;
}
public String getItemExamine() {
return itemExamine;
}
public boolean isNoted() {
return noted;
}
public boolean isStackAble() {
return stackAble;
}
public boolean isMembers() {
return members;
}
public boolean isTradeAble() {
return tradeAble;
}
public int getParentId() {
return parentId;
}
public int getNoteId() {
return noteId;
}
public int getShopValue() {
return shopValue;
}
public int getLowAlchValue() {
return lowAlchValue;
}
public int getHighAlchValue() {
return highAlchValue;
}
public int getWeight() {
return weight;
}
}
is there anything i missed or can be done in a better way? if so please suggest.
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]