예제 #1
0
    public void AddNpcPos(ECO kEco)
    {
        if (0f < kEco.kMovePos[0].x || 0f < kEco.kMovePos[0].z)
        {
            return;
        }
        if (0f < kEco.kRanPos.x || 0f < kEco.kRanPos.z)
        {
            return;
        }
        NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(kEco.szCharCode[0]);

        if (charKindInfoFromCode == null)
        {
            return;
        }
        if (charKindInfoFromCode.IsATB(8L))
        {
            NrNpcPos nrNpcPos = new NrNpcPos();
            nrNpcPos.strKey = NrTSingleton <UIDataManager> .Instance.GetString(kEco.szCharCode[0], ((int)kEco.kFixPos.x).ToString(), ((int)kEco.kFixPos.z).ToString());

            charKindInfoFromCode.SetPosKey(nrNpcPos.strKey);
            nrNpcPos.strName   = charKindInfoFromCode.GetName();
            nrNpcPos.nCharKind = charKindInfoFromCode.GetCharKind();
            nrNpcPos.nMapIndex = kEco.MapIndex;
            nrNpcPos.kPos.x    = kEco.kFixPos.x;
            nrNpcPos.kPos.y    = kEco.kFixPos.y;
            nrNpcPos.kPos.z    = kEco.kFixPos.z;
            this.AddNpcPos(nrNpcPos);
        }
    }
예제 #2
0
 public void RemoveNpcPos(int mapIndex, NrNpcPos kNPCPos)
 {
     if (this.m_mapNpcPos.ContainsKey(mapIndex))
     {
         Dictionary <string, NrNpcPos> dictionary = this.m_mapNpcPos[mapIndex];
         if (dictionary != null && dictionary.ContainsKey(kNPCPos.strKey))
         {
             dictionary.Remove(kNPCPos.strKey);
         }
     }
 }
예제 #3
0
 public void AddNpcPos(NrNpcPos kNPCPos)
 {
     if (NrTSingleton <ContentsLimitManager> .Instance.IsNPCLimit(kNPCPos.nCharKind))
     {
         return;
     }
     if (!this.m_mapNpcPos.ContainsKey(kNPCPos.nMapIndex))
     {
         Dictionary <string, NrNpcPos> dictionary = new Dictionary <string, NrNpcPos>();
         dictionary.Add(kNPCPos.strKey, kNPCPos);
         this.m_mapNpcPos.Add(kNPCPos.nMapIndex, dictionary);
     }
     else
     {
         Dictionary <string, NrNpcPos> dictionary2 = this.m_mapNpcPos[kNPCPos.nMapIndex];
         if (dictionary2 != null && !dictionary2.ContainsKey(kNPCPos.strKey))
         {
             dictionary2.Add(kNPCPos.strKey, kNPCPos);
         }
     }
 }
예제 #4
0
    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;
            }
        }
    }