Exemplo n.º 1
0
                public void OnReceived()
                {
                    if (NetworkServer.active)
                    {
                        return;
                    }
                    GameObject obj = Util.FindNetworkObject(objID);

                    if (obj)
                    {
                        MysticsItemsManuscript controller = obj.GetComponent <MysticsItemsManuscript>();
                        if (controller)
                        {
                            controller.RemoveBuff();
                        }
                    }
                }
Exemplo n.º 2
0
        public void Inventory_RemoveItem_ItemIndex_int(On.RoR2.Inventory.orig_RemoveItem_ItemIndex_int orig, Inventory self, ItemIndex itemIndex, int count)
        {
            MysticsItemsManuscript component = self.GetComponent <MysticsItemsManuscript>();

            if (!component)
            {
                component = self.gameObject.AddComponent <MysticsItemsManuscript>();
            }
            orig(self, itemIndex, count);
            if (NetworkServer.active && itemIndex == itemDef.itemIndex)
            {
                for (var i = 0; i < count; i++)
                {
                    component.RemoveBuff();
                }
            }
        }