Ejemplo n.º 1
0
        public void Apply()
        {
            foreach (DroppedItem current in this.Loot.Items.Values)
            {
                ItemTemplate itemTemplate = Singleton <ItemManager> .Instance.TryGetTemplate(current.ItemId);

                if (itemTemplate.Effects.Count > 0)
                {
                    int num = 0;
                    while ((long)num < (long)((ulong)current.Amount))
                    {
                        TaxCollectorItem item = Singleton <ItemManager> .Instance.CreateTaxCollectorItem(this.TaxCollector, current.ItemId, current.Amount);

                        this.TaxCollector.Bag.AddItem(item);
                        num++;
                    }
                }
                else
                {
                    TaxCollectorItem item = Singleton <ItemManager> .Instance.CreateTaxCollectorItem(this.TaxCollector, current.ItemId, current.Amount);

                    this.TaxCollector.Bag.AddItem(item);
                }
            }
            this.TaxCollector.GatheredExperience += this.Experience;
            this.TaxCollector.GatheredKamas      += this.Loot.Kamas;
        }
        public override bool MoveItem(int id, int quantity)
        {
            bool result;

            if (quantity >= 0)
            {
                this.Character.SendSystemMessage(7, false, new object[0]);
                result = false;
            }
            else
            {
                quantity = -quantity;
                TaxCollectorItem taxCollectorItem = this.TaxCollector.Bag.TryGetItem(id);
                if (taxCollectorItem == null)
                {
                    result = false;
                }
                else
                {
                    if (this.TaxCollector.Bag.MoveToInventory(taxCollectorItem, this.Character, (uint)quantity))
                    {
                        this.Character.Client.Send(new StorageObjectRemoveMessage((uint)id));
                    }
                    result = true;
                }
            }
            return(result);
        }