Пример #1
0
 public void DeleteMapItem(MapItem m)
 {
     mapItemManager.DeleteMapItem(m.MapItemID, m.ItemID);
     mapItems.Remove(m);
 }
Пример #2
0
 public static byte[] SendItemOnGround(MapItem e)
 {
     Packet p = new Packet(200);
     p.WriteHexString("00 01 00");
     p.WriteInt(e.MapID);
     p.WriteShort(e.MapX);
     p.WriteShort(e.MapY);
     p.WriteByte(e.MapZ);
     p.WriteInt(e.MapItemID); // DROP ITEM NEED NEW CLASS DROP ITEM PROBABLY
     p.WriteByte(e.bType);
     p.WriteShort(e.VisualID);
     p.WriteShort(e.ReferenceID);
     p.WriteInt(e.ItemID);
     p.WriteShort(e.Amount);
     p.WriteHexString("00 00 00 00 00 00 01 00 00");
     return p.GetWrittenBuffer(PacketIds.SendItemOnGround);
 }
Пример #3
0
        //public Map GetMapById(int mapId)
        //{
        //    return maps.Where(x => x.MapID == mapId).First();
        //}
        //public Map[] Maps { get { return maps; } }
        public MapItem PlayerDropItem(int droppedByCharId ,BaseItem item,short x, short y, byte z, int mapId)
        {
            item.OwnerID = -1;
            item.Bag = 255;
            item.Slot = 255;

            MapItem m = new MapItem
            {
                DropTime = DateTime.Now,
                MapID = mapId,
                MapX = x,
                MapY = y,
                MapZ = z,
                bType =item.bType,
                ItemID = item.ItemID,
                Amount = item.Amount,
                ReferenceID = item.ReferenceID,
                VisualID = item.VisualID,
                DroppedByCharacterID = droppedByCharId
            };

            int mapItemId = mapItemManager.InsertMapItem(m.MapID, m.MapX, m.MapY, m.MapZ, m.bType, m.VisualID, m.ReferenceID, m.ItemID, m.Amount, droppedByCharId);

            m.MapItemID = mapItemId;

            if (item.ItemID != 0)
                itemDataManager.UpdateItem(item);
            mapItems.Add(m);

            return m;
        }
Пример #4
0
        public MapItem PlayerDropItem(BaseItem item,short x, short y, byte z, int mapId)
        {
            item.OwnerID = -1;
            item.Bag = 255;
            item.Slot = 255;

            MapItem m = new MapItem
            {
                MapID = mapId,
                MapX = x,
                MapY = y,
                MapZ = z,
                bType =item.bType,
                ItemID = item.ItemID,
                Amount = item.Amount,
                ReferenceID = item.ReferenceID,
                VisualID = item.VisualID
            };

            int mapItemId = mapItemManager.InsertMapItem(m.MapID, m.MapX, m.MapY, m.MapZ, m.bType, m.VisualID, m.ReferenceID, m.ItemID, m.Amount);

            m.MapItemID = mapItemId;

            itemDataManager.UpdateItem(item);
            mapItems.Add(m);

            return m;
        }