示例#1
0
            Vector3 GetPlayerSpawnPos()
            {
                IntVector2 posXZ = VArtifactUtil.GetSpawnPos();
                Vector3    pos   = new Vector3(posXZ.x, VFDataRTGen.GetPosTop(posXZ), posXZ.y);

                return(pos);
            }
示例#2
0
    public static Vector3 GetStartPos()
    {
        if (PeGameMgr.IsSingleAdventure)
        {
            return(VArtifactTownManager.Instance.playerStartPos);
        }
        IntVector2 posXZ = GetSpawnPos();
        Vector3    pos   = new Vector3(posXZ.x, VFDataRTGen.GetPosTop(posXZ), posXZ.y);

        return(pos);
    }
    Vector3 GetNpcPointInRndTer(Vector3 cpos, out bool bSuc)     // Special process to get creation pos for NPC.
    {
        Vector2 v2 = UnityEngine.Random.insideUnitCircle.normalized;

        v2 = v2 * UnityEngine.Random.Range(-SceneEntityPosRect.EntityCreationRadius, SceneEntityPosRect.EntityCreationRadius);
        IntVector2 iv = new IntVector2((int)(cpos.x + v2.x), (int)(cpos.z + v2.y));
        float      fy = VFDataRTGen.GetPosTop(iv, out bSuc);

        if (!bSuc)
        {
            return(Vector3.zero);
        }
        return(new Vector3(iv.x, fy + 1, iv.y));
    }
    void RPC_S2C_CreateFollowPos(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        float x, y;
        int   targetid, missionId;

        stream.TryRead <float> (out x);
        stream.TryRead <float> (out y);
        stream.TryRead <int> (out targetid);
        stream.TryRead <int>(out missionId);

        Vector3 pos = new Vector3(x, VFDataRTGen.GetPosTop(new IntVector2((int)x, (int)y)), y);

        if (null != PlayerNetwork.mainPlayer)
        {
            PlayerNetwork.mainPlayer.RPCServer(EPacketType.PT_InGame_MissionFollowPos, pos, targetid);
        }

        TypeFollowData data = MissionManager.GetTypeFollowData(targetid);

        if (data == null)
        {
            return;
        }

        data.m_DistPos    = pos;
        data.m_DistRadius = data.m_AdDistPos.radius2;
        if (data.m_AdNpcRadius.num > 0)
        {
            data.m_LookNameID = StroyManager.Instance.CreateMissionRandomNpc(data.m_DistPos, data.m_AdNpcRadius.num);
        }
        if (IsOwner)
        {
            if (data.m_AdDistPos.refertoType == ReferToType.Transcript)
            {
                RandomDungenMgr.Instance.GenTaskEntrance(new IntVector2((int)data.m_DistPos.x, (int)data.m_DistPos.z), data.m_AdDistPos.referToID);
            }

            for (int i = 0; i < data.m_CreateNpcList.Count; i++)
            {
                Vector3 createpos = StroyManager.Instance.GetPatrolPoint(data.m_DistPos, 3, 8, false);
                EntityCreateMgr.Instance.CreateRandomNpc(data.m_CreateNpcList[i], createpos);
            }
            MissionManager.Instance.m_PlayerMission.ProcessFollowMission(missionId, targetid);
        }
        UpdateMissionMapLabelPos(missionId, targetid, pos);
    }
示例#5
0
            void PeLauncher.ILaunchable.Launch()
            {
                if (null == BaseNetwork.MainPlayer)
                {
                    return;
                }

                Vector3 pos = BaseNetwork.MainPlayer._pos;

                if (BaseNetwork.MainPlayer.UseNewPos)
                {
                    IntVector2 posXZ = VArtifactUtil.GetSpawnPos();
                    pos = new Vector3(posXZ.x, VFDataRTGen.GetPosTop(posXZ), posXZ.y);
                }

                Pathea.PlayerSpawnPosProvider.Instance.SetPos(pos);
            }
示例#6
0
    void BtnClick_OnCancel()
    {
        if (currentState == ReivieState.Reivie_Servant || currentEntity == null)
        {
            Hide();
            return;
        }
        if (!PeGameMgr.IsMulti)
        {
            ReviveLabel label = new ReviveLabel();
            label.pos = currentEntity.position;
            ReviveLabel.Mgr.Instance.Add(label);

            if (RandomDungenMgrData.InDungeon)
            {
                bool reviveSuc = DoRevive(true);
                if (reviveSuc)
                {
                    currentEntity.position = RandomDungenMgrData.revivePos;
                    Hide();
                }
                return;
            }

            //lz-2016.08.03 空对象
            if (null != MissionManager.Instance)
            {
                MissionManager.Instance.RemoveFollowTowerMission();
            }
            DoRevive(true);
            Vector3 revivePos;
            if (SingleGameStory.curType == SingleGameStory.StoryScene.DienShip0)
            {
                revivePos = new Vector3(14798.09f, 20.98818f, 8246.396f);
            }
            else if (SingleGameStory.curType == SingleGameStory.StoryScene.L1Ship)
            {
                revivePos = new Vector3(9649.354f, 90.488f, 12744.77f);
            }
            else if (SingleGameStory.curType == SingleGameStory.StoryScene.PajaShip)
            {
                revivePos = new Vector3(1593.53f, 148.635f, 8022.03f);
            }
            else
            {
                revivePos = GetNearFastTrvalPos(currentEntity.position);
            }
            Pathea.FastTravelMgr.Instance.TravelTo(revivePos);
        }
        else
        {
            Vector3 warpPos = Vector3.zero;
            if (RandomDungenMgrData.InDungeon)
            {
                warpPos = RandomDungenMgrData.revivePos;
            }
            else if (PeGameMgr.IsMultiCoop)
            {
                warpPos = GetNearFastTrvalPos(currentEntity.position);
            }
            else
            {
                if (PeGameMgr.IsCustom)
                {
                    warpPos = PlayerNetwork.mainPlayer.GetCustomModePos();
                }
                else
                {
                    IntVector2 posXZ = VArtifactUtil.GetSpawnPos();
                    warpPos = new Vector3(posXZ.x, VFDataRTGen.GetPosTop(posXZ), posXZ.y);
                }
            }

            PlayerNetwork.mainPlayer.RPCServer(EPacketType.PT_InGame_PlayerReset, warpPos);
            PlayerNetwork.mainPlayer.RequestChangeScene(0);
        }

        Hide();
    }