Ejemplo n.º 1
0
    private bool Set_Quest_Dialog_Info(string strTextKey, string strText)
    {
        QUEST_DLG_INFO qUEST_DLG_INFO = new QUEST_DLG_INFO();

        NrTSingleton <CTextParser> .Instance.ParsingQuestDlg(ref qUEST_DLG_INFO, strTextKey + strText);

        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParamColor(out empty, new string[]
        {
            qUEST_DLG_INFO.strLang_Idx
        });

        qUEST_DLG_INFO.strLang_Idx = empty;
        NrTSingleton <NkQuestManager> .Instance.AddQuestDlg(qUEST_DLG_INFO);

        QUEST_NPC_POS_INFO qUEST_NPC_POS_INFO = NrTSingleton <NrBaseTableManager> .Instance.GetQuestNPCPosInfo(qUEST_DLG_INFO.strDialogUnique);

        if (qUEST_NPC_POS_INFO == null)
        {
            qUEST_NPC_POS_INFO              = new QUEST_NPC_POS_INFO();
            qUEST_NPC_POS_INFO.strUnique    = qUEST_DLG_INFO.strDialogUnique;
            qUEST_NPC_POS_INFO.CHAR_CODE[0] = qUEST_DLG_INFO.QuestDlgCharCode;
        }
        else
        {
            bool flag = false;
            for (byte b = 0; b < 5; b += 1)
            {
                if (qUEST_NPC_POS_INFO.CHAR_CODE[(int)b] == qUEST_DLG_INFO.QuestDlgCharCode)
                {
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                for (byte b2 = 0; b2 < 5; b2 += 1)
                {
                    if (qUEST_NPC_POS_INFO.CHAR_CODE[(int)b2] == string.Empty)
                    {
                        qUEST_NPC_POS_INFO.CHAR_CODE[(int)b2] = qUEST_DLG_INFO.QuestDlgCharCode;
                        break;
                    }
                }
            }
        }
        return(NrTSingleton <NrBaseTableManager> .Instance.SetData(qUEST_NPC_POS_INFO));
    }
Ejemplo n.º 2
0
    public string GetQuestSummary()
    {
        string         strDlgID     = this.GetQuestUnique().ToString() + "a";
        int            num          = 1;
        QUEST_DLG_INFO questDlgInfo = NrTSingleton <NkQuestManager> .Instance.GetQuestDlgInfo(strDlgID, num);

        string textColor = NrTSingleton <CTextParser> .Instance.GetTextColor("1107");

        string textColor2 = NrTSingleton <CTextParser> .Instance.GetTextColor("1101");

        string charName = NrTSingleton <NkCharManager> .Instance.GetChar(1).GetCharName();

        NrTSingleton <UIDataManager> .Instance.InitStringBuilder();

        NrTSingleton <UIDataManager> .Instance.AppendString("{&20}");

        NrTSingleton <UIDataManager> .Instance.AppendString(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1637"));

        NrTSingleton <UIDataManager> .Instance.AppendString("{&15}");

        NrTSingleton <UIDataManager> .Instance.AppendString("\n");

        while (questDlgInfo != null)
        {
            string strLang_Idx = questDlgInfo.strLang_Idx;
            string empty       = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                strLang_Idx
            });

            NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(questDlgInfo.QuestDlgCharCode);

            if (charKindInfoFromCode == null)
            {
                num++;
                questDlgInfo = NrTSingleton <NkQuestManager> .Instance.GetQuestDlgInfo(strDlgID, num);
            }
            else
            {
                if (questDlgInfo.bTalkUser)
                {
                    NrTSingleton <UIDataManager> .Instance.AppendString(NrTSingleton <CTextParser> .Instance.GetTextColor("1104"));

                    NrTSingleton <UIDataManager> .Instance.AppendString("[");

                    NrTSingleton <UIDataManager> .Instance.AppendString(charName);

                    NrTSingleton <UIDataManager> .Instance.AppendString("] ");

                    NrTSingleton <UIDataManager> .Instance.AppendString(textColor2);

                    NrTSingleton <UIDataManager> .Instance.AppendString(empty);
                }
                else
                {
                    NrTSingleton <UIDataManager> .Instance.AppendString(textColor);

                    NrTSingleton <UIDataManager> .Instance.AppendString("[");

                    NrTSingleton <UIDataManager> .Instance.AppendString(charKindInfoFromCode.GetName());

                    NrTSingleton <UIDataManager> .Instance.AppendString("] ");

                    NrTSingleton <UIDataManager> .Instance.AppendString(textColor2);

                    NrTSingleton <UIDataManager> .Instance.AppendString(empty);
                }
                if (string.Empty != questDlgInfo.strUserAnswer)
                {
                    NrTSingleton <UIDataManager> .Instance.AppendString("\n");

                    NrTSingleton <UIDataManager> .Instance.AppendString(NrTSingleton <CTextParser> .Instance.GetTextColor("1104"));

                    NrTSingleton <UIDataManager> .Instance.AppendString("[");

                    NrTSingleton <UIDataManager> .Instance.AppendString(charName);

                    NrTSingleton <UIDataManager> .Instance.AppendString("] ");

                    NrTSingleton <UIDataManager> .Instance.AppendString(textColor2);

                    NrTSingleton <UIDataManager> .Instance.AppendString(questDlgInfo.strUserAnswer);
                }
                NrTSingleton <UIDataManager> .Instance.AppendString("\n");

                num++;
                questDlgInfo = NrTSingleton <NkQuestManager> .Instance.GetQuestDlgInfo(strDlgID, num);
            }
        }
        string @string = NrTSingleton <UIDataManager> .Instance.GetString();

        if (NrTSingleton <NkQuestManager> .Instance.GetQuestState(this.GetQuestUnique()) == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ONGOING)
        {
            return(@string);
        }
        if (NrTSingleton <NkQuestManager> .Instance.GetQuestState(this.GetQuestUnique()) == QUEST_CONST.eQUESTSTATE.QUESTSTATE_COMPLETE)
        {
            return(@string);
        }
        NrTSingleton <UIDataManager> .Instance.AppendString("\n\n");

        NrTSingleton <UIDataManager> .Instance.AppendString("{&20}");

        NrTSingleton <UIDataManager> .Instance.AppendString(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1638"));

        NrTSingleton <UIDataManager> .Instance.AppendString("{&15}");

        NrTSingleton <UIDataManager> .Instance.AppendString("\n");

        strDlgID     = this.GetQuestUnique() + "p";
        num          = 1;
        questDlgInfo = NrTSingleton <NkQuestManager> .Instance.GetQuestDlgInfo(strDlgID, num);

        while (questDlgInfo != null)
        {
            string strLang_Idx2 = questDlgInfo.strLang_Idx;
            string empty2       = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty2, new object[]
            {
                strLang_Idx2
            });

            NrCharKindInfo charKindInfoFromCode2 = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(questDlgInfo.QuestDlgCharCode);

            if (charKindInfoFromCode2 == null)
            {
                num++;
                questDlgInfo = NrTSingleton <NkQuestManager> .Instance.GetQuestDlgInfo(strDlgID, num);
            }
            else
            {
                if (questDlgInfo.bTalkUser)
                {
                    NrTSingleton <UIDataManager> .Instance.AppendString(NrTSingleton <CTextParser> .Instance.GetTextColor("1104"));

                    NrTSingleton <UIDataManager> .Instance.AppendString("[");

                    NrTSingleton <UIDataManager> .Instance.AppendString(charName);

                    NrTSingleton <UIDataManager> .Instance.AppendString("] ");

                    NrTSingleton <UIDataManager> .Instance.AppendString(textColor2);

                    NrTSingleton <UIDataManager> .Instance.AppendString(empty2);
                }
                else
                {
                    NrTSingleton <UIDataManager> .Instance.AppendString(textColor);

                    NrTSingleton <UIDataManager> .Instance.AppendString("[");

                    NrTSingleton <UIDataManager> .Instance.AppendString(charKindInfoFromCode2.GetName());

                    NrTSingleton <UIDataManager> .Instance.AppendString("] ");

                    NrTSingleton <UIDataManager> .Instance.AppendString(textColor2);

                    NrTSingleton <UIDataManager> .Instance.AppendString(empty2);
                }
                if (string.Empty != questDlgInfo.strUserAnswer)
                {
                    NrTSingleton <UIDataManager> .Instance.AppendString("\n");

                    NrTSingleton <UIDataManager> .Instance.AppendString(NrTSingleton <CTextParser> .Instance.GetTextColor("1104"));

                    NrTSingleton <UIDataManager> .Instance.AppendString("[");

                    NrTSingleton <UIDataManager> .Instance.AppendString(charName);

                    NrTSingleton <UIDataManager> .Instance.AppendString("] ");

                    NrTSingleton <UIDataManager> .Instance.AppendString(textColor2);

                    NrTSingleton <UIDataManager> .Instance.AppendString(questDlgInfo.strUserAnswer);
                }
                NrTSingleton <UIDataManager> .Instance.AppendString("\n");

                num++;
                questDlgInfo = NrTSingleton <NkQuestManager> .Instance.GetQuestDlgInfo(strDlgID, num);
            }
        }
        return(NrTSingleton <UIDataManager> .Instance.GetString());
    }
