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); }
/** * @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); }