Пример #1
0
 public Drop(Item item, MapObject dropper, int x, int y, int secondsToLive)
 {
     Item = new DroppedItem(item);
     DroppedBy = dropper;
     Position = new Vector2(x, y);
     Expire = Program.CurrentTime.AddSeconds(secondsToLive);
     CanTake = true;
 }
Пример #2
0
 public Item(DroppedItem item, ZoneCharacter pNewOwner, sbyte pSlot)
 {
     DatabaseItem dbi = new DatabaseItem();
     dbi.Amount = item.Amount;
     dbi.Character = pNewOwner.character;
     dbi.ObjectID = item.ItemID;
     dbi.Slot = pSlot;
     Program.Entity.AddToDatabaseItems(dbi);
     Program.Entity.SaveChanges();
     _item = dbi;
     ItemID = item.ItemID;
     pNewOwner.InventoryItems.Add(pSlot, this);
 }
Пример #3
0
        public Item(DroppedItem item, ZoneCharacter pNewOwner, sbyte pSlot)
        {
            DatabaseItem dbi = new DatabaseItem();

            dbi.Amount    = item.Amount;
            dbi.Character = pNewOwner.character;
            dbi.ObjectID  = item.ItemID;
            dbi.Slot      = pSlot;
            Program.Entity.AddToDatabaseItems(dbi);
            Program.Entity.SaveChanges();
            _item  = dbi;
            ItemID = item.ItemID;
            pNewOwner.InventoryItems.Add(pSlot, this);
        }
Пример #4
0
 public Drop(Item item, MapObject dropper, int x, int y, int secondsToLive)
 {
     if (item is Equip)
     {
         Item = new DroppedEquip(item as Equip);
     }
     else
     {
         Item = new DroppedItem(item);
     }
     DroppedBy = dropper;
     Position  = new Vector2(x, y);
     Expire    = Program.CurrentTime.AddSeconds(secondsToLive);
     CanTake   = true;
 }
Пример #5
0
 public static void ObtainedItem(ZoneCharacter character, DroppedItem item, ObtainedItemStatus status)
 {
     using (var packet = new Packet(SH12Type.ObtainedItem))
     {
         packet.WriteUShort(item.ItemID);
         packet.WriteInt(item.Amount);
         packet.WriteUShort((ushort)status);
         packet.WriteUShort(0xffff);
         character.Client.SendPacket(packet);
     }
 }