Пример #1
0
        public override bool TakeAction()
        {
            MosaicInfo mosaicInfo = new ConfigCacheSet<MosaicInfo>().FindKey(postion);
            if (mosaicInfo != null)
            {
                notchColor = mosaicInfo.MosaicColor;
            }
            var package = UserEnchant.Get(ContextUser.UserID);
            var itemPackage = UserItemPackage.Get(ContextUser.UserID);
            if (package == null || itemPackage == null)
                return false;

            UserItemInfo userItem = itemPackage.ItemPackage.Find(m => m.UserItemID == userItemID);
            if (userItem != null)
            {
                int openPostion = EnchantHelper.EnchantOpenGridNum(userItem.ItemLv);
                if (postion > openPostion)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1213_GridNumNotEnough;
                    return false;
                }
                var userEnchantInfo = package.EnchantPackage.Find(m => m.UserItemID == userItemID && m.Position == postion);
                if (userEnchantInfo != null)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1259_EnchantOpenGridFull;
                    return false;
                }
                List<UserEnchantInfo> enchantList = new List<UserEnchantInfo>();
                var enchantInfoArray = package.EnchantPackage.FindAll(m => string.IsNullOrEmpty(m.UserItemID));

                foreach (var info in enchantInfoArray)
                {
                    EnchantInfo enchantInfo = new ConfigCacheSet<EnchantInfo>().FindKey(info.EnchantID);
                    if (enchantInfo != null && EnchantHelper.IsMosaicColor(postion, enchantInfo.ColorType))
                    {
                        enchantList.Add(info);
                    }
                }
                if (enchantList.Count == 0)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1261_EnchantEquipmentNotEnough;
                    return false;
                }
                enchantArray = enchantList.GetPaging(pageIndex, pageSize, out PageCount).ToArray();
            }
            return true;
        }
Пример #2
0
        public override bool TakeAction()
        {
            string puUserID;
            if (string.IsNullOrEmpty(toUserID))
            {
                puUserID = ContextUser.UserID;
            }
            else
            {
                puUserID = toUserID;
                UserCacheGlobal.LoadOffline(puUserID);
            }
            UserGeneral general = new GameDataCacheSet<UserGeneral>().FindKey(puUserID, generalID);
            if (general == null)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                return false;
            }
            generalName = general.GeneralName;
            careerID = general.CareerID;
            var package = UserEnchant.Get(puUserID);
            UserItemInfo useritem = EnchantHelper.GetGeneralWeapon(general.UserID, general.GeneralID);
            if (useritem != null)
            {
                userItemID = useritem.UserItemID;
                ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(useritem.ItemID);
                if (itemInfo != null)
                {
                    itemName = itemInfo.ItemName;
                    headID = itemInfo.HeadID;
                }
                openNum = EnchantHelper.EnchantOpenGridNum(useritem.ItemLv);
                enchantArray = package.EnchantPackage.FindAll(m => m.UserItemID == useritem.UserItemID).ToArray();
            }

            return true;
        }
Пример #3
0
        public override bool TakeAction()
        {
            var package = UserEnchant.Get(ContextUser.UserID);
            if (package == null)
                return false;

            var userEnchantInfo = package.EnchantPackage.Find(m => m.UserEnchantID == userEnchantID);
            if (userEnchantInfo == null)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St1256_EnchantNotEnough;
                return false;
            }
            List<UserEnchantInfo> enchantList = new List<UserEnchantInfo>();
            var enchantInfoArray = package.EnchantPackage.FindAll(m => string.IsNullOrEmpty(m.UserItemID) && m.EnchantLv <= userEnchantInfo.EnchantLv);
            if (enchantInfoArray.Count == 0)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St1262_EnchantSynthesisNotEnough;
                return false;
            }
            foreach (var info in enchantInfoArray)
            {
                if (info.UserEnchantID == userEnchantID || info.CurrExprience > userEnchantInfo.CurrExprience)
                {
                    continue;
                }
                enchantList.Add(info);
            }
            enchantArray = enchantList.GetPaging(pageIndex, pageSize, out PageCount).ToArray();
            return true;
        }
Пример #4
0
 public override bool TakeAction()
 {
     GameUser user = null;
     string puUserID = string.Empty;
     if (!string.IsNullOrEmpty(toUserID))
     {
         puUserID = toUserID;
         user = UserCacheGlobal.LoadOffline(toUserID);
     }
     else
     {
         puUserID = ContextUser.UserID;
         user = new GameDataCacheSet<GameUser>().FindKey(ContextUser.UserID);
         UserFunction userFunction = new GameDataCacheSet<UserFunction>().FindKey(ContextUser.UserID,
                                                                                  FunctionEnum.Enchant);
         if (userFunction != null)
         {
             EnchantHelper.EnchantFunctionOpen(ContextUser);
         }
         else
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St_NoFun;
             return false;
         }
     }
     generalArray = new GameDataCacheSet<UserGeneral>().FindAll(puUserID, m => m.GeneralStatus == GeneralStatus.DuiWuZhong && m.GeneralType != GeneralType.Soul).ToArray();
     if (user != null)
     {
         goldNum = user.GoldNum;
         if (user.UserExtend != null)
         {
             enchantPackNum = user.UserExtend.EnchantGridNum;
             moShiNum = user.UserExtend.MoJingNum;
         }
     }
     package = UserEnchant.Get(puUserID);
     if (package != null && string.IsNullOrEmpty(toUserID))
     {
         var enchantsArray = package.EnchantPackage.FindAll(m => string.IsNullOrEmpty(m.UserItemID));
         enchantPackageArray = enchantsArray.GetPaging(pageIndex, pageSize, out pageCount).ToArray();
     }
     mosaicList = new ConfigCacheSet<MosaicInfo>().FindAll().ToArray();
     return true;
 }
Пример #5
0
 public override bool TakeAction()
 {
     GameUser user = null;
     string puUserID;
     if (string.IsNullOrEmpty(toUserID))
     {
         puUserID = ContextUser.UserID;
     }
     else
     {
         puUserID = toUserID;
         UserCacheGlobal.LoadOffline(puUserID);
     }
     user = new GameDataCacheSet<GameUser>().FindKey(puUserID);
     if (user != null)
     {
         goldNum = user.GoldNum;
         if (user.UserExtend != null)
         {
             moshiNum = user.UserExtend.MoJingNum;
             packNum = user.UserExtend.EnchantGridNum;
         }
     }
     var package = UserEnchant.Get(puUserID);
     if (package != null && string.IsNullOrEmpty(toUserID))
     {
         var enchantsLList = package.EnchantPackage.FindAll(m => string.IsNullOrEmpty(m.UserItemID));
         enchantArray = enchantsLList.GetPaging(pageIndex, pageSize, out pageCount).ToArray();
     }
     return true;
 }