public override void Init() { base.Init(); this.talentSystem = new TalentSystem(); this.talentSystem.Init(this.actorPtr); this.stSkillStat = new CSkillStat(); if (this.stSkillStat == null) { return; } this.stSkillStat.Initialize(this.actorPtr); this.InitRandomSkill(); this.InitPassiveSkill(); IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); IGameActorDataProvider actorDataProvider2 = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.ServerDataProvider); ActorStaticSkillData actorStaticSkillData = default(ActorStaticSkillData); this.ornamentFirstSwitchCdEftTime = Singleton <BattleLogic> .GetInstance().GetCurLvelContext().m_ornamentFirstSwitchCdEftTime; int i = 0; while (i < 8) { if (i != 6) { goto IL_EB; } SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); if (curLvelContext.IsGameTypeGuide()) { if (CBattleGuideManager.Is5v5GuideLevel(curLvelContext.m_mapID)) { goto IL_EB; } } else if (curLvelContext.IsMobaModeWithOutGuide() && curLvelContext.m_pvpPlayerNum == 10) { goto IL_EB; } IL_267: i++; continue; IL_EB: if (i == 7) { SLevelContext curLvelContext2 = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); if (!curLvelContext2.m_bEnableOrnamentSlot || curLvelContext2.m_ornamentSkillId <= 0) { goto IL_267; } } if ((i == 4 || i == 6 || i == 7) && this.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { SLevelContext curLvelContext3 = Singleton <BattleLogic> .get_instance().GetCurLvelContext(); if (curLvelContext3 != null) { int mapID = curLvelContext3.m_mapID; if (mapID > 0) { int num = curLvelContext3.m_extraSkillId; if (i == 6) { num = curLvelContext3.m_extraSkill2Id; if (num <= 0) { goto IL_267; } } else if (i == 7) { num = curLvelContext3.m_ornamentSkillId; } else { this.CreateTalent(curLvelContext3.m_extraPassiveSkillId); } this.InitSkillSlot(i, num, 0); SkillSlot skillSlot = this.SkillSlotArray[i]; if (skillSlot != null) { skillSlot.SetSkillLevel(1); } } } goto IL_267; } if (!actorDataProvider.GetActorStaticSkillData(ref this.actor.TheActorMeta, (ActorSkillSlot)i, ref actorStaticSkillData)) { goto IL_267; } this.InitSkillSlot(i, actorStaticSkillData.SkillId, actorStaticSkillData.PassiveSkillId); if (i <= 3 && i >= 1 && Singleton <BattleLogic> .GetInstance().m_LevelContext.IsSoulGrow() && this.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { goto IL_267; } SkillSlot skillSlot2 = this.SkillSlotArray[i]; if (skillSlot2 == null) { goto IL_267; } skillSlot2.SetSkillLevel(1); goto IL_267; } uint num2 = 0u; if (actorDataProvider2.GetActorServerCommonSkillData(ref this.actor.TheActorMeta, out num2)) { int num3 = 5; if (num2 != 0u) { this.InitSkillSlot(num3, (int)num2, 0); SkillSlot skillSlot3 = this.SkillSlotArray[num3]; if (skillSlot3 != null) { skillSlot3.SetSkillLevel(1); } } } if (this.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { this.SkillUseCache = new SkillCache(); } }
public void AddPreloadActor(ref List <ActorPreloadTab> list, ref ActorMeta actorMeta, float spawnCnt, int ownerSkinID = 0) { ActorStaticData inStaticData = default(ActorStaticData); IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); actorDataProvider.GetActorStaticData(ref actorMeta, ref inStaticData); ActorServerData actorServerData = default(ActorServerData); IGameActorDataProvider actorDataProvider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider); actorDataProvider2.GetActorServerData(ref actorMeta, ref actorServerData); CActorInfo actorInfo = CActorInfo.GetActorInfo(inStaticData.TheResInfo.ResPath, enResourceType.BattleScene); if (actorInfo == null) { return; } for (int i = 0; i < list.get_Count(); i++) { ActorPreloadTab actorPreloadTab = list.get_Item(i); if (actorPreloadTab.theActor.ActorType == actorMeta.ActorType && actorPreloadTab.theActor.ConfigId == actorMeta.ConfigId) { if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || actorMeta.ActorType == ActorTypeDef.Actor_Type_Call) { int actorMarkID = this.GetActorMarkID(actorMeta); if (actorMarkID != actorPreloadTab.MarkID) { goto IL_13B; } uint skillID = 0u; if (actorDataProvider2.GetActorServerCommonSkillData(ref actorMeta, out skillID)) { this.AnalyseSkill(ref actorPreloadTab, (int)skillID); } } else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && spawnCnt > 0f) { actorPreloadTab.spawnCnt += spawnCnt; list.set_Item(i, actorPreloadTab); } LoaderHelper.retCnt++; return; } IL_13B :; } ActorPreloadTab actorPreloadTab2 = new ActorPreloadTab(); actorPreloadTab2.theActor = actorMeta; actorPreloadTab2.modelPrefab.assetPath = actorInfo.GetArtPrefabName((ownerSkinID != 0) ? ownerSkinID : ((int)actorServerData.SkinId), -1); actorPreloadTab2.modelPrefab.nInstantiate = 1; actorPreloadTab2.spawnCnt = spawnCnt; actorPreloadTab2.MarkID = this.GetActorMarkID(actorMeta); actorPreloadTab2.ageActions = new List <AssetLoadBase>(); actorPreloadTab2.parPrefabs = new List <AssetLoadBase>(); actorPreloadTab2.mesPrefabs = new List <AssetLoadBase>(); if (actorServerData.SkinId != 0u) { actorInfo.PreLoadAdvanceSkin(actorPreloadTab2.mesPrefabs, actorServerData.SkinId, -1); } actorPreloadTab2.spritePrefabs = new List <AssetLoadBase>(); actorPreloadTab2.soundBanks = new List <AssetLoadBase>(); actorPreloadTab2.behaviorXml = new List <AssetLoadBase>(); ActorStaticSkillData actorStaticSkillData = default(ActorStaticSkillData); for (int j = 0; j < 8; j++) { actorDataProvider.GetActorStaticSkillData(ref actorMeta, (ActorSkillSlot)j, ref actorStaticSkillData); this.AnalyseSkill(ref actorPreloadTab2, actorStaticSkillData.SkillId); this.AnalysePassiveSkill(ref actorPreloadTab2, actorStaticSkillData.PassiveSkillId); } if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || actorMeta.ActorType == ActorTypeDef.Actor_Type_Call) { int skillID2; int skillID3; int skillID4; int passiveSkillID; this.GetMapSkills(out skillID2, out skillID3, out skillID4, out passiveSkillID); this.AnalyseSkill(ref actorPreloadTab2, skillID2); this.AnalyseSkill(ref actorPreloadTab2, skillID3); this.AnalyseSkill(ref actorPreloadTab2, skillID4); this.AnalysePassiveSkill(ref actorPreloadTab2, passiveSkillID); uint skillID5 = 0u; if (actorDataProvider2.GetActorServerCommonSkillData(ref actorMeta, out skillID5)) { this.AnalyseSkill(ref actorPreloadTab2, (int)skillID5); } this.AnalyseHeroBornAndReviveAge(ref actorPreloadTab2, actorMeta.ConfigId); ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)actorMeta.ConfigId); if (dataByKey != null) { this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey.iPassiveID1); this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey.iPassiveID2); } } else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { ActorStaticData actorStaticData = default(ActorStaticData); IGameActorDataProvider actorDataProvider3 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); actorDataProvider3.GetActorStaticData(ref actorMeta, ref actorStaticData); int randomPassiveSkillRule = actorStaticData.TheBaseAttribute.RandomPassiveSkillRule; if (randomPassiveSkillRule > 0 && !this.randomSkillCheckerSet.ContainsKey(randomPassiveSkillRule)) { this.randomSkillCheckerSet.Add(randomPassiveSkillRule, true); ResRandomSkillPassiveRule dataByKey2 = GameDataMgr.randomSkillPassiveDatabin.GetDataByKey((long)randomPassiveSkillRule); if (dataByKey2.astRandomSkillPassiveID1 != null && dataByKey2.astRandomSkillPassiveID1.Length > 0) { for (int k = 0; k < dataByKey2.astRandomSkillPassiveID1.Length; k++) { this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey2.astRandomSkillPassiveID1[k].iParam); } } if (dataByKey2.astRandomSkillPassiveID2 != null && dataByKey2.astRandomSkillPassiveID2.Length > 0) { for (int l = 0; l < dataByKey2.astRandomSkillPassiveID2.Length; l++) { this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey2.astRandomSkillPassiveID2[l].iParam); } } } ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff != null && dataCfgInfoByCurLevelDiff.iBufDropID != 0 && dataCfgInfoByCurLevelDiff.iBufDropRate > 0) { ShenFuSystem.PreLoadShenfuResource(dataCfgInfoByCurLevelDiff.iBufDropID, ref actorPreloadTab2, this); } if (actorStaticData.TheMonsterOnlyInfo.SoldierType == 8 && dataCfgInfoByCurLevelDiff != null) { ListView <Assets.Scripts.GameLogic.SoldierWave> listView = new ListView <Assets.Scripts.GameLogic.SoldierWave>(); int iKillByCamp1ChangeSoldierWave = dataCfgInfoByCurLevelDiff.iKillByCamp1ChangeSoldierWave; int iKillByCamp2ChangeSoldierWave = dataCfgInfoByCurLevelDiff.iKillByCamp2ChangeSoldierWave; listView.AddRange(SoldierRegion.GetWavesForPreLoad(iKillByCamp1ChangeSoldierWave)); listView.AddRange(SoldierRegion.GetWavesForPreLoad(iKillByCamp2ChangeSoldierWave)); for (int m = 0; m < listView.Count; m++) { Assets.Scripts.GameLogic.SoldierWave soldierWave = listView[m]; if (soldierWave != null && soldierWave.WaveInfo != null && soldierWave.WaveInfo.astNormalSoldierInfo != null && soldierWave.WaveInfo.astNormalSoldierInfo.Length > 0) { for (int n = 0; n < soldierWave.WaveInfo.astNormalSoldierInfo.Length; n++) { ResSoldierTypeInfo resSoldierTypeInfo = soldierWave.WaveInfo.astNormalSoldierInfo[n]; if (resSoldierTypeInfo.dwSoldierID == 0u) { break; } ActorMeta actorMeta2 = default(ActorMeta); ActorMeta actorMeta3 = actorMeta2; actorMeta3.ActorType = ActorTypeDef.Actor_Type_Monster; actorMeta3.ConfigId = (int)resSoldierTypeInfo.dwSoldierID; actorMeta2 = actorMeta3; this.AddPreloadActor(ref list, ref actorMeta2, resSoldierTypeInfo.dwSoldierNum * 2f, 0); } } } } } if (!string.IsNullOrEmpty(actorInfo.deadAgePath)) { actorPreloadTab2.ageActions.Add(new AssetLoadBase { assetPath = actorInfo.deadAgePath }); } if (!string.IsNullOrEmpty(actorInfo.BtResourcePath) && !this.behaviorXmlSet.ContainsKey(actorInfo.BtResourcePath)) { actorPreloadTab2.behaviorXml.Add(new AssetLoadBase { assetPath = actorInfo.BtResourcePath }); this.behaviorXmlSet.Add(actorInfo.BtResourcePath, true); } actorPreloadTab2.soundBanks = new List <AssetLoadBase>(); this.AnalyseSoundBanks(ref actorPreloadTab2, ref actorInfo, ref actorServerData); list.Add(actorPreloadTab2); if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { this.CheckCallMonsterSkill(actorInfo, ref list, ref actorMeta, (int)actorServerData.SkinId); } else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Organ) { this.CheckOrganSoldierWave(ref list, ref actorMeta, inStaticData); } }