public static void Postfix(ref string __result, ItemDrop.ItemData item)
        {
            if (item != null && (item.IsMagicCraftingMaterial() || item.IsRunestone()))
            {
                var rarityDisplay = EpicLoot.GetRarityDisplayName(item.GetCraftingMaterialRarity());
                __result = $"<color={item.GetCraftingMaterialRarityColor()}>{rarityDisplay} crafting material\n</color>" + __result;
            }

            if (item != null && !item.IsMagic())
            {
                var text = new StringBuilder();

                // Set stuff
                if (!string.IsNullOrEmpty(item.m_shared.m_setName))
                {
                    // Remove old set stuff
                    var index = __result.IndexOf("\n\n$item_seteffect", StringComparison.InvariantCulture);
                    if (index >= 0)
                    {
                        __result = __result.Remove(index);
                    }

                    // Create new
                    AddSetTooltip(item, text);
                }

                __result += text.ToString();
            }

            __result = __result.Replace("<color=orange>", "<color=lightblue>");
            __result = __result.Replace("<color=yellow>", "<color=lightblue>");
        }
Esempio n. 2
0
        private static string GetLegendaryName(ItemDrop.ItemData item, MagicItem magicItem)
        {
            var allowedNames = GetAllowedNamesFromListAllRequired(Config.Legendary, item, magicItem);
            var name         = GetRandomStringFromList(allowedNames);

            return(string.IsNullOrEmpty(name) ? $"{EpicLoot.GetRarityDisplayName(ItemRarity.Legendary)} {TranslateAndCapitalize(item.m_shared.m_name)}" : name);
        }
Esempio n. 3
0
        public static string GetNameForItem(ItemDrop.ItemData item, MagicItem magicItem)
        {
            var baseName = item.m_shared.m_name;

            if (!EpicLoot.UseGeneratedMagicItemNames.Value || magicItem == null)
            {
                return(null);
            }

            var rarity = magicItem.Rarity;

            switch (rarity)
            {
            case ItemRarity.Magic:
                return($"{EpicLoot.GetRarityDisplayName(ItemRarity.Magic)} {baseName}");

            case ItemRarity.Rare:
                var prefix = GetPrefix(magicItem);
                var suffix = GetSuffix(magicItem);
                return($"{prefix}{TranslateAndCapitalize(baseName)}{suffix}");

            case ItemRarity.Epic:
                return(BuildEpicName(item, magicItem));

            case ItemRarity.Legendary:
                return(GetLegendaryName(item, magicItem));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 4
0
        public static string GetAdjectivePartForItem(ItemDrop.ItemData item, MagicItem magicItem)
        {
            var adjectives    = GetAllowedNamesFromList(Config.Epic.Adjectives, item, magicItem);
            var adjectivePart = GetRandomStringFromList(adjectives);

            return(string.IsNullOrEmpty(adjectivePart) ? EpicLoot.GetRarityDisplayName(ItemRarity.Epic) : adjectivePart);
        }
Esempio n. 5
0
        public string GetRarityDisplay()
        {
            var color = GetColorString();

            return($"<color={color}>{EpicLoot.GetRarityDisplayName(Rarity)}</color>");
        }