Ejemplo n.º 1
0
        /**
         * @brief 提取数据
         *
         * @param node
         *
         * @return
         */
        public bool CollectDataFromDBC(DBC_Row node)
        {
            m_Id              = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
            m_Type            = DBCUtil.ExtractNumeric <int>(node, "Type", 0, true);
            m_IntroTime       = DBCUtil.ExtractNumeric <int>(node, "IntroTime", 0, true);
            m_ScenePath       = DBCUtil.ExtractString(node, "ScenePath", "", true);
            m_UnitFile        = DBCUtil.ExtractString(node, "UnitFile", "", true);
            m_ObstacleFile    = DBCUtil.ExtractString(node, "ObstacleFile", "", true);
            m_SceneLogicFile  = DBCUtil.ExtractString(node, "SceneLogicFile", "", true);
            m_BlockInfoFile   = DBCUtil.ExtractString(node, "BlockInfoFile", "", true);
            m_ClientSceneFile = DBCUtil.ExtractString(node, "ClientSceneFile", "", true);
            m_TiledDataScale  = DBCUtil.ExtractNumeric <float>(node, "TiledDataScale", 0, true);

            List <float> coords = DBCUtil.ExtractNumericList <float>(node, "ReachableSet", 0, false);

            if (coords.Count > 0)
            {
                m_ReachableSet = new Vector3[coords.Count / 2];
                for (int i = 0; i < coords.Count - 1; i += 2)
                {
                    m_ReachableSet[i / 2] = new Vector3(coords[i], 0, coords[i + 1]);
                }
            }
            else
            {
                m_ReachableSet = null;
            }
            return(true);
        }
Ejemplo n.º 2
0
        public bool CollectDataFromDBC(DBC_Row node)
        {
            m_ItemId       = DBCUtil.ExtractNumeric <int>(node, "ItemId", 0, true);
            m_ItemName     = DBCUtil.ExtractString(node, "ItemName", "", true);
            m_ItemTrueName = DBCUtil.ExtractString(node, "ItemTrueName", "", true);
            m_ItemType     = DBCUtil.ExtractString(node, "ItemType", "", true);
            m_IsLobbyItem  = DBCUtil.ExtractBool(node, "IsLobbyItem", false, true);
            m_Grade        = DBCUtil.ExtractNumeric <int>(node, "Grade", 0, true);
            m_UseLogicId   = DBCUtil.ExtractNumeric <int>(node, "UseLogicId", 0, true);
            List <string> strList = DBCUtil.ExtractStringList(node, "UseResultData", "", true);

            if (strList.Count > 0)
            {
                m_UseResultData = strList.ToArray();
            }
            List <int> list = DBCUtil.ExtractNumericList <int>(node, "AddBuffOnEquiping", 0, true);

            if (list.Count > 0)
            {
                m_AddBuffOnEquiping = list.ToArray();
            }
            list = DBCUtil.ExtractNumericList <int>(node, "AddSkillOnEquiping", 0, true);
            if (list.Count > 0)
            {
                m_AddSkillOnEquiping = list.ToArray();
            }
            m_ShowInShop = (0 != DBCUtil.ExtractNumeric <int>(node, "ShowInShop", 0, true));
            m_Model      = DBCUtil.ExtractString(node, "Model", "", true);
            m_UiModel    = DBCUtil.ExtractString(node, "UiModel", "", true);
            m_MaxStack   = DBCUtil.ExtractNumeric <int>(node, "MaxStack", 1, true);
            list         = DBCUtil.ExtractNumericList <int>(node, "ConsumeItems", 0, true);
            if (list.Count > 0)
            {
                m_ConsumeItems = list.ToArray();
            }
            else
            {
                m_ConsumeItems = new int[] { 0, 0, 0 };
            }
            m_ConsumeMoney = DBCUtil.ExtractNumeric <int>(node, "ConsumeMoney", 0, true);
            list           = DBCUtil.ExtractNumericList <int>(node, "PropertyRank", 0, true);
            if (list.Count > 0)
            {
                m_PropertyRank = list.ToArray();
            }
            else
            {
                m_PropertyRank = new int[] { 0, 0, 0, 0, 0 };
            }
            m_AddExp          = DBCUtil.ExtractNumeric <int>(node, "AddExp", 0, true);
            m_AddMoney        = DBCUtil.ExtractNumeric <int>(node, "AddMoney", 0, true);
            m_AddBuff         = DBCUtil.ExtractNumeric <int>(node, "AddBuffer", 0, true);
            m_Introduce       = DBCUtil.ExtractString(node, "Introduce", "", true);
            m_ItemSkillFirst  = DBCUtil.ExtractNumeric <int>(node, "ItemSkillFirst", 0, true);
            m_ItemSkillSecond = DBCUtil.ExtractNumeric <int>(node, "ItemSkillSecond", 0, true);
            m_ItemSkillThird  = DBCUtil.ExtractNumeric <int>(node, "ItemSkillThird", 0, true);
            m_NormalIcon      = DBCUtil.ExtractString(node, "NormalIcon", "", true);
            m_BigIcon         = DBCUtil.ExtractString(node, "BigIcon", "", true);
            m_AttrData.CollectDataFromDBC(node);
            return(true);
        }
