public void CancelQuest(object obj)
    {
        CQuest cQuest = (CQuest)obj;

        if (cQuest == null)
        {
            return;
        }
        GS_QUEST_CANCLE_REQ gS_QUEST_CANCLE_REQ = new GS_QUEST_CANCLE_REQ();

        TKString.StringChar(cQuest.GetQuestUnique(), ref gS_QUEST_CANCLE_REQ.strQuestUnique);
        SendPacket.GetInstance().SendObject(1013, gS_QUEST_CANCLE_REQ);
        this.Close();
    }
    public void ShowTouchButton(CQuest quest)
    {
        if (quest == null)
        {
            return;
        }
        this.m_kQuest = quest;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        int level = charPersonInfo.GetLevel(0L);

        if (3 >= level)
        {
            if ("10101_005" == quest.GetQuestUnique())
            {
                return;
            }
            QUEST_CONST.eQUESTSTATE questState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(quest.GetQuestUnique());

            if ((null == this.m_Touch && quest.IsAutoMoveQuest()) || questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_COMPLETE)
            {
                if (null != this.m_Touch)
                {
                    return;
                }
                this.m_Touch = UICreateControl.Button("touch", "Main_I_Touch01", 196f, 154f);
                this.m_Touch.PlayAni(true);
                base.InteractivePanel.MakeChild(this.m_Touch.gameObject);
                this.m_Touch.SetLocation(-this.m_Touch.GetSize().x + 85f, 0f, this.m_kQuestList.GetLocation().z - 1f);
                BoxCollider component = this.m_Touch.gameObject.GetComponent <BoxCollider>();
                if (null != component)
                {
                    UnityEngine.Object.Destroy(component);
                }
            }
        }
        else
        {
            if (null != this.m_Touch)
            {
                base.InteractivePanel.RemoveChild(this.m_Touch.gameObject);
                UnityEngine.Object.Destroy(this.m_Touch.gameObject);
            }
            this.m_kQuest = null;
        }
    }
