Beispiel #1
0
        //更新圣物额外属性
        public void UpdataHolyItemExAttr(GameClient client, sbyte sShenWu_slot)
        {
            Dictionary <sbyte, HolyItemData> holyitemdata = client.ClientData.MyHolyItemDataDic;

            if (null == holyitemdata)
            {
                return;
            }

            HolyItemData     tmpdata     = null;
            HolyItemPartData tmppartdata = null;

            int sMinSuit = (int)MAX_HOLY_PART_LEVEL;

            if (true == holyitemdata.TryGetValue(sShenWu_slot, out tmpdata))
            {
                for (sbyte i = 1; i <= MAX_HOLY_PART_NUM; ++i)
                {
                    if (true == tmpdata.m_PartArray.TryGetValue(i, out tmppartdata))
                    {
                        if (sMinSuit > tmppartdata.m_sSuit)
                        {
                            sMinSuit = tmppartdata.m_sSuit;
                        }
                    }
                    else
                    {
                        //存在有0阶情况直接跳
                        sMinSuit = 0;
                        break;
                    }
                }
            }
            else
            {
                //这个圣物不存在按0阶处理
                sMinSuit = 0;
            }

            HolyInfo xmlData = null;
            int      nDataID = HolyInfo.GetShengwuID((sbyte)sMinSuit, sShenWu_slot);

            if (true == _holyDataDic.TryGetValue(nDataID, out xmlData))
            {
                for (int j = 0; j < xmlData.m_ExtraPropertyList.Count; ++j)
                {
                    ProcessAction(
                        client
                        , xmlData.m_ExtraPropertyList[j].MagicActionID
                        , xmlData.m_ExtraPropertyList[j].MagicActionParams
                        , (int)PropsSystemTypes.HolyItem
                        , sShenWu_slot
                        , 100);       //0 作为额外属性用
                }
            }
        }
        public void UpdataHolyItemExAttr(GameClient client, sbyte sShenWu_slot)
        {
            Dictionary <sbyte, HolyItemData> holyitemdata = client.ClientData.MyHolyItemDataDic;

            if (null != holyitemdata)
            {
                HolyItemData     tmpdata     = null;
                HolyItemPartData tmppartdata = null;
                int sMinSuit = (int)HolyItemManager.MAX_HOLY_PART_LEVEL;
                if (holyitemdata.TryGetValue(sShenWu_slot, out tmpdata))
                {
                    for (sbyte i = 1; i <= HolyItemManager.MAX_HOLY_PART_NUM; i += 1)
                    {
                        if (!tmpdata.m_PartArray.TryGetValue(i, out tmppartdata))
                        {
                            sMinSuit = 0;
                            break;
                        }
                        if (sMinSuit > (int)tmppartdata.m_sSuit)
                        {
                            sMinSuit = (int)tmppartdata.m_sSuit;
                        }
                    }
                }
                else
                {
                    sMinSuit = 0;
                }
                HolyInfo xmlData = null;
                int      nDataID = HolyInfo.GetShengwuID((sbyte)sMinSuit, sShenWu_slot);
                if (this._holyDataDic.TryGetValue(nDataID, out xmlData))
                {
                    for (int j = 0; j < xmlData.m_ExtraPropertyList.Count; j++)
                    {
                        this.ProcessAction(client, xmlData.m_ExtraPropertyList[j].MagicActionID, xmlData.m_ExtraPropertyList[j].MagicActionParams, 16, sShenWu_slot, 100);
                    }
                }
            }
        }
Beispiel #3
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());
        }
        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);
        }