Ejemplo n.º 3
0
        /**
         * @brief 提取数据
         *
         * @param node
         *
         * @return
         */
        public bool CollectDataFromDBC(DBC_Row node)
        {
            m_Id      = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
            m_Name    = DBCUtil.ExtractString(node, "Name", "", true);
            m_NpcType = DBCUtil.ExtractNumeric <int>(node, "NpcType", 0, true);
            m_Level   = DBCUtil.ExtractNumeric <int>(node, "Level", 0, true);
            m_Scale   = DBCUtil.ExtractNumeric <float>(node, "Scale", 1.0f, true);

            m_DropCount = DBCUtil.ExtractNumeric <int>(node, "DropCount", 0, false);
            m_DropExp   = DBCUtil.ExtractNumeric <int>(node, "DropExp", 0, false);
            m_DropMoney = DBCUtil.ExtractNumeric <int>(node, "DropMoney", 0, false);

            List <int> list = DBCUtil.ExtractNumericList <int>(node, "DropProbabilities", 0, false);

            if (list.Count > 0)
            {
                m_DropProbabilities = list.ToArray();
            }

            list = DBCUtil.ExtractNumericList <int>(node, "DropNpcs", 0, false);
            if (list.Count > 0)
            {
                m_DropNpcs = list.ToArray();
            }

            list = DBCUtil.ExtractNumericList <int>(node, "InteractSourceActions", 0, false);
            if (list.Count > 0)
            {
                m_InteractSourceActions = list.ToArray();
            }
            else
            {
                m_InteractSourceActions = new int[] { 0, 0 };
            }

            list = DBCUtil.ExtractNumericList <int>(node, "InteractTargetActions", 0, false);
            if (list.Count > 0)
            {
                m_InteractTargetActions = list.ToArray();
            }
            else
            {
                m_InteractTargetActions = new int[] { 0, 0 };
            }

            m_InteractionLogic = DBCUtil.ExtractNumeric <int>(node, "InteractionLogic", 0, false);
            List <string> strList = DBCUtil.ExtractStringList(node, "InteractResultData", "", false);

            if (strList.Count > 0)
            {
                m_InteractResultData = strList.ToArray();
            }

            m_AttrData.CollectDataFromDBC(node);
            m_ViewRange   = DBCUtil.ExtractNumeric <float>(node, "ViewRange", -1, true);
            m_GohomeRange = DBCUtil.ExtractNumeric <float>(node, "GohomeRange", -1, true);
            m_ReleaseTime = DBCUtil.ExtractNumeric <long>(node, "ReleaseTime", 0, true);
            m_HeadUiPos   = DBCUtil.ExtractNumeric <int>(node, "HeadUiPos", 0, true);

            m_SkillList  = DBCUtil.ExtractNumericList <int>(node, "SkillList", 0, false);
            m_ActionList = DBCUtil.ExtractNumericList <int>(node, "ActionId", 0, false);

            m_Model       = DBCUtil.ExtractString(node, "Model", "", false);
            m_DeathModel  = DBCUtil.ExtractString(node, "DeathModel", "", false);
            m_DeathEffect = DBCUtil.ExtractString(node, "DeathEffect", "", false);
            m_DeathSound  = DBCUtil.ExtractString(node, "DeathSound", "", false);
            m_DeadType    = DBCUtil.ExtractNumeric <int>(node, "DeadType", 0, false);
            m_Barrage     = DBCUtil.ExtractNumeric <int>(node, "Barrage", 0, false);

            m_AvoidanceRadius = DBCUtil.ExtractNumeric <int>(node, "AvoidanceRadius", 1, false);
            m_CanMove         = DBCUtil.ExtractBool(node, "CanMove", false, false);
            m_CanRotate       = DBCUtil.ExtractBool(node, "CanRotate", true, false);
            m_IsRange         = DBCUtil.ExtractBool(node, "IsRange", false, false);
            m_IsShine         = DBCUtil.ExtractBool(node, "IsShine", false, false);
            m_isBlaze         = DBCUtil.ExtractBool(node, "IsBlaze", false, false);
            m_IsHurtComa      = DBCUtil.ExtractBool(node, "IsHurtComa", false, false);

            m_BornTimeMs        = DBCUtil.ExtractNumeric <int>(node, "BornTimeMs", 0, false);
            m_BornEffect        = DBCUtil.ExtractString(node, "BornEffect", "", false);
            m_IsAttachControler = DBCUtil.ExtractBool(node, "IsAttachControler", false, false);
            m_AttachNodeName    = DBCUtil.ExtractString(node, "AttachNodeName", "", false);

            m_GunEndRelativePos = Converter.ConvertVector3D(DBCUtil.ExtractString(node, "GunEndRelativePos", "0.0,0.0,0.0", false));

            m_WeaponList = DBCUtil.ExtractNumericList <int>(node, "WeaponId", 0, false);

            string shapeType     = DBCUtil.ExtractString(node, "ShapeType", "", true);
            int    shapeParamNum = DBCUtil.ExtractNumeric <int>(node, "ShapeParamNum", 0, true);

            if (shapeParamNum > 0)
            {
                string[] shapeParams = new string[shapeParamNum];
                for (int i = 0; i < shapeParamNum; ++i)
                {
                    shapeParams[i] = DBCUtil.ExtractString(node, "ShapeParam" + i, "", false);
                }

                if (0 == string.Compare("Circle", shapeType, true))
                {
                    m_Shape = new Circle(new Vector3(0, 0, 0), float.Parse(shapeParams[0]));
                }
                else if (0 == string.Compare("Line", shapeType, true))
                {
                    Vector3 start = Converter.ConvertVector3D(shapeParams[0]);
                    Vector3 end   = Converter.ConvertVector3D(shapeParams[1]);
                    m_Shape = new Line(start, end);
                }
                else if (0 == string.Compare("Rect", shapeType, true))
                {
                    float width  = float.Parse(shapeParams[0]);
                    float height = float.Parse(shapeParams[1]);
                    m_Shape = new Rect(width, height);
                }
                else if (0 == string.Compare("Polygon", shapeType, true))
                {
                    Polygon polygon = new Polygon();
                    foreach (string s in shapeParams)
                    {
                        Vector3 pt = Converter.ConvertVector3D(s);
                        polygon.AddVertex(pt);
                    }
                    m_Shape = polygon;
                }
            }

            return(true);
        }
