Exemplo n.º 1
0
        /// <summary>
        /// 初始化套装强化加成信息
        /// </summary>
        public static void InitAllForgeLevelInfo()
        {
            lock (QiangHuaFuJiaItemList)
            {
                SystemXmlItems xmlitems = new SystemXmlItems();
                xmlitems.LoadFromXMlFile("Config/QiangHuaFuJia.xml", "", "ID");
                SystemXmlItem item = null;
                QiangHuaFuJiaItemList.Clear();
                foreach (var kv in xmlitems.SystemXmlItemDict)
                {
                    item = kv.Value;

                    QiangHuaFuJiaItem qiangHuaFuJiaItem = new QiangHuaFuJiaItem();
                    qiangHuaFuJiaItem.Id    = item.GetIntValue("ID");
                    qiangHuaFuJiaItem.Level = item.GetIntValue("QiangHuaLevel");
                    qiangHuaFuJiaItem.Num   = item.GetIntValue("Num");
                    qiangHuaFuJiaItem.AddAttackInjurePercent = item.GetDoubleValue("AddAttackInjurePercent");
                    qiangHuaFuJiaItem.MaxLifePercent         = item.GetDoubleValue("MaxLifePercent");
                    QiangHuaFuJiaItemList.Add(qiangHuaFuJiaItem);
                }

                QiangHuaFuJiaItemList.Sort((x, y) => { return(x.Id - y.Id); });
                for (int i = 0; i < QiangHuaFuJiaItemList.Count; i++)
                {
                    QiangHuaFuJiaItemList[i].Id = i + 1;
                }
            }
        }
