void AccessMission(int nMissionID, int nNpcID, bool bCheck = true, byte[] adrmData = null)
    {
        PeEntity npc = EntityMgr.Instance.Get(nNpcID);

        if (IsOwner)
        {
            MissionManager.Instance.ProcessSingleMode(nMissionID, npc, MissionManager.TakeMissionType.TakeMissionType_Get, bCheck);
        }
        else
        {
            if (PeGameMgr.IsMultiStory)
            {
                RMRepository.Import(adrmData);
            }
            else
            {
                AdRMRepository.Import(adrmData);
            }

            AiAdNpcNetwork adNpc = AiAdNpcNetwork.Get <AiAdNpcNetwork>(nNpcID);
            MissionManager.Instance.ProcessSingleMode(nMissionID, npc, MissionManager.TakeMissionType.TakeMissionType_Get, bCheck, adNpc);
        }

        if (null != npc)
        {
            npc.SetAttribute(AttribType.DefaultPlayerID, Id, false);
        }
    }
    //同步任务
    void RPC_S2C_SyncMissions(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        byte[] pmData     = stream.Read <byte[]> ();
        byte[] adrmData   = stream.Read <byte[]> ();
        byte[] tmData     = stream.Read <byte[]>();
        byte[] tmadrmData = stream.Read <byte[]>();

        if (PeGameMgr.IsMultiStory)
        {
            if (adrmData != null)
            {
                RMRepository.Import(adrmData);
            }
            if (tmadrmData != null)
            {
                RMRepository.Import(tmadrmData);
            }
        }
        else
        {
            if (adrmData != null)
            {
                AdRMRepository.Import(adrmData);
            }
            if (tmadrmData != null)
            {
                AdRMRepository.Import(tmadrmData);
            }
        }
        StartCoroutine(WaitForMissionModule(pmData, tmData));
    }
Exemplo n.º 3
0
 protected override void SetData(byte[] data)
 {
     if (null != data)
     {
         AdRMRepository.Import(data);
     }
 }
    void CreateMission(int nMissionID, int idx, int rewardIdx)
    {
        MissionCommonData data = MissionManager.GetMissionCommonData(nMissionID);

        if (data == null)
        {
            return;
        }
        if (PeGameMgr.IsMultiStory)
        {
            RMRepository.CreateRandomMission(nMissionID, idx, rewardIdx);
        }
        else
        {
            AdRMRepository.CreateRandomMission(nMissionID, idx, rewardIdx);
        }
    }
Exemplo n.º 5
0
    public void NpcMouseEventHandler(object sender, MousePickable.RMouseClickEvent e)
    {
        Pathea.PeEntity npc = e.mousePickable.GetComponent <Pathea.PeEntity>();

        if (npc == null)
        {
            return;
        }

        float dist = Vector3.Distance(npc.position, GetPlayerPos());

        if (dist > 7)
        {
            return;
        }

        if (IsRandomNpc(npc) && npc.IsDead())
        {
            if (npc.Id == 9203 || npc.Id == 9204)
            {
                return;
            }

            if (npc.Id == 9214 || npc.Id == 9215)
            {
                if (!MissionManager.Instance.HasMission(MissionManager.m_SpecialMissionID10))
                {
                    return;
                }
            }

            if (GameConfig.IsMultiMode)
            {
                //if (null != PlayerFactory.mMainPlayer)
                //    PlayerFactory.mMainPlayer.RequestDeadObjItem(npc.OwnerView);
            }
            else
            {
                //if (GameUI.Instance.mItemGetGui.UpdateItem(npc))
                //{
                //    GameUI.Instance.mItemGetGui.Show();
                //}
            }

            if (npc.IsRecruited())
            {
                GameUI.Instance.mRevive.ShowServantRevive(npc);
            }

            return;
        }


        if (IsRandomNpc(npc) && npc.IsFollower())
        {
            return;
        }

        if (!npc.GetTalkEnable())
        {
            return;
        }

        if (IsRandomNpc(npc) && !npc.IsDead())
        {
            NpcMissionData missionData = npc.GetUserData() as NpcMissionData;
            if (null != missionData)
            {
                if (!MissionManager.Instance.HasMission(missionData.m_RandomMission))
                {
                    if (PeGameMgr.IsStory)
                    {
                        RMRepository.CreateRandomMission(missionData.m_RandomMission);
                    }
                    else if (PeGameMgr.IsMultiAdventure || PeGameMgr.IsMultiBuild)
                    {
                        PlayerNetwork.mainPlayer.RPCServer(EPacketType.PT_InGame_NewMission, missionData.m_RandomMission, npc.Id);
                    }
                    else
                    {
                        AdRMRepository.CreateRandomMission(missionData.m_RandomMission);
                    }
                }
            }
        }

        GameUI.Instance.mNpcWnd.SetCurSelNpc(npc);
        GameUI.Instance.mNpcWnd.Show();
    }
