Пример #1
0
        //    // 强化需求 [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);
        }