hxp
2018-09-19 2786606d81a3938bec26619884bff65c55af657d
Fix: A5 C4 神兽装备强化 #tagCMDogzEquipPlus(增加消耗个数)
3个文件已修改
48 ■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -8270,6 +8270,7 @@
    EquipIndex = 0    #(BYTE EquipIndex)//神兽装备背包中索引
    IndexCount = 0    #(BYTE IndexCount)//材料所在神兽物品背包索引的数量
    IndexList = list()    #(vector<BYTE> IndexList)//材料所在神兽物品背包索引列表
    IndexUseCountList = list()    #(vector<DWORD> IndexUseCountList)//材料所在神兽物品背包索引对应使用个数列表
    IsDouble = 0    #(BYTE IsDouble)//是否双倍强化
    data = None
@@ -8287,6 +8288,9 @@
        for i in range(self.IndexCount):
            value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
            self.IndexList.append(value)
        for i in range(self.IndexCount):
            value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
            self.IndexUseCountList.append(value)
        self.IsDouble,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        return _pos
@@ -8298,6 +8302,7 @@
        self.EquipIndex = 0
        self.IndexCount = 0
        self.IndexList = list()
        self.IndexUseCountList = list()
        self.IsDouble = 0
        return
@@ -8307,6 +8312,7 @@
        length += 1
        length += 1
        length += 1 * self.IndexCount
        length += 4 * self.IndexCount
        length += 1
        return length
@@ -8318,6 +8324,8 @@
        data = CommFunc.WriteBYTE(data, self.IndexCount)
        for i in range(self.IndexCount):
            data = CommFunc.WriteBYTE(data, self.IndexList[i])
        for i in range(self.IndexCount):
            data = CommFunc.WriteDWORD(data, self.IndexUseCountList[i])
        data = CommFunc.WriteBYTE(data, self.IsDouble)
        return data
@@ -8327,6 +8335,7 @@
                                EquipIndex:%d,
                                IndexCount:%d,
                                IndexList:%s,
                                IndexUseCountList:%s,
                                IsDouble:%d
                                '''\
                                %(
@@ -8334,6 +8343,7 @@
                                self.EquipIndex,
                                self.IndexCount,
                                "...",
                                "...",
                                self.IsDouble
                                )
        return DumpString
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -8270,6 +8270,7 @@
    EquipIndex = 0    #(BYTE EquipIndex)//神兽装备背包中索引
    IndexCount = 0    #(BYTE IndexCount)//材料所在神兽物品背包索引的数量
    IndexList = list()    #(vector<BYTE> IndexList)//材料所在神兽物品背包索引列表
    IndexUseCountList = list()    #(vector<DWORD> IndexUseCountList)//材料所在神兽物品背包索引对应使用个数列表
    IsDouble = 0    #(BYTE IsDouble)//是否双倍强化
    data = None
@@ -8287,6 +8288,9 @@
        for i in range(self.IndexCount):
            value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
            self.IndexList.append(value)
        for i in range(self.IndexCount):
            value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
            self.IndexUseCountList.append(value)
        self.IsDouble,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        return _pos
@@ -8298,6 +8302,7 @@
        self.EquipIndex = 0
        self.IndexCount = 0
        self.IndexList = list()
        self.IndexUseCountList = list()
        self.IsDouble = 0
        return
@@ -8307,6 +8312,7 @@
        length += 1
        length += 1
        length += 1 * self.IndexCount
        length += 4 * self.IndexCount
        length += 1
        return length
@@ -8318,6 +8324,8 @@
        data = CommFunc.WriteBYTE(data, self.IndexCount)
        for i in range(self.IndexCount):
            data = CommFunc.WriteBYTE(data, self.IndexList[i])
        for i in range(self.IndexCount):
            data = CommFunc.WriteDWORD(data, self.IndexUseCountList[i])
        data = CommFunc.WriteBYTE(data, self.IsDouble)
        return data
@@ -8327,6 +8335,7 @@
                                EquipIndex:%d,
                                IndexCount:%d,
                                IndexList:%s,
                                IndexUseCountList:%s,
                                IsDouble:%d
                                '''\
                                %(
@@ -8334,6 +8343,7 @@
                                self.EquipIndex,
                                self.IndexCount,
                                "...",
                                "...",
                                self.IsDouble
                                )
        return DumpString
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
@@ -314,6 +314,7 @@
#    BYTE        EquipIndex;    //神兽装备背包中索引
#    BYTE        IndexCount;        //材料所在神兽物品背包索引的数量
#    BYTE        IndexList[IndexCount];    //材料所在神兽物品背包索引列表
#    BYTE        IndexUseCountList[IndexCount];    //材料所在神兽物品背包索引对应使用个数列表
#    BYTE        IsDouble;        //是否双倍强化
#};
def OnDogzEquipPlus(index, clientData, tick):
@@ -321,8 +322,14 @@
    playerID = curPlayer.GetPlayerID()
    equipIndex = clientData.EquipIndex
    indexList = clientData.IndexList
    indexUseCountList = clientData.IndexUseCountList
    isDouble = clientData.IsDouble
    GameWorld.DebugLog("神兽装备强化: equipIndex=%s,indexList=%s,isDouble=%s" % (equipIndex, indexList, isDouble), playerID)
    GameWorld.DebugLog("神兽装备强化: equipIndex=%s,indexList=%s,indexUseCountList=%s,isDouble=%s"
                       % (equipIndex, indexList, indexUseCountList, isDouble), playerID)
    if len(indexList) != len(indexUseCountList):
        GameWorld.DebugLog("    指定消耗的个数数据长度错误!")
        return
    
    dogzEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzEquip)
    curEquip = dogzEquipPack.GetAt(equipIndex)
