Пример #1
0
 public void MakeChar()
 {
     if (this.m_CenterChar == null || this._MakeCharCodes == null)
     {
         UnityEngine.Object.Destroy(base.gameObject);
         return;
     }
     this.MakeComplete = false;
     base.enabled      = true;
     if (this.m_MakeNpcTable == null)
     {
         this.m_MakeNpcTable = new Dictionary <string, SubNpc>();
     }
     for (int i = 0; i < this._MakeCharCodes.Count; i++)
     {
         float y    = this.m_CenterChar.m_k3DChar.GetRootGameObject().transform.localEulerAngles.y;
         float num  = 0f;
         int   num2 = this._PositionList[i];
         if (num2 == -1)
         {
             num = y + this.degreeTemp[this._GetEmptySlot()];
         }
         else if (0 <= num2 && 5 > num2)
         {
             num = y + this.degreeTemp[num2];
         }
         float f     = num * 0.0174532924f;
         POS3D pOS3D = new POS3D();
         pOS3D.x = this.m_CenterChar.GetPersonInfo().GetCharPos().x + 15f * Mathf.Sin(f);
         pOS3D.y = 0f;
         pOS3D.z = this.m_CenterChar.GetPersonInfo().GetCharPos().z + 15f * Mathf.Cos(f);
         float f2     = (num + 180f) * 0.0174532924f;
         POS3D pOS3D2 = new POS3D();
         pOS3D2.x = 1f * Mathf.Sin(f2);
         pOS3D2.y = 0f;
         pOS3D2.z = 1f * Mathf.Cos(f2);
         NrCharBase nrCharBase = this._CreateClientNPC(this._MakeCharCodes[i], pOS3D, pOS3D2);
         if (nrCharBase != null)
         {
             SubNpc subNpc = new SubNpc();
             subNpc.i32ID         = nrCharBase.GetID();
             subNpc.CharCode      = nrCharBase.GetCharKindInfo().GetCode();
             subNpc.i16CharUnique = nrCharBase.GetCharUnique();
             if (!this.m_MakeNpcTable.ContainsKey(nrCharBase.GetCharKindInfo().GetCode()))
             {
                 this.m_MakeNpcTable.Add(nrCharBase.GetCharKindInfo().GetCode(), subNpc);
             }
         }
     }
 }
Пример #2
0
    private void ReplaceGender(ref int m_iTextCount, ref StringBuilder refReplaceText, string content)
    {
        char[] separator = new char[]
        {
            '/'
        };
        int num    = 2;
        int i      = m_iTextCount + 2;
        int length = content.Length;

        NrTSingleton <UIDataManager> .Instance.InitStringBuilder();

        while (i < length)
        {
            i++;
            num++;
            if (content[i] == this.m_szTag[0])
            {
                break;
            }
            NrTSingleton <UIDataManager> .Instance.AppendString(content[i]);
        }
        string[] array = NrTSingleton <UIDataManager> .Instance.GetString().Split(separator);

        if (2 <= array.Length)
        {
            NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

            if (@char != null)
            {
                if (@char.GetCharKindInfo().GetGender() == 1)
                {
                    refReplaceText.Append(array[0]);
                }
                else if (@char.GetCharKindInfo().GetGender() == 2)
                {
                    refReplaceText.Append(array[1]);
                }
            }
        }
        m_iTextCount += num + 2;
    }
Пример #3
0
    public void SetTalk(string text, float fShowTime)
    {
        NrCharBase nrCharBase = this._kChar;

        if (nrCharBase == null)
        {
            return;
        }
        this._Showtime = Time.time + fShowTime;
        string szColorNum = "1101";

        if (nrCharBase.GetCharKindInfo() != null)
        {
            int cHARKIND = nrCharBase.GetCharKindInfo().GetCHARKIND_INFO().CHARKIND;
            this.dtFace1.SetTexture(eCharImageType.SMALL, cHARKIND, -1, string.Empty);
        }
        string strText = NrTSingleton <CTextParser> .Instance.GetTextColor(szColorNum) + text;

        this.SetTalkControl(strText, this.flbTalk1);
        this.m_ShowUI = true;
    }
