public a3_EquipData getEquipByItemId(uint id) { a3_EquipData result = default(a3_EquipData); SXML sXML = XMLMgr.instance.GetSXML("item.item", "id==" + id); result.tpid = new uint?(id); result.color = sXML.getUint("colour"); result.intensify_lv = sXML.getInt("intensify_lv"); result.add_level = sXML.getInt("add_level"); result.add_exp = sXML.getInt("add_exp"); result.stage = sXML.getInt("stage"); result.blessing_lv = sXML.getInt("blessing_lv"); result.combpt = sXML.getInt("combpt"); result.eqp_level = sXML.getInt("equip_level"); result.eqp_type = sXML.getInt("equip_type"); result.subjoin_att = new Dictionary <int, int>(); result.gem_att = new Dictionary <int, int>(); result.attribute = sXML.getInt("prefix_name"); SXML sXML2 = XMLMgr.instance.GetSXML("item", ""); SXML node = sXML2.GetNode("item", "id==" + id); SXML sXML3 = XMLMgr.instance.GetSXML("activate_fun.eqp", "eqp_type==" + node.getInt("equip_type")); SXML sXML4 = (sXML3 != null) ? sXML3.GetNode("prefix_fun", "id==" + sXML.getInt("prefix_name")) : null; result.att_type = ((sXML4 != null) ? sXML4.getInt("funtype") : 0); result.att_value = sXML.getInt("att_value"); return(result); }
public List <MatInfo> GetMatListById(uint tpid) { a3_EquipData equip = a3_EquipModel.getInstance().getEquipByItemId(tpid); List <MatInfo> listMat = new List <MatInfo>(); if (dicSmithyInfo.ContainsKey(tpid)) { for (int i = 0; i < dicSmithyInfo[tpid].Count; i++) { listMat.Add(new MatInfo { tpid = dicSmithyInfo[tpid][i].tpid, num = dicSmithyInfo[tpid][i].num }); } } return(listMat); }
public List <MatInfo> GetMatListById(uint tpid) { a3_EquipData equipByItemId = ModelBase <a3_EquipModel> .getInstance().getEquipByItemId(tpid); List <MatInfo> list = new List <MatInfo>(); bool flag = this.dicSmithyInfo.ContainsKey(tpid); if (flag) { for (int i = 0; i < this.dicSmithyInfo[tpid].Count; i++) { list.Add(new MatInfo { tpid = this.dicSmithyInfo[tpid][i].tpid, num = this.dicSmithyInfo[tpid][i].num }); } } return(list); }
private bool CheckUp(Dictionary <uint, a3_BagItemData> equips, a3_EquipModel.EquipStrengthOption checkOption) { List <uint> list = new List <uint>(equips.Keys); bool result; switch (checkOption) { case a3_EquipModel.EquipStrengthOption.None: case a3_EquipModel.EquipStrengthOption.Intensify | a3_EquipModel.EquipStrengthOption.Stage: case a3_EquipModel.EquipStrengthOption.Intensify | a3_EquipModel.EquipStrengthOption.Add: case a3_EquipModel.EquipStrengthOption.Stage | a3_EquipModel.EquipStrengthOption.Add: case a3_EquipModel.EquipStrengthOption.Intensify | a3_EquipModel.EquipStrengthOption.Stage | a3_EquipModel.EquipStrengthOption.Add: IL_3B: break; case a3_EquipModel.EquipStrengthOption.Intensify: for (int i = 0; i < list.Count; i++) { uint key = (uint)(equips[list[i]].equipdata.intensify_lv + 1); bool flag = !ModelBase <a3_BagModel> .getInstance().EqpIntensifyLevelInfo.ContainsKey(key); if (!flag) { int intensifyCharge = ModelBase <a3_BagModel> .getInstance().EqpIntensifyLevelInfo[key].intensifyCharge; Dictionary <uint, int> intensifyMaterials = ModelBase <a3_BagModel> .getInstance().EqpIntensifyLevelInfo[key].intensifyMaterials; List <uint> list2 = new List <uint>(intensifyMaterials.Keys); bool flag2 = (ulong)ModelBase <PlayerModel> .getInstance().money >= (ulong)((long)intensifyCharge); if (flag2) { int j; for (j = 0; j < list2.Count; j++) { bool flag3 = ModelBase <a3_BagModel> .getInstance().getItemNumByTpid(list2[j]) < intensifyMaterials[list2[j]]; if (flag3) { break; } } bool flag4 = list2.Count == j; if (flag4) { result = true; return(result); } } } } goto IL_67B; case a3_EquipModel.EquipStrengthOption.Stage: for (int k = 0; k < list.Count; k++) { int num = equips[list[k]].equipdata.stage + 1; List <Dictionary <uint, EqpStageLvInfo> > eqpStageInfo = ModelBase <a3_BagModel> .getInstance().EqpStageInfo; bool flag5 = eqpStageInfo.Count < num + 1; if (!flag5) { EqpStageLvInfo eqpStageLvInfo = eqpStageInfo[equips[list[k]].equipdata.stage][equips[list[k]].tpid]; bool flag6 = ModelBase <PlayerModel> .getInstance().up_lvl >= eqpStageLvInfo.reincarnation && ModelBase <PlayerModel> .getInstance().lvl >= eqpStageLvInfo.lv && ModelBase <PlayerModel> .getInstance().money >= eqpStageLvInfo.upstageCharge; if (flag6) { List <A3_CharacterAttribute> list3 = new List <A3_CharacterAttribute>(eqpStageLvInfo.equipLimit.Keys); bool flag7 = true; for (int l = 0; l < list3.Count; l++) { A3_CharacterAttribute a3_CharacterAttribute = list3[l]; A3_CharacterAttribute a3_CharacterAttribute2 = a3_CharacterAttribute; switch (a3_CharacterAttribute2) { case A3_CharacterAttribute.Strength: flag7 &= ((ulong)ModelBase <PlayerModel> .getInstance().strength >= (ulong)((long)eqpStageLvInfo.equipLimit[a3_CharacterAttribute])); break; case A3_CharacterAttribute.Agility: flag7 &= ((ulong)ModelBase <PlayerModel> .getInstance().agility >= (ulong)((long)eqpStageLvInfo.equipLimit[a3_CharacterAttribute])); break; case A3_CharacterAttribute.Constitution: flag7 &= ((ulong)ModelBase <PlayerModel> .getInstance().constitution >= (ulong)((long)eqpStageLvInfo.equipLimit[a3_CharacterAttribute])); break; case A3_CharacterAttribute.Intelligence: flag7 &= ((ulong)ModelBase <PlayerModel> .getInstance().intelligence >= (ulong)((long)eqpStageLvInfo.equipLimit[a3_CharacterAttribute])); break; default: if (a3_CharacterAttribute2 != A3_CharacterAttribute.Wisdom) { Debug.LogError(string.Format("配置表信息错误<装备进阶>:未知的人物属性Id:{0}", (int)a3_CharacterAttribute)); flag7 = false; } else { flag7 &= ((ulong)ModelBase <PlayerModel> .getInstance().wisdom >= (ulong)((long)eqpStageLvInfo.equipLimit[a3_CharacterAttribute])); } break; } } bool flag8 = flag7; if (flag8) { List <int> list4 = new List <int>(eqpStageLvInfo.upstageMaterials.Keys); int m; for (m = 0; m < list4.Count; m++) { bool flag9 = ModelBase <a3_BagModel> .getInstance().getItemNumByTpid((uint)list4[m]) < eqpStageLvInfo.upstageMaterials[list4[m]]; if (flag9) { break; } } bool flag10 = list4.Count == m; if (flag10) { result = true; return(result); } } } } } goto IL_67B; case a3_EquipModel.EquipStrengthOption.Add: for (int n = 0; n < list.Count; n++) { EqpStageLvInfo eqpStageLvInfo2 = ModelBase <a3_BagModel> .getInstance().EqpStageInfo[equips[list[n]].equipdata.stage][equips[list[n]].tpid]; bool flag11 = equips[list[n]].equipdata.add_level >= eqpStageLvInfo2.maxAddLv; if (!flag11) { uint add_level = (uint)equips[list[n]].equipdata.add_level; bool flag12 = !ModelBase <a3_BagModel> .getInstance().EqpAddInfo.ContainsKey(add_level); if (!flag12) { EqpAddConfInfo eqpAddConfInfo = ModelBase <a3_BagModel> .getInstance().EqpAddInfo[add_level]; bool flag13 = (ulong)ModelBase <PlayerModel> .getInstance().money <= (ulong)((long)eqpAddConfInfo.addCharge); if (!flag13) { bool flag14 = (long)ModelBase <a3_BagModel> .getInstance().getItemNumByTpid(eqpAddConfInfo.matId) <= (long)((ulong)eqpAddConfInfo.matNum); if (!flag14) { result = true; return(result); } } } } } goto IL_67B; case a3_EquipModel.EquipStrengthOption.Gem: for (int num2 = 0; num2 < list.Count; num2++) { a3_EquipData equipdata = equips[list[num2]].equipdata; List <EqpGemConfInfo> list5 = ModelBase <a3_BagModel> .getInstance().EqpGemInfo[equips[list[num2]].equipdata.stage][equips[list[num2]].tpid]; try { for (int num3 = 0; num3 < list5.Count; num3++) { bool flag15 = (long)equipdata.gem_att[list5[num3].attType] < (long)((ulong)list5[num3].attMax) && (long)ModelBase <a3_BagModel> .getInstance().getItemNumByTpid(list5[num3].gemId) >= (long)((ulong)list5[num3].gemNeedNum); if (flag15) { result = true; return(result); } } } catch (Exception) { Debug.LogError(string.Format("item.xml<宝石镶嵌>信息有误:物品id:{0}", equips[list[num2]].tpid)); } } goto IL_67B; } goto IL_3B; IL_67B: result = false; return(result); }