Esempio n. 1
0
 public void Init(ulong playerId, COMDT_HEROINFO svrInfo)
 {
     this.cfgInfo = GameDataMgr.heroDatabin.GetDataByKey(svrInfo.stCommonInfo.dwHeroID);
     GameDataMgr.heroShopInfoDict.TryGetValue(svrInfo.stCommonInfo.dwHeroID, out this.shopCfgInfo);
     this.m_selectPageIndex = svrInfo.stCommonInfo.bSymbolPageWear;
     if (this.mActorValue == null)
     {
         this.mActorValue = new PropertyHelper();
     }
     this.mActorValue.Init(svrInfo);
     if (this.skillInfo == null)
     {
         this.skillInfo = new CSkillData();
     }
     this.skillInfo.InitSkillData(this.cfgInfo, svrInfo.stCommonInfo.stSkill);
     this.m_Proficiency   = svrInfo.stCommonInfo.stProficiency.dwProficiency;
     this.m_ProficiencyLV = svrInfo.stCommonInfo.stProficiency.bLv;
     this.MaskBits        = svrInfo.stCommonInfo.dwMaskBits;
     this.m_skinInfo.Init(svrInfo.stCommonInfo.wSkinID);
     this.m_talentBuyList = new byte[svrInfo.stCommonInfo.stTalent.astTalentInfo.Length];
     for (int i = 0; i < svrInfo.stCommonInfo.stTalent.astTalentInfo.Length; i++)
     {
         this.m_talentBuyList[i] = svrInfo.stCommonInfo.stTalent.astTalentInfo[i].bIsBuyed;
     }
     this.m_awakeState         = svrInfo.stCommonInfo.stTalent.bWakeState;
     this.m_awakeStepID        = svrInfo.stCommonInfo.stTalent.stWakeStep.dwStepID;
     this.m_isStepFinish       = svrInfo.stCommonInfo.stTalent.stWakeStep.bIsFinish == 1;
     this.m_experienceDeadLine = !this.IsExperienceHero() ? 0 : svrInfo.stCommonInfo.dwDeadLine;
     this.m_masterHeroFightCnt = svrInfo.stCommonInfo.dwMasterTotalFightCnt;
     this.m_masterHeroWinCnt   = svrInfo.stCommonInfo.dwMasterTotalWinCnt;
 }
Esempio n. 2
0
        public void Init(COMDT_HEROINFO svrInfo)
        {
            ActorMeta theActorMeta = new ActorMeta {
                ConfigId = (int)svrInfo.stCommonInfo.dwHeroID
            };

            this.InitValueDataArr(ref theActorMeta, true);
            this.actorLvl        = svrInfo.stCommonInfo.wLevel;
            this.actorExp        = (int)svrInfo.stCommonInfo.dwExp;
            this.actorStar       = svrInfo.stCommonInfo.wStar;
            this.actorQuality    = svrInfo.stCommonInfo.stQuality.wQuality;
            this.actorSubQuality = svrInfo.stCommonInfo.stQuality.wSubQuality;
            this.SetSkinProp(svrInfo.stCommonInfo.dwHeroID, svrInfo.stCommonInfo.wSkinID, true);
        }
Esempio n. 3
0
        public void Init(COMDT_HEROINFO svrInfo)
        {
            ActorMeta actorMeta  = default(ActorMeta);
            ActorMeta actorMeta2 = actorMeta;

            actorMeta2.ConfigId = (int)svrInfo.stCommonInfo.dwHeroID;
            actorMeta           = actorMeta2;
            this.InitValueDataArr(ref actorMeta, true);
            this.actorLvl        = (int)svrInfo.stCommonInfo.wLevel;
            this.actorExp        = (int)svrInfo.stCommonInfo.dwExp;
            this.actorStar       = (int)svrInfo.stCommonInfo.wStar;
            this.actorQuality    = (int)svrInfo.stCommonInfo.stQuality.wQuality;
            this.actorSubQuality = (int)svrInfo.stCommonInfo.stQuality.wSubQuality;
            this.SetSkinProp(svrInfo.stCommonInfo.dwHeroID, (uint)svrInfo.stCommonInfo.wSkinID, true);
        }
