Thread: suggestion for improvement...

Results 1 to 4 of 4
  1. #1 suggestion for improvement... 
    Registered Member
    Serenity's Avatar
    Join Date
    Oct 2008
    Age
    32
    Posts
    2,327
    Thanks given
    43
    Thanks received
    43
    Rep Power
    389
    Spoiler for EquipmentDefinition:
    Code:
    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. ]

    Reply With Quote  
     

  2. #2  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    29
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    Looks great. Not hard to do, but most servers don't have this. (Or all of this...)
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    X Mercy X's Avatar
    Join Date
    May 2009
    Age
    28
    Posts
    1,336
    Thanks given
    3
    Thanks received
    41
    Rep Power
    301
    nice you showed me these on msn theyre not difficult to do but usefull

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Registered Member
    Serenity's Avatar
    Join Date
    Oct 2008
    Age
    32
    Posts
    2,327
    Thanks given
    43
    Thanks received
    43
    Rep Power
    389
    it aint hard i know but i was wondering if i mist something.. cause i dont wanna redo it when im done... (except grounditems havent done those yet.)

    this will be my itemManager so any suggestions on improvement would be nice.
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]

    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •