private void LoadNpcPos( ) { CXmlContainer xml = new CXmlContainer(); List <string> list = new List <string> (); if (xml.LoadXML("data/npc_pos", "id", list)) { for (int i = 0; i < list.Count; i++) { tagNpcMapPos item = new tagNpcMapPos(); item.dwNpcID = xml.GetDword("id", list[i]); item.fPosX = xml.GetFloat("PosX", list[i], 0.0f); item.fPosY = xml.GetFloat("PosY", list[i], 0.0f); item.fPosZ = xml.GetFloat("PosZ", list[i], 0.0f); m_mapNPCPos.Add(item.dwNpcID, item); } } }
private void LoadEntityConfig() { CXmlContainer xml = new CXmlContainer(); List <string> herolist = new List <string> (); if (xml.LoadXML("data/entity_proto", "id", herolist)) { for (int i = 0; i < herolist.Count; i++) { tagEntityProto item = new tagEntityProto(); item.nBaseAtt = new int[5]; item.dwTypeID = xml.GetDword("id", herolist[i]); item.eType = (ECreatureType)xml.GetInt("type", herolist[i], 0); item.szName = xml.GetString("name", herolist[i], ""); item.szIcon = xml.GetString("Icon", herolist[i], ""); item.szModelName = xml.GetString("model", herolist[i], ""); item.nLevel = xml.GetInt("Level", herolist[i], 1); item.bCanAttack = xml.GetInt("CanAtk", herolist[i], 1) == 1 ? true : false; item.bCanBeAttack = xml.GetInt("CanBeAtk", herolist[i], 1) == 1 ? true : false; item.nRespawnTime = xml.GetInt("spawnTime", herolist[i], 1); item.nLiveTime = xml.GetInt("LiveTime", herolist[i], 0); item.nExpGive = xml.GetInt("exp", herolist[i], 1); item.dwLootID = xml.GetDword("LootID", herolist[i]); item.dwNormalSkill = xml.GetDword("normalskill1", herolist[i]); item.dwLongDisSkill = xml.GetDword("normalskill2", herolist[i]); item.fLookdistance = xml.GetFloat("Lookdist", herolist[i], 1); item.nPatrolRadius = xml.GetFloat("Patroldist", herolist[i], 1); //----------------------------------------------------------------------- // 怪物的一级属性 item.nBaseAtt[0] = xml.GetInt("Physique", herolist[i], 0); item.nBaseAtt[1] = xml.GetInt("Strength", herolist[i], 0); item.nBaseAtt[2] = xml.GetInt("Pneuma", herolist[i], 0); item.nBaseAtt[3] = xml.GetInt("InnerForce", herolist[i], 0); item.nBaseAtt[4] = xml.GetInt("Agility", herolist[i], 0); m_mapEntity.Add(item.dwTypeID, item); } } }
public void LoadSkillConfig( ) { CXmlContainer xml = new CXmlContainer(); List <string> herolist = new List <string> (); if (xml.LoadXML("data/skill_proto", "id", herolist)) { for (int i = 0; i < herolist.Count; i++) { tagSkillProto skill = new tagSkillProto(); skill.dwID = xml.GetDword("id", herolist[i]); skill.eType = (ESkillType)xml.GetInt("type", herolist[i], 0); skill.eUseType = (ESkillUseType)xml.GetInt("usetype", herolist[i], 0); skill.ePriority = (SkillPriority)xml.GetInt("Priority", herolist[i], 0); skill.eDmgType = (ESkillDmgType)xml.GetInt("Dmgtype", herolist[i], 0); skill.eCostType = (ESkillCostType)xml.GetInt("CostType", herolist[i], 0); skill.eFingerType = (ESKILLFINGERTYPE)xml.GetInt("FingerType", herolist[i], 0); skill.strIcon = xml.GetString("icon", herolist[i], ""); skill.strName = xml.GetString("name", herolist[i], ""); skill.strPrefabFile = xml.GetString("prefab", herolist[i], ""); skill.strdesc = xml.GetString("desc", herolist[i], ""); skill.ActID = xml.GetInt("ActMode", herolist[i], 0); skill.nDmgValues = xml.GetInt("DmgValue", herolist[i], 1); skill.nCostValue = xml.GetInt("CostValue", herolist[i], 0); skill.fOPDist = xml.GetFloat("distance", herolist[i], 0); skill.fOPRadius = xml.GetFloat("radius", herolist[i], 0); skill.nCoolDown = xml.GetInt("CoolDown", herolist[i], 1000); m_mapSkill.Add(skill.dwID, skill); } } }