예제 #1
0
        public static List <Dye> GetAllDyes(DyeType dt)
        {
            try
            {
                using (SQLiteConnection conn = new SQLiteConnection("Data Source=" + m_filePath))
                {
                    conn.Open();
                    SQLiteCommand cmd = conn.CreateCommand();
                    cmd.CommandText = "SELECT * FROM [" + m_tableName + "] where DyeType = @DyeType;";
                    cmd.Parameters.Add(new SQLiteParameter("DyeType", dt));

                    SQLiteDataReader dr   = cmd.ExecuteReader();
                    List <Dye>       dyes = new List <Dye>();
                    while (dr.Read())
                    {
                        Dye d = new Dye(dr.GetString(0), (DyeType)dr.GetInt32(1), dr.GetString(2), dr.GetInt32(3));
                        dyes.Add(d);
                    }

                    return(dyes);
                }
            }
            catch (Exception)
            {
                return(null);
            }
        }
예제 #2
0
        public static List <string> GetNamesByType(DyeType dt)
        {
            try
            {
                using (SQLiteConnection conn = new SQLiteConnection("Data Source=" + m_filePath))
                {
                    conn.Open();
                    SQLiteCommand cmd   = conn.CreateCommand();
                    int           intUT = (int)dt;
                    cmd.CommandText = "SELECT * FROM [" + m_tableName + "] where DyeType=" + intUT.ToString() + ";";

                    SQLiteDataReader dr       = cmd.ExecuteReader();
                    List <string>    dyeCodes = new List <string>();
                    while (dr.Read())
                    {
                        Dye d = new Dye(dr.GetString(0), (DyeType)dr.GetInt32(1), dr.GetString(2), dr.GetInt32(3));
                        dyeCodes.Add(d.DyeCode);
                    }

                    return(dyeCodes);
                }
            }
            catch (Exception)
            {
                return(null);
            }
        }
예제 #3
0
        public DyeForm(DyeType dt)
        {
            InitializeComponent();

            switch (dt)
            {
            case DyeType.DYE:
                this.Text           = "染料设置";
                this.labelCode.Text = "染料代号:";
                this.labelName.Text = "染料名称:";

                this.labelValve.Hide();
                this.textBoxValve.Hide();

                m_DyeType = DyeType.DYE;
                break;

            case DyeType.AUXILIARY:
                this.Text           = "助剂设置";
                this.labelCode.Text = "助剂代号:";
                this.labelName.Text = "助剂名称:";


                this.labelValve.Show();
                this.textBoxValve.Show();

                m_DyeType = DyeType.AUXILIARY;
                break;

            default:
                break;
            }
        }
예제 #4
0
 public static ItemState Dye(DyeType type = DyeType.InkSac)
 {
     return(new ItemState
     {
         Id = (uint)ItemId.WhiteDye, // TODO: more kinds of dye
         MetaValue = (uint)type
     });
 }
예제 #5
0
 public static ItemState Dye(DyeType type = DyeType.InkSac)
 {
     return(new ItemState
     {
         Id = (uint)ItemId.Dye,
         MetaValue = (uint)type
     });
 }
예제 #6
0
        public SpecialNaturalDye(DyeType type, bool booksonly)
            : base(0x182B)
        {
            Weight        = 1.0;
            DyeType       = type;
            UsesRemaining = 5;

            BooksOnly = booksonly;
        }
예제 #7
0
        public Dye(List <TableElement> elements)
        {
            m_dyeCode  = (string)elements[0].Value;
            m_dyeType  = (DyeType)(Convert.ToInt32(elements[1].Value));
            m_dyeName  = (string)elements[2].Value;
            m_dyeValve = Convert.ToInt32(elements[3].Value);

            m_elements = elements;
        }
예제 #8
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_DyeType       = (DyeType)reader.ReadInt();
            m_UsesRemaining = reader.ReadInt();
            m_BooksOnly     = reader.ReadBool();
        }
예제 #9
0
    public static Color GetDyeColor(DyeType t)
    {
        DyePattern p;

        if (!DyePallette.TryGetValue(t, out p))
        {
            return(Color.black);
        }

        return(Random.ColorHSV(p.hueMin, p.hueMax, p.satMin, p.satMax, p.valMin, p.valMax));
    }
예제 #10
0
        public static List <Dye> GetAllRecords(DyeType dt)
        {
            List <Dye> dyes    = GetAllRecords();
            List <Dye> newDyes = new List <Dye>();

            foreach (Dye d in dyes)
            {
                if (d.DyeType == dt)
                {
                    newDyes.Add(d);
                }
            }

            return(newDyes);
        }
