Esempio n. 1
0
 public void MoveToFollowChar()
 {
     if (this.m_pkChar.GetID() == 1)
     {
         NrCharUser nrCharUser = (NrCharUser)this.m_pkChar;
         if (nrCharUser.GetFollowCharPersonID() > 0L)
         {
             NrCharBase followChar = this.GetFollowChar(nrCharUser.GetFollowCharPersonID());
             if (followChar != null && followChar.GetCharObject() != null)
             {
                 float num  = 5f;
                 float num2 = Vector3.Distance(this.m_vCharPos, followChar.GetCharObject().transform.position);
                 if (num2 > num)
                 {
                     int nMapIndex = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_kCharMapInfo.m_nMapIndex;
                     this.m_vFollowCharLastPos = new Vector3(followChar.GetCharObject().transform.position.x, followChar.GetCharObject().transform.position.y, followChar.GetCharObject().transform.position.z);
                     float   d   = num + 1f;
                     Vector3 lhs = followChar.GetCharObject().transform.position + d * -followChar.GetCharObject().transform.forward;
                     if (lhs != Vector3.zero)
                     {
                         this.m_pkChar.m_kCharMove.AutoMoveTo(nMapIndex, (short)lhs.x, (short)lhs.z, true);
                         NrTSingleton <NkQuestManager> .Instance.SetAutoPathInfo(null);
                     }
                     return;
                 }
                 float num3 = this.CheckDistance(this.m_vLastCharPos, this.m_vCharPos);
                 float num4 = 1f;
                 if (num3 >= num4)
                 {
                     this.SendCharMovePacketForKeyBoardMove(true);
                 }
             }
             else
             {
                 nrCharUser.RefreshFollowCharPos();
             }
         }
     }
 }
Esempio n. 2
0
 public bool SceneChange()
 {
     try
     {
         if (!this.ReadyCharInfo())
         {
             this.m_Debugstring.Add("AUTO MOVE MAP PATH CNT: ReadyCharInfo() == false)");
             bool result = false;
             return(result);
         }
         if (this.m_MainUser.IsCharKindATB(1L) && Scene.PreScene != Scene.Type.BATTLE)
         {
             NrCharUser nrCharUser = (NrCharUser)this.m_MainUser;
             if (nrCharUser.GetFollowCharPersonID() > 0L)
             {
                 nrCharUser.RefreshFollowCharPos();
                 bool result = true;
                 return(result);
             }
         }
         if (this.m_MapPath == null)
         {
             this.m_Debugstring.Add("m_MapPath is null");
             bool result = true;
             return(result);
         }
         if (this.m_bAutoMove && this.m_MapPath.Count > 0 && !this.m_MainUser.m_kCharMove.AutoMoveTo(this.m_iDestMapIdx, (short)this.m_v3Dest.x, (short)this.m_v3Dest.z))
         {
             this.ResetData();
         }
     }
     catch (Exception ex)
     {
         this.m_Debugstring.Add("AutoPath " + ex.Message);
     }
     this.ClearUserData();
     return(true);
 }