@@ -370,24 +377,25 @@
            GameWorld.ErrLog("神兽背包物品无经验效果,无法强化!i=%s,itemID=%s" % (i, curItem.GetItemTypeID()), playerID)
            return
        
        delCount = max(1, min(curItem.GetCount(), indexUseCountList[i]))
        baseExp = effect.GetEffectValue(0)
        doubleCostGold = effect.GetEffectValue(1)
        
        addExp = baseExp
        addExp = baseExp * delCount
        plusInfoCount = curItem.GetUserAttrCount(ShareDefine.Def_IudetDogzEquipPlus)
        if not plusInfoCount:
            if isDouble and doubleCostGold:
                addExp = (baseExp * 2)
                costGoldTotal += doubleCostGold
            GameWorld.DebugLog("    强化: addExp=%s,baseExp=%s,isDouble=%s,doubleCostGold=%s,costGoldTotal=%s"
                               % (addExp, baseExp, isDouble, doubleCostGold, costGoldTotal), playerID)
                addExp = (baseExp * 2 * delCount)
                costGoldTotal += doubleCostGold * delCount
            GameWorld.DebugLog("    强化: addExp=%s,delCount=%s,baseExp=%s,isDouble=%s,doubleCostGold=%s,costGoldTotal=%s"
                               % (addExp, delCount, baseExp, isDouble, doubleCostGold, costGoldTotal), playerID)
        else:
            #plusLV = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetDogzEquipPlus, 0)
            plusExpTotal = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetDogzEquipPlus, 1)
            addExp += plusExpTotal
            GameWorld.DebugLog("    强化: addExp=%s,baseExp=%s,plusExpTotal=%s" % (addExp, baseExp, plusExpTotal), playerID)
            GameWorld.DebugLog("    强化: addExp=%s,delCount=%s,baseExp=%s,plusExpTotal=%s" % (addExp, delCount, baseExp, plusExpTotal), playerID)
        addExpTotal += addExp
        delItemList.append(curItem)
        delItemList.append([curItem, delCount])
        
    if not delItemList:
        GameWorld.DebugLog("    没有材料可强化!", playerID)
@@ -401,8 +409,8 @@
                                      ChConfig.Def_Cost_DogzEquipPlus, infoDict):
            return
        
    for delItem in delItemList:
        ItemCommon.DelItem(curPlayer, delItem, curItem.GetCount(), False, ChConfig.ItemDel_DogzEquipPlus, infoDict)
    for delItem, delCount in delItemList:
        ItemCommon.DelItem(curPlayer, delItem, delCount, False, ChConfig.ItemDel_DogzEquipPlus, infoDict)
        
    updPlusLV = curPlusLV
    doCount, maxDoCount = 0, maxPlusLV * 2