private void OnQuery_QUEST_DETAIL()
    {
        int num   = (int)GameSection.GetEventData();
        int count = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.Count;

        if (num < 0 || num >= count)
        {
            GameSection.StopEvent();
        }
        else
        {
            QuestItemInfo questItem = MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem((uint)MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[num].itemId);

            if (questItem == null)
            {
                GameSection.StopEvent();
            }
            else
            {
                QuestSortData questSortData = new QuestSortData();
                questSortData.SetItem(questItem);
                GameSection.SetEventData(questSortData);
            }
        }
    }
Exemple #2
0
    public override void OnNotify(NOTIFY_FLAG flags)
    {
        if ((flags & NOTIFY_FLAG.UPDATE_QUEST_ITEM_INVENTORY) != (NOTIFY_FLAG)0L)
        {
            QuestItemInfo questItem = MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem(data.GetTableID());

            if (questItem != null && questItem.infoData != null && questItem.infoData.questData.num > 0)
            {
                data = new QuestSortData();
                data.SetItem(questItem);
            }
        }
        base.OnNotify(flags);
    }
    public static int SetDropData(List <SortCompareData> drop_ary, int start_ary_index, List <QuestCompleteReward.QuestItem> drop_data, REWARD_CATEGORY category = REWARD_CATEGORY.DROP)
    {
        int num = start_ary_index;

        QuestCompleteReward.QuestItem[] ary = drop_data.ToArray();
        int i = 0;

        for (int num2 = ary.Length; i < num2; i++)
        {
            SortCompareData sortCompareData = null;
            if (num > 0 && category != REWARD_CATEGORY.BREAK)
            {
                sortCompareData = drop_ary.Find((SortCompareData _data) => _data != null && _data.GetTableID() == (uint)ary[i].questId && _data is QuestSortData);
            }
            if (sortCompareData == null)
            {
                QuestItemInfo item = new QuestItemInfo();
                item.tableID = (uint)ary[i].questId;
                QuestData quest_list = new QuestData();
                item.infoData = new QuestInfoData(Singleton <QuestTable> .I.GetQuestData(item.tableID), quest_list, null);
                item.infoData.questData.num = ary[i].num;
                if (MonoBehaviourSingleton <InventoryManager> .I.IsHaveingItem(item.tableID))
                {
                    MonoBehaviourSingleton <InventoryManager> .I.ForAllItemInventory(delegate(ItemInfo inventory_item)
                    {
                        if (inventory_item.tableID == item.tableID && inventory_item.num == item.infoData.questData.num)
                        {
                            item.uniqueID = inventory_item.uniqueID;
                        }
                    });
                }
                QuestSortData questSortData = new QuestSortData();
                questSortData.SetItem(item);
                questSortData.SetCategory(category);
                drop_ary.Add(questSortData);
                num++;
            }
            else
            {
                QuestSortData questSortData2 = sortCompareData as QuestSortData;
                questSortData2.itemData.infoData.questData.num += ary[i].num;
            }
        }
        return(num);
    }