Excluding Items From EquipList

Results 1 to 6 of 6
  1. #1
    TranquilityStory JarrYD is offline
    MemberRank
    Jan 2010 Join Date
    764Posts

    Excluding Items From EquipList

    Cant work it out,
    So this is my equiplist method, but from this, how would I make a certain item or an item with a certain tag not show when this equiplist method is used.

    Code:
    public String EquipList(MapleClient c) {
            StringBuilder str = new StringBuilder();
               MapleInventory equip = c.getPlayer().getInventory(MapleInventoryType.EQUIP);
                    List<String> stra = new LinkedList<String>();
                        for (IItem item : equip.list()) {
                            stra.add("#L"+item.getPosition()+"##v"+item.getItemId()+"##l");
                            }
                        for (String strb : stra) {
                    str.append(strb);
                }
            return str.toString();
        }
    Thanks.


  2. #2
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: Excluding Items From EquipList

    Add a check in

    PHP Code:
    for (IItem item equip.list()) {
                            
    stra.add("#L"+item.getPosition()+"##v"+item.getItemId()+"##l");
                            } 
    SO it become

    PHP Code:
    for (IItem item equip.list()) {
               if(
    item.getItemId() == <forbidden item>) {
                        
    // do nothing
                 
    } else {
                            
    stra.add("#L"+item.getPosition()+"##v"+item.getItemId()+"##l");
                 }


  3. #3
    TranquilityStory JarrYD is offline
    MemberRank
    Jan 2010 Join Date
    764Posts

    Re: Excluding Items From EquipList

    Quote Originally Posted by hecari View Post
    Add a check in

    PHP Code:
    for (IItem item equip.list()) {
                            
    stra.add("#L"+item.getPosition()+"##v"+item.getItemId()+"##l");
                            } 
    SO it become

    PHP Code:
    for (IItem item equip.list()) {
               if(
    item.getItemId() == <forbidden item>) {
                        
    // do nothing
                 
    } else {
                            
    stra.add("#L"+item.getPosition()+"##v"+item.getItemId()+"##l");
                 }

    Augh too easy, thanks.

  4. #4
    Account Upgraded | Title Enabled! StripedCow is offline
    MemberRank
    Jun 2011 Join Date
    813Posts

    Re: Excluding Items From EquipList

    for owner just do item.getOwner().equals(""), you know the drill.

  5. #5
    Account Upgraded | Title Enabled! bbhing98 is offline
    MemberRank
    Jul 2012 Join Date
    314Posts

    Re: Excluding Items From EquipList

    uhh, what bout having it to read certain stat of the equip and only show the equip in the selection if it meets the requirement?
    eg: make it only read equips with potential, make it only read equips with enhancement, make it read item with 0 slot etc

  6. #6
    Account Upgraded | Title Enabled! StripedCow is offline
    MemberRank
    Jun 2011 Join Date
    813Posts

    Re: Excluding Items From EquipList

    Sigh.. everyone's trying to copy ToyStory day by day.

    Code:
        public String EquipListMSI(MapleClient c) {
            StringBuilder str = new StringBuilder();
            MapleInventory equip = c.getPlayer().getInventory(MapleInventoryType.EQUIP);
            List<String> stra = new LinkedList<>();
            for (IItem item : equip.list()) {
                Equip eq = (Equip) MapleItemInformationProvider.getInstance().getEquipById(item.getItemId());
                Equip nEquip = (Equip) item;
                String itemName = MapleItemInformationProvider.getInstance().getName(nEquip.getItemId());
                if (eq.getPotential > amounthere) { // edit this if statement
                    stra.add("#L" + item.getPosition() + "##v" + item.getItemId() + "##l");
                }
            }
            for (String strb : stra) {
                str.append(strb);
            }
            return str.toString();
        }



Advertisement