Ejemplo n.º 3
0
    public bool ParsingQuestDlg(ref QUEST_DLG_INFO info, string strInfo)
    {
        int i   = 0;
        int num = 0;

        this.paramValueBuilder.Length = 0;
        bool flag = false;

        while (i < strInfo.Length)
        {
            if (strInfo[i] == this.m_szTag[16])
            {
                string text = this.paramValueBuilder.ToString();
                switch (num)
                {
                case 0:
                    info.strDialogUnique = NrTSingleton <UIDataManager> .Instance.GetString(info.strDialogUnique, text);

                    break;

                case 1:
                    info.strDialogUnique = NrTSingleton <UIDataManager> .Instance.GetString(info.strDialogUnique, text);

                    break;

                case 2:
                    int.TryParse(text, out info.i32OrderUnique);
                    break;

                case 3:
                    if (text.Contains("&"))
                    {
                        int startIndex = text.IndexOf("&");
                        text           = text.Remove(startIndex);
                        info.bTalkUser = true;
                    }
                    if (text.Contains("*"))
                    {
                        char[] separator = new char[]
                        {
                            '*'
                        };
                        string[] array = text.Split(separator);
                        if (2 <= array.Length)
                        {
                            info.nNpcName = int.Parse(array[1]);
                        }
                        text = array[0];
                    }
                    if (text.Contains("#"))
                    {
                        char[] separator2 = new char[]
                        {
                            '#'
                        };
                        string[] array2 = text.Split(separator2);
                        if (1 <= array2.Length)
                        {
                            char[] separator3 = new char[]
                            {
                                '%'
                            };
                            string[] array3 = array2[0].Split(separator3);
                            if (1 <= array3.Length)
                            {
                                info.QuestDlgCharCode = array3[0];
                                if (info.QuestDlgCharCode == "player")
                                {
                                    info.bTalkUser = true;
                                }
                            }
                            if (2 <= array3.Length)
                            {
                                QUEST_DLG_INFO.Alignment ePosition = QUEST_DLG_INFO.Alignment.CENTER;
                                if (array3[1] == "l")
                                {
                                    ePosition = QUEST_DLG_INFO.Alignment.LEFT;
                                }
                                else if (array3[1] == "r")
                                {
                                    ePosition = QUEST_DLG_INFO.Alignment.RIGHT;
                                }
                                info.ePosition = ePosition;
                            }
                            if (3 <= array3.Length)
                            {
                                if (array3[2] == "x")
                                {
                                    info.bShowName = false;
                                }
                                else
                                {
                                    info.bShowName = true;
                                }
                            }
                            if (4 <= array3.Length)
                            {
                                if (array3[3] == "x")
                                {
                                    info.bShowImage = false;
                                }
                                else
                                {
                                    info.bShowImage = true;
                                }
                            }
                        }
                        if (2 <= array2.Length)
                        {
                            char[] separator4 = new char[]
                            {
                                '%'
                            };
                            string[] array4 = array2[1].Split(separator4);
                            if (1 <= array4.Length)
                            {
                                info.QuestDlgCharCode2 = array4[0];
                                if (info.QuestDlgCharCode2 == "player")
                                {
                                    info.bTalkUser = true;
                                }
                            }
                            if (2 <= array4.Length)
                            {
                                QUEST_DLG_INFO.Alignment ePosition2 = QUEST_DLG_INFO.Alignment.NONE;
                                if (array4[1] == "l")
                                {
                                    ePosition2 = QUEST_DLG_INFO.Alignment.LEFT;
                                }
                                else if (array4[1] == "r")
                                {
                                    ePosition2 = QUEST_DLG_INFO.Alignment.RIGHT;
                                }
                                info.ePosition2 = ePosition2;
                            }
                            if (3 <= array4.Length)
                            {
                                if (array4[2] == "x")
                                {
                                    info.bShowName2 = false;
                                }
                                else
                                {
                                    info.bShowName2 = true;
                                }
                            }
                            else
                            {
                                info.bShowName2 = true;
                            }
                            if (3 <= array4.Length)
                            {
                                if (array4[2] == "x")
                                {
                                    info.bShowImage2 = false;
                                }
                                else
                                {
                                    info.bShowImage2 = true;
                                }
                            }
                            else
                            {
                                info.bShowImage2 = true;
                            }
                        }
                    }
                    else if (text.Contains("%"))
                    {
                        char[] separator5 = new char[]
                        {
                            '%'
                        };
                        string[] array5 = text.Split(separator5);
                        if (1 <= array5.Length)
                        {
                            info.QuestDlgCharCode = NrTSingleton <UIDataManager> .Instance.GetString(info.QuestDlgCharCode, array5[0]);

                            if (info.QuestDlgCharCode == "player")
                            {
                                info.bTalkUser = true;
                            }
                        }
                        if (2 <= array5.Length)
                        {
                            QUEST_DLG_INFO.Alignment ePosition3 = QUEST_DLG_INFO.Alignment.CENTER;
                            if (array5[1] == "l")
                            {
                                ePosition3 = QUEST_DLG_INFO.Alignment.LEFT;
                            }
                            else if (array5[1] == "r")
                            {
                                ePosition3 = QUEST_DLG_INFO.Alignment.RIGHT;
                            }
                            info.ePosition = ePosition3;
                        }
                        if (3 <= array5.Length)
                        {
                            if (array5[2] == "x")
                            {
                                info.bShowName = false;
                            }
                            else
                            {
                                info.bShowName = true;
                            }
                        }
                        if (4 <= array5.Length)
                        {
                            if (array5[3] == "x")
                            {
                                info.bShowImage = false;
                            }
                            else
                            {
                                info.bShowImage = true;
                            }
                        }
                    }
                    else
                    {
                        info.QuestDlgCharCode = NrTSingleton <UIDataManager> .Instance.GetString(info.QuestDlgCharCode, text);
                    }
                    break;

                case 4:
                    info.strLang_Idx = NrTSingleton <UIDataManager> .Instance.GetString(info.strLang_Idx, text);

                    break;

                case 5:
                    goto IL_4E5;

                case 6:
                    info.strUserAnswer = NrTSingleton <UIDataManager> .Instance.GetString(info.strUserAnswer, text);

                    break;

                default:
                    goto IL_4E5;
                }
IL_661:
                this.paramValueBuilder.Length = 0;
                num++;
                i++;
                continue;
IL_4E5:
                if (text.Equals("s"))
                {
                    info.AddDLGOption(2L);
                }
                else if (text.Equals("b"))
                {
                    info.AddDLGOption(1L);
                }
                else if (text.Equals("sb"))
                {
                    info.AddDLGOption(2L);
                    info.AddDLGOption(1L);
                }
                else if (text.Equals("c"))
                {
                    info.AddDLGOption(4L);
                }
                else if (text.Equals("sound"))
                {
                    info.AddDLGOption(8L);
                    flag = true;
                }
                else if (flag)
                {
                    info.strSound = text;
                    flag          = false;
                }
                else if (text.Equals("i"))
                {
                    info.MakeLoadImage();
                }
                else if (text.Equals("ir"))
                {
                    info.MakeLoadImage();
                    info.AddDLGOption(16L);
                }
                else if (text.Equals("il"))
                {
                    info.MakeLoadImage();
                    info.AddDLGOption(32L);
                }
                else if (text.Equals("ic"))
                {
                    info.bImageClose = true;
                }
                else if (text.Equals("fw"))
                {
                    info.AddDLGOption(64L);
                }
                else if (text.Equals("fb"))
                {
                    info.AddDLGOption(128L);
                }
                goto IL_661;
            }
            this.paramValueBuilder.Append(strInfo[i]);
            i++;
        }
        return(true);
    }