From f10b4418d4b543e77dadf11730ddd7636c11cf79 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 20 十一月 2019 19:55:24 +0800
Subject: [PATCH] 8341 【恺英】【后端】强化进化系统优化(强化大师)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py | 116 ++++-------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini | 12
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 56 +++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 108 ++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 26 ++
PySysDB/PySysDBPY.h | 9
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py | 79 +++++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 56 +++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 108 ++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 2
10 files changed, 495 insertions(+), 77 deletions(-)
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 8a4a273..bc3db27 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -124,6 +124,15 @@
DWORD TotalExp; //升级所需熟练度总值
};
+//装备强化大师表
+
+struct tagItemPlusMaster
+{
+ BYTE _ClassLV; //阶
+ WORD MasterPlusLV; //大师强化等级
+ list MasterPlusAttrIDList; //激活属性类型列表
+ list MasterPlusAttrValueList; //激活属性值列表
+};
//装备全身星数属性
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index baaae1b..1dd0089 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -7728,6 +7728,62 @@
#------------------------------------------------------
+# A5 C7 激活大师强化等级 #tagCMActivateMasterPlusLV
+
+class tagCMActivateMasterPlusLV(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ClassLV", c_ubyte), # 所属装备阶
+ ("MasterPlusLV", c_ushort), # 大师强化等级
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xA5
+ self.SubCmd = 0xC7
+ 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.Cmd = 0xA5
+ self.SubCmd = 0xC7
+ self.ClassLV = 0
+ self.MasterPlusLV = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCMActivateMasterPlusLV)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// A5 C7 激活大师强化等级 //tagCMActivateMasterPlusLV:
+ Cmd:%s,
+ SubCmd:%s,
+ ClassLV:%d,
+ MasterPlusLV:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ClassLV,
+ self.MasterPlusLV
+ )
+ return DumpString
+
+
+m_NAtagCMActivateMasterPlusLV=tagCMActivateMasterPlusLV()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActivateMasterPlusLV.Cmd,m_NAtagCMActivateMasterPlusLV.SubCmd))] = m_NAtagCMActivateMasterPlusLV
+
+
+#------------------------------------------------------
# A5 03 全身属性激活 #tagCMActiveAllEquipAttr
class tagCMActiveAllEquipAttr(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index a406404..b5df0a7 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -15932,6 +15932,114 @@
#------------------------------------------------------
+# A3 C2 大师强化等级激活信息 #tagMCMasterPlusLVInfo
+
+class tagMCMasterPlusLV(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("ClassLV", c_ubyte),
+ ("MasterPlusLV", c_ushort), # 已经激活的最高大师强化等级,向下兼容
+ ]
+
+ 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.ClassLV = 0
+ self.MasterPlusLV = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCMasterPlusLV)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// A3 C2 大师强化等级激活信息 //tagMCMasterPlusLVInfo:
+ ClassLV:%d,
+ MasterPlusLV:%d
+ '''\
+ %(
+ self.ClassLV,
+ self.MasterPlusLV
+ )
+ return DumpString
+
+
+class tagMCMasterPlusLVInfo(Structure):
+ Head = tagHead()
+ Count = 0 #(BYTE Count)// 信息个数
+ MasterPlusLVInfoList = list() #(vector<tagMCMasterPlusLV> MasterPlusLVInfoList)// 信息列表
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA3
+ self.Head.SubCmd = 0xC2
+ 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):
+ temMasterPlusLVInfoList = tagMCMasterPlusLV()
+ _pos = temMasterPlusLVInfoList.ReadData(_lpData, _pos)
+ self.MasterPlusLVInfoList.append(temMasterPlusLVInfoList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA3
+ self.Head.SubCmd = 0xC2
+ self.Count = 0
+ self.MasterPlusLVInfoList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ for i in range(self.Count):
+ length += self.MasterPlusLVInfoList[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.MasterPlusLVInfoList[i].GetLength(), self.MasterPlusLVInfoList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ Count:%d,
+ MasterPlusLVInfoList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.Count,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCMasterPlusLVInfo=tagMCMasterPlusLVInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMasterPlusLVInfo.Head.Cmd,m_NAtagMCMasterPlusLVInfo.Head.SubCmd))] = m_NAtagMCMasterPlusLVInfo
+
+
+#------------------------------------------------------
#A3 1B 玩家自动战斗设置储存信息通知#tagMCAutoFightSetting
class tagMCAutoFightSetting(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index 77856d6..0725a6e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -68,7 +68,7 @@
Writer = wdb
Releaser = wdb
RegType = 0
-RegisterPackCount = 2
+RegisterPackCount = 3
PacketCMD_1=0xA3
PacketSubCMD_1=0x01
@@ -77,6 +77,10 @@
PacketCMD_2=0xA3
PacketSubCMD_2=0x16
PacketCallFunc_2=OnEquipPlusEvolve
+
+PacketCMD_3=0xA5
+PacketSubCMD_3=0xC7
+PacketCallFunc_3=OnActivateMasterPlusLV
;npc交互
[FunctionNPCCommon]
@@ -1246,9 +1250,9 @@
RegType = 0
RegisterPackCount = 3
-PacketCMD_1=0xA5
-PacketSubCMD_1=0x03
-PacketCallFunc_1=OnActiveAllEquipAttr
+PacketCMD_1=
+PacketSubCMD_1=
+PacketCallFunc_1=
PacketCMD_2=0xA3
PacketSubCMD_2=0x18
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index b39a72c..52f70d0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3595,7 +3595,7 @@
#强化
Def_PDict_TotalPlusLV = "TotalPlusLV" # 总强化等级
Def_PDict_EquipPartPlusLV = "EPPlusLV_%s_%s" # 装备部位对应公共强化星级,参数为(packType, index)
-Def_PDict_EquipActiveStarLV = "EquipActiveStarLV" #装备已激活总强化等级
+Def_PDict_EquipPartMasterPlusLV = "EquipPartMasterPlusLV_%s" #装备已激活大师强化等级, 参数为(classLV)
Def_PDict_EquipPartProficiency = "EPProf_%s_%s" # 装备部位对应公共强化熟练度,参数为(packType, index)
Def_PDict_EquipPartPlusEvolveLV = "EPPlusEvolveLV_%s_%s" # 装备部位对应公共强化进化等级,参数为(packType, index)
Def_PDict_TotalPlusEvolveLV = "TotalPlusEvolveLV" # 装备部位对应公共强化进化总等级
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index baaae1b..1dd0089 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -7728,6 +7728,62 @@
#------------------------------------------------------
+# A5 C7 激活大师强化等级 #tagCMActivateMasterPlusLV
+
+class tagCMActivateMasterPlusLV(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ClassLV", c_ubyte), # 所属装备阶
+ ("MasterPlusLV", c_ushort), # 大师强化等级
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xA5
+ self.SubCmd = 0xC7
+ 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.Cmd = 0xA5
+ self.SubCmd = 0xC7
+ self.ClassLV = 0
+ self.MasterPlusLV = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCMActivateMasterPlusLV)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// A5 C7 激活大师强化等级 //tagCMActivateMasterPlusLV:
+ Cmd:%s,
+ SubCmd:%s,
+ ClassLV:%d,
+ MasterPlusLV:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ClassLV,
+ self.MasterPlusLV
+ )
+ return DumpString
+
+
+m_NAtagCMActivateMasterPlusLV=tagCMActivateMasterPlusLV()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActivateMasterPlusLV.Cmd,m_NAtagCMActivateMasterPlusLV.SubCmd))] = m_NAtagCMActivateMasterPlusLV
+
+
+#------------------------------------------------------
# A5 03 全身属性激活 #tagCMActiveAllEquipAttr
class tagCMActiveAllEquipAttr(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index a406404..b5df0a7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -15932,6 +15932,114 @@
#------------------------------------------------------
+# A3 C2 大师强化等级激活信息 #tagMCMasterPlusLVInfo
+
+class tagMCMasterPlusLV(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("ClassLV", c_ubyte),
+ ("MasterPlusLV", c_ushort), # 已经激活的最高大师强化等级,向下兼容
+ ]
+
+ 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.ClassLV = 0
+ self.MasterPlusLV = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCMasterPlusLV)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// A3 C2 大师强化等级激活信息 //tagMCMasterPlusLVInfo:
+ ClassLV:%d,
+ MasterPlusLV:%d
+ '''\
+ %(
+ self.ClassLV,
+ self.MasterPlusLV
+ )
+ return DumpString
+
+
+class tagMCMasterPlusLVInfo(Structure):
+ Head = tagHead()
+ Count = 0 #(BYTE Count)// 信息个数
+ MasterPlusLVInfoList = list() #(vector<tagMCMasterPlusLV> MasterPlusLVInfoList)// 信息列表
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA3
+ self.Head.SubCmd = 0xC2
+ 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):
+ temMasterPlusLVInfoList = tagMCMasterPlusLV()
+ _pos = temMasterPlusLVInfoList.ReadData(_lpData, _pos)
+ self.MasterPlusLVInfoList.append(temMasterPlusLVInfoList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA3
+ self.Head.SubCmd = 0xC2
+ self.Count = 0
+ self.MasterPlusLVInfoList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ for i in range(self.Count):
+ length += self.MasterPlusLVInfoList[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.MasterPlusLVInfoList[i].GetLength(), self.MasterPlusLVInfoList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ Count:%d,
+ MasterPlusLVInfoList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.Count,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCMasterPlusLVInfo=tagMCMasterPlusLVInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMasterPlusLVInfo.Head.Cmd,m_NAtagMCMasterPlusLVInfo.Head.SubCmd))] = m_NAtagMCMasterPlusLVInfo
+
+
+#------------------------------------------------------
#A3 1B 玩家自动战斗设置储存信息通知#tagMCAutoFightSetting
class tagMCAutoFightSetting(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
index 4897a13..8be890e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
@@ -33,6 +33,8 @@
import ChConfig
import ChEquip
import EventShell
+import ChPyNetSendPack
+import NetPackCommon
#-------------------------------------------------------------------------------------------
#===============================================================================
@@ -147,7 +149,6 @@
OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_PlusLV, ChEquip.GetTotalPlusLV(curPlayer))
return
-
def DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV):
#先刷装备BUFF 再计算属性
curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrActivatyNotify, ChConfig.Def_AttrActivatyNotify_Plus)
@@ -205,3 +206,79 @@
EventShell.EventRespons_EquipPlusEvolve(curPlayer, nextEvolveLV)
return
+
+#// A5 C7 激活大师强化等级 #tagCMActivateMasterPlusLV
+#
+#struct tagCMActivateMasterPlusLV
+#{
+# tagHead Head;
+# BYTE ClassLV; // 所属装备阶
+# WORD MasterPlusLV; // 大师强化等级
+#};
+def OnActivateMasterPlusLV(index, clientData, tick):
+
+ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+ classLV = clientData.ClassLV
+ actMasterPlusLV = clientData.MasterPlusLV
+
+ curMasterPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV)
+ if curMasterPlusLV >= actMasterPlusLV:
+ # 已经激活过了
+ GameWorld.DebugLog("已经激活过该强化大师等级了! actMasterPlusLV=%s,curMasterPlusLV=%s" % (actMasterPlusLV, curMasterPlusLV))
+ return
+
+ ipyData = IpyGameDataPY.GetIpyGameDataByCondition("ItemPlusMaster", {"ClassLV":classLV, "MasterPlusLV":actMasterPlusLV}, False, False)
+ if not ipyData:
+ GameWorld.DebugLog("不存在该强化大师等级! actMasterPlusLV=%s" % actMasterPlusLV)
+ return
+
+ packType = IPY_GameWorld.rptEquip
+ # 判断可否激活
+ for equipPlace in ChConfig.EquipPlace_Base:
+ ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
+ if not ipyData:
+ return
+ equipIndex = ipyData.GetGridIndex()
+ plusLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, equipIndex)
+ if plusLV < actMasterPlusLV:
+ GameWorld.DebugLog("部位强化等级不足,无法激活强化大师! equipPlace=%s,equipIndex=%s,plusLV=%s < %s"
+ % (equipPlace, equipIndex, plusLV, actMasterPlusLV))
+ return
+
+ GameWorld.DebugLog("激活强化大师等级! classLV=%s,actMasterPlusLV=%s" % (classLV, actMasterPlusLV))
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV, actMasterPlusLV)
+
+ SyncEquipMasterPlusLVInfo(curPlayer, classLV)
+
+ #刷新所有属性
+ DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
+ return
+
+def SyncEquipMasterPlusLVInfo(curPlayer, classLV=0, isForce=False):
+ ## 同步大师强化等级信息
+ if not classLV:
+ needSyncClassLVList = xrange(1, IpyGameDataPY.GetFuncCfg('EquipMaxClasslv') + 1)
+ else:
+ needSyncClassLVList = [classLV]
+
+ masterPlusLVInfoList = []
+ for classLV in needSyncClassLVList:
+ masterPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV)
+ if not masterPlusLV and not isForce:
+ continue
+ lvInfo = ChPyNetSendPack.tagMCMasterPlusLV()
+ lvInfo.ClassLV = classLV
+ lvInfo.MasterPlusLV = masterPlusLV
+ masterPlusLVInfoList.append(lvInfo)
+
+ if not masterPlusLVInfoList:
+ return
+
+ clientPack = ChPyNetSendPack.tagMCMasterPlusLVInfo()
+ clientPack.MasterPlusLVInfoList = masterPlusLVInfoList
+ clientPack.Count = len(masterPlusLVInfoList)
+ NetPackCommon.SendFakePack(curPlayer, clientPack)
+ return
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 99de716..b3c32e8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -129,6 +129,13 @@
("DWORD", "TotalExp", 0),
),
+ "ItemPlusMaster":(
+ ("BYTE", "ClassLV", 1),
+ ("WORD", "MasterPlusLV", 0),
+ ("list", "MasterPlusAttrIDList", 0),
+ ("list", "MasterPlusAttrValueList", 0),
+ ),
+
"RoleEquipStars":(
("BYTE", "StarsNeed", 1),
("list", "AttrType", 0),
@@ -1740,6 +1747,21 @@
def GetCostCount(self): return self.CostCount # 消耗铜钱
def GetAddExp(self): return self.AddExp # 提升熟练度值
def GetTotalExp(self): return self.TotalExp # 升级所需熟练度总值
+
+# 装备强化大师表
+class IPY_ItemPlusMaster():
+
+ def __init__(self):
+ self.ClassLV = 0
+ self.MasterPlusLV = 0
+ self.MasterPlusAttrIDList = []
+ self.MasterPlusAttrValueList = []
+ return
+
+ def GetClassLV(self): return self.ClassLV # 阶
+ def GetMasterPlusLV(self): return self.MasterPlusLV # 大师强化等级
+ def GetMasterPlusAttrIDList(self): return self.MasterPlusAttrIDList # 激活属性类型列表
+ def GetMasterPlusAttrValueList(self): return self.MasterPlusAttrValueList # 激活属性值列表
# 装备全身星数属性
class IPY_RoleEquipStars():
@@ -4740,6 +4762,8 @@
self.ipyItemCompoundLen = len(self.ipyItemCompoundCache)
self.ipyItemPlusCache = self.__LoadFileData("ItemPlus", IPY_ItemPlus)
self.ipyItemPlusLen = len(self.ipyItemPlusCache)
+ self.ipyItemPlusMasterCache = self.__LoadFileData("ItemPlusMaster", IPY_ItemPlusMaster)
+ self.ipyItemPlusMasterLen = len(self.ipyItemPlusMasterCache)
self.ipyRoleEquipStarsCache = self.__LoadFileData("RoleEquipStars", IPY_RoleEquipStars)
self.ipyRoleEquipStarsLen = len(self.ipyRoleEquipStarsCache)
self.ipyEquipLegendAttrCountCache = self.__LoadFileData("EquipLegendAttrCount", IPY_EquipLegendAttrCount)
@@ -5210,6 +5234,8 @@
def GetItemCompoundByIndex(self, index): return self.ipyItemCompoundCache[index]
def GetItemPlusCount(self): return self.ipyItemPlusLen
def GetItemPlusByIndex(self, index): return self.ipyItemPlusCache[index]
+ def GetItemPlusMasterCount(self): return self.ipyItemPlusMasterLen
+ def GetItemPlusMasterByIndex(self, index): return self.ipyItemPlusMasterCache[index]
def GetRoleEquipStarsCount(self): return self.ipyRoleEquipStarsLen
def GetRoleEquipStarsByIndex(self, index): return self.ipyRoleEquipStarsCache[index]
def GetEquipLegendAttrCountCount(self): return self.ipyEquipLegendAttrCountLen
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
index 8109d93..56b29c2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -25,6 +25,7 @@
import FBLogic
import OperControlManager
import Operate_EquipWash
+import Operate_EquipPlus
import ShareDefine
import ChPyNetSendPack
import NetPackCommon
@@ -186,8 +187,6 @@
#NotifyEquipPartPlusLV(curPlayer)
#NotifyEquipPartStar(curPlayer)
#Operate_EquipWash.OnEquipWashLogin(curPlayer)
- #通知套装信息
- #ChEquip.SyncAllEquipAttrActiveInfo(curPlayer)
#装备位宝石镶嵌通知
#Operate_EquipStone.OnLogin(curPlayer)
if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_LingGenShow):
@@ -316,6 +315,8 @@
ePartStonePack.EquipCount = len(ePartStonePack.InfoList)
NetPackCommon.SendFakePack(curPlayer, ePartStonePack)
+ Operate_EquipPlus.SyncEquipMasterPlusLVInfo(curPlayer)
+
# 更新统计汇总值
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_EquipOrangeCount, orangeEquipCount)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipStar, totalStar)
@@ -729,6 +730,8 @@
#legendAttrDict = {} #所有传奇属性
equipScoreTotal = 0 #为解决装备评分、战力不一致的情况,装备战力改为由评分作为参数计算战力
+ basePlusLVMin = None # 基础装备最小强化等级,计算大师强化属性用
+
# 1. 循环遍历本阶装备
for equipPlace in equipPartStarIndexList:
ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
@@ -808,8 +811,10 @@
__CalcFuncAddEquipAttrPer(equipPlace, legendAttrID, legendAttrValue, equip_addEquipBaseAttrPerList)
#物品强化属性
- __CalcAttr_ItemPlus(curPlayer, curEquip, packType, equipIndex, allAttrListPlus, plus_addEquipBaseAttrPerList)
-
+ plusLV = __CalcAttr_ItemPlus(curPlayer, curEquip, packType, equipIndex, allAttrListPlus, plus_addEquipBaseAttrPerList)
+ if isBaseEquip:
+ basePlusLVMin = plusLV if basePlusLVMin == None else min(basePlusLVMin, plusLV)
+
#计算装备宝石加成
CalcEquipStone_Effect(curPlayer, equipIndex, allAttrListStone)
@@ -825,6 +830,8 @@
# 2. 计算遍历后的附加属性
#套装属性,暂归为星级套装属性
CalcEquipSuiteAttr(curPlayer, suitCntDict, allAttrListStar)
+ #大师
+ __CalcMasterPlusLVAttr(curPlayer, classLV, basePlusLVMin, allAttrListPlus, plus_addEquipBaseAttrPerList)
# GameWorld.DebugLog(" 升星属性套装: %s" % (allAttrListEquip))
@@ -914,7 +921,7 @@
return
# 基础部位
- if effPlace == -2 and equipPlace in ChConfig.EquipPlace_Base:
+ if effPlace == -2:
basePlaceAddPerDict = addPerInfoList[1]
for calcAttrIndex in calcAttrList:
basePlaceAddPerDict[calcAttrIndex] = basePlaceAddPerDict.get(calcAttrIndex, 0) + attrValue
@@ -993,32 +1000,60 @@
equipPartPlusEvolveLV = GetEquipPartPlusEvolveLV(curPlayer, packType, equipIndex)
if not equipPartPlusLV:
- return
+ return equipPartPlusLV
plusType = GetEquipPlusType(curEquip)
if plusType is None:
- return
+ return equipPartPlusLV
#GameWorld.DebugLog(" 强化属性: plusType=%s,equipPartPlusLV=%s,equipPartPlusEvolveLV=%s" % (plusType, equipPartPlusLV, equipPartPlusEvolveLV))
ipyData = IpyGameDataPY.GetIpyGameData("ItemPlus", plusType, equipPartPlusLV)
if not ipyData:
- return
+ return equipPartPlusLV
attrTypeList, attrValueList = ipyData.GetAttrType(), ipyData.GetAttrValue()
for i, attrID in enumerate(attrTypeList):
#GameWorld.DebugLog(" 强化基础属性: ID=%s +%s" % (attrID, attrValueList[i]))
PlayerControl.CalcAttrDict_Type(attrID, attrValueList[i], allAttrList)
if not equipPartPlusEvolveLV:
- return
+ return equipPartPlusLV
#进化属性
equipPlace = curEquip.GetEquipPlace()
ipyData = IpyGameDataPY.GetIpyGameData('EquipPlusEvolve', equipPlace, equipPartPlusEvolveLV)
if not ipyData:
- return
+ return equipPartPlusLV
for attrID, attrValue in ipyData.GetAttr().items():
#GameWorld.DebugLog(" 强化进阶属性: ID=%s +%s" % (attrID, attrValue))
PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
__CalcFuncAddEquipAttrPer(equipPlace, attrID, attrValue, plus_addEquipBaseAttrPerList)
+ return equipPartPlusLV
+
+def __CalcMasterPlusLVAttr(curPlayer, classLV, basePlusLVMin, allAttrListPlus, plus_addEquipBaseAttrPerList):
+ ## 计算装备大师强化属性
+
+ ipyDataList = IpyGameDataPY.GetIpyGameDataList("ItemPlusMaster", classLV)
+ if not ipyDataList:
+ return
+
+ actMasterPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV) # 已激活的最大大师等级
+
+ for ipyData in ipyDataList:
+ needMasterPlusLV = ipyData.GetMasterPlusLV()
+ if basePlusLVMin < needMasterPlusLV:
+ #GameWorld.DebugLog(" 未达到大师强化等级! classLV=%s,basePlusLVMin=%s < needMasterPlusLV=%s" % (classLV, basePlusLVMin, needMasterPlusLV))
+ continue
+ if actMasterPlusLV < needMasterPlusLV:
+ #GameWorld.DebugLog(" 未激活大师强化等级! classLV=%s,actMasterPlusLV=%s < needMasterPlusLV=%s" % (classLV, actMasterPlusLV, needMasterPlusLV))
+ continue
+
+ attrIDList = ipyData.GetMasterPlusAttrIDList()
+ attrValueList = ipyData.GetMasterPlusAttrValueList()
+ for i, attrID in enumerate(attrIDList):
+ attrValue = attrValueList[i]
+ PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListPlus)
+ __CalcFuncAddEquipAttrPer(None, attrID, attrValue, plus_addEquipBaseAttrPerList)
+ #GameWorld.DebugLog(" 强化大师属性! needMasterPlusLV=%s, attrID=%s + %s" % (needMasterPlusLV, attrID, attrValue))
+
return
## 装备套装属性计算
@@ -1536,64 +1571,3 @@
NetPackCommon.SendFakePack(curPlayer, ePartStarLVPack)
return
-
-#// A5 03 全身属性激活 #tagCMActiveAllEquipAttr
-#
-#struct tagCMActiveAllEquipAttr
-#
-#{
-# tagHead Head;
-# BYTE Type; //0强化 1星数
-# DWORD Cnt; //激活数量
-#};
-def OnActiveAllEquipAttr(index, clientData, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- activeType = clientData.Type
- activeCnt = clientData.Cnt
- if activeType == 0:
- key = ChConfig.Def_PDict_EquipActiveStarLV
-# elif activeType == 1:
-# key = ChConfig.Def_PDict_EquipActiveStars
- else:
- return
- curCnt = curPlayer.NomalDictGetProperty(key)
- if activeCnt <= curCnt:
- GameWorld.Log(' 全身属性激活 该数量已激活过! activeType=%s,activeCnt=%s,curCnt=%s' % (activeType, activeCnt, curCnt))
- return
-
- PlayerControl.NomalDictSetProperty(curPlayer, key, activeCnt)
-
- SyncAllEquipAttrActiveInfo(curPlayer, activeType)
-
- #注意: 需要传装备阶触发刷属性,暂屏蔽,功能修改时再处理
- #else:
- # RefreshPlayerEquipAttribute(curPlayer)
-
- #刷新所有属性
- playControl = PlayerControl.PlayerControl(curPlayer)
- playControl.RefreshPlayerAttrState()
- return
-
-
-def SyncAllEquipAttrActiveInfo(curPlayer, activeType=-1):
- ## 通知全身属性激活数量
- packData = ChPyNetSendPack.tagMCAllEquipAttrActiveInfo()
- packData.ActiveInfo = []
- for aType in [0, 1]:
- if activeType != -1 and activeType != aType:
- continue
- if aType == 0:
- key = ChConfig.Def_PDict_EquipActiveStarLV
-# elif aType == 1:
-# key = ChConfig.Def_PDict_EquipActiveStars
- else:
- return
- curCnt = curPlayer.NomalDictGetProperty(key)
- activeInfo = ChPyNetSendPack.tagMCEquipActiveInfo()
- activeInfo.Type = aType
- activeInfo.Cnt = curCnt
- packData.ActiveInfo.append(activeInfo)
-
- packData.Count = len(packData.ActiveInfo)
- NetPackCommon.SendFakePack(curPlayer, packData)
- return
--
Gitblit v1.8.0