void UpdateCharActionSetFile() { m_pCharActionSetFile = null; if (m_pBusData != null) { int nCharModelID = m_pBusData.m_nModelID; DBC.COMMON_DBC <_DBC_CHARACTER_MODEL> s_pCharModelDBC = CDataBaseSystem.Instance.GetDataBase <_DBC_CHARACTER_MODEL>((int)DataBaseStruct.DBC_CHARACTER_MODEL); if (nCharModelID != MacroDefine.INVALID_ID) { _DBC_CHARACTER_MODEL pCharModel = s_pCharModelDBC.Search_Index_EQU(m_pBusData.m_nModelID); if (pCharModel != null) { string pszActionSetFileName = pCharModel.m_pszActionSetName_None; if (pszActionSetFileName.Length > 0) { m_pCharActionSetFile = CActionSetMgr.Instance.GetActionSetFile(pszActionSetFileName); } } } } }
public void Init() { allLayouts = CDataBaseSystem.Instance.GetDataBase <_DBC_UI_LAYOUTDEFINE>((int)DataBaseStruct.DBC_UI_LAYOUTDEFINE); if (allLayouts == null || allLayouts.StructDict.Count == 0) { LogManager.LogWarning("layouts is empty!"); return; } foreach (_DBC_UI_LAYOUTDEFINE layout in allLayouts.StructDict.Values) { if (layout.downImmediately == 1) { needDownList.Add(layout); } } _DBC_UI_LAYOUTDEFINE common = allLayouts.Search_Index_EQU(0); ResourceManager.Me.DownloadAsync(UIWindowItem.UIRoot + common.szLayout, null, CommonWindowDownload); _DBC_UI_LAYOUTDEFINE fonts = allLayouts.Search_Index_EQU(2); ResourceManager.Me.DownloadAsync(UIWindowItem.UIRoot + fonts.szLayout, null, FontsDownload); // 这里是为了初始化Icon管理器 [2/17/2012 Ivan] _DBC_UI_LAYOUTDEFINE icon = allLayouts.Search_Index_EQU(1); IconManager.Instance.Init(UIWindowItem.UIRoot + icon.szLayout); }
private void InitialAllDialogue() { dialogues = DBSystem.CDataBaseSystem.Instance.GetDataBase <_DBC_Dialogue>((int)DataBaseStruct.DBC_DIALOGUE); if (dialogues == null) { LogManager.LogWarning("剧情对白配置表为空,path:Private/system/JuQingDialog.txt"); } }
private EncodeUtility() { gb2Unicode = CDataBaseSystem.Instance.GetDataBase <EncodeBase>((int)DataBaseStruct.DBC_CODE_GB2UNI); foreach (EncodeBase code in gb2Unicode.StructDict.Values) { uni2gbTable.Add(code.tarCode, code.orgCode); } }
public void Init() { ClearOld(); DBC.COMMON_DBC <_DBC_RANDOM_NAME> allNames = CDataBaseSystem.Instance.GetDataBase <_DBC_RANDOM_NAME>((int)DataBaseStruct.DBC_RANDOM_NAME); foreach (_DBC_RANDOM_NAME item in allNames.StructDict.Values) { if (item.surname != null && item.surname != "") { surnames.Add(item.surname); } if (item.personalName != null && item.personalName != "") { if (item.sex == 1) { if (item.repeat == 1) { repeatNameM.Add(item.personalName); } else { noRepeatNameM.Add(item.personalName); } } else if (item.sex == 0) { if (item.repeat == 1) { repeatNameF.Add(item.personalName); } else { noRepeatNameF.Add(item.personalName); } } else { if (item.repeat == 1) { repeatNameF.Add(item.personalName); repeatNameM.Add(item.personalName); } else { noRepeatNameF.Add(item.personalName); noRepeatNameM.Add(item.personalName); } } } } }
// 心法特殊描述 [5/9/2012 SUN] public string GetDesc1() { SCLIENT_SKILL pSkill = GetSkillImpl() as SCLIENT_SKILL; if (pSkill != null) { SCLIENT_SKILLCLASS pXinfa = CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_SkillClass(pSkill.m_pDefine.m_nSkillClass); DBC.COMMON_DBC <_DBC_XINFA_SKILL_DATA> dbc = CDataBaseSystem.Instance.GetDataBase <_DBC_XINFA_SKILL_DATA>((int)DataBaseStruct.DBC_XINFA_SKILL_DATA); _DBC_XINFA_SKILL_DATA define = dbc.Search_Index_EQU(pXinfa.m_pDefine.nID); int nMenPai = CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_MenPai(); int nStepValue = define.nMenPaiValue[nMenPai] / 100; int curValue = pXinfa.m_nLevel * nStepValue; return(string.Format(pSkill.GetSkillDesc(), nStepValue, curValue)); } return(""); }
private void UpdateFaces() { DBC.COMMON_DBC <_DBC_CHAR_FACE> dbs = CDataBaseSystem.Instance.GetDataBase <_DBC_CHAR_FACE>( (int)DataBaseStruct.DBC_CHAR_FACE); if (dbs != null) { int addNum = (1 - GameProcedure.s_ProcCharCreate.Sex) * GamePro_CharCreate.MaxMaleCount; for (int i = 0; i < 9; i++) { _DBC_CHAR_FACE item = dbs.Search_Index_EQU(i + 1 + addNum);// 配置表从1开始计数 [3/30/2012 Ivan] if (item != null) { faceBtns[i].SetTexture(IconManager.Instance.GetIcon(item.pImageSetName)); } } } }
void InitialAllWindow() { DBC.COMMON_DBC <_DBC_FUNC_OPEN_LIST> allList = DBSystem.CDataBaseSystem.Instance.GetDataBase <_DBC_FUNC_OPEN_LIST> ((int)DataBaseStruct.DBC_FUNC_OPEN_LIST); funcList = new List <_DBC_FUNC_OPEN_LIST>(); uiGoList = new GameObject[allList.StructDict.Values.Count]; int i = 0; foreach (_DBC_FUNC_OPEN_LIST func in allList.StructDict.Values) { GameObject go = GameObject.Find(func.uiName); funcList.Add(func); uiGoList[i++] = go; } RegistConditions(); }
public override void UpdateCharRace() { m_pCharRace = null; CCharacterData pCharacterData = GetCharacterData(); if (pCharacterData != null && pCharacterData.Get_RaceID() != MacroDefine.INVALID_ID) { DBC.COMMON_DBC <_DBC_CHAR_RACE> raceDBC = CDataBaseSystem.Instance.GetDataBase <_DBC_CHAR_RACE>((int)DataBaseStruct.DBC_CHAR_RACE); if (raceDBC != null) { m_pCharRace = raceDBC.Search_Index_EQU(pCharacterData.Get_RaceID()); if (m_pCharRace != null) { LogManager.Log("Race ID:" + pCharacterData.Get_RaceID().ToString() + "Model ID:" + m_pCharRace.nModelID.ToString()); } } } }
public void Initial() { DBC.COMMON_DBC <_DBC_ACTIVITY_INFO> activityDBC = CDataBaseSystem.Instance.GetDataBase <_DBC_ACTIVITY_INFO>((int)DataBaseStruct.DBC_ACTIVITY_INFO); int nCount = activityDBC.StructDict.Count; for (int i = 0; i < nCount; i++) { _DBC_ACTIVITY_INFO info = activityDBC.Search_Index_EQU(i); //按照类型区分活动 if (s_ActivityDBC.ContainsKey(info.nActivityType)) { s_ActivityDBC[info.nActivityType].Add(info); } else { List <_DBC_ACTIVITY_INFO> infoList = new List <_DBC_ACTIVITY_INFO>(); infoList.Add(info); s_ActivityDBC.Add(info.nActivityType, infoList); } } }
void InitSceneTransportData() { // 初始化传送点数据 [8/3/2011 ivan edit] if (!alreadyLoad) { DBC.COMMON_DBC <_DBC_SCENE_POS_DEFINE> allPos = CDataBaseSystem.Instance.GetDataBase <_DBC_SCENE_POS_DEFINE>((int)DataBaseStruct.DBC_SCENE_POS_DEFINE); SceneTransportPath.Instance.Initailize(allPos.StructDict.Count * 2 + 1, GAMEDEFINE.MAX_SCENE); foreach (_DBC_SCENE_POS_DEFINE scene in allPos.StructDict.Values) { SceneTransferData data = new SceneTransferData(); data.nSceneID = scene.nSceneID; data.xPos = scene.nXPos; data.yPos = scene.nZPos; data.nDestSceneID = scene.nDestSceneID; SceneTransportPath.Instance.AddSceneTransData(data); } alreadyLoad = true; } }
void CreateRenderInterface() { if (m_pBusData != null && m_pBusData.m_nModelID != MacroDefine.INVALID_ID) { DBC.COMMON_DBC <_DBC_CHARACTER_MODEL> s_pCharModelDBC = CDataBaseSystem.Instance.GetDataBase <_DBC_CHARACTER_MODEL>((int)DataBaseStruct.DBC_CHARACTER_MODEL); string lpszModelFileName = null; _DBC_CHARACTER_MODEL pCharModel = s_pCharModelDBC.Search_Index_EQU(m_pBusData.m_nModelID); if (pCharModel != null) { lpszModelFileName = pCharModel.m_pszModelName; } if (lpszModelFileName != null) { mRenderInterface = GFX.GFXObjectManager.Instance.createObject(lpszModelFileName, GFX.GFXObjectType.ACTOR); mRenderInterface.useTempAsset();//资源未加载完全时使用临时模型 mRenderInterface.SetData(ID); //mRenderInterface.Actor_SetFile(lpszModelFileName); setVisible(isVisible()); mRenderInterface.SetRayQuery(false); mRenderInterface.SetAnimationEndEvent(new GFX.OnAnimationEvent(OnAnimationEnd)); UpdatePassengerAttached(); UpdateCharActionSetFile(); SetPosition(GetPosition()); SetFaceDir(GetFaceDir()); setVisible(isVisible()); } } }
void UpdateData() { if (m_pBusData != null && m_pBusData.m_nDataID == m_nDataID) { return; } ReleaseRenderInterface(); m_pBusData = null; if (m_nDataID != MacroDefine.INVALID_ID) { DBC.COMMON_DBC <_BUS_INFO> allBus = CDataBaseSystem.Instance.GetDataBase <_BUS_INFO>((int)DataBaseStruct.DBC_BUS_INFO); if (allBus == null) { LogManager.LogError("无法找到Bus配置表。"); return; } m_pBusData = allBus.Search_Index_EQU(m_nDataID); } CreateRenderInterface(); }
//VOID ParserString_Runtime(const STRING& strSource, CEGUI::String& strOut); //STRING ParserString_VarParam(const STRING& strID, va_list ptr); //VOID ParserString_NoColor(const STRING& strSrc, STRING&strOut, BOOL bControl = FALSE); //STRING ParserString_NoVarParam(const STRING& strID); //// 转换字符串,使其回到parserstring_runtime之前,现在只支持部分标志 [4/18/2011 Sun] //VOID RollBackParseredString(const CEGUI::String& strSource, STRING& strOut); //// 去掉字符串中的各种特殊标记 [6/20/2011 Sun] //VOID ParserString_IgnoreParam(const STRING& strSource, STRING& strOut, BOOL bIgnoreFace = FALSE); ////聊天模板字串的取得 //STRING getTalkTemplate(const STRING& strKey, UINT index); //STRING ModifyChatTemplate(const STRING& strSrc, const STRING& strTalker, const STRING& strTarget); //STRING getTalkRandHelpMsg(); ////初始化 public void Init() { //---------------------------------------------------- //字符串字典 DBC.COMMON_DBC <_DBC_STRING_DICT> dicDBC = CDataBaseSystem.Instance.GetDataBase <_DBC_STRING_DICT>((int)DataBaseStruct.DBC_STRING_DICT); DBC.COMMON_DBC <_DBC_NPC_MISSION> NPCMission = CDataBaseSystem.Instance.GetDataBase <_DBC_NPC_MISSION>((int)DataBaseStruct.DBC_NPC_MISSION); foreach (_DBC_STRING_DICT item in dicDBC.StructDict.Values) { orginalDirectionary[item.szKey] = item.szString; } //系统关键字 //m_theDirectionary[UKS_PLAYERNAME] = //--------------------------------- //字符串字典id转化 // 由于在foreach里面修改directionary会出错,所以拷贝一份 [2/20/2012 Ivan] foreach (KeyValuePair <string, string> kv in orginalDirectionary) { string strOut; ParserString_Prebuild(kv.Value, out strOut); m_theDirectionary[kv.Key] = strOut; } foreach (KeyValuePair <int, _DBC_NPC_MISSION> itemNPC in NPCMission.StructDict) { NPCMissionDictionary[itemNPC.Key.ToString()] = itemNPC.Value.m_DefaultDialog; } orginalDirectionary = null; //------------------------------------------------ //聊天模板创建 //GenerateTalkTemplateTable(); // 表情映射 //加载所有ui // const tDataBase* pDBC = pUIDBC->GetDataBase(DBC_CODE_CONVERT); // for(INT i=0; i<(INT)pDBC->GetRecordsNum(); i++) // { // const _DBC_CODE_CONVERT* pLine = (const _DBC_CODE_CONVERT*)((tDataBase*)pDBC)->Search_LineNum_EQU(i); // CEGUI::utf32 dwValue = 0; // sscanf( pLine->szCode, "%8X", &dwValue ); // m_mapCodeConvertTable[ pLine->nID ] = dwValue ; // } //------------------------------------------------ // 过滤词数组构造 // const tDataBase* pDBCfl = pUIDBC->GetDataBase(DBC_TALK_FILTER); // for(INT i=0; i<(INT)pDBCfl->GetRecordsNum(); i++) // { // const _DBC_TALK_FILTER* pLine = (const _DBC_TALK_FILTER*)((tDataBase*)pDBCfl)->Search_LineNum_EQU(i); // m_vecFilterTable.push_back(pLine->szString); // } //------------------------------------------------ // 完全匹配过滤表构造 //GenerateFullCompareTable(); }
protected void UpdateEquip(HUMAN_EQUIP point) { CCharacterData pCharacterData = GetCharacterData(); if (pCharacterData == null) { return; } //生成一个临时的Item对象 int nID = pCharacterData.Get_Equip(point); // CObject_Item_Equip pTempEquip = null; // // if(nID != MacroDefine.INVALID_ID) // { // pTempEquip = (CObject_Item_Equip)CObject_Item.NewItem(nID); // visualID = pTempEquip.GetVisualID(); // } //因为和物品相关的代码还没有完成,暂时直接访问数据库 [1/4/2012 ZZY] DBC.COMMON_DBC <_DBC_ITEM_EQUIP_BASE> equipBaseDBC = CDataBaseSystem.Instance.GetDataBase <_DBC_ITEM_EQUIP_BASE>((int)DataBaseStruct.DBC_ITEM_EQUIP_BASE); _DBC_ITEM_EQUIP_BASE pEquip = equipBaseDBC.Search_Index_EQU(nID); //如果是装备根据装配点装备物品 bool result = false; if (/*pTempEquip != null && ITEM_CLASS.ICLASS_EQUIP == pTempEquip.GetItemClass()*/ pEquip != null && pEquip.nVisualID != MacroDefine.INVALID_ID) { if (point == HUMAN_EQUIP.HEQUIP_WEAPON) { if (m_bHideWeapon == true && mRenderInterface != null) //如果当前正隐藏武器,那么不装备武器 [2012/4/18 ZZY] { mRenderInterface.changeRightWeapon(""); mRenderInterface.changeLeftWeapon(""); SetWeaponType(ENUM_WEAPON_TYPE.WEAPON_TYPE_NONE); } else { result = EquipItem_BodyLocator(/*pTempEquip.GetItemType()*/ point, pEquip.nVisualID); SetWeaponType((ENUM_WEAPON_TYPE)pEquip.nType); } } else { result = EquipItem_BodyPart(point, pEquip.nVisualID); } } else { //卸载装备 UnEquipItem(point); } // [5/6/2011 ivan edit] if (result == false) { UnEquipItem(point); } //CObject_Item.DestroyItem(pTempEquip); }
// 能否可以开采资源 public bool Resource_CanOperation() { if (m_pResourceDef == null) { return(false); } SCLIENT_LIFEABILITY pSclientAbilityDef = (CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_LifeAbility(m_pResourceDef.nLifeAbility)); if (pSclientAbilityDef == null) { _DBC_LIFEABILITY_DEFINE pAbilityDef = DBSystem.CDataBaseSystem.Instance.GetDataBase <_DBC_LIFEABILITY_DEFINE>((int)DataBaseStruct.DBC_LIFEABILITY_DEFINE).Search_Index_EQU(m_pResourceDef.nLifeAbility); if (pAbilityDef == null) { return(false); } string szMsg = "Ability_Requiement" + pAbilityDef.szName; GameProcedure.s_pEventSystem.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, szMsg); return(false); } int my_level = CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Level(); if (my_level < pSclientAbilityDef.m_pDefine.nLevelNeed) { GameProcedure.s_pEventSystem.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, "等级不够"); return(false); } int idNeedFacility = pSclientAbilityDef.m_pDefine.nToolNeed; if (idNeedFacility >= 0) { bool bHaveTool = false; CObject_Item Facility; Facility = CDataPool.Instance.UserEquip_GetItem(HUMAN_EQUIP.HEQUIP_WEAPON); if (Facility == null || idNeedFacility != Facility.GetParticularID()) { for (int i = 0; i < GAMEDEFINE.MAX_BAG_SIZE; i++) { if ((Facility = CDataPool.Instance.UserBag_GetItem(i)) != null) { if (idNeedFacility == Facility.GetParticularID()) { bHaveTool = true; break; } } } string szTemp = ""; //从资源表中去查找工具名称 DBC.COMMON_DBC <_DBC_ITEM_EQUIP_BASE> equipBaseDBC = DBSystem.CDataBaseSystem.Instance.GetDataBase <_DBC_ITEM_EQUIP_BASE>((int)DataBaseStruct.DBC_ITEM_EQUIP_BASE); _DBC_ITEM_EQUIP_BASE pWhiteEquip = equipBaseDBC.Search_Index_EQU(idNeedFacility); if (pWhiteEquip != null) { if (bHaveTool) { szTemp = "你需要先将" + pWhiteEquip.szName + "装备上"; } else { szTemp = "你还没有" + pWhiteEquip.szName; } } else { szTemp = "你需要装备工具。"; } GameProcedure.s_pEventSystem.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, szTemp); //todo // ADDTALKMSG(szTemp); return(false); } } return(true); }