Пример #1
0
        public static ItemDatabaseData Load(DataRow row)
        {
            ItemDatabaseData item = new ItemDatabaseData();

            if (item.LoadFromDatabase(row) == false)
            {
                return(null);
            }

            return(item);
        }
Пример #2
0
        public void WriteItemCardData(Packet p)
        {
            // Blank data
            if (Cards == null)
            {
                for (int i = 0; i < Global.MAX_SLOTS; i++)
                {
                    p.Write((short)0);
                }
                return;
            }

            // Pet eggs
            if (Cards[0] == Item.Card0Pet)
            {
                p.Write((short)0);
                p.Write((short)0);
                p.Write((short)0);
                p.Write((short)Cards[3]);                 // Pet renamed flag.
                return;
            }

            // Forged/created items
            if (Cards[0] == Item.Card0Create || Cards[0] == Item.Card0Forge)
            {
                for (int i = 0; i < Global.MAX_SLOTS; i++)
                {
                    p.Write((short)Cards[i]);
                }
                return;
            }

            // Normal items
            for (int i = 0; i < Global.MAX_SLOTS; i++)
            {
                // Write viewID of cards
                ItemDatabaseData item = (Cards[i] > 0 ? (ItemDatabaseData)World.Database[EDatabaseType.Item, Cards[i]] : null);
                p.Write((ushort)(item != null && item.ViewID != EWeaponType.Fist ? (ushort)item.ViewID : Cards[i]));
            }
        }
Пример #3
0
		public static ItemDatabaseData Load(DataRow row) {
			ItemDatabaseData item = new ItemDatabaseData();
			if (item.LoadFromDatabase(row) == false) {
				return null;
			}

			return item;
		}