Esempio n. 1
0
        void TestReplenishableContainer(BasePlayer player, StorageContainer container)
        {
            if (GetReplenishableContainer(container.inventory) == null)
            {
                ReplyPlayer(player, "NotReplenishing");
                return;
            }
            ReplenishableContainer repl = GetReplenishableContainer(container.inventory);

            ReplyFormatted(player, String.Format(Lang("BoxTested"), repl.type, repl.uid, repl.timer));
        }
Esempio n. 2
0
        void OnItemRemovedFromContainer(ItemContainer container, Item item)
        {
            if (GetReplenishableContainer(container) == null)
            {
                return;
            }
            ReplenishableContainer repl = GetReplenishableContainer(container);

            if (RequireAllSlotsEmpty && container.itemList.Count > 0)
            {
                return;
            }

            timer.Once((float)repl.timer, () => {
                repl.Replenish(container);
            });
        }
Esempio n. 3
0
        void CreateReplenishableContainer(BasePlayer player, ReplenishPlayer rPlayer, StorageContainer container, HitInfo info, string type)
        {
            if (GetReplenishableContainer(container.inventory) != null)
            {
                containers.Remove(GetReplenishableContainer(container.inventory));
                ReplyPlayer(player, "AlreadyReplenishing");
            }

            ReplenishableContainer repl = new ReplenishableContainer(container.inventory.uid, rPlayer.timer);

            repl.type = Lang(type);
            repl.SaveItems(container.inventory);
            var worldPos = info.HitEntity.GetEstimatedWorldPosition();

            repl.pos = new Pos(worldPos.x, worldPos.y, worldPos.z);
            containers.Add(repl);
            ReplyFormatted(player, String.Format(Lang("BoxAdded"), repl.type, repl.uid, repl.timer));
        }