Beispiel #1
0
 public static SpellItemEnchantment CreateNewSpellItemEnchant()
 {
     int maxid = (from d in LegacyToolBox.Data.SpellItemEnchant select d.ID).Max() + 1;
     SpellItemEnchantment enchant = new SpellItemEnchantment();
     enchant.ID = maxid;
     enchant.Item = 0;
     enchant.ItemVisual = 0;
     enchant.Charges = 0;
     enchant.Condition = 0;
     enchant.EnchantType = new int[3] { 0, 0, 0 };
     enchant.Max = new int[3] { 0, 0, 0 };
     enchant.Min = new int[3] { 0, 0, 0 };
     enchant.Name = "";
     enchant.NameFlags = 16712190;
     enchant.Object = new int[3] { 0, 0, 0 };
     enchant.RequiredLevel = 0;
     enchant.SkillLevel = 0;
     enchant.SkillLine = 0;
     enchant.Slot = 0;
     LegacyToolBox.Data.SpellItemEnchant.Add(enchant);
     return enchant;
 }
Beispiel #2
0
 public static ObservableCollection<SpellItemEnchantment> LoadSpellItemEnchant()
 {
     ObservableCollection<SpellItemEnchantment> list = new ObservableCollection<SpellItemEnchantment>();
     using (FileStream stream = File.OpenRead(LegacyToolBox.DATA_PATH + "DBC/SpellItemEnchantment.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();
         int dataSize = 20 + rowSize * records;
         for (int i = 0; i != records; ++i)
         {
             SpellItemEnchantment enchant = new SpellItemEnchantment();
             enchant.ID = r.ReadInt32();
             enchant.Charges = r.ReadInt32();
             enchant.EnchantType[0] = r.ReadInt32();
             enchant.EnchantType[1] = r.ReadInt32();
             enchant.EnchantType[2] = r.ReadInt32();
             enchant.Min[0] = r.ReadInt32();
             enchant.Min[1] = r.ReadInt32();
             enchant.Min[2] = r.ReadInt32();
             enchant.Max[0] = r.ReadInt32();
             enchant.Max[1] = r.ReadInt32();
             enchant.Max[2] = r.ReadInt32();
             enchant.Object[0] = r.ReadInt32();
             enchant.Object[1] = r.ReadInt32();
             enchant.Object[2] = r.ReadInt32();
             enchant.Name = DBC.ReadString(r, dataSize, 4 * 4, 4 * 11);
             enchant.NameFlags = r.ReadInt32();
             enchant.ItemVisual = r.ReadInt32();
             enchant.Slot = r.ReadInt32();
             enchant.Item = r.ReadInt32();
             enchant.Condition = r.ReadInt32();
             enchant.SkillLine = r.ReadInt32();
             enchant.SkillLevel = r.ReadInt32();
             enchant.RequiredLevel = r.ReadInt32();
             list.Add(enchant);
         }
         r.Close();
     }
     return list;
 }