Exemplo n.º 6
0
 protected override void WriteData(BinaryWriter bw)
 {
     AdRMRepository.Export(bw);
 }
Exemplo n.º 7
0
    public static void LoadAllData()
    {
        if (s_localDatabase != null)
        {
            return;
        }

#if UNITY_EDITOR
        System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
        sw.Start();
#endif
        s_localDatabase = LoadDb();
        SkillSystem.SkData.LoadData();
        Pathea.Effect.EffectData.LoadData();
        Pathea.Projectile.ProjectileData.LoadData();
        Pathea.RequestRelation.LoadData();
        Pathea.CampData.LoadData();
        Pathea.ThreatData.LoadData();
        Pathea.DamageData.LoadData();
        HumanSoundData.LoadData();
        ItemDropData.LoadData();

        PELocalization.LoadData();

        NaturalResAsset.NaturalRes.LoadData();
        //SkillAsset.EffCastData.LoadData();
        //SkillAsset.EffSkill.LoadData();
        //SkillAsset.MergeSkill.LoadData();
        //AnimData.LoadData();
        //AnimSoundData.LoadData();

        AiAsset.AiData.LoadData();

        SoundAsset.SESoundBuff.LoadData();
        SoundAsset.SESoundStory.LoadData();
        //CharacterData.LoadCharacterData();
        StoryDoodadMap.LoadData();
        StoreRepository.LoadData();
        NpcMissionDataRepository.LoadData();
        //PlayerAttribute.LoadData();
        MissionRepository.LoadData();
        TalkRespository.LoadData();
        //NpcRandomRepository.LoadData();
        ShopRespository.LoadData();
        WareHouseManager.LoadData();
        //HeroTalkRepository.LoadData();
        MutiPlayRandRespository.LoadData();
        PromptRepository.LoadData();

        //MapIconData.LoadDate();
        //MapMaskData.LoadDate();
        CampPatrolData.LoadDate();
        Camp.LoadData();
        RepProcessor.LoadData();

        CloudManager.LoadData();
        //BattleUnitData.LoadData();
        TutorialData.LoadData();
        //RepairMachineManager.LoadData();
        MapMaskData.LoadDate();
        MessageData.LoadData();         //lz-2016.07.13 Add it
        MonsterHandbookData.LoadData(); //lz-2016.07.20 Add it
        StoryRepository.LoadData();
        RMRepository.LoadRandMission();
        MisInitRepository.LoadData();
        CameraRepository.LoadCameraPlot();
        AdRMRepository.LoadData();
        VCConfig.InitConfig();
        Cutscene.LoadData();

//		BuildBrushData.LoadBrush();
        BSPattern.LoadBrush();
        BSVoxelMatMap.Load();
        BSBlockMatMap.Load();
        BlockBuilding.LoadBuilding();
        LifeFormRule.LoadData();
        PlantInfo.LoadData();
        MetalScanData.LoadData();
        BattleConstData.LoadData();
        CustomCharactor.CustomMetaData.LoadData();
        SkillTreeInfo.LoadData();
        VArtifactUtil.LoadData();
        Pathea.ActionRelationData.LoadActionRelation();

        //colony
        CSInfoMgr.LoadData();
        ProcessingObjInfo.LoadData();
        CSTradeInfoData.LoadData();
        CampTradeIdData.LoadData();
        AbnormalTypeTreatData.LoadData();
        CSMedicineSupport.LoadData();
        //RandomItemMgr
        RandomItemDataMgr.LoadData();
        FecesData.LoadData();
        //randomdungeon
        RandomDungeonDataBase.LoadData();
        AbnormalData.LoadData();
        PEAbnormalNoticeData.LoadData();

        RelationInfo.LoadData();
        EquipSetData.LoadData();
        SuitSetData.LoadData();

        CheatData.LoadData();

        Pathea.NpcProtoDb.Load();
        Pathea.MonsterProtoDb.Load();
        Pathea.MonsterRandomDb.Load();
        Pathea.MonsterGroupProtoDb.Load();
        Pathea.RandomNpcDb.Load();
        Pathea.PlayerProtoDb.Load();
        Pathea.TowerProtoDb.Load();
        Pathea.DoodadProtoDb.Load();
        Pathea.AttPlusNPCData.Load();
        Pathea.AttPlusBuffDb.Load();
        Pathea.NpcTypeDb.Load();
        Pathea.NpcRandomTalkDb.Load();
        Pathea.NpcThinkDb.LoadData();
        Pathea.NpcEatDb.LoadData();
        Pathea.NpcRobotDb.Load();
        Pathea.NPCScheduleData.Load();
        Pathea.NpcVoiceDb.LoadData();
        InGameAidData.LoadData(); //lz-2016.08.21 add it
        MountsSkillDb.LoadData();

#if UNITY_EDITOR
        sw.Stop();
        Debug.Log("Database Loaded : " + sw.ElapsedMilliseconds);
        sw.Reset();
#else
        Debug.Log("Database Loaded");
#endif
    }
