Пример #1
0
        public override bool DropToWorld(Mobile from, Point3D p)
        {
            bool drop = base.DropToWorld(from, p);

            EnchantedHotItem.CheckDrop(from, this);

            return(drop);
        }
Пример #2
0
        public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
        {
            if (!CheckHold(from, item, true, true))
            {
                return(false);
            }

            if (item.QuestItem && from.Backpack != this)
            {
                from.SendLocalizedMessage(1074769); // An item must be in your backpack (and not in a container within) to be toggled as a quest item.
                return(false);
            }

            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house != null && house.IsLockedDown(this))
            {
                if (item is VendorRentalContract || (item is Container && ((Container)item).FindItemByType(typeof(VendorRentalContract)) != null))
                {
                    from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
                    return(false);
                }

                if (!house.LockDown(from, item, false))
                {
                    return(false);
                }
            }

            item.Location = new Point3D(p.X, p.Y, 0);

            AddItem(item);

            from.SendSound(GetDroppedSound(item), GetWorldLocation());

            ItemFlags.SetTaken(item, true);

            if (item.HonestyItem && item.HonestyPickup == DateTime.MinValue)
            {
                item.HonestyPickup = DateTime.UtcNow;
                item.StartHonestyTimer();

                if (item.HonestyOwner == null)
                {
                    Server.Services.Virtues.HonestyVirtue.AssignOwner(item);
                }

                from.SendLocalizedMessage(1151536); // You have three hours to turn this item in for Honesty credit, otherwise it will cease to be a quest item.
            }

            if (Siege.SiegeShard && this != from.Backpack && from is PlayerMobile && ((PlayerMobile)from).BlessedItem != null && ((PlayerMobile)from).BlessedItem == item)
            {
                ((PlayerMobile)from).BlessedItem = null;
                item.LootType = LootType.Regular;

                from.SendLocalizedMessage(1075292, item.Name != null ? item.Name : "#" + item.LabelNumber.ToString()); // ~1_NAME~ has been unblessed.
            }

            if (!EnchantedHotItem.CheckDrop(from, this, item))
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
        public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage)
        {
            if (!CheckHold(from, dropped, sendFullMessage, !CheckStack(from, dropped)))
            {
                return(false);
            }

            if (dropped.QuestItem && from.Backpack != this)
            {
                from.SendLocalizedMessage(1074769); // An item must be in your backpack (and not in a container within) to be toggled as a quest item.
                return(false);
            }

            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house != null && house.IsLockedDown(this))
            {
                if (dropped is VendorRentalContract || (dropped is Container && ((Container)dropped).FindItemByType(typeof(VendorRentalContract)) != null))
                {
                    from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
                    return(false);
                }

                if (!house.LockDown(from, dropped, false))
                {
                    return(false);
                }
            }

            List <Item> list = Items;

            for (int i = 0; i < list.Count; ++i)
            {
                Item item = list[i];

                if (!(item is Container) && item.StackWith(from, dropped, false))
                {
                    return(true);
                }
            }

            DropItem(dropped);

            ItemFlags.SetTaken(dropped, true);

            if (dropped.HonestyItem && dropped.HonestyPickup == DateTime.MinValue)
            {
                dropped.HonestyPickup = DateTime.UtcNow;
                dropped.StartHonestyTimer();

                if (dropped.HonestyOwner == null)
                {
                    Server.Services.Virtues.HonestyVirtue.AssignOwner(dropped);
                }

                from.SendLocalizedMessage(1151536); // You have three hours to turn this item in for Honesty credit, otherwise it will cease to be a quest item.
            }

            if (Siege.SiegeShard && this != from.Backpack && from is PlayerMobile && ((PlayerMobile)from).BlessedItem != null && ((PlayerMobile)from).BlessedItem == dropped)
            {
                ((PlayerMobile)from).BlessedItem = null;
                dropped.LootType = LootType.Regular;

                from.SendLocalizedMessage(1075292, dropped.Name != null ? dropped.Name : "#" + dropped.LabelNumber.ToString()); // ~1_NAME~ has been unblessed.
            }

            if (!EnchantedHotItem.CheckDrop(from, this, dropped))
            {
                return(false);
            }

            return(true);
        }