| | |
| | | DWORD _Rank; //排名
|
| | | dict Award; //奖励 {"职业":[[物品ID,个数,是否绑定],...], ...}
|
| | | }; |
| | |
|
| | | //幸运鉴宝活动时间表
|
| | |
|
| | | struct tagActLuckyTreasure
|
| | | {
|
| | | DWORD _CfgID; //配置ID
|
| | | char ActMark; //活动组标记
|
| | | list PlatformList; //活动平台列表["平台A", "平台A", ...],配[]代表所有
|
| | | list ServerIDList; //服务器ID列表
|
| | | char StartDate; //开启日期
|
| | | char EndDate; //结束日期
|
| | | BYTE ResetType; //重置类型,0-0点重置;1-5点重置
|
| | | dict NotifyInfoStart; //全服提示信息 - 相对开始时间
|
| | | dict NotifyInfoEnd; //全服提示信息 - 相对结束时间
|
| | | list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key]
|
| | | WORD LVLimit; //限制等级
|
| | | }; |
| | |
| | | list AttrIDList; //属性ID列表
|
| | | list AttrValueList; //属性值列表
|
| | | }; |
| | |
|
| | | //幸运鉴宝活动时间表
|
| | |
|
| | | struct tagActLuckyTreasure
|
| | | {
|
| | | DWORD _CfgID; //配置ID
|
| | | char StartDate; //开启日期
|
| | | char EndDate; //结束日期
|
| | | BYTE ResetType; //重置类型,0-0点重置;1-5点重置
|
| | | WORD LVLimit; //限制等级
|
| | | BYTE TemplateID; //模板编号
|
| | | WORD LuckyPoint; //总幸运值
|
| | | };
|
| | |
|
| | | //幸运鉴宝库模板表
|
| | |
|
| | | struct tagLuckyTreasureTemplate
|
| | | {
|
| | | BYTE _TemplateID; //模板ID
|
| | | list WorldLVLimit; //世界等级范围
|
| | | DWORD ItemID; //物品ID
|
| | | WORD ItemCnt; //物品数量
|
| | | BYTE IsBind; //是否绑定
|
| | | DWORD Weight; //权重
|
| | | }; |
| | |
| | | ShareDefine.Def_UniversalGameRecType_DujieHelpAllRecord:500, #渡劫副本护法总记录
|
| | | ShareDefine.Def_UniversalGameRecType_DujieHelpRecord:10000, #渡劫副本护法详细记录
|
| | | ShareDefine.Def_UniversalGameRecType_ZhuXianBossRecord:100, #诛仙BOSS结算记录
|
| | | ShareDefine.Def_UniversalGameRecType_LuckyTreasure:5, #幸运鉴宝记录
|
| | | }
|
| | | #---------------------------------------------------------------------
|
| | | #比较标识
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 08 开始幸运鉴宝 #tagCMStartLuckyTreasure
|
| | |
|
| | | class tagCMStartLuckyTreasure(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x08
|
| | | 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 = 0xAA
|
| | | self.SubCmd = 0x08
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMStartLuckyTreasure)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 08 开始幸运鉴宝 //tagCMStartLuckyTreasure:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMStartLuckyTreasure=tagCMStartLuckyTreasure()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMStartLuckyTreasure.Cmd,m_NAtagCMStartLuckyTreasure.SubCmd))] = m_NAtagCMStartLuckyTreasure
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AB 0B 购买天神经验 #tagCMBuySkyGodExp
|
| | |
|
| | | class tagCMBuySkyGodExp(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 1F 幸运鉴宝活动信息 #tagMCLuckyTreasureInfo
|
| | |
|
| | | class tagMCLuckyTreasureItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), # 物品数量
|
| | | ("IsBind", 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.ItemID = 0
|
| | | self.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCLuckyTreasureItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 1F 幸运鉴宝活动信息 //tagMCLuckyTreasureInfo:
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCLuckyTreasureInfo(Structure):
|
| | | Head = tagHead()
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置
|
| | | LimitLV = 0 #(WORD LimitLV)// 限制等级
|
| | | LuckyPoint = 0 #(WORD LuckyPoint)// 总幸运值
|
| | | Count = 0 #(WORD Count)// 物品数
|
| | | ItemList = list() #(vector<tagMCLuckyTreasureItem> ItemList)// 随机库物品信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1F
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.LuckyPoint,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temItemList = tagMCLuckyTreasureItem()
|
| | | _pos = temItemList.ReadData(_lpData, _pos)
|
| | | self.ItemList.append(temItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1F
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.ResetType = 0
|
| | | self.LimitLV = 0
|
| | | self.LuckyPoint = 0
|
| | | self.Count = 0
|
| | | self.ItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 10
|
| | | length += 10
|
| | | length += 1
|
| | | length += 2
|
| | | length += 2
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.ItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteString(data, 10, self.StartDate)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | data = CommFunc.WriteBYTE(data, self.ResetType)
|
| | | data = CommFunc.WriteWORD(data, self.LimitLV)
|
| | | data = CommFunc.WriteWORD(data, self.LuckyPoint)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.ItemList[i].GetLength(), self.ItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | ResetType:%d,
|
| | | LimitLV:%d,
|
| | | LuckyPoint:%d,
|
| | | Count:%d,
|
| | | ItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.ResetType,
|
| | | self.LimitLV,
|
| | | self.LuckyPoint,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCLuckyTreasureInfo=tagMCLuckyTreasureInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLuckyTreasureInfo.Head.Cmd,m_NAtagMCLuckyTreasureInfo.Head.SubCmd))] = m_NAtagMCLuckyTreasureInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 1E 幸运鉴宝结果信息 #tagMCLuckyTreasureResultInfo
|
| | |
|
| | | class tagMCLuckyTreasureResultInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("LuckyPoint", c_ushort), # 当前幸运点
|
| | | ("HasFree", c_ubyte), # 是否免费过
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), #物品数量
|
| | | ("IsBind", c_ubyte), # 是否绑定
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x1E
|
| | | 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 = 0xAA
|
| | | self.SubCmd = 0x1E
|
| | | self.LuckyPoint = 0
|
| | | self.HasFree = 0
|
| | | self.ItemID = 0
|
| | | self.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCLuckyTreasureResultInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 1E 幸运鉴宝结果信息 //tagMCLuckyTreasureResultInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | LuckyPoint:%d,
|
| | | HasFree:%d,
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.LuckyPoint,
|
| | | self.HasFree,
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCLuckyTreasureResultInfo=tagMCLuckyTreasureResultInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLuckyTreasureResultInfo.Cmd,m_NAtagMCLuckyTreasureResultInfo.SubCmd))] = m_NAtagMCLuckyTreasureResultInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 23 新仙界盛典全民来嗨玩家信息 #tagMCNewAllPeoplePartyInfo
|
| | |
|
| | | class tagMCNewAllPeoplePartyCount(Structure):
|
| | |
| | | import PlayerFamilyRedPacket
|
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import PlayerUniversalGameRec
|
| | | import GameWorldProcess
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | |
| | | ipyData = operationActionDict[ShareDefine.OperationActionName_FeastRedPacket][0]
|
| | | if ipyData:
|
| | | PlayerFamilyRedPacket.Sync_FeastRedPacket(ipyData, curPlayer)
|
| | | |
| | | # 幸运鉴宝活动进行中
|
| | | if ShareDefine.OperationActionName_LuckyTreasure in operationActionDict:
|
| | | PlayerUniversalGameRec.SendUniversalGameRecInfo(curPlayer, ShareDefine.Def_UniversalGameRecType_LuckyTreasure)
|
| | | return
|
| | |
|
| | | def SendMapServerOperationActionState():
|
| | |
| | | ("DWORD", "Rank", 1),
|
| | | ("dict", "Award", 0),
|
| | | ),
|
| | |
|
| | | "ActLuckyTreasure":(
|
| | | ("DWORD", "CfgID", 1),
|
| | | ("char", "ActMark", 0),
|
| | | ("list", "PlatformList", 0),
|
| | | ("list", "ServerIDList", 0),
|
| | | ("char", "StartDate", 0),
|
| | | ("char", "EndDate", 0),
|
| | | ("BYTE", "ResetType", 0),
|
| | | ("dict", "NotifyInfoStart", 0),
|
| | | ("dict", "NotifyInfoEnd", 0),
|
| | | ("list", "NotifyInfoLoop", 0),
|
| | | ("WORD", "LVLimit", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetRank(self): return self.Rank # 排名
|
| | | def GetAward(self): return self.Award # 奖励 {"职业":[[物品ID,个数,是否绑定],...], ...} |
| | |
|
| | | # 幸运鉴宝活动时间表 |
| | | class IPY_ActLuckyTreasure(): |
| | | |
| | | def __init__(self): |
| | | self.CfgID = 0
|
| | | self.ActMark = ""
|
| | | self.PlatformList = []
|
| | | self.ServerIDList = []
|
| | | self.StartDate = ""
|
| | | self.EndDate = ""
|
| | | self.ResetType = 0
|
| | | self.NotifyInfoStart = {}
|
| | | self.NotifyInfoEnd = {}
|
| | | self.NotifyInfoLoop = []
|
| | | self.LVLimit = 0 |
| | | return |
| | | |
| | | def GetCfgID(self): return self.CfgID # 配置ID
|
| | | def GetActMark(self): return self.ActMark # 活动组标记
|
| | | def GetPlatformList(self): return self.PlatformList # 活动平台列表["平台A", "平台A", ...],配[]代表所有
|
| | | def GetServerIDList(self): return self.ServerIDList # 服务器ID列表
|
| | | def GetStartDate(self): return self.StartDate # 开启日期
|
| | | def GetEndDate(self): return self.EndDate # 结束日期
|
| | | def GetResetType(self): return self.ResetType # 重置类型,0-0点重置;1-5点重置
|
| | | def GetNotifyInfoStart(self): return self.NotifyInfoStart # 全服提示信息 - 相对开始时间
|
| | | def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
|
| | | def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key]
|
| | | def GetLVLimit(self): return self.LVLimit # 限制等级 |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | | LogUI.Msg("%s\t%s\t%s" % (par, playerID, msg))
|
| | |
| | | self.ipyActNewFairyCeremonyLen = len(self.ipyActNewFairyCeremonyCache)
|
| | | self.ipyNewUniquenessArriveCache = self.__LoadFileData("NewUniquenessArrive", IPY_NewUniquenessArrive)
|
| | | self.ipyNewUniquenessArriveLen = len(self.ipyNewUniquenessArriveCache)
|
| | | self.ipyActLuckyTreasureCache = self.__LoadFileData("ActLuckyTreasure", IPY_ActLuckyTreasure)
|
| | | self.ipyActLuckyTreasureLen = len(self.ipyActLuckyTreasureCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetActNewFairyCeremonyByIndex(self, index): return self.ipyActNewFairyCeremonyCache[index]
|
| | | def GetNewUniquenessArriveCount(self): return self.ipyNewUniquenessArriveLen
|
| | | def GetNewUniquenessArriveByIndex(self, index): return self.ipyNewUniquenessArriveCache[index]
|
| | | def GetActLuckyTreasureCount(self): return self.ipyActLuckyTreasureLen
|
| | | def GetActLuckyTreasureByIndex(self, index): return self.ipyActLuckyTreasureCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | OperationActionName_FeastWeekParty = "ActFeastWeekParty" # 节日巡礼狂欢活动
|
| | | OperationActionName_FeastRedPacket = "ActFeastRedPacket" # 节日红包活动
|
| | | OperationActionName_FeastCollectWords = "ActFeastCollectWords" # 节日集字活动
|
| | | OperationActionName_LuckyTreasure = "ActLuckyTreasure" # 幸运鉴宝活动
|
| | | #节日活动类型列表 - 该类型无视开服天,日期到了就开启
|
| | | FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket, OperationActionName_FeastCollectWords]
|
| | | #所有的运营活动列表,含节日活动
|
| | |
| | | OperationActionName_RealmPoint, OperationActionName_FlashSale,
|
| | | OperationActionName_WishingWell, OperationActionName_TotalRecharge,
|
| | | OperationActionName_WeekParty, OperationActionName_LoginAward,
|
| | | OperationActionName_NewFairyCeremony, ] \
|
| | | OperationActionName_NewFairyCeremony, OperationActionName_LuckyTreasure] \
|
| | | + FeastOperationActionNameList
|
| | | #需要记录开启活动时的世界等级的运营活动
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell,
|
| | | OperationActionName_NewFairyCeremony, OperationActionName_FlashSale,
|
| | | OperationActionName_BossReborn, OperationActionName_TotalRecharge,
|
| | | OperationActionName_CostRebate, OperationActionName_FlashGiftbag,
|
| | | OperationActionName_SpringSale,]
|
| | | OperationActionName_SpringSale, OperationActionName_LuckyTreasure]
|
| | |
|
| | | #活动信息字典key定义
|
| | | ActKey_ID = "ID" # 活动ID,唯一标识的ID,一般是活动开启的time值
|
| | |
| | | Def_UniversalGameRecType_FBHelpBattleCheckInPlayer, #助战玩家登记记录9
|
| | | Def_UniversalGameRecType_FBHelpBattleRecord, #助战未同步记录10
|
| | | Def_UniversalGameRecType_ZhuXianBossRecord, #诛仙BOSS结算记录11
|
| | | Def_UniversalGameRecType_12,
|
| | | Def_UniversalGameRecType_LuckyTreasure, #幸运鉴宝大奖记录12
|
| | | Def_UniversalGameRecType_13,
|
| | | Def_UniversalGameRecType_Reward, # 通用奖励表(TopBar)14
|
| | | Def_UniversalGameRecType_15,
|
| | |
| | | PacketCMD_3=0xA5
|
| | | PacketSubCMD_3=0x1C
|
| | | PacketCallFunc_3=OnGatherSoulCompound |
| | |
|
| | | ;幸运鉴宝
|
| | | [PlayerLuckyTreasure]
|
| | | ScriptName = Player\PlayerLuckyTreasure.py
|
| | | Writer = xdh
|
| | | Releaser = xdh
|
| | | RegType = 0
|
| | | RegisterPackCount = 1
|
| | |
|
| | | PacketCMD_1=0xAA
|
| | | PacketSubCMD_1=0x08
|
| | | PacketCallFunc_1=OnStartLuckyTreasure |
| | |
| | |
|
| | | #诛仙BOSS
|
| | | Def_PDict_ZhuXianBossHelpCnt = "ZhuXianBossHelpCnt" # 协助次数
|
| | |
|
| | | #幸运鉴宝
|
| | | Def_PDict_LuckyTreasureID = "LuckyTreasureID" # 玩家身上的活动ID,唯一标识,取活动开始日期time值
|
| | | Def_PDict_LuckyTreasureFree = "LuckyTreasureFree" #是否免费过
|
| | | Def_PDict_LuckyTreasurePoint = "LuckyTreasurePoint" #幸运值
|
| | | #-------------------------------------------------------------------------------
|
| | | #类型 Def_PDictType_OnlinePrize
|
| | | Def_PDict1_OnlinePrizeCnt = "OnlinePrizeCnt" # 新手在线已领取奖励次数
|
| | |
| | | Def_Cost_FBHelpBattle, # 副本助战
|
| | | Def_Cost_FBGatherSoulBoss, # 聚魂副本BOSS召唤 40
|
| | | Def_Cost_CrossRealmPK, # 跨服PK
|
| | | Def_Cost_LuckyTreasure, #幸运鉴宝
|
| | | #-----------以下为暂时没用的,先不删除,如有新增消费点则放在这些之前------------
|
| | | Def_Cost_RefreshArrestTask, # 刷新悬赏任务
|
| | | Def_Cost_OffLineExp, # 兑换离线经验
|
| | |
| | | Def_Cost_Trade, # 交易
|
| | | Def_Cost_Rename, # 改名
|
| | | Def_Cost_SkillLvUp, # 技能升级
|
| | | ) = range(2000, 2000 + 57)
|
| | | ) = range(2000, 2000 + 58)
|
| | |
|
| | | Def_Cost_Reason_SonKey = "reason_name_son" # 消费点原因子类说明key
|
| | |
|
| | |
| | | Def_Cost_FBHelpBattle:"FBHelpBattle",
|
| | | Def_Cost_FBGatherSoulBoss:"FBGatherSoulBoss",
|
| | | Def_Cost_CrossRealmPK:"CrossRealmPK",
|
| | | Def_Cost_LuckyTreasure:"LuckyTreasure",
|
| | | }
|
| | | ## -----------------------------------------------------
|
| | |
|
| | |
| | | ItemGive_Refine, # 炼丹
|
| | | ItemGive_Chests, # 宝箱
|
| | | ItemGive_TrialExchange, # 宗门兑换
|
| | | ) = range(1000, 1000 + 20)
|
| | | ItemGive_LuckyTreasure, #幸运鉴宝
|
| | | ) = range(1000, 1000 + 21)
|
| | |
|
| | | # 物品获得类型对应信息 {类型:eventName, ...}
|
| | | ItemGiveTypeDict = {
|
| | |
| | | ItemGive_Refine:"Refine",
|
| | | ItemGive_Chests:"Chests",
|
| | | ItemGive_TrialExchange:"TrialExchange",
|
| | | ItemGive_LuckyTreasure:"LuckyTreasure",
|
| | | }
|
| | |
|
| | | ## 物品扣除类型定义,与获得类型不重复,类型定义为 2000 ~ 2999
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 08 开始幸运鉴宝 #tagCMStartLuckyTreasure
|
| | |
|
| | | class tagCMStartLuckyTreasure(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x08
|
| | | 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 = 0xAA
|
| | | self.SubCmd = 0x08
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMStartLuckyTreasure)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 08 开始幸运鉴宝 //tagCMStartLuckyTreasure:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMStartLuckyTreasure=tagCMStartLuckyTreasure()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMStartLuckyTreasure.Cmd,m_NAtagCMStartLuckyTreasure.SubCmd))] = m_NAtagCMStartLuckyTreasure
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AB 0B 购买天神经验 #tagCMBuySkyGodExp
|
| | |
|
| | | class tagCMBuySkyGodExp(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 1F 幸运鉴宝活动信息 #tagMCLuckyTreasureInfo
|
| | |
|
| | | class tagMCLuckyTreasureItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), # 物品数量
|
| | | ("IsBind", 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.ItemID = 0
|
| | | self.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCLuckyTreasureItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 1F 幸运鉴宝活动信息 //tagMCLuckyTreasureInfo:
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCLuckyTreasureInfo(Structure):
|
| | | Head = tagHead()
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置
|
| | | LimitLV = 0 #(WORD LimitLV)// 限制等级
|
| | | LuckyPoint = 0 #(WORD LuckyPoint)// 总幸运值
|
| | | Count = 0 #(WORD Count)// 物品数
|
| | | ItemList = list() #(vector<tagMCLuckyTreasureItem> ItemList)// 随机库物品信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1F
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.LuckyPoint,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temItemList = tagMCLuckyTreasureItem()
|
| | | _pos = temItemList.ReadData(_lpData, _pos)
|
| | | self.ItemList.append(temItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1F
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.ResetType = 0
|
| | | self.LimitLV = 0
|
| | | self.LuckyPoint = 0
|
| | | self.Count = 0
|
| | | self.ItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 10
|
| | | length += 10
|
| | | length += 1
|
| | | length += 2
|
| | | length += 2
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.ItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteString(data, 10, self.StartDate)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | data = CommFunc.WriteBYTE(data, self.ResetType)
|
| | | data = CommFunc.WriteWORD(data, self.LimitLV)
|
| | | data = CommFunc.WriteWORD(data, self.LuckyPoint)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.ItemList[i].GetLength(), self.ItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | ResetType:%d,
|
| | | LimitLV:%d,
|
| | | LuckyPoint:%d,
|
| | | Count:%d,
|
| | | ItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.ResetType,
|
| | | self.LimitLV,
|
| | | self.LuckyPoint,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCLuckyTreasureInfo=tagMCLuckyTreasureInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLuckyTreasureInfo.Head.Cmd,m_NAtagMCLuckyTreasureInfo.Head.SubCmd))] = m_NAtagMCLuckyTreasureInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 1E 幸运鉴宝结果信息 #tagMCLuckyTreasureResultInfo
|
| | |
|
| | | class tagMCLuckyTreasureResultInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("LuckyPoint", c_ushort), # 当前幸运点
|
| | | ("HasFree", c_ubyte), # 是否免费过
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), #物品数量
|
| | | ("IsBind", c_ubyte), # 是否绑定
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x1E
|
| | | 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 = 0xAA
|
| | | self.SubCmd = 0x1E
|
| | | self.LuckyPoint = 0
|
| | | self.HasFree = 0
|
| | | self.ItemID = 0
|
| | | self.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCLuckyTreasureResultInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 1E 幸运鉴宝结果信息 //tagMCLuckyTreasureResultInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | LuckyPoint:%d,
|
| | | HasFree:%d,
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.LuckyPoint,
|
| | | self.HasFree,
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCLuckyTreasureResultInfo=tagMCLuckyTreasureResultInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCLuckyTreasureResultInfo.Cmd,m_NAtagMCLuckyTreasureResultInfo.SubCmd))] = m_NAtagMCLuckyTreasureResultInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 23 新仙界盛典全民来嗨玩家信息 #tagMCNewAllPeoplePartyInfo
|
| | |
|
| | | class tagMCNewAllPeoplePartyCount(Structure):
|
| | |
| | | ("list", "AttrIDList", 0),
|
| | | ("list", "AttrValueList", 0),
|
| | | ),
|
| | |
|
| | | "ActLuckyTreasure":(
|
| | | ("DWORD", "CfgID", 1),
|
| | | ("char", "StartDate", 0),
|
| | | ("char", "EndDate", 0),
|
| | | ("BYTE", "ResetType", 0),
|
| | | ("WORD", "LVLimit", 0),
|
| | | ("BYTE", "TemplateID", 0),
|
| | | ("WORD", "LuckyPoint", 0),
|
| | | ),
|
| | |
|
| | | "LuckyTreasureTemplate":(
|
| | | ("BYTE", "TemplateID", 1),
|
| | | ("list", "WorldLVLimit", 0),
|
| | | ("DWORD", "ItemID", 0),
|
| | | ("WORD", "ItemCnt", 0),
|
| | | ("BYTE", "IsBind", 0),
|
| | | ("DWORD", "Weight", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetAttrIDList(self): return self.AttrIDList # 属性ID列表
|
| | | def GetAttrValueList(self): return self.AttrValueList # 属性值列表 |
| | |
|
| | | # 幸运鉴宝活动时间表 |
| | | class IPY_ActLuckyTreasure(): |
| | | |
| | | def __init__(self): |
| | | self.CfgID = 0
|
| | | self.StartDate = ""
|
| | | self.EndDate = ""
|
| | | self.ResetType = 0
|
| | | self.LVLimit = 0
|
| | | self.TemplateID = 0
|
| | | self.LuckyPoint = 0 |
| | | return |
| | | |
| | | def GetCfgID(self): return self.CfgID # 配置ID
|
| | | def GetStartDate(self): return self.StartDate # 开启日期
|
| | | def GetEndDate(self): return self.EndDate # 结束日期
|
| | | def GetResetType(self): return self.ResetType # 重置类型,0-0点重置;1-5点重置
|
| | | def GetLVLimit(self): return self.LVLimit # 限制等级
|
| | | def GetTemplateID(self): return self.TemplateID # 模板编号
|
| | | def GetLuckyPoint(self): return self.LuckyPoint # 总幸运值 |
| | | |
| | | # 幸运鉴宝库模板表 |
| | | class IPY_LuckyTreasureTemplate(): |
| | | |
| | | def __init__(self): |
| | | self.TemplateID = 0
|
| | | self.WorldLVLimit = []
|
| | | self.ItemID = 0
|
| | | self.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | self.Weight = 0 |
| | | return |
| | | |
| | | def GetTemplateID(self): return self.TemplateID # 模板ID
|
| | | def GetWorldLVLimit(self): return self.WorldLVLimit # 世界等级范围
|
| | | def GetItemID(self): return self.ItemID # 物品ID
|
| | | def GetItemCnt(self): return self.ItemCnt # 物品数量
|
| | | def GetIsBind(self): return self.IsBind # 是否绑定
|
| | | def GetWeight(self): return self.Weight # 权重 |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | | LogUI.Msg("%s\t%s\t%s" % (par, playerID, msg))
|
| | |
| | | self.ipyNewAllPeoplePartyAwardLen = len(self.ipyNewAllPeoplePartyAwardCache)
|
| | | self.ipyZhuXianStoneAttrCache = self.__LoadFileData("ZhuXianStoneAttr", IPY_ZhuXianStoneAttr)
|
| | | self.ipyZhuXianStoneAttrLen = len(self.ipyZhuXianStoneAttrCache)
|
| | | self.ipyActLuckyTreasureCache = self.__LoadFileData("ActLuckyTreasure", IPY_ActLuckyTreasure)
|
| | | self.ipyActLuckyTreasureLen = len(self.ipyActLuckyTreasureCache)
|
| | | self.ipyLuckyTreasureTemplateCache = self.__LoadFileData("LuckyTreasureTemplate", IPY_LuckyTreasureTemplate)
|
| | | self.ipyLuckyTreasureTemplateLen = len(self.ipyLuckyTreasureTemplateCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetNewAllPeoplePartyAwardByIndex(self, index): return self.ipyNewAllPeoplePartyAwardCache[index]
|
| | | def GetZhuXianStoneAttrCount(self): return self.ipyZhuXianStoneAttrLen
|
| | | def GetZhuXianStoneAttrByIndex(self, index): return self.ipyZhuXianStoneAttrCache[index]
|
| | | def GetActLuckyTreasureCount(self): return self.ipyActLuckyTreasureLen
|
| | | def GetActLuckyTreasureByIndex(self, index): return self.ipyActLuckyTreasureCache[index]
|
| | | def GetLuckyTreasureTemplateCount(self): return self.ipyLuckyTreasureTemplateLen
|
| | | def GetLuckyTreasureTemplateByIndex(self, index): return self.ipyLuckyTreasureTemplateCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import PlayerFeastRedPacket
|
| | | import PlayerLuckyTreasure
|
| | | import CrossRealmPlayer
|
| | | import ChNetSendPack
|
| | | import FamilyRobBoss
|
| | |
| | | PlayerBindJadeWheel.OnLogin(curPlayer)
|
| | | # 许愿池
|
| | | PlayerWishingWell.OnLogin(curPlayer)
|
| | | #幸运鉴宝
|
| | | PlayerLuckyTreasure.OnLogin(curPlayer)
|
| | | # 上线查询一次充值订单
|
| | | curPlayer.SendDBQueryRecharge()
|
| | | # 小助手
|
| | |
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import PlayerFeastRedPacket
|
| | | import PlayerLuckyTreasure
|
| | | import PlayerRefineStove
|
| | | import PlayerFlashSale
|
| | | import PlayerWishingWell
|
| | |
| | | elif actionName == ShareDefine.OperationActionName_FeastRedPacket:
|
| | | PlayerFeastRedPacket.RefreshOperationAction_FeastRedPacket()
|
| | |
|
| | | elif actionName == ShareDefine.OperationActionName_LuckyTreasure:
|
| | | PlayerLuckyTreasure.RefreshLuckyTreasureAction()
|
| | | return
|
| | |
|
| | | if key == ShareDefine.Def_Notify_WorldKey_CrossZoneName:
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.PlayerLuckyTreasure
|
| | | #
|
| | | # @todo:幸运鉴宝
|
| | | # @author xdh
|
| | | # @date 2019-2-12 19:50
|
| | | # @version 1.0
|
| | | #
|
| | | #
|
| | | # 详细描述: 幸运鉴宝
|
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | """Version = 2019-2-12 19:50"""
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import IPY_GameWorld
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import ItemControler
|
| | | import ItemCommon
|
| | |
|
| | |
|
| | |
|
| | | def OnLogin(curPlayer):
|
| | | isReset = __CheckPlayerLuckyTreasureAction(curPlayer)
|
| | | if not isReset:
|
| | | actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_LuckyTreasure, {})
|
| | | # 活动中同步活动信息
|
| | | if actCostRebateInfo.get(ShareDefine.ActKey_State):
|
| | | SyncLuckyTreasureInfo(curPlayer)
|
| | | SyncLuckyTreasureResultInfo(curPlayer)
|
| | | |
| | | return
|
| | |
|
| | | def RefreshLuckyTreasureAction():
|
| | | __InitLuckyTreasureRateList()
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(i)
|
| | | if curPlayer == None or not curPlayer.GetInitOK():
|
| | | continue
|
| | | __CheckPlayerLuckyTreasureAction(curPlayer)
|
| | | return
|
| | |
|
| | | def __CheckPlayerLuckyTreasureAction(curPlayer):
|
| | | ## 检查玩家幸运鉴宝活动数据信息
|
| | | global g_randomWellDict
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | actLuckyTreasureInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_LuckyTreasure, {})
|
| | | LuckyTreasureID = actLuckyTreasureInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actLuckyTreasureInfo.get(ShareDefine.ActKey_State, 0)
|
| | | #cfgID = actLuckyTreasureInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | worldLV = actLuckyTreasureInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | playerLuckyTreasureID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LuckyTreasureID) # 玩家身上的活动ID
|
| | | |
| | | # 活动ID 相同的话不处理
|
| | | if LuckyTreasureID == playerLuckyTreasureID:
|
| | | #GameWorld.DebugLog("幸运鉴宝活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | return
|
| | | msgStr = str([ShareDefine.Def_UniversalGameRecType_LuckyTreasure, 2])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'DelUniversalGameRec', msgStr, len(msgStr))
|
| | | GameWorld.DebugLog("幸运鉴宝重置! LuckyTreasureID=%s,playerLuckyTreasureID=%s,state=%s,worldLv=%s" |
| | | % (LuckyTreasureID, playerLuckyTreasureID, state, worldLV), playerID)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasureID, LuckyTreasureID)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasureFree, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasurePoint, 0)
|
| | | |
| | | SyncLuckyTreasureInfo(curPlayer)
|
| | | SyncLuckyTreasureResultInfo(curPlayer)
|
| | | return True
|
| | |
|
| | | def __InitLuckyTreasureRateList():
|
| | | global g_itemRateList
|
| | | actLuckyTreasureInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_LuckyTreasure, {})
|
| | | state = actLuckyTreasureInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actLuckyTreasureInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | worldLV = actLuckyTreasureInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | if not cfgID or not worldLV or not state:
|
| | | return
|
| | | actIpyData = IpyGameDataPY.GetIpyGameData("ActLuckyTreasure", cfgID)
|
| | | if not actIpyData:
|
| | | return
|
| | | templateID = actIpyData.GetTemplateID()
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList('LuckyTreasureTemplate', templateID)
|
| | | if not ipyDataList:
|
| | | return
|
| | | tWeight = 0
|
| | | g_itemRateList = []
|
| | | for ipyData in ipyDataList:
|
| | | worldLVLimit = ipyData.GetWorldLVLimit()
|
| | | if worldLV < worldLVLimit[0] or worldLV > worldLVLimit[1]:
|
| | | continue
|
| | | itemID = ipyData.GetItemID()
|
| | | itemCnt = ipyData.GetItemCnt()
|
| | | isBind = ipyData.GetIsBind()
|
| | | weight = ipyData.GetWeight()
|
| | | tWeight += weight
|
| | | g_itemRateList.append([tWeight, [itemID, itemCnt, isBind]])
|
| | | return
|
| | |
|
| | | def __GetRandomRateList():
|
| | | if not g_itemRateList:
|
| | | __InitLuckyTreasureRateList()
|
| | | return g_itemRateList
|
| | |
|
| | |
|
| | | #// AA 08 开始幸运鉴宝 #tagCMStartLuckyTreasure
|
| | | #struct tagCMStartLuckyTreasure
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnStartLuckyTreasure(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_LuckyTreasure, {})
|
| | | state = actBossRebornInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | if not state or not cfgID:
|
| | | return
|
| | | actIpyData = IpyGameDataPY.GetIpyGameData("ActLuckyTreasure", cfgID)
|
| | | if not actIpyData:
|
| | | return
|
| | | |
| | | hasFree = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LuckyTreasureFree)
|
| | | if hasFree:
|
| | | costMoney = IpyGameDataPY.GetFuncCfg('LuckyAppraisal')
|
| | | if not PlayerControl.HaveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney):
|
| | | return
|
| | | # 检查背包
|
| | | needSpace = 1
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
|
| | | if needSpace > packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | | |
| | | randomRateList = __GetRandomRateList()
|
| | | if not randomRateList:
|
| | | return
|
| | | greatItem = randomRateList[-1][1]
|
| | | |
| | | curLuckyPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LuckyTreasurePoint)
|
| | | maxLuckyPoint = actIpyData.GetLuckyPoint()
|
| | | singlePoint = IpyGameDataPY.GetFuncCfg('LuckyAppraisal', 2)
|
| | | if curLuckyPoint + singlePoint >= maxLuckyPoint:
|
| | | giveItem = greatItem
|
| | | newLuckyPoint = 0
|
| | | else:
|
| | | randomResultList = GameWorld.GetResultByRandomListEx(randomRateList, 1, [])
|
| | | if len(randomResultList) != 1:
|
| | | GameWorld.DebugLog(' 开始幸运鉴宝 随机库结果 获取错误 !')
|
| | | return
|
| | | giveItem = randomResultList[0]
|
| | | if giveItem == greatItem:
|
| | | newLuckyPoint = 0
|
| | | playerName = curPlayer.GetName()
|
| | | PlayerControl.WorldNotify(0, 'LuckyAppraisal_1', [playerName, greatItem[0]])
|
| | | msgStr = str([ShareDefine.Def_UniversalGameRecType_LuckyTreasure, [], [curPlayer.GetName()], 2, 0])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'AddUniversalGameRec', msgStr, len(msgStr))
|
| | |
|
| | | else:
|
| | | newLuckyPoint = curLuckyPoint + singlePoint
|
| | | if hasFree:
|
| | | PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney, ChConfig.Def_Cost_LuckyTreasure)
|
| | | else:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasureFree, 1)
|
| | | #更新幸运值
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasurePoint, newLuckyPoint)
|
| | | |
| | | for itemID, itemCount, isBind in [giveItem]:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem], event=[ChConfig.ItemGive_LuckyTreasure, False, {"isFree":not hasFree}])
|
| | | |
| | | SyncLuckyTreasureResultInfo(curPlayer, giveItem)
|
| | | return
|
| | |
|
| | |
|
| | | def SyncLuckyTreasureInfo(curPlayer):
|
| | | ##同步幸运鉴宝活动信息
|
| | | actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_LuckyTreasure, {})
|
| | | state = actBossRebornInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | if not state or not cfgID:
|
| | | return
|
| | | actIpyData = IpyGameDataPY.GetIpyGameData("ActLuckyTreasure", cfgID)
|
| | | if not actIpyData:
|
| | | return
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | actInfo = ChPyNetSendPack.tagMCLuckyTreasureInfo()
|
| | | actInfo.Clear()
|
| | | actInfo.StartDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
|
| | | actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actIpyData.GetEndDate(), openServerDay)
|
| | | actInfo.ResetType = actIpyData.GetResetType()
|
| | | actInfo.LimitLV = actIpyData.GetLVLimit()
|
| | | actInfo.LuckyPoint = actIpyData.GetLuckyPoint()
|
| | | actInfo.ItemList = []
|
| | | randomItemList = __GetRandomRateList()
|
| | | for itemInfo in randomItemList:
|
| | | itemID, itemCnt, isBind = itemInfo[1]
|
| | | wellItemInfo = ChPyNetSendPack.tagMCLuckyTreasureItem()
|
| | | wellItemInfo.ItemID = itemID
|
| | | wellItemInfo.ItemCnt = itemCnt
|
| | | wellItemInfo.IsBind = isBind
|
| | | actInfo.ItemList.append(wellItemInfo)
|
| | | actInfo.Count = len(actInfo.ItemList)
|
| | | NetPackCommon.SendFakePack(curPlayer, actInfo)
|
| | | return
|
| | |
|
| | |
|
| | | def SyncLuckyTreasureResultInfo(curPlayer, itemInfo=[]):
|
| | | ##同步幸运鉴宝玩家信息
|
| | | packInfo = ChPyNetSendPack.tagMCLuckyTreasureResultInfo()
|
| | | packInfo.Clear()
|
| | | packInfo.LuckyPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LuckyTreasurePoint)
|
| | | packInfo.HasFree = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LuckyTreasureFree)
|
| | | if itemInfo:
|
| | | packInfo.ItemID = itemInfo[0]
|
| | | packInfo.ItemCnt = itemInfo[1]
|
| | | packInfo.IsBind = itemInfo[2]
|
| | | NetPackCommon.SendFakePack(curPlayer, packInfo)
|
| | | return
|
| | |
| | | OperationActionName_FeastWeekParty = "ActFeastWeekParty" # 节日巡礼狂欢活动
|
| | | OperationActionName_FeastRedPacket = "ActFeastRedPacket" # 节日红包活动
|
| | | OperationActionName_FeastCollectWords = "ActFeastCollectWords" # 节日集字活动
|
| | | OperationActionName_LuckyTreasure = "ActLuckyTreasure" # 幸运鉴宝活动
|
| | | #节日活动类型列表 - 该类型无视开服天,日期到了就开启
|
| | | FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket, OperationActionName_FeastCollectWords]
|
| | | #所有的运营活动列表,含节日活动
|
| | |
| | | OperationActionName_RealmPoint, OperationActionName_FlashSale,
|
| | | OperationActionName_WishingWell, OperationActionName_TotalRecharge,
|
| | | OperationActionName_WeekParty, OperationActionName_LoginAward,
|
| | | OperationActionName_NewFairyCeremony, ] \
|
| | | OperationActionName_NewFairyCeremony, OperationActionName_LuckyTreasure] \
|
| | | + FeastOperationActionNameList
|
| | | #需要记录开启活动时的世界等级的运营活动
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell,
|
| | | OperationActionName_NewFairyCeremony, OperationActionName_FlashSale,
|
| | | OperationActionName_BossReborn, OperationActionName_TotalRecharge,
|
| | | OperationActionName_CostRebate, OperationActionName_FlashGiftbag,
|
| | | OperationActionName_SpringSale,]
|
| | | OperationActionName_SpringSale, OperationActionName_LuckyTreasure]
|
| | |
|
| | | #活动信息字典key定义
|
| | | ActKey_ID = "ID" # 活动ID,唯一标识的ID,一般是活动开启的time值
|
| | |
| | | Def_UniversalGameRecType_FBHelpBattleCheckInPlayer, #助战玩家登记记录9
|
| | | Def_UniversalGameRecType_FBHelpBattleRecord, #助战未同步记录10
|
| | | Def_UniversalGameRecType_ZhuXianBossRecord, #诛仙BOSS结算记录11
|
| | | Def_UniversalGameRecType_12,
|
| | | Def_UniversalGameRecType_LuckyTreasure, #幸运鉴宝大奖记录12
|
| | | Def_UniversalGameRecType_13,
|
| | | Def_UniversalGameRecType_Reward, # 通用奖励表(TopBar)14
|
| | | Def_UniversalGameRecType_15,
|