Ejemplo n.º 1
0
 public static GemProperty CreateNewGemProperty()
 {
     int maxid = (from d in LegacyToolBox.Data.GemProperty select d.ID).Max() + 1;
     GemProperty gem = new GemProperty();
     gem.ID = maxid;
     gem.Color = 1;
     gem.Enchant = 0;
     gem.MaxCountInventory = 0;
     gem.MaxCountItem = 0;
     return gem;
 }
Ejemplo n.º 2
0
 public static List<GemProperty> LoadGemProperties()
 {
     List<GemProperty> list = new List<GemProperty>();
     using (FileStream stream = File.OpenRead(LegacyToolBox.DATA_PATH + "DBC/GemProperties.dbc"))
     {
         BinaryReader r = new BinaryReader(stream);
         stream.Position = 4;
         int records = r.ReadInt32();
         int columns = r.ReadInt32();
         int rowSize = r.ReadInt32();
         int stringSize = r.ReadInt32();
         for (int i = 0; i != records; ++i)
         {
             GemProperty gem = new GemProperty();
             gem.ID = r.ReadInt32();
             gem.Enchant = r.ReadInt32();
             gem.MaxCountInventory = r.ReadInt32();
             gem.MaxCountItem = r.ReadInt32();
             gem.Color = r.ReadInt32();
             list.Add(gem);
         }
         r.Close();
     }
     return list;
 }