/// <summary> /// 装备一级属性判断 /// </summary> /// <param name="goodsData"></param> /// <returns></returns> public int EquipFirstPropCondition(GameClient client, SystemXmlItem systemGoods = null) { int nNeedStrength = 0; // 力量 int nNeedIntelligence = 0; // 智力 int nNeedDexterity = 0; // 敏捷 int nNeedConstitution = 0; // 体力 nNeedStrength = systemGoods.GetIntValue("Strength"); nNeedIntelligence = systemGoods.GetIntValue("Intelligence"); nNeedDexterity = systemGoods.GetIntValue("Dexterity"); nNeedConstitution = systemGoods.GetIntValue("Constitution"); if (nNeedStrength > 0 && nNeedStrength > RoleAlgorithm.GetStrength(client)) { return(-1); } if (nNeedIntelligence > 0 && nNeedIntelligence > RoleAlgorithm.GetIntelligence(client)) { return(-2); } if (nNeedDexterity > 0 && nNeedDexterity > RoleAlgorithm.GetDexterity(client)) { return(-3); } if (nNeedConstitution > 0 && nNeedConstitution > RoleAlgorithm.GetConstitution(client)) { return(-4); } return(1); }
private static List <double[]> GetCachingPropsList(SingleEquipProps singleEquipPropsMgr, int occupation, SystemXmlItem systemGoods) { int categoriy = systemGoods.GetIntValue("Categoriy", -1); int suitID = systemGoods.GetIntValue("SuitID", -1); return(singleEquipPropsMgr.GetSingleEquipPropsList(occupation, categoriy, suitID)); }
public static void InitAllForgeLevelInfo() { lock (AllThingsCalcItem.QiangHuaFuJiaItemList) { SystemXmlItems xmlitems = new SystemXmlItems(); xmlitems.LoadFromXMlFile("Config/QiangHuaFuJia.xml", "", "ID", 0); AllThingsCalcItem.QiangHuaFuJiaItemList.Clear(); foreach (KeyValuePair <int, SystemXmlItem> kv in xmlitems.SystemXmlItemDict) { SystemXmlItem item = kv.Value; QiangHuaFuJiaItem qiangHuaFuJiaItem = new QiangHuaFuJiaItem(); qiangHuaFuJiaItem.Id = item.GetIntValue("ID", -1); qiangHuaFuJiaItem.Level = item.GetIntValue("QiangHuaLevel", -1); qiangHuaFuJiaItem.Num = item.GetIntValue("Num", -1); qiangHuaFuJiaItem.AddAttackInjurePercent = item.GetDoubleValue("AddAttackInjurePercent"); qiangHuaFuJiaItem.MaxLifePercent = item.GetDoubleValue("MaxLifePercent"); AllThingsCalcItem.QiangHuaFuJiaItemList.Add(qiangHuaFuJiaItem); } AllThingsCalcItem.QiangHuaFuJiaItemList.Sort((QiangHuaFuJiaItem x, QiangHuaFuJiaItem y) => x.Id - y.Id); for (int i = 0; i < AllThingsCalcItem.QiangHuaFuJiaItemList.Count; i++) { AllThingsCalcItem.QiangHuaFuJiaItemList[i].Id = i + 1; } } }
/// <summary> /// 根据物品ID获取装备进阶项 /// </summary> /// <param name="goodsID"></param> /// <returns></returns> public static SystemXmlItem GetEquipUpgradeItemByGoodsID(int goodsID, int maxSuiItID) { SystemXmlItem systemGoods = null; if (!GameManager.SystemGoods.SystemXmlItemDict.TryGetValue(goodsID, out systemGoods)) { return(null); } int categoriy = systemGoods.GetIntValue("Categoriy"); if (categoriy < 0 || categoriy >= (int)ItemCategories.EquipMax) { return(null); } int suitID = systemGoods.GetIntValue("SuitID"); if (suitID < 1 || suitID > maxSuiItID) { suitID = 1; } return(GetEquipUpgradeCacheItem(categoriy, suitID)); }
/// <summary> /// 解析五行奇阵的奖励项 /// </summary> /// <param name="systemXmlItem"></param> public static void ParseWuXingAwardItem(SystemXmlItem systemXmlItem) { List <GoodsData> goodsDataList = null; string goodsIDs = systemXmlItem.GetStringValue("GoodsIDs"); if (!string.IsNullOrEmpty(goodsIDs)) { string[] fields = goodsIDs.Split('|'); if (fields.Length > 0) { goodsDataList = ParseGoodsDataList(fields); } else { LogManager.WriteLog(LogTypes.Error, string.Format("解析WuXingAwards.xml配置项中的物品奖励失败, MapCode={0}", systemXmlItem.GetIntValue("MapCode"))); } } else { LogManager.WriteLog(LogTypes.Error, string.Format("解析WuXingAwards.xml配置项中的物品奖励失败, MapCode={0}", systemXmlItem.GetIntValue("MapCode"))); } TheWuXingMapAwardItem = new WuXingMapAwardItem() { MapCode = systemXmlItem.GetIntValue("MapCode"), Money1 = systemXmlItem.GetIntValue("Moneyaward"), ExpXiShu = systemXmlItem.GetDoubleValue("ExpXiShu"), GoodsDataList = goodsDataList, MinBlessPoint = systemXmlItem.GetIntValue("MinBlessPoint"), MaxBlessPoint = systemXmlItem.GetIntValue("MaxBlessPoint"), }; }
public static SystemXmlItem GetEquipUpgradeItemByGoodsID(int goodsID, int maxSuiItID) { SystemXmlItem systemGoods = null; SystemXmlItem result; if (!GameManager.SystemGoods.SystemXmlItemDict.TryGetValue(goodsID, out systemGoods)) { result = null; } else { int categoriy = systemGoods.GetIntValue("Categoriy", -1); if (categoriy < 0 || categoriy >= 49) { result = null; } else { int suitID = systemGoods.GetIntValue("SuitID", -1); if (suitID < 1 || suitID > maxSuiItID) { suitID = 1; } result = EquipUpgradeCacheMgr.GetEquipUpgradeCacheItem(categoriy, suitID); } } return(result); }
/// <summary> /// 初始化套装强化加成信息 /// </summary> public static void InitAllForgeLevelInfo() { lock (QiangHuaFuJiaItemList) { SystemXmlItems xmlitems = new SystemXmlItems(); xmlitems.LoadFromXMlFile("Config/QiangHuaFuJia.xml", "", "ID"); SystemXmlItem item = null; QiangHuaFuJiaItemList.Clear(); foreach (var kv in xmlitems.SystemXmlItemDict) { item = kv.Value; QiangHuaFuJiaItem qiangHuaFuJiaItem = new QiangHuaFuJiaItem(); qiangHuaFuJiaItem.Id = item.GetIntValue("ID"); qiangHuaFuJiaItem.Level = item.GetIntValue("QiangHuaLevel"); qiangHuaFuJiaItem.Num = item.GetIntValue("Num"); qiangHuaFuJiaItem.AddAttackInjurePercent = item.GetDoubleValue("AddAttackInjurePercent"); qiangHuaFuJiaItem.MaxLifePercent = item.GetDoubleValue("MaxLifePercent"); QiangHuaFuJiaItemList.Add(qiangHuaFuJiaItem); } QiangHuaFuJiaItemList.Sort((x, y) => { return(x.Id - y.Id); }); for (int i = 0; i < QiangHuaFuJiaItemList.Count; i++) { QiangHuaFuJiaItemList[i].Id = i + 1; } } }
/// <summary> /// 清空DailyActive数据 /// </summary> /// <returns></returns> public static bool CheckLevCondition(GameClient client, int daTpye) { SystemXmlItem itemDailyActive = null; GameManager.systemDailyActiveInfo.SystemXmlItemDict.TryGetValue(daTpye, out itemDailyActive); if (null == itemDailyActive) { return(false); } // 条件 int MinZhuanshengleve = -1; MinZhuanshengleve = itemDailyActive.GetIntValue("MinZhuanshengleve"); if (client.ClientData.ChangeLifeCount < MinZhuanshengleve) { return(false); } else if (client.ClientData.ChangeLifeCount == itemDailyActive.GetIntValue("MinZhuanshengleve")) { int nLev = -1; nLev = itemDailyActive.GetIntValue("Minleve"); if (client.ClientData.Level < nLev) { return(false); } } return(true); }
public void AddSkillCoolDownForMonster(Monster monster, int skillID) { SystemXmlItem systemMagic = null; if (GameManager.SystemMagicQuickMgr.MagicItemsDict.TryGetValue(skillID, out systemMagic)) { int cdTime = systemMagic.GetIntValue("CDTime", -1); if (cdTime > 0) { int pubCDTime = systemMagic.GetIntValue("PubCDTime", -1); long nowTicks = TimeUtil.NOW(); Global.AddCoolDownItem(this.SkillCoolDownDict, skillID, nowTicks, (long)(cdTime * 1000)); if (null != monster.MonsterInfo.SkillIDs) { for (int i = 0; i < monster.MonsterInfo.SkillIDs.Length; i++) { if (pubCDTime > 0) { Global.AddCoolDownItem(this.SkillCoolDownDict, monster.MonsterInfo.SkillIDs[i], nowTicks, (long)pubCDTime); } } } } } }
public bool ProcessJoinCmd(GameClient client, int nID, byte[] bytes, string[] cmdParams) { try { SceneUIClasses sceneType = Global.GetMapSceneType(client.ClientData.MapCode); if (sceneType != SceneUIClasses.Normal) { client.sendCmd(nID, "-21".ToString(), false); return(true); } if (!this.IsGongNengOpened(client, true)) { client.sendCmd(nID, "-2001".ToString(), false); return(true); } if (client.ClientData.SignUpGameType != 0) { client.sendCmd(nID, "-2002".ToString(), false); return(true); } if (KuaFuManager.getInstance().IsInCannotJoinKuaFuCopyTime(client)) { client.sendCmd(nID, "-2004".ToString(), false); return(true); } SystemXmlItem systemFuBenItem = null; if (!GameManager.systemFuBenMgr.SystemXmlItemDict.TryGetValue(this._runtimeData.CopyID, out systemFuBenItem)) { client.sendCmd(nID, "-3".ToString(), false); return(true); } int minLevel = systemFuBenItem.GetIntValue("MinLevel", -1); int minZhuanSheng = systemFuBenItem.GetIntValue("MinZhuanSheng", -1); int levelLimit = minZhuanSheng * 100 + minLevel; if (client.ClientData.ChangeLifeCount * 100 + client.ClientData.Level < levelLimit) { client.sendCmd(nID, "-19".ToString(), false); return(true); } int oldCount = this.GetElementWarCount(client); if (oldCount >= systemFuBenItem.GetIntValue("FinishNumber", -1)) { client.sendCmd(nID, "-16".ToString(), false); return(true); } int result = 0; if (result > 0) { client.ClientData.SignUpGameType = 4; GlobalNew.UpdateKuaFuRoleDayLogData(client.ServerId, client.ClientData.RoleID, TimeUtil.NowDateTime(), client.ClientData.ZoneID, 1, 0, 0, 0, 4); } client.sendCmd <int>(nID, result, false); return(true); } catch (Exception ex) { DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(client.ClientSocket), false, false); } return(false); }
/// <summary> /// 解析任务装备奖励 /// </summary> /// <param name="fields"></param> /// <param name="taskAwards"></param> private void ParseTaskAwardsItem(string awardsStr, out AwardsItemData taskAwards) { // 物品通用奖励改造 [1/7/2014 LiaoWei] taskAwards = null; string[] fields = awardsStr.Split(','); if (fields.Length != 7) { return; } SystemXmlItem systemGoods = null; if (!GameManager.SystemGoods.SystemXmlItemDict.TryGetValue(Convert.ToInt32(fields[0]), out systemGoods)) { LogManager.WriteLog(LogTypes.Error, string.Format("解析任务装备奖励时,物品不存在: GoodsID={0}", Convert.ToInt32(fields[0]))); return; } taskAwards = new AwardsItemData() { Occupation = (null == systemGoods) ? -1 : systemGoods.GetIntValue("ToOccupation"), //取的物品本身的职业 RoleSex = (null == systemGoods) ? -1 : systemGoods.GetIntValue("ToSex"), //取的物品本身的职业 GoodsID = Convert.ToInt32(fields[0]), GoodsNum = Convert.ToInt32(fields[1]), Binding = Convert.ToInt32(fields[2]), Level = Convert.ToInt32(fields[3]), AppendLev = Convert.ToInt32(fields[4]), // 追加等级 IsHaveLuckyProp = Convert.ToInt32(fields[5]), // 是否有幸运属性 ExcellencePorpValue = Convert.ToInt32(fields[6]), // 卓越属性值 EndTime = Global.ConstGoodsEndTime, }; }
private static void ParseXmlItem(SystemXmlItem systemXmlItem, List <PopupWinItem> popupWinItemList) { int id = systemXmlItem.GetIntValue("ID", -1); int hintFileID = systemXmlItem.GetIntValue("HintFileID", -1); string times = systemXmlItem.GetStringValue("Times"); if (!string.IsNullOrEmpty(times)) { PopupWinTimeItem[] popupWinTimeItemArray = PopupWinMgr.ParsePopupWinTimeItems(times); if (null == popupWinTimeItemArray) { LogManager.WriteLog(LogTypes.Error, string.Format("解析弹窗配置表中的时间项为数组时失败, ID={0}", id), null, true); } else { PopupWinItem popupWinItem = new PopupWinItem { ID = id, HintFileID = hintFileID, Times = popupWinTimeItemArray }; popupWinItemList.Add(popupWinItem); } } }
/// <summary> /// 配置的功能是否开启 /// </summary> /// <param name="client"></param> /// <param name="id"></param> /// <returns></returns> public static bool IsGongNengOpened(GameClient client, GongNengIDs id) { SystemXmlItem xmlItem = null; if (GameManager.SystemSystemOpen.SystemXmlItemDict.TryGetValue((int)id, out xmlItem)) { int trigger = xmlItem.GetIntValue("TriggerCondition"); if (trigger == 7) { if (client.ClientData.MainTaskID < xmlItem.GetIntValue("TimeParameters")) { return(false); } return(true); } else if (trigger == 1) { int[] paramArray = xmlItem.GetIntArrayValue("TimeParameters"); if (paramArray.Length == 2) { if (Global.GetUnionLevel(paramArray[0], paramArray[1]) > Global.GetUnionLevel(client)) { return(false); } } return(true); } } return(true); }
public int EquipFirstPropCondition(GameClient client, SystemXmlItem systemGoods = null) { int nNeedStrength = systemGoods.GetIntValue("Strength", -1); int nNeedIntelligence = systemGoods.GetIntValue("Intelligence", -1); int nNeedDexterity = systemGoods.GetIntValue("Dexterity", -1); int nNeedConstitution = systemGoods.GetIntValue("Constitution", -1); int result; if (nNeedStrength > 0 && (double)nNeedStrength > RoleAlgorithm.GetStrength(client, true)) { result = -1; } else if (nNeedIntelligence > 0 && (double)nNeedIntelligence > RoleAlgorithm.GetIntelligence(client, true)) { result = -2; } else if (nNeedDexterity > 0 && (double)nNeedDexterity > RoleAlgorithm.GetDexterity(client, true)) { result = -3; } else if (nNeedConstitution > 0 && (double)nNeedConstitution > RoleAlgorithm.GetConstitution(client, true)) { result = -4; } else { result = 1; } return(result); }
/// <summary> /// 添加技能冷却 /// </summary> /// <param name="magicCode"></param> public void AddSkillCoolDownForMonster(Monster monster, int skillID) { SystemXmlItem systemMagic = null; if (!GameManager.SystemMagicQuickMgr.MagicItemsDict.TryGetValue(skillID, out systemMagic)) { return; } int cdTime = systemMagic.GetIntValue("CDTime"); if (cdTime <= 0) //不需要CD时间 { return; } int pubCDTime = systemMagic.GetIntValue("PubCDTime"); long nowTicks = DateTime.Now.Ticks / 10000; Global.AddCoolDownItem(SkillCoolDownDict, skillID, nowTicks, cdTime * 1000); if (null != monster.MonsterInfo.SkillIDs) { for (int i = 0; i < monster.MonsterInfo.SkillIDs.Length; i++) { if (pubCDTime > 0) { Global.AddCoolDownItem(SkillCoolDownDict, monster.MonsterInfo.SkillIDs[i], nowTicks, pubCDTime * 1000); } } } }
/// <summary> /// 添加物品冷却 /// </summary> /// <param name="magicCode"></param> public void AddGoodsCoolDown(GameClient client, int goodsID) { // 物品名字索引管理 SystemXmlItem systemGoods = null; if (!GameManager.SystemGoods.SystemXmlItemDict.TryGetValue(goodsID, out systemGoods)) { return; } int cdTime = systemGoods.GetIntValue("CDTime"); if (cdTime <= 0) //不需要CD时间 { return; } int pubCDTime = systemGoods.GetIntValue("PubCDTime"); int cdGroup = systemGoods.GetIntValue("ShareGroupID"); long nowTicks = TimeUtil.NOW(); Global.AddCoolDownItem(GoodsCoolDownDict, goodsID, nowTicks, cdTime * 1000); if (cdGroup > 0) { if (null != client.ClientData.GoodsDataList) { for (int i = 0; i < client.ClientData.GoodsDataList.Count; i++) { GoodsData goodsData = client.ClientData.GoodsDataList[i]; if (null == goodsData) { continue; } if (goodsData.Using > 0) { continue; } SystemXmlItem systemGoods2 = null; if (!GameManager.SystemGoods.SystemXmlItemDict.TryGetValue(goodsData.GoodsID, out systemGoods2)) { continue; } if (null == systemGoods2) { continue; } if (cdGroup == systemGoods2.GetIntValue("ShareGroupID")) //同组 { Global.AddCoolDownItem(GoodsCoolDownDict, goodsData.GoodsID, nowTicks, pubCDTime * 1000); } } } } }
public void LoadNPCTasks(SystemXmlItems systemTasks) { Dictionary <int, List <int> > sourceNPCTasksDict = new Dictionary <int, List <int> >(); Dictionary <int, List <int> > destNPCTasksDict = new Dictionary <int, List <int> >(); foreach (int key in systemTasks.SystemXmlItemDict.Keys) { SystemXmlItem systemTask = systemTasks.SystemXmlItemDict[key]; this.AddSourceNPCTask(systemTask.GetIntValue("SourceNPC", -1), systemTask.GetIntValue("ID", -1), sourceNPCTasksDict); this.AddDestNPCTask(systemTask.GetIntValue("DestNPC", -1), systemTask.GetIntValue("ID", -1), destNPCTasksDict); } this._SourceNPCTasksDict = sourceNPCTasksDict; this._DestNPCTasksDict = destNPCTasksDict; }
private void ParseTaskAwardsItem(string awardsStr, out AwardsItemData taskAwards) { taskAwards = null; string[] fields = awardsStr.Split(new char[] { ',' }); if (fields.Length == 7) { SystemXmlItem systemGoods = null; if (!GameManager.SystemGoods.SystemXmlItemDict.TryGetValue(Convert.ToInt32(fields[0]), out systemGoods)) { LogManager.WriteLog(LogTypes.Error, string.Format("解析任务装备奖励时,物品不存在: GoodsID={0}", Convert.ToInt32(fields[0])), null, true); } else { taskAwards = new AwardsItemData { Occupation = ((systemGoods == null) ? -1 : Global.GetMainOccupationByGoodsID(Convert.ToInt32(fields[0]))), RoleSex = ((systemGoods == null) ? -1 : systemGoods.GetIntValue("ToSex", -1)), GoodsID = Convert.ToInt32(fields[0]), GoodsNum = Convert.ToInt32(fields[1]), Binding = Convert.ToInt32(fields[2]), Level = Convert.ToInt32(fields[3]), AppendLev = Convert.ToInt32(fields[4]), IsHaveLuckyProp = Convert.ToInt32(fields[5]), ExcellencePorpValue = Convert.ToInt32(fields[6]), EndTime = "1900-01-01 12:00:00" }; } } }
public int FindBindYuanBao(int taskID) { int bindYuanBao = -1; lock (this._BindYuanBaoDict) { if (this._BindYuanBaoDict.TryGetValue(taskID, out bindYuanBao)) { return(bindYuanBao); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = bindYuanBao; } else { bindYuanBao = systemTask.GetIntValue("BindYuanBao", -1); lock (this._BindYuanBaoDict) { this._BindYuanBaoDict[taskID] = bindYuanBao; } result = bindYuanBao; } return(result); }
public int FindCompDonate(GameClient client, int taskID) { int nCompDonate = -1; lock (this._CompDonateAwardDict) { if (this._CompDonateAwardDict.TryGetValue(taskID, out nCompDonate)) { return(nCompDonate); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = nCompDonate; } else { nCompDonate = systemTask.GetIntValue("AwardCompHonor", -1); lock (this._CompDonateAwardDict) { this._CompDonateAwardDict[taskID] = nCompDonate; } result = nCompDonate; } return(result); }
public int FindCompJunXian(GameClient client, int taskID) { int nCompJunXian = -1; lock (this._CompJunXianAwardDict) { if (this._CompJunXianAwardDict.TryGetValue(taskID, out nCompJunXian)) { return(nCompJunXian); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = nCompJunXian; } else { nCompJunXian = systemTask.GetIntValue("AwardCompFeast", -1); lock (this._CompJunXianAwardDict) { this._CompJunXianAwardDict[taskID] = nCompJunXian; } result = nCompJunXian; } return(result); }
public int FindMoJing(GameClient client, int taskID) { int nJingYuan = -1; lock (this._JingYuanDict) { if (this._JingYuanDict.TryGetValue(taskID, out nJingYuan)) { return(nJingYuan); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = nJingYuan; } else { nJingYuan = systemTask.GetIntValue("MoJing", -1); lock (this._JingYuanDict) { this._JingYuanDict[taskID] = nJingYuan; } result = nJingYuan; } return(result); }
public int FindXingHun(GameClient client, int taskID) { int nXinghun = -1; lock (this._XinHunAwardDict) { if (this._XinHunAwardDict.TryGetValue(taskID, out nXinghun)) { return(nXinghun); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = nXinghun; } else { nXinghun = systemTask.GetIntValue("Xinghun", -1); lock (this._XinHunAwardDict) { this._XinHunAwardDict[taskID] = nXinghun; } result = nXinghun; } return(result); }
public int FindRongYu(GameClient client, int taskID) { int rongYu = -1; lock (this._RongYuDict) { if (this._RongYuDict.TryGetValue(taskID, out rongYu)) { return(rongYu); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = rongYu; } else { rongYu = systemTask.GetIntValue("RongYu", -1); lock (this._RongYuDict) { this._RongYuDict[taskID] = rongYu; } result = rongYu; } return(result); }
public int FindJunGong(GameClient client, int taskID) { int junGong = -1; lock (this._JunGongDict) { if (this._JunGongDict.TryGetValue(taskID, out junGong)) { return(junGong); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = junGong; } else { junGong = systemTask.GetIntValue("JunGong", -1); lock (this._JunGongDict) { this._JunGongDict[taskID] = junGong; } result = junGong; } return(result); }
public int FindBlessPoint(int taskID) { int blessPoint = -1; lock (this._BlessPointDict) { if (this._BlessPointDict.TryGetValue(taskID, out blessPoint)) { return(blessPoint); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = blessPoint; } else { blessPoint = systemTask.GetIntValue("BlessPoint", -1); lock (this._BlessPointDict) { this._BlessPointDict[taskID] = blessPoint; } result = blessPoint; } return(result); }
public int FindLingLi(int taskID) { int lingLi = -1; lock (this._LingLiDict) { if (this._LingLiDict.TryGetValue(taskID, out lingLi)) { return(lingLi); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = lingLi; } else { lingLi = systemTask.GetIntValue("LingLi", -1); lock (this._LingLiDict) { this._LingLiDict[taskID] = lingLi; } result = lingLi; } return(result); }
public int FindYinLiang(int taskID) { int yinLiang = -1; lock (this._YinLiangDict) { if (this._YinLiangDict.TryGetValue(taskID, out yinLiang)) { return(yinLiang); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = yinLiang; } else { yinLiang = systemTask.GetIntValue("Moneyaward", -1); lock (this._YinLiangDict) { this._YinLiangDict[taskID] = yinLiang; } result = yinLiang; } return(result); }
public static void LoadEquipQianHuaProps() { XElement xml = null; string fileName = ""; try { fileName = string.Format("Config/QiangHua.xml", new object[0]); xml = XElement.Load(Global.GameResPath(fileName)); if (null == xml) { throw new Exception(string.Format("加载系统xml配置文件:{0}, 失败。没有找到相关XML配置文件!", fileName)); } } catch (Exception) { throw new Exception(string.Format("加载系统xml配置文件:{0}, 失败。没有找到相关XML配置文件!", fileName)); } Dictionary <int, List <ChuanQiQianHuaItem> > dict = new Dictionary <int, List <ChuanQiQianHuaItem> >(); IEnumerable <XElement> xmlItems = xml.Elements("QiangHua"); foreach (XElement xmltem in xmlItems) { SystemXmlItem systemXmlItem = new SystemXmlItem { XMLNode = xmltem }; int id = systemXmlItem.GetIntValue("ID", -1); dict[id] = ChuanQiQianHua.ParseSystemXmlItem(systemXmlItem); } ChuanQiQianHua.QianHuaItemDict = dict; }
public int FindMoney(int taskID) { int money = -1; lock (this._MoneyDict) { if (this._MoneyDict.TryGetValue(taskID, out money)) { return(money); } } SystemXmlItem systemTask = null; int result; if (!GameManager.SystemTasksMgr.SystemXmlItemDict.TryGetValue(taskID, out systemTask)) { result = money; } else { money = systemTask.GetIntValue("BindMoneyaward", -1); lock (this._MoneyDict) { this._MoneyDict[taskID] = money; } result = money; } return(result); }