Exemplo n.º 1
0
        public static table.SuitDataBase GetSuitID(uint uSuitID, Client.EquipPos pos, byte profession, byte sex)
        {
            var table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>(uSuitID);

            if (table_data == null)
            {
                int nSex = sex;
                // 根据职业、性别和部位去查找
                var database = table.SelectRoleDataBase.Where((GameCmd.enumProfession)profession, (GameCmd.enmCharSex)nSex);
                if (database != null)
                {
                    switch (pos)
                    {
                    case Client.EquipPos.EquipPos_Body:
                    {
                        table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.bodyPathID);
                        break;
                    }

                    case Client.EquipPos.EquipPos_Weapon:
                    {
                        table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.weaponPath);
                        break;
                    }
                    }
                }
            }

            return(table_data);
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------------------------------------
        public static string GetModelPath(uint uSuitID, Client.EquipPos pos, byte profession, byte sex)
        {
            var modelPath  = "";
            var table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>(uSuitID);

            if (table_data == null)
            {
                int nSex = sex;
                // 根据职业、性别和部位去查找
                var database = table.SelectRoleDataBase.Where((GameCmd.enumProfession)profession, (GameCmd.enmCharSex)nSex);
                if (database != null)
                {
                    switch (pos)
                    {
                    case Client.EquipPos.EquipPos_Body:
                    {
                        var sult_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.bodyPathID);
                        if (sult_data != null)
                        {
                            table.ResourceDataBase db = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(sult_data.resid);
                            if (db != null)
                            {
                                modelPath = db.strPath;
                            }
                        }
                        break;
                    }

                    case Client.EquipPos.EquipPos_Weapon:
                    {
                        var sult_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.weaponPath);
                        if (sult_data != null)
                        {
                            table.ResourceDataBase db = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(sult_data.resid);
                            if (db != null)
                            {
                                modelPath = db.strPath;
                            }
                        }
                        break;
                    }
                    }
                }
            }
            else
            {
                table.ResourceDataBase db = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(table_data.resid);
                if (db != null)
                {
                    modelPath = db.strPath;
                }
            }

            return(modelPath);
        }
Exemplo n.º 3
0
        public static SuitInfo GetResPathBySuitID(uint uSuitID, Client.EquipPos pos, uint profession, uint sex, uint skillStatu)
        {
            SuitInfo info = new SuitInfo();

            info.pos = (SuitPos)pos;
            var table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>(uSuitID);

            if (table_data == null)
            {
                GameCmd.enmCharSex nSex = (GameCmd.enmCharSex)GameUtil.FaceToSex(sex);
                // 根据职业、性别和部位去查找
                var database = table.SelectRoleDataBase.Where((GameCmd.enumProfession)profession, (GameCmd.enmCharSex)nSex);
                if (database != null)
                {
                    switch (pos)
                    {
                    case Client.EquipPos.EquipPos_Body:
                    {
                        table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.bodyPathID);
                        break;
                    }

                    case Client.EquipPos.EquipPos_Weapon:
                    {
                        table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.weaponPath);
                        break;
                    }
                    }
                }
            }
            if (table_data == null)
            {
                return(info);
            }
            uint viewID = skillStatu == 0?table_data.viewresid:table_data.viewresid2;

            table.ResourceDataBase db = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(viewID); // 使用观察路径
            if (db != null)
            {
                info.modelPath   = db.strPath;
                info.locatorName = table_data.locator_name;
            }

            return(info);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取模型信息
        /// </summary>
        /// <param name="itemID"></param>
        /// <param name="pos">装备部位</param>
        /// <param name="profession">职业</param>
        /// <param name="faceID"></param>
        /// <param name="ifJudgeSex">是否需要职业</param>
        /// <returns></returns>
        public static string GetModelPath(ushort itemID, Client.EquipPos pos, byte profession, byte faceID, bool ifJudgeSex = true)
        {
            var modelPath = "";
            //var tbl = Table.Query<table.ItemDatabase>().FirstOrDefault(i => i.dwID == itemID);
            //if (tbl == null) return modelPath;
            var table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>(itemID);

            if (table_data == null)
            {
                int nSex = 1;
                if (ifJudgeSex)
                {
                    //modelPath = GameUtil.FaceToSex(faceID) == GameCmd.enmCharSex.MALE ? tbl.wdMaleModelSetID.ToString() : tbl.wdFemaleModelSetID.ToString();
                    nSex = (int)GameUtil.FaceToSex(faceID);
                }
                // 根据职业、性别和部位去查找
                var database = table.SelectRoleDataBase.Where((GameCmd.enumProfession)profession, (GameCmd.enmCharSex)nSex);
                if (database != null)
                {
                    //Engine.Utility.Log.Error("BuildPlayerPropList:job{0}或者sex{1}数据非法!", data.mapnpcdata.npcdata.job, data.mapnpcdata.npcdata.sex);
                    //return;
                    switch (pos)
                    {
                    case Client.EquipPos.EquipPos_Body:
                    {
                        var sult_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.bodyPathID);
                        if (sult_data != null)
                        {
                            table.ResourceDataBase db = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(sult_data.resid);
                            if (db != null)
                            {
                                modelPath = db.strPath;
                            }
                        }
                        break;
                    }

                    case Client.EquipPos.EquipPos_Weapon:
                    {
                        var sult_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.weaponPath);
                        if (sult_data != null)
                        {
                            table.ResourceDataBase db = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(sult_data.resid);
                            if (db != null)
                            {
                                modelPath = db.strPath;
                            }
                        }
                        break;
                    }
                    }
                }
            }
            else
            {
                table.ResourceDataBase db = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(table_data.resid);
                if (db != null)
                {
                    modelPath = db.strPath;
                }
            }

            return(modelPath);
        }