Ejemplo n.º 1
0
    private void ShowClickQuestOpenDlg(string OpenUi, short unique)
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo != null)
        {
            ChallengeTable sequenceChallengeTable = NrTSingleton <ChallengeManager> .Instance.GetSequenceChallengeTable();

            if (sequenceChallengeTable != null)
            {
                UserChallengeInfo userChallengeInfo = kMyCharInfo.GetUserChallengeInfo();
                if (userChallengeInfo != null)
                {
                    Challenge_Info userChallengeInfo2 = userChallengeInfo.GetUserChallengeInfo(sequenceChallengeTable.m_nUnique);
                    if (userChallengeInfo2 != null && userChallengeInfo2.m_nValue >= (long)sequenceChallengeTable.m_kRewardInfo[0].m_nConditionCount)
                    {
                        NrTSingleton <ChallengeManager> .Instance.GetChallengeOpenReward();

                        return;
                    }
                }
            }
        }
        NrTSingleton <ChallengeManager> .Instance.GetChallengeOpenUi(OpenUi, unique);
    }
Ejemplo n.º 2
0
 public void AddChallengeTable(ChallengeTable table)
 {
     if (this.m_bLoad)
     {
         return;
     }
     if (!this.m_kChallenge.ContainsKey(table.m_nType))
     {
         Dictionary <short, ChallengeTable> dictionary = new Dictionary <short, ChallengeTable>();
         table.m_kRewardInfo.Add(table.m_kInfo);
         dictionary.Add(table.m_nUnique, table);
         this.m_kChallenge.Add(table.m_nType, dictionary);
     }
     else if (this.m_kChallenge[table.m_nType].ContainsKey(table.m_nUnique))
     {
         Dictionary <short, ChallengeTable> dictionary2 = this.m_kChallenge[table.m_nType];
         dictionary2[table.m_nUnique].m_kRewardInfo.Add(table.m_kInfo);
     }
     else
     {
         Dictionary <short, ChallengeTable> dictionary3 = new Dictionary <short, ChallengeTable>();
         table.m_kRewardInfo.Add(table.m_kInfo);
         dictionary3.Add(table.m_nUnique, table);
         this.m_kChallenge[table.m_nType].Add(table.m_nUnique, table);
     }
 }
Ejemplo n.º 3
0
    public bool Is_GetRefreshReward()
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return(false);
        }
        List <ChallengeTable> list = new List <ChallengeTable>();

        for (int i = 0; i < this.m_earrTimeShopChallegeCode.Length; i++)
        {
            ChallengeTable challengeTable = NrTSingleton <ChallengeManager> .Instance.GetChallengeTable((short)this.m_earrTimeShopChallegeCode[i]);

            if (challengeTable != null)
            {
                list.Add(challengeTable);
            }
        }
        int  num    = -1;
        bool result = false;
        bool flag   = false;

        for (int j = 0; j < list.Count; j++)
        {
            if ((int)list[j].m_nLevel <= kMyCharInfo.GetLevel())
            {
                for (int k = 0; k < list[j].m_kRewardInfo.Count; k++)
                {
                    if (kMyCharInfo.GetLevel() < list[j].m_kRewardInfo[k].m_nConditionLevel)
                    {
                        num = k;
                        break;
                    }
                }
                if (num != -1)
                {
                    long charDetail = kMyCharInfo.GetCharDetail(12);
                    if (1L <= (charDetail & list[j].m_nCheckRewardValue))
                    {
                        if (j < list.Count - 1)
                        {
                            goto IL_15D;
                        }
                        flag = true;
                    }
                    long num2 = (long)kMyCharInfo.GetDayCharDetail((eCHAR_DAY_COUNT)list[j].m_nDetailInfoIndex);
                    if (num2 >= (long)list[j].m_kRewardInfo[num].m_nConditionCount && !flag)
                    {
                        result = true;
                    }
                }
            }
            IL_15D :;
        }
        return(result);
    }
Ejemplo n.º 4
0
 public void AddSequenceChallengeTable(ChallengeTable table)
 {
     if (!this.m_listChallengeData.Contains(table))
     {
         this.m_listChallengeData.Add(table);
     }
     else
     {
         TsLog.LogWarning("m_listChallengeData Add Error", new object[]
         {
             table.m_nUnique
         });
     }
 }
