| | |
| | |
|
| | | //古宝表
|
| | |
|
| | | struct tagGubao
|
| | | struct Gubao
|
| | | {
|
| | | WORD _GubaoID; //古宝ID
|
| | | BYTE GubaoType; //古宝分类
|
| | | BYTE GubaoQuality; //古宝品质
|
| | | DWORD UnlockItemID; //解锁所需物品ID
|
| | | BYTE UnlockItemCnt; //解锁所需物品数量
|
| | | list BaseAttrIDList; //基础属性ID列表
|
| | | list BaseAttrValueList; //基础属性初始值
|
| | | list BaseAttrPerStarAddList; //基础属性每星成长
|
| | | BYTE SpecEffType; //特殊效果类型
|
| | | BYTE SpecEffLayerMax; //特殊效果最大层数
|
| | | BYTE SpecAttrID; //特殊属性ID
|
| | | DWORD SpecAttrValue; //特殊属性初始值
|
| | | DWORD SpecAttrPerLVAdd; //特殊属性每级成长
|
| | | DWORD SpecAttrPerStarAdd; //特殊属性每星成长
|
| | | };
|
| | |
|
| | | //古宝共鸣属性表
|
| | |
|
| | | struct tagGubaoResonanceAttr
|
| | | struct GubaoResonanceAttr
|
| | | {
|
| | | WORD _ResonanceID; //共鸣ID
|
| | | BYTE ResonanceStar; //共鸣星级
|
| | |
| | |
|
| | | //古宝共鸣组合表
|
| | |
|
| | | struct tagGubaoResonance
|
| | | struct GubaoResonance
|
| | | {
|
| | | WORD _ResonanceID; //共鸣ID
|
| | | list GubaoIDList; //古宝ID列表
|
| | | };
|
| | |
|
| | | //古宝升星表
|
| | | //古宝品质升星表
|
| | |
|
| | | struct tagGubaoStar
|
| | | struct GubaoStar
|
| | | {
|
| | | WORD _GubaoID; //古宝ID
|
| | | BYTE _GubaoStar; //古宝星级
|
| | | list StarUPNeedItemInfo; //升星所需物品 [[物品ID,个数], ...]
|
| | | list StarUPNeedQualityPiece; //升下一星额外所需品质碎片 [[品质,个数], ...]
|
| | | list StarAttrIDList; //累计总属性ID列表
|
| | | list StarAttrValueList; //累计总属性值列表
|
| | | list StarEffIDList; //星级特殊效果ID列表
|
| | | };
|
| | |
|
| | | //古宝特殊效果表
|
| | |
|
| | | struct tagGubaoEffAttr
|
| | | {
|
| | | DWORD _GubaoEffID; //古宝特殊效果ID
|
| | | BYTE GubaoEffType; //效果类型
|
| | | DWORD EffCond; //条件
|
| | | DWORD EffCond2; //条件2
|
| | | DWORD EffCond3; //条件3
|
| | | BYTE IsPer; //是否百分比提升
|
| | | list EffFuncAttrIDList; //提升指定功能属性ID列表
|
| | | DWORD EffAttrID; //直接增加属性类型
|
| | | DWORD EffAttrValue; //提升属性值
|
| | | list EffItemAwardList; //领取物品列表
|
| | | BYTE _GubaoQuality; //古宝品质
|
| | | BYTE GubaoStar; //古宝星级
|
| | | BYTE StarUPNeedSelfCnt; //升到本星消耗本体碎片数量
|
| | | list StarUPNeedItemList; //消耗其他物品列表 [[物品ID,个数], ...]
|
| | | };
|
| | |
|
| | | //古宝品质升级表
|
| | |
|
| | | struct tagGubaoLV
|
| | | struct GubaoLV
|
| | | {
|
| | | BYTE _GubaoType; //古宝分类
|
| | | BYTE _GubaoQuality; //古宝品质
|
| | | BYTE _GubaoLV; //古宝等级
|
| | | BYTE LessEqualLV; //小于等于等级
|
| | | list LVUPNeedItemInfo; //升级所需物品 [[物品ID,个数], ...]
|
| | | list LVAttrTypeList; //等级属性类型列表
|
| | | list LVAttrValueList; //等级属性值列表
|
| | | };
|
| | |
|
| | | //神通表
|
| | |
| | | Def_CalcAttr_MainEquip, # 主装备 1
|
| | | Def_CalcAttr_HeroBook, # 武将图鉴 2
|
| | | Def_CalcAttr_Realm, # 官职 3
|
| | | ) = range(4)
|
| | | Def_CalcAttr_Gubao, # 古宝 4
|
| | | ) = range(5)
|
| | |
|
| | | CalcAttrName = {
|
| | | Def_CalcAttr_LV:"主公等级",
|
| | | Def_CalcAttr_MainEquip:"主装备",
|
| | | Def_CalcAttr_HeroBook:"武将图鉴",
|
| | | Def_CalcAttr_Realm:"官职",
|
| | | Def_CalcAttr_Gubao:"古宝",
|
| | | }
|
| | |
|
| | | ##-----------------------------------------------------------------------------------------------
|
| | |
| | | Def_Effect_ItemGiveMoney = 264 #通用给货币道具,A值数量,B值货币类型
|
| | | Def_Effect_GuajiAward = 266 #直接给挂机收益,A值分钟
|
| | | Def_Effect_ItemCount = 267 #自动转化为对应物品ID的个数,不存背包
|
| | | Def_Effect_GubaoPiece = 270 #古宝碎片效果ID, A值-古宝ID
|
| | | Def_Effect_TrainRealmLV = 272 #境界培养卡,值A-功能(1-坐骑;2-灵宠;3-灵器), 值B-境界
|
| | | Def_Effect_TiandaoQiyun = 273 #增加天道树气运;A值-增加值 效果值B: 领取是否默认直接使用
|
| | | Def_Effect_Face = 274 #头像物品;A值-头像ID
|
| | |
| | | Def_PDict_CharmLV = "CharmLV" # 魅力等级
|
| | |
|
| | | #古宝
|
| | | Def_PDict_GubaoLVInfo = "GubaoLVInfo_%s" # 古宝等级信息,参数(古宝ID),等级*100+星级
|
| | | Def_PDict_GubaoItemEffValue = "GubaoItemEffValue_%s_%s" # 古宝效果物品进度,参数(古宝ID, 效果类型)
|
| | | Def_PDict_GubaoPiece = "GubaoPiece_%s" # 古宝碎片数,参数(古宝ID)
|
| | | Def_PDict_GubaoInfo = "Gubao_%s" # 古宝信息,参数(古宝ID),特殊效果层*100000 + 等级*100 + 星级
|
| | |
|
| | | #神通
|
| | | Def_PDict_ShentongLVInfo = "ShentongLVInfo_%s" # 神通等级信息,参数(神通ID),阶级*100+等级
|
| | |
| | | #------------------------------------------------------
|
| | | # B2 17 古宝升星 #tagCMGubaoStarUp
|
| | |
|
| | | class tagCMGubaoPieceUse(Structure):
|
| | | class tagCMGubaoStarUp(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("GubaoID", c_ushort), # 通用碎片古宝ID
|
| | | ("PieceCount", c_ushort), # 使用碎片个数
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("GubaoID", c_ushort), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x17
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | |
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x17
|
| | | self.GubaoID = 0
|
| | | self.PieceCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMGubaoPieceUse)
|
| | | return sizeof(tagCMGubaoStarUp)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 17 古宝升星 //tagCMGubaoStarUp:
|
| | | GubaoID:%d,
|
| | | PieceCount:%d
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | GubaoID:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.PieceCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagCMGubaoStarUp(Structure):
|
| | | Head = tagHead()
|
| | | GubaoID = 0 #(WORD GubaoID)
|
| | | PieceSelectCount = 0 #(BYTE PieceSelectCount)
|
| | | CommPieceUseList = list() #(vector<tagCMGubaoPieceUse> CommPieceUseList)// 通用古宝碎片使用列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x17
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.GubaoID,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.PieceSelectCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.PieceSelectCount):
|
| | | temCommPieceUseList = tagCMGubaoPieceUse()
|
| | | _pos = temCommPieceUseList.ReadData(_lpData, _pos)
|
| | | self.CommPieceUseList.append(temCommPieceUseList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x17
|
| | | self.GubaoID = 0
|
| | | self.PieceSelectCount = 0
|
| | | self.CommPieceUseList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | length += 1
|
| | | for i in range(self.PieceSelectCount):
|
| | | length += self.CommPieceUseList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.GubaoID)
|
| | | data = CommFunc.WriteBYTE(data, self.PieceSelectCount)
|
| | | for i in range(self.PieceSelectCount):
|
| | | data = CommFunc.WriteString(data, self.CommPieceUseList[i].GetLength(), self.CommPieceUseList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | GubaoID:%d,
|
| | | PieceSelectCount:%d,
|
| | | CommPieceUseList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.GubaoID,
|
| | | self.PieceSelectCount,
|
| | | "..."
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.GubaoID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMGubaoStarUp=tagCMGubaoStarUp()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGubaoStarUp.Head.Cmd,m_NAtagCMGubaoStarUp.Head.SubCmd))] = m_NAtagCMGubaoStarUp
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGubaoStarUp.Cmd,m_NAtagCMGubaoStarUp.SubCmd))] = m_NAtagCMGubaoStarUp
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | ("GubaoID", c_ushort),
|
| | | ("GubaoStar", c_ubyte),
|
| | | ("GubaoLV", c_ubyte),
|
| | | ("EffLayer", c_ubyte), # 该特殊效果累加层值
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.GubaoID = 0
|
| | | self.GubaoStar = 0
|
| | | self.GubaoLV = 0
|
| | | self.EffLayer = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | DumpString = '''// A3 C7 古宝信息 //tagMCGubaoInfo:
|
| | | GubaoID:%d,
|
| | | GubaoStar:%d,
|
| | | GubaoLV:%d
|
| | | GubaoLV:%d,
|
| | | EffLayer:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.GubaoStar,
|
| | | self.GubaoLV
|
| | | self.GubaoLV,
|
| | | self.EffLayer
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCGubaoInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | Count = 0 #(WORD Count)
|
| | | GubaoInfoList = list() #(vector<tagMCGubao> GubaoInfoList)
|
| | | data = None
|
| | |
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temGubaoInfoList = tagMCGubao()
|
| | | _pos = temGubaoInfoList.ReadData(_lpData, _pos)
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.GubaoInfoList[i].GetLength()
|
| | |
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.GubaoInfoList[i].GetLength(), self.GubaoInfoList[i].GetBuffer())
|
| | | return data
|
| | |
| | |
|
| | | m_NAtagMCGubaoInfo=tagMCGubaoInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGubaoInfo.Head.Cmd,m_NAtagMCGubaoInfo.Head.SubCmd))] = m_NAtagMCGubaoInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 CA 古宝物品特殊效果信息 #tagMCGubaoItemEffInfo
|
| | |
|
| | | class tagMCGubaoItemEff(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("GubaoID", c_ushort), |
| | | ("EffType", c_ubyte), # 不同古宝ID允许拥有相同效果类型,进度值每个古宝ID单独统计
|
| | | ("EffValue", c_int), # 该效果目前累加值
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.GubaoID = 0
|
| | | self.EffType = 0
|
| | | self.EffValue = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCGubaoItemEff)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 CA 古宝物品特殊效果信息 //tagMCGubaoItemEffInfo:
|
| | | GubaoID:%d,
|
| | | EffType:%d,
|
| | | EffValue:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.EffType,
|
| | | self.EffValue
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCGubaoItemEffInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(WORD Count)
|
| | | ItemEffInfoList = list() #(vector<tagMCGubaoItemEff> ItemEffInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCA
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temItemEffInfoList = tagMCGubaoItemEff()
|
| | | _pos = temItemEffInfoList.ReadData(_lpData, _pos)
|
| | | self.ItemEffInfoList.append(temItemEffInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCA
|
| | | self.Count = 0
|
| | | self.ItemEffInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.ItemEffInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.ItemEffInfoList[i].GetLength(), self.ItemEffInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | ItemEffInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCGubaoItemEffInfo=tagMCGubaoItemEffInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGubaoItemEffInfo.Head.Cmd,m_NAtagMCGubaoItemEffInfo.Head.SubCmd))] = m_NAtagMCGubaoItemEffInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 CB 古宝碎片信息 #tagMCGubaoPieceInfo
|
| | |
|
| | | class tagMCGubaoPiece(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("GubaoID", c_ushort), |
| | | ("PieceCount", c_int), # 当前碎片个数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.GubaoID = 0
|
| | | self.PieceCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCGubaoPiece)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 CB 古宝碎片信息 //tagMCGubaoPieceInfo:
|
| | | GubaoID:%d,
|
| | | PieceCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.GubaoID,
|
| | | self.PieceCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCGubaoPieceInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | PieceInfoList = list() #(vector<tagMCGubaoPiece> PieceInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCB
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temPieceInfoList = tagMCGubaoPiece()
|
| | | _pos = temPieceInfoList.ReadData(_lpData, _pos)
|
| | | self.PieceInfoList.append(temPieceInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xCB
|
| | | self.Count = 0
|
| | | self.PieceInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.PieceInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.PieceInfoList[i].GetLength(), self.PieceInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | PieceInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCGubaoPieceInfo=tagMCGubaoPieceInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGubaoPieceInfo.Head.Cmd,m_NAtagMCGubaoPieceInfo.Head.SubCmd))] = m_NAtagMCGubaoPieceInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | #
|
| | | # @todo:古宝
|
| | | # @author hxp
|
| | | # @date 2023-01-5
|
| | | # @date 2025-10-11
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 古宝
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2023-01-5 15:30"""
|
| | | #"""Version = 2025-10-11 21:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import IpyGameDataPY
|
| | | import ItemControler
|
| | | import PlayerGubao
|
| | | import PlayerControl
|
| | | import ChConfig
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #逻辑实现
|
| | |
|
| | | ## GM命令执行入口
|
| | | # @param curPlayer 当前玩家
|
| | | # @param msgList 参数列表
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(curPlayer, msgList):
|
| | |
|
| | | if not msgList:
|
| | | GameWorld.DebugAnswer(curPlayer, "重置古宝: Gubao 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置古宝: Gubao 古宝ID 等级 星级")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置效果: Gubao e 古宝ID 效果类型 进度值")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置古宝: Gubao 古宝ID [等级 星级 层级]")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置碎片: Gubao p 古宝ID 数量")
|
| | | return
|
| | |
|
| | |
| | | for index in range(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gubaoID):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoPiece % gubaoID, 0)
|
| | | if gubaoID not in gubaoIDList:
|
| | | gubaoIDList.append(gubaoID)
|
| | | _, star = PlayerGubao.GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not star:
|
| | | itemID = ipyData.GetUnlockItemID()
|
| | | if ItemControler.GetItemCountByID(curPlayer, itemID):
|
| | | ItemControler.SetItemCountByID(curPlayer, itemID, 0) # 重置
|
| | | if not PlayerGubao.IsGubaoActivated(curPlayer, gubaoID):
|
| | | continue
|
| | | if gubaoID not in gubaoIDList:
|
| | | gubaoIDList.append(gubaoID)
|
| | | PlayerGubao.SetGubaoLVInfo(curPlayer, gubaoID, 0, 0)
|
| | | for effType in PlayerGubao.NeedGubaoItemEffValueTypeList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType), 0)
|
| | | |
| | | PlayerGubao.Sync_GubaoItemEffInfo(curPlayer, force=True)
|
| | | PlayerGubao.SetGubaoInfo(curPlayer, gubaoID, 0, 0, 0)
|
| | | GameWorld.DebugAnswer(curPlayer, "重置古宝OK")
|
| | | else:
|
| | | return
|
| | | |
| | | elif value1 == "p":
|
| | | gubaoID = msgList[1] if len(msgList) > 1 else 0
|
| | | pieceCount = msgList[2] if len(msgList) > 2 else 0
|
| | |
| | | if not ipyData:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该古宝!gubaoID=%s" % gubaoID)
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoPiece % gubaoID, pieceCount)
|
| | | GameWorld.DebugAnswer(curPlayer, "设置碎片数量: ID:%s,数量:%s" % (gubaoID, pieceCount))
|
| | | PlayerGubao.Sync_GubaoPieceInfo(curPlayer, [gubaoID])
|
| | | return
|
| | | elif len(msgList) == 3:
|
| | | gubaoID, lv, star = msgList
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Gubao", gubaoID)
|
| | | if not ipyData:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该古宝!gubaoID=%s" % gubaoID)
|
| | | return
|
| | | starIpyData = IpyGameDataPY.GetIpyGameData("GubaoStar", gubaoID, star)
|
| | | if not starIpyData:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该古宝星级!gubaoID=%s,star=%s" % (gubaoID, star))
|
| | | return
|
| | | gubaoType = ipyData.GetGubaoType()
|
| | | quality = ipyData.GetGubaoQuality()
|
| | | lvIpyData = IpyGameDataPY.GetIpyGameData("GubaoLV", gubaoType, quality, lv)
|
| | | if not lvIpyData:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该古宝品质等级!gubaoID=%s,gubaoType=%s,quality=%s,lv=%s" % (gubaoID, gubaoType, quality, lv))
|
| | | return
|
| | | GameWorld.DebugAnswer(curPlayer, "设置古宝:%s,等级(%s),星(%s)" % (gubaoID, lv, star))
|
| | | PlayerGubao.SetGubaoLVInfo(curPlayer, gubaoID, lv, star)
|
| | | gubaoIDList.append(gubaoID)
|
| | | elif value1 == "e":
|
| | | if len(msgList) != 4:
|
| | | return
|
| | | _, gubaoID, effType, effValue = msgList
|
| | | if effType not in PlayerGubao.NeedGubaoItemEffValueTypeList:
|
| | | GameWorld.DebugAnswer(curPlayer, "古宝效果值类型仅包含:%s" % str(PlayerGubao.NeedGubaoItemEffValueTypeList))
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Gubao", gubaoID)
|
| | | if not ipyData:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该古宝!gubaoID=%s" % gubaoID)
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType), effValue)
|
| | | PlayerGubao.Sync_GubaoItemEffInfo(curPlayer, gubaoID, effType, True)
|
| | | GameWorld.DebugAnswer(curPlayer, "设置古宝:%s,效果类型(%s),值(%s)" % (gubaoID, effType, effValue))
|
| | | else:
|
| | | itemID = ipyData.GetUnlockItemID()
|
| | | ItemControler.SetItemCountByID(curPlayer, itemID, pieceCount)
|
| | | GameWorld.DebugAnswer(curPlayer, "设置古宝(%s)碎片ID:%s,数量:%s" % (gubaoID, itemID, pieceCount))
|
| | | return
|
| | |
|
| | | else:
|
| | | gubaoID = value1
|
| | | lv = msgList[1] if len(msgList) > 1 else 1
|
| | | star = msgList[2] if len(msgList) > 2 else 0
|
| | | layer = msgList[3] if len(msgList) > 3 else 0
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Gubao", gubaoID)
|
| | | if not ipyData:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该古宝!gubaoID=%s" % gubaoID)
|
| | | return
|
| | | quality = ipyData.GetGubaoQuality()
|
| | | layer = min(layer, ipyData.GetSpecEffLayerMax())
|
| | | |
| | | starIpyDataList = IpyGameDataPY.GetIpyGameDataList("GubaoStar", quality)
|
| | | if starIpyDataList:
|
| | | lastStarIpyData = starIpyDataList[-1]
|
| | | star = min(star, lastStarIpyData.GetGubaoStar())
|
| | | |
| | | lvIpyDataList = IpyGameDataPY.GetIpyGameDataList("GubaoLV", quality)
|
| | | if lvIpyDataList:
|
| | | lastLVIpyData = lvIpyDataList[-1]
|
| | | lv = min(lv, lastLVIpyData.GetLessEqualLV())
|
| | | |
| | | GameWorld.DebugAnswer(curPlayer, "设置古宝:%s,级(%s),星(%s),层(%s)" % (gubaoID, lv, star, layer))
|
| | | PlayerGubao.SetGubaoInfo(curPlayer, gubaoID, lv, star, layer)
|
| | | gubaoIDList.append(gubaoID)
|
| | | |
| | | PlayerGubao.RefreshGubaoAttr(curPlayer)
|
| | | PlayerGubao.Sync_GubaoInfo(curPlayer, gubaoIDList)
|
| | | PlayerGubao.Sync_GubaoPieceInfo(curPlayer, gubaoIDList) |
| | | PlayerGubao.Sync_GubaoInfo(curPlayer, gubaoIDList) |
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | | import GameWorld
|
| | | import PlayerPrestigeSys
|
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import PlayerGubao
|
| | | import ChConfig
|
| | |
|
| | |
|
| | |
| | | value = cmdList[0]
|
| | | if value == 0:
|
| | | curPlayer.SetOfficialRank(ChConfig.Def_InitOfficialRank)
|
| | | curPlayer.SetFreePoint(0)
|
| | | GameWorld.DebugAnswer(curPlayer, "重置境界!")
|
| | | GameWorld.DebugAnswer(curPlayer, "重置灵根点!")
|
| | | effType = PlayerGubao.GubaoEffType_RealmLVAddLinggen
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in range(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | addFreePointAlready = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType))
|
| | | if not addFreePointAlready:
|
| | | continue
|
| | | GameWorld.DebugAnswer(curPlayer, "重置古宝(%s)效果(%s)增加灵根点:%s" % (gubaoID, effType, addFreePointAlready))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType), 0)
|
| | | PlayerGubao.Sync_GubaoItemEffInfo(curPlayer, gubaoID, effType, force=True)
|
| | | GameWorld.DebugAnswer(curPlayer, "重置境界OK")
|
| | | return
|
| | | if value == 1:
|
| | |
| | | import PlayerZhanling
|
| | | import ItemControler
|
| | | import PlayerArena
|
| | | import PlayerGubao
|
| | | import PyGameData
|
| | | import FBCommon
|
| | | import ChConfig
|
| | |
| | | PlayerArena.DoArenaMatchRefresh(curPlayer, True, isSys=True)
|
| | |
|
| | | PlayerZhanling.AddZhanlingValue(curPlayer, PlayerZhanling.ZhanlingType_ArenaCnt, 1)
|
| | | PlayerGubao.AddGubaoSpecEffLayer(curPlayer, PlayerGubao.GubaoEffType_Arena, 1)
|
| | | return
|
| | |
|
| | | def __updArenaBatRecord(curPlayer, turnFight, tagPlayerID, isWin, atkAddScore, defDecScore):
|
| | |
| | |
|
| | | "Gubao":(
|
| | | ("WORD", "GubaoID", 1),
|
| | | ("BYTE", "GubaoType", 0),
|
| | | ("BYTE", "GubaoQuality", 0),
|
| | | ("DWORD", "UnlockItemID", 0),
|
| | | ("BYTE", "UnlockItemCnt", 0),
|
| | | ("list", "BaseAttrIDList", 0),
|
| | | ("list", "BaseAttrValueList", 0),
|
| | | ("list", "BaseAttrPerStarAddList", 0),
|
| | | ("BYTE", "SpecEffType", 0),
|
| | | ("BYTE", "SpecEffLayerMax", 0),
|
| | | ("BYTE", "SpecAttrID", 0),
|
| | | ("DWORD", "SpecAttrValue", 0),
|
| | | ("DWORD", "SpecAttrPerLVAdd", 0),
|
| | | ("DWORD", "SpecAttrPerStarAdd", 0),
|
| | | ),
|
| | |
|
| | | "GubaoResonanceAttr":(
|
| | |
| | | ),
|
| | |
|
| | | "GubaoStar":(
|
| | | ("WORD", "GubaoID", 1),
|
| | | ("BYTE", "GubaoStar", 1),
|
| | | ("list", "StarUPNeedItemInfo", 0),
|
| | | ("list", "StarUPNeedQualityPiece", 0),
|
| | | ("list", "StarAttrIDList", 0),
|
| | | ("list", "StarAttrValueList", 0),
|
| | | ("list", "StarEffIDList", 0),
|
| | | ),
|
| | |
|
| | | "GubaoEffAttr":(
|
| | | ("DWORD", "GubaoEffID", 1),
|
| | | ("BYTE", "GubaoEffType", 0),
|
| | | ("DWORD", "EffCond", 0),
|
| | | ("DWORD", "EffCond2", 0),
|
| | | ("DWORD", "EffCond3", 0),
|
| | | ("BYTE", "IsPer", 0),
|
| | | ("list", "EffFuncAttrIDList", 0),
|
| | | ("DWORD", "EffAttrID", 0),
|
| | | ("DWORD", "EffAttrValue", 0),
|
| | | ("list", "EffItemAwardList", 0),
|
| | | ("BYTE", "GubaoQuality", 1),
|
| | | ("BYTE", "GubaoStar", 0),
|
| | | ("BYTE", "StarUPNeedSelfCnt", 0),
|
| | | ("list", "StarUPNeedItemList", 0),
|
| | | ),
|
| | |
|
| | | "GubaoLV":(
|
| | | ("BYTE", "GubaoType", 1),
|
| | | ("BYTE", "GubaoQuality", 1),
|
| | | ("BYTE", "GubaoLV", 1),
|
| | | ("BYTE", "LessEqualLV", 0),
|
| | | ("list", "LVUPNeedItemInfo", 0),
|
| | | ("list", "LVAttrTypeList", 0),
|
| | | ("list", "LVAttrValueList", 0),
|
| | | ),
|
| | |
|
| | | "Shentong":(
|
| | |
| | | return |
| | | |
| | | def GetGubaoID(self): return self.attrTuple[0] # 古宝ID WORD
|
| | | def GetGubaoType(self): return self.attrTuple[1] # 古宝分类 BYTE
|
| | | def GetGubaoQuality(self): return self.attrTuple[2] # 古宝品质 BYTE
|
| | | def GetUnlockItemID(self): return self.attrTuple[3] # 解锁所需物品ID DWORD
|
| | | def GetUnlockItemCnt(self): return self.attrTuple[4] # 解锁所需物品数量 BYTE |
| | | def GetGubaoQuality(self): return self.attrTuple[1] # 古宝品质 BYTE
|
| | | def GetUnlockItemID(self): return self.attrTuple[2] # 解锁所需物品ID DWORD
|
| | | def GetUnlockItemCnt(self): return self.attrTuple[3] # 解锁所需物品数量 BYTE
|
| | | def GetBaseAttrIDList(self): return self.attrTuple[4] # 基础属性ID列表 list
|
| | | def GetBaseAttrValueList(self): return self.attrTuple[5] # 基础属性初始值 list
|
| | | def GetBaseAttrPerStarAddList(self): return self.attrTuple[6] # 基础属性每星成长 list
|
| | | def GetSpecEffType(self): return self.attrTuple[7] # 特殊效果类型 BYTE
|
| | | def GetSpecEffLayerMax(self): return self.attrTuple[8] # 特殊效果最大层数 BYTE
|
| | | def GetSpecAttrID(self): return self.attrTuple[9] # 特殊属性ID BYTE
|
| | | def GetSpecAttrValue(self): return self.attrTuple[10] # 特殊属性初始值 DWORD
|
| | | def GetSpecAttrPerLVAdd(self): return self.attrTuple[11] # 特殊属性每级成长 DWORD
|
| | | def GetSpecAttrPerStarAdd(self): return self.attrTuple[12] # 特殊属性每星成长 DWORD |
| | | |
| | | # 古宝共鸣属性表 |
| | | class IPY_GubaoResonanceAttr(): |
| | |
| | | def GetResonanceID(self): return self.attrTuple[0] # 共鸣ID WORD
|
| | | def GetGubaoIDList(self): return self.attrTuple[1] # 古宝ID列表 list |
| | | |
| | | # 古宝升星表 |
| | | # 古宝品质升星表 |
| | | class IPY_GubaoStar(): |
| | | |
| | | def __init__(self): |
| | | self.attrTuple = None |
| | | return |
| | | |
| | | def GetGubaoID(self): return self.attrTuple[0] # 古宝ID WORD
|
| | | def GetGubaoQuality(self): return self.attrTuple[0] # 古宝品质 BYTE
|
| | | def GetGubaoStar(self): return self.attrTuple[1] # 古宝星级 BYTE
|
| | | def GetStarUPNeedItemInfo(self): return self.attrTuple[2] # 升星所需物品 [[物品ID,个数], ...] list
|
| | | def GetStarUPNeedQualityPiece(self): return self.attrTuple[3] # 升下一星额外所需品质碎片 [[品质,个数], ...] list
|
| | | def GetStarAttrIDList(self): return self.attrTuple[4] # 累计总属性ID列表 list
|
| | | def GetStarAttrValueList(self): return self.attrTuple[5] # 累计总属性值列表 list
|
| | | def GetStarEffIDList(self): return self.attrTuple[6] # 星级特殊效果ID列表 list |
| | | |
| | | # 古宝特殊效果表 |
| | | class IPY_GubaoEffAttr(): |
| | | |
| | | def __init__(self): |
| | | self.attrTuple = None |
| | | return |
| | | |
| | | def GetGubaoEffID(self): return self.attrTuple[0] # 古宝特殊效果ID DWORD
|
| | | def GetGubaoEffType(self): return self.attrTuple[1] # 效果类型 BYTE
|
| | | def GetEffCond(self): return self.attrTuple[2] # 条件 DWORD
|
| | | def GetEffCond2(self): return self.attrTuple[3] # 条件2 DWORD
|
| | | def GetEffCond3(self): return self.attrTuple[4] # 条件3 DWORD
|
| | | def GetIsPer(self): return self.attrTuple[5] # 是否百分比提升 BYTE
|
| | | def GetEffFuncAttrIDList(self): return self.attrTuple[6] # 提升指定功能属性ID列表 list
|
| | | def GetEffAttrID(self): return self.attrTuple[7] # 直接增加属性类型 DWORD
|
| | | def GetEffAttrValue(self): return self.attrTuple[8] # 提升属性值 DWORD
|
| | | def GetEffItemAwardList(self): return self.attrTuple[9] # 领取物品列表 list |
| | | def GetStarUPNeedSelfCnt(self): return self.attrTuple[2] # 升到本星消耗本体碎片数量 BYTE
|
| | | def GetStarUPNeedItemList(self): return self.attrTuple[3] # 消耗其他物品列表 [[物品ID,个数], ...] list |
| | | |
| | | # 古宝品质升级表 |
| | | class IPY_GubaoLV(): |
| | |
| | | self.attrTuple = None |
| | | return |
| | | |
| | | def GetGubaoType(self): return self.attrTuple[0] # 古宝分类 BYTE
|
| | | def GetGubaoQuality(self): return self.attrTuple[1] # 古宝品质 BYTE
|
| | | def GetGubaoLV(self): return self.attrTuple[2] # 古宝等级 BYTE
|
| | | def GetLVUPNeedItemInfo(self): return self.attrTuple[3] # 升级所需物品 [[物品ID,个数], ...] list
|
| | | def GetLVAttrTypeList(self): return self.attrTuple[4] # 等级属性类型列表 list
|
| | | def GetLVAttrValueList(self): return self.attrTuple[5] # 等级属性值列表 list |
| | | def GetGubaoQuality(self): return self.attrTuple[0] # 古宝品质 BYTE
|
| | | def GetLessEqualLV(self): return self.attrTuple[1] # 小于等于等级 BYTE
|
| | | def GetLVUPNeedItemInfo(self): return self.attrTuple[2] # 升级所需物品 [[物品ID,个数], ...] list |
| | | |
| | | # 神通表 |
| | | class IPY_Shentong(): |
| | |
| | | self.__LoadFileData("GubaoResonanceAttr", onlyCheck)
|
| | | self.__LoadFileData("GubaoResonance", onlyCheck)
|
| | | self.__LoadFileData("GubaoStar", onlyCheck)
|
| | | self.__LoadFileData("GubaoEffAttr", onlyCheck)
|
| | | self.__LoadFileData("GubaoLV", onlyCheck)
|
| | | self.__LoadFileData("Shentong", onlyCheck)
|
| | | self.__LoadFileData("ShentongLV", onlyCheck)
|
| | |
| | | def GetGubaoStarByIndex(self, index): |
| | | self.CheckLoadData("GubaoStar") |
| | | return self.ipyGubaoStarCache[index]
|
| | | |
| | | def GetGubaoEffAttrCount(self): |
| | | self.CheckLoadData("GubaoEffAttr") |
| | | return self.ipyGubaoEffAttrLen
|
| | | def GetGubaoEffAttrByIndex(self, index): |
| | | self.CheckLoadData("GubaoEffAttr") |
| | | return self.ipyGubaoEffAttrCache[index]
|
| | | |
| | | def GetGubaoLVCount(self): |
| | | self.CheckLoadData("GubaoLV") |
| | |
| | | ChConfig.Def_Effect_AddVIPExp:"Item_AddVIPExp", # 增加VIP经验
|
| | | ChConfig.Def_Effect_VIPLVCard:"Item_VIPLVCard", # VIP等级直升卡
|
| | | ChConfig.Def_Effect_TiandaoQiyun:"Item_TiandaoQiyun", # 天道树气运
|
| | | ChConfig.Def_Effect_GubaoPiece:"Item_GubaoPiece", # 古宝碎片效果ID
|
| | | ChConfig.Def_Effect_TrainRealmLV:"Item_TrainRealmLV", # 境界培养卡
|
| | | ChConfig.Def_Effect_ResetBossKillCnt:"Item_ResetBossKillCnt", # 重置boss击杀疲劳
|
| | | ChConfig.Def_Effect_AddFBCnt:"Item_AddFBCnt", # 增加副本可进入次数
|
| | |
| | | import traceback
|
| | | import random
|
| | | import ReadChConfig
|
| | | import ChItem
|
| | | import PlayerSuccess
|
| | | import PlayerFamily
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import PlayerXiangong
|
| | | import IpyGameDataPY
|
| | | import DataRecordPack
|
| | | import PlayerGubao
|
| | | import PyGameData
|
| | | import ChEquip
|
| | | import PlayerHero
|
| | | import ObjPool
|
| | |
|
| | | import math
|
| | | import time
|
| | |
| | | SetItemCountByID(curPlayer, itemID, GetItemCountByID(curPlayer, itemID) + tagItemCount)
|
| | | tagItem.Clear()
|
| | | return True
|
| | | #古宝碎片
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_GubaoPiece:
|
| | | gubaoID = itemEff.GetEffectValue(0)
|
| | | if gubaoID:
|
| | | PlayerGubao.AddGubaoPiece(curPlayer, gubaoID, tagItemCount, itemID)
|
| | | tagItem.Clear()
|
| | | return True
|
| | | #气运
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_TiandaoQiyun:
|
| | | isAutoUse = itemEff.GetEffectValue(1)
|
| | |
| | | itemCount = GetItemCountByID(curPlayer, itemID)
|
| | | if not itemCount and not force:
|
| | | continue
|
| | | countInfo = ChPyNetSendPack.tagMCAutoItemCount()
|
| | | countInfo = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCAutoItemCount)
|
| | | countInfo.Clear()
|
| | | countInfo.ItemID = itemID
|
| | | countInfo.ItemCount = itemCount
|
| | |
| | | if not itemCountList:
|
| | | return
|
| | |
|
| | | clientPack = ChPyNetSendPack.tagMCAutoItemCountRefresh()
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCAutoItemCountRefresh)
|
| | | clientPack.Clear()
|
| | | clientPack.ItemCountList = itemCountList
|
| | | clientPack.Count = len(clientPack.ItemCountList)
|
| | |
| | | def GetItemCountByID(curPlayer, itemID):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ItemCount % itemID)
|
| | | def SetItemCountByID(curPlayer, itemID, itemCount, isSync=True):
|
| | | befCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ItemCount % itemID)
|
| | | itemCount = max(0, min(itemCount, ChConfig.Def_UpperLimit_DWord))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ItemCount % itemID, itemCount)
|
| | | |
| | | # 检查碎片溢出自动转化,数量增加时才检查
|
| | | if itemCount > befCount:
|
| | | #GameWorld.DebugLog("碎片数量增加,检查溢出! itemID=%s,itemCount=%s,befCount=%s" % (itemID, itemCount, befCount))
|
| | | if PlayerGubao.AutoTransGubaoPiece(curPlayer, itemID):
|
| | | PyGameData.g_transItemSign = 1
|
| | | |
| | | if isSync:
|
| | | Sync_AutoItemCount(curPlayer, [itemID])
|
| | | return itemCount
|
| | | def CheckItemEnoughByID(curPlayer, itemID, needCount):
|
| | | itemCount = GetItemCountByID(curPlayer, itemID)
|
| | | if itemCount < needCount:
|
| | | GameWorld.DebugLog("物品碎片不足! itemID=%s,itemCount=%s < %s" % (itemID, itemCount, needCount))
|
| | | return False
|
| | | return True
|
| | | def DelItemCountByID(curPlayer, itemID, delCount, isSync=True):
|
| | | itemCount = GetItemCountByID(curPlayer, itemID)
|
| | | if itemCount < delCount:
|
| | | GameWorld.DebugLog("扣除物品碎片不足! itemID=%s,itemCount=%s < %s" % (itemID, itemCount, delCount))
|
| | | return False
|
| | | SetItemCountByID(curPlayer, itemID, itemCount - delCount, isSync)
|
| | | return True
|
| | |
|
| | | ## 设置物品数量
|
| | | # @param item 物品实例
|
| | |
| | | itemEff = itemData.GetEffectByIndex(0)
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_ItemCount:
|
| | | return True
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_GubaoPiece:
|
| | | gubaoID = itemEff.GetEffectValue(0)
|
| | | if gubaoID:
|
| | | return True
|
| | | return False
|
| | |
|
| | | def GetOutPutItemObj(itemID, itemCount=1, isAuctionItem=False, expireTime=0, curPlayer=None, setAttrDict=None):
|
| | |
| | | import PlayerActTask
|
| | | #import PlayerZhanling
|
| | | import IpyGameDataPY
|
| | | import PlayerGubao
|
| | | import PlayerState
|
| | | import TurnAttack
|
| | | import PyGameData
|
| | |
| | | if limitIndex == ShareDefine.Def_Boss_Func_World:
|
| | | # 世界BOSS击杀成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillWorldBoss, 1)
|
| | | PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_KillWorldBoss, 1)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_WorldBOSS)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_WorldBOSS, 1)
|
| | |
| | | #BOSS之家
|
| | | # BOSS之家BOSS击杀成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillBossHomeBoss, 1)
|
| | | PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_KillBossHome, 1)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_BOSSHome)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_BOSSHome, 1)
|
| | |
| | | # #跨服蓬莱仙境
|
| | | # PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossPenglai)
|
| | | # PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillCrossPenglaiBoss, 1)
|
| | | # PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_KillCrossPenglaiBoss, 1)
|
| | | # PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_CrossPenglaiBoss, 1)
|
| | | # elif mapID == ChConfig.Def_FBMapID_CrossDemonLand:
|
| | | # #跨服魔化之地
|
| | | # PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossDemonLand)
|
| | | # PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillCrossDemonLandBoss, 1)
|
| | | # PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_KillCrossDemonLandBoss, 1)
|
| | | # PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_CrossDemonLandBoss, 1)
|
| | | # if mapID in [ChConfig.Def_FBMapID_CrossPenglai, ChConfig.Def_FBMapID_CrossDemonLand]:
|
| | | # PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_CrossBoss, 1)
|
| | |
| | | elif rewardType == ChConfig.Def_RewardType_CrossYaomoBossHurt:
|
| | | PlayerCrossYaomoBoss.GetCrossYaomoBossHurtAward(curPlayer, dataEx, tick)
|
| | | # 古宝特殊效果物品奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_GubaoItemEff:
|
| | | PlayerGubao.GetGubaoItemEffAward(curPlayer, dataEx, dataExStr)
|
| | | #elif rewardType == ChConfig.Def_RewardType_GubaoItemEff:
|
| | | # PlayerGubao.GetGubaoItemEffAward(curPlayer, dataEx, dataExStr)
|
| | | # 成就积分奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_SuccessScore:
|
| | | PlayerSuccess.GetSuccessScoreAward(curPlayer, dataEx)
|
| | |
| | | import PlayerTongTianLing
|
| | | import PlayerActTask
|
| | | import PlayerSuccess
|
| | | import PlayerGubao
|
| | |
|
| | | #关联类型
|
| | | (
|
| | |
| | | ItemControler.GivePlayerItemOrMail(curPlayer, rewardItemList, event=["ActivityPlace", False, {}])
|
| | |
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_ActivityPlace, rewardCount)
|
| | | PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_ActivityPlace, rewardCount)
|
| | |
|
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | | return
|
| | |
| | | import CrossPlayerData
|
| | | import ChNetSendPack
|
| | | import PlayerState
|
| | | import PlayerGubao
|
| | | import PlayerOnline
|
| | | import PlayerTask
|
| | | import PlayerMail
|
| | |
| | |
|
| | | #if aftFreePoint > befFreePoint:
|
| | | # curPlayer.SetFreePoint(aftFreePoint)
|
| | | PlayerGubao.DoGubaoAddFreePoint(curPlayer)
|
| | |
|
| | | # 升级需要执行的游戏功能处理
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | | import GameObj
|
| | | import PlayerGubao
|
| | |
|
| | | def DoPlayerOnDay(curPlayer):
|
| | | if GameWorld.IsCrossServer():
|
| | |
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_CrossPK, 1)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_CrossPK, 1)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_CrossPK, 1)
|
| | | PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_CrossRealmPK, 1)
|
| | | PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_CrossPK, 1)
|
| | | else:
|
| | | GameWorld.Log(" 不同天的PK结算不增加今日PK次数! ", playerID)
|
| | |
| | | import ShareDefine
|
| | | import ItemCommon
|
| | | import ChConfig
|
| | | import PlayerGubao
|
| | |
|
| | | def OnYaomoBossStateChange(state, tick):
|
| | | ## 活动状态变更
|
| | |
| | |
|
| | | ## 参与击杀妖魔boss
|
| | | if msgType == "KillYaomoBoss":
|
| | | PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_CrossYaomoBoss, 1)
|
| | | pass
|
| | |
|
| | | return
|
| | |
|
| | |
| | | import ChPyNetSendPack
|
| | | import PlayerControl
|
| | | import GameFuncComm
|
| | | import PlayerGubao
|
| | | import ShareDefine
|
| | | import ObjPool
|
| | |
|
| | |
| | | SetCampInfo(curPlayer, campID, 0, 0, 0, False)
|
| | | syncCampIDList.append(campID)
|
| | | GameWorld.DebugLog("淘金结束: campID=%s,goldID=%s,放入淘金仓库index=%s,panningCnt=%s" % (campID, goldID, index, panningCnt))
|
| | | PlayerGubao.AddGubaoSpecEffLayer(curPlayer, PlayerGubao.GubaoEffType_GoldRush, 1)
|
| | |
|
| | | if not syncCampIDList:
|
| | | return
|
| | |
| | | #
|
| | | ##@package Player.PlayerGubao
|
| | | #
|
| | | # @todo:古宝系统
|
| | | # @todo:古宝
|
| | | # @author hxp
|
| | | # @date 2023-01-05
|
| | | # @date 2025-10-11
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 古宝系统
|
| | | # 详细描述: 古宝
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2023-01-05 15:30"""
|
| | | #"""Version = 2025-10-11 21:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import PlayerRune
|
| | | import ItemCommon
|
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import IPY_GameWorld
|
| | | import PlayerHorse
|
| | | import PlayerDogz
|
| | | import PlayerPet
|
| | | import ChConfig
|
| | | import ItemControler
|
| | | import PlayerDienstgrad
|
| | | import PlayerActTask
|
| | | import PlayerCoat
|
| | | import PlayerOnline
|
| | | import ChConfig
|
| | | import ObjPool
|
| | |
|
| | | GubaoEffType_FamilyWar = 48 # 参与仙盟联赛每X次+XXX属性 x次
|
| | | GubaoEffType_ElderBattlefield = 49 # 参与上古战场每X次+XXX属性 x次
|
| | | GubaoEffType_CrossBattlefield = 50 # 参与古神战场每X次+XXX属性 x次
|
| | | GubaoEffType_CrossYaomoBoss = 51 # 参与魔王入侵每X次+XXX属性 x次
|
| | | GubaoEffType_CrossFamilyFlagwar = 52 # 参与逐鹿万界每X次+XXX属性 x次
|
| | | GubaoEffType_GoldRush = 1 # 参与淘金
|
| | | GubaoEffType_Arena = 2 # 参与演武场
|
| | |
|
| | | GubaoEffAttrIypeList = [GubaoEffType_FamilyWar, GubaoEffType_ElderBattlefield, GubaoEffType_CrossBattlefield, |
| | | GubaoEffType_CrossYaomoBoss, GubaoEffType_CrossFamilyFlagwar]
|
| | |
|
| | | GubaoEffType_ActivityPlace = 33 # 活跃修炼x次可领取物品 x次
|
| | | GubaoEffType_Arena = 34 # 竞技场挑战x次可领取物品 x次
|
| | | GubaoEffType_KillWorldBoss = 35 # 击杀世界bossx次可领取物品 x次
|
| | | GubaoEffType_KillBossHome = 36 # 击杀boss之家bossx次可领取物品 x次
|
| | | GubaoEffType_KillCrossPenglaiBoss = 37 # 击杀蓬莱仙境bossx次可领取物品 x次
|
| | | GubaoEffType_KillCrossDemonLandBoss = 38 # 击杀魔化之地bossx次可领取物品 x次
|
| | | GubaoEffType_KillSealDemonBoss = 39 # 击杀封魔坛bossx次可领取物品 x次
|
| | | GubaoEffType_CrossRealmPK = 40 # 参与跨服天梯赛x次可领取物品 x次
|
| | |
|
| | | # 古宝领取物品特殊效果列表
|
| | | GubaoEffTtemIypeList = [GubaoEffType_ActivityPlace, GubaoEffType_Arena, GubaoEffType_KillWorldBoss, GubaoEffType_KillBossHome,
|
| | | GubaoEffType_KillCrossPenglaiBoss, GubaoEffType_KillCrossDemonLandBoss, GubaoEffType_KillSealDemonBoss,
|
| | | GubaoEffType_CrossRealmPK,
|
| | | ]
|
| | |
|
| | | # 古宝灵根点特殊效果列表
|
| | | GubaoEffType_RealmLVAddLinggen = 55 # 境界每级增加X点灵根
|
| | | GubaoEffFreePointTypeList = [54, 55, 56]
|
| | |
|
| | | # 需要记录EffValue的EffType列表
|
| | | NeedGubaoItemEffValueTypeList = GubaoEffAttrIypeList + GubaoEffTtemIypeList + GubaoEffFreePointTypeList
|
| | |
|
| | | def GetGubaoLVInfo(curPlayer, gubaoID):
|
| | | lvInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoLVInfo % gubaoID)
|
| | | lv = lvInfo / 100
|
| | | star = lvInfo % 100
|
| | | return lv, star
|
| | | def SetGubaoLVInfo(curPlayer, gubaoID, lv, star):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoLVInfo % gubaoID, lv * 100 + star)
|
| | | def GetGubaoInfo(curPlayer, gubaoID):
|
| | | info = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoInfo % gubaoID)
|
| | | layer = info / 100000
|
| | | lv = info % 100000 / 100
|
| | | star = info % 100
|
| | | return lv, star, layer
|
| | | def SetGubaoInfo(curPlayer, gubaoID, lv, star, layer):
|
| | | ## 特殊效果层*100000 + 等级*100 + 星级
|
| | | info = min(layer, 99) * 100000 + min(lv, 999) * 100 + min(star, 99)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoInfo % gubaoID, info)
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | DoGubaoAddFreePoint(curPlayer) # 上线检查一下,修改配置可生效
|
| | | Sync_GubaoInfo(curPlayer)
|
| | | Sync_GubaoItemEffInfo(curPlayer)
|
| | | Sync_GubaoPieceInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def AddGubaoPiece(curPlayer, gubaoID, addCount, useItemID):
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gubaoID)
|
| | | updCount = min(curCount + addCount, ChConfig.Def_UpperLimit_DWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoPiece % gubaoID, updCount)
|
| | | Sync_GubaoPieceInfo(curPlayer, [gubaoID])
|
| | | GameWorld.Log("增加古宝碎片: gubaoID=%s,curCount=%s,addCount=%s,updCount=%s,useItemID=%s" |
| | | % (gubaoID, curCount, addCount, updCount, useItemID), curPlayer.GetPlayerID())
|
| | | return curCount, updCount
|
| | |
|
| | | def DelGubaoPiece(curPlayer, gubaoID, delCount, delName):
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gubaoID)
|
| | | if curCount < delCount:
|
| | | return False
|
| | | updCount = curCount - delCount
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoPiece % gubaoID, updCount)
|
| | | Sync_GubaoPieceInfo(curPlayer, [gubaoID])
|
| | | GameWorld.Log("扣除古宝碎片: gubaoID=%s,curCount=%s,delCount=%s,updCount=%s,delName=%s" |
| | | % (gubaoID, curCount, delCount, updCount, delName), curPlayer.GetPlayerID())
|
| | | return True
|
| | |
|
| | | def ParseGubaoNeedItem(curPlayer, needItemList):
|
| | | ## 解析古宝功能所需物品,转化为古宝碎片+物品
|
| | | needPieceInfo, realNeedItemList = {}, []
|
| | | for itemID, itemCount in needItemList:
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | curEff = itemData.GetEffectByIndex(0)
|
| | | effID = curEff.GetEffectID()
|
| | | if effID != ChConfig.Def_Effect_GubaoPiece:
|
| | | realNeedItemList.append([itemID, itemCount])
|
| | | continue
|
| | | gubaoID = curEff.GetEffectValue(0)
|
| | | needPieceInfo[gubaoID] = needPieceInfo.get(gubaoID, 0) + itemCount
|
| | | GameWorld.DebugLog("转化古宝功能所需物品: needItemList=%s,realNeedItemList=%s,needPieceInfo=%s" |
| | | % (needItemList, realNeedItemList, needPieceInfo), curPlayer.GetPlayerID())
|
| | | return needPieceInfo, realNeedItemList
|
| | | def IsGubaoActivated(curPlayer, gubaoID):
|
| | | ## 检查古宝是否已激活
|
| | | lv, star, _ = GetGubaoInfo(curPlayer, gubaoID)
|
| | | if lv or star:
|
| | | return True
|
| | | return False
|
| | |
|
| | | #// B2 16 古宝激活 #tagCMGubaoActivate
|
| | | #
|
| | |
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | gubaoID = curPackData.GubaoID
|
| | | |
| | | if IsGubaoActivated(curPlayer, gubaoID):
|
| | | GameWorld.DebugLog("古宝已经激活过! gubaoID=%s" % gubaoID, playerID)
|
| | | return
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("Gubao", gubaoID)
|
| | | if not ipyData:
|
| | | return
|
| | |
| | | if not needItemID or not needItemCnt:
|
| | | return
|
| | |
|
| | | lv, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if lv or star:
|
| | | GameWorld.DebugLog("古宝已经激活过! gubaoID=%s" % gubaoID, playerID)
|
| | | itemCount = ItemControler.GetItemCountByID(curPlayer, needItemID)
|
| | | if itemCount < needItemCnt:
|
| | | GameWorld.DebugLog("激活古宝碎片不足! gubaoID=%s,needItemID=%s,itemCount=%s < %s" % (gubaoID, needItemID, itemCount, needItemCnt), playerID)
|
| | | return
|
| | | ItemControler.DelItemCountByID(curPlayer, needItemID, needItemCnt)
|
| | |
|
| | | needPieceInfo, realNeedItemList = ParseGubaoNeedItem(curPlayer, [[needItemID, needItemCnt]])
|
| | | if realNeedItemList:
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(needItemID, itemPack, needItemCnt)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog("激活古宝道具不足! needItemID=%s,needItemCnt=%s" % (needItemID, needItemCnt), playerID)
|
| | | return
|
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gID)
|
| | | if curCount < needPieceCount:
|
| | | GameWorld.DebugLog("激活古宝碎片不足! gubaoID=%s,curCount=%s < needPieceCount=%s" % (gubaoID, curCount, needPieceCount), playerID)
|
| | | return
|
| | | |
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | DelGubaoPiece(curPlayer, gID, needPieceCount, "Activate")
|
| | | if realNeedItemList:
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemList, needItemCnt, False, "Gubao")
|
| | | |
| | | lv, star = 1, 1
|
| | | SetGubaoLVInfo(curPlayer, gubaoID, lv, star)
|
| | | GameWorld.Log("古宝激活成功! gubaoID=%s" % gubaoID, playerID)
|
| | | DoGubaoAddFreePoint(curPlayer, gubaoID)
|
| | | lv, star, layer = 1, 0, 0
|
| | | SetGubaoInfo(curPlayer, gubaoID, lv, star, layer)
|
| | | GameWorld.DebugLog("古宝激活成功! gubaoID=%s" % gubaoID, playerID)
|
| | |
|
| | | RefreshGubaoAttr(curPlayer)
|
| | | Sync_GubaoInfo(curPlayer, [gubaoID])
|
| | | |
| | | return
|
| | |
|
| | | #// B2 17 古宝升星 #tagCMGubaoStarUp
|
| | | #
|
| | | #struct tagCMGubaoPieceUse
|
| | | #{
|
| | | # WORD GubaoID; // 通用碎片古宝ID
|
| | | # WORD PieceCount; // 使用碎片个数
|
| | | #};
|
| | | #
|
| | | #struct tagCMGubaoStarUp
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD GubaoID;
|
| | | # BYTE PieceSelectCount;
|
| | | # tagCMGubaoPieceUse CommPieceUseList[PieceSelectCount]; // 通用古宝碎片使用列表
|
| | | #};
|
| | | def OnGubaoStarUp(index, curPackData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | gubaoID = curPackData.GubaoID
|
| | |
|
| | | lv, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not star:
|
| | | if not IsGubaoActivated(curPlayer, gubaoID):
|
| | | GameWorld.DebugLog("古宝未激活,无法升星! gubaoID=%s" % gubaoID, playerID)
|
| | | return
|
| | |
|
| | | if not IpyGameDataPY.GetIpyGameDataNotLog("GubaoStar", gubaoID, star + 1):
|
| | | GameWorld.DebugLog("古宝已满星! gubaoID=%s,star=%s" % (gubaoID, star), playerID)
|
| | | gubaoIpyData = IpyGameDataPY.GetIpyGameData("Gubao", gubaoID)
|
| | | if not gubaoIpyData:
|
| | | return
|
| | | quality = gubaoIpyData.GetGubaoQuality()
|
| | | selfItemID = gubaoIpyData.GetUnlockItemID()
|
| | |
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("GubaoStar", gubaoID, star)
|
| | | if not ipyData:
|
| | | return
|
| | | needItemList = ipyData.GetStarUPNeedItemInfo()
|
| | | needQualityPiece = ipyData.GetStarUPNeedQualityPiece()
|
| | | if not needItemList and not needQualityPiece:
|
| | | return
|
| | | lv, star, layer = GetGubaoInfo(curPlayer, gubaoID)
|
| | | nextStar = star + 1
|
| | |
|
| | | needPieceInfo, realNeedItemList = ParseGubaoNeedItem(curPlayer, needItemList)
|
| | | if realNeedItemList:
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("GubaoStar", quality)
|
| | | if not ipyDataList:
|
| | | return
|
| | | nextIpyData = None
|
| | | for ipyData in ipyDataList:
|
| | | if ipyData.GetGubaoStar() == nextStar:
|
| | | nextIpyData = ipyData
|
| | | break
|
| | | if not nextIpyData:
|
| | | GameWorld.DebugLog("古宝已满星! gubaoID=%s,quality=%s,star=%s" % (gubaoID, quality, star), playerID)
|
| | | return
|
| | | needSelfCnt = nextIpyData.GetStarUPNeedSelfCnt()
|
| | | needItemList = nextIpyData.GetStarUPNeedItemList()
|
| | | |
| | | if needItemList:
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(realNeedItemList, itemPack)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("古宝升星所需物品不足! star=%s,realNeedItemList=%s,lackItemDict=%s" % (star, realNeedItemList, lackItemDict), playerID)
|
| | | GameWorld.DebugLog("古宝升星所需物品不足! quality=%s,nextStar=%s,needItemList=%s,lackItemDict=%s" % (quality, nextStar, needItemList, lackItemDict), playerID)
|
| | | return
|
| | |
|
| | | if needQualityPiece:
|
| | | commPieceUseLimitInfo = IpyGameDataPY.GetFuncEvalCfg("GubaoPiece", 1, {})
|
| | | selectPieceDict = {}
|
| | | for pieceUse in curPackData.CommPieceUseList:
|
| | | useGubaoID = pieceUse.GubaoID
|
| | | usePieceCnt = pieceUse.PieceCount
|
| | | useIpyData = IpyGameDataPY.GetIpyGameData("Gubao", useGubaoID)
|
| | | if not useIpyData:
|
| | | return
|
| | | quality = useIpyData.GetGubaoQuality()
|
| | | if str(quality) not in commPieceUseLimitInfo:
|
| | | GameWorld.DebugLog("该古宝品质没有配置可作为通用碎片使用的最低星级! useGubaoID=%s" % (useGubaoID), playerID)
|
| | | return
|
| | | needStar = commPieceUseLimitInfo[str(quality)]
|
| | | _, usePieceStar = GetGubaoLVInfo(curPlayer, useGubaoID)
|
| | | if usePieceStar < needStar:
|
| | | GameWorld.DebugLog("该古宝品质星级不足,无法作为通用碎片! useGubaoID=%s,usePieceStar=%s < %s" % (useGubaoID, usePieceStar, needStar), playerID)
|
| | | return
|
| | | selectPieceDict[quality] = selectPieceDict.get(quality, 0) + usePieceCnt
|
| | | needPieceInfo[useGubaoID] = needPieceInfo.get(useGubaoID, 0) + usePieceCnt
|
| | | |
| | | for quality, needCount in needQualityPiece:
|
| | | selectCount = selectPieceDict.get(quality, 0)
|
| | | if selectCount != needCount: # 需精确匹配个数,多或少都不允许升星,防止多扣或者少扣
|
| | | GameWorld.ErrLog("选择使用的品质通用碎片个数不匹配,无法升星! gubaoID=%s,star=%s,quality=%s,selectCount=%s != %s" |
| | | % (gubaoID, star, quality, selectCount, needCount), playerID)
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("所需古宝碎片汇总: %s" % needPieceInfo, playerID)
|
| | | |
| | | for costGubaoID, needPieceCount in needPieceInfo.items():
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % costGubaoID)
|
| | | if curCount < needPieceCount:
|
| | | GameWorld.DebugLog("古宝升星所需古宝碎片不足! gubaoID=%s,costGubaoID=%s,curCount=%s < needPieceCount=%s" % (gubaoID, costGubaoID, curCount, needPieceCount), playerID)
|
| | | if needSelfCnt:
|
| | | if not ItemControler.CheckItemEnoughByID(curPlayer, selfItemID, needSelfCnt):
|
| | | return
|
| | |
|
| | | #扣消耗
|
| | | for costGubaoID, needPieceCount in needPieceInfo.items():
|
| | | DelGubaoPiece(curPlayer, costGubaoID, needPieceCount, "StarUp")
|
| | | if realNeedItemList:
|
| | | if selfItemID and needSelfCnt:
|
| | | ItemControler.DelItemCountByID(curPlayer, selfItemID, needSelfCnt)
|
| | | if needItemList:
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "Gubao")
|
| | |
|
| | | updStar = star + 1
|
| | | SetGubaoLVInfo(curPlayer, gubaoID, lv, updStar)
|
| | | GameWorld.Log("古宝升星: gubaoID=%s,updStar=%s" % (gubaoID, updStar), playerID)
|
| | | DoGubaoAddFreePoint(curPlayer, gubaoID)
|
| | | updStar = nextStar
|
| | | SetGubaoInfo(curPlayer, gubaoID, lv, updStar, layer)
|
| | | GameWorld.DebugLog("古宝升星: gubaoID=%s,updStar=%s,needSelfCnt=%s,needItemList=%s" % (gubaoID, updStar, needSelfCnt, needItemList), playerID)
|
| | | |
| | | RefreshGubaoAttr(curPlayer)
|
| | | Sync_GubaoInfo(curPlayer, [gubaoID])
|
| | | |
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_GubaoStarUp)
|
| | | return
|
| | |
|
| | | def DoGubaoAddFreePoint(curPlayer, gubaoID=0):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | effPointDict = {}
|
| | | if gubaoID:
|
| | | __calcStarEffAddFreePoint(curPlayer, gubaoID, effPointDict)
|
| | | else:
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | __calcStarEffAddFreePoint(curPlayer, gubaoID, effPointDict)
|
| | | |
| | | if not effPointDict:
|
| | | return
|
| | | |
| | | unAddFreePointTotal = 0
|
| | | for effKey, addFreePointTotal in effPointDict.items():
|
| | | gubaoID, star, effType = effKey |
| | | # 已增加的点数
|
| | | addFreePointAlready = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType))
|
| | | unAddFreePoint = max(0, addFreePointTotal - addFreePointAlready)
|
| | | unAddFreePointTotal += unAddFreePoint
|
| | | GameWorld.DebugLog("古宝星级增加灵根点: gubaoID=%s,star=%s,effType=%s,addFreePointTotal=%s,addFreePointAlready=%s,unAddFreePoint=%s,total=%s" |
| | | % (gubaoID, star, effType, addFreePointTotal, addFreePointAlready, unAddFreePoint, unAddFreePointTotal), playerID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType), addFreePointTotal)
|
| | | if unAddFreePoint:
|
| | | Sync_GubaoItemEffInfo(curPlayer, gubaoID, effType, True)
|
| | | |
| | | if unAddFreePointTotal <= 0:
|
| | | return
|
| | | freePoint = curPlayer.GetFreePoint()
|
| | | updFreePoint = freePoint + unAddFreePointTotal
|
| | | curPlayer.SetFreePoint(updFreePoint)
|
| | | GameWorld.DebugLog("古宝加点: freePoint=%s,freePoint=%s,freePoint=%s" % (freePoint, unAddFreePointTotal, updFreePoint), playerID)
|
| | | return
|
| | |
|
| | | def __calcStarEffAddFreePoint(curPlayer, gubaoID, effPointDict):
|
| | | _, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not star:
|
| | | return
|
| | | starIpyData = IpyGameDataPY.GetIpyGameData("GubaoStar", gubaoID, star)
|
| | | if not starIpyData:
|
| | | return
|
| | | starEffIDList = starIpyData.GetStarEffIDList()
|
| | | for effID in starEffIDList:
|
| | | effIpyData = IpyGameDataPY.GetIpyGameData("GubaoEffAttr", effID)
|
| | | if not effIpyData:
|
| | | continue
|
| | | effType = effIpyData.GetGubaoEffType()
|
| | | effCond = effIpyData.GetEffCond()
|
| | | effAttrValue = effIpyData.GetEffAttrValue()
|
| | | |
| | | effKey = (gubaoID, star, effType)
|
| | | if effType == 54: # 增加x点灵根
|
| | | addFreePointTotal = effIpyData.GetEffAttrValue()
|
| | | effPointDict[effKey] = effPointDict.get(effKey, 0) + addFreePointTotal
|
| | | elif effType == 55: # 境界每级增加X点灵根
|
| | | realmLV = curPlayer.GetOfficialRank()
|
| | | addFreePointTotal = int(realmLV / effCond * effAttrValue)
|
| | | effPointDict[effKey] = effPointDict.get(effKey, 0) + addFreePointTotal
|
| | | elif effType == 56: # 等级每级增加X点灵根
|
| | | playerLV = curPlayer.GetLV()
|
| | | addFreePointTotal = int(playerLV / effCond * effAttrValue)
|
| | | effPointDict[effKey] = effPointDict.get(effKey, 0) + addFreePointTotal
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | #// B2 18 古宝升级 #tagCMGubaoLVUp
|
| | | #
|
| | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | gubaoID = curPackData.GubaoID
|
| | |
|
| | | lv, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not star:
|
| | | if not IsGubaoActivated(curPlayer, gubaoID):
|
| | | GameWorld.DebugLog("古宝未激活,无法升级! gubaoID=%s" % gubaoID, playerID)
|
| | | return
|
| | |
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Gubao", gubaoID)
|
| | | if not ipyData:
|
| | | gubaoIpyData = IpyGameDataPY.GetIpyGameData("Gubao", gubaoID)
|
| | | if not gubaoIpyData:
|
| | | return
|
| | | gubaoType = ipyData.GetGubaoType()
|
| | | quality = ipyData.GetGubaoQuality()
|
| | | quality = gubaoIpyData.GetGubaoQuality()
|
| | |
|
| | | if not IpyGameDataPY.GetIpyGameDataNotLog("GubaoLV", gubaoType, quality, lv + 1):
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("GubaoLV", quality)
|
| | | if not ipyDataList:
|
| | | return
|
| | | |
| | | lv, star, layer = GetGubaoInfo(curPlayer, gubaoID)
|
| | | nextLV = lv + 1
|
| | | nextIpyData = None
|
| | | for ipyData in ipyDataList:
|
| | | if nextLV <= ipyData.GetLessEqualLV():
|
| | | nextIpyData = ipyData
|
| | | break
|
| | | |
| | | if not nextIpyData:
|
| | | GameWorld.DebugLog("古宝已满级! gubaoID=%s,quality=%s,lv=%s" % (gubaoID, quality, lv), playerID)
|
| | | return
|
| | |
|
| | | lvIpyData = IpyGameDataPY.GetIpyGameData("GubaoLV", gubaoType, quality, lv)
|
| | | if not lvIpyData:
|
| | | return
|
| | | needItemList = lvIpyData.GetLVUPNeedItemInfo()
|
| | | if not needItemList:
|
| | | return
|
| | | |
| | | needPieceInfo, realNeedItemList = ParseGubaoNeedItem(curPlayer, needItemList)
|
| | | if realNeedItemList:
|
| | | needItemList = nextIpyData.GetLVUPNeedItemInfo()
|
| | | if needItemList:
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(realNeedItemList, itemPack)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("古宝升级所需物品不足! quality=%s,lv=%s,realNeedItemList=%s,lackItemDict=%s" |
| | | % (quality, lv, realNeedItemList, lackItemDict), playerID)
|
| | | return
|
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gID)
|
| | | if curCount < needPieceCount:
|
| | | GameWorld.DebugLog("古宝升级所需古宝碎片不足! gubaoID=%s,curCount=%s < needPieceCount=%s" % (gubaoID, curCount, needPieceCount), playerID)
|
| | | GameWorld.DebugLog("古宝升级所需物品不足! quality=%s,nextLV=%s,needItemList=%s,lackItemDict=%s" |
| | | % (quality, nextLV, needItemList, lackItemDict), playerID)
|
| | | return
|
| | |
|
| | | #扣消耗
|
| | | for gID, needPieceCount in needPieceInfo.items():
|
| | | DelGubaoPiece(curPlayer, gID, needPieceCount, "LVUp")
|
| | | if realNeedItemList:
|
| | | if needItemList:
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "Gubao")
|
| | | |
| | | updLV = nextLV
|
| | | SetGubaoInfo(curPlayer, gubaoID, updLV, star, layer)
|
| | | GameWorld.DebugLog("古宝升级: gubaoID=%s,quality=%s,updLV=%s,needItemList=%s" % (gubaoID, quality, updLV, needItemList), playerID)
|
| | |
|
| | | updLV = lv + 1
|
| | | SetGubaoLVInfo(curPlayer, gubaoID, updLV, star)
|
| | | GameWorld.Log("古宝升级: gubaoID=%s,gubaoType=%s,quality=%s,updLV=%s" % (gubaoID, gubaoType, quality, updLV), playerID)
|
| | | RefreshGubaoAttr(curPlayer)
|
| | | Sync_GubaoInfo(curPlayer, [gubaoID])
|
| | | |
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_GubaoLVUp)
|
| | | return
|
| | |
|
| | | def GetGubaoTotalLVStar(curPlayer):
|
| | |
| | | for index in xrange(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | lv, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | lv, star, _ = GetGubaoInfo(curPlayer, gubaoID)
|
| | | totalLV += lv
|
| | | totalStar += star
|
| | | return totalLV, totalStar
|
| | |
|
| | | def GetGubaoTotalCnt(curPlayer):
|
| | | def GetGubaoTotalCnt(curPlayer, checkCnt=0):
|
| | | ## 获取古宝激活总数
|
| | | return 0
|
| | |
|
| | | def RefreshGubaoAttr(curPlayer):
|
| | | #CalcGubaoAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | | def CalcGubaoAttr(curPlayer):
|
| | | |
| | | allAttrList = [{} for _ in range(4)]
|
| | | allAttrListResonance = [{} for _ in range(4)]
|
| | | |
| | | # @param checkCnt: 可指定需要验证的所需个数,当达到该个数时直接返回该个数
|
| | | totalCount = 0
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | lv, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not star:
|
| | | if not IsGubaoActivated(curPlayer, gubaoID):
|
| | | continue
|
| | | totalCount += 1
|
| | | if checkCnt and totalCount >= checkCnt:
|
| | | break
|
| | | return totalCount
|
| | |
|
| | | def RefreshGubaoAttr(curPlayer):
|
| | | CalcGubaoAttr(curPlayer)
|
| | | PlayerOnline.GetOnlinePlayer(curPlayer).RefreshRoleAttr()
|
| | | return
|
| | |
|
| | | def CalcGubaoAttr(curPlayer):
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | attrDict = {}
|
| | | |
| | | gubaoStarDict = {}
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | |
| | | if not IsGubaoActivated(curPlayer, gubaoID):
|
| | | continue
|
| | |
|
| | | gubaoType = ipyData.GetGubaoType()
|
| | | quality = ipyData.GetGubaoQuality()
|
| | | lvIpyData = IpyGameDataPY.GetIpyGameData("GubaoLV", gubaoType, quality, lv)
|
| | | if lvIpyData:
|
| | | lvAttrTypeList = lvIpyData.GetLVAttrTypeList()
|
| | | lvAttrValueList = lvIpyData.GetLVAttrValueList()
|
| | | for i, attrID in enumerate(lvAttrTypeList):
|
| | | attrValue = lvAttrValueList[i]
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
|
| | | |
| | | starIpyData = IpyGameDataPY.GetIpyGameData("GubaoStar", gubaoID, star)
|
| | | if starIpyData:
|
| | | starAttrIDList = starIpyData.GetStarAttrIDList()
|
| | | starAttrValueList = starIpyData.GetStarAttrValueList()
|
| | | for i, attrID in enumerate(starAttrIDList):
|
| | | attrValue = starAttrValueList[i]
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
|
| | | |
| | | starEffIDList = starIpyData.GetStarEffIDList()
|
| | | effAttrInfo = {}
|
| | | #GameWorld.DebugLog("GubaoStar属性: gubaoID=%s,star=%s,starEffIDList=%s" % (gubaoID, star, starEffIDList))
|
| | | for effID in starEffIDList:
|
| | | __calcStarEffAttrByID(curPlayer, gubaoID, effID, effAttrInfo)
|
| | | #GameWorld.DebugLog(" effID=%s,effAttrInfo=%s" % (effID, effAttrInfo))
|
| | | for attrID, attrValue in effAttrInfo.items():
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
|
| | | |
| | | lv, star, layer = GetGubaoInfo(curPlayer, gubaoID)
|
| | | gubaoStarDict[gubaoID] = star
|
| | | |
| | | # 基础属性
|
| | | BaseAttrIDList = ipyData.GetBaseAttrIDList()
|
| | | BaseAttrValueList = ipyData.GetBaseAttrValueList()
|
| | | BaseAttrPerStarAddList = ipyData.GetBaseAttrPerStarAddList()
|
| | | for bIndex, attrID in enumerate(BaseAttrIDList):
|
| | | baseValue = BaseAttrValueList[bIndex]
|
| | | perStarAdd = BaseAttrPerStarAddList[bIndex]
|
| | | attrValue = baseValue + perStarAdd * star
|
| | | attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
|
| | | GameWorld.DebugLog("古宝基础属性! gubaoID=%s,star=%s,addAttr=%s,v:%s,perStar:%s,%s" |
| | | % (gubaoID, star, BaseAttrIDList, BaseAttrValueList, BaseAttrPerStarAddList, attrDict), playerID)
|
| | | |
| | | # 特殊属性
|
| | | attrID = ipyData.GetSpecAttrID()
|
| | | effType = ipyData.GetSpecEffType()
|
| | | SpecAttrValue = ipyData.GetSpecAttrValue()
|
| | | SpecAttrPerLVAdd = ipyData.GetSpecAttrPerLVAdd()
|
| | | SpecAttrPerStarAdd = ipyData.GetSpecAttrPerStarAdd()
|
| | | attrValue = SpecAttrValue + SpecAttrPerLVAdd * max(lv - 1, 0) + SpecAttrPerStarAdd * star
|
| | | if effType: # 有特殊效果类型的
|
| | | attrValue *= layer
|
| | | attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
|
| | | GameWorld.DebugLog("古宝特殊属性! gubaoID=%s,lv=%s,star=%s,effType=%s,layer=%s,attrID=%s,v=%s,perLV=%s,perStar=%s,attrValue=%s,%s" |
| | | % (gubaoID, lv, star, effType, layer, attrID, SpecAttrValue, SpecAttrPerLVAdd, SpecAttrPerStarAdd, attrValue, attrDict), playerID)
|
| | | |
| | | # 共鸣
|
| | | for index in range(ipyDataMgr.GetGubaoResonanceCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoResonanceByIndex(index)
|
| | |
| | | gubaoIDList = ipyData.GetGubaoIDList()
|
| | | if not gubaoIDList:
|
| | | continue
|
| | | |
| | | gubaoStarDict = {}
|
| | | for gubaoID in gubaoIDList:
|
| | | _, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | gubaoStarDict[gubaoID] = star
|
| | | minStar = min(gubaoStarDict.values()) # 共鸣星级,取组合中最低古宝星级
|
| | | if not minStar:
|
| | | #GameWorld.DebugLog("共鸣组合存在古宝未激活! resonanceID=%s,gubaoStarDict=%s" % (resonanceID, gubaoStarDict))
|
| | | continue
|
| | | starList = [gubaoStarDict.get(gubaoID, 0) for gubaoID in gubaoIDList]
|
| | | minStar = min(starList) # 共鸣星级,取组合中最低古宝星级
|
| | |
|
| | | attrIpyDataList = IpyGameDataPY.GetIpyGameDataList("GubaoResonanceAttr", resonanceID)
|
| | | if not attrIpyDataList:
|
| | |
| | | resonanceAttrIpyData = attrIpyData
|
| | |
|
| | | if not resonanceAttrIpyData:
|
| | | #GameWorld.DebugLog("没有古宝共鸣属性! resonanceID=%s,minStar=%s" % (resonanceID, minStar))
|
| | | GameWorld.DebugLog("没有古宝共鸣属性! resonanceID=%s,minStar=%s,starList=%s" % (resonanceID, minStar, starList), playerID)
|
| | | continue
|
| | |
|
| | | #GameWorld.DebugLog("古宝共鸣: resonanceID=%s,resonanceStar=%s,gubaoStarDict=%s" % (resonanceID, resonanceAttrIpyData.GetResonanceStar(), gubaoStarDict))
|
| | | resonanceAttrIDList = resonanceAttrIpyData.GetResonanceAttrIDList()
|
| | | resonanceAttrValueList = resonanceAttrIpyData.GetResonanceAttrValueList()
|
| | | for i, attrID in enumerate(resonanceAttrIDList):
|
| | | attrValue = resonanceAttrValueList[i]
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListResonance)
|
| | | |
| | | attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
|
| | | GameWorld.DebugLog("古宝共鸣: resonanceID=%s,resonanceStar=%s,starList=%s,addAttr=%s,%s,%s" |
| | | % (resonanceID, resonanceAttrIpyData.GetResonanceStar(), starList, |
| | | resonanceAttrIDList, resonanceAttrValueList, attrDict), playerID)
|
| | | |
| | | # 保存计算值
|
| | | #GameWorld.DebugLog("古宝属性: %s" % allAttrList)
|
| | | #GameWorld.DebugLog("古宝共鸣属性: %s" % allAttrListResonance)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Gubao, allAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_GubaoResonance, allAttrListResonance)
|
| | | GameWorld.DebugLog("古宝属性: %s" % attrDict, playerID)
|
| | | PlayerOnline.GetOnlinePlayer(curPlayer).SetCalcAttr(ChConfig.Def_CalcAttr_Gubao, attrDict)
|
| | | return
|
| | |
|
| | | def __calcStarEffAttrByID(curPlayer, gubaoID, effID, effAttrInfo):
|
| | | ''' 计算古宝特殊效果ID对应提升属性
|
| | | '''
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("GubaoEffAttr", effID)
|
| | | if not ipyData:
|
| | | return
|
| | | effType = ipyData.GetGubaoEffType()
|
| | | effCond = ipyData.GetEffCond()
|
| | | effCond2 = ipyData.GetEffCond2()
|
| | | effCond3 = ipyData.GetEffCond3()
|
| | | attrID = ipyData.GetEffAttrID()
|
| | | effAttrValue = ipyData.GetEffAttrValue()
|
| | | if effAttrValue <= 0:
|
| | | return
|
| | | #效果类型 类型说明 条件
|
| | | # 10 x品质灵宠攻击属性提升x% x品质
|
| | | if effType == 10:
|
| | | customAttrDictPet = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Pet)[2]
|
| | | petQualityAttrInfo = customAttrDictPet.get("petQualityAttrInfo", {})
|
| | | quality = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,quality=%s,petQualityAttrInfo=%s" % (effID, effType, quality, petQualityAttrInfo))
|
| | | if quality not in petQualityAttrInfo:
|
| | | return
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, petQualityAttrInfo[quality], effAttrValue)
|
| | | |
| | | # 11 灵宠总等级每x级+xx属性 x级
|
| | | elif effType == 11:
|
| | | totalPetLV = PlayerPet.GetTotalPetLV(curPlayer)
|
| | | addAttrValue = int(totalPetLV / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,totalPetLV=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, totalPetLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | # 12 灵宠每激活x只+xx属性 x只
|
| | | elif effType == 12:
|
| | | totalPetCount = PlayerPet.GetTotalPetCount(curPlayer)
|
| | | addAttrValue = int(totalPetCount / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,totalPetCount=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, totalPetCount, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | # 13 x品质坐骑幻化属性提升x% x品质
|
| | | elif effType == 13:
|
| | | customAttrDictSkin = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSkin)[2]
|
| | | horseSkinQualityAttrInfo = customAttrDictSkin.get("horseSkinQualityAttrInfo", {})
|
| | | quality = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,quality=%s,horseSkinQualityAttrInfo=%s" % (effID, effType, quality, horseSkinQualityAttrInfo))
|
| | | if quality not in horseSkinQualityAttrInfo:
|
| | | return
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, horseSkinQualityAttrInfo[quality], effAttrValue)
|
| | | |
| | | # 14 坐骑幻化激活x只+xx属性 x只
|
| | | elif effType == 14:
|
| | | horseSkinActCount = PlayerHorse.GetHorseSkinActCount(curPlayer)
|
| | | addAttrValue = int(horseSkinActCount / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,horseSkinActCount=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, horseSkinActCount, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | # 15 每培养坐骑x次+xx属性 x次
|
| | | elif effType == 15:
|
| | | pass
|
| | | |
| | | #16 x阶装备强化属性提升x% x阶
|
| | | elif effType == 16:
|
| | | customAttrDictPlus = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Plus)[2]
|
| | | classBaseAttrDictPlus = customAttrDictPlus.get("classBaseAttrDictPlus", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classBaseAttrDictPlus=%s" % (effID, effType, classLV, classBaseAttrDictPlus))
|
| | | if classLV not in classBaseAttrDictPlus:
|
| | | return
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, classBaseAttrDictPlus[classLV], effAttrValue)
|
| | | |
| | | #17 x阶装备宝石属性提升x% x阶
|
| | | elif effType == 17:
|
| | | customAttrDictStone = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Stone)[2]
|
| | | classBaseAttrDictStone = customAttrDictStone.get("classBaseAttrDictStone", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classBaseAttrDictStone=%s" % (effID, effType, classLV, classBaseAttrDictStone))
|
| | | if classLV not in classBaseAttrDictStone:
|
| | | return
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, classBaseAttrDictStone[classLV], effAttrValue)
|
| | | |
| | | #18 x阶装备升星属性提升x% x阶
|
| | | elif effType == 18:
|
| | | customAttrDictStar = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Star)[2]
|
| | | classBaseAttrDictStar = customAttrDictStar.get("classBaseAttrDictStar", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classBaseAttrDictStar=%s" % (effID, effType, classLV, classBaseAttrDictStar))
|
| | | if classLV not in classBaseAttrDictStar:
|
| | | return
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, classBaseAttrDictStar[classLV], effAttrValue)
|
| | | |
| | | #19 x阶装备洗炼属性提升x% x阶
|
| | | elif effType == 19:
|
| | | customAttrDictWash = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Wash)[2]
|
| | | classBaseAttrDictWash = customAttrDictWash.get("classBaseAttrDictWash", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classBaseAttrDictWash=%s" % (effID, effType, classLV, classBaseAttrDictWash))
|
| | | if classLV not in classBaseAttrDictWash:
|
| | | return
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, classBaseAttrDictWash[classLV], effAttrValue)
|
| | | |
| | | #20 x阶装备附魔属性提升x% x阶
|
| | | elif effType == 20:
|
| | | customAttrDictEnchant = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Enchant)[2]
|
| | | classBaseAttrDictEnchant = customAttrDictEnchant.get("classBaseAttrDictEnchant", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classBaseAttrDictEnchant=%s" % (effID, effType, classLV, classBaseAttrDictEnchant))
|
| | | if classLV not in classBaseAttrDictEnchant:
|
| | | return
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, classBaseAttrDictEnchant[classLV], effAttrValue)
|
| | | |
| | | #21 出战神兽装备强化每x级+xx属性 x级
|
| | | elif effType == 21:
|
| | | fightDogzTotalPlusLv = PlayerDogz.GetFightDogzTotalPlusLv(curPlayer)
|
| | | addAttrValue = int(fightDogzTotalPlusLv / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,fightDogzTotalPlusLv=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, fightDogzTotalPlusLv, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #24 符印等级每每x级+xx属性 x级
|
| | | elif effType == 24:
|
| | | runeTotalLV = PlayerRune.GetRuneTotalLV(curPlayer)
|
| | | addAttrValue = int(runeTotalLV / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,runeTotalLV=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, runeTotalLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #26 x阶装备强化每x级+xx属性 x阶 x级
|
| | | elif effType == 26:
|
| | | customAttrDictPlus = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Plus)[2]
|
| | | classPlusLVDict = customAttrDictPlus.get("classPlusLVDict", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classPlusLVDict=%s" % (effID, effType, classLV, classPlusLVDict))
|
| | | if classLV not in classPlusLVDict:
|
| | | return
|
| | | totalPlusLV = classPlusLVDict[classLV]
|
| | | addAttrValue = int(totalPlusLV / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effCond=%s,effCond2=%s,totalPlusLV=%s,attrID=%s,addAttrValue=%s" % (effCond, effCond2, totalPlusLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #27 x阶装备宝石每x级+xx属性 x阶 x级
|
| | | elif effType == 27:
|
| | | customAttrDictStone = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Stone)[2]
|
| | | classStoneLVDict = customAttrDictStone.get("classStoneLVDict", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classStoneLVDict=%s" % (effID, effType, classLV, classStoneLVDict))
|
| | | if classLV not in classStoneLVDict:
|
| | | return
|
| | | totalStoneLV = classStoneLVDict[classLV]
|
| | | addAttrValue = int(totalStoneLV / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effCond=%s,effCond2=%s,totalStoneLV=%s,attrID=%s,addAttrValue=%s" % (effCond, effCond2, totalStoneLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #28 x阶装备升星每x星+xx属性 x阶 x星
|
| | | elif effType == 28:
|
| | | customAttrDictStar = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Star)[2]
|
| | | classStarLVDict = customAttrDictStar.get("classStarLVDict", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classStarLVDict=%s" % (effID, effType, classLV, classStarLVDict))
|
| | | if classLV not in classStarLVDict:
|
| | | return
|
| | | totalStarLV = classStarLVDict[classLV]
|
| | | addAttrValue = int(totalStarLV / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effCond=%s,effCond2=%s,totalStarLV=%s,attrID=%s,addAttrValue=%s" % (effCond, effCond2, totalStarLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #29 x阶装备洗练每x级+xx属性 x阶 x级
|
| | | elif effType == 29:
|
| | | customAttrDictWash = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Wash)[2]
|
| | | classWashLVDict = customAttrDictWash.get("classWashLVDict", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classWashLVDict=%s" % (effID, effType, classLV, classWashLVDict))
|
| | | if classLV not in classWashLVDict:
|
| | | return
|
| | | totalWashLV = classWashLVDict[classLV]
|
| | | addAttrValue = int(totalWashLV / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effCond=%s,effCond2=%s,totalWashLV=%s,attrID=%s,addAttrValue=%s" % (effCond, effCond2, totalWashLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #30 x阶装备附魔每x级+xx属性 x阶 x级
|
| | | elif effType == 30:
|
| | | customAttrDictEnchant = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Enchant)[2]
|
| | | classEnchantLVDict = customAttrDictEnchant.get("classEnchantLVDict", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classEnchantLVDict=%s" % (effID, effType, classLV, classEnchantLVDict))
|
| | | if classLV not in classEnchantLVDict:
|
| | | return
|
| | | totalEnchantLV = classEnchantLVDict[classLV]
|
| | | addAttrValue = int(totalEnchantLV / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effCond=%s,effCond2=%s,totalEnchantLV=%s,attrID=%s,addAttrValue=%s" % (effCond, effCond2, totalEnchantLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #31 x阶装备x件x品质装备+xx属性 x阶 x件 x品质
|
| | | elif effType == 31:
|
| | | customAttrDictEquip = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Equip)[2]
|
| | | classEquipColorDict = customAttrDictEquip.get("classEquipColorDict", {})
|
| | | classLV = effCond
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,classLV=%s,classEquipColorDict=%s" % (effID, effType, classLV, classEquipColorDict))
|
| | | if classLV not in classEquipColorDict:
|
| | | return
|
| | | equipColorDict = classEquipColorDict[classLV]
|
| | | equipColorCnt = 0
|
| | | for itemColor in equipColorDict.values():
|
| | | if itemColor >= effCond3:
|
| | | equipColorCnt += 1
|
| | | addAttrValue = int(equipColorCnt / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effCond=%s,effCond2=%s,effCond3=%s,equipColorCnt=%s,attrID=%s,addAttrValue=%s" % (effCond, effCond2, effCond3, equipColorCnt, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #32 获得x点灵根点+xx属性 x点
|
| | | elif effType == 32:
|
| | | totalLingGenPoint = PlayerControl.GetTotalLingGenPoint(curPlayer)
|
| | | addAttrValue = int(totalLingGenPoint / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,totalLingGenPoint=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, totalLingGenPoint, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #41 x类型神兵每X级+X属性 x类型 x级
|
| | | elif effType == 41:
|
| | | gwType = effCond
|
| | | gwLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % gwType)
|
| | | addAttrValue = int(gwLV / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,gwType=%s,gwLV=%s,effCond2=%s,attrID=%s,addAttrValue=%s" % (effID, effType, gwType, gwLV, effCond2, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #42 法器每X阶+X%法器总属性 x阶
|
| | | elif effType == 42:
|
| | | customAttrDictFaQi = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_FaQi)[2]
|
| | | faQiAllAttrInfo = customAttrDictFaQi.get("faQiAllAttrInfo", {})
|
| | | faQiLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FaQiLV)
|
| | | addPer = int(faQiLV / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,faQiLV=%s,addPer=%s,faQiAllAttrInfo=%s" % (effID, effType, faQiLV, addPer, faQiAllAttrInfo))
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, faQiAllAttrInfo, addPer)
|
| | | |
| | | #43 每拥有X个X类型的称号+X属性 x类型 x个
|
| | | elif effType == 43:
|
| | | activeTypeCountDict = PlayerDienstgrad.GetDienstgradActiveTypeCountInfo(curPlayer)
|
| | | dType = effCond
|
| | | activeCount = activeTypeCountDict.get(dType, 0)
|
| | | addAttrValue = int(activeCount / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,dType=%s,activeTypeCountDict=%s,effCond2=%s,attrID=%s,addAttrValue=%s" % (effID, effType, dType, activeTypeCountDict, effCond2, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | |
| | | #44 X品质时装总星数每X星+X属性 x类型 x星
|
| | | elif effType == 44:
|
| | | costQualityLVDict = PlayerCoat.GetCoatQualityLVInfo(curPlayer)
|
| | | quality = effCond
|
| | | lvTotal = costQualityLVDict.get(quality, 0)
|
| | | addAttrValue = int(lvTotal / effCond2 * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,quality=%s,costQualityLVDict=%s,effCond2=%s,attrID=%s,addAttrValue=%s" % (effID, effType, quality, costQualityLVDict, effCond2, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #45 每X级魅力等级+X属性 x级
|
| | | elif effType == 45:
|
| | | charmLV = PlayerControl.GetCharmLV(curPlayer)
|
| | | addAttrValue = int(charmLV / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,charmLV=%s,effCond=%s,attrID=%s,addAttrValue=%s" % (effID, effType, charmLV, effCond, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #46 每拥有X个神通技能+X属性 x个
|
| | | elif effType == 46:
|
| | | customAttrDictShentong = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Shentong)[2]
|
| | | shentongSkillInfo = customAttrDictShentong.get("shentongSkillInfo", {})
|
| | | skillCount = len(shentongSkillInfo)
|
| | | addAttrValue = int(skillCount / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,skillCount=%s,effCond=%s,attrID=%s,addAttrValue=%s,shentongSkillInfo=%s" % (effID, effType, skillCount, effCond, attrID, addAttrValue, shentongSkillInfo))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #47 神通技能总等级每X级+X属性 x级
|
| | | elif effType == 47:
|
| | | customAttrDictShentong = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Shentong)[2]
|
| | | shentongSkillInfo = customAttrDictShentong.get("shentongSkillInfo", {})
|
| | | skillLVTotal = sum(shentongSkillInfo.values())
|
| | | addAttrValue = int(skillLVTotal / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,skillLVTotal=%s,effCond=%s,attrID=%s,addAttrValue=%s,shentongSkillInfo=%s" % (effID, effType, skillLVTotal, effCond, attrID, addAttrValue, shentongSkillInfo))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #48 参与仙盟联赛每X次+XXX属性 x次
|
| | | #49 参与上古战场每X次+XXX属性 x次
|
| | | #50 参与古神战场每X次+XXX属性 x次
|
| | | #51 参与魔王入侵每X次+XXX属性 x次
|
| | | #52 参与逐鹿万界每X次+XXX属性 x次
|
| | | elif effType in GubaoEffAttrIypeList:
|
| | | effValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType))
|
| | | addAttrValue = int(effValue / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effValue=%s,effCond=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effValue, effCond, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #57 坐骑基础属性提升x%
|
| | | elif effType == 57:
|
| | | customAttrDict = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Horse)[2]
|
| | | horseBaseAttrInfo = customAttrDict.get("horseBaseAttrInfo", {})
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,horseBaseAttrInfo=%s,effAttrInfo=%s" % (effID, effType, horseBaseAttrInfo, effAttrInfo))
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, horseBaseAttrInfo, effAttrValue)
|
| | | |
| | | #58 坐骑每x级+xx属性 x级
|
| | | elif effType == 58:
|
| | | horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV)
|
| | | addAttrValue = int(horseLV / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,horseLV=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, horseLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | #59 法器每X阶+xx属性 x阶
|
| | | elif effType == 59:
|
| | | faQiLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FaQiLV)
|
| | | addAttrValue = int(faQiLV / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,faQiLV=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, faQiLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | return
|
| | |
|
| | | def __addStarEffFuncAttr(ipyData, effAttrInfo, funcAttrInfo, effAttrValue):
|
| | | if not funcAttrInfo or effAttrValue <= 0:
|
| | | return
|
| | | isPer = ipyData.GetIsPer()
|
| | | effAttrIDList = ipyData.GetEffFuncAttrIDList() # 提升指定功能属性ID列表
|
| | | for attrID, attrValue in funcAttrInfo.items():
|
| | | if effAttrIDList and attrID not in effAttrIDList:
|
| | | continue
|
| | | if isPer:
|
| | | addAttrValue = int(attrValue * effAttrValue / 100.0)
|
| | | else:
|
| | | addAttrValue = effAttrValue
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | return
|
| | |
|
| | | def AddGubaoItemEffValue(curPlayer, effType, addCnt):
|
| | | if effType not in GubaoEffTtemIypeList and effType not in GubaoEffAttrIypeList:
|
| | | return
|
| | | isAttr = False
|
| | | def AddGubaoSpecEffLayer(curPlayer, effType, addLayer):
|
| | | ## 增加古宝特殊效果属性层级
|
| | | gubaoIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | _, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not star:
|
| | | if not IsGubaoActivated(curPlayer, gubaoID):
|
| | | continue
|
| | | starIpyData = IpyGameDataPY.GetIpyGameData("GubaoStar", gubaoID, star)
|
| | | if not starIpyData:
|
| | | if effType != ipyData.GetSpecEffType():
|
| | | continue
|
| | | starEffIDList = starIpyData.GetStarEffIDList()
|
| | | for effID in starEffIDList:
|
| | | effIpyData = IpyGameDataPY.GetIpyGameData("GubaoEffAttr", effID)
|
| | | if not effIpyData:
|
| | | continue
|
| | | if effType != effIpyData.GetGubaoEffType():
|
| | | continue
|
| | | effValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType))
|
| | | updValue = min(effValue + addCnt, ChConfig.Def_UpperLimit_DWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType), updValue)
|
| | | GameWorld.DebugLog("更新古宝物品效果类型进度值: gubaoID=%s,effID=%s,effType=%s,effValue=%s,addCnt=%s,updValue=%s" |
| | | % (gubaoID, effID, effType, effValue, addCnt, updValue), curPlayer.GetPlayerID())
|
| | | Sync_GubaoItemEffInfo(curPlayer, gubaoID, effType, True)
|
| | | if effType in GubaoEffAttrIypeList:
|
| | | isAttr = True
|
| | | |
| | | if isAttr:
|
| | | RefreshGubaoAttr(curPlayer)
|
| | | layerMax = ipyData.GetSpecEffLayerMax()
|
| | | if not layerMax:
|
| | | continue
|
| | | |
| | | lv, star, layer = GetGubaoInfo(curPlayer, gubaoID)
|
| | | if layer >= layerMax:
|
| | | continue
|
| | | layer = min(layerMax, layer + addLayer)
|
| | | SetGubaoInfo(curPlayer, gubaoID, lv, star, layer)
|
| | | gubaoIDList.append(gubaoID)
|
| | | |
| | | if not gubaoIDList:
|
| | | return
|
| | | Sync_GubaoInfo(curPlayer, gubaoIDList)
|
| | | RefreshGubaoAttr(curPlayer)
|
| | | return
|
| | |
|
| | | def GetGubaoItemEffAward(curPlayer, gubaoID, effIDStr):
|
| | | _, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not star:
|
| | | #GameWorld.DebugLog("古宝物品效果领奖! 没有星级! gubaoID=%s" % (gubaoID), curPlayer.GetPlayerID())
|
| | | def GetItemGubaoIDDict():
|
| | | ## 获取物品碎片对应的古宝ID字典
|
| | | ItemGubaoIDDict = IpyGameDataPY.GetConfigEx("ItemGubaoIDDict")
|
| | | if not ItemGubaoIDDict:
|
| | | ItemGubaoIDDict = {}
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in range(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | itemID = ipyData.GetUnlockItemID()
|
| | | ItemGubaoIDDict[itemID] = gubaoID
|
| | | IpyGameDataPY.SetConfigEx("ItemGubaoIDDict", ItemGubaoIDDict)
|
| | | return ItemGubaoIDDict
|
| | |
|
| | | def AutoTransGubaoPiece(curPlayer, itemID):
|
| | | ## 自动转化溢出的古宝碎片
|
| | | ItemGubaoIDDict = GetItemGubaoIDDict()
|
| | | if itemID not in ItemGubaoIDDict:
|
| | | return
|
| | | starIpyData = IpyGameDataPY.GetIpyGameData("GubaoStar", gubaoID, star)
|
| | | if not starIpyData:
|
| | | gubaoID = ItemGubaoIDDict[itemID]
|
| | | if not IsGubaoActivated(curPlayer, gubaoID):
|
| | | return
|
| | | starEffIDList = starIpyData.GetStarEffIDList()
|
| | | effID = GameWorld.ToIntDef(effIDStr)
|
| | | if not effID or effID not in starEffIDList:
|
| | | GameWorld.DebugLog("古宝物品效果领奖! 该星级不存在该效果ID! gubaoID=%s,star=%s,effID=%s" |
| | | % (gubaoID, star, effID), curPlayer.GetPlayerID())
|
| | | gubaoIpyData = IpyGameDataPY.GetIpyGameData("Gubao", gubaoID)
|
| | | if not gubaoIpyData:
|
| | | return
|
| | | effIpyData = IpyGameDataPY.GetIpyGameData("GubaoEffAttr", effID)
|
| | | if not effIpyData:
|
| | | if gubaoIpyData.GetUnlockItemID() != itemID:
|
| | | return
|
| | | effType = effIpyData.GetGubaoEffType()
|
| | | if effType not in GubaoEffTtemIypeList:
|
| | | GameWorld.DebugLog("古宝物品效果领奖! 非物品效果类型! gubaoID=%s,star=%s,effID=%s,effType=%s" |
| | | % (gubaoID, star, effID, effType), curPlayer.GetPlayerID())
|
| | | quality = gubaoIpyData.GetGubaoQuality()
|
| | | |
| | | starIpyDataList = IpyGameDataPY.GetIpyGameDataList("GubaoStar", quality)
|
| | | if not starIpyDataList:
|
| | | return
|
| | | condValue = effIpyData.GetEffCond()
|
| | | awardItemList = effIpyData.GetEffItemAwardList()
|
| | | if not condValue or not awardItemList:
|
| | | |
| | | itemCount = ItemControler.GetItemCountByID(curPlayer, itemID)
|
| | | if itemCount <= 0:
|
| | | return
|
| | | effValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType))
|
| | | getTimes = effValue / condValue
|
| | | if getTimes <= 0:
|
| | | GameWorld.DebugLog("古宝物品效果领奖! 未达到领奖条件! gubaoID=%s,star=%s,effID=%s,effType=%s,effValue=%s,condValue=%s" |
| | | % (gubaoID, star, effID, effType, effValue, condValue), curPlayer.GetPlayerID())
|
| | | |
| | | _, star, _ = GetGubaoInfo(curPlayer, gubaoID) |
| | | needPieceTotal = 0 # 还需碎片个数
|
| | | for ipyData in starIpyDataList:
|
| | | if star >= ipyData.GetGubaoStar():
|
| | | continue
|
| | | needSelfCnt = ipyData.GetStarUPNeedSelfCnt() # 升星所需
|
| | | if not needSelfCnt:
|
| | | continue
|
| | | needPieceTotal += needSelfCnt
|
| | | if itemCount <= needPieceTotal:
|
| | | return
|
| | | |
| | | transPieceCnt = itemCount - needPieceTotal # 溢出数量
|
| | | if transPieceCnt <= 0:
|
| | | return
|
| | | awardItemTotalList = []
|
| | | if getTimes > 1:
|
| | | for itemID, itemCount, isAuctionItem in awardItemList:
|
| | | awardItemTotalList.append([itemID, int(itemCount * getTimes), isAuctionItem])
|
| | | else:
|
| | | awardItemTotalList = awardItemList
|
| | | updValue = effValue % condValue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType), updValue)
|
| | | Sync_GubaoItemEffInfo(curPlayer, gubaoID, effType, True)
|
| | | GameWorld.DebugLog("古宝物品效果领奖: gubaoID=%s,star=%s,effID=%s,effType=%s,effValue=%s,condValue=%s,getTimes=%s,updValue=%s,awardItemTotalList=%s" |
| | | % (gubaoID, star, effID, effType, effValue, condValue, getTimes, updValue, awardItemTotalList), curPlayer.GetPlayerID())
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, awardItemTotalList, event=["Gubao", False, {}])
|
| | | return
|
| | | |
| | | qualityTransDict = IpyGameDataPY.GetFuncEvalCfg("Gubao", 1, {})
|
| | | if str(quality) not in qualityTransDict:
|
| | | return
|
| | | transItemID, transCount = qualityTransDict[str(quality)]
|
| | | transCountTotal = transCount * transPieceCnt
|
| | | GameWorld.DebugLog("自动转化古宝溢出碎片! gubaoID=%s,itemID=%s,itemCount=%s,star=%s,needPieceTotal=%s,transPieceCnt=%s,transItemID=%s,transCountTotal=%s" |
| | | % (gubaoID, itemID, itemCount, star, needPieceTotal, transPieceCnt, transItemID, transCountTotal))
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, [[transItemID, transCountTotal]], isNotifyAward=False)
|
| | | ItemControler.SetItemCountByID(curPlayer, itemID, needPieceTotal)
|
| | | return transPieceCnt
|
| | |
|
| | | def Sync_GubaoInfo(curPlayer, gubaoIDList=None):
|
| | | if gubaoIDList == None:
|
| | |
| | |
|
| | | gubaoInfoList = []
|
| | | for gubaoID in syncIDList:
|
| | | lv, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not lv and not star and gubaoIDList == None:
|
| | | if gubaoIDList == None and not IsGubaoActivated(curPlayer, gubaoID):
|
| | | # 没有指定时只同步激活的
|
| | | continue
|
| | | gubao = ChPyNetSendPack.tagMCGubao()
|
| | | lv, star, layer = GetGubaoInfo(curPlayer, gubaoID)
|
| | | gubao = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCGubao)
|
| | | gubao.GubaoID = gubaoID
|
| | | gubao.GubaoLV = lv
|
| | | gubao.GubaoStar = star
|
| | | gubao.EffLayer = layer
|
| | | gubaoInfoList.append(gubao)
|
| | |
|
| | | if not gubaoInfoList:
|
| | | return
|
| | |
|
| | | clientPack = ChPyNetSendPack.tagMCGubaoInfo()
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCGubaoInfo)
|
| | | clientPack.GubaoInfoList = gubaoInfoList
|
| | | clientPack.Count = len(clientPack.GubaoInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def Sync_GubaoItemEffInfo(curPlayer, gubaoID=0, effType=0, force=False):
|
| | | syncIDList = []
|
| | | if not gubaoID:
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in range(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | syncIDList.append(ipyData.GetGubaoID())
|
| | | else:
|
| | | syncIDList = [gubaoID]
|
| | | |
| | | syncEffTypeList = [effType] if effType else NeedGubaoItemEffValueTypeList
|
| | | |
| | | itemEffInfoList = []
|
| | | for gubaoID in syncIDList:
|
| | | for effType in syncEffTypeList:
|
| | | effValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType))
|
| | | if not effValue and not force:
|
| | | # 非强制同步情况下只同步有值的
|
| | | continue
|
| | | eff = ChPyNetSendPack.tagMCGubaoItemEff()
|
| | | eff.GubaoID = gubaoID
|
| | | eff.EffType = effType
|
| | | eff.EffValue = effValue
|
| | | itemEffInfoList.append(eff)
|
| | | |
| | | if not itemEffInfoList:
|
| | | return
|
| | | |
| | | clientPack = ChPyNetSendPack.tagMCGubaoItemEffInfo()
|
| | | clientPack.ItemEffInfoList = itemEffInfoList
|
| | | clientPack.Count = len(clientPack.ItemEffInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def Sync_GubaoPieceInfo(curPlayer, gubaoIDList=None):
|
| | | if gubaoIDList == None:
|
| | | syncIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in range(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | syncIDList.append(ipyData.GetGubaoID())
|
| | | else:
|
| | | syncIDList = gubaoIDList
|
| | | |
| | | pieceInfoList = []
|
| | | for gubaoID in syncIDList:
|
| | | curCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoPiece % gubaoID)
|
| | | if not curCount and gubaoIDList == None:
|
| | | # 没有指定时只同步有数量的
|
| | | continue
|
| | | gubao = ChPyNetSendPack.tagMCGubaoPiece()
|
| | | gubao.GubaoID = gubaoID
|
| | | gubao.PieceCount = curCount
|
| | | pieceInfoList.append(gubao)
|
| | | |
| | | if not pieceInfoList:
|
| | | return
|
| | | |
| | | clientPack = ChPyNetSendPack.tagMCGubaoPieceInfo()
|
| | | clientPack.PieceInfoList = pieceInfoList
|
| | | clientPack.Count = len(clientPack.PieceInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
| | | import IpyGameDataPY
|
| | | import FormulaControl
|
| | | import PlayerPrestigeSys
|
| | | import PlayerGubao
|
| | | import PlayerHero
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
| | | ChEquip.CalcRoleEquipAttr(curPlayer)
|
| | | PlayerHero.CalcHeroAddAttr(curPlayer)
|
| | | PlayerPrestigeSys.CalcOfficialRankAttr(curPlayer)
|
| | | PlayerGubao.CalcGubaoAttr(curPlayer)
|
| | | return
|
| | |
|
| | | def doRefreshLineupAttr(curPlayer, olPlayer, lineup):
|
| | |
| | | equipAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_MainEquip)
|
| | | bookAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_HeroBook)
|
| | | realmAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Realm)
|
| | |
|
| | | gubaoAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Gubao)
|
| | | |
| | | GameWorld.DebugLog(" 国家武将统计=%s" % countryHeroInfo, playerID)
|
| | | GameWorld.DebugLog(" 羁绊武将统计=%s" % fetterHeroInfo, playerID)
|
| | | GameWorld.DebugLog(" 武将自身属性=%s" % heroSelfAttrInfo, playerID)
|
| | |
| | | GameWorld.DebugLog(" 主公装备属性=%s" % equipAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公图鉴属性=%s" % bookAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公官职属性=%s" % realmAttrDict, playerID)
|
| | | GameWorld.DebugLog(" 主公古宝属性=%s" % gubaoAttrDict, playerID)
|
| | |
|
| | | PlayerLV = curPlayer.GetLV()
|
| | | OfficialLV = curPlayer.GetOfficialRank()
|
| | |
| | | realmValue = realmAttrDict.get(attrID, 0)
|
| | | realmPer = realmAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | |
|
| | | gubaoValue = gubaoAttrDict.get(attrID, 0)
|
| | | gubaoPer = gubaoAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
|
| | | |
| | | lineupInitAddPer, lineupLVAddPer, lineupBreakLVAddPer, lineupStarAddPer = 0, 0, 0, 0
|
| | | if attrID in ChConfig.BaseAttrIDList:
|
| | | lineupInitAddPer, lineupLVAddPer, lineupBreakLVAddPer, lineupStarAddPer = InitAddPer, LVAddPer, BreakLVAddPer, StarAddPer
|
| | |
| | |
|
| | | # 计算
|
| | | attrParamDict = {"lvValue":lvValue, "equipValue":equipValue, "bookValue":bookValue, "bookPer":bookPer, "realmValue":realmValue, "realmPer":realmPer,
|
| | | "gubaoValue":gubaoValue, "gubaoPer":gubaoPer, |
| | | "lineupInitAddPer":lineupInitAddPer, "lineupLVAddPer":lineupLVAddPer, "lineupBreakLVAddPer":lineupBreakLVAddPer, "lineupStarAddPer":lineupStarAddPer,
|
| | | "heroSelfValue":heroSelfValue, "heroSelfPer":heroSelfPer, "inheritPer":inheritPer,
|
| | | "lineupHaloValue":lineupHaloValue, "lineupHaloPer":lineupHaloPer, "fetterValue":fetterValue, "fetterPer":fetterPer,
|
| | |
| | | import PlayerSuccess
|
| | | import PlayerBillboard
|
| | | import PlayerTongTianLing
|
| | | import PlayerGubao
|
| | | import PlayerTask
|
| | | import PlayerOnline
|
| | |
|
| | |
| | | return
|
| | |
|
| | | curPlayer.SetOfficialRank(nextRealmLv)
|
| | | PlayerGubao.DoGubaoAddFreePoint(curPlayer)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmTaskAwardState, 0)
|
| | | syncTaskIDList = []
|
| | |
| | | import ChPyNetSendPack |
| | | import IPY_GameWorld |
| | | import NetPackCommon |
| | | import PlayerGubao |
| | | import ItemCommon |
| | | import ChConfig |
| | | import SkillCommon |
| | |
| | | shentongID = curPackData.ShentongID |
| | | ipyData = IpyGameDataPY.GetIpyGameData("Shentong", shentongID) |
| | | if not ipyData: |
| | | return |
| | | needGubaoID = ipyData.GetNeedGubaoID() |
| | | if needGubaoID and not PlayerGubao.GetGubaoLVInfo(curPlayer, needGubaoID)[1]: |
| | | GameWorld.DebugLog("古宝未激活,无法升级神通! shentongID=%s,needGubaoID=%s" % (shentongID, needGubaoID), playerID) |
| | | return |
| | | |
| | | classLV, lv = GetShentongLVInfo(curPlayer, shentongID) |
| | |
| | | import PlayerActLunhuidian
|
| | | import PlayerActYunshi
|
| | | import PlayerActTask
|
| | | import PlayerGubao
|
| | | import ItemCommon
|
| | | import PlayerHero
|
| | | import PyGameData
|
| | | import ChConfig
|
| | |
|
| | | import random
|
| | |
| | | GameWorld.ErrLog("寻宝格子不存在!treasureType=%s,gridNum=%s" % (treasureType, gridNum), playerID)
|
| | | return
|
| | |
|
| | | treasureResult.append([gridNum, itemID, itemCount, isBind])
|
| | | isTrans = 0 # 是否转化
|
| | | treasureResult.append([gridNum, itemID, itemCount, isTrans])
|
| | |
|
| | | # 扣消耗
|
| | | if costType == 1:
|
| | |
| | | PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_JSTreasure, treasureCount)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_JSTreasure, treasureCount)
|
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_TreasureJueshi, treasureCount)
|
| | | elif treasureType == TreasureType_Gubao:
|
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_TreasureGubao, treasureCount)
|
| | | #elif treasureType == TreasureType_Gubao:
|
| | | # PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_TreasureGubao, treasureCount)
|
| | |
|
| | | PlayerActLunhuidian.AddLunhuidianValue(curPlayer, PlayerActLunhuidian.AwardType_Treasure, treasureType, treasureCount)
|
| | |
|
| | | # 给物品
|
| | | mailItemList = []
|
| | | itemControl = ItemControler.PlayerItemControler(curPlayer)
|
| | | for gridNum, itemID, itemCount, isBind in treasureResult:
|
| | | itemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, False, curPlayer=curPlayer)
|
| | | for tResult in treasureResult:
|
| | | gridNum, itemID, itemCount = tResult[:3]
|
| | | PyGameData.g_transItemSign = 0
|
| | | itemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, isBind, curPlayer=curPlayer)
|
| | | mailItemDict = ItemCommon.GetMailItemDict(itemObj)
|
| | |
|
| | | if int(gridNum) in notifyGridNumList and notifyKey:
|
| | |
| | | mailItemList.append(mailItemDict)
|
| | | itemObj.Clear()
|
| | |
|
| | | # 检查物品转化
|
| | | if PyGameData.g_transItemSign:
|
| | | tResult[3] = 1 # 有转化物品时设置转化标记
|
| | | |
| | | if mailItemList:
|
| | | PlayerControl.SendMailByKey("HappyXBUnEnough", [playerID], mailItemList)
|
| | |
|
| | |
| | | lvID = needValue
|
| | | curValue = lvID if PlayerControl.IsMainLevelPass(curPlayer, lvID) else 0
|
| | | elif zhanlingType == ZhanlingType_GubaoCnt:
|
| | | curValue = PlayerGubao.GetGubaoTotalCnt(curPlayer)
|
| | | curValue = PlayerGubao.GetGubaoTotalCnt(curPlayer, needValue)
|
| | | #elif zhanlingType == ZhanlingType_Login:
|
| | | # firstLoginTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhanlingValue1 % zhanlingType)
|
| | | # if not firstLoginTime:
|
| | |
| | | g_playerDataCntInfo = {} # 玩家各表最后一次存档时数据条数 {playerID:{表名:条数, ...}, ...}
|
| | | g_mergeRegisterPlayerDict = {} # 跨服玩家数据缓存 {accID:[loginTime, logoutTime, recvPack, groupID], ...}
|
| | |
|
| | | g_usrCtrlDB = None #数据库实例 |
| | | g_usrCtrlDB = None #数据库实例
|
| | |
|
| | | g_transItemSign = 0
|