Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        private void fillPickupDic(int dynamicID, ItemType itemtype, string name, string internalname, ItemQuality quality, int level, bool onehanded, bool twohanded, int balanceid)
        {
            object result;

            itemDic = new Dictionary <string, object>();

            // add log unique key
            itemDic.Add("[KEY]", dynamicID.ToString());

            // - BASETYPE ---------------------------------------------------------//
            itemDic.Add("[BASETYPE]", itemtype.ToString());

            // - TYPE -------------------------------------------------------------//
            /// TODO remove this check if it isnt necessary anymore
            if (itemtype == ItemType.Unknown && (name.Contains("Plan") || name.Contains("Design")))
            {
                FunkyTownRunPlugin.DBLog.InfoFormat("There are still buggy itemType infos for craftingPlan around {0} has itemType = {1}", name, itemtype);
                result = ItemType.CraftingPlan.ToString();
            }
            else
            {
                result = itemtype.ToString();
            }
            itemDic.Add("[TYPE]", result);

            // - QUALITY -------------------------------------------------------//
            itemDic.Add("[QUALITY]", Regex.Replace(quality.ToString(), @"[\d-]", string.Empty));
            itemDic.Add("[D3QUALITY]", quality.ToString());

            // - ROLL ----------------------------------------------------------//
            float roll;

            if (float.TryParse(Regex.Replace(quality.ToString(), @"[^\d]", string.Empty), out roll))
            {
                itemDic.Add("[ROLL]", roll);
            }
            else
            {
                itemDic.Add("[ROLL]", 0f);
            }

            // - NAME -------------------------------------------------------------//
            itemDic.Add("[NAME]", name.ToString().Replace(" ", ""));

            // - LEVEL ------------------------------------------------------------//
            itemDic.Add("[LEVEL]", (float)level);
            itemDic.Add("[ONEHAND]", onehanded);
            itemDic.Add("[TWOHAND]", twohanded);
            itemDic.Add("[UNIDENT]", (bool)true);
            itemDic.Add("[INTNAME]", internalname);
            itemDic.Add("[ITEMID]", balanceid.ToString());
        }
Exemple #2
0
 public override void WriteXml(XmlWriter writer)
 {
     writer.WriteAttributeString("ActionType", ActionType.ToString());
     writer.WriteAttributeString("ItemTarget", ItemTarget.ToString());
     writer.WriteAttributeString("ItemQuality", ItemQuality.ToString());
     writer.WriteAttributeString("ItemId", ItemId.ToString());
 }
Exemple #3
0
 public QualityRow(ItemQuality quality)
 {
     Quality = quality;
     Name = quality.ToString();
 }
Exemple #4
0
 /// <summary>Get the quality name.</summary>
 /// <param name="current">The quality.</param>
 public static string GetName(this ItemQuality current)
 {
     return(current.ToString().ToLower());
 }