Ejemplo n.º 5
0
    private void Set_Value()
    {
        ChallengeManager.eCHALLENGECODE[] timeShopChallengeCode = NrTSingleton <NrTableTimeShopManager> .Instance.Get_TimeShopChallengeCode();

        if (timeShopChallengeCode == null)
        {
            return;
        }
        for (int i = 0; i < timeShopChallengeCode.Length; i++)
        {
            ChallengeTable challengeTable = NrTSingleton <ChallengeManager> .Instance.GetChallengeTable((short)timeShopChallengeCode[i]);

            if (challengeTable != null)
            {
                this.m_lstTimeShopTable.Add(challengeTable);
            }
        }
        this.Set_ChallengeInfo();
    }
    public override bool ParseDataFromNDT(TsDataReader dr)
    {
        foreach (TsDataReader.Row data in dr)
        {
            ChallengeTable challengeTable = new ChallengeTable();
            challengeTable.SetData(data);
            if (0 < challengeTable.m_nType)
            {
                NrTSingleton <ChallengeManager> .Instance.AddChallengeTable(challengeTable);

                if (0 < challengeTable.m_nSequence)
                {
                    NrTSingleton <ChallengeManager> .Instance.AddSequenceChallengeTable(challengeTable);
                }
            }
        }
        NrTSingleton <ChallengeManager> .Instance.CalcTotalRewardCount();

        return(true);
    }
Ejemplo n.º 7
0
    public void SetPopupInfo(short unique, short index)
    {
        ChallengeTable challengeTable = NrTSingleton <ChallengeManager> .Instance.GetChallengeTable(unique);

        if (challengeTable == null)
        {
            return;
        }
        ChallengeTable.RewardInfo rewardInfo = challengeTable.m_kRewardInfo[(int)index];
        if (rewardInfo == null)
        {
            return;
        }
        this.m_kTitle.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromChallenge(challengeTable.m_szTitleTextKey);

        string text = string.Empty;
        string textFromChallenge = NrTSingleton <NrTextMgr> .Instance.GetTextFromChallenge(rewardInfo.m_szConditionTextKey);

        if (textFromChallenge.Contains("count"))
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
            {
                textFromChallenge,
                "count",
                challengeTable.m_kRewardInfo[(int)index].m_nConditionCount,
                "count1",
                rewardInfo.m_nConditionCount,
                "count2",
                rewardInfo.m_nConditionCount
            });
        }
        else
        {
            text = textFromChallenge;
        }
        this.m_kMessage.Text = text;
        this.m_kIcon.SetTexture(NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary(challengeTable.m_szIconKey));
    }
Ejemplo n.º 8
0
    private void BtnDoubleClickQuestList(object sender)
    {
        UI_UIGuide uI_UIGuide = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.UIGUIDE_DLG) as UI_UIGuide;

        if (uI_UIGuide != null)
        {
            uI_UIGuide.CloseUI = true;
        }
        if (string.Empty != this.m_szSelectQuestUnique)
        {
            CQuest questByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(this.m_szSelectQuestUnique);

            if (questByQuestUnique == null)
            {
                string text = this.m_szSelectQuestUnique.Replace(this.m_ChallengeUniqueDistinguish, string.Empty);
                if (string.IsNullOrEmpty(text))
                {
                    return;
                }
                short          unique         = short.Parse(text);
                ChallengeTable challengeTable = NrTSingleton <ChallengeManager> .Instance.GetChallengeTable(unique);

                if (challengeTable == null)
                {
                    return;
                }
                this.ShowClickQuestOpenDlg(challengeTable.m_szOpenUI, challengeTable.m_nUnique);
                return;
            }
            else
            {
                QUEST_CONST.eQUESTSTATE questState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(questByQuestUnique.GetQuestUnique());

                if (questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ONGOING)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        if (questByQuestUnique.GetQuestCommon().cQuestCondition[i].i32QuestCode == 155)
                        {
                            MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI;

                            if (msgBoxUI != null)
                            {
                                string empty = string.Empty;
                                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                                {
                                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1533"),
                                    "targetname",
                                    NrTSingleton <NrCharKindInfoManager> .Instance.GetName((int)questByQuestUnique.GetQuestCommon().cQuestCondition[1].i64Param)
                                });

                                msgBoxUI.SetMsg(new YesDelegate(NrTSingleton <NkQuestManager> .Instance.OpenQuestBattle), questByQuestUnique, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1532"), empty, eMsgType.MB_OK_CANCEL, 2);
                                msgBoxUI.SetButtonOKText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("320"));
                                msgBoxUI.SetButtonCancelText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("321"));
                                return;
                            }
                        }
                    }
                }
                NrTSingleton <NkQuestManager> .Instance.QuestAutoMove(this.m_szSelectQuestUnique);

                if (null != this.m_Touch)
                {
                    this.m_Touch.RenderEnabled = false;
                    this.bClickTouch           = true;
                }
            }
        }
    }