Пример #4
0
    public bool CheckAutoMoveKind()
    {
        QuestAutoPathInfo autoPathInfo = NrTSingleton <NkQuestManager> .Instance.GetAutoPathInfo();

        if (autoPathInfo != null)
        {
            if (!autoPathInfo.m_bComplete)
            {
                autoPathInfo.m_kQuest.AfterAutoPath();
            }
            else if (autoPathInfo.m_nCharKind > 0)
            {
                NrCharBase charByCharKind = NrTSingleton <NkCharManager> .Instance.GetCharByCharKind(autoPathInfo.m_nCharKind);

                if (charByCharKind != null)
                {
                    if (!this.m_pkChar.IsCloseToTalkNPC(ref charByCharKind, 2f))
                    {
                        return(false);
                    }
                    NrCharKindInfo charKindInfo = charByCharKind.GetCharKindInfo();
                    if (charKindInfo != null)
                    {
                        NpcTalkUI_DLG npcTalkUI_DLG = (NpcTalkUI_DLG)NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.NPCTALK_DLG);

                        if (npcTalkUI_DLG != null)
                        {
                            npcTalkUI_DLG.SetNpcID(charKindInfo.GetCharKind(), charByCharKind.GetCharUnique());
                            npcTalkUI_DLG.Show();
                        }
                        CHARKIND_NPCINFO cHARKIND_NPCINFO = charKindInfo.GetCHARKIND_NPCINFO();
                        if (cHARKIND_NPCINFO != null && !string.IsNullOrEmpty(cHARKIND_NPCINFO.SOUND_GREETING))
                        {
                            TsAudioManager.Instance.AudioContainer.RequestAudioClip("NPC", cHARKIND_NPCINFO.SOUND_GREETING, "GREETING", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
                        }
                    }
                    if (charByCharKind.GetCharObject() != null)
                    {
                        Vector3 position = charByCharKind.GetCharObject().transform.position;
                        this.m_pkChar.m_k3DChar.RequestLookAt(position.x, position.z);
                    }
                    return(true);
                }
                else
                {
                    Debug.Log("null == npc");
                }
            }
            NrTSingleton <NkQuestManager> .Instance.SetAutoPathInfo(null);
        }
        return(false);
    }
Пример #5
0
    public void SetNpc(int i32CharKind, short i16CharUnique, string strQuestUnique)
    {
        this.m_nTalkMode = 0;
        this.m_Button_Button36.Visible     = true;
        this.m_NPCTalk_Transbutton.Visible = true;
        this.m_i32CurCharKind = i32CharKind;
        this.m_i16CharUnique  = i16CharUnique;
        this.m_Quest          = NrTSingleton <NkQuestManager> .Instance.GetQuestByQuestUnique(strQuestUnique);

        if (this.m_Quest == null)
        {
            return;
        }
        this.m_bCount = 0;
        while (this.m_bCount < 3)
        {
            if ((int)this.m_Quest.GetQuestCommon().cQuestCondition[this.m_bCount].i64Param == i32CharKind)
            {
                break;
            }
            this.m_bCount++;
        }
        NrCharBase charByCharUnique = NrTSingleton <NkCharManager> .Instance.GetCharByCharUnique(i16CharUnique);

        if (charByCharUnique == null)
        {
            return;
        }
        this.m_Face.SetTexture(eCharImageType.LARGE, i32CharKind, -1, string.Empty);
        this.m_NPCTalk_npcname.Text = charByCharUnique.GetCharKindInfo().GetName();
        string textFromCharInfo = NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo(charByCharUnique.GetCharKindInfo().GetCHARKIND_NPCINFO().GetTextGreeting());

        this.m_NPCTalk_talklabel.Visible = true;
        this.m_NPCTalk_talklabel.SetFlashLabel(textFromCharInfo);
        this.SetCameraSet(this.m_i16CharUnique);
    }
