xdh
2019-07-01 4a95dde4662769711a7ba2a21e32567711ced1d6
7678 【2.0.200】【后端】灵器系统
7个文件已修改
294 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -6774,6 +6774,58 @@
#------------------------------------------------------
# A3 18 灵器突破 #tagCMLingQiEquipBreak
class  tagCMLingQiEquipBreak(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("ItemID", c_int),    #突破的物品ID
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xA3
        self.SubCmd = 0x18
        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 = 0xA3
        self.SubCmd = 0x18
        self.ItemID = 0
        return
    def GetLength(self):
        return sizeof(tagCMLingQiEquipBreak)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A3 18 灵器突破 //tagCMLingQiEquipBreak:
                                Cmd:%s,
                                SubCmd:%s,
                                ItemID:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.ItemID
                                )
        return DumpString
m_NAtagCMLingQiEquipBreak=tagCMLingQiEquipBreak()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMLingQiEquipBreak.Cmd,m_NAtagCMLingQiEquipBreak.SubCmd))] = m_NAtagCMLingQiEquipBreak
#------------------------------------------------------
#A3 02 丢弃背包物品 #tagPlayerDropItem
class  tagPlayerDropItem(Structure):
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -21502,6 +21502,58 @@
#------------------------------------------------------
# A8 15 灵器突破结果 #tagMCLingQiEquipBreakResult
class  tagMCLingQiEquipBreakResult(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("MakeItemID", c_int),    #突破后的物品ID
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xA8
        self.SubCmd = 0x15
        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 = 0xA8
        self.SubCmd = 0x15
        self.MakeItemID = 0
        return
    def GetLength(self):
        return sizeof(tagMCLingQiEquipBreakResult)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A8 15 灵器突破结果 //tagMCLingQiEquipBreakResult:
                                Cmd:%s,
                                SubCmd:%s,
                                MakeItemID:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.MakeItemID
                                )
        return DumpString
m_NAtagMCLingQiEquipBreakResult=tagMCLingQiEquipBreakResult()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLingQiEquipBreakResult.Cmd,m_NAtagMCLingQiEquipBreakResult.SubCmd))] = m_NAtagMCLingQiEquipBreakResult
#------------------------------------------------------
# A8 14 合成结果通知 #tagMCMakeItemAnswer
class  tagMCMakeItemAnswer(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1221,12 +1221,16 @@
Writer = xdh
Releaser = xdh
RegType = 0
RegisterPackCount = 1
RegisterPackCount = 2
PacketCMD_1=0xA5
PacketSubCMD_1=0x03
PacketCallFunc_1=OnActiveAllEquipAttr
PacketCMD_2=0xA3
PacketSubCMD_2=0x18
PacketCallFunc_2=OnLingQiEquipBreak
;仙盟抢boss
[FamilyRobBoss]
ScriptName = GameWorldLogic\FamilyRobBoss.py
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4780,7 +4780,8 @@
ItemGive_Chests, # 宝箱
ItemGive_TrialExchange, # 宗门兑换
ItemGive_LuckyTreasure, #幸运鉴宝
) = range(1000, 1000 + 21)
ItemGive_LingQiEquipBreak, #灵器突破
) = range(1000, 1000 + 22)
# 物品获得类型对应信息 {类型:eventName, ...}
ItemGiveTypeDict = {
@@ -4805,6 +4806,7 @@
                    ItemGive_Chests:"Chests",
                    ItemGive_TrialExchange:"TrialExchange",
                    ItemGive_LuckyTreasure:"LuckyTreasure",
                    ItemGive_LingQiEquipBreak:"LingQiEquipBreak",
                    }
## 物品扣除类型定义,与获得类型不重复,类型定义为 2000 ~ 2999
@@ -4849,7 +4851,8 @@
ItemDel_2037,
ItemDel_EquipStarUp, # 装备升星
ItemDel_EquipPlusEvolve, # 装备强化进化
) = range(2000, 2000 + 40)
ItemDel_LingQiEquipBreak, # 灵器突破
) = range(2000, 2000 + 41)
# 物品扣除类型对应信息 {类型:eventName, ...}
ItemDelTypeDict = {
@@ -4892,6 +4895,7 @@
                   ItemDel_CoatDecompose:"CoatDecompose",
                   ItemDel_EquipStarUp:"EquipStarUp",
                   ItemDel_EquipPlusEvolve:"EquipPlusEvolve",
                   ItemDel_LingQiEquipBreak:"LingQiEquipBreak",
                   }
##==================================================================================================
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -6774,6 +6774,58 @@
#------------------------------------------------------
# A3 18 灵器突破 #tagCMLingQiEquipBreak
class  tagCMLingQiEquipBreak(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("ItemID", c_int),    #突破的物品ID
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xA3
        self.SubCmd = 0x18
        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 = 0xA3
        self.SubCmd = 0x18
        self.ItemID = 0
        return
    def GetLength(self):
        return sizeof(tagCMLingQiEquipBreak)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A3 18 灵器突破 //tagCMLingQiEquipBreak:
                                Cmd:%s,
                                SubCmd:%s,
                                ItemID:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.ItemID
                                )
        return DumpString
