コード例 #1
0
        /// <summary>
        /// Determines if we should salvage an item
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private static bool TrinitySalvage(ACDItem item)
        {
            CachedACDItem cItem = CachedACDItem.GetCachedItem(item);

            if (cItem.AcdItem.IsVendorBought)
            {
                return(false);
            }

            // Vanity Items
            if (DataDictionary.VanityItems.Any(i => item.InternalName.StartsWith(i)))
            {
                return(false);
            }

            GItemType     trinityItemType     = Trinity.DetermineItemType(cItem.InternalName, cItem.DBItemType, cItem.FollowerType);
            GItemBaseType trinityItemBaseType = Trinity.DetermineBaseType(trinityItemType);

            // Take Salvage Option corresponding to ItemLevel
            SalvageOption salvageOption = GetSalvageOption(cItem.Quality);

            // Stashing Whites
            if (Trinity.Settings.Loot.TownRun.StashWhites && cItem.Quality < ItemQuality.Magic1)
            {
                return(false);
            }

            // Stashing Blues
            if (Trinity.Settings.Loot.TownRun.StashBlues && cItem.Quality > ItemQuality.Superior && cItem.Quality < ItemQuality.Rare4)
            {
                return(false);
            }

            switch (trinityItemBaseType)
            {
            case GItemBaseType.WeaponRange:
            case GItemBaseType.WeaponOneHand:
            case GItemBaseType.WeaponTwoHand:
            case GItemBaseType.Armor:
            case GItemBaseType.Offhand:
                return(salvageOption == SalvageOption.Salvage);

            case GItemBaseType.Jewelry:
                return(salvageOption == SalvageOption.Salvage);

            case GItemBaseType.FollowerItem:
                return(salvageOption == SalvageOption.Salvage);

            case GItemBaseType.Gem:
            case GItemBaseType.Misc:
            case GItemBaseType.Unknown:
                return(false);

            default:
                return(false);
            }
        }
コード例 #2
0
ファイル: SalvageBag.cs プロジェクト: nogu3ira/xrunuo
            public UseBagEntry(SalvageBag bag, SalvageOption option, int number, bool enabled)
                : base(number)
            {
                m_Bag    = bag;
                m_Option = option;

                if (!enabled)
                {
                    Flags |= CMEFlags.Disabled;
                }
            }
コード例 #3
0
        public bool ShouldSalvageItem(ACDItem item, ItemEvaluationType evaluationType)
        {
            if (ItemManager.Current.ItemIsProtected(item))
            {
                return(false);
            }

            //if (ShouldStashItem(item, evaluationType))
            //    return false;

            GilesCachedACDItem cItem = GilesCachedACDItem.GetCachedItem(item);

            GItemType     trinityItemType     = GilesTrinity.DetermineItemType(cItem.InternalName, cItem.DBItemType, cItem.FollowerType);
            GItemBaseType trinityItemBaseType = GilesTrinity.DetermineBaseType(trinityItemType);

            // Take Salvage Option corresponding to ItemLevel
            SalvageOption salvageOption = GetSalvageOption(cItem.Quality);

            if (cItem.Quality >= ItemQuality.Legendary && salvageOption == SalvageOption.InfernoOnly && cItem.Level >= 60)
            {
                return(true);
            }

            switch (trinityItemBaseType)
            {
            case GItemBaseType.WeaponRange:
            case GItemBaseType.WeaponOneHand:
            case GItemBaseType.WeaponTwoHand:
            case GItemBaseType.Armor:
            case GItemBaseType.Offhand:
                return((cItem.Level >= 61 && salvageOption == SalvageOption.InfernoOnly) || salvageOption == SalvageOption.All);

            case GItemBaseType.Jewelry:
                return((cItem.Level >= 59 && salvageOption == SalvageOption.InfernoOnly) || salvageOption == SalvageOption.All);

            case GItemBaseType.FollowerItem:
                return((cItem.Level >= 60 && salvageOption == SalvageOption.InfernoOnly) || salvageOption == SalvageOption.All);

            case GItemBaseType.Gem:
            case GItemBaseType.Misc:
            case GItemBaseType.Unknown:
                return(false);

            default:
                return(false);
            }
        }
コード例 #4
0
ファイル: SalvageBag.cs プロジェクト: nogu3ira/xrunuo
        public void Use(Mobile from, SalvageOption option)
        {
            if (from.Backpack == null || !this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1062334);                   // This item must be in your backpack to be used.
                return;
            }

            if ((option & SalvageOption.Ingots) != 0)
            {
                SalvageIngots(from);
            }

            if ((option & SalvageOption.Cloth) != 0)
            {
                SalvageCloth(from);
            }
        }
コード例 #5
0
ファイル: SalvageBag.cs プロジェクト: Ravenwolfe/xrunuo
            public UseBagEntry( SalvageBag bag, SalvageOption option, int number, bool enabled )
                : base(number)
            {
                m_Bag = bag;
                m_Option = option;

                if ( !enabled )
                    Flags |= CMEFlags.Disabled;
            }
コード例 #6
0
ファイル: SalvageBag.cs プロジェクト: Ravenwolfe/xrunuo
        public void Use( Mobile from, SalvageOption option )
        {
            if ( from.Backpack == null || !this.IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
                return;
            }

            if ( ( option & SalvageOption.Ingots ) != 0 )
                SalvageIngots( from );

            if ( ( option & SalvageOption.Cloth ) != 0 )
                SalvageCloth( from );
        }