Пример #1
0
        public override void OnDoubleClick(Mobile from)
        {
            base.OnDoubleClick(from);

            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("That item must be in your pack in order to use it.");
                return;
            }

            from.SendMessage("You clean the fish and place a raw fish steak in your pack.");

            int x = X;
            int y = Y;

            Item item = new UOACZRawFishsteak();

            bool dropToGround = false;

            Delete();

            if (!from.Backpack.TryDropItem(from, item, false))
            {
                item.MoveToWorld(from.Location, from.Map);
                dropToGround = true;
            }

            else
            {
                item.X = X;
                item.Y = Y;
            }
        }
Пример #2
0
        public override void OnDoubleClick(Mobile from)
        {
            base.OnDoubleClick(from);

            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("That item must be in your pack in order to use it.");
                return;
            }

            from.SendMessage("You clean the fish and place several raw fish steaks in your pack.");

            int x = X;
            int y = Y;

            bool dropToGround = false;

            int fishCount = 3;

            Delete();

            for (int a = 0; a < fishCount; a++)
            {
                Item item = new UOACZRawFishsteak();

                if (!from.Backpack.TryDropItem(from, item, false))
                {
                    item.MoveToWorld(from.Location, from.Map);
                    dropToGround = true;
                }

                else
                {
                    item.X = X;
                    item.Y = Y;
                }
            }

            if (dropToGround)
            {
                from.SendMessage("There was not enough room in your backpack and some of the items were placed on the ground.");
            }
        }