Example #3
0
    public override void SetComponent()
    {
        this.m_DropDownList2   = (base.GetControl("DropDownList2") as DropDownList);
        this.m_DropDownList3   = (base.GetControl("DropDownList3") as DropDownList);
        this.m_Button_Button4  = (base.GetControl("Button_Button4") as Button);
        this.m_Button_Button7  = (base.GetControl("Button_Button7") as Button);
        this.m_Button_Button15 = (base.GetControl("Button_Button15") as Button);
        this.m_Button_Button16 = (base.GetControl("Button_Button16") as Button);
        this.m_Button_Button17 = (base.GetControl("Button_Button17") as Button);
        this.m_Button_Button18 = (base.GetControl("Button_Button18") as Button);
        this.m_Button_Button19 = (base.GetControl("Button_Button19") as Button);
        this.m_Button_Button20 = (base.GetControl("Button_Button20") as Button);
        this.m_Button_Button23 = (base.GetControl("Button_Button23") as Button);
        this.m_Button_Button25 = (base.GetControl("Button_Button23") as Button);
        this.m_Button_Button26 = (base.GetControl("Button_Button23") as Button);
        this.m_ListBox         = (base.GetControl("ListBox") as ListBox);
        Button expr_13A = this.m_Button_Button4;

        expr_13A.Click = (EZValueChangedDelegate)Delegate.Combine(expr_13A.Click, new EZValueChangedDelegate(this.OnCharUniqueSet));
        Button expr_161 = this.m_Button_Button7;

        expr_161.Click = (EZValueChangedDelegate)Delegate.Combine(expr_161.Click, new EZValueChangedDelegate(this.OnQuestUniqueSet));
        Button expr_188 = this.m_Button_Button15;

        expr_188.Click = (EZValueChangedDelegate)Delegate.Combine(expr_188.Click, new EZValueChangedDelegate(this.OnQuestPass_Small));
        Button expr_1AF = this.m_Button_Button16;

        expr_1AF.Click = (EZValueChangedDelegate)Delegate.Combine(expr_1AF.Click, new EZValueChangedDelegate(this.OnQuestInit_Small));
        Button expr_1D6 = this.m_Button_Button17;

        expr_1D6.Click = (EZValueChangedDelegate)Delegate.Combine(expr_1D6.Click, new EZValueChangedDelegate(this.OnQuestPass_Middle));
        Button expr_1FD = this.m_Button_Button18;

        expr_1FD.Click = (EZValueChangedDelegate)Delegate.Combine(expr_1FD.Click, new EZValueChangedDelegate(this.OnQuestInit_Middle));
        Button expr_224 = this.m_Button_Button19;

        expr_224.Click = (EZValueChangedDelegate)Delegate.Combine(expr_224.Click, new EZValueChangedDelegate(this.OnQuestAllPass));
        Button expr_24B = this.m_Button_Button20;

        expr_24B.Click = (EZValueChangedDelegate)Delegate.Combine(expr_24B.Click, new EZValueChangedDelegate(this.OnQuestAllInit));
        Button expr_272 = this.m_Button_Button23;

        expr_272.Click = (EZValueChangedDelegate)Delegate.Combine(expr_272.Click, new EZValueChangedDelegate(this.OnOption));
        Button expr_299 = this.m_Button_Button25;

        expr_299.Click = (EZValueChangedDelegate)Delegate.Combine(expr_299.Click, new EZValueChangedDelegate(this.OnQuestPass_Big));
        Button expr_2C0 = this.m_Button_Button26;

        expr_2C0.Click = (EZValueChangedDelegate)Delegate.Combine(expr_2C0.Click, new EZValueChangedDelegate(this.OnQuestInit_Big));
        this.m_DropDownList2.AddValueChangedDelegate(new EZValueChangedDelegate(this.ChangeChapter));
        this.m_DropDownList3.AddValueChangedDelegate(new EZValueChangedDelegate(this.ChangePage));
        this.m_ListBox.SetValueChangedDelegate(new EZValueChangedDelegate(this.ClickList));
        Dictionary <short, QUEST_CHAPTER> hashQuestChapter = NrTSingleton <NkQuestManager> .Instance.GetHashQuestChapter();

        if (hashQuestChapter != null)
        {
            this.m_DropDownList2.Clear();
            foreach (QUEST_CHAPTER current in hashQuestChapter.Values)
            {
                ListItem listItem = new ListItem();
                listItem.SetColumnStr(0, current.i16QuestChapterUnique.ToString());
                listItem.Key = current;
                this.m_DropDownList2.Add(listItem);
            }
            this.m_DropDownList2.SetFirstItem();
        }
        this.m_DropDownList2.RepositionItems();
        ListItem listItem2 = this.m_DropDownList2.SelectedItem.Data as ListItem;

        this.m_CurrentChapter = (listItem2.Key as QUEST_CHAPTER);
        Dictionary <int, CQuestGroup> hashQuestGroup = NrTSingleton <NkQuestManager> .Instance.GetHashQuestGroup();

        foreach (CQuestGroup current2 in hashQuestGroup.Values)
        {
            this.m_DropDownList3.SetViewArea(10);
            this.m_DropDownList3.Clear();
            if (this.m_CurrentChapter.i16QuestChapterUnique == current2.GetChapterUnique())
            {
                ListItem listItem3 = new ListItem();
                listItem3.SetColumnStr(0, current2.GetGroupTitle() + " " + current2.GetPageUnique().ToString());
                listItem3.Key = current2;
                this.m_DropDownList3.Add(listItem3);
            }
        }
        this.m_DropDownList3.RepositionItems();
        this.m_DropDownList3.SetFirstItem();
        listItem2                = (this.m_DropDownList3.SelectedItem.Data as ListItem);
        this.m_CurGroup          = (listItem2.Key as CQuestGroup);
        this.m_ListBox.ColumnNum = 1;
        if (this.m_CurGroup != null)
        {
            foreach (QUEST_SORTID current3 in this.m_CurGroup.GetGroupInfo().m_QuestUnique.Values)
            {
                CQuest questByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(current3.m_strQuestUnique);

                if (questByQuestUnique != null)
                {
                    ListItem listItem4 = new ListItem();
                    listItem4.SetColumnStr(0, questByQuestUnique.GetQuestTitle() + " " + questByQuestUnique.GetQuestUnique().ToString());
                    listItem4.Key = questByQuestUnique;
                    this.m_ListBox.Add(listItem4);
                }
            }
            this.m_ListBox.RepositionItems();
        }
    }
Example #4
0
    private void ChangePage(IUIObject obj)
    {
        ListItem listItem = this.m_DropDownList3.SelectedItem.Data as ListItem;

        this.m_CurGroup = (listItem.Key as CQuestGroup);
        if (this.m_CurGroup != null)
        {
            this.m_ListBox.Clear();
            foreach (QUEST_SORTID current in this.m_CurGroup.GetGroupInfo().m_QuestUnique.Values)
            {
                CQuest questByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(current.m_strQuestUnique);

                if (questByQuestUnique != null)
                {
                    ListItem listItem2 = new ListItem();
                    listItem2.SetColumnStr(0, questByQuestUnique.GetQuestTitle() + " " + questByQuestUnique.GetQuestUnique().ToString());
                    listItem2.Key = questByQuestUnique;
                    this.m_ListBox.Add(listItem2);
                }
            }
            this.m_ListBox.RepositionItems();
        }
    }