Exemplo n.º 8
0
    public static void CreateNpc(SceneEntityPosAgent agent)
    {
        agent.entity = null;
        if (agent.protoId < 0)
        {
            List <int> adnpcList = NpcMissionDataRepository.GetAdRandListByWild(1);
            int        idx       = UnityEngine.Random.Range(0, adnpcList.Count);
            agent.protoId = adnpcList[idx];
        }

        AdNpcData data = NpcMissionDataRepository.GetAdNpcData(agent.protoId);

        if (data == null)
        {
            return;
        }

        if (NetworkInterface.IsClient && !PeGameMgr.IsMultiStory)
        {
            if (agent.protoId > 100)
            {
                NetworkManager.WaitCoroutine(PlayerNetwork.RequestCreateAdNpc(agent.protoId, agent.Pos));
            }
            else
            {
                NetworkManager.WaitCoroutine(PlayerNetwork.RequestCreateAdMainNpc(agent.protoId, agent.Pos));
            }
            return;
        }
        int id = WorldInfoMgr.Instance.FetchRecordAutoId();

//		agent.entity = PeCreature.Instance.CreateRandomNpc(data.mRnpc_ID, data.mID, agent.Pos, agent.Rot, agent.Scl);
        agent.entity = PeCreature.Instance.CreateRandomNpc(data.mRnpc_ID, id, agent.Pos, agent.Rot, agent.Scl);
        if (null == agent.entity)
        {
            Debug.LogError("[SceneEntityCreator]Failed to create npc:" + agent.protoId);
            return;
        }
        if (MissionManager.Instance && agent.protoId < 100 && !MissionManager.Instance.m_PlayerMission.adId_entityId.ContainsKey(agent.protoId))
        {
            MissionManager.Instance.m_PlayerMission.adId_entityId[agent.protoId] = agent.entity.Id;
        }

        agent.entity.SetBirthPos(agent.Pos);//delete npc need

        NpcMissionData useData = new NpcMissionData();

        useData.m_bRandomNpc = true;
        useData.m_Rnpc_ID    = data.mRnpc_ID;
        useData.m_QCID       = data.mQC_ID;
        int misid = AdRMRepository.GetRandomMission(useData.m_QCID, useData.m_CurMissionGroup);

        if (misid != 0)
        {
            useData.m_RandomMission = misid;
        }
        for (int i = 0; i < data.m_CSRecruitMissionList.Count; i++)
        {
            useData.m_CSRecruitMissionList.Add(data.m_CSRecruitMissionList[i]);
        }
        NpcMissionDataRepository.AddMissionData(agent.entity.Id, useData);
        agent.entity.SetUserData(useData);
        return;
    }