public void Modify(DropModificationContext context)
        {
            EpicLootItemConfiguration config = GetConfig(context.Template);

            if (config is null)
            {
#if DEBUG
                Log.LogDebug("Found no config for drop template.");
#endif
                return;
            }

            ItemDrop itemDrop = context.ItemDrop;

            if (itemDrop is null)
            {
                return;
            }

#if DEBUG
            Log.LogDebug("Adding magic modifiers.");
#endif

            var magicItemData = ItemRoller.Roll(
                itemDrop.m_itemData,
                context.Drop.transform.position,
                config);

            if (magicItemData is not null)
            {
                itemDrop.m_itemData = magicItemData;
            }
        }
        public void Modify(ref ItemDrop.ItemData drop, DropTemplate template, Vector3 position)
        {
            EpicLootItemConfiguration config = GetConfig(template);

            if (config is null)
            {
#if DEBUG
                Log.LogDebug("Found no config for drop template.");
#endif

                return;
            }

            if (drop is null)
            {
                return;
            }

#if DEBUG
            Log.LogDebug("Adding magic modifiers.");
#endif

            var magicItemData = ItemRoller.Roll(
                drop,
                position,
                config);

            if (magicItemData is not null)
            {
#if DEBUG
                Log.LogTrace($"Assigning magickified drop '{drop.m_shared.m_name}'.");
#endif
                drop = magicItemData;
            }
        }
Exemple #3
0
 private void Start()
 {
     PopulateSpecific();
     armorClass.gameObject.SetActive(false); // hide the armor class dropdown until it is selected
     UpdatePreview();
     itemRoller      = GetComponent <ItemRoller>();
     playerInventory = FindObjectOfType <Player>().GetInventory();
 }