Beispiel #1
0
        /// <summary>
        /// Needs serious fixing in the reader, as it throws invalid casts (files all use uint, but f**k those)
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static ItemInfo Load(DataRow row)
        {
            ItemInfo itemInfo = new ItemInfo
            {
                ItemID = GetDataTypes.GetUshort(row["id"]),
                Slot = (ItemSlot)GetDataTypes.GetByte(row["equip"]),
                InxName = (string)row["inxname"],
                MaxLot = GetDataTypes.GetInt(row["maxlot"]),
                AttackSpeed = GetDataTypes.GetUshort(row["atkspeed"]),
                Level = GetDataTypes.GetByte(row["demandlv"]),
                Type = (ItemType)GetDataTypes.GetByte(row["type"]),
                Class = (ItemClass)GetDataTypes.GetByte(row["class"]),
                UpgradeLimit = (byte)GetDataTypes.GetByte(row["uplimit"]),
                Jobs = UnpackWhoEquip(GetDataTypes.GetUint(row["whoequip"])),
                TwoHand = GetDataTypes.GetBool(row["TwoHand"]),
                MinMagic = GetDataTypes.GetUshort(row["minma"]),
                MaxMagic = GetDataTypes.GetUshort(row["maxma"]),
                MinMelee = GetDataTypes.GetUshort(row["minwc"]),
                MaxMelee = GetDataTypes.GetUshort(row["maxwc"]),
                WeaponDef = GetDataTypes.GetUshort(row["ac"]),
                MagicDef = GetDataTypes.GetUshort(row["mr"]),
                UpSucRation = GetDataTypes.GetUshort(row["UpSucRatio"]),
                UpResource = GetDataTypes.GetUshort(row["UpResource"]),
                SellPrice =  GetDataTypes.GetUint(row["SellPrice"]),
                BuyPrice = GetDataTypes.GetUint(row["BuyPrice"]),

            };
            itemInfo.Stats = new ItemStats();
            return itemInfo;
        }
Beispiel #2
0
 /// <summary>
 /// Needs serious fixing in the reader, as it throws invalid casts (files all use uint, but f**k those)
 /// </summary>
 /// <param name="reader"></param>
 /// <returns></returns>
 public static ItemInfo Load(DataTableReaderEx reader)
 {
     ItemInfo itemInfo = new ItemInfo
     {
         ItemID = reader.GetUInt16("id"),
         Slot = (ItemSlot)reader.GetUInt32("equip"),
         InxName = reader.GetString("inxname"),
         MaxLot = (byte)reader.GetUInt32("maxlot"),
         AttackSpeed = (ushort)reader.GetUInt32("atkspeed"),
         Level = (byte)reader.GetUInt32("demandlv"),
         Type = (ItemType)reader.GetUInt32("type"),
         Class = (ItemClass)reader.GetUInt32("class"),
         UpgradeLimit = reader.GetByte("uplimit"),
         Jobs = UnpackWhoEquip(reader.GetUInt32("whoequip")),
         TwoHand = reader.GetBoolean("TwoHand"),
         MinMagic = (ushort)reader.GetUInt32("minma"),
         MaxMagic = (ushort)reader.GetUInt32("maxma"),
         MinMelee = (ushort)reader.GetUInt32("minwc"),
         MaxMelee = (ushort)reader.GetUInt32("maxwc"),
         WeaponDef = (ushort)reader.GetUInt32("ac"),
         MagicDef = (ushort)reader.GetUInt32("mr"),
         UpSucRation = reader.GetUInt16("UpSucRatio"),
         UpResource = reader.GetByte("UpResource")
     };
     return itemInfo;
 }
Beispiel #3
0
 public static bool GetItemInfo(ushort itemID, out ItemInfo info)
 {
     return Instance.ItemsByID.TryGetValue(itemID, out info);
 }