m_NAtagCMLingQiEquipBreak=tagCMLingQiEquipBreak()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMLingQiEquipBreak.Cmd,m_NAtagCMLingQiEquipBreak.SubCmd))] = m_NAtagCMLingQiEquipBreak
#------------------------------------------------------
#A3 02 丢弃背包物品 #tagPlayerDropItem
class  tagPlayerDropItem(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -21502,6 +21502,58 @@
#------------------------------------------------------
# A8 15 灵器突破结果 #tagMCLingQiEquipBreakResult
class  tagMCLingQiEquipBreakResult(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("MakeItemID", c_int),    #突破后的物品ID
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xA8
        self.SubCmd = 0x15
        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 = 0xA8
        self.SubCmd = 0x15
        self.MakeItemID = 0
        return
    def GetLength(self):
        return sizeof(tagMCLingQiEquipBreakResult)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A8 15 灵器突破结果 //tagMCLingQiEquipBreakResult:
                                Cmd:%s,
                                SubCmd:%s,
                                MakeItemID:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.MakeItemID
                                )
        return DumpString
m_NAtagMCLingQiEquipBreakResult=tagMCLingQiEquipBreakResult()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLingQiEquipBreakResult.Cmd,m_NAtagMCLingQiEquipBreakResult.SubCmd))] = m_NAtagMCLingQiEquipBreakResult
#------------------------------------------------------
# A8 14 合成结果通知 #tagMCMakeItemAnswer
class  tagMCMakeItemAnswer(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -573,6 +573,78 @@
    
    return
#// A3 18 灵器突破 #tagCMLingQiEquipBreak
#
#struct    tagCMLingQiEquipBreak
#{
#    tagHead        Head;
#    DWORD        ItemID;  //突破的物品ID
#};
def OnLingQiEquipBreak(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    breakItemID = clientData.ItemID
    ipyData = IpyGameDataPY.GetIpyGameData('LingQiAttr', breakItemID)
    if not ipyData:
        return
    nextItemID = ipyData.GetNextItemID() #突破后的物品ID
    if not IpyGameDataPY.GetIpyGameData('LingQiAttr', nextItemID):
        return
    breakItemData = GameWorld.GetGameData().GetItemByTypeID(breakItemID)
    nextItemData = GameWorld.GetGameData().GetItemByTypeID(nextItemID)
    if not breakItemData or not nextItemData:
        return
    equipIndex = ItemCommon.GetEquipPackIndex(breakItemData)
    if equipIndex != ItemCommon.GetEquipPackIndex(nextItemData):
        GameWorld.DebugLog("突破的物品和突破后的物品不是同个装备位!breakItemID=%s,nextItemID=%s"
                           % (breakItemID, nextItemID))
        return
    equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
    curEquip = equipPack.GetAt(equipIndex)
    if not curEquip or curEquip.IsEmpty():
        GameWorld.DebugLog("突破的物品未穿戴!breakItemID=%s"
                           % (breakItemID))
        return
    if curEquip.GetEndureReduceType():
        GameWorld.DebugLog("突破的物品是时效物品!breakItemID=%s"
                           % (breakItemID))
        return
    if curEquip.GetItemTypeID() != breakItemID:
        GameWorld.DebugLog("突破的物品未穿戴!breakItemID=%s"
                           % (breakItemID))
        return
    costItemDict = ipyData.GetUpCostItem()
    itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
    lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(costItemDict, itemPack)
    if lackItemDict:
        GameWorld.DebugLog("突破消耗物品不足!breakItemID=%s,costItemDict=%s,lackItemDict=%s"
                           % (breakItemID, costItemDict, lackItemDict))
        return
    #扣消耗
    ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, 'LingQiEquipBreak')
    ItemCommon.DelItem(curPlayer, curEquip, 1, False, ChConfig.ItemDel_LingQiEquipBreak, {}, True)
    #给物品
    ItemControler.GivePlayerItem(curPlayer, nextItemID, 1, 0, [IPY_GameWorld.rptEquip],
                                 event=[ChConfig.ItemGive_LingQiEquipBreak, False, {}])
    changeItemID = curEquip.GetItemTypeID()
    changeItemStarLV = 0  #curItem.GetItemStarLV()
    changeItemStoneCnt = 0  #curItem.GetUseStoneCount()
    changeItemHoleCnt = 0  #curItem.GetCanPlaceStoneCount()
    changeItemUseData = curEquip.GetUserData()
    curPlayer.ChangeEquip(changeItemID, equipIndex, changeItemStarLV, changeItemHoleCnt, changeItemStoneCnt, changeItemUseData)
    #刷属性
    RefreshPlayerLingQiEquipAttr(curPlayer)
    playControl = PlayerControl.PlayerControl(curPlayer)
    playControl.RefreshPlayerAttrState()
    #通知结果
    resultPack = ChPyNetSendPack.tagMCLingQiEquipBreakResult()
    resultPack.Clear()
    resultPack.MakeItemID = nextItemID
    NetPackCommon.SendFakePack(curPlayer, resultPack)
    return
def RefreshPlayerLingQiEquipAttr(curPlayer):
    ''' 刷新玩家灵器装备属性
    '''