Exemplo n.º 1
0
        public bool StoreItem(BasePlayerItem item, int amount, uint price)
        {
            if (!Owner.Inventory.HasItem(item) || amount <= 0)
            {
                return(false);
            }

            if (item.IsLinkedToPlayer() || item.IsLinkedToAccount())
            {
                return(false);
            }

            if (amount > item.Stack)
            {
                amount = (int)item.Stack;
            }

            var merchantItem = ItemManager.Instance.CreateMerchantItem(Owner, item, amount, price);

            AddItem(merchantItem);

            Owner.Inventory.RemoveItem(item, amount);

            return(true);
        }
Exemplo n.º 2
0
Arquivo: Bank.cs Projeto: Mixi59/Stump
        public BankItem StoreItem(BasePlayerItem item, int amount, bool sendMessage)
        {
            if (!Owner.Inventory.HasItem(item) || amount <= 0)
            {
                return(null);
            }

            if (item.IsLinkedToPlayer())
            {
                return(null);
            }

            if (item.IsEquiped())
            {
                return(null);
            }

            if (amount > item.Stack)
            {
                amount = (int)item.Stack;
            }

            Owner.Inventory.RemoveItem(item, amount, sendMessage: sendMessage);

            var bankItem = ItemManager.Instance.CreateBankItem(Owner, item, amount);

            bankItem = AddItem(bankItem, sendMessage);

            return(bankItem);
        }
        public bool MoveToInventory(MerchantItem item, uint quantity)
        {
            bool result;

            if (quantity == 0u)
            {
                result = false;
            }
            else
            {
                if (quantity > item.Stack)
                {
                    quantity = item.Stack;
                }
                this.RemoveItem(item, quantity, true);
                BasePlayerItem item2 = Singleton <ItemManager> .Instance.CreatePlayerItem(this.Owner, item.Template, quantity, item.Effects);

                this.Owner.Inventory.AddItem(item2);
                result = true;
            }
            return(result);
        }
Exemplo n.º 4
0
 public bool MustStackWith(BasePlayerItem compared)
 {
     return(compared.Template.Id == Template.Id &&
            compared.Effects.CompareEnumerable(Effects));
 }
Exemplo n.º 5
0
 public virtual bool Drop(BasePlayerItem dropOnItem) => false;
Exemplo n.º 6
0
 public virtual bool CanDrop(BasePlayerItem item) => false;
Exemplo n.º 7
0
 public virtual bool Feed(BasePlayerItem food) => false;
Exemplo n.º 8
0
 public virtual bool CanFeed(BasePlayerItem item) => false;
 public virtual bool Drop(BasePlayerItem dropOnItem)
 {
     return(false);
 }
Exemplo n.º 10
0
 public virtual bool Feed(BasePlayerItem food)
 {
     return(false);
 }
Exemplo n.º 11
0
 public virtual bool MustStackWith(BasePlayerItem compared)
 {
     return(compared.Template.Id == this.Template.Id && compared.Position == CharacterInventoryPositionEnum.INVENTORY_POSITION_NOT_EQUIPED && compared.Position == this.Position && compared.Effects.CompareEnumerable(this.Effects));
 }