Ejemplo n.º 1
0
        public override bool SetKamas(int amount)
        {
            if (TaxCollector.IsFighting || !TaxCollector.IsInWorld)
            {
                return(false);
            }

            if (amount > 0)
            {
                return(false);
            }

            amount = Math.Abs(amount);

            if (TaxCollector.GatheredKamas <= 0)
            {
                amount = 0;
            }

            if (TaxCollector.GatheredKamas < amount)
            {
                amount = TaxCollector.GatheredKamas;
            }

            TaxCollector.GatheredKamas -= amount;
            Character.Inventory.AddKamas(amount);
            Character.Client.Send(new StorageKamasUpdateMessage(TaxCollector.GatheredKamas));

            if (TaxCollector.Bag.Count == 0 && TaxCollector.GatheredKamas == 0)
            {
                TaxCollector.Delete();
            }

            return(true);
        }
Ejemplo n.º 2
0
        public void Close()
        {
            Character.Area.UnregisterTimer(Timer);

            Character.CloseDialog(this);
            TaxCollector.OnDialogClosed(this);

            if (TaxCollector.IsDisposed)
            {
                return;
            }

            TaxCollectorHandler.SendGetExchangeGuildTaxCollectorMessage(TaxCollector.Guild.Clients, GetExchangeGuildTaxCollector());
            InventoryHandler.SendExchangeLeaveMessage(Character.Client, DialogType, false);

            TaxCollector.Guild.AddXP(TaxCollector.GatheredExperience);
            TaxCollector.Delete();
        }