/// <summary> /// 注册球星启示录npc /// </summary> private void ReBuildRevelationNpc() { BuildCache(); var allnpcTemp = ConfigRevelationnpctempMgr.GetAll(); SqlHelper.ExecuteNonQuery(_connection, CommandType.Text, "Delete From Dic_Npc Where Type=3;Truncate table Config_RevelationNpcLink"); int index = 0; foreach (var item in allnpcTemp) { index++; DicNpcEntity entity = new DicNpcEntity(); entity.Idx = ShareUtil.GenerateComb(); entity.Type = 3; entity.Name = item.OpponentTeamName; entity.Logo = 1; entity.FormationId = item.FormationID; entity.FormationLevel = item.PlayerLevel; entity.TeammemberLevel = item.PlayerLevel; entity.PlayerCardStrength = item.PlayerCardStrength; entity.CoachId = 0; entity.DoTalent = GetDoTalent(); //主动天赋 entity.ManagerSkill = GetNodoManagerSkill(); //被动天赋和意志 int comb = 0; entity.DoWill = GetDoWill(ref comb); //主动意志 entity.CombLevel = item.PlayerLevel; entity.Buff = item.Buff; entity.TP1 = item.P1; entity.TP2 = item.P2; entity.TP3 = item.P3; entity.TP4 = item.P4; entity.TP5 = item.P5; entity.TP6 = item.P6; entity.TP7 = item.P7; entity.TE1 = 211071; entity.TE2 = 211076; entity.TE3 = 211072; entity.TE4 = 211073; entity.TE5 = 211074; entity.TE6 = 211075; entity.TE7 = 211077; entity.TS1 = "A031_40"; entity.TS2 = "A033_40"; entity.TS3 = "A027_40"; entity.TS4 = "A034_40"; entity.TS5 = "A030_40"; entity.TS6 = "A032_40"; entity.TS7 = "A028_40"; DicNpcMgr.Insert(entity); ConfigRevelationnpclinkMgr.Insert(new ConfigRevelationnpclinkEntity(index, item.MarkId, item.Schedule, entity.Idx)); m_curCount++; ProgressBar1.Value = m_curCount; lblProcess.Content = string.Format("进度:{0}/{1}", m_curCount, m_totalCount); } }
void InitCache() { _morale = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.RevelationMorale, 10); _addMoralePrice = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.RevelationPlusMorale, 300); _addDrawsPrice = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.RevelationDrawsPrice, 5); var subtractMorale = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.RevelationSubtractMorale); _maxSubtractMorale = CacheFactory.AppsettingCache.GetAppSettingToInt(EnumAppsetting.RevelationMaxSubtractMorale, 6); SubtractMoraleDic = new Dictionary <int, int>(); if (subtractMorale.Length > 0) { var subtracts = subtractMorale.Split('|'); foreach (var item in subtracts) { var items = item.Split(','); if (items.Length > 0) { SubtractMoraleDic.Add(ConvertHelper.ConvertToInt(items[0]), ConvertHelper.ConvertToInt(items[1])); } } } _markDic = new Dictionary <int, ConfigRevelationEntity>(); var allmarkInfo = ConfigRevelationMgr.GetAllFor(); foreach (var item in allmarkInfo) { var key = GetKey(item.MarkId, item.Schedule); if (!_markDic.ContainsKey(key)) { _markDic.Add(key, item); } } _drawList = ConfigRevelationdrawMgr.GetAll(); //勇气商城配置 _shopList = ConfigRevelationshopMgr.GetAll(); _shopDic = _shopList.ToDictionary(r => r.Idx, r => r); //获取所有NPC var npcList = ConfigRevelationnpclinkMgr.GetAll(); _npcList = npcList.ToDictionary(d => GetKey(d.SmallClearanceId, d.StageId), d => d); _shopRefreshDic = new Dictionary <int, int>(); var shopRefresh = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.RevelationRefrestShopPrice); if (shopRefresh.Length > 0) { var shopPrizeList = shopRefresh.Split(','); for (int i = 0; i < shopPrizeList.Length; i++) { var price = ConvertHelper.ConvertToInt(shopPrizeList[i]); _shopRefreshDic.Add(i, price); } } }