Exemplo n.º 2
0
 public static void InitAllForgeLevelInfo()
 {
     lock (AllThingsCalcItem.QiangHuaFuJiaItemList)
     {
         SystemXmlItems xmlitems = new SystemXmlItems();
         xmlitems.LoadFromXMlFile("Config/QiangHuaFuJia.xml", "", "ID", 0);
         AllThingsCalcItem.QiangHuaFuJiaItemList.Clear();
         foreach (KeyValuePair <int, SystemXmlItem> kv in xmlitems.SystemXmlItemDict)
         {
             SystemXmlItem     item = kv.Value;
             QiangHuaFuJiaItem qiangHuaFuJiaItem = new QiangHuaFuJiaItem();
             qiangHuaFuJiaItem.Id    = item.GetIntValue("ID", -1);
             qiangHuaFuJiaItem.Level = item.GetIntValue("QiangHuaLevel", -1);
             qiangHuaFuJiaItem.Num   = item.GetIntValue("Num", -1);
             qiangHuaFuJiaItem.AddAttackInjurePercent = item.GetDoubleValue("AddAttackInjurePercent");
             qiangHuaFuJiaItem.MaxLifePercent         = item.GetDoubleValue("MaxLifePercent");
             AllThingsCalcItem.QiangHuaFuJiaItemList.Add(qiangHuaFuJiaItem);
         }
         AllThingsCalcItem.QiangHuaFuJiaItemList.Sort((QiangHuaFuJiaItem x, QiangHuaFuJiaItem y) => x.Id - y.Id);
         for (int i = 0; i < AllThingsCalcItem.QiangHuaFuJiaItemList.Count; i++)
         {
             AllThingsCalcItem.QiangHuaFuJiaItemList[i].Id = i + 1;
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 加载魔法的职业/级别/技能ID索引
        /// </summary>
        /// <param name="systemMagicMgr"></param>
        public void LoadMagicItemsDict(SystemXmlItems systemMagicMgr)
        {
            foreach (var key in systemMagicMgr.SystemXmlItemDict.Keys)
            {
                SystemXmlItem systemMagic = systemMagicMgr.SystemXmlItemDict[key];

                int intKey = systemMagic.GetIntValue("ID");
                _MagicItemsDict[intKey] = systemMagic;
            }
        }
Exemplo n.º 4
0
        public void LoadGoodsItemsDict(SystemXmlItems systemGoodsMgr)
        {
            Dictionary <string, SystemXmlItem> goodsItemsDict = new Dictionary <string, SystemXmlItem>();

            foreach (int key in systemGoodsMgr.SystemXmlItemDict.Keys)
            {
                SystemXmlItem systemGoods = systemGoodsMgr.SystemXmlItemDict[key];
                string        strKey      = systemGoods.GetStringValue("Title");
                goodsItemsDict[strKey] = systemGoods;
            }
            this._GoodsItemsDict = goodsItemsDict;
        }
Exemplo n.º 5
0
 public void LoadMagicItemsDict(SystemXmlItems systemMagicMgr)
 {
     lock (this._MagicItemsDict)
     {
         foreach (int key in systemMagicMgr.SystemXmlItemDict.Keys)
         {
             SystemXmlItem systemMagic = systemMagicMgr.SystemXmlItemDict[key];
             int           intKey      = systemMagic.GetIntValue("ID", -1);
             this._MagicItemsDict[intKey] = systemMagic;
         }
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 解析公式
        /// </summary>
        /// <param name="systemMagicsMgr"></param>
        public void ParseMagicActions2(SystemXmlItems systemMagicsMgr)
        {
            //Dictionary<int, List<MagicActionItem>> magicActionsDict = new Dictionary<int, List<MagicActionItem>>();
            //foreach (var key in systemMagicsMgr.SystemXmlItemDict.Keys)
            //{
            //    string actions = (string)systemMagicsMgr.SystemXmlItemDict[(int)key].GetStringValue("MagicScripts2");
            //    if (null == actions) continue;
            //    ParseMagicActions(magicActionsDict, (int)key, actions);
            //}

            //_MagicActionsDict = magicActionsDict;
        }
Exemplo n.º 7
0
        public void LoadNPCTasks(SystemXmlItems systemTasks)
        {
            Dictionary <int, List <int> > sourceNPCTasksDict = new Dictionary <int, List <int> >();
            Dictionary <int, List <int> > destNPCTasksDict   = new Dictionary <int, List <int> >();

            foreach (int key in systemTasks.SystemXmlItemDict.Keys)
            {
                SystemXmlItem systemTask = systemTasks.SystemXmlItemDict[key];
                this.AddSourceNPCTask(systemTask.GetIntValue("SourceNPC", -1), systemTask.GetIntValue("ID", -1), sourceNPCTasksDict);
                this.AddDestNPCTask(systemTask.GetIntValue("DestNPC", -1), systemTask.GetIntValue("ID", -1), destNPCTasksDict);
            }
            this._SourceNPCTasksDict = sourceNPCTasksDict;
            this._DestNPCTasksDict   = destNPCTasksDict;
        }
Exemplo n.º 8
0
        public static void ParseManyTimeDmageItems(SystemXmlItems systemMagicMgr)
        {
            Dictionary <int, List <ManyTimeDmageItem> > manyTimeDmageItemsDict = new Dictionary <int, List <ManyTimeDmageItem> >();

            foreach (int key in systemMagicMgr.SystemXmlItemDict.Keys)
            {
                string manyTimeDmage = systemMagicMgr.SystemXmlItemDict[key].GetStringValue("ManyTimeDmage");
                if (null != manyTimeDmage)
                {
                    MagicsManyTimeDmageCachingMgr.ParseMagicManyTimeDmage(manyTimeDmageItemsDict, key, manyTimeDmage);
                }
            }
            MagicsManyTimeDmageCachingMgr.ManyTimeDmageCachingDict = manyTimeDmageItemsDict;
        }
Exemplo n.º 9
0
        public void ParseExtensionPropsActions(SystemXmlItems systemExtensionProps)
        {
            Dictionary <int, List <MagicActionItem> > extensionPropsActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (int key in systemExtensionProps.SystemXmlItemDict.Keys)
            {
                string actions = systemExtensionProps.SystemXmlItemDict[key].GetStringValue("MagicScripts");
                if (!string.IsNullOrEmpty(actions))
                {
                    this.ParseMagicActions(extensionPropsActionsDict, key, actions);
                }
            }
            this._ExtensionPropsActionsDict = extensionPropsActionsDict;
        }
Exemplo n.º 10
0
        public void ParseBossAIActions(SystemXmlItems systemBossAI)
        {
            Dictionary <int, List <MagicActionItem> > bossAIActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (int key in systemBossAI.SystemXmlItemDict.Keys)
            {
                string actions = systemBossAI.SystemXmlItemDict[key].GetStringValue("Action");
                if (!string.IsNullOrEmpty(actions))
                {
                    this.ParseMagicActions(bossAIActionsDict, key, actions);
                }
            }
            this._BossAIActionsDict = bossAIActionsDict;
        }
Exemplo n.º 11
0
        public void ParseNPCScriptActions(SystemXmlItems systemNPCScripts)
        {
            Dictionary <int, List <MagicActionItem> > npcScriptActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (int key in systemNPCScripts.SystemXmlItemDict.Keys)
            {
                string actions = systemNPCScripts.SystemXmlItemDict[key].GetStringValue("ExecMagic");
                if (null != actions)
                {
                    this.ParseMagicActions(npcScriptActionsDict, key, actions);
                }
            }
            this._NPCScriptActionsDict = npcScriptActionsDict;
        }
Exemplo n.º 12
0
        public void ParseGoodsActions(SystemXmlItems systemGoodsMgr)
        {
            Dictionary <int, List <MagicActionItem> > goodsActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (int key in systemGoodsMgr.SystemXmlItemDict.Keys)
            {
                string actions = systemGoodsMgr.SystemXmlItemDict[key].GetStringValue("ExecMagic");
                if (!string.IsNullOrEmpty(actions))
                {
                    this.ParseMagicActions(goodsActionsDict, key, actions);
                }
            }
            this._GoodsActionsDict = goodsActionsDict;
        }
Exemplo n.º 13
0
        public void ParseScanTypeActions2(SystemXmlItems systemMagicsMgr)
        {
            Dictionary <int, List <MagicActionItem> > magicActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (int key in systemMagicsMgr.SystemXmlItemDict.Keys)
            {
                string actions = systemMagicsMgr.SystemXmlItemDict[key].GetStringValue("ScanType");
                if (null != actions)
                {
                    this.ParseMagicActions(magicActionsDict, key, actions);
                }
            }
            this._MagicActionsDict = magicActionsDict;
        }
Exemplo n.º 14
0
        public void ParseMagicActionRelations(SystemXmlItems systemMagicsMgr)
        {
            Dictionary <int, int> magicActionRelationDic = new Dictionary <int, int>();

            foreach (int key in systemMagicsMgr.SystemXmlItemDict.Keys)
            {
                int nextMagicID = systemMagicsMgr.SystemXmlItemDict[key].GetIntValue("NextMagicID", -1);
                if (-1 != nextMagicID)
                {
                    magicActionRelationDic[nextMagicID] = key;
                }
            }
            this._MagicActionRelationDic = magicActionRelationDic;
        }
Exemplo n.º 15
0
        /// <summary>
        /// 预先进行缓存
        /// </summary>
        /// <param name="systemMagicMgr"></param>
        public static void ParseManyTimeDmageItems(SystemXmlItems systemMagicMgr)
        {
            Dictionary <int, List <ManyTimeDmageItem> > manyTimeDmageItemsDict = new Dictionary <int, List <ManyTimeDmageItem> >();

            foreach (var key in systemMagicMgr.SystemXmlItemDict.Keys)
            {
                string manyTimeDmage = (string)systemMagicMgr.SystemXmlItemDict[(int)key].GetStringValue("ManyTimeDmage");
                if (null == manyTimeDmage)
                {
                    continue;
                }
                ParseMagicManyTimeDmage(manyTimeDmageItemsDict, (int)key, manyTimeDmage);
            }

            ManyTimeDmageCachingDict = manyTimeDmageItemsDict;
        }
Exemplo n.º 16
0
        /// <summary>
        /// 解析公式
        /// </summary>
        /// <param name="systemMagicsMgr"></param>
        public void ParseNPCScriptActions(SystemXmlItems systemNPCScripts)
        {
            Dictionary <int, List <MagicActionItem> > npcScriptActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (var key in systemNPCScripts.SystemXmlItemDict.Keys)
            {
                string actions = (string)systemNPCScripts.SystemXmlItemDict[(int)key].GetStringValue("ExecMagic");
                if (null == actions)
                {
                    continue;
                }
                ParseMagicActions(npcScriptActionsDict, (int)key, actions);
            }

            _NPCScriptActionsDict = npcScriptActionsDict;
        }
Exemplo n.º 17
0
        /// <summary>
        /// 解析公式
        /// </summary>
        /// <param name="systemMagicsMgr"></param>
        public void ParseExtensionPropsActions(SystemXmlItems systemExtensionProps)
        {
            Dictionary <int, List <MagicActionItem> > extensionPropsActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (var key in systemExtensionProps.SystemXmlItemDict.Keys)
            {
                string actions = (string)systemExtensionProps.SystemXmlItemDict[(int)key].GetStringValue("MagicScripts");
                if (string.IsNullOrEmpty(actions))
                {
                    continue;
                }
                ParseMagicActions(extensionPropsActionsDict, (int)key, actions);
            }

            _ExtensionPropsActionsDict = extensionPropsActionsDict;
        }
Exemplo n.º 18
0
        /// <summary>
        /// 解析攻击范围公式
        /// </summary>
        /// <param name="systemMagicsMgr"></param>
        public void ParseScanTypeActions2(SystemXmlItems systemMagicsMgr)
        {
            Dictionary <int, List <MagicActionItem> > magicActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (var key in systemMagicsMgr.SystemXmlItemDict.Keys)
            {
                string actions = (string)systemMagicsMgr.SystemXmlItemDict[(int)key].GetStringValue("ScanType");
                if (null == actions)
                {
                    continue;
                }
                ParseMagicActions(magicActionsDict, (int)key, actions);
            }

            _MagicActionsDict = magicActionsDict;
        }
Exemplo n.º 19
0
        /// <summary>
        /// 解析公式
        /// </summary>
        /// <param name="systemMagicsMgr"></param>
        public void ParseBossAIActions(SystemXmlItems systemBossAI)
        {
            Dictionary <int, List <MagicActionItem> > bossAIActionsDict = new Dictionary <int, List <MagicActionItem> >();

            foreach (var key in systemBossAI.SystemXmlItemDict.Keys)
            {
                //int execScript = (int)systemGoodsMgr.SystemXmlItemDict[(int)key].GetIntValue("ExecScript");
                //if (execScript <= 0) continue;
                string actions = (string)systemBossAI.SystemXmlItemDict[(int)key].GetStringValue("Action");
                if (string.IsNullOrEmpty(actions))
                {
                    continue;
                }
                ParseMagicActions(bossAIActionsDict, (int)key, actions);
            }

            _BossAIActionsDict = bossAIActionsDict;
        }
Exemplo n.º 20
0
 public void init()
 {
     try
     {
         this.dNeedGam = GameManager.systemParamsList.GetParamValueDoubleArrayByName("XianHuaCost", ',');
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic XianHuaCost", false, false);
     }
     try
     {
         this.dRingmodulus = GameManager.systemParamsList.GetParamValueDoubleByName("GoodWillXiShu", 0.0);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GoodWillXiShu", false, false);
     }
     try
     {
         this.dOtherRingmodulus = GameManager.systemParamsList.GetParamValueDoubleByName("BanLvXiShu", 0.0);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic BanLvXiShu", false, false);
     }
     try
     {
         this.WeddingRingDic.LoadFromXMlFile("Config/WeddingRing.xml", "", "GoodsID", 0);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic WeddingRing.xml", false, false);
     }
     try
     {
         SystemXmlItems RoseXmlItems = new SystemXmlItems();
         RoseXmlItems.LoadFromXMlFile("Config/GiveRose.xml", "", "GoodsID", 0);
         foreach (KeyValuePair <int, SystemXmlItem> item in RoseXmlItems.SystemXmlItemDict)
         {
             MarriageRoseData rosedata = new MarriageRoseData();
             rosedata.nBaseAddGoodWill = item.Value.GetIntValue("GoodWill", -1);
             string[] strfiled = item.Value.GetStringValue("MultiplyingPower").Split(new char[]
             {
                 '|'
             });
             int nAddRate = 0;
             for (int i = 0; i < strfiled.Length; i++)
             {
                 string[] strfiled2 = strfiled[i].Split(new char[]
                 {
                     ','
                 });
                 nAddRate += (int)(Convert.ToDouble(strfiled2[1]) * 100.0);
                 rosedata.modulusList.Add(Convert.ToInt32(strfiled2[0]));
                 rosedata.rateList.Add(nAddRate);
             }
             this.RoseDataDic.Add(Convert.ToInt32(item.Value.GetIntValue("GoodsID", -1)), rosedata);
         }
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GiveRose.xml", false, false);
     }
     try
     {
         SystemXmlItems XmlItems = new SystemXmlItems();
         XmlItems.LoadFromXMlFile("Config/GoodWill.xml", "", "Type", 0);
         sbyte tmpStar = 0;
         int   nAddExp = 0;
         this.GoodwillAllExpList.Add(0);
         foreach (KeyValuePair <int, SystemXmlItem> item in XmlItems.SystemXmlItemDict)
         {
             tmpStar = 0;
             foreach (XElement xmlnode in item.Value.XMLNode.Descendants())
             {
                 nAddExp += Convert.ToInt32(xmlnode.Attribute("NeedGoodWill").Value);
                 this.GoodwillAllExpList.Add(nAddExp);
                 tmpStar += 1;
             }
         }
         this.byMaxGoodwillLv   = (sbyte)((this.GoodwillAllExpList.Count - 1) / (int)tmpStar);
         this.byMaxGoodwillStar = tmpStar;
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GoodWill.xml", false, false);
     }
     TCPCmdDispatcher.getInstance().registerProcessorEx(871, 1, 1, MarriageOtherLogic.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(872, 1, 1, MarriageOtherLogic.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(873, 1, 1, MarriageOtherLogic.getInstance(), TCPCmdFlags.IsStringArrayParams);
 }
Exemplo n.º 21
0
        public void Initialize()
        {
            SystemXmlItems xml = new SystemXmlItems();

            xml.LoadFromXMlFile("Config/BuJian.xml", "", "ID", 0);
            foreach (KeyValuePair <int, SystemXmlItem> item in xml.SystemXmlItemDict)
            {
                HolyPartInfo data = new HolyPartInfo();
                data.m_nCostBandJinBi      = item.Value.GetIntValue("CostBandJinBi", -1);
                data.m_sSuccessProbability = Convert.ToSByte(item.Value.GetDoubleValue("SuccessProbability") * 100.0);
                if (data.m_sSuccessProbability < 0)
                {
                    data.m_sSuccessProbability = -1;
                }
                string[] strfiled = item.Value.GetStringValue("NeedGoods").Split(new char[]
                {
                    ','
                });
                if (strfiled.Length > 1)
                {
                    data.m_nNeedGoodsCount = Global.SafeConvertToInt32(strfiled[1]);
                }
                strfiled = item.Value.GetStringValue("FailCost").Split(new char[]
                {
                    ','
                });
                if (strfiled.Length > 1)
                {
                    data.m_nFailCostGoodsCount = Global.SafeConvertToInt32(strfiled[1]);
                }
                string strParam = item.Value.GetStringValue("Property");
                if (strParam != "-1")
                {
                    data.m_PropertyList = GameManager.SystemMagicActionMgr.ParseActionsOutUse(strParam);
                }
                data.m_nMaxFailCount = item.Value.GetIntValue("FailMaxNum", -1);
                if (data.m_nMaxFailCount < 0)
                {
                    data.m_nMaxFailCount = 0;
                }
                data.NeedGoods      = ConfigParser.ParserIntArrayList(item.Value.GetStringValue("NeedItem"), true, '|', ',');
                data.FaildNeedGoods = ConfigParser.ParserIntArrayList(item.Value.GetStringValue("FailureConsumption"), true, '|', ',');
                this._partDataDic.Add(item.Value.GetIntValue("ID", -1), data);
                int suitID = item.Value.GetIntValue("SuitID", -1);
                HolyItemManager.MAX_HOLY_PART_LEVEL = Math.Max(HolyItemManager.MAX_HOLY_PART_LEVEL, Convert.ToSByte(suitID));
            }
            HolyItemManager.MAX_HOLY_PART_LEVEL = (sbyte)Global.GMin((int)HolyItemManager.MAX_HOLY_PART_LEVEL, (int)GameManager.systemParamsList.GetParamValueIntByName("ShengWuMax", 0));
            xml = new SystemXmlItems();
            xml.LoadFromXMlFile("Config/ShengWu.xml", "", "ID", 0);
            foreach (KeyValuePair <int, SystemXmlItem> item in xml.SystemXmlItemDict)
            {
                HolyInfo data2    = new HolyInfo();
                string   strParam = item.Value.GetStringValue("ExtraProperty");
                if (strParam != "-1")
                {
                    data2.m_ExtraPropertyList = GameManager.SystemMagicActionMgr.ParseActionsOutUse(strParam);
                }
                this._holyDataDic.Add(item.Value.GetIntValue("ID", -1), data2);
            }
            TCPCmdDispatcher.getInstance().registerProcessorEx(10206, 2, 2, HolyItemManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 初始化管理器
        /// </summary>
        public void init()
        {
            //缓存献花需要的钻石
            try
            {
                dNeedGam = GameManager.systemParamsList.GetParamValueDoubleArrayByName("XianHuaCost");
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic XianHuaCost", false);
            }

            //缓存婚戒最终属性系数
            try
            {
                dRingmodulus = GameManager.systemParamsList.GetParamValueDoubleByName("GoodWillXiShu");
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GoodWillXiShu", false);
            }

            //对方婚戒属性倍率参数
            try
            {
                dOtherRingmodulus = GameManager.systemParamsList.GetParamValueDoubleByName("BanLvXiShu");
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic BanLvXiShu", false);
            }

            //加载婚戒数据
            try
            {
                WeddingRingDic.LoadFromXMlFile("Config/WeddingRing.xml", "", "GoodsID");
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic WeddingRing.xml", false);
            }

            //加载玫瑰花数据
            try
            {
                SystemXmlItems RoseXmlItems = new SystemXmlItems();
                RoseXmlItems.LoadFromXMlFile("Config/GiveRose.xml", "", "GoodsID");

                foreach (KeyValuePair <int, SystemXmlItem> item in RoseXmlItems.SystemXmlItemDict)
                {
                    MarriageRoseData rosedata = new MarriageRoseData();
                    rosedata.nBaseAddGoodWill = item.Value.GetIntValue("GoodWill");

                    string[] strfiled = item.Value.GetStringValue("MultiplyingPower").Split('|');

                    int nAddRate = 0;

                    for (int i = 0; i < strfiled.Length; ++i)
                    {
                        string[] strfiled2 = strfiled[i].Split(',');

                        //预先计算一下几率
                        nAddRate += (int)(Convert.ToDouble(strfiled2[1]) * 100.0d);

                        rosedata.modulusList.Add(Convert.ToInt32(strfiled2[0]));
                        rosedata.rateList.Add(nAddRate);
                    }

                    RoseDataDic.Add(Convert.ToInt32(item.Value.GetIntValue("GoodsID")), rosedata);
                }
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GiveRose.xml", false);
            }

            //加载奉献数据
            try
            {
                SystemXmlItems XmlItems = new SystemXmlItems();
                XmlItems.LoadFromXMlFile("Config/GoodWill.xml", "", "Type");

                sbyte tmpStar = 0;
                int   nAddExp = 0;

                //预先把1阶0星加进去
                GoodwillAllExpList.Add(0);

                foreach (var item in XmlItems.SystemXmlItemDict)
                {
                    tmpStar = 0;

                    foreach (var xmlnode in item.Value.XMLNode.Descendants())
                    {
                        nAddExp += Convert.ToInt32(xmlnode.Attribute("NeedGoodWill").Value);
                        GoodwillAllExpList.Add(nAddExp);

                        tmpStar++;
                    }
                }

                //动态设置一下最大阶级
                byMaxGoodwillLv = (sbyte)((GoodwillAllExpList.Count - 1) / tmpStar);

                //动态设置一下最大星级
                byMaxGoodwillStar = tmpStar;
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GoodWill.xml", false);
            }

            //初始化协议列表
            TCPCmdDispatcher.getInstance().registerProcessorEx((int)TCPGameServerCmds.CMD_SPR_MARRY_ROSE, 1, 1, getInstance());
            TCPCmdDispatcher.getInstance().registerProcessorEx((int)TCPGameServerCmds.CMD_SPR_MARRY_RING, 1, 1, getInstance());
            TCPCmdDispatcher.getInstance().registerProcessorEx((int)TCPGameServerCmds.CMD_SPR_MARRY_MESSAGE, 1, 1, getInstance());

            //初始化消息监听器
            //GlobalEventSource.getInstance().registerListener((int)EventTypes.PlayerInitGame, getInstance());   //玩家登陆事件
        }
Exemplo n.º 23
0
        //初始化静态数据
        public void Initialize()
        {
            //从BuJian.xml读取数据
            SystemXmlItems xml = new SystemXmlItems();

            xml.LoadFromXMlFile("Config/BuJian.xml", "", "ID");

            foreach (KeyValuePair <int, SystemXmlItem> item in xml.SystemXmlItemDict)
            {
                HolyPartInfo data = new HolyPartInfo();
                data.m_nCostBandJinBi = item.Value.GetIntValue("CostBandJinBi");
                //if (data.m_nCostBandJinBi < 0)
                //data.m_nCostBandJinBi = 0;
                data.m_sSuccessProbability = Convert.ToSByte(item.Value.GetDoubleValue("SuccessProbability") * 100);
                if (data.m_sSuccessProbability < 0)
                {
                    data.m_sSuccessProbability = -1;
                }

                string[] strfiled = item.Value.GetStringValue("NeedGoods").Split(',');
                if (strfiled.Length > 1)
                {
                    //data.m_nNeedGoodsID = Global.SafeConvertToInt32(strfiled[0]);
                    data.m_nNeedGoodsCount = Global.SafeConvertToInt32(strfiled[1]);
                }

                strfiled = item.Value.GetStringValue("FailCost").Split(',');
                if (strfiled.Length > 1)
                {
                    //data.m_nFailCostGoodsID = Global.SafeConvertToInt32(strfiled[0]);
                    data.m_nFailCostGoodsCount = Global.SafeConvertToInt32(strfiled[1]);
                }

                string strParam = item.Value.GetStringValue("Property");
                if (strParam != "-1")
                {
                    data.m_PropertyList = GameManager.SystemMagicActionMgr.ParseActionsOutUse(strParam);
                }

                data.m_nMaxFailCount = item.Value.GetIntValue("FailMaxNum");
                if (data.m_nMaxFailCount < 0)
                {
                    data.m_nMaxFailCount = 0;
                }

                _partDataDic.Add(item.Value.GetIntValue("ID"), data);
            }

            //从ShengWu.xml读取数据
            xml = new SystemXmlItems();
            xml.LoadFromXMlFile("Config/ShengWu.xml", "", "ID");

            foreach (KeyValuePair <int, SystemXmlItem> item in xml.SystemXmlItemDict)
            {
                HolyInfo data = new HolyInfo();

                string strParam = item.Value.GetStringValue("ExtraProperty");
                if (strParam != "-1")
                {
                    data.m_ExtraPropertyList = GameManager.SystemMagicActionMgr.ParseActionsOutUse(strParam);
                }

                _holyDataDic.Add(item.Value.GetIntValue("ID"), data);
            }

            TCPCmdDispatcher.getInstance().registerProcessorEx((int)TCPGameServerCmds.CMD_DB_UPDATE_HOLYITEM, 2, 2, getInstance());
        }
Exemplo n.º 24
0
 public void ParseMagicActions2(SystemXmlItems systemMagicsMgr)
 {
 }