Ejemplo n.º 9
0
    public void QuestUpdate()
    {
        this.m_kQuestList.Clear();
        List <USER_CURRENT_QUEST_INFO> list = new List <USER_CURRENT_QUEST_INFO>();

        foreach (USER_CURRENT_QUEST_INFO current in NrTSingleton <NkQuestManager> .Instance.GetMainlist())
        {
            list.Add(current);
        }
        foreach (USER_CURRENT_QUEST_INFO current2 in NrTSingleton <NkQuestManager> .Instance.GetSublist())
        {
            list.Add(current2);
        }
        float num  = 0f;
        int   num2 = 0;

        foreach (USER_CURRENT_QUEST_INFO current3 in list)
        {
            if (!(current3.strQuestUnique == string.Empty))
            {
                string strQuestUnique = current3.strQuestUnique;
                if (strQuestUnique != string.Empty)
                {
                    CQuestGroup questGroupByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByQuestUnique(strQuestUnique);

                    if (questGroupByQuestUnique != null)
                    {
                        CQuest questByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(strQuestUnique);

                        if (questByQuestUnique != null)
                        {
                            float num3 = 80f;
                            int   num4 = 0;
                            for (int i = 0; i < 3; i++)
                            {
                                if (0 < questByQuestUnique.GetQuestCommon().cQuestCondition[i].i32QuestCode)
                                {
                                    num4++;
                                }
                            }
                            if (num4 == 1)
                            {
                                this.m_kQuestList.SetColumnData("Mobile/DLG/Main/nlb_questlist_columndata" + NrTSingleton <UIDataManager> .Instance.AddFilePath);
                            }
                            else if (num4 == 2)
                            {
                                this.m_kQuestList.SetColumnData("Mobile/DLG/Main/nlb_questlist2_columndata" + NrTSingleton <UIDataManager> .Instance.AddFilePath);
                                num3 = 120f;
                            }
                            else if (num4 == 3)
                            {
                                this.m_kQuestList.SetColumnData("Mobile/DLG/Main/nlb_questlist3_columndata" + NrTSingleton <UIDataManager> .Instance.AddFilePath);
                                num3 = 160f;
                            }
                            num += num3;
                            this.m_kQuestList.LineHeight = num3;
                            NewListItem newListItem = new NewListItem(this.m_kQuestList.ColumnNum, true, string.Empty);
                            this.ShowTouchButton(questByQuestUnique);
                            string   text  = string.Empty;
                            string[] array = new string[3];
                            text = questByQuestUnique.GetGiveQuestNpcName();
                            if (!(text != string.Empty))
                            {
                                string msg = string.Format("Quest Give Npc Name == Blank, unique = {0}, charcode = {1}", questByQuestUnique.GetQuestUnique(), questByQuestUnique.GetQuestCommon().i32QuestCharKind);
                                NrTSingleton <NrMainSystem> .Instance.Alert(msg);

                                return;
                            }
                            CSelQuestInfo cSelQuestInfo = new CSelQuestInfo();
                            cSelQuestInfo.m_bComplete          = true;
                            cSelQuestInfo.m_SeldQuestCondition = questByQuestUnique.GetQuestCommon().cQuestCondition[0];
                            cSelQuestInfo.m_SelQuest           = questByQuestUnique;
                            cSelQuestInfo.bType = 0;
                            CQuestGroup questGroupByQuestUnique2 = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByQuestUnique(questByQuestUnique.GetQuestUnique());

                            if (questGroupByQuestUnique2 != null)
                            {
                                if (NrTSingleton <NkQuestManager> .Instance.GetToggleQuestUnique())
                                {
                                    text = NrTSingleton <UIDataManager> .Instance.GetString(this.m_ColorTitle, questByQuestUnique.GetQuestTitle(), "(", questByQuestUnique.GetQuestUnique().ToString(), ")");
                                }
                                else
                                {
                                    text = NrTSingleton <UIDataManager> .Instance.GetString(this.m_ColorTitle, questByQuestUnique.GetQuestTitle());
                                }
                                newListItem.SetListItemData(3, text, cSelQuestInfo, null, null);
                            }
                            for (int j = 0; j < 3; j++)
                            {
                                if (0 < questByQuestUnique.GetQuestCommon().cQuestCondition[j].i32QuestCode)
                                {
                                    array[j] = questByQuestUnique.GetConditionText(current3.i64ParamVal[j], j);
                                    if (string.Empty != array[j])
                                    {
                                        string conditionText = questByQuestUnique.GetConditionText(current3.i64ParamVal[j], j);
                                        string empty         = string.Empty;
                                        bool   bTitle        = NrTSingleton <CTextParser> .Instance.ChangeQuestConditionText(conditionText, out empty);

                                        if (NrTSingleton <NkQuestManager> .Instance.GetToggleQuestUnique())
                                        {
                                            array[j] = string.Concat(new object[]
                                            {
                                                empty,
                                                "(",
                                                questByQuestUnique.GetQuestCommon().cQuestCondition[j].i32QuestCode,
                                                ")"
                                            });
                                        }
                                        else
                                        {
                                            array[j] = empty;
                                        }
                                        CSelQuestInfo cSelQuestInfo2 = new CSelQuestInfo();
                                        int           index          = 5;
                                        if (j == 0)
                                        {
                                            index = 5;
                                        }
                                        else if (j == 1)
                                        {
                                            index = 10;
                                        }
                                        else if (j == 2)
                                        {
                                            index = 13;
                                        }
                                        if (questByQuestUnique.CheckCondition(questByQuestUnique.GetQuestCommon().cQuestCondition[j].i64Param, ref current3.i64ParamVal[j], j) && current3.bFailed == 0)
                                        {
                                            cSelQuestInfo2.m_bComplete          = true;
                                            cSelQuestInfo2.m_SeldQuestCondition = questByQuestUnique.GetQuestCommon().cQuestCondition[j];
                                            cSelQuestInfo2.m_SelQuest           = questByQuestUnique;
                                            cSelQuestInfo2.bType  = 1;
                                            cSelQuestInfo2.bTitle = bTitle;
                                            cSelQuestInfo2.strCon = conditionText;
                                            newListItem.SetListItemData(index, this.m_ColorComplte + array[j], cSelQuestInfo2, null, null);
                                        }
                                        else
                                        {
                                            cSelQuestInfo2.m_bComplete          = false;
                                            cSelQuestInfo2.m_SeldQuestCondition = questByQuestUnique.GetQuestCommon().cQuestCondition[j];
                                            cSelQuestInfo2.m_SelQuest           = questByQuestUnique;
                                            cSelQuestInfo2.bType  = 1;
                                            cSelQuestInfo2.bTitle = bTitle;
                                            cSelQuestInfo2.strCon = conditionText;
                                            newListItem.SetListItemData(index, this.m_ColorNormal + array[j], cSelQuestInfo2, null, null);
                                        }
                                    }
                                }
                            }
                            if (questGroupByQuestUnique.GetQuestType() == 2)
                            {
                                newListItem.SetListItemData(7, string.Empty, questByQuestUnique, new EZValueChangedDelegate(this.ClickCancelQuest), null);
                            }
                            else
                            {
                                newListItem.SetListItemData(6, false);
                                newListItem.SetListItemData(7, false);
                            }
                            newListItem.Data = strQuestUnique;
                            this.m_kQuestList.Add(newListItem);
                            if (0 < num2)
                            {
                                num += this.m_kQuestList.itemSpacing;
                            }
                            num2++;
                        }
                    }
                }
            }
        }
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo != null)
        {
            ChallengeTable sequenceChallengeTable = NrTSingleton <ChallengeManager> .Instance.GetSequenceChallengeTable();

            if (sequenceChallengeTable != null && (int)sequenceChallengeTable.m_nLevel <= kMyCharInfo.GetLevel())
            {
                UserChallengeInfo userChallengeInfo = kMyCharInfo.GetUserChallengeInfo();
                if (userChallengeInfo != null && userChallengeInfo.GetLoadData())
                {
                    Challenge_Info userChallengeInfo2 = userChallengeInfo.GetUserChallengeInfo(sequenceChallengeTable.m_nUnique);
                    num += 80f;
                    this.m_kQuestList.LineHeight = 80f;
                    NewListItem newListItem2 = new NewListItem(this.m_kQuestList.ColumnNum, true, string.Empty);
                    newListItem2.SetListItemData(0, "Win_T_QuestTitleBK2", null, null, null);
                    newListItem2.SetListItemData(2, "Win_I_QuestMark02", null, null, null);
                    newListItem2.SetListItemData(3, this.m_ColorTitle + NrTSingleton <NrTextMgr> .Instance.GetTextFromChallenge(sequenceChallengeTable.m_szTitleTextKey), null, null, null);
                    string str = string.Empty;
                    string textFromChallenge = NrTSingleton <NrTextMgr> .Instance.GetTextFromChallenge(sequenceChallengeTable.m_kRewardInfo[0].m_szConditionTextKey);

                    if (textFromChallenge.Contains("count"))
                    {
                        if (userChallengeInfo2 == null)
                        {
                            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref str, new object[]
                            {
                                textFromChallenge,
                                "count",
                                sequenceChallengeTable.m_kRewardInfo[0].m_nConditionCount,
                                "count1",
                                0,
                                "count2",
                                sequenceChallengeTable.m_kRewardInfo[0].m_nConditionCount
                            });

                            newListItem2.SetListItemData(5, this.m_ColorNormal + str, null, null, null);
                        }
                        else if (userChallengeInfo2.m_nValue >= (long)sequenceChallengeTable.m_kRewardInfo[0].m_nConditionCount)
                        {
                            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref str, new object[]
                            {
                                textFromChallenge,
                                "count",
                                sequenceChallengeTable.m_kRewardInfo[0].m_nConditionCount,
                                "count1",
                                userChallengeInfo2.m_nValue,
                                "count2",
                                sequenceChallengeTable.m_kRewardInfo[0].m_nConditionCount
                            });

                            newListItem2.SetListItemData(5, this.m_ColorComplte + str, null, null, null);
                        }
                    }
                    else
                    {
                        str = textFromChallenge;
                        if (userChallengeInfo2 == null)
                        {
                            newListItem2.SetListItemData(5, this.m_ColorNormal + str, null, null, null);
                        }
                        else if (userChallengeInfo2.m_nValue >= (long)sequenceChallengeTable.m_kRewardInfo[0].m_nConditionCount)
                        {
                            newListItem2.SetListItemData(5, this.m_ColorComplte + str, null, null, null);
                        }
                        else
                        {
                            newListItem2.SetListItemData(5, this.m_ColorNormal + str, null, null, null);
                        }
                    }
                    newListItem2.SetListItemData(6, false);
                    newListItem2.SetListItemData(7, false);
                    newListItem2.Data = sequenceChallengeTable.m_nUnique.ToString() + this.m_ChallengeUniqueDistinguish;
                    this.m_kQuestList.Add(newListItem2);
                }
            }
        }
        base.SetSize(base.GetSizeX(), num);
        this.m_kQuestList.ResizeViewableArea(this.m_kQuestList.GetSize().x, num);
        NrTSingleton <NkQuestManager> .Instance.UpdateClientNpc(0);
    }
