Exemple #1
0
    public override bool ParseDataFromNDT(TsDataReader dr)
    {
        foreach (TsDataReader.Row data in dr)
        {
            NrClientNpcInfo nrClientNpcInfo = new NrClientNpcInfo();
            nrClientNpcInfo.SetData(data);
            if (NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(nrClientNpcInfo.kStartCon.strQuestUnique) == null)
            {
                string msg = string.Concat(new string[]
                {
                    "캐릭터 코드 : ",
                    nrClientNpcInfo.strCharCode,
                    " 퀘스트",
                    nrClientNpcInfo.kStartCon.strQuestUnique,
                    "클라이언트 npc 시작 퀘스트 정보가 없습니다"
                });
                NrTSingleton <NrMainSystem> .Instance.Alert(msg);
            }
            if (NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(nrClientNpcInfo.kEndCon.strQuestUnique) == null)
            {
                string msg2 = string.Concat(new string[]
                {
                    "캐릭터 코드 : ",
                    nrClientNpcInfo.strCharCode,
                    " 퀘스트",
                    nrClientNpcInfo.kEndCon.strQuestUnique,
                    "클라이언트 npc 마지막 퀘스트 정보가 없습니다"
                });
                NrTSingleton <NrMainSystem> .Instance.Alert(msg2);
            }
            NrTSingleton <NkQuestManager> .Instance.AddQuestAutoPath(nrClientNpcInfo);

            if (!NrTSingleton <NkQuestManager> .Instance.AddQuestNpcPos(nrClientNpcInfo))
            {
                Debug.LogError("XML Parsing Error! - " + this.m_strFilePath);
            }
        }
        return(true);
    }
    private void ClickStart(IUIObject obj)
    {
        NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

        if (@char == null)
        {
            return;
        }
        if (!NrTSingleton <NkClientLogic> .Instance.IsMovable())
        {
            return;
        }
        NrTSingleton <NrAutoPath> .Instance.ResetData();

        Vector3 lhs  = Vector3.zero;
        Vector2 zero = Vector2.zero;

        if (@char.m_kCharMove == null)
        {
            return;
        }
        int num = 0;

        if (this.m_CurrentQuest != null)
        {
            num = this.m_CurrentQuest.GetQuestCommon().iCastleUnique;
            NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(this.m_CurrentQuest.GetQuestCommon().GiveQuestCharCode);

            if (charKindInfoFromCode != null)
            {
                NrClientNpcPosList clientNpcPosList = NrTSingleton <NkQuestManager> .Instance.GetClientNpcPosList(num);

                if (clientNpcPosList != null)
                {
                    for (int i = 0; i < clientNpcPosList.ClientNpcPosList.Count; i++)
                    {
                        NrClientNpcInfo nrClientNpcInfo = clientNpcPosList.ClientNpcPosList[i];
                        if (nrClientNpcInfo != null && NrTSingleton <NkQuestManager> .Instance.ClinetNpcCreateCheck(nrClientNpcInfo.kStartCon, nrClientNpcInfo.kEndCon) && charKindInfoFromCode.GetCode() == nrClientNpcInfo.strCharCode && num == nrClientNpcInfo.i32MapIndex)
                        {
                            NrCharBase char2 = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                            if (char2 != null && char2.m_kCharMove != null)
                            {
                                lhs    = char2.m_kCharMove.FindFirstPath(num, (short)nrClientNpcInfo.fFixPosX, (short)nrClientNpcInfo.fFixPosY, false);
                                zero.x = nrClientNpcInfo.fFixPosX;
                                zero.y = nrClientNpcInfo.fFixPosY;
                            }
                        }
                    }
                }
                if (lhs == Vector3.zero)
                {
                    NrNpcPos npcPos = NrTSingleton <NrNpcPosManager> .Instance.GetNpcPos(charKindInfoFromCode.GetPosKey(), charKindInfoFromCode.GetCharKind(), num);

                    if (npcPos != null && @char.m_kCharMove != null)
                    {
                        lhs    = @char.m_kCharMove.FindFirstPath(npcPos.nMapIndex, (short)npcPos.kPos.x, (short)npcPos.kPos.z, false);
                        zero.x = npcPos.kPos.x;
                        zero.y = npcPos.kPos.z;
                    }
                }
            }
        }
        else
        {
            num    = this.m_CurrentAdventureInfo.mapIndex;
            lhs    = @char.m_kCharMove.FindFirstPath(num, (short)this.m_CurrentAdventureInfo.destX, (short)this.m_CurrentAdventureInfo.destY, false);
            zero.x = (float)this.m_CurrentAdventureInfo.destX;
            zero.y = (float)this.m_CurrentAdventureInfo.destY;
        }
        if (!NrTSingleton <NkClientLogic> .Instance.ShowDownLoadUI(0, num))
        {
            return;
        }
        NrMyCharInfo myCharInfo = NrTSingleton <NkCharManager> .Instance.GetMyCharInfo();

        if (myCharInfo == null)
        {
            return;
        }
        int mapIndex = myCharInfo.m_kCharMapInfo.MapIndex;

        if (num == mapIndex)
        {
            if (lhs != Vector3.zero)
            {
                GS_CHAR_FINDPATH_REQ gS_CHAR_FINDPATH_REQ = new GS_CHAR_FINDPATH_REQ();
                gS_CHAR_FINDPATH_REQ.DestPos.x = lhs.x;
                gS_CHAR_FINDPATH_REQ.DestPos.y = lhs.y;
                gS_CHAR_FINDPATH_REQ.DestPos.z = lhs.z;
                SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_CHAR_FINDPATH_REQ, gS_CHAR_FINDPATH_REQ);
                TsAudioManager.Instance.AudioContainer.RequestAudioClip("UI_SFX", "QUEST", "AUTOMOVE", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
            }
            if (NrTSingleton <FormsManager> .Instance.IsShow(G_ID.ADVENTURECOLLECT_DLG))
            {
                NrTSingleton <FormsManager> .Instance.CloseForm(G_ID.ADVENTURECOLLECT_DLG);
            }
            base.CloseForm(null);
            NrTSingleton <FormsManager> .Instance.GetForm(G_ID.ADVENTURE_DLG).CloseForm(null);
        }
        else
        {
            string mapName = NrTSingleton <MapManager> .Instance.GetMapName(num);

            if (mapName != string.Empty)
            {
                MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI;

                if (msgBoxUI == null)
                {
                    return;
                }
                ICollection gateInfo_Col = NrTSingleton <NrBaseTableManager> .Instance.GetGateInfo_Col();

                if (gateInfo_Col == null)
                {
                    return;
                }
                int num2 = 0;
                foreach (GATE_INFO gATE_INFO in gateInfo_Col)
                {
                    if (num == gATE_INFO.DST_MAP_IDX)
                    {
                        num2 = gATE_INFO.GATE_IDX;
                    }
                }
                string empty = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("4"),
                    "mapname",
                    mapName
                });

                msgBoxUI.SetMsg(new YesDelegate(this.MapWarp), num2, NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("3"), empty, eMsgType.MB_OK_CANCEL, 2);
                msgBoxUI.SetButtonOKText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("109"));
                msgBoxUI.SetButtonCancelText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("11"));
                this.m_nAutoMoveMapIndex  = num;
                this.m_nAutoMoveGateIndex = num2;
                NrTSingleton <NkQuestManager> .Instance.AutoMoveMapIndex = this.m_nAutoMoveMapIndex;
                NrTSingleton <NkQuestManager> .Instance.AutoMove         = true;
                NrTSingleton <NkQuestManager> .Instance.AutoMoveDestPos  = zero;
            }
        }
    }