Exemplo n.º 1
0
 public ItemPickupEvent(CollectibleEntity collectibleEntity, BaseEntity.RPCMessage msg, Item item)
 {
     Entity = collectibleEntity;
     RPCMessage = msg;
     Player = Server.GetPlayer(msg.player);
     Item = new InvItem(item);
 }
Exemplo n.º 2
0
        public ItemConditionEvent(Item item, float amount)
        {
            Item = new InvItem(item);
            Amount = amount;

            BasePlayer ownerPlayer = item.GetOwnerPlayer();

            if (ownerPlayer != null) {
                Player = Server.GetPlayer(ownerPlayer);
            }
        }
Exemplo n.º 3
0
        public InventoryModEvent(ItemContainer itemContainer, Item item)
        {
            ItemContainer = itemContainer;
            Item = new InvItem(item);

            if (itemContainer.playerOwner != null)
                Player = Server.GetPlayer(itemContainer.playerOwner);

            if (itemContainer.entityOwner != null)
                Entity = new Entity(itemContainer.entityOwner);
        }
Exemplo n.º 4
0
        public InvItem(string name)
        {
            Item item = ItemManager.CreateByItemID(GetItemID(name), 1);

            if (item == null) {
                Logger.LogDebug($"[InvItem] Couldn't create item: 1x{name}");
                _item = null;
            } else {
                _item = item;
                containerPref = GetContainerPreference(Category);
            }
        }
Exemplo n.º 5
0
        public InvItem(int itemid, int amount = 1)
        {
            Item item = ItemManager.CreateByItemID(itemid, amount);

            if (item == null) {
                Logger.LogDebug($"[InvItem] Couldn't create item: {amount}x{itemid}");
                _item = null;
            } else {
                _item = item;
                containerPref = GetContainerPreference(Category);
            }
        }
Exemplo n.º 6
0
 public PlayerClothingEvent(PlayerInventory playerInventory, Item item)
 {
     Player = Server.GetPlayer(playerInventory.containerMain.playerOwner);
     Item = new InvItem(item);
 }
Exemplo n.º 7
0
 public ItemUsedEvent(Item item, int amount)
 {
     Item = new InvItem(item);
     Amount = amount;
 }
Exemplo n.º 8
0
 public InvItem(Item item)
 {
     _item = item;
     containerPref = GetContainerPreference(Category);
 }
Exemplo n.º 9
0
 public ConsumeFuelEvent(BaseOven baseOven, Item fuel, ItemModBurnable burnable)
 {
     BaseOven = baseOven;
     Item = new InvItem(fuel);
     Burnable = burnable;
 }