Ejemplo n.º 10
0
    public ChallengeTable GetSequenceChallengeTable()
    {
        ChallengeTable challengeTable = null;
        NrMyCharInfo   kMyCharInfo    = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return(null);
        }
        UserChallengeInfo userChallengeInfo = kMyCharInfo.GetUserChallengeInfo();

        if (userChallengeInfo == null)
        {
            return(null);
        }
        for (int i = 0; i < this.m_listChallengeData.Count; i++)
        {
            Challenge_Info userChallengeInfo2 = userChallengeInfo.GetUserChallengeInfo(this.m_listChallengeData[i].m_nUnique);
            if (userChallengeInfo2 == null)
            {
                if (challengeTable == null)
                {
                    challengeTable = this.m_listChallengeData[i];
                }
                break;
            }
            int j   = 0;
            int num = 64;
            while (j < this.m_listChallengeData[i].m_kRewardInfo.Count)
            {
                bool flag = false;
                if (j < num)
                {
                    long num2 = 1L << (j & 31);
                    if ((userChallengeInfo2.m_bGetReward1 & num2) == 0L)
                    {
                        flag = true;
                    }
                }
                else
                {
                    long num3 = 1L << (j - num & 31);
                    if ((userChallengeInfo2.m_bGetReward1 & num3) == 0L)
                    {
                        flag = true;
                    }
                }
                if (flag)
                {
                    challengeTable = this.m_listChallengeData[i];
                    break;
                }
                if (userChallengeInfo2.m_nValue >= (long)this.m_listChallengeData[i].m_kRewardInfo[j].m_nConditionCount)
                {
                    challengeTable = null;
                }
                j++;
            }
        }
        return(challengeTable);
    }