private void LoadMapConfig( ) { CXmlContainer xml = new CXmlContainer(); List <string> list = new List <string> (); if (xml.LoadXML("data/map_proto", "id", list)) { for (int i = 0; i < list.Count; i++) { tagInstanceProto item = new tagInstanceProto(); item.dwID = xml.GetInt("id", list[i], 0); item.chapterID = xml.GetInt("chapterID", list[i], 0); item.iEnterLevel = xml.GetInt("level", list[i], 0); item.iPosX = xml.GetInt("PosX", list[i], 0); item.iPosY = xml.GetInt("PosY", list[i], 0); item.strMapName = xml.GetString("name", list[i], ""); item.strIcon = xml.GetString("icon", list[i], ""); m_mapInstance.Add(item.dwID, item); } } // 整合数据 CaleChapter2Instance(); }
public void LoadItemConfig( ) { CXmlContainer xml = new CXmlContainer(); List <string> herolist = new List <string> (); if (xml.LoadXML("data/item_proto", "id", herolist)) { for (int i = 0; i < herolist.Count; i++) { tagItemProto item = new tagItemProto(); item.dwTypeID = xml.GetDword("id", herolist[i]); item.eType = (EItemType)xml.GetDword("type", herolist[i]); item.byLevel = xml.GetInt("level", herolist[i], 1); item.byQuality = (byte)xml.GetInt("quality", herolist[i], 0); item.nBasePrice = xml.GetInt("Price", herolist[i], 1); item.nMaxUseTimes = xml.GetInt("MaxUseTime", herolist[i], 1); item.nMaxLapNum = xml.GetInt("MaxLap", herolist[i], 1); item.eSpecFunc = (EItemSpecFunc)xml.GetInt("SpecFunction", herolist[i], 0); item.nSpecFuncVal1 = xml.GetInt("SpecValue1", herolist[i], 0); item.nSpecFuncVal2 = xml.GetInt("SpecValue2", herolist[i], 0); item.strIcon = xml.GetString("icon", herolist[i], ""); item.strName = xml.GetString("name", herolist[i], ""); item.strdesc = xml.GetString("desc", herolist[i], ""); m_mapItem.Add(item.dwTypeID, item); } } }
public void LoadQuestProto( ) { CXmlContainer xml = new CXmlContainer(); List <string> questlist = new List <string> (); if (xml.LoadXML("data/quest_proto", "id", questlist)) { for (int i = 0; i < questlist.Count; i++) { tagQuestProto quest = new tagQuestProto(); quest.id = xml.GetDword("id", questlist[i]); quest.type = (EQuestEvent)xml.GetInt("type", questlist[i], 0); quest.prev_quest_id = xml.GetDword("prev_quest", questlist[i]); quest.next_quest_id = xml.GetDword("next_quest", questlist[i]); quest.limit_time = xml.GetDword("limit_time", questlist[i]); quest.limit_level = xml.GetInt("limit_level", questlist[i], -1); quest.limit_class = xml.GetInt("limit_class", questlist[i], -1); quest.week = (EWeek)xml.GetInt("week", questlist[i], 0); int repeata = xml.GetInt("canrepeata", questlist[i], 0); quest.repeatable = Convert.ToBoolean(repeata); quest.accept_quest_npc = xml.GetDword("accept_npc", questlist[i]); quest.complete_quest_npc = xml.GetDword("complete_npc", questlist[i]); quest.accept_req_item[0] = xml.GetDword("accept_req_item1", questlist[i]); quest.accept_req_item_num[0] = xml.GetInt("accept_req_item_num1", questlist[i], 1); quest.accept_req_item[1] = xml.GetDword("accept_req_item2", questlist[i]); quest.accept_req_item_num[1] = xml.GetInt("accept_req_item_num2", questlist[i], 1); quest.accept_req_item[2] = xml.GetDword("accept_req_item3", questlist[i]); quest.accept_req_item_num[2] = xml.GetInt("accept_req_item_num3", questlist[i], 1); quest.complete_req_data[0] = xml.GetDword("complete_req_item1", questlist[i]); quest.complete_req_data_num[0] = xml.GetInt("complete_req_item_num1", questlist[i], 1); quest.complete_req_data[1] = xml.GetDword("complete_req_item2", questlist[i]); quest.complete_req_data_num[1] = xml.GetInt("complete_req_item_num2", questlist[i], 1); quest.complete_req_data[2] = xml.GetDword("complete_req_item3", questlist[i]); quest.complete_req_data_num[2] = xml.GetInt("complete_req_item_num3", questlist[i], 1); quest.rew_type = xml.GetInt("rew_type", questlist[i], 0); quest.rew_value = xml.GetInt("rew_value", questlist[i], 0); quest.rew_type2 = xml.GetInt("rew_type1", questlist[i], 0); quest.rew_value2 = xml.GetInt("rew_value1", questlist[i], 0); quest.rew_sel_type = xml.GetInt("rew_item_seltype", questlist[i], 0); quest.rew_item[0] = xml.GetDword("rew_item1", questlist[i]); quest.rew_item_num[0] = xml.GetInt("rew_item_num1", questlist[i], 1); quest.rew_item[1] = xml.GetDword("rew_item2", questlist[i]); quest.rew_item_num[1] = xml.GetInt("rew_item_num2", questlist[i], 1); quest.rew_item[2] = xml.GetDword("rew_item3", questlist[i]); quest.rew_item_num[2] = xml.GetInt("rew_item_num3", questlist[i], 1); m_QuestData.Add(quest.id, quest); } } }
// 对应任务的 quest_name.xml public void LoadQuestName( ) { CXmlContainer xml = new CXmlContainer(); List <string> questlist = new List <string> (); if (xml.LoadXML("data/quest_name", "id", questlist)) { for (int i = 0; i < questlist.Count; i++) { tagQuestText quest = new tagQuestText(); quest.id = xml.GetDword("id", questlist[i]); quest.name = xml.GetString("name", questlist[i]); quest.AcceptTalk = xml.GetString("AcceptTalk", questlist[i]); quest.CompleteTalk = xml.GetString("CompleteTalk", questlist[i]); m_QuestInfo.Add(quest.id, quest); } } }
private void LoadTeamLevelExp( ) { CXmlContainer xml = new CXmlContainer(); List <string> list = new List <string> (); if (xml.LoadXML("data/team_uplevel", "id", list)) { for (int i = 0; i < list.Count; i++) { tagTeamLevelEffect item = new tagTeamLevelEffect(); item.nLevel = xml.GetInt("id", list[i], 0); item.nExpLevelUp = xml.GetInt("ExpLevelUp", list[i], 0); item.nPhysique = xml.GetInt("Physique", list[i], 0); m_mapTeamUpExp.Add(item); } } }
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); } } }
private void LoadChapterConfig( ) { CXmlContainer xml = new CXmlContainer(); List <string> list = new List <string> (); if (xml.LoadXML("data/chapter_proto", "id", list)) { for (int i = 0; i < list.Count; i++) { tagChapterProto item = new tagChapterProto(); item.chapterID = xml.GetInt("id", list[i], 0); item.iEnterLevel = xml.GetInt("level", list[i], 0); item.strName = xml.GetString("name", list[i], ""); item.strBG = xml.GetString("icon", list[i], ""); m_mapChapter.Add(item.chapterID, item); } } }
public void LoadEquipConfig( ) { CXmlContainer xml = new CXmlContainer(); List <string> herolist = new List <string> (); if (xml.LoadXML("data/equip_proto", "id", herolist)) { for (int i = 0; i < herolist.Count; i++) { tagEquipProto item = new tagEquipProto(); item.dwTypeID = xml.GetDword("id", herolist[i]); item.eType = (EItemType)xml.GetDword("type", herolist[i]); item.byLevel = xml.GetInt("level", herolist[i], 1); item.byQuality = (byte)xml.GetInt("quality", herolist[i], 0); item.nBasePrice = xml.GetInt("Price", herolist[i], 1); item.dwSuitID = xml.GetDword("SuitID", herolist[i]); item.eEquipPos = (EEquipPos)xml.GetInt("EquipPos", herolist[i], 0); item.nMinDmg = xml.GetInt("WeaponMinDmg", herolist[i], 1); item.nMaxDmg = xml.GetInt("WeaponMaxDmg", herolist[i], 1); item.nRepairPrice = xml.GetInt("RepairPrice", herolist[i], 1); item.nHolePrice = xml.GetInt("HolePrice", herolist[i], 1); item.dwFormulaID = xml.GetDword("FormulaID", herolist[i]); item.dwDeFoemulaID = xml.GetDword("DeFoemulaID", herolist[i]); item.BaseEffect[0].eRoleAtt = (ERoleAttribute)xml.GetDword("AttType1", herolist[i]); item.BaseEffect[0].nValue = xml.GetInt("AttValue1", herolist[i], 1); item.BaseEffect[1].eRoleAtt = (ERoleAttribute)xml.GetDword("AttType2", herolist[i]); item.BaseEffect[1].nValue = xml.GetInt("AttValue2", herolist[i], 1); item.BaseEffect[2].eRoleAtt = (ERoleAttribute)xml.GetDword("AttType3", herolist[i]); item.BaseEffect[2].nValue = xml.GetInt("AttValue3", herolist[i], 1); item.strIcon = xml.GetString("icon", herolist[i], ""); item.strName = xml.GetString("name", herolist[i], ""); item.strdesc = xml.GetString("desc", herolist[i], ""); m_mapEquip.Add(item.dwTypeID, item); } } }
public void LoadHeroConfig( ) { CXmlContainer xml = new CXmlContainer(); List <string> herolist = new List <string> (); if (xml.LoadXML("data/hero_proto", "id", herolist)) { for (int i = 0; i < herolist.Count; i++) { tagHeroProto hero = new tagHeroProto(); hero.dwID = xml.GetDword("id", herolist[i]); hero.strName = xml.GetString("name", herolist[i], ""); hero.strDesc = xml.GetString("desc", herolist[i], ""); hero.strIcon = xml.GetString("icon", herolist[i], ""); hero.strModel = xml.GetString("model", herolist[i], ""); hero.dwSkill1 = xml.GetDword("normalskill1", herolist[i]); hero.dwSkill2 = xml.GetDword("normalskill2", herolist[i]); hero.dwSkill3 = xml.GetDword("normalskill3", herolist[i]); hero.dwSkill4 = xml.GetDword("normalskill4", herolist[i]); m_mapHero.Add(hero.dwID, hero); } } }
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); } } }
private void LoadLevelExp( ) { CXmlContainer xml = new CXmlContainer(); List <string> list = new List <string> (); if (xml.LoadXML("data/level_up", "id", list)) { for (int i = 0; i < list.Count; i++) { tagLevelUpEffect item = new tagLevelUpEffect(); item.nLevel = xml.GetInt("id", list[i], 0); item.nExpLevelUp = xml.GetInt("ExpLevelUp", list[i], 0); item.nRoleAtt[0] = xml.GetInt("Physique", list[i], 0); item.nRoleAtt[1] = xml.GetInt("Strength", list[i], 0); item.nRoleAtt[2] = xml.GetInt("Pneuma", list[i], 0); item.nRoleAtt[3] = xml.GetInt("InnerForce", list[i], 0); item.nRoleAtt[4] = xml.GetInt("Technique", list[i], 0); item.nMaxHP = xml.GetInt("HP", list[i], 0); item.nMaxMP = xml.GetInt("MP", list[i], 0); m_mapLevelExp.Add(item); } } }