Esempio n. 1
0
 public static void DropItemToContainer(Item item, Container container)
 {
     // get random coords and drop the item there.
     Rectangle bounds = Data.ContainerData.GetData(container.ItemID).Bounds;
     int x = Utility.RandomValue(bounds.Left, bounds.Right);
     int y = Utility.RandomValue(bounds.Top, bounds.Bottom);
     DropItemToContainer(item, container, x, y);
 }
Esempio n. 2
0
 public static void DropItemToContainer(Item item, Container container, int x, int y)
 {
     Rectangle containerBounds = Data.ContainerData.GetData(container.ItemID).Bounds;
     Texture2D itemTexture = Data.Art.GetStaticTexture(item.DisplayItemID);
     if (x < containerBounds.Left) x = containerBounds.Left;
     if (x > containerBounds.Right - itemTexture.Width) x = containerBounds.Right - itemTexture.Width;
     if (y < containerBounds.Top) y = containerBounds.Top;
     if (y > containerBounds.Bottom - itemTexture.Height) y = containerBounds.Bottom - itemTexture.Height;
     UltimaClient.Send(new DropItemPacket(item.Serial, (ushort)x, (ushort)y, 0, 0, container.Serial));
     _legacyUI.Cursor.ClearHolding();
 }
Esempio n. 3
0
 public static void DropItemToWorld(Item item, int X, int Y, int Z)
 {
     if (!_legacyUI.IsMouseOverUI)
     {
         Serial serial;
         if (_world.MouseOverObject is MapObjectItem && ((Item)_world.MouseOverObject.OwnerEntity).ItemData.Container)
         {
             serial = _world.MouseOverObject.OwnerEntity.Serial;
             X = Y = 0xFFFF;
             Z = 0;
         }
         else
             serial = Serial.World;
         UltimaClient.Send(new DropItemPacket(item.Serial, (ushort)X, (ushort)Y, (byte)Z, 0, serial));
         _legacyUI.Cursor.ClearHolding();
     }
 }
Esempio n. 4
0
 public ItemGumplingPaperdoll(Control owner, int x, int y, Item item)
     : base(owner, item)
 {
     _x = x;
     _y = y;
 }
Esempio n. 5
0
 public void PickUpItem(Item item, int x, int y)
 {
     if (item.Parent != null)
     {
         if (item.Parent is Container)
             ((Container)item.Parent).RemoveItem(item.Serial);
     }
     IsHolding = true;
     holdingItem = item;
     holdingOffset = new Point(x, y);
 }
Esempio n. 6
0
 public static void WearItem(Item item)
 {
     UltimaClient.Send(new DropToLayerPacket(item.Serial, 0x00, EntitiesCollection.MySerial));
     _legacyUI.Cursor.ClearHolding();
 }
Esempio n. 7
0
 public static void PickUpItem(Item item, int x, int y)
 {
     if (item.PickUp())
     {
         UltimaClient.Send(new PickupItemPacket(item.Serial, item.Amount));
         _legacyUI.Cursor.PickUpItem(item, x, y);
     }
 }