Exemple #5
0
        public string Details()
        {
            StringBuilder buffer = new StringBuilder(string.Empty);

            if (IsVowel())
            {
                buffer.Append("An ");
                buffer.Append(Name);
            }
            else
            {
                buffer.Append("A ");
                buffer.Append(Name);
            }
            buffer.Append("=");
            buffer.Append("=");
            switch (Type)
            {
            case ItemType.Weapon:
                buffer.Append("A robust weapon, enough to make a sizable dent in your foes.");
                buffer.Append("=");
                buffer.Append("It is of ");
                buffer.Append(quality.ToString());
                buffer.Append(" quality.");
                buffer.Append("=");
                buffer.Append("=");
                buffer.Append("It provides the following bonus to attack:");
                buffer.Append("=");
                buffer.Append("Attack Bonus: ");
                buffer.Append(attackBonus.ToString());
                buffer.Append("=");
                buffer.Append("=");
                if (bodyBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Body by ");
                    buffer.Append(bodyBonus.ToString());
                    buffer.Append("=");
                }
                if (mindBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Mind by ");
                    buffer.Append(mindBonus.ToString());
                    buffer.Append("=");
                }
                if (finesseBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Finesse by ");
                    buffer.Append(finesseBonus.ToString());
                    buffer.Append("=");
                }
                break;

            case ItemType.Armour:
                buffer.Append("A full set of solid armor, enough to protect your entire body.");
                buffer.Append("=");
                buffer.Append("It is of ");
                buffer.Append(quality.ToString());
                buffer.Append(" quality.");
                buffer.Append("=");
                buffer.Append("=");
                buffer.Append("It provides the following protection:");
                buffer.Append("=");
                buffer.Append("Defense Bonus: ");
                buffer.Append(defenseBonus.ToString());
                buffer.Append("=");
                buffer.Append("=");
                if (bodyBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Body by ");
                    buffer.Append(bodyBonus.ToString());
                    buffer.Append("=");
                }
                if (mindBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Mind by ");
                    buffer.Append(mindBonus.ToString());
                    buffer.Append("=");
                }
                if (finesseBonus > 0)
                {
                    buffer.Append("Wearing it also increases your Finesse by ");
                    buffer.Append(finesseBonus.ToString());
                    buffer.Append("=");
                }
                break;

            case ItemType.Potion:
                buffer.Append("A stoppered glass vial containing a glowing liquid.");
                buffer.Append("=");
                buffer.Append("Drinking it will result in a");
                buffer.Append(PotionType.ToString());
                buffer.Append(" spell being cast upon you.");
                buffer.Append("=");
                buffer.Append("=");
                buffer.Append("There is only enough liquid for one dose.");
                break;

            case ItemType.Scroll:
                buffer.Append("A piece of paper containing the");
                buffer.Append(ScrollType.ToString());
                buffer.Append(" spell written on it in glyphs.");
                buffer.Append("=");
                buffer.Append("This item can only be used once, and then the glyphs will magically disappear.");
                break;

            case ItemType.Wand:
                buffer.Append("A wooden wand containing the ");
                buffer.Append(WandType.ToString());
                buffer.Append(" spell.");
                buffer.Append("=");
                buffer.Append("It currently has ");
                buffer.Append(charges.ToString());
                buffer.Append(" stored.");
                break;

            case ItemType.Corpse:
                buffer.Append("A frozen corpse of a long-dead traveller.");
                break;
            }
            return(buffer.ToString());
        }
        /// <summary>
        /// 
        /// </summary>
        private void fillPickupDic(int dynamicID, ItemType itemtype, string name, string internalname, ItemQuality quality, int level, bool onehanded, bool twohanded, int balanceid)
        {
            object result;
              itemDic = new Dictionary<string, object>();

              // add log unique key
              itemDic.Add("[KEY]", dynamicID.ToString());

              // - BASETYPE ---------------------------------------------------------//
              itemDic.Add("[BASETYPE]", itemtype.ToString());

              // - TYPE -------------------------------------------------------------//
              /// TODO remove this check if it isnt necessary anymore
              if (itemtype == ItemType.Unknown && (name.Contains("Plan") || name.Contains("Design")))
              {
                  FunkyTownRunPlugin.DBLog.InfoFormat("There are still buggy itemType infos for craftingPlan around {0} has itemType = {1}", name, itemtype);
                  result = ItemType.CraftingPlan.ToString();
              }
              else result = itemtype.ToString();
              itemDic.Add("[TYPE]", result);

              // - QUALITY -------------------------------------------------------//
              itemDic.Add("[QUALITY]", Regex.Replace(quality.ToString(), @"[\d-]", string.Empty));
              itemDic.Add("[D3QUALITY]", quality.ToString());

              // - ROLL ----------------------------------------------------------//
              float roll;
              if (float.TryParse(Regex.Replace(quality.ToString(), @"[^\d]", string.Empty), out roll))
                  itemDic.Add("[ROLL]", roll);
              else
                  itemDic.Add("[ROLL]", 0f);

              // - NAME -------------------------------------------------------------//
              itemDic.Add("[NAME]", name.ToString().Replace(" ", ""));

              // - LEVEL ------------------------------------------------------------//
              itemDic.Add("[LEVEL]", (float)level);
              itemDic.Add("[ONEHAND]", onehanded);
              itemDic.Add("[TWOHAND]", twohanded);
              itemDic.Add("[UNIDENT]", (bool)true);
              itemDic.Add("[INTNAME]",internalname);
              itemDic.Add("[ITEMID]", balanceid.ToString());
        }
Exemple #7
0
 public void SetQuality(ItemQuality modQuality)
 {
     Quality = modQuality;
     OnQualityChange();
     Debug.Log("Item Quality set to " + Quality.ToString());
 }
