Ejemplo n.º 1
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);
    }
Ejemplo n.º 2
0
 private void QuestSymbol(int i32CharKind, QUEST_CONST.eQUESTSTATE eState)
 {
     this.m_DrawTexture_NpcIcon.Visible = true;
     if (eState != QUEST_CONST.eQUESTSTATE.QUESTSTATE_NOT_ACCEPTABLE_NOT_VIEW && eState != QUEST_CONST.eQUESTSTATE.QUESTSTATE_NONE && eState != QUEST_CONST.eQUESTSTATE.QUESTSTATE_END)
     {
         if (eState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_COMPLETE)
         {
             this.m_DrawTexture_NpcIcon.SetTexture("NPC_I_QuestI11");
         }
         else if (eState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_DAYQUEST_COMPLETE)
         {
             this.m_DrawTexture_NpcIcon.SetTexture("NPC_I_QuestI13");
         }
         else if (eState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ONGOING)
         {
             this.m_DrawTexture_NpcIcon.SetTexture("NPC_I_QuestI12");
         }
         else if (eState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE)
         {
             this.m_DrawTexture_NpcIcon.SetTexture("NPC_I_QuestI21");
         }
         else if (eState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_DAYQUEST_ACCEPTABLE)
         {
             this.m_DrawTexture_NpcIcon.SetTexture("NPC_I_QuestI23");
         }
     }
     else
     {
         this.m_DrawTexture_NpcIcon.SetTexture("NPC_I_Nomal");
     }
 }
Ejemplo n.º 3
0
    public void SetCharKind(short i16CharUnique, NrCharKindInfo charKindInfo, QUEST_CONST.eQUESTSTATE eState)
    {
        int charKind = charKindInfo.GetCharKind();

        if (this.m_nOldCharUnique == i16CharUnique && charKindInfo.IsATB(8L))
        {
            this.QuestSymbol(charKind, eState);
            this.m_Button_Npc.SetButtonTextureKey("Win_B_NewTileBtnOrange");
            return;
        }
        if (this.m_nOldCharUnique == i16CharUnique && charKindInfo.IsATB(16L))
        {
            this.QuestSymbol(charKind, eState);
            this.m_Button_Npc.SetButtonTextureKey("Win_B_NewTileBtnOrange");
            return;
        }
        if (this.m_nOldCharUnique == i16CharUnique && charKindInfo.IsATB(4L))
        {
            this.BattleSymbol();
            this.m_Button_Npc.SetButtonTextureKey("Win_B_BattleControl");
            return;
        }
        this.m_i16CharUnique  = i16CharUnique;
        this.m_nOldCharUnique = i16CharUnique;
        string name = NrTSingleton <NrCharKindInfoManager> .Instance.GetName(charKind);

        if (name.Length > 5)
        {
            float num;
            if (NrGlobalReference.strLangType.Equals("eng"))
            {
                num = (float)name.Length * this.m_Button_Npc.fontSize / 2f;
            }
            else
            {
                num = (float)name.Length * this.m_Button_Npc.fontSize;
            }
            base.SetSize(num + 50f, base.GetSize().y);
            this.m_Button_Npc.SetSize(num, this.m_Button_Npc.GetSize().y);
        }
        this.m_Button_Npc.Text = name;
        if (this.m_nOldCharUnique == i16CharUnique && charKindInfo.IsATB(8L))
        {
            this.QuestSymbol(charKind, eState);
            this.m_Button_Npc.SetButtonTextureKey("Win_B_NewTileBtnOrange");
        }
        else if (this.m_nOldCharUnique == i16CharUnique && charKindInfo.IsATB(16L))
        {
            this.QuestSymbol(charKind, eState);
            this.m_Button_Npc.SetButtonTextureKey("Win_B_NewTileBtnOrange");
        }
        else if (this.m_nOldCharUnique == i16CharUnique && charKindInfo.IsATB(4L))
        {
            this.BattleSymbol();
            this.m_Button_Npc.SetButtonTextureKey("Win_B_BattleControl");
        }
    }
Ejemplo n.º 4
0
    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;
        }
    }
Ejemplo n.º 5
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);
    }
