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>");
        }
Exemple #2
0
 public static bool Prefix(ItemDrop.ItemData item)
 {
     if (item.IsMagicCraftingMaterial())
     {
         var variant = EpicLoot.GetRarityIconIndex(item.GetCraftingMaterialRarity());
         item.m_variant = variant;
     }
     return(true);
 }
Exemple #3
0
        public static ItemRarity GetRarity(this ItemDrop.ItemData itemData)
        {
            if (itemData.IsMagic())
            {
                return(itemData.GetMagicItem().Rarity);
            }
            else if (itemData.IsMagicCraftingMaterial())
            {
                return(itemData.GetCraftingMaterialRarity());
            }
            else if (itemData.IsRunestone())
            {
                return(itemData.GetRunestoneRarity());
            }

            throw new ArgumentException("itemData is not magic item, magic crafting material, or runestone");
        }
Exemple #4
0
 public static ItemRarity GetRunestoneRarity(this ItemDrop.ItemData item)
 {
     return(item.GetCraftingMaterialRarity());
 }
Exemple #5
0
 public static string GetCraftingMaterialRarityColor(this ItemDrop.ItemData item)
 {
     return(EpicLoot.GetRarityColor(item.GetCraftingMaterialRarity()));
 }