Exemple #8
0
        public static string ParseGroup(ItemQuality color, string icon)
        {
            string itemName = icon;

            switch (true)
            {
            /* KINAH */
            case true when itemName.Contains("item_qina"):
                itemName = "KINAH";

                break;

            /* ARMORS */
            case true when itemName.Contains("item_ch_torso"):
            case true when itemName.Contains("item_ch_pants"):
            case true when itemName.Contains("item_ch_shoulder"):
            case true when itemName.Contains("item_ch_glove"):
            case true when itemName.Contains("item_ch_shoes"):
            case true when itemName.Contains("item_lt_torso"):
            case true when itemName.Contains("item_lt_pants"):
            case true when itemName.Contains("item_lt_shoulder"):
            case true when itemName.Contains("item_lt_glove"):
            case true when itemName.Contains("item_lt_shoes"):
            case true when itemName.Contains("item_pl_torso"):
            case true when itemName.Contains("item_pl_pants"):
            case true when itemName.Contains("item_pl_shoulder"):
            case true when itemName.Contains("item_pl_glove"):
            case true when itemName.Contains("item_pl_shoes"):
            case true when itemName.Contains("item_rb_torso"):
            case true when itemName.Contains("item_rb_pants"):
            case true when itemName.Contains("item_rb_shoulder"):
            case true when itemName.Contains("item_rb_glove"):
            case true when itemName.Contains("item_rb_shoes"):
                itemName = "ARMOR";

                break;

            /* WEAPONS */
            case true when itemName.Contains("item_2hsword"):
            case true when itemName.Contains("item_book"):
            case true when itemName.Contains("item_bow"):
            case true when itemName.Contains("item_dagger"):
            case true when itemName.Contains("item_cannon"):
            case true when itemName.Contains("item_gun"):
            case true when itemName.Contains("item_harp"):
            case true when itemName.Contains("item_keyblade"):
            case true when itemName.Contains("item_mace"):
            case true when itemName.Contains("item_orb"):
            case true when itemName.Contains("item_polearm"):
            case true when itemName.Contains("item_shield"):
            case true when itemName.Contains("item_staff"):
            case true when itemName.Contains("item_sword"):
                itemName = "WEAPON";

                break;

            /* ACCESSORY */
            case true when itemName.Contains("item_ac_head"):
            case true when itemName.Contains("item_ch_head"):
            case true when itemName.Contains("item_rb_head"):
            case true when itemName.Contains("item_pl_head"):
            case true when itemName.Contains("item_lt_head"):
            case true when itemName.Contains("item_belt"):
            case true when itemName.Contains("item_ring"):
            case true when itemName.Contains("item_necklace"):
            case true when itemName.Contains("item_feather"):
            case true when itemName.Contains("item_earring"):
            case true when itemName.Contains("item_tshirt"):
            case true when itemName.Contains("item_bracelet"):
                itemName = "ACCESSORY";

                break;

            /* CONSUMABLE */
            case true when itemName.Contains("item_potion"): itemName = "POTION"; break;

            case true when itemName.Contains("item_dish"): itemName = "FOOD"; break;

            case true when itemName.Contains("item_scroll"): itemName = "SCROLL"; break;

            case true when itemName.Contains("item_estima_enchant"): itemName = "ESTIMA_ENCHANT"; break;

            case true when itemName.Contains("item_enchant"): itemName = "ENCHANT"; break;

            case true when itemName.Contains("item_2stenchant"): itemName = "ENCHANT"; break;

            case true when itemName.Contains("item_polish"): itemName = "IDIAN"; break;

            case true when itemName.Contains("magicstone"): itemName = "MANASTONE"; break;

            case true when itemName.Contains("holystone"): itemName = "GODSTONE"; break;

            case true when itemName.Contains("item_sack"): itemName = "BAG"; break;

            /* CRAFTING */
            case true when itemName.Contains("crystalball"):
                itemName = "FLUX";

                break;

            case true when itemName.Contains("item_dragonhorn"):
            case true when itemName.Contains("item_dragonscale"):
            case true when itemName.Contains("item_dragonhide"):
            case true when itemName.Contains("item_mucus"):
            case true when itemName.Contains("item_heart"):
                itemName = "CRAFTING";

                break;
            }

            // If this item doesn't have any group defined, group it by color quality
            if (itemName == icon)
            {
                return(color.ToString());
            }

            if (itemName == "ARMOR" || itemName == "WEAPON" || itemName == "ACCESSORY")
            {
                return(color + "_" + itemName);
            }
            return(itemName);
        }
Exemple #9
0
 public QualityRow(ItemQuality quality)
 {
     Quality = quality;
     Name    = quality.ToString();
 }