Exemplo n.º 1
0
        public void OnConfirmButtonCallBack()
        {
            List <StorageDataItemBase> storageItemList = new List <StorageDataItemBase>();

            if (this.storageDataItem is MaterialDataItem)
            {
                StorageDataItemBase item = new MaterialDataItem(ItemMetaDataReader.GetItemMetaDataByKey(this.storageDataItem.ID))
                {
                    number = this._sellItemNumber
                };
                storageItemList.Add(item);
            }
            else
            {
                storageItemList.Add(this.storageDataItem);
            }
            Singleton <NetworkManager> .Instance.RequestEquipmentSell(storageItemList);

            if (!(this.storageDataItem is MaterialDataItem) || (this.storageDataItem.number <= this._sellItemNumber))
            {
                Singleton <MainUIManager> .Instance.BackPageTo("StorageShowPageContext");

                this.Destroy();
            }
        }
Exemplo n.º 2
0
        private void ReturnMaterial(StorageDataItemBase input)
        {
            WeaponDataItem item    = input as WeaponDataItem;
            List <int>     evoPath = WeaponMetaDataReaderExtend.GetEvoPath(item.ID);
            int            num     = 0;

            foreach (int num2 in evoPath)
            {
                int accumulateExp = 0;
                if (num2 == item.ID)
                {
                    int expType = item.GetExpType();
                    int exp     = item.exp;
                    accumulateExp = EquipmentLevelMetaDataReaderExtend.GetAccumulateExp(item.level, expType) + exp;
                }
                else
                {
                    WeaponMetaData weaponMetaDataByKey = WeaponMetaDataReader.GetWeaponMetaDataByKey(num2);
                    int            type = weaponMetaDataByKey.expType;
                    accumulateExp = EquipmentLevelMetaDataReaderExtend.GetAccumulateExp(weaponMetaDataByKey.maxLv, type);
                }
                num += accumulateExp;
            }
            float num9  = Singleton <PlayerModule> .Instance.playerData.disjoin_equipment_back_exp_percent * 0.01f;
            int   num11 = (int)(num * num9);

            int[] numArray = new int[] { 0xbbc, 0xbbb, 0xbba, 0xbb9 };
            foreach (int num12 in numArray)
            {
                float gearExpProvideBase = ItemMetaDataReader.GetItemMetaDataByKey(num12).gearExpProvideBase;
                float num15 = MaterialExpBonusMetaDataReader.GetMaterialExpBonusMetaDataByKey(num12).weaponExpBonus * 0.01f;
                int   num16 = (int)(gearExpProvideBase * num15);
                int   num17 = num11 / num16;
                num11 = num11 % num16;
                if (num17 > 0)
                {
                    this.AddItem(num12, num17);
                }
            }
        }