Exemple #1
0
        public static CachedACDItem GetTrinityItem(ACDItem item)
        {
            try
            {
                if (!item.IsValid)
                {
                    return(default(CachedACDItem));
                }

                CachedACDItem cItem = new CachedACDItem(item.Stats)
                {
                    AcdItem           = item,
                    InternalName      = item.InternalName,
                    RealName          = item.Name,
                    Level             = item.Level,
                    Quality           = item.GetItemQuality(),
                    GoldAmount        = item.Gold,
                    BalanceId         = item.GameBalanceId,
                    DynamicId         = item.AnnId,
                    ActorSnoId        = item.ActorSnoId,
                    OneHanded         = item.IsOneHand,
                    TwoHanded         = item.IsTwoHand,
                    DyeType           = item.DyeType,
                    ItemType          = item.GetItemType(),
                    BaseType          = item.ItemBaseType,
                    FollowerType      = item.FollowerSpecialType,
                    IsUnidentified    = item.IsUnidentified,
                    ItemStackQuantity = item.ItemStackQuantity,
                    InventoryRow      = item.InventoryRow,
                    InventoryColumn   = item.InventoryColumn,
                    ItemLink          = item.ItemLink,
                    GameBalanceId     = item.GameBalanceId,
                    TrinityItemType   = TypeConversions.DetermineItemType(item.InternalName, item.GetItemType(), item.FollowerSpecialType),
                    IsAncient         = item.GetAttribute <int>(ActorAttributeType.AncientRank) > 0,
                    InventorySlot     = item.InventorySlot,
                };

                TrinityItemBaseType trinityItemBaseType = TypeConversions
                                                          .GetTrinityItemBaseType(
                    TypeConversions.DetermineItemType(
                        item.InternalName,
                        item.GetItemType(),
                        item.FollowerSpecialType));

                cItem.TrinityItemBaseType = trinityItemBaseType;
                cItem.IsEquipment         = GetIsEquipment(trinityItemBaseType);
                cItem.IsSalvageable       = GetIsSalvageable(cItem);
                cItem.IsClassItem         = GetIsClassItem(cItem);
                cItem.IsOffHand           = GetIsOffhand(cItem);
                return(cItem);
            }
            catch (Exception ex)
            {
                Core.Logger.Error("Error getting TrinityItem {0}", ex.Message);
                return(default(CachedACDItem));
            }
        }
Exemple #2
0
        internal static void DumpItemSNOReference()
        {
            string[] names  = Enum.GetNames(typeof(SNOActor));
            int[]    values = (int[])Enum.GetValues(typeof(SNOActor));
            var      toLog  = new List <string>();

            for (int i = 0; i < names.Length; i++)
            {
                var sno  = values[i];
                var name = names[i];
                var type = TypeConversions.DetermineItemType(name, ItemType.Unknown);
                if (type != TrinityItemType.Unknown || GameData.GoldSNO.Contains(sno) ||
                    GameData.ForceToItemOverrideIds.Contains(sno) || GameData.HealthGlobeSNO.Contains(sno) || Legendary.ItemIds.Contains(sno))
                {
                    toLog.Add($"{{ {sno}, TrinityItemType.{type} }}, // {name}");
                }
            }

            var path = WriteLinesToLog("ItemSNOReference.log", toLog, true);

            Core.Logger.Log("Finished Dumping Item SNO Reference to {0}", path);
        }
Exemple #3
0
 public static TrinityItemType GetTrinityItemType(this ACDItem item)
 {
     return(TypeConversions.DetermineItemType(item.InternalName, item.ItemType));
 }