Aura.Channel.World.Inventory.CreatureInventory.Add C# (CSharp) Method

Add() public method

Tries to add item to pocket. Returns false if the pocket doesn't exist or there was no space.
public Add ( Item item, Pocket pocket ) : bool
item Item
pocket Pocket
return bool
		public bool Add(Item item, Pocket pocket)
		{
			var success = false;

			lock (_pockets)
			{
				if (!_pockets.ContainsKey(pocket))
					return success;

				success = _pockets[pocket].Add(item);
			}

			if (success)
			{
				this.PrepareBags(item);

				Send.ItemNew(_creature, item);

				if (_creature.IsPlayer && pocket != Pocket.Temporary)
				{
					this.OnItemEntersInventory(item);

					// Notify everybody about receiving the item.
					ChannelServer.Instance.Events.OnPlayerReceivesItem(_creature, item.Info.Id, item.Amount);

					// If item was a sac, we have to notify the server about
					// receiving its *contents* as well.
					if (item.Data.StackType == StackType.Sac)
						ChannelServer.Instance.Events.OnPlayerReceivesItem(_creature, item.Data.StackItemId, item.Info.Amount);
				}

				if (pocket.IsEquip())
				{
					this.UpdateEquipReferences();
					this.OnEquip(item);
					this.UpdateEquipStats();

					if (_creature.Region != Region.Limbo)
						Send.EquipmentChanged(_creature, item);
				}
			}

			return success;
		}

Same methods

CreatureInventory::Add ( Item item, bool tempFallback ) : bool
CreatureInventory::Add ( InventoryPocket inventoryPocket ) : void