Example #5
0
    private void ChangeChapter(IUIObject obj)
    {
        ListItem listItem = this.m_DropDownList2.SelectedItem.Data as ListItem;

        this.m_CurrentChapter = (listItem.Key as QUEST_CHAPTER);
        Dictionary <int, CQuestGroup> hashQuestGroup = NrTSingleton <NkQuestManager> .Instance.GetHashQuestGroup();

        this.m_DropDownList3.Clear();
        foreach (CQuestGroup current in hashQuestGroup.Values)
        {
            if (this.m_CurrentChapter.i16QuestChapterUnique == current.GetChapterUnique())
            {
                ListItem listItem2 = new ListItem();
                listItem2.SetColumnStr(0, current.GetPageUnique().ToString());
                listItem2.Key = current;
                this.m_DropDownList3.Add(listItem2);
            }
        }
        this.m_DropDownList3.SetFirstItem();
        this.m_DropDownList3.RepositionItems();
        ListItem listItem3 = this.m_DropDownList3.SelectedItem.Data as ListItem;

        this.m_CurGroup = (listItem3.Key as CQuestGroup);
        if (this.m_CurGroup != null)
        {
            this.m_ListBox.Clear();
            foreach (QUEST_SORTID current2 in this.m_CurGroup.GetGroupInfo().m_QuestUnique.Values)
            {
                CQuest questByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(current2.m_strQuestUnique);

                if (questByQuestUnique != null)
                {
                    ListItem listItem4 = new ListItem();
                    listItem4.SetColumnStr(0, questByQuestUnique.GetQuestTitle() + " " + questByQuestUnique.GetQuestUnique().ToString());
                    listItem4.Key = questByQuestUnique;
                    this.m_ListBox.Add(listItem4);
                }
            }
            this.m_ListBox.RepositionItems();
        }
    }
Example #6
0
    public void SortingQuestInGroup()
    {
        CQuest       cQuest       = null;
        QUEST_SORTID qUEST_SORTID = null;

        for (int i = 0; i < 200; i++)
        {
            if (this.m_stQuestGroupInfo.m_QuestUniqueBit.ContainsKey(i))
            {
                QUEST_SORTID qUEST_SORTID2 = this.m_stQuestGroupInfo.m_QuestUniqueBit[i];
                if (qUEST_SORTID2 != null)
                {
                    cQuest = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(qUEST_SORTID2.m_strQuestUnique);

                    if (cQuest != null)
                    {
                        CQuest questByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(cQuest.GetQuestCommon().strPreQuestUnique);

                        if (questByQuestUnique != null)
                        {
                            CQuestGroup questGroupByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByQuestUnique(cQuest.GetQuestUnique());

                            CQuestGroup questGroupByQuestUnique2 = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByQuestUnique(questByQuestUnique.GetQuestUnique());

                            if (questGroupByQuestUnique != null && questGroupByQuestUnique2 != null && questGroupByQuestUnique.GetGroupUnique() != questGroupByQuestUnique2.GetGroupUnique() && questGroupByQuestUnique.GetGroupSort() > questGroupByQuestUnique2.GetGroupSort() && this.m_stQuestGroupInfo.m_QuestUnique.ContainsKey(qUEST_SORTID2.m_strQuestUnique))
                            {
                                qUEST_SORTID = this.m_stQuestGroupInfo.m_QuestUnique[qUEST_SORTID2.m_strQuestUnique];
                                qUEST_SORTID.m_i32QuestSort = 1;
                                break;
                            }
                        }
                        else if (questByQuestUnique == null && this.m_stQuestGroupInfo.m_QuestUnique.ContainsKey(qUEST_SORTID2.m_strQuestUnique))
                        {
                            qUEST_SORTID = this.m_stQuestGroupInfo.m_QuestUnique[qUEST_SORTID2.m_strQuestUnique];
                            qUEST_SORTID.m_i32QuestSort = 1;
                            break;
                        }
                    }
                }
            }
        }
        if (qUEST_SORTID == null || cQuest == null)
        {
            return;
        }
        int num = 2;

        for (int j = 0; j < 200; j++)
        {
            CQuest questByQuestUnique2 = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(qUEST_SORTID.m_strQuestUnique);

            if (questByQuestUnique2 != null)
            {
                if (this.m_stQuestGroupInfo.m_QuestUnique.ContainsKey(questByQuestUnique2.GetQuestCommon().strNextQuestUnique))
                {
                    QUEST_SORTID qUEST_SORTID3 = this.m_stQuestGroupInfo.m_QuestUnique[questByQuestUnique2.GetQuestCommon().strNextQuestUnique];
                    if (qUEST_SORTID3 != null)
                    {
                        qUEST_SORTID3.m_i32QuestSort = num;
                        num++;
                        qUEST_SORTID = qUEST_SORTID3;
                    }
                }
            }
        }
        this.m_stQuestGroupInfo.m_QuestList.Sort(new Comparison <QUEST_SORTID>(NkQuestManager.AscendingQuestNum));
    }