Ejemplo n.º 6
0
    public override void Update()
    {
        if (null != this.m_Touch)
        {
            NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

            if (@char != null && this.m_kQuest != null)
            {
                if ([email protected]_kCharMove.IsMoving() && !this.bClickTouch && 0 < this.m_kQuestList.Count)
                {
                    QUEST_CONST.eQUESTSTATE questState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(this.m_kQuest.GetQuestUnique());

                    if (this.m_kQuest.IsAutoMoveQuest() || questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_COMPLETE)
                    {
                        this.m_Touch.RenderEnabled = true;
                    }
                    else
                    {
                        this.m_Touch.RenderEnabled = false;
                    }
                }
                else if (@char.m_kCharMove.IsMoving())
                {
                    this.bClickTouch = false;
                }
            }
            else
            {
                this.m_Touch.RenderEnabled = false;
            }
            if (this.m_kQuestList.Count == 0)
            {
                this.m_Touch.RenderEnabled = false;
            }
        }
        base.Update();
    }
    public static bool IsQuestState(string QuestUnique, QUEST_CONST.eQUESTSTATE QuestState)
    {
        QUEST_CONST.eQUESTSTATE questState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(QuestUnique);

        return(questState == QuestState);
    }
Ejemplo n.º 8
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;
        }
    }
Ejemplo n.º 9
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.º 10
0
    public void SetQuestInfo(CQuest kQuest)
    {
        this.m_Quest       = kQuest;
        this.m_eQuestState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(this.m_Quest.GetQuestUnique());

        if (this.m_eQuestState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE)
        {
            this.m_Quest_Info_Cancel.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1162");
        }
        else if (this.m_eQuestState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ONGOING || this.m_eQuestState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_COMPLETE)
        {
            this.m_Quest_Info_Cancel.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("799");
        }
        else
        {
            this.m_Quest_Info_Cancel.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("10");
        }
        CQuestGroup questGroupByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByQuestUnique(this.m_Quest.GetQuestUnique());

        short chapterUnique = NrTSingleton <NkQuestManager> .Instance.GetChapterUnique(this.m_Quest.GetQuestUnique());

        string text = "None";

        if (questGroupByQuestUnique != null)
        {
            text = questGroupByQuestUnique.GetPage();
        }
        string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("666");

        string textFromInterface2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("667");

        string text2 = string.Concat(new object[]
        {
            this.str1101,
            chapterUnique,
            textFromInterface2,
            " ",
            text,
            textFromInterface,
            ". ",
            this.str1107,
            kQuest.GetQuestTitle()
        });

        if (questGroupByQuestUnique.GetQuestType() == 2)
        {
            text2 = string.Concat(new string[]
            {
                this.str1101,
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1454"),
                ". ",
                this.str1107,
                kQuest.GetQuestTitle()
            });
        }
        else if (questGroupByQuestUnique.GetQuestType() == 100)
        {
            text2 = string.Concat(new string[]
            {
                this.str1101,
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("784"),
                ". ",
                this.str1107,
                kQuest.GetQuestTitle()
            });
        }
        this.m_Quest_Info_Chapter_Page_Quest_Title.SetText(text2);
        text2 = string.Empty;
        this.m_Quest_Info_Summary.Clear();
        ListItem listItem = new ListItem();

        if (this.m_eQuestState <= QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE)
        {
            text2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1202");

            this.m_Quest_Info_Summary.SetColumnAlignment(0, SpriteText.Anchor_Pos.Middle_Center);
            this.m_Quest_Info_Description_BG2.SetAlpha(0.7f);
            this.m_Quest_Info_Description_BG1.SetAlpha(0.7f);
        }
        else
        {
            text2 = this.m_Quest.GetQuestSummary();
            this.m_Quest_Info_Summary.SetColumnAlignment(0, SpriteText.Anchor_Pos.Middle_Left);
            this.m_Quest_Info_Description_BG2.SetAlpha(1f);
            this.m_Quest_Info_Description_BG1.SetAlpha(1f);
        }
        listItem.SetColumnStr(0, text2);
        this.m_Quest_Info_Summary.Add(listItem);
        this.m_Quest_Info_Summary.RepositionItems();
        text2 = string.Empty;
        if (this.m_Quest.GetQuestCommon().cQuestCondition[0] != null)
        {
            text2 = this.m_Quest.GetConditionText(0L, 0);
            this.m_Quest_Info_Condition_Hint01.SetText(this.str1201 + text2);
        }
        if (this.m_Quest.GetQuestCommon().cQuestCondition[1] != null)
        {
            text2 = this.m_Quest.GetConditionText(0L, 1);
            this.m_Quest_Info_Condition_Hint02.SetText(this.str1201 + text2);
        }
        if (this.m_Quest.GetQuestCommon().cQuestCondition[2] != null)
        {
            text2 = this.m_Quest.GetConditionText(0L, 2);
            this.m_Quest_Info_Condition_Hint03.SetText(this.str1201 + text2);
        }
        if (this.m_eQuestState <= QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE)
        {
            this.m_Quest_Info_Condition_Hint01.SetText(string.Empty);
            this.m_Quest_Info_Condition_Hint02.SetText(string.Empty);
            this.m_Quest_Info_Condition_Hint03.SetText(string.Empty);
        }
        this.SetGrade();
        this.SetReward();
    }