Suggestion (including some code!) - Only Equippable Items

Categorizes items in your guildbank(s)

Moderator: Mathos

Suggestion (including some code!) - Only Equippable Items

Postby filterban » Wed Feb 07, 2007 11:46 am

My guild has four banker characters, all of whom are nearly 100% full on inventory. That means our bank is very large and unwieldy - people have to sort through all sorts of gear they can't use. You could also filter out items that are far too low level for them.

Categorized Guild Bank is a vast improvement over the regular bank view, and it has a very nice filtering option, but even searching for something like "leather" in CGB can return a lot of pointless results.

My thought is this - provide a drop-down menu containing each char in roster_players. When that character is selected, filter out all items that they can't use or are more than 10 levels lower than them. (Since we have their skills, this would be feasible.)

Also, sorting by item level and instead of the item name would probably help out most people finding what they need.

I've written an untested PHP function that will do what is needed (attached) for weapons and armor. It would be relatively easy to do for recipes as well. Would the developers be interested in including this with the CGB?

If not, is there other demand for this? Should I work on my own plugin?

Code: Select all

// Function takes as input the following:
// 1) Player's level (from roster_players)
// 2) Player's skills (from roster_skills, only Weapon Skills and Armor Proficiences, named array in the format such as:  $playerSkills['Daggers'] = '300:310'
// 3) current item's level (from roster_items)
// 4) current item's tooltip (from roster_items)
// Will return TRUE if player can use the item, FALSE otherwise

function isUsable($playerLevel, $playerSkills, $itemLevel, $itemTooltip) {

   if ($itemLevel > 0 && $itemLevel <= $playerLevel && ($playerLevel - $itemLevel)< 10) {
      // level OK, check for skill in tooltip
      if ($itemTooltip =~ m/(^\w+)\t(\w+$)/) {
         // found a weapon or armor
         $itemDetail = $1;
         $itemType = $2;
         if ($itemType == 'Cloth' || $itemType == 'Leather' || $itemType == 'Mail' || $itemType == 'Plate') {
            // item is armor, skill is same as name (e.g. Cloth)
            $itemSkillRequired = $itemType;
         } else {
            // item is a weapon.  check if it's two handed or not.
            if ($itemDetail == "Two Handed") {
               $itemSkillRequired = "Two Handed ".$itemType."s";
            } else {
               $itemSkillRequired = $itemType."s";
            }
         }
         if ($playerSkills[$itemSkillRequired] =~ /(\d+):(\d+)/) {
            // matches something like 300:310.  $1 contains actual skill.
            if ($1 >= 1)
               return true;
         }
      }
   }
   return false;
}

User avatar
filterban
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Thu Jul 06, 2006 4:16 am

Re: Suggestion (including some code!) - Only Equippable Item

Postby Shaylar » Tue Feb 13, 2007 10:25 am

Hi filterban,

I think this would be a great extension to the guild bank. We already use three characters with full bags, too and it would help a lot to have this option for additional filtering.

If this could be inculded into the addon I'd download a new beta instantly ;)

Thanks a lot,
Shaylar
Shaylar
WR.net Apprentice
WR.net Apprentice
 
Posts: 5
Joined: Sat Jan 06, 2007 1:19 am


Return to Categorized Guild Bank

Who is online

Users browsing this forum: No registered users and 1 guest

cron