Example #7
0
    private void ShowNpcImage(Adventure adventure)
    {
        if (adventure == null)
        {
            return;
        }
        bool flag = false;

        for (int i = 0; i < this.m_MaxControlNum; i++)
        {
            NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(adventure.GetMonsterKind(i));

            if (charKindInfoFromCode != null)
            {
                this.m_AdventureControl[i].m_MonsterImage.SetTexture(eCharImageType.SMALL, charKindInfoFromCode.GetCharKind(), -1, string.Empty);
                this.m_AdventureControl[i].m_ClearImage.Visible = false;
                if (NrTSingleton <NkQuestManager> .Instance.QuestGroupClearCheck(adventure.GetQuestGroupUnique(i)) == QUEST_CONST.E_QUEST_GROUP_STATE.E_QUEST_GROUP_STATE_NONE)
                {
                    this.m_AdventureControl[i].m_ClearImage.Visible  = true;
                    this.m_AdventureControl[i].m_DisableMark.Visible = false;
                    this.m_AdventureControl[i].m_DisableBG.Visible   = false;
                    this.m_AdventureControl[i].m_MonsterLevel.Text   = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1002"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                }
                else if (!flag)
                {
                    CQuestGroup questGroupByGroupUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByGroupUnique(adventure.GetQuestGroupUnique(i));

                    if (questGroupByGroupUnique != null)
                    {
                        CQuest cQuest = questGroupByGroupUnique.FindCurrentQuest();
                        if (cQuest != null)
                        {
                            QUEST_CONST.eQUESTSTATE questState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(cQuest.GetQuestUnique());

                            if (questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE)
                            {
                                this.m_CurrentQuest = cQuest;
                                this.m_AdventureControl[i].m_NpcButton.Visible = true;
                                this.m_AdventureControl[i].m_NpcImage.Visible  = true;
                                this.m_AdventureControl[i].m_QuestMark.Visible = true;
                                this.m_AdventureControl[i].m_NpcImage.SetTexture(eCharImageType.SMALL, cQuest.GetQuestCommon().i32QuestCharKind, -1, string.Empty);
                                this.m_AdventureControl[i].m_MonsterLevel.Text = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1002"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                            }
                            else if (questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ONGOING || questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_COMPLETE)
                            {
                                this.m_AdventureControl[i].m_DisableMark.Visible = false;
                                this.m_AdventureControl[i].m_DisableBG.Visible   = false;
                                this.m_AdventureControl[i].m_MonsterLevel.Text   = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1002"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                            }
                            else
                            {
                                this.m_AdventureControl[i].m_MonsterLevel.Text = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1102"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                            }
                            flag = true;
                        }
                    }
                }
                else
                {
                    this.m_AdventureControl[i].m_MonsterLevel.Text = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1102"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                }
            }
        }
        CQuestGroup questGroupByGroupUnique2 = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByGroupUnique(adventure.GetQuestGroupUnique(0));

        if (questGroupByGroupUnique2 == null)
        {
            return;
        }
        CQuest firstQuest = questGroupByGroupUnique2.GetFirstQuest();

        if (firstQuest == null)
        {
            return;
        }
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return;
        }
        if ((int)firstQuest.GetQuestLevel(0) > kMyCharInfo.GetLevel())
        {
            base.SetShowLayer(1, true);
            string empty = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("622"),
                "count",
                firstQuest.GetQuestLevel(0)
            });

            this.m_BaloonText.Text             = empty;
            this.m_NextButton.controlIsEnabled = false;
        }
        else
        {
            base.SetShowLayer(1, false);
            this.m_NextButton.controlIsEnabled = true;
        }
    }
    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;
                }
            }
        }
    }
    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);
    }
    private void SetQuestSubStory()
    {
        bool flag = false;

        this.m_kSubStoryListBox.Clear();
        int level = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetLevel();

        foreach (CQuestGroup current in this.m_kQuestGroupList)
        {
            for (int i = 0; i < 200; i++)
            {
                CQuest questByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(current.GetQuestUniqueByBit(i));

                if (questByQuestUnique != null)
                {
                    if (!NrTSingleton <NkQuestManager> .Instance.IsCompletedQuest(questByQuestUnique.GetQuestUnique()))
                    {
                        if ((int)questByQuestUnique.GetQuestLevel(1) <= level)
                        {
                            if (NrTSingleton <NkQuestManager> .Instance.GetQuestState(questByQuestUnique.GetQuestUnique()) == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE)
                            {
                                NewListItem newListItem = new NewListItem(this.m_kSubStoryListBox.ColumnNum, true, string.Empty);
                                if ((int)questByQuestUnique.GetQuestLevel(1) < level)
                                {
                                    newListItem.SetListItemData(7, false);
                                }
                                string empty = string.Empty;
                                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                                {
                                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("75"),
                                    "count",
                                    current.GetPageUnique()
                                });

                                newListItem.SetListItemData(1, empty, null, null, null);
                                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                                {
                                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("93"),
                                    "targetname",
                                    questByQuestUnique.GetQuestNpcName()
                                });

                                newListItem.SetListItemData(3, empty, questByQuestUnique.GetQuestUnique(), new EZValueChangedDelegate(this.ClickMove), null);
                                newListItem.SetListItemData(4, current.GetGroupTitle(), null, null, null);
                                newListItem.SetListItemData(5, "UI/Adventure/EpisodeBG", true, null, null);
                                newListItem.SetListItemData(6, questByQuestUnique.GetQuestNpc().GetCharKind(), true, null, null);
                                newListItem.SetListItemData(8, questByQuestUnique.GetQuestLevel(1).ToString(), null, null, null);
                                newListItem.SetListItemData(8, false);
                                this.m_kSubStoryListBox.Add(newListItem);
                                flag = true;
                                break;
                            }
                        }
                    }
                }
            }
        }
        this.m_kSubStoryListBox.RepositionItems();
        if (flag)
        {
            base.SetShowLayer(1, false);
        }
    }
