Ejemplo n.º 1
0
        public BankItem CreateBankItem(Character character, BasePlayerItem item, int amount)
        {
            if (amount < 0)
            {
                throw new ArgumentException("amount < 0", "amount");
            }


            var guid   = BankItemRecord.PopNextId();
            var record = new BankItemRecord // create the associated record
            {
                Id             = guid,
                OwnerAccountId = character.Account.Id,
                Template       = item.Template,
                Stack          = (uint)amount,
                Effects        = new List <EffectBase>(item.Effects),
                IsNew          = true
            };

            return(new BankItem(character, record));
        }
Ejemplo n.º 2
0
        public BankItem CreateBankItem(Character character, ItemTemplate template, int amount, bool maxStats = false)
        {
            if (amount < 0)
            {
                throw new ArgumentException("amount < 0", "amount");
            }


            var guid   = BankItemRecord.PopNextId();
            var record = new BankItemRecord // create the associated record
            {
                Id             = guid,
                OwnerAccountId = character.Account.Id,
                Template       = template,
                Stack          = (uint)amount,
                Effects        = GenerateItemEffects(template, maxStats),
                IsNew          = true
            };

            return(new BankItem(character, record));
        }