public void DeleteCreatureLoot(loot_info_creature loot)
 {
     DataProcessor.DeleteCreatureLoot(loot);
     CreatureLoot.Remove(loot);
 }
示例#2
0
 public static void SaveCreatureLoot(loot_info_creature loot)
 {
     var old = (from d in DB.LEGACY.loot_info_creature where d.Entry == loot.Entry && d.SetID == loot.SetID select d).SingleOrDefault();
     if (old == null)
     {
         DB.LEGACY.loot_info_creature.Add(loot);
         DB.LSave();
     }
     else
     {
         old.Chance = loot.Chance;
         DB.LSave();
     }
 }
示例#3
0
 public static void DeleteCreatureLoot(loot_info_creature loot)
 {
     var old = (from d in DB.LEGACY.loot_info_creature where d.Entry == loot.Entry && d.SetID == loot.SetID select d).SingleOrDefault();
     if (old != null)
     {
         DB.LEGACY.loot_info_creature.Remove(old);
         DB.LSave();
     }
 }
示例#4
0
        public static void CreateCreatureLootInfo(int creature, int setID, int item, float chance, int group, string name)
        {
            var old = (from d in DB.LEGACY.loot_set where d.Entry == setID && d.Item == item select d).SingleOrDefault();
            if (old != null)
            {
                DB.LEGACY.loot_set.Remove(old);
                DB.LSave();
            }

            var oldName = (from d in DB.LEGACY.loot_set_name where d.SetID == setID select d).SingleOrDefault();
            if (oldName == null)
            {
                loot_set_name setName = new loot_set_name();
                setName.Category = 17;
                setName.SetID = setID;
                setName.Name = name;
                DB.LEGACY.loot_set_name.Add(setName);
                DB.LSave();
            }

            loot_set set = new loot_set();
            set.Entry = setID;
            set.Chance = chance;
            set.GroupID = group;
            set.Item = item;
            set.MaxCount = 1;
            set.MaxLooterLevel = 0;
            set.MaxTargetLevel = 0;
            set.MinCount = 1;
            set.MinLooterLevel = 0;
            set.MinMF = 0;
            set.MinTargetLevel = 0;
            set.Mode = 1;
            set.Quest = 0;
            SaveLootSet(set);

            loot_info_creature loot_info = new loot_info_creature();
            loot_info.Entry = creature;
            loot_info.SetID = set.Entry;
            loot_info.Chance = 100.0f;
            SaveCreatureLoot(loot_info);
        }