public void SetDropItems(PassUICommonDrop commonDrop)
    {
        List <KeyValuePair <int, long> > list  = new List <KeyValuePair <int, long> >();
        List <KeyValuePair <int, long> > list2 = new List <KeyValuePair <int, long> >();

        if (commonDrop != null)
        {
            list2.Add(new KeyValuePair <int, long>(1, commonDrop.exp));
            list2.Add(new KeyValuePair <int, long>(2, commonDrop.gold));
            for (int i = 0; i < commonDrop.item.get_Count(); i++)
            {
                int   key   = commonDrop.item.get_Item(i).get_Key();
                long  value = commonDrop.item.get_Item(i).get_Value();
                Items items = DataReader <Items> .Get(key);

                if (items != null && items.tab == 2)
                {
                    int num = 0;
                    while ((long)num < value)
                    {
                        list.Add(new KeyValuePair <int, long>(key, 1L));
                        num++;
                    }
                }
                else
                {
                    list.Add(commonDrop.item.get_Item(i));
                }
            }
        }
        this.SetExpAndGold(list2);
        this.SetDropItem(list);
    }
Example #2
0
    protected PassUICommonDrop FixInstanceDrop()
    {
        PassUICommonDrop  passUICommonDrop = new PassUICommonDrop();
        XDict <int, long> xDict            = new XDict <int, long>();

        for (int i = 0; i < base.InstanceResult.item.get_Count(); i++)
        {
            int typeId = base.InstanceResult.item.get_Item(i).typeId;
            if (typeId != 1)
            {
                if (typeId != 2)
                {
                    if (xDict.ContainsKey(base.InstanceResult.item.get_Item(i).typeId))
                    {
                        XDict <int, long> xDict2;
                        XDict <int, long> expr_B2 = xDict2 = xDict;
                        int  typeId2;
                        int  expr_CB = typeId2 = base.InstanceResult.item.get_Item(i).typeId;
                        long num     = xDict2[typeId2];
                        expr_B2[expr_CB] = num + base.InstanceResult.item.get_Item(i).count;
                    }
                    else
                    {
                        xDict.Add(base.InstanceResult.item.get_Item(i).typeId, base.InstanceResult.item.get_Item(i).count);
                    }
                }
                else
                {
                    passUICommonDrop.gold += base.InstanceResult.item.get_Item(i).count;
                }
            }
            else
            {
                passUICommonDrop.exp += base.InstanceResult.item.get_Item(i).count;
            }
        }
        for (int j = 0; j < xDict.Count; j++)
        {
            passUICommonDrop.item.Add(new KeyValuePair <int, long>(xDict.ElementKeyAt(j), xDict.ElementValueAt(j)));
        }
        return(passUICommonDrop);
    }
Example #3
0
    protected PassUICommonDrop FixInstanceDrop()
    {
        PassUICommonDrop     passUICommonDrop = new PassUICommonDrop();
        List <ItemBriefInfo> normalPrize      = base.InstanceResult.normalPrize;

        if (normalPrize == null)
        {
            return(passUICommonDrop);
        }
        for (int i = 0; i < normalPrize.get_Count(); i++)
        {
            int   cfgId = normalPrize.get_Item(i).cfgId;
            long  count = normalPrize.get_Item(i).count;
            Items item  = BackpackManager.Instance.GetItem(cfgId);
            if (item != null)
            {
                int secondType = item.secondType;
                if (secondType != 15)
                {
                    if (secondType != 16)
                    {
                        passUICommonDrop.item.Add(new KeyValuePair <int, long>(cfgId, count));
                    }
                    else
                    {
                        passUICommonDrop.exp += count;
                    }
                }
                else
                {
                    passUICommonDrop.gold += count;
                }
            }
        }
        return(passUICommonDrop);
    }
 public void SetRewardItems(PassUICommonDrop commonDrop)
 {
     this.ObtainExps  = commonDrop.exp;
     this.ObtainCoins = commonDrop.gold;
     this.SetRewardItem(commonDrop.item);
 }