private void AddActionsFromSoldier(DictionaryView <string, Action> actions, uint soldierID) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff((int)soldierID); if (dataCfgInfoByCurLevelDiff == null) { return; } string path = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo); CActorInfo actorInfo = CActorInfo.GetActorInfo(path, enResourceType.BattleScene); if (actorInfo == null) { return; } this.AddBehaviorTree(actorInfo); string artPrefabName = actorInfo.GetArtPrefabName(0, -1); if (!this.prefabDict.ContainsKey(artPrefabName)) { this.prefabDict.Add(artPrefabName, false); } if (dataCfgInfoByCurLevelDiff.SkillIDs != null && dataCfgInfoByCurLevelDiff.SkillIDs.Length > 0) { for (int i = 0; i < dataCfgInfoByCurLevelDiff.SkillIDs.Length; i++) { int skillID = dataCfgInfoByCurLevelDiff.SkillIDs[i]; this.AddActionsFromSkill(actions, skillID); } } }
public static bool FitWithJungleMonsterNotInBattle(ActorRoot _actor, bool bWithMonsterNotInBattle) { if (_actor.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Monster) { return(false); } if (bWithMonsterNotInBattle) { return(true); } MonsterWrapper monsterWrapper = _actor.ActorControl as MonsterWrapper; if (monsterWrapper != null) { ResMonsterCfgInfo cfgInfo = monsterWrapper.cfgInfo; if (cfgInfo != null && cfgInfo.bMonsterType == 2) { ObjBehaviMode myBehavior = monsterWrapper.myBehavior; if (myBehavior == ObjBehaviMode.State_Idle || myBehavior == ObjBehaviMode.State_Dead || myBehavior == ObjBehaviMode.State_Null) { return(false); } } } return(true); }
private string QueryEliteName(ActorRoot inActor) { string str = null; if (inActor != null) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { return(str); } str = UT.Bytes2String(dataCfgInfoByCurLevelDiff.szName); if ((inActor.SkillControl == null) || (inActor.SkillControl.talentSystem == null)) { return(str); } string str3 = string.Empty; PassiveSkill[] skillArray = inActor.SkillControl.talentSystem.QueryTalents(); if (skillArray != null) { foreach (PassiveSkill skill in skillArray) { if ((skill != null) && skill.bShowAsElite) { str3 = str3 + skill.PassiveSkillName + "之"; } } } if (!string.IsNullOrEmpty(str3)) { str = str3 + str; } } return(str); }
public int GetKillDragonNum() { int num = 0; int dragonId = Singleton <BattleLogic> .instance.DragonId; for (int i = 0; i < this.m_deadRecordList.Count; i++) { DeadRecord record = this.m_deadRecordList[i]; if (dragonId == record.cfgId) { num++; } else { DeadRecord record2 = this.m_deadRecordList[i]; if (record2.actorType == ActorTypeDef.Actor_Type_Monster) { DeadRecord record3 = this.m_deadRecordList[i]; if (record3.actorSubType == 2) { DeadRecord record4 = this.m_deadRecordList[i]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(record4.cfgId); if ((dataCfgInfoByCurLevelDiff != null) && (dataCfgInfoByCurLevelDiff.bSoldierType == 9)) { num++; } } } } } return(num); }
private void OnNextSpawnGroups(ref NextSpawnGroupsParam prm) { if (prm.OldGroup == null) { return; } for (int i = 0; i < this.node_ary.Count; i++) { DragonIcon.DragonNode dragonNode = this.node_ary[i]; if (dragonNode != null && dragonNode.spawnGroup == prm.OldGroup) { dragonNode.spawnGroup = prm.NextGroups[0]; } } ActorMeta actorMeta = prm.OldGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { return; } if (dataCfgInfoByCurLevelDiff.bSoldierType == 9) { KillDetailInfo killDetailInfo = new KillDetailInfo(); killDetailInfo.bSelfCamp = true; killDetailInfo.Type = KillDetailInfoType.Info_Type_5V5SmallDragon_Suicide; Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo); KillDetailInfo killDetailInfo2 = new KillDetailInfo(); killDetailInfo2.bSelfCamp = true; killDetailInfo2.Type = KillDetailInfoType.Info_Type_5V5SmallDragon_Enter; Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo2); } }
public void Init(GameObject mmNode_ugui, GameObject bmNode_ugui, GameObject mmNode_3dui, GameObject bmNode_3dui, bool b5V5) { this.m_b5v5 = b5V5; Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born)); Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead)); Singleton <GameEventSys> .instance.AddEventHandler <NextSpawnGroupsParam>(GameEventDef.Event_NextSpawnGroups, new RefAction <NextSpawnGroupsParam>(this.OnNextSpawnGroups)); for (int i = 0; i < mmNode_ugui.transform.childCount; i++) { mmNode_ugui.transform.GetChild(i).gameObject.CustomSetActive(false); } for (int j = 0; j < bmNode_ugui.transform.childCount; j++) { bmNode_ugui.transform.GetChild(j).gameObject.CustomSetActive(false); } for (int k = 0; k < mmNode_3dui.transform.childCount; k++) { mmNode_3dui.transform.GetChild(k).gameObject.CustomSetActive(false); } for (int l = 0; l < bmNode_3dui.transform.childCount; l++) { bmNode_3dui.transform.GetChild(l).gameObject.CustomSetActive(false); } this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_3", 7, 0)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_big", 8, 0)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_small_1", 9, 13)); this.node_ary.Add(new DragonIcon.DragonNode(mmNode_ugui, bmNode_ugui, mmNode_3dui, bmNode_3dui, "d_5_small_2", 9, 13)); ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .instance.mapLogic.GetSpawnGroups(); if (spawnGroups != null) { for (int m = 0; m < spawnGroups.Count; m++) { SpawnGroup spawnGroup = spawnGroups[m]; if (spawnGroup != null) { ActorMeta actorMeta = spawnGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff != null) { bool flag = dataCfgInfoByCurLevelDiff.bSoldierType == 8 || dataCfgInfoByCurLevelDiff.bSoldierType == 9 || dataCfgInfoByCurLevelDiff.bSoldierType == 7 || dataCfgInfoByCurLevelDiff.bSoldierType == 13; if (flag && !spawnGroup.bTriggerSpawn) { DragonIcon.DragonNode dragonNode = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType); if (dragonNode != null) { dragonNode.spawnGroup = spawnGroup; dragonNode.SetData(spawnGroup.gameObject.transform.position, (int)dataCfgInfoByCurLevelDiff.bSoldierType, 0u, this.m_b5v5, true, true, true); dragonNode.ShowDead(true); MiniMapSysUT.RefreshMapPointerBig(dragonNode.bmDragonNode_3dui); } } } } } } this.m_cdTimer = Singleton <CTimerManager> .GetInstance().AddTimer(1000, 0, new CTimer.OnTimeUpHandler(this.OnCDTimer)); }
public static bool FitWithJungleMonsterNotInBattle(ActorRoot _actor, bool bWithMonsterNotInBattle) { if (_actor.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Monster) { return(false); } if (!bWithMonsterNotInBattle) { MonsterWrapper actorControl = _actor.ActorControl as MonsterWrapper; if (actorControl != null) { ResMonsterCfgInfo cfgInfo = actorControl.cfgInfo; if ((cfgInfo != null) && (cfgInfo.bMonsterType == 2)) { switch (actorControl.myBehavior) { case ObjBehaviMode.State_Idle: case ObjBehaviMode.State_Dead: case ObjBehaviMode.State_Null: return(false); } } } } return(true); }
internal DynamicAttributeInfo ConsiderMonsterDynamicInfo(ResMonsterCfgInfo monsterCfg) { int dwAIPlayerLevel = 0; if (monsterCfg.iDynamicInfoType == 1) { SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); if ((curLvelContext != null) && !curLvelContext.IsMobaMode()) { ResLevelCfgInfo info2 = GameDataMgr.levelDatabin.GetDataByKey((long)curLvelContext.m_mapID); if (info2 == null) { base.ErrorMissingLevelConfig((uint)curLvelContext.m_mapID); return(null); } if (curLvelContext.m_pveLevelType == RES_LEVEL_TYPE.RES_LEVEL_TYPE_PVP) { dwAIPlayerLevel = (int)info2.dwAIPlayerLevel; } } } if (dwAIPlayerLevel <= 0) { return(null); } ResMonsterOrganLevelDynamicInfo dataByKey = GameDataMgr.monsterOrganLvDynamicInfobin.GetDataByKey((long)dwAIPlayerLevel); if (dataByKey == null) { return(null); } switch (monsterCfg.bSoldierType) { case 1: return(dataByKey.stMelee); case 2: return(dataByKey.stRemote); case 3: return(dataByKey.stSuper); case 4: return(dataByKey.stAnYingDaJiang); case 5: return(dataByKey.stHeiAnXianFeng); case 6: return(dataByKey.stBaoZouJiangShi); case 7: case 8: return(dataByKey.stBaoJun); } return(null); }
protected override bool BuildMonsterData(ref ActorMeta actorMeta, ref ActorStaticData actorData) { ResMonsterCfgInfo resMonsterCfgInfo = this.ConsiderDifficultyToChooseMonsterCfg((uint)actorData.TheActorMeta.ConfigId, actorData.TheActorMeta.Difficuty); if (resMonsterCfgInfo == null) { resMonsterCfgInfo = MonsterDataHelper.GetDataCfgInfo(actorData.TheActorMeta.ConfigId, (int)actorData.TheActorMeta.Difficuty); if (resMonsterCfgInfo == null) { resMonsterCfgInfo = MonsterDataHelper.GetDataCfgInfo(actorData.TheActorMeta.ConfigId, 1); } if (resMonsterCfgInfo == null) { base.ErrorMissingMonsterConfig((uint)actorData.TheActorMeta.ConfigId); return(false); } } DynamicAttributeInfo dynamicAttributeInfo = this.ConsiderMonsterDynamicInfo(resMonsterCfgInfo); actorData.TheBaseAttribute.EpType = 1u; actorData.TheBaseAttribute.BaseHp = ((dynamicAttributeInfo == null) ? resMonsterCfgInfo.iBaseHP : dynamicAttributeInfo.iBaseHP); actorData.TheBaseAttribute.PerLvHp = 0; actorData.TheBaseAttribute.BaseAd = ((dynamicAttributeInfo == null) ? resMonsterCfgInfo.iBaseATT : dynamicAttributeInfo.iAD); actorData.TheBaseAttribute.PerLvAd = 0; actorData.TheBaseAttribute.BaseAp = ((dynamicAttributeInfo == null) ? resMonsterCfgInfo.iBaseINT : dynamicAttributeInfo.iAP); actorData.TheBaseAttribute.PerLvAp = 0; actorData.TheBaseAttribute.BaseAtkSpeed = 0; actorData.TheBaseAttribute.PerLvAtkSpeed = 0; actorData.TheBaseAttribute.BaseDef = ((dynamicAttributeInfo == null) ? resMonsterCfgInfo.iBaseDEF : dynamicAttributeInfo.iDef); actorData.TheBaseAttribute.PerLvDef = 0; actorData.TheBaseAttribute.BaseRes = ((dynamicAttributeInfo == null) ? resMonsterCfgInfo.iBaseRES : dynamicAttributeInfo.iRes); actorData.TheBaseAttribute.PerLvRes = 0; actorData.TheBaseAttribute.BaseHpRecover = resMonsterCfgInfo.iBaseHPAdd; actorData.TheBaseAttribute.PerLvHpRecover = 0; actorData.TheBaseAttribute.CriticalChance = 0; actorData.TheBaseAttribute.CriticalDamage = 0; actorData.TheBaseAttribute.Sight = resMonsterCfgInfo.iSightR; actorData.TheBaseAttribute.MoveSpeed = resMonsterCfgInfo.iBaseSpeed; actorData.TheBaseAttribute.SoulExpGained = resMonsterCfgInfo.iSoulExp; actorData.TheBaseAttribute.GoldCoinInBattleGained = (int)resMonsterCfgInfo.wStartingGoldCoinInBattle; actorData.TheBaseAttribute.GoldCoinInBattleGainedFloatRange = (int)resMonsterCfgInfo.bGoldCoinInBattleRange; actorData.TheBaseAttribute.DynamicProperty = resMonsterCfgInfo.dwDynamicPropertyCfg; actorData.TheBaseAttribute.ClashMark = resMonsterCfgInfo.dwClashMark; actorData.TheBaseAttribute.RandomPassiveSkillRule = (int)resMonsterCfgInfo.bRandomPassiveSkillRule; actorData.TheBaseAttribute.PassiveSkillID1 = 0; actorData.TheBaseAttribute.PassiveSkillID2 = 0; actorData.TheBaseAttribute.DeadControl = false; actorData.TheMonsterOnlyInfo.MonsterBaseLevel = resMonsterCfgInfo.iLevel; actorData.TheMonsterOnlyInfo.SoldierType = resMonsterCfgInfo.bSoldierType; actorData.TheResInfo.Name = StringHelper.UTF8BytesToString(ref resMonsterCfgInfo.szName); actorData.TheResInfo.ResPath = StringHelper.UTF8BytesToString(ref resMonsterCfgInfo.szCharacterInfo); actorData.ProviderType = GameActorDataProviderType.StaticBattleDataProvider; return(true); }
public override void NotifyDropEvent(PoolObjHandle <ActorRoot> actor) { DebugHelper.Assert((bool)actor); if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { ResMonsterCfgInfo info = base.FindMonsterConfig(actor.handle.TheActorMeta.ConfigId); if ((info != null) && (info.bMonsterGrade == 3)) { this.FinishDrop(); } } }
public ActorRoot GetNearestEnemyWithoutNotInBattleJungleMonsterWithoutActor(ActorRoot InActor, int srchR, uint withOutActor) { if (InActor == null) { return(null); } ActorRoot root = null; ulong num = (ulong)(srchR * srchR); for (int i = 0; i < 3; i++) { if (i != InActor.TheActorMeta.ActorCamp) { List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)i); int count = campActors.Count; for (int j = 0; j < count; j++) { PoolObjHandle <ActorRoot> handle = campActors[j]; ActorRoot target = handle.handle; if (((target != null) && (target.ObjID != withOutActor)) && target.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp)) { MonsterWrapper wrapper = target.AsMonster(); if (wrapper != null) { ResMonsterCfgInfo cfgInfo = wrapper.cfgInfo; if ((cfgInfo != null) && (cfgInfo.bMonsterType == 2)) { switch (target.ActorAgent.GetCurBehavior()) { case ObjBehaviMode.State_Idle: case ObjBehaviMode.State_Dead: case ObjBehaviMode.State_Null: { continue; } } } } VInt3 num6 = target.location - InActor.location; ulong num5 = (ulong)num6.sqrMagnitudeLong2D; if ((num5 < num) && InActor.CanAttack(target)) { root = target; num = num5; } } } } } return(root); }
public ActorRoot GetNearestEnemy(ActorRoot InActor, int srchR, uint filter, bool bWithMonsterNotInBattle = true) { ActorRoot root = null; ulong num = (ulong)(srchR * srchR); for (int i = 0; i < 3; i++) { if (i != InActor.TheActorMeta.ActorCamp) { List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)i); int count = campActors.Count; for (int j = 0; j < count; j++) { PoolObjHandle <ActorRoot> handle = campActors[j]; ActorRoot target = handle.handle; if (((filter & (((int)1) << target.TheActorMeta.ActorType)) <= 0L) && target.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp)) { if (!bWithMonsterNotInBattle) { MonsterWrapper actorControl = target.ActorControl as MonsterWrapper; if (actorControl != null) { ResMonsterCfgInfo cfgInfo = actorControl.cfgInfo; if ((cfgInfo != null) && (cfgInfo.bMonsterType == 2)) { switch (target.ActorAgent.GetCurBehavior()) { case ObjBehaviMode.State_Idle: case ObjBehaviMode.State_Dead: case ObjBehaviMode.State_Null: { continue; } } } } } VInt3 num6 = target.location - InActor.location; ulong num5 = (ulong)num6.sqrMagnitudeLong2D; if ((num5 < num) && InActor.CanAttack(target)) { root = target; num = num5; } } } } } return(root); }
public void MakeDropItemIfNeed(MonsterWrapper InMonster, ObjWrapper InTarget) { DebugHelper.Assert(InMonster != null); ResMonsterCfgInfo cfgInfo = InMonster.cfgInfo; if ((cfgInfo != null) && (cfgInfo.iBufDropID != 0)) { this.MonsterRef = InMonster; if (FrameRandom.Random(0x2710) < cfgInfo.iBufDropRate) { this.SpawnBuf(cfgInfo.iBufDropID); } } }
public void Init(GameObject node, GameObject bigNode, bool b5V5) { this.m_b5v5 = b5V5; Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_born", new Action <ActorRoot>(this.onDragon_Born)); Singleton <EventRouter> .GetInstance().AddEventHandler <ActorRoot>("Dragon_dead", new Action <ActorRoot>(this.onDragon_Dead)); for (int i = 0; i < node.transform.childCount; i++) { node.transform.GetChild(i).gameObject.CustomSetActive(false); } for (int j = 0; j < bigNode.transform.childCount; j++) { bigNode.transform.GetChild(j).gameObject.CustomSetActive(false); } this.node_ary.Add(new DragonNode(node, bigNode, "d_3", 7, 0)); this.node_ary.Add(new DragonNode(node, bigNode, "d_5_big", 8, 0)); this.node_ary.Add(new DragonNode(node, bigNode, "d_5_small_1", 9, 13)); this.node_ary.Add(new DragonNode(node, bigNode, "d_5_small_2", 9, 13)); SpawnGroup group = null; ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .instance.mapLogic.GetSpawnGroups(); if (spawnGroups != null) { for (int k = 0; k < spawnGroups.Count; k++) { group = spawnGroups[k]; if ((group != null) && (group.NextGroups.Length == 0)) { ActorMeta meta = group.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(meta.ConfigId); if ((dataCfgInfoByCurLevelDiff != null) && ((((dataCfgInfoByCurLevelDiff.bSoldierType == 8) || (dataCfgInfoByCurLevelDiff.bSoldierType == 9)) || (dataCfgInfoByCurLevelDiff.bSoldierType == 7)) || (dataCfgInfoByCurLevelDiff.bSoldierType == 13))) { DragonNode node2 = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType); if (node2 != null) { node2.spawnGroup = group; node2.SetData(group.gameObject.transform.position, dataCfgInfoByCurLevelDiff.bSoldierType, 0, this.m_b5v5); node2.ShowDead(true); MiniMapSysUT.RefreshMapPointerBig(node2.node_in_bigMap); } } } } } if (Singleton <WatchController> .GetInstance().IsWatching) { this.m_cdTimer = Singleton <CTimerManager> .GetInstance().AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnCDTimer)); } }
private void SpawnMonster(Action _action) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(this.ConfigID); if (dataCfgInfoByCurLevelDiff == null) { return; } string fullPathInResources = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo) + ".asset"; CActorInfo exists = Singleton <CResourceManager> .GetInstance().GetResource(fullPathInResources, typeof(CActorInfo), enResourceType.BattleScene, false, false).m_content as CActorInfo; if (exists) { ActorMeta actorMeta = default(ActorMeta); ActorMeta actorMeta2 = actorMeta; actorMeta2.ConfigId = this.ConfigID; actorMeta2.ActorType = ActorTypeDef.Actor_Type_Monster; actorMeta2.ActorCamp = this.PlayerCamp; actorMeta2.EnCId = this.ConfigID; actorMeta = actorMeta2; VInt3 location = this.tarActor.handle.location; VInt3 forward = this.tarActor.handle.forward; PoolObjHandle <ActorRoot> poolObjHandle = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref actorMeta, location, forward, false, true); if (poolObjHandle) { poolObjHandle.handle.InitActor(); poolObjHandle.handle.PrepareFight(); Singleton <GameObjMgr> .instance.AddActor(poolObjHandle); poolObjHandle.handle.StartFight(); poolObjHandle.handle.ObjLinker.Invincible = this.Invincible; poolObjHandle.handle.ObjLinker.CanMovable = this.Moveable; MonsterWrapper monsterWrapper = poolObjHandle.handle.ActorControl as MonsterWrapper; if (monsterWrapper != null) { if (this.wayPoint != null) { monsterWrapper.AttackAlongRoute(this.wayPoint.GetComponent <WaypointsHolder>()); } if (this.LifeTime > 0) { monsterWrapper.LifeTime = this.LifeTime; } } } } }
public void RefreshDragNode(bool bUseCache, bool bRefreshMM = false) { ListView <SpawnGroup> spawnGroups = Singleton <BattleLogic> .get_instance().mapLogic.GetSpawnGroups(); if (spawnGroups != null) { for (int i = 0; i < spawnGroups.get_Count(); i++) { SpawnGroup spawnGroup = spawnGroups.get_Item(i); if (spawnGroup != null && spawnGroup.NextGroups.Length == 0) { ActorMeta actorMeta = spawnGroup.TheActorsMeta[0]; ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff != null) { bool flag = dataCfgInfoByCurLevelDiff.bSoldierType == 8 || dataCfgInfoByCurLevelDiff.bSoldierType == 9 || dataCfgInfoByCurLevelDiff.bSoldierType == 7 || dataCfgInfoByCurLevelDiff.bSoldierType == 13; if (flag) { DragonIcon.DragonNode dragonNode = this.getDragonNode(dataCfgInfoByCurLevelDiff.bSoldierType); if (dragonNode != null) { dragonNode.spawnGroup = spawnGroup; dragonNode.SetData(spawnGroup.gameObject.transform.position, (int)dataCfgInfoByCurLevelDiff.bSoldierType, dragonNode.objid, this.m_b5v5, bUseCache, false, bRefreshMM); if (dragonNode.objid != 0u) { PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(dragonNode.objid); if (actor) { dragonNode.ShowDead(actor.get_handle().ActorControl.IsDeadState); } else { dragonNode.ShowDead(true); } } else { dragonNode.ShowDead(true); } MiniMapSysUT.RefreshMapPointerBig(dragonNode.bmDragonNode_3dui); } } } } } } }
public static bool FitSoldier(ActorRoot _actor) { if (_actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { MonsterWrapper monsterWrapper = _actor.ActorControl as MonsterWrapper; if (monsterWrapper != null) { ResMonsterCfgInfo cfgInfo = monsterWrapper.cfgInfo; if (cfgInfo != null && cfgInfo.bMonsterType == 1) { return(true); } } } return(false); }
public void MakeDropItemIfNeed(MonsterWrapper InMonster, ObjWrapper InTarget) { DebugHelper.Assert(InMonster != null); ResMonsterCfgInfo cfgInfo = InMonster.cfgInfo; if (cfgInfo == null || cfgInfo.iBufDropID == 0) { return; } this.MonsterRef = InMonster; ushort num = FrameRandom.Random(10000u); if ((int)num < cfgInfo.iBufDropRate) { this.SpawnBuf(cfgInfo.iBufDropID); } }
public int GetKillSpecialMonsterNumAtTime(uint playerID, int deadTime, byte bySoldierType) { int num = 0; for (int i = 0; i < this.m_deadRecordList.Count; i++) { DeadRecord record = this.m_deadRecordList[i]; if (((record.AttackPlayerID == playerID) && (record.actorType == ActorTypeDef.Actor_Type_Monster)) && (record.actorSubType == 2)) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(record.cfgId); if (((dataCfgInfoByCurLevelDiff != null) && (dataCfgInfoByCurLevelDiff.bSoldierType == bySoldierType)) && (record.deadTime < deadTime)) { num++; } } } return(num); }
private void SetBossIcon(ActorRoot inActor) { if ((inActor != null) && (this.map_fromScript != null)) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff != null) { if (!string.IsNullOrEmpty(dataCfgInfoByCurLevelDiff.szBossIcon)) { this.boss_icon.SetSprite(dataCfgInfoByCurLevelDiff.szBossIcon, this.map_fromScript, true, false, false); } else { this.boss_icon.SetSprite("UGUI/Sprite/Dynamic/BustCircle/50001", this.map_fromScript, true, false, false); } } } }
public int GetBaronDeadCount(COM_PLAYERCAMP killerCamp) { int num = 0; for (int i = 0; i < this.m_deadRecordList.Count; i++) { DeadRecord record = this.m_deadRecordList[i]; if (((killerCamp == record.killerCamp) && (record.actorType == ActorTypeDef.Actor_Type_Monster)) && (record.actorSubType == 2)) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(record.cfgId); if ((dataCfgInfoByCurLevelDiff != null) && (dataCfgInfoByCurLevelDiff.bSoldierType == 8)) { num++; } } } return(num); }
protected virtual bool BuildMonsterSkillData(ref ActorMeta actorMeta, ActorSkillSlot skillSlot, ref ActorStaticSkillData skillData) { int index = (int)skillSlot; ResMonsterCfgInfo dataCfgInfo = MonsterDataHelper.GetDataCfgInfo(skillData.TheActorMeta.ConfigId, skillData.TheActorMeta.Difficuty); if (dataCfgInfo == null) { base.ErrorMissingMonsterConfig((uint)skillData.TheActorMeta.ConfigId); return(false); } if (index >= dataCfgInfo.SkillIDs.Length) { return(false); } skillData.SkillId = dataCfgInfo.SkillIDs[index]; skillData.PassiveSkillId = dataCfgInfo.PassiveSkillID[index]; return((skillData.SkillId > 0) || (skillData.PassiveSkillId > 0)); }
private string QueryEliteName(ActorRoot inActor) { string text = null; if (inActor == null) { return(text); } ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { return(text); } string text2 = UT.Bytes2String(dataCfgInfoByCurLevelDiff.szName); text = text2; if (inActor.SkillControl == null || inActor.SkillControl.talentSystem == null) { return(text); } string text3 = string.Empty; PassiveSkill[] array = inActor.SkillControl.talentSystem.QueryTalents(); if (array != null) { PassiveSkill[] array2 = array; for (int i = 0; i < array2.Length; i++) { PassiveSkill passiveSkill = array2[i]; if (passiveSkill != null && passiveSkill.bShowAsElite) { text3 += passiveSkill.PassiveSkillName; text3 += "之"; } } } if (!string.IsNullOrEmpty(text3)) { text = text3 + text; } return(text); }
private void CheckCallMonsterSkill(CActorInfo InActorInfo, ref List <ActorPreloadTab> InPreloadListRef, ref ActorMeta InParentActorMetaRef, int markID) { if (InActorInfo != null && InActorInfo.callMonsterConfigID > 0) { ResCallMonster dataByKey = GameDataMgr.callMonsterDatabin.GetDataByKey((long)InActorInfo.callMonsterConfigID); if (dataByKey != null) { ResMonsterCfgInfo dataCfgInfo = MonsterDataHelper.GetDataCfgInfo((int)dataByKey.dwMonsterID, 1); if (dataCfgInfo != null) { ActorMeta actorMeta = default(ActorMeta); actorMeta.ActorType = ActorTypeDef.Actor_Type_Monster; actorMeta.ActorCamp = InParentActorMetaRef.ActorCamp; actorMeta.ConfigId = dataCfgInfo.iCfgID; this.AddPreloadActor(ref InPreloadListRef, ref actorMeta, 2f, markID); } } } }
protected override bool BuildMonsterData(ref ActorMeta actorMeta, ref ActorStaticData actorData) { ResMonsterCfgInfo dataCfgInfo = MonsterDataHelper.GetDataCfgInfo(actorData.TheActorMeta.ConfigId, (int)actorData.TheActorMeta.Difficuty); if (dataCfgInfo == null) { dataCfgInfo = MonsterDataHelper.GetDataCfgInfo(actorData.TheActorMeta.ConfigId, 1); } if (dataCfgInfo == null) { base.ErrorMissingMonsterConfig((uint)actorData.TheActorMeta.ConfigId); return(false); } actorData.TheBaseAttribute.EpType = 1u; actorData.TheBaseAttribute.BaseHp = dataCfgInfo.iBaseHP; actorData.TheBaseAttribute.PerLvHp = 0; actorData.TheBaseAttribute.BaseAd = dataCfgInfo.iBaseATT; actorData.TheBaseAttribute.PerLvAd = 0; actorData.TheBaseAttribute.BaseAp = dataCfgInfo.iBaseINT; actorData.TheBaseAttribute.PerLvAp = 0; actorData.TheBaseAttribute.BaseAtkSpeed = 0; actorData.TheBaseAttribute.PerLvAtkSpeed = 0; actorData.TheBaseAttribute.BaseDef = dataCfgInfo.iBaseDEF; actorData.TheBaseAttribute.PerLvDef = 0; actorData.TheBaseAttribute.BaseRes = dataCfgInfo.iBaseRES; actorData.TheBaseAttribute.PerLvRes = 0; actorData.TheBaseAttribute.BaseHpRecover = dataCfgInfo.iBaseHPAdd; actorData.TheBaseAttribute.PerLvHpRecover = 0; actorData.TheBaseAttribute.CriticalChance = 0; actorData.TheBaseAttribute.CriticalDamage = 0; actorData.TheBaseAttribute.Sight = dataCfgInfo.iSightR; actorData.TheBaseAttribute.MoveSpeed = dataCfgInfo.iBaseSpeed; actorData.TheBaseAttribute.SoulExpGained = dataCfgInfo.iSoulExp; actorData.TheBaseAttribute.GoldCoinInBattleGained = (int)dataCfgInfo.wStartingGoldCoinInBattle; actorData.TheBaseAttribute.GoldCoinInBattleGainedFloatRange = (int)dataCfgInfo.bGoldCoinInBattleRange; actorData.TheBaseAttribute.DynamicProperty = dataCfgInfo.dwDynamicPropertyCfg; actorData.TheBaseAttribute.ClashMark = dataCfgInfo.dwClashMark; actorData.TheResInfo.Name = StringHelper.UTF8BytesToString(ref dataCfgInfo.szName); actorData.TheResInfo.ResPath = StringHelper.UTF8BytesToString(ref dataCfgInfo.szCharacterInfo); actorData.ProviderType = GameActorDataProviderType.StaticLobbyDataProvider; return(true); }
private bool MonsterNotInBattle(ref PoolObjHandle <ActorRoot> monster) { if (monster) { MonsterWrapper monsterWrapper = monster.handle.ActorControl as MonsterWrapper; if (monsterWrapper != null) { ResMonsterCfgInfo cfgInfo = monsterWrapper.cfgInfo; if (cfgInfo != null && cfgInfo.bMonsterType == 2) { ObjAgent actorAgent = monster.handle.ActorAgent; ObjBehaviMode curBehavior = actorAgent.GetCurBehavior(); if (curBehavior == ObjBehaviMode.State_Idle || curBehavior == ObjBehaviMode.State_Dead || curBehavior == ObjBehaviMode.State_Null) { return(true); } } } } return(false); }
protected virtual bool BuildMonsterSkillData(ref ActorMeta actorMeta, ActorSkillSlot skillSlot, ref ActorStaticSkillData skillData) { ResMonsterCfgInfo dataCfgInfo = MonsterDataHelper.GetDataCfgInfo(skillData.TheActorMeta.ConfigId, (int)skillData.TheActorMeta.Difficuty); if (dataCfgInfo == null) { dataCfgInfo = MonsterDataHelper.GetDataCfgInfo(skillData.TheActorMeta.ConfigId, 1); } if (dataCfgInfo == null) { base.ErrorMissingMonsterConfig((uint)skillData.TheActorMeta.ConfigId); return(false); } if (skillSlot >= (ActorSkillSlot)dataCfgInfo.SkillIDs.Length) { return(false); } skillData.SkillId = dataCfgInfo.SkillIDs[(int)skillSlot]; skillData.PassiveSkillId = dataCfgInfo.PassiveSkillID[(int)skillSlot]; return(skillData.SkillId > 0 || skillData.PassiveSkillId > 0); }
public override void NotifyDropEvent(PoolObjHandle <ActorRoot> actor) { DebugHelper.Assert((bool)actor); if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { ResMonsterCfgInfo info = base.FindMonsterConfig(actor.handle.TheActorMeta.ConfigId); object[] inParameters = new object[] { actor.handle.TheActorMeta.ConfigId }; DebugHelper.Assert(info != null, "怪物数据档里面找不到id:{0}", inParameters); if (info != null) { RES_DROP_PROBABILITY_TYPE iDropProbability = (RES_DROP_PROBABILITY_TYPE)info.iDropProbability; if (iDropProbability == RES_DROP_PROBABILITY_TYPE.RES_PROBABILITY_SETTLE) { this.FinishDrop(); } else if ((this.hasRemain && (iDropProbability != ((RES_DROP_PROBABILITY_TYPE)0))) && (FrameRandom.Random(100) <= ((ushort)iDropProbability))) { this.PlayDrop(); } } } }
public int GetBaronDeadTime(int index) { int num = 0; for (int i = 0; i < this.m_deadRecordList.Count; i++) { DeadRecord record = this.m_deadRecordList[i]; if ((record.actorType == ActorTypeDef.Actor_Type_Monster) && (record.actorSubType == 2)) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(record.cfgId); if ((dataCfgInfoByCurLevelDiff != null) && (dataCfgInfoByCurLevelDiff.bSoldierType == 8)) { if (num == index) { DeadRecord record2 = this.m_deadRecordList[i]; return(record2.deadTime); } num++; } } } return(0); }
public override void NotifyDropEvent(PoolObjHandle <ActorRoot> actor) { DebugHelper.Assert(actor); if (actor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { ResMonsterCfgInfo resMonsterCfgInfo = base.FindMonsterConfig(actor.get_handle().TheActorMeta.ConfigId); DebugHelper.Assert(resMonsterCfgInfo != null, "怪物数据档里面找不到id:{0}", new object[] { actor.get_handle().TheActorMeta.ConfigId }); if (resMonsterCfgInfo != null) { RES_DROP_PROBABILITY_TYPE iDropProbability = resMonsterCfgInfo.iDropProbability; if (iDropProbability == 101) { this.FinishDrop(); } else if (this.hasRemain && iDropProbability != null && FrameRandom.Random(100u) <= iDropProbability) { this.PlayDrop(); } } } }