示例#1
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);
            }
            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);
        }
示例#2
0
        internal DynamicAttributeInfo ConsiderOrganDynamicInfo(ResOrganCfgInfo organCfg)
        {
            int num = 0;
            DynamicAttributeInfo result = null;

            if (organCfg.iDynamicInfoType == 1)
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

                if (curLvelContext != null && !curLvelContext.IsMobaMode())
                {
                    ResLevelCfgInfo dataByKey = GameDataMgr.levelDatabin.GetDataByKey((long)curLvelContext.m_mapID);
                    if (dataByKey == null)
                    {
                        base.ErrorMissingLevelConfig((uint)curLvelContext.m_mapID);
                        return(null);
                    }
                    if (curLvelContext.m_pveLevelType == null)
                    {
                        num = (int)dataByKey.dwAIPlayerLevel;
                    }
                }
            }
            if (num <= 0)
            {
                return(null);
            }
            ResMonsterOrganLevelDynamicInfo dataByKey2 = GameDataMgr.monsterOrganLvDynamicInfobin.GetDataByKey((long)num);

            if (dataByKey2 == null)
            {
                return(null);
            }
            switch (organCfg.bOrganType)
            {
            case 1:
                result = dataByKey2.stTurret;
                break;

            case 2:
                result = dataByKey2.stBase;
                break;

            case 3:
                result = dataByKey2.stBarrack;
                break;
            }
            return(result);
        }
示例#3
0
        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);
        }
        internal DynamicAttributeInfo ConsiderOrganDynamicInfo(ResOrganCfgInfo organCfg)
        {
            int dwAIPlayerLevel = 0;

            if (organCfg.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 (organCfg.bOrganType)
            {
            case 1:
                return(dataByKey.stTurret);

            case 2:
                return(dataByKey.stBase);

            case 3:
                return(dataByKey.stBarrack);
            }
            return(null);
        }
示例#6
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);
        }
示例#7
0
 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();
             }
         }
     }
 }
示例#8
0
        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);
                            }
                        }
                    }
                }
            }
        }