Ejemplo n.º 1
0
 public void AnalyseHeroTalent(ref ActorPreloadTab loadInfo, ResTalentHero talentCfg)
 {
     for (int i = 0; i < talentCfg.astTalentList.Length; i++)
     {
         RESDT_TALENT_DETAIL resdt_talent_detail = talentCfg.astTalentList[i];
         ResTalentLib        dataByKey           = GameDataMgr.talentLib.GetDataByKey(resdt_talent_detail.dwLvl1ID);
         if (dataByKey != null)
         {
             this.AnalyseSkill(ref loadInfo, (int)dataByKey.dwSkillID);
             this.AnalysePassiveSkill(ref loadInfo, (int)dataByKey.dwPassiveSkillID);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID1);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID2);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID3);
         }
         dataByKey = GameDataMgr.talentLib.GetDataByKey(resdt_talent_detail.dwLvl2ID);
         if (dataByKey != null)
         {
             this.AnalyseSkill(ref loadInfo, (int)dataByKey.dwSkillID);
             this.AnalysePassiveSkill(ref loadInfo, (int)dataByKey.dwPassiveSkillID);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID1);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID2);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID3);
         }
         dataByKey = GameDataMgr.talentLib.GetDataByKey(resdt_talent_detail.dwLvl3ID);
         if (dataByKey != null)
         {
             this.AnalyseSkill(ref loadInfo, (int)dataByKey.dwSkillID);
             this.AnalysePassiveSkill(ref loadInfo, (int)dataByKey.dwPassiveSkillID);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID1);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID2);
             this.AnalyseSkillCombine(ref loadInfo, (int)dataByKey.dwEffectID3);
         }
     }
 }
Ejemplo n.º 2
0
        public static bool IsHaveTalentBuyFunc(uint heroID)
        {
            bool          flag      = false;
            ResTalentHero dataByKey = GameDataMgr.talentHero.GetDataByKey(heroID);

            if (((dataByKey != null) && (dataByKey.astTalentList.Length > 0)) && (dataByKey.astTalentList[0].dwLvl3ID != 0))
            {
                flag = true;
            }
            return(flag);
        }