Esempio n. 4
0
        private static void SelectHeroForEnemyPlayer(ref COMDT_HEROINFO heroInfo, uint playerLevel)
        {
            uint   heroID       = 0u;
            ushort wSkinID      = 0;
            uint   dwSelSkillID = 0u;

            if (playerLevel <= 6u)
            {
                int             num         = Random.Range(0, GameDataMgr.robotRookieHeroSkinDatabin.Count());
                ResFakeAcntHero dataByIndex = GameDataMgr.robotRookieHeroSkinDatabin.GetDataByIndex(num);
                if (dataByIndex == null)
                {
                    return;
                }
                heroID = dataByIndex.dwHeroID;
                while (CFakePvPHelper.EnemyChosenHeroes.FindIndex((uint x) => x == heroID) != -1)
                {
                    num         = Random.Range(0, GameDataMgr.robotRookieHeroSkinDatabin.Count());
                    dataByIndex = GameDataMgr.robotRookieHeroSkinDatabin.GetDataByIndex(num);
                    if (dataByIndex == null)
                    {
                        return;
                    }
                    heroID = dataByIndex.dwHeroID;
                }
                if (dataByIndex != null && dataByIndex.dwSkinID != 0u)
                {
                    int num2 = Random.Range(0, 10000);
                    if ((long)num2 < (long)((ulong)dataByIndex.dwSkinRate))
                    {
                        wSkinID = (ushort)dataByIndex.dwSkinID;
                    }
                }
            }
            else
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo == null)
                {
                    return;
                }
                int num3 = GameDataMgr.robotVeteranHeroSkinDatabin.Count();
                int max  = num3 + ((masterRoleInfo == null) ? 0 : masterRoleInfo.freeHeroList.get_Count());
                int num  = Random.Range(0, max);
                if (num < num3)
                {
                    ResFakeAcntHero dataByIndex = GameDataMgr.robotVeteranHeroSkinDatabin.GetDataByIndex(num);
                    if (dataByIndex == null)
                    {
                        return;
                    }
                    heroID = dataByIndex.dwHeroID;
                }
                else
                {
                    heroID = masterRoleInfo.freeHeroList.get_Item(num - num3).dwFreeHeroID;
                }
                while (CFakePvPHelper.EnemyChosenHeroes.FindIndex((uint x) => x == heroID) != -1)
                {
                    num = Random.Range(0, max);
                    if (num < num3)
                    {
                        ResFakeAcntHero dataByIndex = GameDataMgr.robotVeteranHeroSkinDatabin.GetDataByIndex(num);
                        if (dataByIndex == null)
                        {
                            return;
                        }
                        heroID = dataByIndex.dwHeroID;
                    }
                    else
                    {
                        heroID = masterRoleInfo.freeHeroList.get_Item(num - num3).dwFreeHeroID;
                    }
                }
            }
            ResFakeAcntSkill dataByKey = GameDataMgr.robotPlayerSkillDatabin.GetDataByKey(playerLevel);

            if (dataByKey != null)
            {
                int num4 = Random.Range(0, dataByKey.SkillId.Length);
                while (dataByKey.SkillId[num4] == 0u)
                {
                    num4 = Random.Range(0, dataByKey.SkillId.Length);
                }
                dwSelSkillID = dataByKey.SkillId[num4];
            }
            CFakePvPHelper.EnemyChosenHeroes.Add(heroID);
            heroInfo.stCommonInfo.dwHeroID             = heroID;
            heroInfo.stCommonInfo.stSkill.dwSelSkillID = dwSelSkillID;
            heroInfo.stCommonInfo.wSkinID = wSkinID;
        }
Esempio n. 5
0
 private static void SelectHeroForEnemyPlayer(ref COMDT_HEROINFO heroInfo, uint playerLevel)
 {