public override bool TakeAction() { string puUserID; if (string.IsNullOrEmpty(toUserID)) { puUserID = ContextUser.UserID; } else { puUserID = toUserID; UserCacheGlobal.LoadOffline(puUserID); } var package = UserEnchant.Get(puUserID); if (package != null) { userEnchantInfo = package.EnchantPackage.Find(m => m.UserEnchantID == userEnchantID); if (userEnchantInfo != null) { finalMature = CombatHelper.EnchantFinalNum(userEnchantInfo); currExp = userEnchantInfo.CurrExprience; enchant = new ConfigCacheSet <EnchantInfo>().FindKey(userEnchantInfo.EnchantID); if (enchant != null) { enchantLvInfo = new ConfigCacheSet <EnchantLvInfo>().FindKey(enchant.EnchantID, userEnchantInfo.EnchantLv); short uplv = MathUtils.Addition(userEnchantInfo.EnchantLv, (short)1, (short)GameConfigSet.MaxEnchantLv); EnchantLvInfo enchantLv = new ConfigCacheSet <EnchantLvInfo>().FindKey(userEnchantInfo.EnchantID, uplv); upExp = enchantLv == null ? 0 : enchantLv.Experience; } } } return(true); }
public override bool TakeAction() { var package = UserEnchant.Get(ContextUser.UserID); if (package != null) { userEnchant = package.EnchantPackage.Find(m => m.UserEnchantID == userEnchantID); if (userEnchant != null) { matureNum = (decimal)userEnchant.MaxMature / GameConfigSet.MaxEnchantMature; maxMature = CombatHelper.EnchantFinalNum(userEnchant); enchantInfo = new ConfigCacheSet <EnchantInfo>().FindKey(userEnchant.EnchantID); EnchantLvInfo enchantLvInfo = new ConfigCacheSet <EnchantLvInfo>().FindKey(userEnchant.EnchantID, userEnchant.EnchantLv); if (enchantLvInfo != null) { abilityNum = TrumpHelper.GetTransformData(enchantLvInfo.Num); } } } enchantList = EnchantHelper.EnchantCultureList(); return(true); }