Ejemplo n.º 3
0
        public static bool IsTalentBelongHero(uint uiTalentId, uint uiHeroId)
        {
            ResTalentHero dataByKey = GameDataMgr.talentHero.GetDataByKey(uiHeroId);

            if (dataByKey == null)
            {
                return(false);
            }
            for (int i = 0; i < dataByKey.astTalentList.Length; i++)
            {
                if (((dataByKey.astTalentList[i].dwLvl1ID == uiTalentId) || (dataByKey.astTalentList[i].dwLvl2ID == uiTalentId)) || (dataByKey.astTalentList[i].dwLvl3ID == uiTalentId))
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 4
0
 public void AutoLearnTalent(PoolObjHandle <ActorRoot> hero, int level)
 {
     if (hero.handle.ActorAgent.IsAutoAI())
     {
         int          bID  = 0;
         bool         flag = false;
         int          num2 = 0;
         ResTalentLib lib  = null;
         for (int i = 0; i < this.m_talentRuleList.Count; i++)
         {
             if (this.m_talentRuleList[i].bSoulRequestValue == level)
             {
                 bID  = this.m_talentRuleList[i].bID;
                 flag = true;
                 break;
             }
         }
         if (flag)
         {
             ResTalentHero dataByKey = GameDataMgr.talentHero.GetDataByKey((uint)hero.handle.TheActorMeta.ConfigId);
             if (dataByKey != null)
             {
                 num2 = FrameRandom.Random(2);
                 if (bID == 2)
                 {
                     lib = GameDataMgr.talentLib.GetDataByKey(dataByKey.astTalentList[bID - 1].dwLvl1ID);
                 }
                 else if ((bID >= 1) && (bID <= dataByKey.astTalentList.Length))
                 {
                     if (num2 == 0)
                     {
                         lib = GameDataMgr.talentLib.GetDataByKey(dataByKey.astTalentList[bID - 1].dwLvl1ID);
                     }
                     else
                     {
                         lib = GameDataMgr.talentLib.GetDataByKey(dataByKey.astTalentList[bID - 1].dwLvl2ID);
                     }
                 }
                 if (lib != null)
                 {
                     this.DirectLearnTalentCommand(hero, lib.dwID, (sbyte)(bID - 1));
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
        public static HeroTalentViewInfo GetHeroTalentViewInfo(uint heroCfgID)
        {
            HeroTalentViewInfo info = new HeroTalentViewInfo {
                m_talentLevel     = 0,
                m_learnTalentList = new uint[5]
            };
            ResTalentHero dataByKey = GameDataMgr.talentHero.GetDataByKey(heroCfgID);

            if (dataByKey != null)
            {
                info.m_heroTalentLevelInfoList = new ListView <HeroTalentLevelInfo>();
                for (int i = 0; i < dataByKey.astTalentList.Length; i++)
                {
                    HeroTalentLevelInfo info2 = new HeroTalentLevelInfo();
                    InitHeroTalentLevelInfo(info2, dataByKey.astTalentList[i].dwLvl1ID, dataByKey.astTalentList[i].dwLvl2ID, dataByKey.astTalentList[i].dwLvl3ID, dataByKey.astTalentList[i]);
                    info.m_heroTalentLevelInfoList.Add(info2);
                }
            }
            return(info);
        }
Ejemplo n.º 6
0
    public void AddPreloadActor(ref List <ActorPreloadTab> list, ref ActorMeta actorMeta, float spawnCnt, int ownerSkinID = 0)
    {
        for (int i = 0; i < list.Count; i++)
        {
            ActorPreloadTab tab = list[i];
            if (tab.theActor.ConfigId != actorMeta.ConfigId)
            {
                continue;
            }
            if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                if (this.GetActorMarkID(actorMeta) == tab.MarkID)
                {
                    goto Label_0085;
                }
                continue;
            }
            if ((actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) && (spawnCnt > 0f))
            {
                tab.spawnCnt += spawnCnt;
                list[i]       = tab;
            }
Label_0085:
            retCnt++;
            return;
        }
        ActorStaticData        actorData         = new ActorStaticData();
        IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

        actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData);
        ActorServerData data2 = new ActorServerData();

        Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider).GetActorServerData(ref actorMeta, ref data2);

        CActorInfo actorInfo = CActorInfo.GetActorInfo(actorData.TheResInfo.ResPath, enResourceType.BattleScene);

        if (actorInfo != null)
        {
            ActorPreloadTab loadInfo = new ActorPreloadTab {
                theActor = actorMeta
            };
            loadInfo.modelPrefab.assetPath    = actorInfo.GetArtPrefabName((ownerSkinID == 0) ? ((int)data2.SkinId) : ownerSkinID, -1);
            loadInfo.modelPrefab.nInstantiate = 1;
            loadInfo.spawnCnt      = spawnCnt;
            loadInfo.MarkID        = this.GetActorMarkID(actorMeta);
            loadInfo.ageActions    = new List <AssetLoadBase>();
            loadInfo.parPrefabs    = new List <AssetLoadBase>();
            loadInfo.mesPrefabs    = new List <AssetLoadBase>();
            loadInfo.spritePrefabs = new List <AssetLoadBase>();
            loadInfo.soundBanks    = new List <AssetLoadBase>();
            loadInfo.behaviorXml   = new List <AssetLoadBase>();
            ActorStaticSkillData skillData = new ActorStaticSkillData();
            for (int j = 0; j < 7; j++)
            {
                actorDataProvider.GetActorStaticSkillData(ref actorMeta, (ActorSkillSlot)j, ref skillData);
                if (skillData.SkillId != 0)
                {
                    this.AnalyseSkill(ref loadInfo, skillData.SkillId);
                    this.AnalysePassiveSkill(ref loadInfo, skillData.PassiveSkillId);
                }
            }
            if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                ResTalentHero dataByKey = GameDataMgr.talentHero.GetDataByKey((uint)actorMeta.ConfigId);
                if (dataByKey != null)
                {
                    this.AnalyseHeroTalent(ref loadInfo, dataByKey);
                }
            }
            else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
            {
                ActorStaticData data4 = new ActorStaticData();
                Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider).GetActorStaticData(ref actorMeta, ref data4);

                int randomPassiveSkillRule = data4.TheBaseAttribute.RandomPassiveSkillRule;
                if ((randomPassiveSkillRule > 0) && !this.randomSkillCheckerSet.ContainsKey(randomPassiveSkillRule))
                {
                    this.randomSkillCheckerSet.Add(randomPassiveSkillRule, true);
                    ResRandomSkillPassiveRule rule = GameDataMgr.randomSkillPassiveDatabin.GetDataByKey(randomPassiveSkillRule);
                    if ((rule.astRandomSkillPassiveID1 != null) && (rule.astRandomSkillPassiveID1.Length > 0))
                    {
                        for (int k = 0; k < rule.astRandomSkillPassiveID1.Length; k++)
                        {
                            this.AnalysePassiveSkill(ref loadInfo, rule.astRandomSkillPassiveID1[k].iParam);
                        }
                    }
                    if ((rule.astRandomSkillPassiveID2 != null) && (rule.astRandomSkillPassiveID2.Length > 0))
                    {
                        for (int m = 0; m < rule.astRandomSkillPassiveID2.Length; m++)
                        {
                            this.AnalysePassiveSkill(ref loadInfo, rule.astRandomSkillPassiveID2[m].iParam);
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(actorInfo.deadAgePath))
            {
                AssetLoadBase item = new AssetLoadBase {
                    assetPath = actorInfo.deadAgePath
                };
                loadInfo.ageActions.Add(item);
            }
            if (!string.IsNullOrEmpty(actorInfo.BtResourcePath) && !this.behaviorXmlSet.ContainsKey(actorInfo.BtResourcePath))
            {
                AssetLoadBase base3 = new AssetLoadBase {
                    assetPath = actorInfo.BtResourcePath
                };
                loadInfo.behaviorXml.Add(base3);
                this.behaviorXmlSet.Add(actorInfo.BtResourcePath, true);
            }
            loadInfo.soundBanks = new List <AssetLoadBase>();
            this.AnalyseSoundBanks(ref loadInfo, ref actorInfo, ref data2);
            list.Add(loadInfo);
            if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                this.CheckCallMonsterSkill(actorInfo, ref list, ref actorMeta, (int)data2.SkinId);
            }
        }
    }