Example #11
0
    public bool IsAcceptQuest()
    {
        foreach (Adventure current in this.m_kAdventureInfo.Values)
        {
            foreach (Adventure.AdventureInfo current2 in current.m_kAdventureInfo)
            {
                if (NrTSingleton <NkQuestManager> .Instance.QuestGroupClearCheck(current2.questGroupUnique) != QUEST_CONST.E_QUEST_GROUP_STATE.E_QUEST_GROUP_STATE_NONE)
                {
                    CQuestGroup questGroupByGroupUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByGroupUnique(current2.questGroupUnique);

                    if (questGroupByGroupUnique != null)
                    {
                        CQuest cQuest = questGroupByGroupUnique.FindCurrentQuest();
                        if (cQuest != null)
                        {
                            QUEST_CONST.eQUESTSTATE questState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(cQuest.GetQuestUnique());

                            if (questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE && NrTSingleton <NkQuestManager> .Instance.GetCurrentQuestCount() == 0)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
        }
        return(false);
    }
Example #12
0
    public Adventure GetCurrentAdventure(ref int index)
    {
        int       num    = 0;
        Adventure result = null;

        foreach (Adventure current in this.m_kAdventureInfo.Values)
        {
            foreach (Adventure.AdventureInfo current2 in current.m_kAdventureInfo)
            {
                if (NrTSingleton <NkQuestManager> .Instance.QuestGroupClearCheck(current2.questGroupUnique) == QUEST_CONST.E_QUEST_GROUP_STATE.E_QUEST_GROUP_STATE_NONE)
                {
                    index  = num;
                    result = current;
                }
                else
                {
                    CQuestGroup questGroupByGroupUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByGroupUnique(current2.questGroupUnique);

                    if (questGroupByGroupUnique != null)
                    {
                        CQuest cQuest = questGroupByGroupUnique.FindCurrentQuest();
                        if (cQuest != null)
                        {
                            QUEST_CONST.eQUESTSTATE questState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(cQuest.GetQuestUnique());

                            if (questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE || questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ONGOING || questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_COMPLETE)
                            {
                                index = num;
                                return(current);
                            }
                        }
                    }
                }
            }
            num++;
        }
        return(result);
    }