Ejemplo n.º 4
0
        /**
         * @brief 提取数据
         *
         * @param node
         *
         * @return
         */
        public bool CollectDataFromDBC(DBC_Row node)
        {
            m_Id      = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
            m_Name    = DBCUtil.ExtractString(node, "Name", "", true);
            m_Scale   = DBCUtil.ExtractNumeric <float>(node, "Scale", 1.0f, true);
            m_AiLogic = DBCUtil.ExtractNumeric <int>(node, "AiLogic", 0, false);

            m_AttrData.CollectDataFromDBC(node);
            m_ViewRange           = DBCUtil.ExtractNumeric <float>(node, "ViewRange", -1, true);
            m_ReleaseTime         = DBCUtil.ExtractNumeric <long>(node, "ReleaseTime", 0, false);
            m_HeadUiPos           = DBCUtil.ExtractNumeric <int>(node, "HeadUiPos", 0, false);
            m_CostType            = DBCUtil.ExtractNumeric <int>(node, "CostType", 0, false);
            m_ShootBuffLifeTime   = DBCUtil.ExtractNumeric <float>(node, "ShootBuffLifeTime", 1.0f, false);
            m_NoGunRunEnterTimeMs = DBCUtil.ExtractNumeric <long>(node, "NoGunRunEnterTimeMs", 2000, false);

            m_SkillList_1 = DBCUtil.ExtractNumericList <int>(node, "Skill_1", 0, false);
            m_SkillList_2 = DBCUtil.ExtractNumericList <int>(node, "Skill_2", 0, false);
            m_SkillList_3 = DBCUtil.ExtractNumericList <int>(node, "Skill_3", 0, false);
            m_SkillList_4 = DBCUtil.ExtractNumericList <int>(node, "Skill_4", 0, false);
            m_SkillList_5 = DBCUtil.ExtractNumericList <int>(node, "Skill_5", 0, false);
            m_SkillList_6 = DBCUtil.ExtractNumericList <int>(node, "Skill_6", 0, false);

            m_RollSkill = DBCUtil.ExtractNumeric <int>(node, "RollSkill", 0, false);

            m_WeaponList = DBCUtil.ExtractNumericList <int>(node, "WeaponList", 0, false);
            m_ActionList = DBCUtil.ExtractNumericList <int>(node, "ActionId", 0, false);

            m_Model      = DBCUtil.ExtractString(node, "Model", "", false);
            m_DeathModel = DBCUtil.ExtractString(node, "DeathModel", "", false);
            m_ActionFile = DBCUtil.ExtractString(node, "ActionFile", "", false);
            m_AnimPath   = DBCUtil.ExtractString(node, "AnimPath", "", false);

            m_Radius            = DBCUtil.ExtractNumeric <float>(node, "Radius", 1.0f, false);
            m_AvoidanceRadius   = DBCUtil.ExtractNumeric <int>(node, "AvoidanceRadius", 1, false);
            m_GunEndRelativePos = Converter.ConvertVector3D(DBCUtil.ExtractString(node, "GunEndRelativePos", "0.0,0.0,0.0", false));

            List <int> list = DBCUtil.ExtractNumericList <int>(node, "RecommendEquipment", 0, false);

            if (list.Count == 6)
            {
                m_RecommendEquipment = list.ToArray();
            }
            else
            {
                m_RecommendEquipment = new int[] { 0, 0, 0, 0, 0, 0 };
            }

            list = DBCUtil.ExtractNumericList <int>(node, "AiEquipment", 0, false);
            if (list.Count == 6)
            {
                m_AiEquipment = list.ToArray();
            }
            else
            {
                m_AiEquipment = new int[] { 0, 0, 0, 0, 0, 0 }
            };
            list = DBCUtil.ExtractNumericList <int>(node, "AiAttackSkill", 0, false);
            if (list.Count > 0)
            {
                m_AiAttackSkill = list.ToArray();
            }
            list = DBCUtil.ExtractNumericList <int>(node, "AiMoveSkill", 0, false);
            if (list.Count > 0)
            {
                m_AiMoveSkill = list.ToArray();
            }
            list = DBCUtil.ExtractNumericList <int>(node, "AiControlSkill", 0, false);
            if (list.Count > 0)
            {
                m_AiControlSkill = list.ToArray();
            }
            list = DBCUtil.ExtractNumericList <int>(node, "AiSelfAssitSkill", 0, false);
            if (list.Count > 0)
            {
                m_AiSelfAssitSkill = list.ToArray();
            }
            list = DBCUtil.ExtractNumericList <int>(node, "AiTeamAssitSkill", 0, false);
            if (list.Count > 0)
            {
                m_AiTeamAssitSkill = list.ToArray();
            }

            return(true);
        }