Пример #1
0
 public void ClothesSet(int _armor   = 0, int _pants     = 0, int _mWeapon = 0, int _aWeapon = 0, int _boots = 0,
                        int _hauberk = 0, int _shoulders = 0, int _bangle  = 0, int _helmet  = 0, int _bow   = 0)
 {
     int[] param = new int[10] {
         _armor, _pants, _mWeapon, _aWeapon, _boots, _hauberk, _shoulders, _bangle, _helmet, _bow
     };
     Clothes     = new DRClothes(param);
     ClothesList = null;
     RunesList   = new DRClothesList();
     RunesList.Runes(Clothes, Lvl, Rank);
     FramesList = new DRClothesList();
     FramesList.Frames(Clothes, Lvl, Rank);
 }
Пример #2
0
 public void RFSet(int _Rarmor   = 0, int _Rpants     = 0, int _RmWeapon = 0, int _RaWeapon = 0, int _Rboots = 0,
                   int _Rhauberk = 0, int _Rshoulders = 0, int _Rbangle  = 0, int _Rhelmet  = 0, int _Rbow   = 0,
                   int _Farmor   = 0, int _Fpants     = 0, int _FmWeapon = 0, int _FaWeapon = 0, int _Fboots = 0,
                   int _Fhauberk = 0, int _Fshoulders = 0, int _Fbangle  = 0, int _Fhelmet  = 0, int _Fbow   = 0)
 {
     int[] paramR = new int[10] {
         _Rarmor, _Rpants, _RmWeapon, _RaWeapon, _Rboots, _Rhauberk, _Rshoulders, _Rbangle, _Rhelmet, _Rbow
     };
     int[] paramF = new int[10] {
         _Farmor, _Fpants, _FmWeapon, _FaWeapon, _Fboots, _Fhauberk, _Fshoulders, _Fbangle, _Fhelmet, _Fbow
     };
     RunesList  = null;
     FramesList = null;
     Runes      = new DRClothes();
     Runes.RFSet(paramR);
     Frames = new DRClothes();
     Frames.RFSet(paramF);
     SetStats();
 }
Пример #3
0
 public void Frames(DRClothes _clothes, int _lvl, int _rank)
 {
     using (Model dbItems = new Model())
     {
         List <DRItems>    items     = dbItems.DRItems.Where(c => c.Lvl <= _lvl && c.Rank <= _rank && c.Type > 30 && c.Type <= 40 || c.Id == 1).ToList();
         List <DRItemView> emptyList = items.Where(c => c.Id == 1).Select(c => new DRItemView
         {
             Id       = c.Id,
             NAME     = c.NAME,
             IconPath = c.ICON,
             Color    = c.Color
         }).ToList();
         if (_clothes.Armor.Id != 1)
         {
             Armor = items.Where(c => c.Slot == 1 || c.Id == 1).Select(c => new DRItemView
             {
                 Id       = c.Id,
                 NAME     = c.NAME,
                 IconSize = iconSize,
                 IconPath = c.ICON,
                 Color    = c.Color
             }).ToList();
         }
         else
         {
             Armor = emptyList;
         }
         if (_clothes.Pants.Id != 1)
         {
             Pants = items.Where(c => c.Slot == 2 || c.Id == 1).Select(c => new DRItemView
             {
                 Id       = c.Id,
                 NAME     = c.NAME,
                 IconSize = iconSize,
                 IconPath = c.ICON,
                 Color    = c.Color
             }).ToList();
         }
         else
         {
             Pants = emptyList;
         }
         MWeapon = items.Where(c => c.Slot == 3 &&
                               c.LvlSet <= dbItems.DRItems.Where(a => a.Id == _clothes.MWeapon.Id).Select(a => a.LvlSet).FirstOrDefault() &&
                               c.Style == dbItems.DRItems.Where(b => b.Id == _clothes.MWeapon.Id).Select(b => b.Style).FirstOrDefault() ||
                               c.Id == 1).Select(c => new DRItemView
         {
             Id       = c.Id,
             NAME     = c.NAME,
             IconSize = iconSize,
             IconPath = c.ICON,
             Color    = c.Color
         }).ToList();
         AWeapon = emptyList;
         Boots   = items.Where(c => c.Slot == 5 &&
                               c.LvlSet <= dbItems.DRItems.Where(a => a.Id == _clothes.Boots.Id).Select(a => a.LvlSet).FirstOrDefault() ||
                               c.Id == 1).Select(c => new DRItemView
         {
             Id       = c.Id,
             NAME     = c.NAME,
             IconSize = iconSize,
             IconPath = c.ICON,
             Color    = c.Color
         }).ToList();
         if (_clothes.Hauberk.Id != 1)
         {
             Hauberk = items.Where(c => c.Slot == 6 || c.Id == 1).Select(c => new DRItemView
             {
                 Id       = c.Id,
                 NAME     = c.NAME,
                 IconSize = iconSize,
                 IconPath = c.ICON,
                 Color    = c.Color
             }).ToList();
         }
         else
         {
             Hauberk = emptyList;
         }
         if (_clothes.Shoulders.Id != 1)
         {
             Shoulders = items.Where(c => c.Slot == 7 || c.Id == 1).Select(c => new DRItemView
             {
                 Id       = c.Id,
                 NAME     = c.NAME,
                 IconSize = iconSize,
                 IconPath = c.ICON,
                 Color    = c.Color
             }).ToList();
         }
         else
         {
             Shoulders = emptyList;
         }
         if (_clothes.Bangle.Id != 1)
         {
             Bangle = items.Where(c => c.Slot == 8 || c.Id == 1).Select(c => new DRItemView
             {
                 Id       = c.Id,
                 NAME     = c.NAME,
                 IconSize = iconSize,
                 IconPath = c.ICON,
                 Color    = c.Color
             }).ToList();
         }
         else
         {
             Bangle = emptyList;
         }
         if (_clothes.Helmet.Id != 1)
         {
             Helmet = items.Where(c => c.Slot == 9 || c.Id == 1).Select(c => new DRItemView
             {
                 Id       = c.Id,
                 NAME     = c.NAME,
                 IconSize = iconSize,
                 IconPath = c.ICON,
                 Color    = c.Color
             }).ToList();
         }
         else
         {
             Helmet = emptyList;
         }
         if (_clothes.Bow.Id != 1)
         {
             Bow = items.Where(c => c.Slot == 10 || c.Id == 1).Select(c => new DRItemView
             {
                 Id       = c.Id,
                 NAME     = c.NAME,
                 IconSize = iconSize,
                 IconPath = c.ICON,
                 Color    = c.Color
             }).ToList();
         }
         else
         {
             Bow = emptyList;
         }
     }
 }
