| | |
| | | DWORD BookInitAddPer; // 图鉴初始加成
|
| | | DWORD BookStarAddPer; // 图鉴每星级加成
|
| | | DWORD BookBreakLVAddPer; // 图鉴每突破等级加成
|
| | | list DismissReturnItems; // 遣散每星返还道具 [[物品ID,个数], ...]
|
| | | };
|
| | |
|
| | | //武将品质突破表
|
| | |
| | | DWORD _Quality; //品质
|
| | | DWORD _AwakeLV; //觉醒等级
|
| | | list UPCostItem; // 觉醒到下级消耗道具
|
| | | DWORD RebirthCostMoney; //重生消耗货币
|
| | | };
|
| | |
|
| | | //品质武将升级表
|
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 10
|
| | | RegisterPackCount = 12
|
| | |
|
| | | PacketCMD_1=0xB2
|
| | | PacketSubCMD_1=0x30
|
| | |
| | | PacketCMD_10=0xB4
|
| | | PacketSubCMD_10=0x12
|
| | | PacketCallFunc_10=OnHeroLineupSave
|
| | |
|
| | | PacketCMD_11=0xB2
|
| | | PacketSubCMD_11=0x39
|
| | | PacketCallFunc_11=OnHeroRebirth
|
| | |
|
| | | PacketCMD_12=0xB2
|
| | | PacketSubCMD_12=0x40
|
| | | PacketCallFunc_12=OnHeroDismiss
|
| | |
| | | #武将
|
| | | Def_PDict_HeroSkin = "HeroSkin_%s" # 武将皮肤解锁状态,按皮肤索引二进制存储,参数(武将ID)
|
| | | Def_PDict_HeroBook = "HeroBook_%s" # 武将图鉴激活等级,参数(武将ID) cccbbba a-初始激活状态1-英雄激活,2-初始图鉴激活; bbb-存星级图鉴激活等级;ccc-存突破图鉴激活等级
|
| | | Def_PDict_HeroAwakeRebirthCnt = "HeroAwakeRebirthCnt" # 已觉醒过的武将今日已重生次数,共享次数
|
| | |
|
| | | #主线
|
| | | Def_PDict_UnXiantaoCntExp = "UnXiantaoCntExp" # 累计未结算经验的战锤数
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 40 武将遣散 #tagCSHeroDismiss
|
| | |
|
| | | class tagCSHeroDismiss(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | ItemIndexList = list() #(vector<WORD> ItemIndexList)// 武将物品所在武将背包位置索引列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x40
|
| | | 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.ReadWORD(_lpData,_pos)
|
| | | self.ItemIndexList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x40
|
| | | self.Count = 0
|
| | | self.ItemIndexList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 2 * 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.WriteWORD(data, self.ItemIndexList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | ItemIndexList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCSHeroDismiss=tagCSHeroDismiss()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroDismiss.Head.Cmd,m_NAtagCSHeroDismiss.Head.SubCmd))] = m_NAtagCSHeroDismiss
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 38 武将锁定 #tagCSHeroLock
|
| | |
|
| | | class tagCSHeroLock(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 39 武将重生 #tagCSHeroRebirth
|
| | |
|
| | | class tagCSHeroRebirth(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ItemIndex", c_ushort), #武将物品所在武将背包位置索引
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x39
|
| | | 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 = 0x39
|
| | | self.ItemIndex = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCSHeroRebirth)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 39 武将重生 //tagCSHeroRebirth:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemIndex:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ItemIndex
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCSHeroRebirth=tagCSHeroRebirth()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroRebirth.Cmd,m_NAtagCSHeroRebirth.SubCmd))] = m_NAtagCSHeroRebirth
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 31 武将升星 #tagCSHeroStarUP
|
| | |
|
| | | class tagCSHeroStarUP(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 25 玩家武将公共信息 #tagSCPlayerHeroInfo
|
| | |
|
| | | class tagSCPlayerHeroInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("AwakeRebirthCnt", c_ubyte), # 今日觉醒过的武将已重生次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x25
|
| | | 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 = 0xB1
|
| | | self.SubCmd = 0x25
|
| | | self.AwakeRebirthCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagSCPlayerHeroInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 25 玩家武将公共信息 //tagSCPlayerHeroInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | AwakeRebirthCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.AwakeRebirthCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagSCPlayerHeroInfo=tagSCPlayerHeroInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCPlayerHeroInfo.Cmd,m_NAtagSCPlayerHeroInfo.SubCmd))] = m_NAtagSCPlayerHeroInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 07 玩家点数信息 #tagMCRolePointInfo
|
| | |
|
| | | class tagMCRolePointInfo(Structure):
|
| | |
| | | GameWorld.DebugAnswer(curPlayer, "武将觉醒: Hero a 背包位置 设置等级")
|
| | | GameWorld.DebugAnswer(curPlayer, "武将图鉴: Hero t 武将ID 图鉴星级 图鉴突破等级")
|
| | | GameWorld.DebugAnswer(curPlayer, "重置图鉴: Hero t 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "重置重生: Hero r")
|
| | | GameWorld.DebugAnswer(curPlayer, "武将皮肤: Hero sk 武将ID 皮肤索引 是否解锁")
|
| | | GameWorld.DebugAnswer(curPlayer, "清空武将: ClearPack 35")
|
| | | GameWorld.DebugAnswer(curPlayer, "新增武将: MakeItemCount 英雄ID [个数]")
|
| | |
| | | PlayerHero.Sync_HeroInfo(curPlayer, syncHeroIDList)
|
| | | return
|
| | |
|
| | | # 重生
|
| | | if value == "r":
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HeroAwakeRebirthCnt, 0)
|
| | | PlayerHero.Sync_PlayerHeroInfo(curPlayer)
|
| | | return
|
| | | |
| | | # 皮肤
|
| | | if value == "sk":
|
| | | heroID = value2
|
| | |
| | | ("DWORD", "BookInitAddPer", 0),
|
| | | ("DWORD", "BookStarAddPer", 0),
|
| | | ("DWORD", "BookBreakLVAddPer", 0),
|
| | | ("list", "DismissReturnItems", 0),
|
| | | ),
|
| | |
|
| | | "HeroQualityBreak":(
|
| | |
| | | ("DWORD", "Quality", 1),
|
| | | ("DWORD", "AwakeLV", 1),
|
| | | ("list", "UPCostItem", 0),
|
| | | ("DWORD", "RebirthCostMoney", 0),
|
| | | ),
|
| | |
|
| | | "HeroQualityLV":(
|
| | |
| | | def GetBookActAwardMoney(self): return self.attrTuple[7] # 图鉴激活奖励货币 类型|值 list
|
| | | def GetBookInitAddPer(self): return self.attrTuple[8] # 图鉴初始加成 DWORD
|
| | | def GetBookStarAddPer(self): return self.attrTuple[9] # 图鉴每星级加成 DWORD
|
| | | def GetBookBreakLVAddPer(self): return self.attrTuple[10] # 图鉴每突破等级加成 DWORD |
| | | def GetBookBreakLVAddPer(self): return self.attrTuple[10] # 图鉴每突破等级加成 DWORD
|
| | | def GetDismissReturnItems(self): return self.attrTuple[11] # 遣散每星返还道具 [[物品ID,个数], ...] list |
| | | |
| | | # 武将品质突破表 |
| | | class IPY_HeroQualityBreak(): |
| | |
| | | |
| | | def GetQuality(self): return self.attrTuple[0] # 品质 DWORD
|
| | | def GetAwakeLV(self): return self.attrTuple[1] # 觉醒等级 DWORD
|
| | | def GetUPCostItem(self): return self.attrTuple[2] # 觉醒到下级消耗道具 list |
| | | def GetUPCostItem(self): return self.attrTuple[2] # 觉醒到下级消耗道具 list
|
| | | def GetRebirthCostMoney(self): return self.attrTuple[3] # 重生消耗货币 DWORD |
| | | |
| | | # 品质武将升级表 |
| | | class IPY_HeroQualityLV(): |
| | |
| | | import PlayerBillboard
|
| | | import PlayerViewCache
|
| | | import PlayerMail
|
| | | import PlayerHero
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | | ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_RechargeDayAward, 0)
|
| | | # 特殊时间点X点过天
|
| | | elif onEventType == ShareDefine.Def_OnEventTypeEx:
|
| | | PlayerHero.PlayerOnDay(curPlayer)
|
| | | # 资源找回
|
| | | PlayerRecover.RecoverOnDay(curPlayer)
|
| | | # 世界boss
|
| | |
| | |
|
| | | import random
|
| | |
|
| | | def PlayerOnDay(curPlayer):
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HeroAwakeRebirthCnt):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HeroAwakeRebirthCnt, 0)
|
| | | Sync_PlayerHeroInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | Sync_HeroInfo(curPlayer)
|
| | | Sync_PlayerHeroInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerFirstLogin(curPlayer):
|
| | |
| | | heroItem.SetIsLocked(1 if isLock else 0)
|
| | | return
|
| | |
|
| | | #// B2 39 武将重生 #tagCSHeroRebirth
|
| | | #
|
| | | #struct tagCSHeroRebirth
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD ItemIndex; //武将物品所在武将背包位置索引
|
| | | #};
|
| | | def OnHeroRebirth(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | itemIndex = clientData.ItemIndex
|
| | | heroItem = GetHeroItem(curPlayer, itemIndex)
|
| | | if not heroItem:
|
| | | return
|
| | | heroLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroLV)
|
| | | breakLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroBreakLV)
|
| | | awakeLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroAwakeLV)
|
| | | if heroLV <= 1 and not breakLV and not awakeLV:
|
| | | GameWorld.DebugLog("该武将未进行过等级突破觉醒培养,不需要重生! itemIndex=%s" % (itemIndex))
|
| | | return
|
| | | |
| | | if awakeLV:
|
| | | rebirthCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HeroAwakeRebirthCnt)
|
| | | rebirthCntMax = IpyGameDataPY.GetFuncCfg("HeroRebirth", 2)
|
| | | if rebirthCntMax and rebirthCnt >= rebirthCntMax:
|
| | | GameWorld.DebugLog("今日觉醒过的武将重生次数已达上限! rebirthCnt=%s >= %s" % (rebirthCnt, rebirthCntMax))
|
| | | return
|
| | | |
| | | heroID = heroItem.GetItemTypeID()
|
| | | heroIpyData = IpyGameDataPY.GetIpyGameData("Hero", heroID)
|
| | | if not heroIpyData:
|
| | | return
|
| | | quality = heroIpyData.GetQuality()
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("HeroQualityAwake", quality, awakeLV)
|
| | | if not ipyData:
|
| | | return
|
| | | costMoney = ipyData.GetRebirthCostMoney()
|
| | | moneyType = IpyGameDataPY.GetFuncCfg("HeroRebirth", 1)
|
| | | if moneyType and costMoney and not PlayerControl.HaveMoney(curPlayer, moneyType, costMoney):
|
| | | return
|
| | | |
| | | # 验证通过,可以重生
|
| | | GameWorld.DebugLog("武将重生: itemIndex=%s,heroID=%s,quality=%s,heroLV=%s,breakLV=%s,awakeLV=%s" |
| | | % (itemIndex, heroID, quality, heroLV, breakLV, awakeLV))
|
| | | |
| | | returnItemDict = {}
|
| | | __calcHeroLVReturnitem(quality, heroLV, returnItemDict)
|
| | | __calcHeroBreakReturnitem(quality, breakLV, returnItemDict)
|
| | | __calcHeroAwakeReturnitem(quality, awakeLV, returnItemDict)
|
| | | |
| | | # 执行重生
|
| | | item = heroItem.GetItem()
|
| | | item.SetUserAttr(ShareDefine.Def_IudetHeroLV, 1)
|
| | | item.SetUserAttr(ShareDefine.Def_IudetHeroBreakLV, 0)
|
| | | item.SetUserAttr(ShareDefine.Def_IudetHeroAwakeLV, 0)
|
| | | heroItem.Sync_Item()
|
| | | |
| | | if returnItemDict:
|
| | | returnItemList = [[k, v] for k, v in returnItemDict.items()]
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, returnItemList, event=["HeroRebirth", False, {}])
|
| | | |
| | | if awakeLV:
|
| | | rebirthCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HeroAwakeRebirthCnt)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HeroAwakeRebirthCnt, rebirthCnt + 1)
|
| | | Sync_PlayerHeroInfo(curPlayer)
|
| | | |
| | | return
|
| | |
|
| | | def __calcHeroLVReturnitem(quality, heroLV, returnItemDict):
|
| | | ## 计算武将等级返还
|
| | | returnDict = {}
|
| | | for retLV in range(1, heroLV):
|
| | | qualityLVIpyData = IpyGameDataPY.GetIpyGameData("HeroQualityLV", quality, retLV)
|
| | | if not qualityLVIpyData:
|
| | | continue
|
| | | costItemInfo = qualityLVIpyData.GetUPCostItem()
|
| | | if not costItemInfo:
|
| | | continue
|
| | | costItemID, costItemCount = costItemInfo
|
| | | returnItemDict[costItemID] = returnItemDict.get(costItemID, 0) + costItemCount
|
| | | returnDict[costItemID] = returnDict.get(costItemID, 0) + costItemCount
|
| | | GameWorld.DebugLog(" 等级返还: quality=%s,heroLV=%s,%s,总%s" % (quality, heroLV, returnDict, returnItemDict))
|
| | | return
|
| | |
|
| | | def __calcHeroBreakReturnitem(quality, breakLV, returnItemDict):
|
| | | # 计算武将突破返还
|
| | | returnDict = {}
|
| | | for retBreakLV in range(0, breakLV):
|
| | | qualityBreakIpyData = IpyGameDataPY.GetIpyGameData("HeroQualityBreak", quality, retBreakLV)
|
| | | if not qualityBreakIpyData:
|
| | | continue
|
| | | costItemInfo = qualityBreakIpyData.GetUPCostItem()
|
| | | if not costItemInfo:
|
| | | continue
|
| | | costItemID, costItemCount = costItemInfo
|
| | | returnItemDict[costItemID] = returnItemDict.get(costItemID, 0) + costItemCount
|
| | | returnDict[costItemID] = returnDict.get(costItemID, 0) + costItemCount
|
| | | GameWorld.DebugLog(" 突破返还: quality=%s,breakLV=%s,%s,总%s" % (quality, breakLV, returnDict, returnItemDict))
|
| | | return
|
| | |
|
| | | def __calcHeroAwakeReturnitem(quality, awakeLV, returnItemDict):
|
| | | # 计算武将觉醒返还
|
| | | returnDict = {}
|
| | | for retAwakeLV in range(0, awakeLV):
|
| | | qualityAwakeIpyData = IpyGameDataPY.GetIpyGameData("HeroQualityAwake", quality, retAwakeLV)
|
| | | if not qualityAwakeIpyData:
|
| | | continue
|
| | | costItemInfo = qualityAwakeIpyData.GetUPCostItem()
|
| | | if not costItemInfo:
|
| | | continue
|
| | | costItemID, costItemCount = costItemInfo
|
| | | returnItemDict[costItemID] = returnItemDict.get(costItemID, 0) + costItemCount
|
| | | returnDict[costItemID] = returnDict.get(costItemID, 0) + costItemCount
|
| | | GameWorld.DebugLog(" 觉醒返还: quality=%s,awakeLV=%s,%s,总%s" % (quality, awakeLV, returnDict, returnItemDict))
|
| | | return
|
| | |
|
| | | #// B2 40 武将遣散 #tagCSHeroDismiss
|
| | | #
|
| | | #struct tagCSHeroDismiss
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE Count;
|
| | | # WORD ItemIndexList[Count]; // 武将物品所在武将背包位置索引列表
|
| | | #};
|
| | | def OnHeroDismiss(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | itemIndexList = clientData.ItemIndexList
|
| | | GameWorld.DebugLog("武将遣散: itemIndexList=%s" % itemIndexList)
|
| | | |
| | | dismissItemList = []
|
| | | returnItemDict = {}
|
| | | curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptHero)
|
| | | for itemIndex in itemIndexList:
|
| | | if itemIndex < 0 or itemIndex >= curPack.GetCount():
|
| | | continue
|
| | | heroItem = curPack.GetAt(itemIndex)
|
| | | if not heroItem or heroItem.IsEmpty():
|
| | | continue
|
| | | awakeLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroAwakeLV)
|
| | | if awakeLV:
|
| | | GameWorld.DebugLog("觉醒过的武将需先重生后才可遣散! itemIndex=%s,awakeLV=%s" % (itemIndex, awakeLV))
|
| | | continue
|
| | | if heroItem.GetIsLocked():
|
| | | GameWorld.DebugLog("锁定的武将无法遣散! itemIndex=%s" % (itemIndex))
|
| | | continue
|
| | | lineupCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroLineup)
|
| | | if lineupCount:
|
| | | lineupValueList = [heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroLineup, lpIndex) for lpIndex in range(lineupCount)]
|
| | | GameWorld.DebugLog("上阵中的武将无法遣散! itemIndex=%s,lineupValueList=%s" % (itemIndex, lineupValueList))
|
| | | continue
|
| | | heroID = heroItem.GetItemTypeID()
|
| | | heroIpyData = IpyGameDataPY.GetIpyGameData("Hero", heroID)
|
| | | if not heroIpyData:
|
| | | continue
|
| | | quality = heroIpyData.GetQuality()
|
| | | heroLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroLV)
|
| | | breakLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroBreakLV)
|
| | | heroStar = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroStar)
|
| | | qualityIpyData = IpyGameDataPY.GetIpyGameData("HeroQuality", quality)
|
| | | if not qualityIpyData:
|
| | | continue
|
| | | GameWorld.DebugLog("Dzɢ: itemIndex=%s,heroID=%s,quality=%s,heroLV=%s,breakLV=%s,heroStar=%s" % (itemIndex, heroID, quality, heroLV, breakLV, heroStar))
|
| | | dismissReturnItems = qualityIpyData.GetDismissReturnItems()
|
| | | for itemID, itemCount in dismissReturnItems:
|
| | | starRetCnt = (heroStar + 1) * itemCount
|
| | | returnItemDict[itemID] = returnItemDict.get(itemID, 0) + starRetCnt
|
| | | GameWorld.DebugLog(" 星级返还: quality=%s,heroStar=%s,%s,总%s" % (quality, heroStar, dismissReturnItems, returnItemDict))
|
| | | __calcHeroLVReturnitem(quality, heroLV, returnItemDict)
|
| | | __calcHeroBreakReturnitem(quality, breakLV, returnItemDict)
|
| | | dismissItemList.append([itemIndex, heroItem])
|
| | | |
| | | if not dismissItemList:
|
| | | return
|
| | | |
| | | for itemIndex, heroItem in dismissItemList:
|
| | | ItemCommon.DelItem(curPlayer, heroItem, heroItem.GetCount(), False, "HeroDismiss")
|
| | | |
| | | if returnItemDict:
|
| | | returnItemList = [[k, v] for k, v in returnItemDict.items()]
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, returnItemList, event=["HeroDismiss", False, {}])
|
| | | |
| | | return
|
| | |
|
| | | #// B4 12 战斗阵容保存 #tagCSHeroLineupSave
|
| | | #
|
| | | #struct tagCSHeroLineupPos
|
| | |
| | | clientPack.LineupCnt = len(clientPack.LineupList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def Sync_PlayerHeroInfo(curPlayer):
|
| | | ## 武将公共信息
|
| | | clientPack = ChPyNetSendPack.tagSCPlayerHeroInfo()
|
| | | clientPack.AwakeRebirthCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HeroAwakeRebirthCnt)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|