// // 强化需求 [7/19/2011 ivan edit] //public Item_Enhance Get_Equip_EnhanceLevel( int nIndexPacket) public Item_Enhance Get_Equip_EnhanceLevel(CObject_Item My_Equip) { Item_Enhance itemEnhance = new Item_Enhance(); if (My_Equip == null || My_Equip.GetItemClass() != ITEM_CLASS.ICLASS_EQUIP) { return(itemEnhance); } CObject_Item_Equip equip = My_Equip as CObject_Item_Equip; if (equip == null) { return(itemEnhance); } int enhanceID = equip.GetStrengthIndex(); _DBC_ITEM_ENHANCE pItemEnhance = ObjectSystem.EquipEnchanceDBC.Search_Index_EQU((int)enhanceID); if (pItemEnhance == null) { return(itemEnhance); } _DBC_ITEM_ENCHANCE_RATE pItemEnchanceRate = ObjectSystem.EquipEnchanceRateDBC.Search_Index_EQU(equip.GetCurrentDangCi()); float fRatio = pItemEnchanceRate.nDangCiRatio / 100.0f; pItemEnchanceRate = ObjectSystem.EquipEnchanceRateDBC.Search_Index_EQU((int)equip.GetItemType()); fRatio *= pItemEnchanceRate.nEquipPointRatio / 100.0f; itemEnhance.needMoney = (int)(fRatio * pItemEnhance.needMoney + 0.5f); itemEnhance.addProperty = pItemEnhance.attribute[0];// 因为增加属性的百分比都一样,所以只获取一个就够了[7/19/2011 ivan edit] return(itemEnhance); }
void ShowShengDangInfo(int index) { ShengDangItem = sItem[index]; ShengDangImageButton[0].UpdateItem(ShengDangItem.GetID()); int j = ShengDangPage[nTheIndex] * 10; for (int i = 0; i < 10; i++) { if (i + j >= sItem.Count) { ShengDangNames[i].Text = ""; ShengDangLevels[i].Text = ""; ShengDangRadios[i].Hide(true); } else { ShengDangNames[i].Text = sItem[i + j].GetName(); ShengDangLevels[i].Text = "档次:" + sItem[i + j].GetCurrentDangCi(); ShengDangRadios[i].Hide(false); } } int selectIndex = (int)ShengDangSelect[nTheIndex]; if (ShengDangPage[nTheIndex] == ShengDangPageRadio[nTheIndex]) { ShengDangRadios[selectIndex].Value = true; } else { ShengDangRadios[selectIndex].Value = false; } ShengDangPageNum.Text = (ShengDangPage[nTheIndex] + 1) + "/" + GetPageNum(); ShengDangPreEnchanceLevel.Text = "强化等级:" + CDataPool.Instance.GetStrengthLevelDesc(ShengDangItem.GetStrengthLevel()); if (ShengDangItem.GetCurrentDangCi() == -1) { ShengDangCurrentDangCi.Text = ""; ShengDangNextDangCi.Text = "档次1"; } else { ShengDangCurrentDangCi.Text = "档次:" + ShengDangItem.GetCurrentDangCi(); ShengDangNextDangCi.Text = "档次:" + (ShengDangItem.GetCurrentDangCi() + 1); } Lua_Item_LevelUp item = LifeAbility.Instance.Get_Equip_LevelUpMaterial(ShengDangItem.GetCurrentDangCi()); CObject_Item pItemObj1 = ObjectSystem.Instance.NewItem((uint)item.needItemID); CObject_Item pItemObj2 = ObjectSystem.Instance.NewItem((uint)item.needItemID2); CActionItem_Item actionItem1 = CActionSystem.Instance.GetAction_ItemID(pItemObj1.GetID()); CActionItem_Item actionItem2 = CActionSystem.Instance.GetAction_ItemID(pItemObj2.GetID()); MaterialName[0].Text = actionItem1.GetName(); MaterialName[1].Text = actionItem2.GetName(); MaterialButton[0].SetActionItemByActionId(actionItem1.GetID()); MaterialButton[1].SetActionItemByActionId(actionItem2.GetID()); int count1 = CDataPool.Instance.UserBag_CountItemByIDTable(item.needItemID); int count2 = CDataPool.Instance.UserBag_CountItemByIDTable(item.needItemID2); if (count1 >= item.needItemNum) { count1 = item.needItemNum; } else if (count1 == -1) { count1 = 0; } if (count2 >= item.needItem2Num) { count2 = item.needItem2Num; } else if (count2 == -1) { count2 = 0; } MaterialNum[0].Text = count1 + "/" + item.needItemNum; MaterialNum[1].Text = count2 + "/" + item.needItem2Num; ShengDangMoney.Text = item.money.ToString(); }