From 9e3dcc708658640e6b00b95e6e8c22fc8f93812e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 19 十一月 2025 17:05:45 +0800
Subject: [PATCH] 16 卡牌服务端(删除神通)
---
/dev/null | 318 --------------------------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini | 16 -
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 119 ---------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 179 --------------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 58 ----
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 2
PySysDB/PySysDBPY.h | 22 -
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 4
8 files changed, 0 insertions(+), 718 deletions(-)
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index e7e77d3..a62f192 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -955,28 +955,6 @@
list LVUPNeedItemInfo; //升级所需物品 [[物品ID,个数], ...]
};
-//神通表
-
-struct tagShentong
-{
- BYTE _ShentongID; //神通ID
- WORD NeedGubaoID; //解锁所需古宝ID
-};
-
-//神通升级表
-
-struct tagShentongLV
-{
- BYTE _ShentongID; //神通ID
- BYTE _ShentongClassLV; //神通阶级
- BYTE _ShentongLV; //神通等级
- list LVLightNeedItem; //点亮该级所需物品 [[物品ID,个数], ...]
- list LVAttrTypeList; //该级属性类型列表
- list LVAttrValueList; //该级属性值列表
- DWORD LVSkillID; //该级职业通用技能ID
- DWORD FightPowerEx; //附加战力
-};
-
//玩家等级表
struct PlayerLV
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index 28d12b5..a461166 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1132,22 +1132,6 @@
PacketSubCMD_3=0x18
PacketCallFunc_3=OnGubaoLVUp
-;神通
-[PlayerShentong]
-ScriptName = Player\PlayerShentong.py
-Writer = hxp
-Releaser = hxp
-RegType = 0
-RegisterPackCount = 2
-
-PacketCMD_1=0xB2
-PacketSubCMD_1=0x19
-PacketCallFunc_1=OnShentongLVUp
-
-PacketCMD_2=0xB2
-PacketSubCMD_2=0x20
-PacketCallFunc_2=OnShentongSkillSet
-
;主线战斗
[GameLogic_MainLevel]
ScriptName = GameWorldLogic\FBProcess\GameLogic_MainLevel.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 61e0d63..a4937b9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3779,10 +3779,6 @@
#古宝
Def_PDict_GubaoInfo = "Gubao_%s" # 古宝信息,参数(古宝ID),特殊效果层*100000 + 等级*100 + 星级
-#神通
-Def_PDict_ShentongLVInfo = "ShentongLVInfo_%s" # 神通等级信息,参数(神通ID),阶级*100+等级
-Def_PDict_ShentongSkillID = "ShentongSkillID_%s" # 神通出战技能ID,参数(编号)
-
#自定义奖励
Def_PDict_CustomAwardCanGet = "CustomAwardCanGet_%s" # 是否可领取,参数(key编号)
Def_PDict_CustomAwardGetState = "CustomAwardGetState_%s" # 是否已领取,参数(key编号)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 2c0124f..c67123e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -12687,125 +12687,6 @@
#------------------------------------------------------
-# B2 19 神通升级 #tagCMShentongLVUp
-
-class tagCMShentongLVUp(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("ShentongID", c_ubyte),
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xB2
- self.SubCmd = 0x19
- 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 = 0xB2
- self.SubCmd = 0x19
- self.ShentongID = 0
- return
-
- def GetLength(self):
- return sizeof(tagCMShentongLVUp)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// B2 19 神通升级 //tagCMShentongLVUp:
- Cmd:%s,
- SubCmd:%s,
- ShentongID:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.ShentongID
- )
- return DumpString
-
-
-m_NAtagCMShentongLVUp=tagCMShentongLVUp()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMShentongLVUp.Cmd,m_NAtagCMShentongLVUp.SubCmd))] = m_NAtagCMShentongLVUp
-
-
-#------------------------------------------------------
-# B2 20 神通技能设置 #tagCMShentongSkillSet
-
-class tagCMShentongSkillSet(Structure):
- Head = tagHead()
- Count = 0 #(BYTE Count)
- SkillIDList = list() #(vector<DWORD> SkillIDList)
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xB2
- self.Head.SubCmd = 0x20
- 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):
- value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
- self.SkillIDList.append(value)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xB2
- self.Head.SubCmd = 0x20
- self.Count = 0
- self.SkillIDList = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 1
- length += 4 * self.Count
-
- 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.WriteDWORD(data, self.SkillIDList[i])
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- Count:%d,
- SkillIDList:%s
- '''\
- %(
- self.Head.OutputString(),
- self.Count,
- "..."
- )
- return DumpString
-
-
-m_NAtagCMShentongSkillSet=tagCMShentongSkillSet()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMShentongSkillSet.Head.Cmd,m_NAtagCMShentongSkillSet.Head.SubCmd))] = m_NAtagCMShentongSkillSet
-
-
-#------------------------------------------------------
# B2 23 仙树升级 #tagCMTreeLVUP
class tagCMTreeLVUP(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 799da4b..8adb7ac 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -7441,185 +7441,6 @@
#------------------------------------------------------
-# A3 C8 神通等级信息 #tagMCShentongLVInfo
-
-class tagMCShentongLV(Structure):
- _pack_ = 1
- _fields_ = [
- ("ShentongID", c_ubyte),
- ("ClassLV", c_ubyte),
- ("LV", c_ubyte),
- ]
-
- 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.ShentongID = 0
- self.ClassLV = 0
- self.LV = 0
- return
-
- def GetLength(self):
- return sizeof(tagMCShentongLV)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// A3 C8 神通等级信息 //tagMCShentongLVInfo:
- ShentongID:%d,
- ClassLV:%d,
- LV:%d
- '''\
- %(
- self.ShentongID,
- self.ClassLV,
- self.LV
- )
- return DumpString
-
-
-class tagMCShentongLVInfo(Structure):
- Head = tagHead()
- Count = 0 #(BYTE Count)
- ShentongLVList = list() #(vector<tagMCShentongLV> ShentongLVList)
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0xC8
- 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):
- temShentongLVList = tagMCShentongLV()
- _pos = temShentongLVList.ReadData(_lpData, _pos)
- self.ShentongLVList.append(temShentongLVList)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0xC8
- self.Count = 0
- self.ShentongLVList = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 1
- for i in range(self.Count):
- length += self.ShentongLVList[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.ShentongLVList[i].GetLength(), self.ShentongLVList[i].GetBuffer())
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- Count:%d,
- ShentongLVList:%s
- '''\
- %(
- self.Head.OutputString(),
- self.Count,
- "..."
- )
- return DumpString
-
-
-m_NAtagMCShentongLVInfo=tagMCShentongLVInfo()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCShentongLVInfo.Head.Cmd,m_NAtagMCShentongLVInfo.Head.SubCmd))] = m_NAtagMCShentongLVInfo
-
-
-#------------------------------------------------------
-# A3 C9 神通技能设置信息 #tagMCShentongSkillInfo
-
-class tagMCShentongSkillInfo(Structure):
- Head = tagHead()
- Count = 0 #(BYTE Count)
- SkillIDList = list() #(vector<DWORD> SkillIDList)
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0xC9
- 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):
- value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
- self.SkillIDList.append(value)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0xC9
- self.Count = 0
- self.SkillIDList = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 1
- length += 4 * self.Count
-
- 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.WriteDWORD(data, self.SkillIDList[i])
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- Count:%d,
- SkillIDList:%s
- '''\
- %(
- self.Head.OutputString(),
- self.Count,
- "..."
- )
- return DumpString
-
-
-m_NAtagMCShentongSkillInfo=tagMCShentongSkillInfo()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCShentongSkillInfo.Head.Cmd,m_NAtagMCShentongSkillInfo.Head.SubCmd))] = m_NAtagMCShentongSkillInfo
-
-
-#------------------------------------------------------
# A3 44 当日累计充值多选一礼包信息 #tagMCSingleGoldGift
class tagMCSingleGoldGift(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Shentong.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Shentong.py
deleted file mode 100644
index e2f7d82..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Shentong.py
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#-------------------------------------------------------------------------------
-#
-##@package GM.Commands.Shentong
-#
-# @todo:神通
-# @author hxp
-# @date 2023-01-08
-# @version 1.0
-#
-# 详细描述: 神通
-#
-#-------------------------------------------------------------------------------
-#"""Version = 2023-01-08 18:00"""
-#-------------------------------------------------------------------------------
-
-import GameWorld
-import IpyGameDataPY
-import PlayerShentong
-import PlayerControl
-import ChConfig
-
-#---------------------------------------------------------------------
-#逻辑实现
-
-## GM命令执行入口
-# @param curPlayer 当前玩家
-# @param msgList 参数列表
-# @return None
-# @remarks 函数详细说明.
-def OnExec(curPlayer, msgList):
-
- if not msgList:
- GameWorld.DebugAnswer(curPlayer, "重置神通: Shentong 0")
- GameWorld.DebugAnswer(curPlayer, "设置神通: Shentong 神通ID 阶 等级")
- return
-
- syncIDList = []
-
- if len(msgList) == 1:
- if msgList[0] == 0:
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for index in range(ipyDataMgr.GetShentongCount()):
- ipyData = ipyDataMgr.GetShentongByIndex(index)
- shentongID = ipyData.GetShentongID()
- classLV, lv = PlayerShentong.GetShentongLVInfo(curPlayer, shentongID)
- if not classLV and not lv:
- continue
- syncIDList.append(shentongID)
- PlayerShentong.SetShentongLVInfo(curPlayer, shentongID, 0, 0)
-
- ShentongSkillCountMax = len(IpyGameDataPY.GetFuncEvalCfg("Shentong", 1))
- skillManager = curPlayer.GetSkillManager()
- playerCtl = PlayerControl.PlayerControl(curPlayer)
- for num in range(ShentongSkillCountMax):
- skillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongSkillID % num)
- if skillID and skillManager.FindSkillBySkillID(skillID):
- skillManager.DeleteSkillBySkillID(skillID, True)
- playerCtl.RefreshSkillFightPowerByDel(skillID)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShentongSkillID % num, 0)
- PlayerShentong.Sync_ShentongSkillInfo(curPlayer)
-
- GameWorld.DebugAnswer(curPlayer, "重置神通OK")
-
- elif len(msgList) == 3:
- shentongID, classLV, lv = msgList
- ipyData = IpyGameDataPY.GetIpyGameData("Shentong", shentongID)
- if not ipyData:
- GameWorld.DebugAnswer(curPlayer, "不存在该神通!shentongID=%s" % shentongID)
- return
- lvIpyData = IpyGameDataPY.GetIpyGameData("ShentongLV", shentongID, classLV, lv)
- if not lvIpyData:
- GameWorld.DebugAnswer(curPlayer, "不存在该神通等级!shentongID=%s,classLV=%s,lv=%s" % (shentongID, classLV, lv))
- return
- GameWorld.DebugAnswer(curPlayer, "设置神通:%s,阶(%s),等级(%s)" % (shentongID, classLV, lv))
- PlayerShentong.SetShentongLVInfo(curPlayer, shentongID, classLV, lv)
- syncIDList.append(shentongID)
- else:
- return
-
- PlayerShentong.RefreshShentongAttr(curPlayer)
- PlayerShentong.Sync_ShentongLVInfo(curPlayer, syncIDList)
- return
-
-
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index eb09923..c16c9d1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -795,22 +795,6 @@
("list", "LVUPNeedItemInfo", 0),
),
- "Shentong":(
- ("BYTE", "ShentongID", 1),
- ("WORD", "NeedGubaoID", 0),
- ),
-
- "ShentongLV":(
- ("BYTE", "ShentongID", 1),
- ("BYTE", "ShentongClassLV", 1),
- ("BYTE", "ShentongLV", 1),
- ("list", "LVLightNeedItem", 0),
- ("list", "LVAttrTypeList", 0),
- ("list", "LVAttrValueList", 0),
- ("DWORD", "LVSkillID", 0),
- ("DWORD", "FightPowerEx", 0),
- ),
-
"PlayerLV":(
("WORD", "LV", 1),
("DWORD", "Exp", 0),
@@ -3335,32 +3319,6 @@
def GetLessEqualLV(self): return self.attrTuple[1] # 小于等于等级 BYTE
def GetLVUPNeedItemInfo(self): return self.attrTuple[2] # 升级所需物品 [[物品ID,个数], ...] list
-# 神通表
-class IPY_Shentong():
-
- def __init__(self):
- self.attrTuple = None
- return
-
- def GetShentongID(self): return self.attrTuple[0] # 神通ID BYTE
- def GetNeedGubaoID(self): return self.attrTuple[1] # 解锁所需古宝ID WORD
-
-# 神通升级表
-class IPY_ShentongLV():
-
- def __init__(self):
- self.attrTuple = None
- return
-
- def GetShentongID(self): return self.attrTuple[0] # 神通ID BYTE
- def GetShentongClassLV(self): return self.attrTuple[1] # 神通阶级 BYTE
- def GetShentongLV(self): return self.attrTuple[2] # 神通等级 BYTE
- def GetLVLightNeedItem(self): return self.attrTuple[3] # 点亮该级所需物品 [[物品ID,个数], ...] list
- def GetLVAttrTypeList(self): return self.attrTuple[4] # 该级属性类型列表 list
- def GetLVAttrValueList(self): return self.attrTuple[5] # 该级属性值列表 list
- def GetLVSkillID(self): return self.attrTuple[6] # 该级职业通用技能ID DWORD
- def GetFightPowerEx(self): return self.attrTuple[7] # 附加战力 DWORD
-
# 玩家等级表
class IPY_PlayerLV():
@@ -5673,8 +5631,6 @@
self.__LoadFileData("GubaoResonance", onlyCheck)
self.__LoadFileData("GubaoStar", onlyCheck)
self.__LoadFileData("GubaoLV", onlyCheck)
- self.__LoadFileData("Shentong", onlyCheck)
- self.__LoadFileData("ShentongLV", onlyCheck)
self.__LoadFileData("PlayerLV", onlyCheck)
self.__LoadFileData("SpecMapPlayerAttrFormat", onlyCheck)
self.__LoadFileData("GMAttr", onlyCheck)
@@ -6537,20 +6493,6 @@
def GetGubaoLVByIndex(self, index):
self.CheckLoadData("GubaoLV")
return self.ipyGubaoLVCache[index]
-
- def GetShentongCount(self):
- self.CheckLoadData("Shentong")
- return self.ipyShentongLen
- def GetShentongByIndex(self, index):
- self.CheckLoadData("Shentong")
- return self.ipyShentongCache[index]
-
- def GetShentongLVCount(self):
- self.CheckLoadData("ShentongLV")
- return self.ipyShentongLVLen
- def GetShentongLVByIndex(self, index):
- self.CheckLoadData("ShentongLV")
- return self.ipyShentongLVCache[index]
def GetPlayerLVCount(self):
self.CheckLoadData("PlayerLV")
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index 58764be..cff0141 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -102,7 +102,6 @@
import PlayerFaQi
import SkillShell
import PlayerGubao
-import PlayerShentong
import PlayerCustomAward
import PlayerZhanling
import PlayerTree
@@ -723,7 +722,6 @@
PlayerHJG.OnPlayerLogin(curPlayer)
PlayerXiangong.OnPlayerLogin(curPlayer)
PlayerGubao.OnPlayerLogin(curPlayer)
- PlayerShentong.OnPlayerLogin(curPlayer)
PlayerZhanling.OnPlayerLogin(curPlayer)
PlayerTask.OnPlayerLogin(curPlayer)
PlayerTree.OnPlayerLogin(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py
deleted file mode 100644
index 0472332..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py
+++ /dev/null
@@ -1,318 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#-------------------------------------------------------------------------------
-#
-##@package Player.PlayerShentong
-#
-# @todo:神通
-# @author hxp
-# @date 2023-01-08
-# @version 1.0
-#
-# 详细描述: 神通
-#
-#-------------------------------------------------------------------------------
-#"""Version = 2023-01-08 18:00"""
-#-------------------------------------------------------------------------------
-
-import GameWorld
-import ShareDefine
-import PlayerControl
-import IpyGameDataPY
-import ChPyNetSendPack
-import IPY_GameWorld
-import NetPackCommon
-import ItemCommon
-import ChConfig
-import SkillCommon
-
-def GetShentongLVInfo(curPlayer, shentongID):
- lvInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongLVInfo % shentongID)
- classLV = lvInfo / 100
- lv = lvInfo % 100
- return classLV, lv
-def SetShentongLVInfo(curPlayer, shentongID, classLV, lv):
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShentongLVInfo % shentongID, classLV * 100 + lv)
- return
-
-def OnPlayerLogin(curPlayer):
- Sync_ShentongLVInfo(curPlayer)
- Sync_ShentongSkillInfo(curPlayer, True)
- return
-
-#// B2 19 神通升级 #tagCMShentongLVUp
-#
-#struct tagCMShentongLVUp
-#{
-# tagHead Head;
-# BYTE ShentongID;
-#};
-def OnShentongLVUp(index, curPackData, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- playerID = curPlayer.GetPlayerID()
- shentongID = curPackData.ShentongID
- ipyData = IpyGameDataPY.GetIpyGameData("Shentong", shentongID)
- if not ipyData:
- return
-
- classLV, lv = GetShentongLVInfo(curPlayer, shentongID)
- nextClassLV = classLV
- nextLV = lv + 1
- lvIpyData = IpyGameDataPY.GetIpyGameDataNotLog("ShentongLV", shentongID, nextClassLV, nextLV)
- if not lvIpyData:
- nextClassLV = classLV + 1
- nextLV = 1
- lvIpyData = IpyGameDataPY.GetIpyGameDataNotLog("ShentongLV", shentongID, nextClassLV, nextLV)
- if not lvIpyData:
- GameWorld.ErrLog("没有下一级神通数据,无法升级! shentongID=%s,classLV=%s,lv=%s" % (shentongID, classLV, lv), playerID)
- return
-
- needItemList = lvIpyData.GetLVLightNeedItem()
- if not needItemList:
- return
-
- itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
- lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
- if lackItemDict:
- GameWorld.DebugLog("神通升级所需物品不足! shentongID=%s,classLV(%s-%s),nextClassLV=(%s-%s),needItemList=%s,lackItemDict=%s"
- % (shentongID, classLV, lv, nextClassLV, nextLV, needItemList, lackItemDict), playerID)
- return
- #扣消耗
- ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "Shentong")
-
- SetShentongLVInfo(curPlayer, shentongID, nextClassLV, nextLV)
- Sync_ShentongLVInfo(curPlayer, [shentongID])
-
- LVSkillID = lvIpyData.GetLVSkillID()
- GameWorld.Log("神通升级成功! shentongID=%s,classLV(%s-%s),nextClassLV=(%s-%s),LVSkillID=%s"
- % (shentongID, classLV, lv, nextClassLV, nextLV, LVSkillID), playerID)
- if LVSkillID:
- lvSkillData = GameWorld.GetGameData().GetSkillBySkillID(LVSkillID)
- lvSkillTypeID = lvSkillData.GetSkillTypeID() if lvSkillData else 0
- lvSkillLV = lvSkillData.GetSkillLV() if lvSkillData else 0
-
- ShentongSkillCount = len(IpyGameDataPY.GetFuncEvalCfg("Shentong", 1))
- skillIDList = []
- for num in range(ShentongSkillCount):
- skillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongSkillID % num)
- if not skillID:
- skillIDList.append(0)
- continue
- skillData = GameWorld.GetGameData().GetSkillBySkillID(skillID)
- if not skillData:
- continue
- skillTypeID = skillData.GetSkillTypeID()
- skillLV = skillData.GetSkillLV()
- if lvSkillTypeID == skillTypeID:
- if lvSkillLV > skillLV: # 升级
- skillIDList.append(LVSkillID)
- else:
- skillIDList.append(0) # 一般不可能,出现该情况的话置0重新添加
- else:
- skillIDList.append(skillID)
-
- # 有空位默认添加到该空位
- if LVSkillID not in skillIDList and 0 in skillIDList:
- skillIDList[skillIDList.index(0)] = LVSkillID
-
- if LVSkillID in skillIDList:
- GameWorld.DebugLog("自动出战/替换神通技能: skillIDList=%s" % skillIDList, playerID)
- SetShentongSkill(curPlayer, skillIDList)
-
- RefreshShentongAttr(curPlayer)
- return
-
-#// B2 20 神通技能设置 #tagCMShentongSkillSet
-#
-#struct tagCMShentongSkillSet
-#{
-# tagHead Head;
-# BYTE Count;
-# DWORD SkillIDList[Count];
-#};
-def OnShentongSkillSet(index, curPackData, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- skillIDList = curPackData.SkillIDList
- SetShentongSkill(curPlayer, skillIDList)
- return
-
-def SetShentongSkill(curPlayer, setSkillIDList):
- # @param setSkillIDList: 因为是发送所有技能槽设置的技能,所以元素中可能存在技能0
- if not setSkillIDList:
- return
- needSkillCntList = IpyGameDataPY.GetFuncEvalCfg("Shentong", 1)
- ShentongSkillCountMax = len(needSkillCntList)
- if len(setSkillIDList) > ShentongSkillCountMax:
- return
-
- if len(setSkillIDList) < ShentongSkillCountMax:
- setSkillIDList += [0] * (ShentongSkillCountMax - len(setSkillIDList))
-
- forbidSkillIDList = []
- for skillID in setSkillIDList:
- if not skillID:
- continue
- if not GameWorld.GetGameData().GetSkillBySkillID(skillID):
- GameWorld.ErrLog("找不到该神通技能数据! skillID=%s" % skillID)
- return
- forbidSkillIDList.append(skillID)
-
- setSkillCount = len(forbidSkillIDList)
- canUseSkillDict = {} # {skillTypeID:skillID, ...}
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for index in xrange(ipyDataMgr.GetShentongLVCount()):
- ipyData = ipyDataMgr.GetShentongLVByIndex(index)
- LVSkillID = ipyData.GetLVSkillID()
- if not LVSkillID:
- continue
- shentongID = ipyData.GetShentongID()
- shentongClassLV = ipyData.GetShentongClassLV()
- shentongLV = ipyData.GetShentongLV()
- classLV, lv = GetShentongLVInfo(curPlayer, shentongID)
- if classLV < shentongClassLV or (classLV == shentongClassLV and lv < shentongLV):
- #GameWorld.ErrLog("神通等级不足,无法使用该技能! LVSkillID=%s,shentongID=%s,needClassLV=(%s-%s),curClassLV=(%s-%s)"
- # % (LVSkillID, shentongID, shentongClassLV, shentongLV, classLV, lv), curPlayer.GetPlayerID())
- continue
- skillData = GameWorld.GetGameData().GetSkillBySkillID(LVSkillID)
- if not skillData:
- continue
- skillTypeID = skillData.GetSkillTypeID()
- canUseSkillDict[skillTypeID] = LVSkillID
- if LVSkillID in forbidSkillIDList:
- forbidSkillIDList.remove(LVSkillID)
-
- if forbidSkillIDList:
- GameWorld.ErrLog("存在无法使用的神通技能,无法设置! setSkillIDList=%s,forbidSkillIDList=%s"
- % (setSkillIDList, forbidSkillIDList), curPlayer.GetPlayerID())
- return
-
- if setSkillCount > 0:
- needCanUseSkillCnt = needSkillCntList[setSkillCount - 1]
- if needCanUseSkillCnt > len(canUseSkillDict):
- GameWorld.DebugLog("存在未解锁的神通技能孔,无法设置! setSkillIDList=%s,needCanUseSkillCnt=%s > canUseSkillCnt=%s(%s)"
- % (setSkillIDList, needCanUseSkillCnt, len(canUseSkillDict), canUseSkillDict), curPlayer.GetPlayerID())
- return
-
- # 因为可能调整顺序,必须先统一删除再统一添加,不然可能导致技能顺序调整后先被添加后又被删除
- skillManager = curPlayer.GetSkillManager()
- playerCtl = PlayerControl.PlayerControl(curPlayer)
- for num in range(ShentongSkillCountMax):
- skillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongSkillID % num)
- if skillID and skillManager.FindSkillBySkillID(skillID):
- skillManager.DeleteSkillBySkillID(skillID, True)
- playerCtl.RefreshSkillFightPowerByDel(skillID)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShentongSkillID % num, 0)
-
- tick = GameWorld.GetGameWorld().GetTick()
- for num in range(ShentongSkillCountMax):
- setSkillID = setSkillIDList[num]
- if setSkillID:
- skillManager.LearnSkillByID(setSkillID, True)
- playerCtl.RefreshSkillFightPowerEx(setSkillID, 0)
- # 重新设置技能强制进入CD
- curSkill = skillManager.FindSkillBySkillID(setSkillID)
- if curSkill:
- SkillCommon.SetSkillRemainTime(curSkill, PlayerControl.GetReduceSkillCDPer(curPlayer), tick, curPlayer, True)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShentongSkillID % num, setSkillID)
-
- Sync_ShentongSkillInfo(curPlayer)
- return
-
-def RefreshShentongAttr(curPlayer):
- CalcShentongAttr(curPlayer)
- PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
- return
-
-def CalcShentongAttr(curPlayer):
-
- customAttrDictShentong = {}
- fightPowerEx = 0
- allAttrList = [{} for _ in range(4)]
-
- shentongSkillInfo = {}
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for index in xrange(ipyDataMgr.GetShentongCount()):
- ipyData = ipyDataMgr.GetShentongByIndex(index)
- shentongID = ipyData.GetShentongID()
- classLV, lv = GetShentongLVInfo(curPlayer, shentongID)
- if not classLV and not lv:
- continue
- lvIpyDataList = IpyGameDataPY.GetIpyGameDataByCondition("ShentongLV", {"ShentongID":shentongID}, True)
- if not lvIpyDataList:
- continue
- for lvIpyData in lvIpyDataList:
- shentongClassLV = lvIpyData.GetShentongClassLV()
- shentongLV = lvIpyData.GetShentongLV()
- if classLV < shentongClassLV or (classLV == shentongClassLV and lv < shentongLV):
- break
-
- LVAttrTypeList = lvIpyData.GetLVAttrTypeList()
- LVAttrValueList = lvIpyData.GetLVAttrValueList()
- for i, attrID in enumerate(LVAttrTypeList):
- attrValue = LVAttrValueList[i]
- PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
-
- if lvIpyData.GetFightPowerEx():
- fightPowerEx += lvIpyData.GetFightPowerEx()
-
- LVSkillID = lvIpyData.GetLVSkillID()
- if LVSkillID:
- skillData = GameWorld.GetGameData().GetSkillBySkillID(LVSkillID)
- if skillData:
- skillTypeID = skillData.GetSkillTypeID()
- skillLV = skillData.GetSkillLV()
- shentongSkillInfo[skillTypeID] = skillLV
-
- customAttrDictShentong["shentongSkillInfo"] = shentongSkillInfo
- # 附加战力
- PlayerControl.SetMFPExFightPower(curPlayer, ShareDefine.Def_MFPType_Shentong, fightPowerEx)
- # 保存计算值
- PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Shentong, allAttrList, customAttrDict=customAttrDictShentong)
- return
-
-def Sync_ShentongLVInfo(curPlayer, shentongIDList=None):
- if shentongIDList == None:
- syncIDList = []
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for index in range(ipyDataMgr.GetShentongCount()):
- ipyData = ipyDataMgr.GetShentongByIndex(index)
- syncIDList.append(ipyData.GetShentongID())
- else:
- syncIDList = shentongIDList
-
- shentongInfoList = []
- for shentongID in syncIDList:
- classLV, lv = GetShentongLVInfo(curPlayer, shentongID)
- if not classLV and not lv and shentongIDList == None:
- # 没有指定时只同步激活的
- continue
- shentong = ChPyNetSendPack.tagMCShentongLV()
- shentong.ShentongID = shentongID
- shentong.ClassLV = classLV
- shentong.LV = lv
- shentongInfoList.append(shentong)
-
- if not shentongInfoList:
- return
-
- clientPack = ChPyNetSendPack.tagMCShentongLVInfo()
- clientPack.ShentongLVList = shentongInfoList
- clientPack.Count = len(clientPack.ShentongLVList)
- NetPackCommon.SendFakePack(curPlayer, clientPack)
- return
-
-def Sync_ShentongSkillInfo(curPlayer, isLogin=False):
- skillIDList = []
- ShentongSkillCountMax = len(IpyGameDataPY.GetFuncEvalCfg("Shentong", 1))
- for num in range(ShentongSkillCountMax):
- skillIDList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongSkillID % num))
-
- if skillIDList.count(0) == ShentongSkillCountMax and isLogin:
- return
-
- clientPack = ChPyNetSendPack.tagMCShentongSkillInfo()
- clientPack.SkillIDList = skillIDList
- clientPack.Count = len(clientPack.SkillIDList)
- NetPackCommon.SendFakePack(curPlayer, clientPack)
- return
-
--
Gitblit v1.8.0