Пример #4
0
        public void Runes(DRClothes _clothes, int _lvl, int _rank)
        {
            using (Model dbItems = new Model())
            {
                List <DRItems> items = dbItems.DRItems.Where(c => c.Lvl <= _lvl && c.Rank <= _rank && c.Type > 20 && c.Type <= 30 || c.Id == 1).ToList();
                int            tempLvlSet;
                int            tempStyle;

                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.Armor.Id).Select(a => a.LvlSet).Single();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.Armor.Id).Select(b => b.Style).Single();
                Armor      = items.Where(c => c.Slot == 1 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.Pants.Id).Select(a => a.LvlSet).Single();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.Pants.Id).Select(b => b.Style).Single();
                Pants      = items.Where(c => c.Slot == 2 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.MWeapon.Id).Select(a => a.LvlSet).Single();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.MWeapon.Id).Select(b => b.Style).FirstOrDefault();
                MWeapon    = items.Where(c => c.Slot == 3 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.AWeapon.Id).Select(a => a.LvlSet).FirstOrDefault();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.AWeapon.Id).Select(b => b.Style).FirstOrDefault();
                AWeapon    = items.Where(c => c.Slot == 4 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
                if (_clothes.Boots.Id != 1)
                {
                    tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.Boots.Id).Select(a => a.LvlSet).FirstOrDefault();
                    Boots      = items.Where(c => c.Slot == 5 && c.LvlSet <= tempLvlSet || c.Id == 1).Select(c => new DRItemView
                    {
                        Id       = c.Id,
                        NAME     = c.NAME,
                        Link     = c.LINK,
                        IconSize = iconSize,
                        IconPath = c.ICON,
                        Color    = c.Color
                    }).ToList();
                }
                else
                {
                    Boots = items.Where(c => c.Id == 1).Select(c => new DRItemView
                    {
                        Id       = c.Id,
                        NAME     = c.NAME,
                        Link     = c.LINK,
                        IconSize = iconSize,
                        IconPath = c.ICON,
                        Color    = c.Color
                    }).ToList();
                }
                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.Hauberk.Id).Select(a => a.LvlSet).FirstOrDefault();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.Hauberk.Id).Select(b => b.Style).FirstOrDefault();
                Hauberk    = items.Where(c => c.Slot == 6 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.Shoulders.Id).Select(a => a.LvlSet).FirstOrDefault();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.Shoulders.Id).Select(b => b.Style).FirstOrDefault();
                Shoulders  = items.Where(c => c.Slot == 7 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.Bangle.Id).Select(a => a.LvlSet).FirstOrDefault();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.Bangle.Id).Select(b => b.Style).FirstOrDefault();
                Bangle     = items.Where(c => c.Slot == 8 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.Helmet.Id).Select(a => a.LvlSet).FirstOrDefault();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.Helmet.Id).Select(b => b.Style).FirstOrDefault();
                Helmet     = items.Where(c => c.Slot == 9 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
                tempLvlSet = dbItems.DRItems.Where(a => a.Id == _clothes.Bow.Id).Select(a => a.LvlSet).FirstOrDefault();
                tempStyle  = dbItems.DRItems.Where(b => b.Id == _clothes.Bow.Id).Select(b => b.Style).FirstOrDefault();
                Bow        = items.Where(c => c.Slot == 10 && c.LvlSet <= tempLvlSet && c.Style == tempStyle || c.Id == 1).Select(c => new DRItemView
                {
                    Id       = c.Id,
                    NAME     = c.NAME,
                    Link     = c.LINK,
                    IconSize = iconSize,
                    IconPath = c.ICON,
                    Color    = c.Color
                }).ToList();
            }
        }