public override void OnClick()
 {
     if (backpack == null || !backpack.IsOwner(player))
     {
         return;
     }
     MasterLooterSetupGump.SendGump(player, backpack, 0);
 }
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (from as PlayerMobile == null || backpack == null || backpack.Deleted)
            {
                return;
            }
            if (targeted == null)
            {
                return;
            }
            Type targetType = targeted.GetType();

            if (selection == SELECTION.ITEM_SELECTION)
            {
                if (backpack.isTypeLootable(targetType))
                {
                    from.SendMessage("You already loot that type.");
                }
                else
                {
                    backpack.AddItemType(targetType);
                }
            }
            else if (previousType != null)
            {
                if (previousType == targetType)
                {
                    from.SendMessage("Both items have the same type.");
                    return;
                }
                Type common = findCommonType(targetType, previousType);
                if (common == null)
                {
                    from.SendMessage("The selected items doesn't have a common type.");
                }
                else
                {
                    string typeName = common.ToString();
                    int    dotIndex = typeName.LastIndexOf(".");
                    if (dotIndex >= 0)
                    {
                        typeName = typeName.Substring(dotIndex + 1);
                    }
                    from.SendMessage("You successfully added " + typeName + " to your loot list.");
                    backpack.AddBaseType(common);
                }
            }
            else
            {
                from.Target = new MasterLooterAddTypeTarget(backpack, from as PlayerMobile, selection, targetType);
                return;
            }
            MasterLooterSetupGump.SendGump(from, backpack, -1);
        }