예제 #11
0
        public Dye(string dyeCode, DyeType dt, string dyeName, int dyeValve)
        {
            m_dyeCode  = dyeCode;
            m_dyeType  = dt;
            m_dyeName  = dyeName;
            m_dyeValve = dyeValve;

            TableElement t1 = new TableElement("DyeCode", dyeCode);
            TableElement t2 = new TableElement("DyeType", dt);
            TableElement t3 = new TableElement("DyeName", dyeName);
            TableElement t4 = new TableElement("DyeValve", dyeValve);

            m_elements = new List <TableElement>();
            m_elements.Add(t1);
            m_elements.Add(t2);
            m_elements.Add(t3);
            m_elements.Add(t4);
        }
예제 #12
0
 public static bool DeleteAll(DyeType dt)
 {
     try
     {
         using (SQLiteConnection conn = new SQLiteConnection("Data Source=" + m_filePath))
         {
             conn.Open();
             SQLiteCommand cmd = conn.CreateCommand();
             cmd.CommandText = "delete from [" + m_tableName + "] where DyeType = @DyeType;";
             cmd.Parameters.Add(new SQLiteParameter("DyeType", dt));
             int i = cmd.ExecuteNonQuery();
             return(i == 1);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #13
0
        public CacheACDItem(string internalname, string realname, int level, ItemQuality quality, int goldamount, int balanceid, int dynamicid, float dps,
					 bool onehanded, DyeType dyetype, ItemType dbitemtype, FollowerType dbfollowertype, bool unidentified, int stackquantity, ItemStats thesestats, ACDItem item, int row, int col, bool ispotion, int acdguid)
        {
            ThisInternalName=internalname;
                     ThisRealName=realname;
                     ThisLevel=level;
                     ThisQuality=quality;
                     ThisGoldAmount=goldamount;
                     ThisBalanceID=balanceid;
                     ThisDynamicID=dynamicid;

                     ThisOneHanded=onehanded;
                     ThisDyeType=dyetype;
                     ThisDBItemType=dbitemtype;
                     ThisFollowerType=dbfollowertype;
                     IsUnidentified=unidentified;
                     ThisItemStackQuantity=stackquantity;

                     SpiritRegen=thesestats.SpiritRegen;
                     ExperienceBonus=thesestats.ExperienceBonus;
                     Dexterity=thesestats.Dexterity;
                     Intelligence=thesestats.Intelligence;
                     Strength=thesestats.Strength;
                     Vitality=thesestats.Vitality;
                     LifePercent=thesestats.LifePercent;
                     LifeOnHit=thesestats.LifeOnHit;
                     LifeSteal=thesestats.LifeSteal;
                     HealthPerSecond=thesestats.HealthPerSecond;
                     MagicFind=thesestats.MagicFind;
                     GoldFind=thesestats.GoldFind;
                     MovementSpeed=thesestats.MovementSpeed;
                     PickUpRadius=thesestats.PickUpRadius;
                     Sockets=thesestats.Sockets;
                     CritPercent=thesestats.CritPercent;
                     CritDamagePercent=thesestats.CritDamagePercent;
                     AttackSpeedPercent=thesestats.AttackSpeedPercent;
                     MinDamage=thesestats.MinDamage;
                     MaxDamage=thesestats.MaxDamage;
                     BlockChance=thesestats.BlockChance;
                     Thorns=thesestats.Thorns;
                     ResistAll=thesestats.ResistAll;
                     ResistArcane=thesestats.ResistArcane;
                     ResistCold=thesestats.ResistCold;
                     ResistFire=thesestats.ResistFire;
                     ResistHoly=thesestats.ResistHoly;
                     ResistLightning=thesestats.ResistLightning;
                     ResistPhysical=thesestats.ResistPhysical;
                     ResistPoison=thesestats.ResistPoison;
                     WeaponDamagePerSecond=thesestats.WeaponDamagePerSecond;
                     ArmorBonus=thesestats.ArmorBonus;
                     MaxDiscipline=thesestats.MaxDiscipline;
                     MaxMana=thesestats.MaxMana;
                     ArcaneOnCrit=thesestats.ArcaneOnCrit;
                     ManaRegen=thesestats.ManaRegen;
                     GlobeBonus=thesestats.HealthGlobeBonus;

                     ACDItem=item;
                     invRow=row;
                     invCol=col;
                     IsPotion=ispotion;
                     ACDGUID=acdguid;
        }
예제 #14
0
        public CachedACDItem(
            ACDItem acdItem,
            string internalName,
            string realName,
            int level,
            ItemQuality quality,
            int goldAmount,
            int balanceId,
            int dynamicId,
            float dps,
            bool oneHanded,
            bool twoHanded,
            DyeType dyeType,
            ItemType itemType,
            ItemBaseType itembasetype,
            FollowerType followerType,
            bool unidentified,
            int stackQuantity,
            ItemStats itemStats)
        {
            AcdItem           = acdItem;
            InternalName      = internalName;
            RealName          = realName;
            Level             = level;
            Quality           = quality;
            GoldAmount        = goldAmount;
            BalanceID         = balanceId;
            DynamicID         = dynamicId;
            WeaponDPS         = dps;
            OneHanded         = oneHanded;
            TwoHanded         = twoHanded;
            DyeType           = dyeType;
            DBItemType        = itemType;
            DBBaseType        = itembasetype;
            FollowerType      = followerType;
            IsUnidentified    = unidentified;
            ItemStackQuantity = stackQuantity;

            Dexterity                      = itemStats.Dexterity;
            Intelligence                   = itemStats.Intelligence;
            Strength                       = itemStats.Strength;
            Vitality                       = itemStats.Vitality;
            LifePercent                    = itemStats.LifePercent;
            LifeOnHit                      = itemStats.LifeOnHit;
            LifeSteal                      = itemStats.LifeSteal;
            HealthPerSecond                = itemStats.HealthPerSecond;
            MagicFind                      = itemStats.MagicFind;
            GoldFind                       = itemStats.GoldFind;
            MovementSpeed                  = itemStats.MovementSpeed;
            PickUpRadius                   = itemStats.PickUpRadius;
            Sockets                        = itemStats.Sockets;
            CritPercent                    = itemStats.CritPercent;
            CritDamagePercent              = itemStats.CritDamagePercent;
            AttackSpeedPercent             = itemStats.AttackSpeedPercent;
            MinDamage                      = itemStats.MinDamage;
            MaxDamage                      = itemStats.MaxDamage;
            BlockChance                    = itemStats.BlockChance;
            Thorns                         = itemStats.Thorns;
            ResistAll                      = itemStats.ResistAll;
            ResistArcane                   = itemStats.ResistArcane;
            ResistCold                     = itemStats.ResistCold;
            ResistFire                     = itemStats.ResistFire;
            ResistHoly                     = itemStats.ResistHoly;
            ResistLightning                = itemStats.ResistLightning;
            ResistPhysical                 = itemStats.ResistPhysical;
            ResistPoison                   = itemStats.ResistPoison;
            WeaponDamagePerSecond          = itemStats.WeaponDamagePerSecond;
            ArmorBonus                     = itemStats.ArmorBonus;
            MaxDiscipline                  = itemStats.MaxDiscipline;
            MaxMana                        = itemStats.MaxMana;
            ArcaneOnCrit                   = itemStats.ArcaneOnCrit;
            ManaRegen                      = itemStats.ManaRegen;
            GlobeBonus                     = itemStats.HealthGlobeBonus;
            HatredRegen                    = itemStats.HatredRegen;
            MaxFury                        = itemStats.MaxFury;
            SpiritRegen                    = itemStats.SpiritRegen;
            MaxSpirit                      = itemStats.MaxSpirit;
            HealthPerSpiritSpent           = itemStats.HealthPerSpiritSpent;
            MaxArcanePower                 = itemStats.MaxArcanePower;
            DamageReductionPhysicalPercent = itemStats.DamageReductionPhysicalPercent;
            ArmorTotal                     = itemStats.ArmorTotal;
            Armor = itemStats.Armor;
            //FireDamagePercent = itemStats.FireDamagePercent;
            //LightningDamagePercent = itemStats.LightningDamagePercent;
            //ColdDamagePercent = itemStats.ColdDamagePercent;
            //PoisonDamagePercent = itemStats.PoisonDamagePercent;
            //ArcaneDamagePercent = itemStats.ArcaneDamagePercent;
            //HolyDamagePercent = itemStats.HolyDamagePercent;
            HealthGlobeBonus       = itemStats.HealthGlobeBonus;
            WeaponAttacksPerSecond = itemStats.WeaponAttacksPerSecond;
            WeaponMaxDamage        = itemStats.WeaponMaxDamage;
            WeaponMinDamage        = itemStats.WeaponMinDamage;

            TrinityItemType     = Trinity.DetermineItemType(internalName, itemType, followerType);
            TrinityItemBaseType = Trinity.DetermineBaseType(TrinityItemType);

            ComputeUpgrade();
        }
예제 #15
0
        public static bool DeleteAll(DyeType dt)
        {
            TableElement te = new TableElement("DyeType", dt);

            return(m_db.ClearRecord(te));
        }
예제 #16
0
 public DyeItem(DyeType type)
 {
     Type = type;
 }
예제 #17
0
        public CacheACDItem(ACDItem item)
        {
            ACDItem          = item;
            SNO              = item.ActorSNO;
            ThisInternalName = item.InternalName;

            try
            {
                _thisLevel = item.Level;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item level for {0} \r\n {1}", SimpleDebugString, ex.Message);
            }


            ItemDataEntry itemEntry;

            if (TheCache.ObjectIDCache.ItemDataEntries.TryGetValue(SNO, out itemEntry))
            {
                ItemType          = itemEntry.ItemType;
                ThisDBItemType    = ItemFunc.PluginItemTypeToDBItemType(ItemType);
                ThisFollowerType  = ItemFunc.ReturnFollowerType(ItemType);
                LegendaryItemType = itemEntry.LegendaryType;
            }
            else
            {
                ThisFollowerType = item.FollowerSpecialType;
                ThisDBItemType   = item.ItemType;
                ItemType         = ItemFunc.DetermineItemType(ThisInternalName, ThisDBItemType, ThisFollowerType);
            }

            BaseItemType    = ItemFunc.DetermineBaseType(ItemType);
            IsStackableItem = ItemFunc.DetermineIsStackable(ItemType, SNO);
            IsTwoSlot       = !IsStackableItem && ItemFunc.DetermineIsTwoSlot(ItemType);

            //Armor / Jewelery / Weapons / Offhand / Follower Items
            if (BaseItemType == PluginBaseItemTypes.Armor || BaseItemType == PluginBaseItemTypes.Jewelry || BaseItemType == PluginBaseItemTypes.Offhand || BaseItemType == PluginBaseItemTypes.WeaponOneHand || BaseItemType == PluginBaseItemTypes.WeaponRange || BaseItemType == PluginBaseItemTypes.WeaponTwoHand || BaseItemType == PluginBaseItemTypes.FollowerItem)
            {
                if (BaseItemType == PluginBaseItemTypes.WeaponOneHand)
                {
                    ThisOneHanded = true;
                }
                else if (BaseItemType == PluginBaseItemTypes.WeaponTwoHand)
                {
                    TwoHanded = true;
                }


                try
                {
                    ItemStats thesestats = item.Stats;
                    ItemStatString     = thesestats.ToString();
                    ItemStatProperties = new ItemProperties(thesestats);

                    if (ItemStatProperties.Sockets > 0)
                    {
                        SocketsFilled = item.NumSocketsFilled;
                    }
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item stats {0} \r\n {1}", SimpleDebugString, ex.Message);
                }


                #region Durability
                try
                {
                    //Durability
                    DurabilityCurrent = item.CurrentDurability;
                    DurabilityMax     = item.MaxDurability;
                    DurabilityPercent = item.DurabilityPercent;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item durability {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion

                #region ItemQualityLevel
                try
                {
                    _thisQuality = item.ItemQualityLevel;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item quality {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion
            }
            else
            {            //Gem, Misc
                if (ItemType == PluginItemTypes.KeyStone)
                {
                    KeystoneRank = ItemFunc.GetGreaterRiftKeystoneRank(SNO);

                    if (KeystoneRank == -1)
                    {
                        try
                        {
                            KeystoneRank = item.TieredLootRunKeyLevel;
                        }
                        catch (Exception ex)
                        {
                            Logger.DBLog.DebugFormat("Failed to get TieredLootRunKeyLevel for Keystone!{0} \r\n {1}", SimpleDebugString, ex.Message);
                        }
                    }
                }
                else if (BaseItemType == PluginBaseItemTypes.Gem && ItemType == PluginItemTypes.LegendaryGem)
                {
                    try
                    {
                        LegendaryGemRank = item.JewelRank;
                    }
                    catch (Exception ex)
                    {
                        Logger.DBLog.DebugFormat("Failed to get Jewel Rank for Legendary Gem!{0} \r\n {1}", SimpleDebugString, ex.Message);
                    }

                    try
                    {
                        LegendaryGemType = (LegendaryGemTypes)Enum.Parse(typeof(LegendaryGemTypes), SNO.ToString());
                    }
                    catch (Exception)
                    {
                        LegendaryGemType = LegendaryGemTypes.None;
                    }
                }
                else
                {
                    IsPotion = ItemType == PluginItemTypes.HealthPotion || ItemType == PluginItemTypes.LegendaryHealthPotion;
                    if (IsPotion)
                    {
                        PotionType = ItemFunc.ReturnPotionType(SNO);
                    }
                }

                #region DyeType
                try
                {
                    _thisDyeType = item.DyeType;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item dye type {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion

                if (IsStackableItem)
                {
                    #region ItemStackQuantity
                    try
                    {
                        _thisItemStackQuantity = item.ItemStackQuantity;
                    }
                    catch (Exception ex)
                    {
                        Logger.Write(LogLevel.Items, "Failed to retrieve item stack quanity {0} \r\n {1}", SimpleDebugString, ex.Message);
                    }
                    #endregion

                    #region ItemStackMaxQuantity
                    try
                    {
                        _maxstackquanity = item.MaxStackCount;
                    }
                    catch (Exception ex)
                    {
                        Logger.Write(LogLevel.Items, "Failed to retrieve item max stack quanity {0} \r\n {1}", SimpleDebugString, ex.Message);
                    }
                    #endregion
                }
            }


            #region GameBalanceId
            try
            {
                ThisBalanceID = item.GameBalanceId;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item GameBalanceId {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region ACDGuid
            try
            {
                ACDGUID = item.ACDGuid;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item ACDGUID {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region DynamicId
            try
            {
                ThisDynamicID = item.DynamicId;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item DynamicId {0} \r\n {1}", SimpleDebugString, ex.Message);
            }

            #endregion

            #region Name
            try
            {
                _thisRealName = item.Name;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item name {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region Gold
            try
            {
                _thisGoldAmount = item.Gold;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item gold amount {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion


            if (!IsStackableItem)
            {
                #region IsUnidentified
                try
                {
                    _isUnidentified = item.IsUnidentified;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item is identified {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion
            }

            #region IsVendorBought
            try
            {
                _isVendorBought = item.IsVendorBought;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item is vendor bought {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region InventoryRow/Column
            try
            {
                invRow = item.InventoryRow;
                invCol = item.InventoryColumn;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item inventory row/column {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion


            if (itemEntry == null && !_isUnidentified && ItemType != PluginItemTypes.Unknown && _thisRealName != String.Empty)
            {
                if (FunkyBaseExtension.Settings.Debugging.DebuggingData && FunkyBaseExtension.Settings.Debugging.DebuggingDataTypes.HasFlag(DebugDataTypes.Items))
                {
                    ObjectCache.DebuggingData.CheckEntry(this);
                }
            }
        }
예제 #18
0
 public SpecialNaturalDye(DyeType type)
     : this(type, false)
 {
 }
예제 #19
0
        // ***** DetermineItemType - Calculates what kind of item it is from D3 internalnames       *****
        private GilesItemType DetermineItemType(string sThisInternalName, ItemType DBItemType, bool DBOneHanded, DyeType DBDyeType)
        {
            sThisInternalName = sThisInternalName.ToLower();
            if (sThisInternalName.StartsWith("axe_"))
            {
                return(GilesItemType.Axe);
            }
            if (sThisInternalName.StartsWith("ceremonialdagger_"))
            {
                return(GilesItemType.CeremonialKnife);
            }
            if (sThisInternalName.StartsWith("handxbow_"))
            {
                return(GilesItemType.HandCrossbow);
            }
            if (sThisInternalName.StartsWith("dagger_"))
            {
                return(GilesItemType.Dagger);
            }
            if (sThisInternalName.StartsWith("fistweapon_"))
            {
                return(GilesItemType.FistWeapon);
            }
            if (sThisInternalName.StartsWith("mace_"))
            {
                return(GilesItemType.Mace);
            }
            if (sThisInternalName.StartsWith("mightyweapon_1h_"))
            {
                return(GilesItemType.MightyWeapon);
            }
            if (sThisInternalName.StartsWith("spear_"))
            {
                return(GilesItemType.Spear);
            }
            if (sThisInternalName.StartsWith("sword_"))
            {
                return(GilesItemType.Sword);
            }
            if (sThisInternalName.StartsWith("wand_"))
            {
                return(GilesItemType.Wand);
            }
            if (sThisInternalName.StartsWith("twohandedaxe_"))
            {
                return(GilesItemType.TwoHandAxe);
            }
            if (sThisInternalName.StartsWith("bow_"))
            {
                return(GilesItemType.TwoHandBow);
            }
            if (sThisInternalName.StartsWith("combatstaff_"))
            {
                return(GilesItemType.TwoHandDaibo);
            }
            if (sThisInternalName.StartsWith("xbow_"))
            {
                return(GilesItemType.TwoHandCrossbow);
            }
            if (sThisInternalName.StartsWith("twohandedmace_"))
            {
                return(GilesItemType.TwoHandMace);
            }
            if (sThisInternalName.StartsWith("mightyweapon_2h_"))
            {
                return(GilesItemType.TwoHandMighty);
            }
            if (sThisInternalName.StartsWith("polearm_"))
            {
                return(GilesItemType.TwoHandPolearm);
            }
            if (sThisInternalName.StartsWith("staff_"))
            {
                return(GilesItemType.TwoHandStaff);
            }
            if (sThisInternalName.StartsWith("twohandedsword_"))
            {
                return(GilesItemType.TwoHandSword);
            }
            if (sThisInternalName.StartsWith("staffofcow"))
            {
                return(GilesItemType.StaffOfHerding);
            }
            if (sThisInternalName.StartsWith("mojo_"))
            {
                return(GilesItemType.Mojo);
            }
            if (sThisInternalName.StartsWith("orb_"))
            {
                return(GilesItemType.Source);
            }
            if (sThisInternalName.StartsWith("quiver_"))
            {
                return(GilesItemType.Quiver);
            }
            if (sThisInternalName.StartsWith("shield_"))
            {
                return(GilesItemType.Shield);
            }
            if (sThisInternalName.StartsWith("amulet_"))
            {
                return(GilesItemType.Amulet);
            }
            if (sThisInternalName.StartsWith("ring_"))
            {
                return(GilesItemType.Ring);
            }
            if (sThisInternalName.StartsWith("boots_"))
            {
                return(GilesItemType.Boots);
            }
            if (sThisInternalName.StartsWith("bracers_"))
            {
                return(GilesItemType.Bracers);
            }
            if (sThisInternalName.StartsWith("cloak_"))
            {
                return(GilesItemType.Cloak);
            }
            if (sThisInternalName.StartsWith("gloves_"))
            {
                return(GilesItemType.Gloves);
            }
            if (sThisInternalName.StartsWith("pants_"))
            {
                return(GilesItemType.Pants);
            }
            if (sThisInternalName.StartsWith("barbbelt_"))
            {
                return(GilesItemType.MightyBelt);
            }
            if (sThisInternalName.StartsWith("shoulderpads_"))
            {
                return(GilesItemType.Shoulders);
            }
            if (sThisInternalName.StartsWith("spiritstone_"))
            {
                return(GilesItemType.SpiritStone);
            }
            if (sThisInternalName.StartsWith("voodoomask_"))
            {
                return(GilesItemType.VoodooMask);
            }
            if (sThisInternalName.StartsWith("wizardhat_"))
            {
                return(GilesItemType.WizardHat);
            }
            if (sThisInternalName.StartsWith("lore_book_"))
            {
                return(GilesItemType.LoreBook);
            }
            if (sThisInternalName.StartsWith("ruby_"))
            {
                return(GilesItemType.Ruby);
            }
            if (sThisInternalName.StartsWith("emerald_"))
            {
                return(GilesItemType.Emerald);
            }
            if (sThisInternalName.StartsWith("topaz_"))
            {
                return(GilesItemType.Topaz);
            }
            if (sThisInternalName.StartsWith("amethyst"))
            {
                return(GilesItemType.Amethyst);
            }
            if (sThisInternalName.StartsWith("healthpotion_"))
            {
                return(GilesItemType.HealthPotion);
            }
            if (sThisInternalName.StartsWith("followeritem_enchantress_"))
            {
                return(GilesItemType.FollowerEnchantress);
            }
            if (sThisInternalName.StartsWith("followeritem_scoundrel_"))
            {
                return(GilesItemType.FollowerScoundrel);
            }
            if (sThisInternalName.StartsWith("followeritem_templar_"))
            {
                return(GilesItemType.FollowerTemplar);
            }
            if (sThisInternalName.StartsWith("craftingplan_"))
            {
                return(GilesItemType.CraftingPlan);
            }
            if (sThisInternalName.StartsWith("dye_"))
            {
                return(GilesItemType.Dye);
            }
            if (sThisInternalName.StartsWith("a1_"))
            {
                return(GilesItemType.SpecialItem);
            }
            if (sThisInternalName.StartsWith("healthglobe"))
            {
                return(GilesItemType.HealthGlobe);
            }
            // DB doesn't yet have support for all three follower type recognition, treating everything as enchantress for now
            if (sThisInternalName.StartsWith("jewelbox_") && DBItemType == ItemType.FollowerSpecial)
            {
                return(GilesItemType.FollowerEnchantress);
            }

            // Fall back on some DB item type checking
            if (sThisInternalName.StartsWith("crafting_"))
            {
                if (DBItemType == ItemType.CraftingPage)
                {
                    return(GilesItemType.LoreBook);
                }
                return(GilesItemType.CraftingMaterial);
            }

            if (sThisInternalName.StartsWith("chestarmor_"))
            {
                if (DBItemType == ItemType.Cloak)
                {
                    return(GilesItemType.Cloak);
                }
                return(GilesItemType.Chest);
            }
            if (sThisInternalName.StartsWith("helm_"))
            {
                if (DBItemType == ItemType.SpiritStone)
                {
                    return(GilesItemType.SpiritStone);
                }
                if (DBItemType == ItemType.VoodooMask)
                {
                    return(GilesItemType.VoodooMask);
                }
                if (DBItemType == ItemType.WizardHat)
                {
                    return(GilesItemType.WizardHat);
                }
                return(GilesItemType.Helm);
            }
            if (sThisInternalName.StartsWith("helmcloth_"))
            {
                if (DBItemType == ItemType.SpiritStone)
                {
                    return(GilesItemType.SpiritStone);
                }
                if (DBItemType == ItemType.VoodooMask)
                {
                    return(GilesItemType.VoodooMask);
                }
                if (DBItemType == ItemType.WizardHat)
                {
                    return(GilesItemType.WizardHat);
                }
                return(GilesItemType.Helm);
            }
            if (sThisInternalName.StartsWith("belt_"))
            {
                if (DBItemType == ItemType.MightyBelt)
                {
                    return(GilesItemType.MightyBelt);
                }
                return(GilesItemType.Belt);
            }

            return(GilesItemType.Unknown);
        }
예제 #20
0
 public DyeItem(DyeType type)
 {
     Type = type;
 }
예제 #21
0
        public CacheACDItem(ACDItem item)
        {
            ACDItem = item;
            SNO=item.ActorSNO;
            ThisInternalName = item.InternalName;

            try
            {
                _thisLevel = item.Level;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item level for {0} \r\n {1}", SimpleDebugString, ex.Message);
            }

            ItemDataEntry itemEntry;
            if (TheCache.ObjectIDCache.ItemDataEntries.TryGetValue(SNO, out itemEntry))
            {
                ItemType=itemEntry.ItemType;
                ThisDBItemType = ItemFunc.PluginItemTypeToDBItemType(ItemType);
                ThisFollowerType = ItemFunc.ReturnFollowerType(ItemType);
                LegendaryItemType = itemEntry.LegendaryType;
            }
            else
            {
                ThisFollowerType = item.FollowerSpecialType;
                ThisDBItemType = item.ItemType;
                ItemType = ItemFunc.DetermineItemType(ThisInternalName, ThisDBItemType, ThisFollowerType);
            }

            BaseItemType = ItemFunc.DetermineBaseType(ItemType);
            IsStackableItem = ItemFunc.DetermineIsStackable(ItemType, SNO);
            IsTwoSlot = !IsStackableItem && ItemFunc.DetermineIsTwoSlot(ItemType);

            //Armor / Jewelery / Weapons / Offhand / Follower Items
            if (BaseItemType== PluginBaseItemTypes.Armor || BaseItemType== PluginBaseItemTypes.Jewelry || BaseItemType== PluginBaseItemTypes.Offhand || BaseItemType == PluginBaseItemTypes.WeaponOneHand || BaseItemType == PluginBaseItemTypes.WeaponRange || BaseItemType == PluginBaseItemTypes.WeaponTwoHand || BaseItemType == PluginBaseItemTypes.FollowerItem)
            {
                if (BaseItemType == PluginBaseItemTypes.WeaponOneHand)
                    ThisOneHanded = true;
                else if (BaseItemType == PluginBaseItemTypes.WeaponTwoHand)
                    TwoHanded = true;

                try
                {
                    ItemStats thesestats = item.Stats;
                    ItemStatString = thesestats.ToString();
                    ItemStatProperties = new ItemProperties(thesestats);

                    if (ItemStatProperties.Sockets > 0)
                    {
                        SocketsFilled = item.NumSocketsFilled;
                    }
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item stats {0} \r\n {1}", SimpleDebugString, ex.Message);
                }

                #region Durability
                try
                {
                    //Durability
                    DurabilityCurrent = item.CurrentDurability;
                    DurabilityMax = item.MaxDurability;
                    DurabilityPercent = item.DurabilityPercent;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item durability {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion

                #region ItemQualityLevel
                try
                {
                    _thisQuality = item.ItemQualityLevel;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item quality {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion

            }
            else
            {//Gem, Misc

                if (ItemType == PluginItemTypes.KeyStone)
                {
                    KeystoneRank = ItemFunc.GetGreaterRiftKeystoneRank(SNO);

                    if (KeystoneRank == -1)
                    {
                        try
                        {
                            KeystoneRank = item.TieredLootRunKeyLevel;
                        }
                        catch (Exception ex)
                        {
                            Logger.DBLog.DebugFormat("Failed to get TieredLootRunKeyLevel for Keystone!{0} \r\n {1}", SimpleDebugString, ex.Message);
                        }

                    }
                }
                else if (BaseItemType == PluginBaseItemTypes.Gem && ItemType == PluginItemTypes.LegendaryGem)
                {
                    try
                    {
                        LegendaryGemRank = item.JewelRank;
                    }
                    catch (Exception ex)
                    {
                        Logger.DBLog.DebugFormat("Failed to get Jewel Rank for Legendary Gem!{0} \r\n {1}", SimpleDebugString, ex.Message);
                    }

                    try
                    {
                        LegendaryGemType = (LegendaryGemTypes)Enum.Parse(typeof(LegendaryGemTypes), SNO.ToString());
                    }
                    catch (Exception)
                    {
                        LegendaryGemType = LegendaryGemTypes.None;
                    }

                }
                else
                {
                    IsPotion = ItemType == PluginItemTypes.HealthPotion || ItemType == PluginItemTypes.LegendaryHealthPotion;
                    if (IsPotion)
                        PotionType = ItemFunc.ReturnPotionType(SNO);
                }

                #region DyeType
                try
                {
                    _thisDyeType = item.DyeType;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item dye type {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion

                if (IsStackableItem)
                {
                    #region ItemStackQuantity
                    try
                    {
                        _thisItemStackQuantity = item.ItemStackQuantity;
                    }
                    catch (Exception ex)
                    {
                        Logger.Write(LogLevel.Items, "Failed to retrieve item stack quanity {0} \r\n {1}", SimpleDebugString, ex.Message);
                    }
                    #endregion

                    #region ItemStackMaxQuantity
                    try
                    {
                        _maxstackquanity = item.MaxStackCount;
                    }
                    catch (Exception ex)
                    {
                        Logger.Write(LogLevel.Items, "Failed to retrieve item max stack quanity {0} \r\n {1}", SimpleDebugString, ex.Message);
                    }
                    #endregion
                }
            }

            #region GameBalanceId
            try
            {
                ThisBalanceID = item.GameBalanceId;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item GameBalanceId {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region ACDGuid
            try
            {
                ACDGUID = item.ACDGuid;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item ACDGUID {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region DynamicId
            try
            {
                ThisDynamicID = item.DynamicId;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item DynamicId {0} \r\n {1}", SimpleDebugString, ex.Message);
            }

            #endregion

            #region Name
            try
            {
                _thisRealName = item.Name;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item name {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region Gold
            try
            {
                _thisGoldAmount = item.Gold;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item gold amount {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            if (!IsStackableItem)
            {
                #region IsUnidentified
                try
                {
                    _isUnidentified = item.IsUnidentified;
                }
                catch (Exception ex)
                {
                    Logger.Write(LogLevel.Items, "Failed to retrieve item is identified {0} \r\n {1}", SimpleDebugString, ex.Message);
                }
                #endregion
            }

            #region IsVendorBought
            try
            {
                _isVendorBought = item.IsVendorBought;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item is vendor bought {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            #region InventoryRow/Column
            try
            {
               invRow = item.InventoryRow;
               invCol = item.InventoryColumn;
            }
            catch (Exception ex)
            {
                Logger.Write(LogLevel.Items, "Failed to retrieve item inventory row/column {0} \r\n {1}", SimpleDebugString, ex.Message);
            }
            #endregion

            if (itemEntry==null && !_isUnidentified && ItemType!= PluginItemTypes.Unknown && _thisRealName!=String.Empty)
            {
                if (FunkyBaseExtension.Settings.Debugging.DebuggingData && FunkyBaseExtension.Settings.Debugging.DebuggingDataTypes.HasFlag(DebugDataTypes.Items))
                {
                    ObjectCache.DebuggingData.CheckEntry(this);
                }
            }
        }