Beispiel #1
0
        private void AddAISkill()
        {
            MonsterData data = pMonster.GetMonsterData();

            if (data == null)
            {
                return;
            }

            DRMonster config = GameEntry.DataTable.GetDataTable <DRMonster>().GetDataRow(data.info.nMonsterID);

            if (config == null)
            {
                return;
            }

            for (int i = 0; i < config.AISkillCount; i++)
            {
                int nSkillID = config.GetAISkillAt(i);
                if (nSkillID == 0)
                {
                    return;
                }
                Owner.SkillCom.AddSkill(nSkillID);
                m_SkillList.Add(nSkillID);
            }

            m_nNextIndex = 0;
        }
Beispiel #2
0
        public void Initialize()
        {
            list = new List <MonsterInfo>
            {
                new MonsterInfo(101, new Vector3(-1.377827f, 18.90628f, 14.0027f), Vector3.zero),
                new MonsterInfo(102, new Vector3(-4.949947f, 18.80193f, -9.916924f), Vector3.zero),
                new MonsterInfo(103, new Vector3(-32.1039f, 19.2231f, -4.73109f), new Vector3(0f, 49.105f, 0f))
            };

            foreach (var item in list)
            {
                DRMonster data = GameEntry.DataTable.GetDataTable <DRMonster>().GetDataRow(item.nMonsterID);
                if (data == null)
                {
                    Log.Error("当前刷怪器的怪物数据有误'{0}'!", item.nMonsterID);
                    continue;
                }

                GameEntry.Entity.ShowEntity(
                    typeof(Monster),
                    Constant.Entity.MonsterGroupName,
                    Constant.AssetPriority.EnemyAsset,
                    new MonsterData(GameEntry.Entity.GenerateSerialId(),
                                    data.ModelID, item));
            }
        }
Beispiel #3
0
        public MonsterData(int entityId, int typeId, MonsterInfo _info)
            : base(entityId, typeId, CampType.Enemy)
        {
            DRMonster data = GameEntry.DataTable.GetDataTable <DRMonster>().GetDataRow(_info.nMonsterID);

            if (data == null)
            {
                Log.Error("当前怪物id不存在!");
                return;
            }

            m_nMonsterAValueID = data.MonsterAValue;
            UpdateAValueByInstance();
            info = _info;
        }