protected override bool BuildOrganData(ref ActorMeta actorMeta, ref ActorStaticData actorData) { ResOrganCfgInfo dataCfgInfoByCurLevelDiff = OrganDataHelper.GetDataCfgInfoByCurLevelDiff(actorData.TheActorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { base.ErrorMissingOrganConfig((uint)actorData.TheActorMeta.ConfigId); return(false); } DynamicAttributeInfo dynamicAttributeInfo = this.ConsiderOrganDynamicInfo(dataCfgInfoByCurLevelDiff); actorData.TheBaseAttribute.EpType = 1u; actorData.TheBaseAttribute.BaseHp = ((dynamicAttributeInfo == null) ? dataCfgInfoByCurLevelDiff.iBaseHP : dynamicAttributeInfo.iBaseHP); actorData.TheBaseAttribute.PerLvHp = dataCfgInfoByCurLevelDiff.iHPLvlup; actorData.TheBaseAttribute.BaseAd = ((dynamicAttributeInfo == null) ? dataCfgInfoByCurLevelDiff.iBaseATT : dynamicAttributeInfo.iAD); actorData.TheBaseAttribute.PerLvAd = dataCfgInfoByCurLevelDiff.iATTLvlup; actorData.TheBaseAttribute.BaseAp = ((dynamicAttributeInfo == null) ? dataCfgInfoByCurLevelDiff.iBaseINT : dynamicAttributeInfo.iAP); actorData.TheBaseAttribute.PerLvAp = dataCfgInfoByCurLevelDiff.iINTLvlup; actorData.TheBaseAttribute.BaseAtkSpeed = 0; actorData.TheBaseAttribute.PerLvAtkSpeed = dataCfgInfoByCurLevelDiff.iAtkSpdAddLvlup; actorData.TheBaseAttribute.BaseDef = ((dynamicAttributeInfo == null) ? dataCfgInfoByCurLevelDiff.iBaseDEF : dynamicAttributeInfo.iDef); actorData.TheBaseAttribute.PerLvDef = dataCfgInfoByCurLevelDiff.iDEFLvlup; actorData.TheBaseAttribute.BaseRes = ((dynamicAttributeInfo == null) ? dataCfgInfoByCurLevelDiff.iBaseRES : dynamicAttributeInfo.iRes); actorData.TheBaseAttribute.PerLvRes = dataCfgInfoByCurLevelDiff.iRESLvlup; actorData.TheBaseAttribute.BaseHpRecover = dataCfgInfoByCurLevelDiff.iBaseHPAdd; actorData.TheBaseAttribute.PerLvHpRecover = dataCfgInfoByCurLevelDiff.iHPAddLvlup; actorData.TheBaseAttribute.CriticalChance = 0; actorData.TheBaseAttribute.CriticalDamage = 0; actorData.TheBaseAttribute.Sight = dataCfgInfoByCurLevelDiff.iSightR; actorData.TheBaseAttribute.MoveSpeed = dataCfgInfoByCurLevelDiff.iBaseSpeed; actorData.TheBaseAttribute.SoulExpGained = dataCfgInfoByCurLevelDiff.iSoulExp; actorData.TheBaseAttribute.GoldCoinInBattleGained = (int)dataCfgInfoByCurLevelDiff.wGoldCoinInBattle; actorData.TheBaseAttribute.GoldCoinInBattleGainedFloatRange = 0; actorData.TheBaseAttribute.DynamicProperty = dataCfgInfoByCurLevelDiff.dwDynamicPropertyCfg; actorData.TheBaseAttribute.ClashMark = dataCfgInfoByCurLevelDiff.dwClashMark; actorData.TheBaseAttribute.RandomPassiveSkillRule = 0; actorData.TheBaseAttribute.PassiveSkillID1 = 0; actorData.TheBaseAttribute.PassiveSkillID2 = 0; actorData.TheBaseAttribute.DeadControl = false; actorData.TheResInfo.Name = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szName); actorData.TheResInfo.ResPath = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo); actorData.TheOrganOnlyInfo.OrganType = (int)dataCfgInfoByCurLevelDiff.bOrganType; actorData.TheOrganOnlyInfo.ShowInMinimap = (dataCfgInfoByCurLevelDiff.bShowInMinimap != 0); actorData.TheOrganOnlyInfo.PhyArmorHurtRate = dataCfgInfoByCurLevelDiff.iPhyArmorHurtRate; actorData.TheOrganOnlyInfo.AttackRouteID = dataCfgInfoByCurLevelDiff.iAktRouteID; actorData.TheOrganOnlyInfo.DeadEnemySoldier = dataCfgInfoByCurLevelDiff.iDeadEnemySoldier; actorData.TheOrganOnlyInfo.NoEnemyAddPhyDef = dataCfgInfoByCurLevelDiff.iNoEnemyAddPhyDef; actorData.TheOrganOnlyInfo.NoEnemyAddMgcDef = dataCfgInfoByCurLevelDiff.iNoEnemyAddMgcDef; actorData.TheOrganOnlyInfo.HorizonRadius = dataCfgInfoByCurLevelDiff.iHorizonRadius; actorData.ProviderType = GameActorDataProviderType.StaticBattleDataProvider; return(true); }
protected virtual bool BuildOrganPerStarLvData(ref ActorMeta actorMeta, ActorStarLv starLv, ref ActorPerStarLvData perStarLvData) { ResOrganCfgInfo dataCfgInfoByCurLevelDiff = OrganDataHelper.GetDataCfgInfoByCurLevelDiff(perStarLvData.TheActorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { base.ErrorMissingOrganConfig((uint)perStarLvData.TheActorMeta.ConfigId); return(false); } perStarLvData.PerLvHp = dataCfgInfoByCurLevelDiff.iHPLvlup; perStarLvData.PerLvAd = dataCfgInfoByCurLevelDiff.iATTLvlup; perStarLvData.PerLvAp = dataCfgInfoByCurLevelDiff.iINTLvlup; perStarLvData.PerLvDef = dataCfgInfoByCurLevelDiff.iDEFLvlup; perStarLvData.PerLvRes = dataCfgInfoByCurLevelDiff.iRESLvlup; return(true); }
protected virtual bool BuildOrganSkillData(ref ActorMeta actorMeta, ActorSkillSlot skillSlot, ref ActorStaticSkillData skillData) { ResOrganCfgInfo dataCfgInfoByCurLevelDiff = OrganDataHelper.GetDataCfgInfoByCurLevelDiff(skillData.TheActorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { base.ErrorMissingOrganConfig((uint)skillData.TheActorMeta.ConfigId); return(false); } if (skillSlot >= (ActorSkillSlot)dataCfgInfoByCurLevelDiff.SkillIDs.Length) { return(false); } skillData.SkillId = dataCfgInfoByCurLevelDiff.SkillIDs[(int)skillSlot]; skillData.PassiveSkillId = 0; return(skillData.SkillId > 0); }
protected override bool BuildOrganData(ref ActorMeta actorMeta, ref ActorStaticData actorData) { ResOrganCfgInfo dataCfgInfoByCurLevelDiff = OrganDataHelper.GetDataCfgInfoByCurLevelDiff(actorData.TheActorMeta.ConfigId); if (dataCfgInfoByCurLevelDiff == null) { base.ErrorMissingOrganConfig((uint)actorData.TheActorMeta.ConfigId); return(false); } actorData.TheBaseAttribute.EpType = 1; actorData.TheBaseAttribute.BaseHp = dataCfgInfoByCurLevelDiff.iBaseHP; actorData.TheBaseAttribute.PerLvHp = dataCfgInfoByCurLevelDiff.iHPLvlup; actorData.TheBaseAttribute.BaseAd = dataCfgInfoByCurLevelDiff.iBaseATT; actorData.TheBaseAttribute.PerLvAd = dataCfgInfoByCurLevelDiff.iATTLvlup; actorData.TheBaseAttribute.BaseAp = dataCfgInfoByCurLevelDiff.iBaseINT; actorData.TheBaseAttribute.PerLvAp = dataCfgInfoByCurLevelDiff.iINTLvlup; actorData.TheBaseAttribute.BaseAtkSpeed = 0; actorData.TheBaseAttribute.PerLvAtkSpeed = dataCfgInfoByCurLevelDiff.iAtkSpdAddLvlup; actorData.TheBaseAttribute.BaseDef = dataCfgInfoByCurLevelDiff.iBaseDEF; actorData.TheBaseAttribute.PerLvDef = dataCfgInfoByCurLevelDiff.iDEFLvlup; actorData.TheBaseAttribute.BaseRes = dataCfgInfoByCurLevelDiff.iBaseRES; actorData.TheBaseAttribute.PerLvRes = dataCfgInfoByCurLevelDiff.iRESLvlup; actorData.TheBaseAttribute.BaseHpRecover = dataCfgInfoByCurLevelDiff.iBaseHPAdd; actorData.TheBaseAttribute.PerLvHpRecover = dataCfgInfoByCurLevelDiff.iHPAddLvlup; actorData.TheBaseAttribute.CriticalChance = 0; actorData.TheBaseAttribute.CriticalDamage = 0; actorData.TheBaseAttribute.Sight = dataCfgInfoByCurLevelDiff.iSightR; actorData.TheBaseAttribute.MoveSpeed = dataCfgInfoByCurLevelDiff.iBaseSpeed; actorData.TheBaseAttribute.SoulExpGained = dataCfgInfoByCurLevelDiff.iSoulExp; actorData.TheBaseAttribute.GoldCoinInBattleGained = dataCfgInfoByCurLevelDiff.wGoldCoinInBattle; actorData.TheBaseAttribute.GoldCoinInBattleGainedFloatRange = 0; actorData.TheBaseAttribute.DynamicProperty = dataCfgInfoByCurLevelDiff.dwDynamicPropertyCfg; actorData.TheBaseAttribute.ClashMark = dataCfgInfoByCurLevelDiff.dwClashMark; actorData.TheResInfo.Name = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szName); actorData.TheResInfo.ResPath = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo); actorData.TheOrganOnlyInfo.PhyArmorHurtRate = dataCfgInfoByCurLevelDiff.iPhyArmorHurtRate; actorData.TheOrganOnlyInfo.AttackRouteID = dataCfgInfoByCurLevelDiff.iAktRouteID; actorData.TheOrganOnlyInfo.DeadEnemySoldier = dataCfgInfoByCurLevelDiff.iDeadEnemySoldier; actorData.TheOrganOnlyInfo.NoEnemyAddPhyDef = dataCfgInfoByCurLevelDiff.iNoEnemyAddPhyDef; actorData.TheOrganOnlyInfo.NoEnemyAddMgcDef = dataCfgInfoByCurLevelDiff.iNoEnemyAddMgcDef; actorData.TheOrganOnlyInfo.HorizonRadius = dataCfgInfoByCurLevelDiff.iHorizonRadius; actorData.ProviderType = GameActorDataProviderType.StaticLobbyDataProvider; return(true); }
public override void Born(ActorRoot owner) { base.Born(owner); this.actor.isMovable = false; this.actor.isRotatable = false; VCollisionShape.InitActorCollision(this.actor); this.navmeshCut = base.gameObject.GetComponent <NavmeshCut>(); if (this.navmeshCut) { this.navmeshCut.enabled = true; } this._aroundEffects = new GameObject[3]; this.attackAreaCheck = new AreaCheck(new ActorFilterDelegate(this.ActorMarkFilter), new AreaCheck.ActorProcess(this.ActorMarkProcess), Singleton <GameObjMgr> .GetInstance().GetCampActors(this.actor.GiveMyEnemyCamp())); this._aroundEnemyMonsterCount = 0; this.cfgInfo = OrganDataHelper.GetDataCfgInfoByCurLevelDiff(this.actor.TheActorMeta.ConfigId); if (this.cfgInfo != null) { this.actorSubType = this.cfgInfo.bOrganType; } }
public override void NotifyDropEvent(PoolObjHandle <ActorRoot> actor) { DebugHelper.Assert((bool)actor); if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ) { ResOrganCfgInfo dataCfgInfoByCurLevelDiff = OrganDataHelper.GetDataCfgInfoByCurLevelDiff(actor.handle.TheActorMeta.ConfigId); object[] inParameters = new object[] { actor.handle.TheActorMeta.ConfigId }; DebugHelper.Assert(dataCfgInfoByCurLevelDiff != null, "can't find organ config, id={0}", inParameters); if (dataCfgInfoByCurLevelDiff != null) { if (dataCfgInfoByCurLevelDiff.bOrganType == 2) { this.FinishDrop(); } else if (this.hasRemain && (FrameRandom.Random(100) <= MonoSingleton <GlobalConfig> .instance.OrganDropItemProbability)) { this.PlayDrop(); } } } }
private void onActorDead(ref GameDeadEventParam param) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "Master Roleinfo is NULL!"); if (masterRoleInfo != null) { if ((param.atker != 0) && ActorHelper.IsHostActor(ref param.atker)) { if (param.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { MonsterWrapper wrapper = param.src.handle.AsMonster(); object[] inParameters = new object[] { param.src.handle.TheActorMeta.ConfigId }; DebugHelper.Assert((wrapper != null) && (wrapper.cfgInfo != null), "Can't find Monster config -- ID: {0}", inParameters); if ((wrapper.cfgInfo.bMonsterType == 1) && !masterRoleInfo.IsNewbieAchieveSet(0)) { this.ShowAchieve(enNewbieAchieve.COM_ACNT_CLIENT_BITS_TYPE_KILL_SOLDIER); masterRoleInfo.SetNewbieAchieve(0, true, false); } } else if (param.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ) { ResOrganCfgInfo dataCfgInfoByCurLevelDiff = OrganDataHelper.GetDataCfgInfoByCurLevelDiff(param.src.handle.TheActorMeta.ConfigId); object[] objArray2 = new object[] { param.src.handle.TheActorMeta.ConfigId }; DebugHelper.Assert(dataCfgInfoByCurLevelDiff != null, "Can't find Organ config -- ID: {0}", objArray2); if (dataCfgInfoByCurLevelDiff.bOrganType == 1) { if (!masterRoleInfo.IsNewbieAchieveSet(1)) { this.ShowAchieve(enNewbieAchieve.COM_ACNT_CLIENT_BITS_TYPE_DESTORY_ARROWTOWER); masterRoleInfo.SetNewbieAchieve(1, true, false); } } else if ((dataCfgInfoByCurLevelDiff.bOrganType == 2) && !masterRoleInfo.IsNewbieAchieveSet(2)) { this.ShowAchieve(enNewbieAchieve.COM_ACNT_CLIENT_BITS_TYPE_DESTORY_BASETOWER); masterRoleInfo.SetNewbieAchieve(2, true, false); } } } if ((param.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (param.atker != 0)) { if (ActorHelper.IsHostActor(ref param.atker)) { if (!masterRoleInfo.IsNewbieAchieveSet(8)) { this.ShowAchieve(enNewbieAchieve.COM_ACNT_CLIENT_BITS_TYPE_KILL_HERO); masterRoleInfo.SetNewbieAchieve(8, true, false); } } else if (param.atker.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero) { HeroWrapper actorControl = param.src.handle.ActorControl as HeroWrapper; if (actorControl != null) { PoolObjHandle <ActorRoot> lastHeroAtker = actorControl.LastHeroAtker; if (((lastHeroAtker != 0) && ActorHelper.IsHostActor(ref lastHeroAtker)) && !masterRoleInfo.IsNewbieAchieveSet(8)) { this.ShowAchieve(enNewbieAchieve.COM_ACNT_CLIENT_BITS_TYPE_KILL_HERO); masterRoleInfo.SetNewbieAchieve(8, true, false); } } } } } }
public static ResOrganCfgInfo GetDataCfgInfoByCurLevelDiff(int configID) { SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); return(OrganDataHelper.GetDataCfgInfo(configID, curLvelContext.m_levelDifficulty)); }