public void ProcessByTargetChar() { 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 && Vector3.Distance(this.m_vFollowCharLastPos, followChar.GetCharObject().transform.position) > 60f) { 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 = 6f; 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; } } } if (this.CheckTargetPositionChanged()) { Vector3 charPos = this.m_pkTargetChar.GetPersonInfo().GetCharPos(); this.MoveTo(charPos.x, charPos.y, charPos.z); } }
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); }
public void SetActor(NrCharBase kCharBase, string ActorName, bool RealActor, bool bShow) { this.m_ActorBase = kCharBase; if (this.m_ActorBase.Get3DChar() != null) { this.m_ActorBase.Get3DChar().SetMiniDramaChar(); } this.m_ActorBase.GetCharAnimation().ClearNextAni(); this.m_ActorName = ActorName; this.m_RealActor = RealActor; this.m_ActorShow = bShow; if (!this.m_RealActor && !this.m_ActorName.Equals(EventTriggerMiniDrama.ActorManager.GeneralName)) { this._PrePosition = kCharBase.GetCharObject().transform.localPosition; this._PreRotate = kCharBase.GetCharObject().transform.localRotation; } }
public GameObject GetGameObject() { NrCharBase charBase = this.GetCharBase(); if (charBase != null) { return(charBase.GetCharObject()); } return(null); }
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(); } } } }
public void Del() { if (this._Talk != null) { this._Talk.Close(); this._Talk = null; } if (this._Emoticon != null) { this._Emoticon.Close(); this._Emoticon = null; } this._ActorAction.Clear(); this._Actor.Dispose(); if (this._Actor.m_RealActor) { if (this._Actor.m_ActorBase != null) { this._Actor.m_ActorBase.SetShowHide3DModel(false, false, false); } NrTSingleton <NkCharManager> .Instance.DeleteChar(this._IDInfo.m_nClientID); } else { NrCharBase charBase = this.GetCharBase(); if (charBase != null) { GameObject charObject = charBase.GetCharObject(); if (MiniDramaActorController.EnableTypeList != null && MiniDramaActorController.EnableTypeList.Length > 0) { Type[] enableTypeList = MiniDramaActorController.EnableTypeList; for (int i = 0; i < enableTypeList.Length; i++) { Type type = enableTypeList[i]; MonoBehaviour monoBehaviour = charObject.GetComponent(type) as MonoBehaviour; if (monoBehaviour != null) { monoBehaviour.enabled = true; } } } this.Show(true); } UnityEngine.Object.Destroy(base.gameObject); } }
public LinkedList <GxRpAsNode> FindRPPath(NrCharBase kChar, short SrcX, short SrcY, short DestX, short DestY) { LinkedList <GxRpAsNode> result = new LinkedList <GxRpAsNode>(); if (!this.ReadyCharInfo()) { return(result); } short nerestRP = this.m_cGxRoadPointMgr.GetNerestRP(0, SrcX, SrcY, false, false); short nerestRP2 = this.m_cGxRoadPointMgr.GetNerestRP(0, DestX, DestY, false, false); this.m_cGxRoadPointAstar.GeneratePath(0, nerestRP, nerestRP2, ref result); Vector3 vDest = new Vector3((float)DestX, 0f, (float)DestY); NrCharBase mainUser = this.m_MainUser; GameObject pkUserObj = this.m_pkUserObj; this.m_pkUserObj = kChar.GetCharObject(); this.m_MainUser = kChar; this.DirectionCheck(vDest, ref result); this.m_MainUser = mainUser; this.m_pkUserObj = pkUserObj; return(result); }
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(); }