Ejemplo n.º 1
0
        public virtual bool DropItem(UserItem I)
        {
            ItemObject Ob = new ItemObject(I, this);

            if (!Ob.Drop(this is PlayerObject ? 1 : Settings.DropRange))
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public void DropGold(int Amount)
        {
            if (Con.Account.Gold < Amount || Amount < 0)
            {
                return;
            }

            Con.Account.Gold -= Amount;

            ItemObject Ob = new ItemObject(Amount, this);

            if (!Ob.Drop(this is PlayerObject ? 1 : Settings.DropRange))
            {
                GainGold(Amount);
            }
        }
Ejemplo n.º 3
0
        protected virtual bool DropItem(UserItem item)
        {
            if (CurrentMap.Info.NoDropMonster) return false;

            ItemObject ob = new ItemObject(this, item)
            {
                Owner = EXPOwner,
                OwnerTime = Envir.Time + Settings.Minute,
            };

            return ob.Drop(Settings.DropRange);
        }
Ejemplo n.º 4
0
        protected virtual bool DropGold(uint gold)
        {
            if (EXPOwner != null && EXPOwner.CanGainGold(gold) && !Settings.DropGold)
            {
                EXPOwner.WinGold(gold);
                return true;
            }

            uint count = gold / Settings.MaxDropGold == 0 ? 1 : gold / Settings.MaxDropGold + 1;
            for (int i = 0; i < count; i++)
            {
                ItemObject ob = new ItemObject(this, i != count - 1 ? Settings.MaxDropGold : gold % Settings.MaxDropGold)
                {
                    Owner = EXPOwner,
                    OwnerTime = Envir.Time + Settings.Minute,
                };

                ob.Drop(Settings.DropRange);
            }

            return true;
        }
Ejemplo n.º 5
0
        private bool DropItem(UserItem item, int range = 1)
        {
            ItemObject ob = new ItemObject(this, item);

            if (!ob.Drop(range)) return false;

            if (item.Info.Type == ItemType.Meat)
                item.CurrentDura = (ushort)Math.Max(0, item.CurrentDura - 2000);

            return true;
        }
Ejemplo n.º 6
0
        public void DropGold(uint gold)
        {
            if (Account.Gold < gold) return;

            ItemObject ob = new ItemObject(this, gold);

            if (!ob.Drop(5)) return;
            Account.Gold -= gold;
            Enqueue(new S.LoseGold { Gold = gold });
        }
Ejemplo n.º 7
0
        protected virtual bool DropGold(uint gold)
        {
            if (EXPOwner != null && EXPOwner.CanGainGold(gold))
            {
                EXPOwner.WinGold(gold);
                return true;
            }

            ItemObject ob = new ItemObject(this, gold)
            {
                Owner = EXPOwner,
                OwnerTime = Envir.Time + Settings.Minute,
            };

            return ob.Drop(Settings.DropRange);
        }
Ejemplo n.º 8
0
        protected virtual bool DropItem(UserItem item)
        {
            ItemObject ob = new ItemObject(this, item)
            {
                Owner = EXPOwner,
                OwnerTime = Envir.Time + Settings.Minute,
            };

            return ob.Drop(Settings.DropRange);
        }