Пример #6
0
    public void NpcClick(IUIObject obj)
    {
        UI_UIGuide uI_UIGuide = NrTSingleton <FormsManager> .Instance.GetForm((G_ID)this.m_nWinID) as UI_UIGuide;

        if (uI_UIGuide != null)
        {
            uI_UIGuide.CloseUI = true;
        }
        NrCharBase charByCharUnique = NrTSingleton <NkCharManager> .Instance.GetCharByCharUnique(this.m_i16CharUnique);

        if (charByCharUnique == null)
        {
            return;
        }
        NrCharKindInfo charKindInfo = charByCharUnique.GetCharKindInfo();

        if (charKindInfo == null)
        {
            return;
        }
        if (!charByCharUnique.IsCharKindATB(16L))
        {
            if (charByCharUnique.IsCharKindATB(8L))
            {
                if (NrTSingleton <NkClientLogic> .Instance.IsNPCTalkState())
                {
                    return;
                }
                if (charByCharUnique.IsCharKindATB(562949953421312L))
                {
                    GS_TREASUREBOX_CLICK_REQ gS_TREASUREBOX_CLICK_REQ = new GS_TREASUREBOX_CLICK_REQ();
                    gS_TREASUREBOX_CLICK_REQ.i32CharUnique = (int)charByCharUnique.GetCharUnique();
                    SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_TREASUREBOX_CLICK_REQ, gS_TREASUREBOX_CLICK_REQ);
                    return;
                }
                if (charByCharUnique.IsCharKindATB(1125899906842624L))
                {
                    if (!NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.IsBountyHunt())
                    {
                        return;
                    }
                    GS_BABELTOWER_GOLOBBY_REQ gS_BABELTOWER_GOLOBBY_REQ = new GS_BABELTOWER_GOLOBBY_REQ();
                    gS_BABELTOWER_GOLOBBY_REQ.mode                = 0;
                    gS_BABELTOWER_GOLOBBY_REQ.babel_floor         = 0;
                    gS_BABELTOWER_GOLOBBY_REQ.babel_subfloor      = 0;
                    gS_BABELTOWER_GOLOBBY_REQ.nPersonID           = 0L;
                    gS_BABELTOWER_GOLOBBY_REQ.i16BountyHuntUnique = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.BountyHuntUnique;
                    SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_BABELTOWER_GOLOBBY_REQ, gS_BABELTOWER_GOLOBBY_REQ);
                    return;
                }
                else
                {
                    NrTSingleton <NkQuestManager> .Instance.IncreaseQuestParamVal(30, (long)charKindInfo.GetCharKind(), 1L);

                    NrTSingleton <NkQuestManager> .Instance.IncreaseQuestParamVal(8, (long)charKindInfo.GetCharKind(), 1L);

                    NrTSingleton <NkQuestManager> .Instance.IncreaseQuestParamVal(99, (long)charKindInfo.GetCharKind(), 1L);

                    NrTSingleton <NkQuestManager> .Instance.IncreaseQuestParamVal(48, (long)charKindInfo.GetCharKind(), 1L);

                    if (charByCharUnique.GetCharUnique() >= 31300 && charByCharUnique.GetCharUnique() <= 31400)
                    {
                        string text = NrTSingleton <NkQuestManager> .Instance.IsCheckCodeANDParam(QUEST_CONST.eQUESTCODE.QUESTCODE_TAKECHAR, (long)charKindInfo.GetCharKind());

                        if (text != string.Empty)
                        {
                            TakeTalk_DLG takeTalk_DLG = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.TAKETALK_DLG) as TakeTalk_DLG;

                            if (takeTalk_DLG != null)
                            {
                                takeTalk_DLG.SetNpc(charKindInfo.GetCharKind(), charByCharUnique.GetCharUnique(), text);
                                takeTalk_DLG.Show();
                            }
                            return;
                        }
                    }
                    if (charByCharUnique.GetCharUnique() >= 31005 && charByCharUnique.GetCharUnique() <= 31200)
                    {
                        return;
                    }
                    NpcTalkUI_DLG npcTalkUI_DLG = (NpcTalkUI_DLG)NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.NPCTALK_DLG);

                    npcTalkUI_DLG.SetNpcID(charKindInfo.GetCharKind(), charByCharUnique.GetCharUnique());
                    npcTalkUI_DLG.Show();
                }
            }
            else if (charByCharUnique.IsCharKindATB(4L))
            {
                NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                if (@char == null)
                {
                    return;
                }
                @char.MoveTo(charByCharUnique.GetCharObject().transform.position);
                NrTSingleton <NkClientLogic> .Instance.SetPickChar(charByCharUnique);

                if (charKindInfo.GetCHARKIND_MONSTERINFO() != null)
                {
                    NrTSingleton <GameGuideManager> .Instance.MonsterLevel = (int)charKindInfo.GetCHARKIND_MONSTERINFO().MINLEVEL;
                }
                else
                {
                    NrTSingleton <GameGuideManager> .Instance.MonsterLevel = 0;
                }
                this.Close();
                return;
            }
            return;
        }
        if (charByCharUnique.IsCharKindATB(268435456L))
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("39"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE);
            return;
        }
        NrCharBase char2 = NrTSingleton <NkCharManager> .Instance.GetChar(1);

        if (char2 == null)
        {
            return;
        }
        char2.MoveTo(charByCharUnique.GetCharObject().transform.position);
        NrTSingleton <NkClientLogic> .Instance.SetPickChar(charByCharUnique);

        this.Close();
    }