| | |
| | | PacketSubCMD_1=0x16
|
| | | PacketCallFunc_1=OnZhenbaogeOP
|
| | |
|
| | | ;公会讨伐
|
| | | [PlayerFamilyTaofa]
|
| | | ScriptName = Player\PlayerFamilyTaofa.py
|
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 1
|
| | |
|
| | | PacketCMD_1=0xA6
|
| | | PacketSubCMD_1=0x13
|
| | | PacketCallFunc_1=OnFamilyTaofaOP
|
| | |
|
| | | ;宠物
|
| | | [PlayerPet]
|
| | | ScriptName = Player\PlayerPet.py
|
| | |
| | | Def_Effect_RecycleItemMoney = 277 #回收物品转化为货币; A值-直接给货币物品ID;B值-货币数量
|
| | | Def_Effect_FamilyEmblem = 278 #激活仙盟徽章; A值-徽章ID;
|
| | | Def_Effect_HeroSkin = 279 #激活武将皮肤; A值-武将ID;B值-皮肤索引
|
| | | Def_Effect_FamilyTaofaCnt = 280 #增加公会讨伐次数; A值-讨伐次数
|
| | | #----以下未使用或代码依然存在的---
|
| | | Def_Effect_ItemGiveGongXun = 1920 #使用道具给予功勋
|
| | | Def_Effect_ItemGiveRuneJH = 1925 #使用道具给予符印精华
|
| | |
| | | Def_Player_Dict_TrialTower_PassLV = "TrialTower_PassLV" # 试炼之塔通关层数
|
| | | Def_Player_Dict_TrialTower_LastDayPassLV = "Tower_LastDayPassLV" # 试炼之塔昨日通关层数
|
| | |
|
| | | #仙盟打坐
|
| | | Def_Player_Dict_FamilySitExpRound = "FamilySitExpRound" # 已给经验轮次
|
| | | Def_Player_Dict_FamilySitTotalExp = "FamilySitTotalExp" # 获得的总经验
|
| | | Def_Player_Dict_FamilySitTotalExpPoint = "FamilySitTotalExpPoint" # 获得的总经验点
|
| | | #公会讨伐
|
| | | Def_Player_Dict_FamilyTaofaCnt = "FamilyTaofaCnt" # 已讨伐次数
|
| | | Def_Player_Dict_FamilyTaofaItemAddCnt = "FamilyTaofaItemAddCnt" # 道具增加讨伐次数
|
| | | Def_Player_Dict_FamilyTaofaBuZhenState = "FamilyTaofaBuZhenState" # 是否已布阵
|
| | | Def_Player_Dict_FamilyTaofaAnger = "FamilyTaofaAnger" # 当前怒气
|
| | | Def_Player_Dict_FamilyTaofaBoxTotalGetCnt = "FamilyTaofaBoxTotalGetCnt" # 累计已领取宝箱奖励数
|
| | | Def_Player_Dict_FamilyTaofaBoxUnGetCnt = "FamilyTaofaBoxUnGetCnt" # 当前未领取的宝箱奖励数
|
| | | Def_Player_Dict_FamilyTaofaBoxLastTime = "FamilyTaofaBoxLastTime" # 上一次统计未领取宝箱时间戳,超过该时间戳的宝箱才可以再增加未领取
|
| | | Def_Player_Dict_FamilyTaofaBoxContribCnt = "FamilyTaofaBoxContribCnt" # 累计贡献的宝箱奖励数
|
| | | Def_Player_Dict_FamilyTaofaBoxHurt = "FamilyTaofaBoxHurt" # 宝箱奖励计算累计伤害,求余亿部分
|
| | | Def_Player_Dict_FamilyTaofaBoxHurtEx = "FamilyTaofaBoxHurtEx" # 宝箱奖励计算累计伤害,整除亿部分
|
| | | Def_Player_Dict_FamilyTaofaBoxHurtHis = "FamilyTaofaBoxHurtHis" # 历史最高累计伤害,求余亿部分
|
| | | Def_Player_Dict_FamilyTaofaBoxHurtHisEx = "FamilyTaofaBoxHurtHisEx" # 历史最高累计伤害,整除亿部分
|
| | |
|
| | | #虚拟背包物品数据
|
| | | Def_PDict_VPackItem = "VPackItem_%s_%s" # 虚拟背包物品数据, 参数(背包类型, 位置索引)
|
| | |
|
| | | #物品个数
|
| | | Def_PDict_ItemCount = "ItemCount_%s" # 存储不放在背包的物品个数, 参数(物品ID)
|
| | |
|
| | | #一次性最大充值
|
| | | Def_Player_RechargeOnce_Coin = "RechargeOnce_Coin"
|
| | |
|
| | | #悬赏任务
|
| | | Def_Player_Dict_ArrestTaskStar = "ArrestTaskStar" # 悬赏任务星级
|
| | | Def_Player_Dict_ArrestTaskData = "ArrestTaskData_%s" # 悬赏任务数据,参数索引
|
| | | Def_Player_Dict_ArrestTaskAwardRecord = "ArrestTaskAwardRecord" # 悬赏任务积分奖励领取记录
|
| | | Def_Player_Dict_ArrestTaskFinishCnt = "ArrestTaskFinishCnt" # 悬赏任务今日完成个数
|
| | |
|
| | | #封魔坛
|
| | | Def_Player_Dict_FMTDouble = "FMTDouble" # 封魔坛是否双倍
|
| | | Def_Player_Dict_FMTOldDouble = "FMTOldDouble" # 封魔坛是否曾经可以双倍
|
| | |
|
| | | #极品白拿
|
| | | Def_PDict_FreeGoodsOpenTime = "FreeGoodsOpenTime" #极品白拿开启时间
|
| | |
| | | Def_RewardType_Activity, # 活跃度奖励 0
|
| | | Def_RewardType_DailyTask, # 每日任务奖励 1
|
| | | Def_RewardType_LLMJLVUp, # 历练秘笈升级 2
|
| | | Def_RewardType_XMZZWinCnt, # 仙魔之争胜利场数奖励 3
|
| | | Def_RewardType_FamilyTaofaBox, # 公会讨伐领取宝箱奖励 3
|
| | | Def_RewardType_FamilyDayAward, # 仙盟每日福利奖励 4
|
| | | Def_RewardType_LVAward, # 玩家等级奖励5
|
| | | Def_RewardType_XBXZ, # 仙宝寻主奖励6
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 15 传功操作 #tagCMChuangongOP
|
| | |
|
| | | class tagCMChuangongOP(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("OPType", c_ubyte), # 操作类型:1-邀请;2-回应;3-领奖;
|
| | | ("PlayerID", c_int), # 目标玩家ID;回应时为邀请方玩家ID
|
| | | ("OPData", c_ubyte), # 操作数据,可选:回应时为是否同意
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA6
|
| | | 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 = 0xA6
|
| | | self.SubCmd = 0x15
|
| | | self.OPType = 0
|
| | | self.PlayerID = 0
|
| | | self.OPData = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMChuangongOP)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A6 15 传功操作 //tagCMChuangongOP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | OPType:%d,
|
| | | PlayerID:%d,
|
| | | OPData:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.OPType,
|
| | | self.PlayerID,
|
| | | self.OPData
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMChuangongOP=tagCMChuangongOP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMChuangongOP.Cmd,m_NAtagCMChuangongOP.SubCmd))] = m_NAtagCMChuangongOP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 11 家族改名 #tagCMRenameFamily
|
| | |
|
| | | class tagCMRenameFamily(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 13 公会讨伐 #tagCSFamilyTaofaOP
|
| | |
|
| | | class tagCSFamilyTaofaOP(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("OpType", c_ubyte), # 操作:0-斩杀攻击;1-布阵
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA6
|
| | | self.SubCmd = 0x13
|
| | | 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 = 0xA6
|
| | | self.SubCmd = 0x13
|
| | | self.OpType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCSFamilyTaofaOP)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A6 13 公会讨伐 //tagCSFamilyTaofaOP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | OpType:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.OpType
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCSFamilyTaofaOP=tagCSFamilyTaofaOP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSFamilyTaofaOP.Cmd,m_NAtagCSFamilyTaofaOP.SubCmd))] = m_NAtagCSFamilyTaofaOP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 26 请求家族成员列表 #tagCMGetFamilyInfo
|
| | |
|
| | | class tagCMGetFamilyInfo(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 35 王者仙盟每日俸禄奖励状态 #tagMCChampionFamilyDailyReward
|
| | |
|
| | | class tagMCChampionFamilyDailyReward(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("GetState", c_ubyte), #是否已领取
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x35
|
| | | 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 = 0xA5
|
| | | self.SubCmd = 0x35
|
| | | self.GetState = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCChampionFamilyDailyReward)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 35 王者仙盟每日俸禄奖励状态 //tagMCChampionFamilyDailyReward:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | GetState:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.GetState
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCChampionFamilyDailyReward=tagMCChampionFamilyDailyReward()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCChampionFamilyDailyReward.Cmd,m_NAtagMCChampionFamilyDailyReward.SubCmd))] = m_NAtagMCChampionFamilyDailyReward
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 10 传功奖励结果 #tagMCChuangongResult
|
| | |
|
| | | class tagMCChuangongItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), |
| | | ("ItemCount", c_ushort), |
| | | ]
|
| | |
|
| | | 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.ItemCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCChuangongItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 10 传功奖励结果 //tagMCChuangongResult:
|
| | | ItemID:%d,
|
| | | ItemCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCChuangongResult(Structure):
|
| | | Head = tagHead()
|
| | | FromLV = 0 #(WORD FromLV)// 传功前等级
|
| | | ToLV = 0 #(WORD ToLV)// 传功后等级
|
| | | Exp = 0 #(DWORD Exp)// 获得经验求余亿部分
|
| | | ExpPoint = 0 #(DWORD ExpPoint)// 获得经验整除亿部分
|
| | | ItemCount = 0 #(BYTE ItemCount)
|
| | | AwardItemList = list() #(vector<tagMCChuangongItem> AwardItemList)// 奖励物品列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x10
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.FromLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.ToLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.Exp,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.ExpPoint,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.ItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.ItemCount):
|
| | | temAwardItemList = tagMCChuangongItem()
|
| | | _pos = temAwardItemList.ReadData(_lpData, _pos)
|
| | | self.AwardItemList.append(temAwardItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x10
|
| | | self.FromLV = 0
|
| | | self.ToLV = 0
|
| | | self.Exp = 0
|
| | | self.ExpPoint = 0
|
| | | self.ItemCount = 0
|
| | | self.AwardItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | length += 2
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.ItemCount):
|
| | | length += self.AwardItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.FromLV)
|
| | | data = CommFunc.WriteWORD(data, self.ToLV)
|
| | | data = CommFunc.WriteDWORD(data, self.Exp)
|
| | | data = CommFunc.WriteDWORD(data, self.ExpPoint)
|
| | | data = CommFunc.WriteBYTE(data, self.ItemCount)
|
| | | for i in range(self.ItemCount):
|
| | | data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | FromLV:%d,
|
| | | ToLV:%d,
|
| | | Exp:%d,
|
| | | ExpPoint:%d,
|
| | | ItemCount:%d,
|
| | | AwardItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.FromLV,
|
| | | self.ToLV,
|
| | | self.Exp,
|
| | | self.ExpPoint,
|
| | | self.ItemCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCChuangongResult=tagMCChuangongResult()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCChuangongResult.Head.Cmd,m_NAtagMCChuangongResult.Head.SubCmd))] = m_NAtagMCChuangongResult
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 02 捐献次数信息 #tagSCDonateCntInfo
|
| | |
|
| | | class tagSCDonateCntInfo(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 07 家族boss副本玩家信息 #tagMCFamilyBosFBPlayerInfo
|
| | |
|
| | | class tagMCFamilyBosFBPlayerInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("HurtTotal", c_int), # 累计伤血,亿求余部分
|
| | | ("HurtTotalPoint", c_int), # 累计伤血,亿整除部分
|
| | | ("FightSeconds", c_int), # 已累计战斗时长,秒
|
| | | ("HurtAwardState", c_int), # 个人总伤血领奖记录,按奖励位二进制位运算表示是否已领取
|
| | | ("HurtAwardStateFamily", c_int), # 仙盟总伤血领奖记录,按奖励位二进制位运算表示是否已领取
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x07
|
| | | 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 = 0xA5
|
| | | self.SubCmd = 0x07
|
| | | self.HurtTotal = 0
|
| | | self.HurtTotalPoint = 0
|
| | | self.FightSeconds = 0
|
| | | self.HurtAwardState = 0
|
| | | self.HurtAwardStateFamily = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFamilyBosFBPlayerInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 07 家族boss副本玩家信息 //tagMCFamilyBosFBPlayerInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | HurtTotal:%d,
|
| | | HurtTotalPoint:%d,
|
| | | FightSeconds:%d,
|
| | | HurtAwardState:%d,
|
| | | HurtAwardStateFamily:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.HurtTotal,
|
| | | self.HurtTotalPoint,
|
| | | self.FightSeconds,
|
| | | self.HurtAwardState,
|
| | | self.HurtAwardStateFamily
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFamilyBosFBPlayerInfo=tagMCFamilyBosFBPlayerInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyBosFBPlayerInfo.Cmd,m_NAtagMCFamilyBosFBPlayerInfo.SubCmd))] = m_NAtagMCFamilyBosFBPlayerInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 21 家族变更 #tagMCFamilyChange
|
| | |
|
| | | class tagMCFamilyChange(Structure):
|
| | |
| | |
|
| | | m_NAtagMCFamilyChange=tagMCFamilyChange()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyChange.Cmd,m_NAtagMCFamilyChange.SubCmd))] = m_NAtagMCFamilyChange
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 06 仙盟每日福利领取状态 #tagMCFamilyDayAward
|
| | |
|
| | | class tagMCFamilyDayAward(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("GetState", c_ubyte), #是否已领取
|
| | | ("MoneyDonateCount", c_ubyte), #今日货币捐献次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x06
|
| | | 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 = 0xA5
|
| | | self.SubCmd = 0x06
|
| | | self.GetState = 0
|
| | | self.MoneyDonateCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFamilyDayAward)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 06 仙盟每日福利领取状态 //tagMCFamilyDayAward:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | GetState:%d,
|
| | | MoneyDonateCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.GetState,
|
| | | self.MoneyDonateCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFamilyDayAward=tagMCFamilyDayAward()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyDayAward.Cmd,m_NAtagMCFamilyDayAward.SubCmd))] = m_NAtagMCFamilyDayAward
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 03 当日祈福信息 #tagMCFamilyPrayInfo
|
| | |
|
| | | class tagMCFamilyPrayInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("PrayCntInfo", c_int), # 当日祈福次数信息, 按位存储祈福类型对应次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x03
|
| | | 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 = 0xA5
|
| | | self.SubCmd = 0x03
|
| | | self.PrayCntInfo = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFamilyPrayInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 03 当日祈福信息 //tagMCFamilyPrayInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | PrayCntInfo:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.PrayCntInfo
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFamilyPrayInfo=tagMCFamilyPrayInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyPrayInfo.Cmd,m_NAtagMCFamilyPrayInfo.SubCmd))] = m_NAtagMCFamilyPrayInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 11 打坐信息 #tagMCFamilySitInfo
|
| | | # A5 04 公会讨伐攻击结果 #tagSCFamilyTaofaAtkRet
|
| | |
|
| | | class tagMCFamilySitInfo(Structure):
|
| | | class tagSCFamilyTaofaAtkItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), |
| | | ("Count", c_int), |
| | | ]
|
| | |
|
| | | 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.Count = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagSCFamilyTaofaAtkItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 04 公会讨伐攻击结果 //tagSCFamilyTaofaAtkRet:
|
| | | ItemID:%d,
|
| | | Count:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.Count
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagSCFamilyTaofaAtkHurt(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("IsSuper", c_ubyte), # 是否暴击
|
| | | ("HurtValue", c_int), # 本次伤害,求余亿部分
|
| | | ("HurtValueEx", c_int), # 本次伤害,整除亿部分
|
| | | ]
|
| | |
|
| | | 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.IsSuper = 0
|
| | | self.HurtValue = 0
|
| | | self.HurtValueEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagSCFamilyTaofaAtkHurt)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 04 公会讨伐攻击结果 //tagSCFamilyTaofaAtkRet:
|
| | | IsSuper:%d,
|
| | | HurtValue:%d,
|
| | | HurtValueEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.IsSuper,
|
| | | self.HurtValue,
|
| | | self.HurtValueEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagSCFamilyTaofaAtkRet(Structure):
|
| | | Head = tagHead()
|
| | | AtkType = 0 #(BYTE AtkType)// 攻击类型:0-常规;1-怒气攻击
|
| | | HurtCount = 0 #(BYTE HurtCount)
|
| | | HurtList = list() #(vector<tagSCFamilyTaofaAtkHurt> HurtList)// 伤害次数列表,如怒气攻击有多次伤害
|
| | | ItemCount = 0 #(BYTE ItemCount)
|
| | | ItemList = list() #(vector<tagSCFamilyTaofaAtkItem> ItemList)// 奖励物品列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x04
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.AtkType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.HurtCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.HurtCount):
|
| | | temHurtList = tagSCFamilyTaofaAtkHurt()
|
| | | _pos = temHurtList.ReadData(_lpData, _pos)
|
| | | self.HurtList.append(temHurtList)
|
| | | self.ItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.ItemCount):
|
| | | temItemList = tagSCFamilyTaofaAtkItem()
|
| | | _pos = temItemList.ReadData(_lpData, _pos)
|
| | | self.ItemList.append(temItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x04
|
| | | self.AtkType = 0
|
| | | self.HurtCount = 0
|
| | | self.HurtList = list()
|
| | | self.ItemCount = 0
|
| | | self.ItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.HurtCount):
|
| | | length += self.HurtList[i].GetLength()
|
| | | length += 1
|
| | | for i in range(self.ItemCount):
|
| | | length += self.ItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.AtkType)
|
| | | data = CommFunc.WriteBYTE(data, self.HurtCount)
|
| | | for i in range(self.HurtCount):
|
| | | data = CommFunc.WriteString(data, self.HurtList[i].GetLength(), self.HurtList[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.ItemCount)
|
| | | for i in range(self.ItemCount):
|
| | | data = CommFunc.WriteString(data, self.ItemList[i].GetLength(), self.ItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | AtkType:%d,
|
| | | HurtCount:%d,
|
| | | HurtList:%s,
|
| | | ItemCount:%d,
|
| | | ItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.AtkType,
|
| | | self.HurtCount,
|
| | | "...",
|
| | | self.ItemCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagSCFamilyTaofaAtkRet=tagSCFamilyTaofaAtkRet()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCFamilyTaofaAtkRet.Head.Cmd,m_NAtagSCFamilyTaofaAtkRet.Head.SubCmd))] = m_NAtagSCFamilyTaofaAtkRet
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 03 公会讨伐信息 #tagSCFamilyTaofaInfo
|
| | |
|
| | | class tagSCFamilyTaofaInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ExpRound", c_ushort), # 已获得经验轮次
|
| | | ("Exp", c_int), # 获得经验求余亿部分
|
| | | ("ExpPoint", c_int), # 获得经验整除亿部分
|
| | | ("BuZhenState", c_ubyte), # 是否已布阵
|
| | | ("AtkCount", c_ushort), # 已斩杀次数,用于计算剩余次数=免费次数+道具增加次数-已斩杀次数
|
| | | ("ItemAddCount", c_ushort), # 道具增加斩杀次数
|
| | | ("Anger", c_ushort), # 当前怒气值
|
| | | ("BoxUnGetCount", c_ushort), # 当前未领取的宝箱数,即可领取的
|
| | | ("BoxHurt", c_int), # 宝箱奖励计算累计伤害,求余亿部分;个人今日累计伤害,换公会不会重置
|
| | | ("BoxHurtEx", c_int), # 宝箱奖励计算累计伤害,整除亿部分
|
| | | ("BoxHurtHis", c_int), # 宝箱奖励计算累计历史最高伤害,求余亿部分
|
| | | ("BoxHurtHisEx", c_int), # 宝箱奖励计算累计历史最高伤害,整除亿部分
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x11
|
| | | self.SubCmd = 0x03
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | |
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x11
|
| | | self.ExpRound = 0
|
| | | self.Exp = 0
|
| | | self.ExpPoint = 0
|
| | | self.SubCmd = 0x03
|
| | | self.BuZhenState = 0
|
| | | self.AtkCount = 0
|
| | | self.ItemAddCount = 0
|
| | | self.Anger = 0
|
| | | self.BoxUnGetCount = 0
|
| | | self.BoxHurt = 0
|
| | | self.BoxHurtEx = 0
|
| | | self.BoxHurtHis = 0
|
| | | self.BoxHurtHisEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFamilySitInfo)
|
| | | return sizeof(tagSCFamilyTaofaInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 11 打坐信息 //tagMCFamilySitInfo:
|
| | | DumpString = '''// A5 03 公会讨伐信息 //tagSCFamilyTaofaInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ExpRound:%d,
|
| | | Exp:%d,
|
| | | ExpPoint:%d
|
| | | BuZhenState:%d,
|
| | | AtkCount:%d,
|
| | | ItemAddCount:%d,
|
| | | Anger:%d,
|
| | | BoxUnGetCount:%d,
|
| | | BoxHurt:%d,
|
| | | BoxHurtEx:%d,
|
| | | BoxHurtHis:%d,
|
| | | BoxHurtHisEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ExpRound,
|
| | | self.Exp,
|
| | | self.ExpPoint
|
| | | self.BuZhenState,
|
| | | self.AtkCount,
|
| | | self.ItemAddCount,
|
| | | self.Anger,
|
| | | self.BoxUnGetCount,
|
| | | self.BoxHurt,
|
| | | self.BoxHurtEx,
|
| | | self.BoxHurtHis,
|
| | | self.BoxHurtHisEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFamilySitInfo=tagMCFamilySitInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilySitInfo.Cmd,m_NAtagMCFamilySitInfo.SubCmd))] = m_NAtagMCFamilySitInfo
|
| | | m_NAtagSCFamilyTaofaInfo=tagSCFamilyTaofaInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCFamilyTaofaInfo.Cmd,m_NAtagSCFamilyTaofaInfo.SubCmd))] = m_NAtagSCFamilyTaofaInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | @param dbData: 实例对应绑定的dbData
|
| | | @return: 成功返回实例对象,失败返回None
|
| | | '''
|
| | | dataToJson = False
|
| | | # 如果需要 dataToJson,可根据ActionType在这里处理
|
| | | dataToJson = True
|
| | | # 默认使用 dataToJson,如果不需要的可根据 ActionType 在这里处理
|
| | | if dbData.ActionType in []:
|
| | | dataToJson = True
|
| | | dataToJson = False
|
| | | actionData = FamilyActionData(dbData, dataToJson)
|
| | | self.__actionDataList.append(actionData)
|
| | | return actionData
|
| | |
| | | elif False:
|
| | | aData = FamilyActionData()
|
| | | return aData
|
| | | |
| | | |
| | | def GetActionDataByValue1(self, value1, isAdd=False):
|
| | | ## 获取Action根据Value1
|
| | | # @return: None or findActionData
|
| | | findActionData = None
|
| | | for actionData in self.__actionDataList:
|
| | | if actionData.GetValue1() == value1:
|
| | | findActionData = actionData
|
| | | break
|
| | | if not findActionData and isAdd:
|
| | | findActionData = self.AddAction()
|
| | | findActionData.SetValue1(value1)
|
| | | return findActionData
|
| | | |
| | | def DelActionDataByValue1(self, value1):
|
| | | ## 删除Action根据Value1
|
| | | for actionData in self.__actionDataList[::-1]:
|
| | | if actionData.GetValue1() == value1:
|
| | | self.__actionDataList.remove(actionData)
|
| | | break
|
| | | return
|
| | | |
| | | class FamilyActionMgr():
|
| | |
|
| | | def __init__(self):
|
| | |
| | | return
|
| | |
|
| | | def GetFamilyAction(self, familyID, actionType):
|
| | | if not familyID:
|
| | | return FamilyAction()
|
| | | if familyID not in self.__familyActionDict:
|
| | | self.__familyActionDict[familyID] = {}
|
| | | actionDict = self.__familyActionDict[familyID]
|
| | |
| | |
|
| | | def FindFamily(self, familyID):
|
| | | family = None
|
| | | if familyID in self.__familyIDDict:
|
| | | if familyID and familyID in self.__familyIDDict:
|
| | | family = self.__familyIDDict[familyID]
|
| | | elif False:
|
| | | family = Family()
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GM.Commands.Taofa
|
| | | #
|
| | | # @todo:公会讨伐
|
| | | # @author hxp
|
| | | # @date 2025-10-24
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 公会讨伐
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-10-24 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import PlayerControl
|
| | | import PlayerFamilyZhenbaoge
|
| | | import PlayerFamilyTaofa
|
| | | import PlayerFamily
|
| | | import DBDataMgr
|
| | | import random
|
| | | import time
|
| | |
|
| | | def OnExec(curPlayer, msgList):
|
| | | |
| | | if not msgList:
|
| | | GameWorld.DebugAnswer(curPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
|
| | | GameWorld.DebugAnswer(curPlayer, "重置公会讨伐: Taofa 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置布阵层级: Taofa z 层级 [剩余秒]")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置当前怒气: Taofa a 怒气")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置讨伐次数: Taofa c 已讨伐次数 物品次数")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置宝箱领取: Taofa b 已领取宝箱 未领取")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置宝箱时间: Taofa t 几秒前统计的")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置宝箱贡献: Taofa g 已贡献宝箱 [累计伤害 历史伤害]")
|
| | | #GameWorld.DebugAnswer(curPlayer, "新增成员讨伐: Taofa m 人数 [每人攻击次数 怒气次数 伤害值A 到B]")
|
| | | #GameWorld.DebugAnswer(curPlayer, "AB值没有填则按常规砍价价格计算")
|
| | | GameWorld.DebugAnswer(curPlayer, "创建仙盟相关使用命令: CreateFamily")
|
| | | return
|
| | | |
| | | familyID = curPlayer.GetFamilyID()
|
| | | if not familyID:
|
| | | GameWorld.DebugAnswer(curPlayer, "没有仙盟")
|
| | | return
|
| | | curFamily = DBDataMgr.GetFamilyMgr().FindFamily(familyID)
|
| | | if not curFamily:
|
| | | return
|
| | | |
| | | value1 = msgList[0]
|
| | | if value1 == 0:
|
| | | PlayerFamilyTaofa.OnTaofaReset(curFamily)
|
| | | PlayerFamilyTaofa.OnTaofaResetPlayer(curPlayer)
|
| | | GameWorld.DebugAnswer(curPlayer, "重置公会讨伐OK")
|
| | | return
|
| | | |
| | | if value1 == "z":
|
| | | gLayer = msgList[1] if len(msgList) > 1 else 0
|
| | | remainSeconds = msgList[2] if len(msgList) > 2 else 3600
|
| | | gEndTime = int(time.time()) + remainSeconds
|
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, PlayerFamilyTaofa.ActionType)
|
| | | gActionData = familyAction.GetActionDataByValue1(PlayerFamilyTaofa.ActionGlobalID, True)
|
| | | PlayerFamilyTaofa.SetFABuzhenLayer(gActionData, gLayer)
|
| | | PlayerFamilyTaofa.SetFABuzhenEndTime(gActionData, gEndTime)
|
| | | PlayerFamily.SendFamilyAction(gActionData)
|
| | | GameWorld.DebugAnswer(curPlayer, "布阵层:%s,到期:%s" % (gLayer, GameWorld.ChangeTimeNumToStr(gEndTime)))
|
| | | return
|
| | | |
| | | # 新增成员讨伐
|
| | | if value1 == "m":
|
| | | memCnt = msgList[1] if len(msgList) > 1 else 0
|
| | | GameWorld.DebugAnswer(curPlayer, "成员讨伐:%s" % (memCnt))
|
| | | return
|
| | | |
| | | elif value1 == "a":
|
| | | anger = msgList[1] if len(msgList) > 1 else 0
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, anger)
|
| | | GameWorld.DebugAnswer(curPlayer, "当前怒气: %s" % anger)
|
| | | |
| | | elif value1 == "c":
|
| | | atkCnt = msgList[1] if len(msgList) > 1 else 0
|
| | | itemAddCnt = msgList[2] if len(msgList) > 2 else 0
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaCnt, atkCnt)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt, itemAddCnt)
|
| | | GameWorld.DebugAnswer(curPlayer, "已讨伐次数:%s, 物品增加次数:%s" % (atkCnt, itemAddCnt))
|
| | | |
| | | elif value1 == "b":
|
| | | totalGetCnt = msgList[1] if len(msgList) > 1 else 0
|
| | | unGetCnt = msgList[2] if len(msgList) > 2 else 0
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt, totalGetCnt)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, unGetCnt)
|
| | | GameWorld.DebugAnswer(curPlayer, "已领取宝箱:%s, 未领取:%s" % (totalGetCnt, unGetCnt))
|
| | | |
| | | elif value1 == "t":
|
| | | befSeconds = msgList[1] if len(msgList) > 1 else 0
|
| | | lastTime = int(time.time()) - befSeconds
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime, lastTime)
|
| | | GameWorld.DebugAnswer(curPlayer, "上次检查宝箱时间:%s" % (GameWorld.ChangeTimeNumToStr(lastTime)))
|
| | | |
| | | elif value1 == "g":
|
| | | contribCnt = msgList[1] if len(msgList) > 1 else 0
|
| | | boxHurtTotal = msgList[2] if len(msgList) > 2 else None
|
| | | boxHurtTotalHis = msgList[3] if len(msgList) > 3 else None
|
| | | if boxHurtTotal == None:
|
| | | boxHurt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt)
|
| | | boxHurtEx = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx)
|
| | | boxHurtTotal = boxHurt + boxHurtEx * ChConfig.Def_PerPointValue
|
| | | if boxHurtTotalHis == None:
|
| | | boxHurtHis = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHis)
|
| | | boxHurtHisEx = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHisEx)
|
| | | boxHurtTotalHis = max(boxHurtTotal, boxHurtHis + boxHurtHisEx * ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxContribCnt, contribCnt)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt, boxHurtTotal % ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx, boxHurtTotal / ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHis, boxHurtTotalHis % ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHisEx, boxHurtTotalHis / ChConfig.Def_PerPointValue)
|
| | | GameWorld.DebugAnswer(curPlayer, "已贡献宝箱:%s,总伤害:%s,历史:%s" % (contribCnt, boxHurtTotal, boxHurtTotalHis))
|
| | | |
| | | PlayerFamilyTaofa.SyncTaofaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | #添加假砍价
|
| | | gActionData = PlayerFamilyZhenbaoge.GetZhenbaogeActionData(familyID, PlayerFamilyZhenbaoge.ActionGlobalID)
|
| | | if not gActionData:
|
| | | GameWorld.DebugAnswer(curPlayer, "请先重置珍宝阁")
|
| | | return
|
| | | |
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, PlayerFamilyZhenbaoge.ActionType)
|
| | | actionCount = familyAction.Count()
|
| | | |
| | | fackCount = value1
|
| | | randValue1 = msgList[1] if len(msgList) > 1 else 0
|
| | | randValue2 = msgList[2] if len(msgList) > 2 else 0
|
| | | syncActionDataList = [gActionData]
|
| | | startFackID = 1000 + actionCount
|
| | | FakeName = GameWorld.GbkToCode("假名字")
|
| | | for fackID in range(startFackID, startFackID + fackCount):
|
| | | |
| | | playerID = fackID
|
| | | playerName = "%s%s" % (FakeName, fackID)
|
| | | |
| | | if randValue1 and randValue2 and randValue1 <= randValue2: |
| | | cutPrice = random.randint(randValue1, randValue2)
|
| | | else:
|
| | | cutPrice = PlayerFamilyZhenbaoge.CalcCutPrice(curFamily, gActionData, playerID)
|
| | | |
| | | if not cutPrice:
|
| | | continue
|
| | | |
| | | actionData = PlayerFamilyZhenbaoge.AddCutPrice(familyID, playerID, playerName, cutPrice, gActionData, False)
|
| | | syncActionDataList.append(actionData)
|
| | | nowPrice = PlayerFamilyZhenbaoge.GetFAPriceFinal(gActionData)
|
| | | GameWorld.DebugAnswer(curPlayer, "砍价人次:%s,砍价:%s,现价:%s" % (fackID % 1000, cutPrice, nowPrice))
|
| | | |
| | | PlayerFamily.SendFamilyAction(syncActionDataList)
|
| | | nowPrice = PlayerFamilyZhenbaoge.GetFAPriceFinal(gActionData)
|
| | | GameWorld.DebugAnswer(curPlayer, "添加假砍价数:%s,总砍价数:%s,当前价格:%s" % (fackCount, familyAction.Count() - 1, nowPrice))
|
| | | return
|
| | |
| | | return -1
|
| | | curItemID = curItem.GetItemTypeID()
|
| | | useCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ItemUseCntToday % curItemID)
|
| | | for itemIDList in IpyGameDataPY.GetFuncEvalCfg('ShareUseCntItem'):
|
| | | if curItemID not in itemIDList:
|
| | | continue
|
| | | for itemID in itemIDList:
|
| | | if itemID == curItemID:
|
| | | continue
|
| | | useCnt += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ItemUseCntToday % itemID)
|
| | | #for itemIDList in IpyGameDataPY.GetFuncEvalCfg('ShareUseCntItem'):
|
| | | # if curItemID not in itemIDList:
|
| | | # continue
|
| | | # for itemID in itemIDList:
|
| | | # if itemID == curItemID:
|
| | | # continue
|
| | | # useCnt += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ItemUseCntToday % itemID)
|
| | |
|
| | | canUseCnt = max(0, maxCnt - useCnt)
|
| | |
|
| | |
| | | ChConfig.Def_Effect_AddRealmExpRate:"Item_AddRealmExpRate", # 增加聚灵效率
|
| | | ChConfig.Def_Effect_TouchMission:"Item_TouchMission", # 触发任务接口
|
| | | ChConfig.Def_Effect_HeroSkin:"Item_HeroSkin", # 武将皮肤
|
| | | ChConfig.Def_Effect_FamilyTaofaCnt:"Item_FamilyTaofaCnt", # 增加公会讨伐次数
|
| | | #ChConfig.Def_Effect_AddArenaBattleCount:"Item_AddArenaBattleCount", # 增加竞技场挑战次数
|
| | | #ChConfig.Def_Effect_FamilyImpeach:"Item_FamilyImpeach", # 弹劾符
|
| | | #ChConfig.Def_Effect_ClothesCoatSkin:"Item_ClothesCoatSkin", #激活时装皮肤
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package UseItem.Item_FamilyTaofaCnt
|
| | | #
|
| | | # @todo:增加公会讨伐次数
|
| | | # @author hxp
|
| | | # @date 2025-10-24
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 增加公会讨伐次数
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-10-24 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import PlayerFamilyTaofa
|
| | | import ItemCommon
|
| | |
|
| | | def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
|
| | | ##批量使用物品
|
| | | curEff = curRoleItem.GetEffectByIndex(0)
|
| | | addCnt = curEff.GetEffectValue(0) * useCnt
|
| | | PlayerFamilyTaofa.AddTaofaCntByItem(curPlayer, addCnt)
|
| | | ItemCommon.DelItem(curPlayer, curRoleItem, useCnt)
|
| | | return True, useCnt
|
| | |
|
| | |
| | | import PlayerCrossRealmPK
|
| | | import PlayerCrossChampionship
|
| | | import GameFuncComm
|
| | | import PlayerFamilyTaofa
|
| | | import PlayerBossReborn
|
| | | import PlayerWeekParty
|
| | | import PlayerFeastWeekParty
|
| | |
| | | # 历练秘笈升级
|
| | | elif rewardType == ChConfig.Def_RewardType_LLMJLVUp:
|
| | | PlayerLLMJ.OnLLMJLVUp(curPlayer)
|
| | | # 公会讨伐领取宝箱奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_FamilyTaofaBox:
|
| | | PlayerFamilyTaofa.GetTaofaBoxAward(curPlayer)
|
| | | # 每日免费直购礼包
|
| | | elif rewardType == ChConfig.Def_RewardType_DayFreeGoldGift:
|
| | | PlayerDailyGiftbag.OnGetDailyFreeGiftbag(curPlayer)
|
| | |
| | | import ChPyNetSendPack
|
| | | import PlayerFamilyEmblem
|
| | | import PlayerFamilyZhenbaoge
|
| | | import PlayerFamilyTaofa
|
| | | import IPY_PlayerDefine
|
| | | import IpyGameDataPY
|
| | | import IPY_GameWorld
|
| | |
| | | family = familyManager.GetAt(i)
|
| | | familyID = family.GetID()
|
| | |
|
| | | #珍宝阁
|
| | | PlayerFamilyZhenbaoge.OnDay(family)
|
| | | PlayerFamilyTaofa.OnDay(family)
|
| | |
|
| | | for index in xrange(family.GetCount()):
|
| | | member = family.GetAt(index)
|
| | |
| | | return
|
| | | ResetDailyDonateCnt(curPlayer)
|
| | | PlayerFamilyZhenbaoge.PlayerOnDay(curPlayer)
|
| | | PlayerFamilyTaofa.PlayerOnDay(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer, tick):
|
| | |
| | | Sync_RequestAddFamilyInfo(curPlayer, False)
|
| | | SyncDonateCntInfo(curPlayer)
|
| | | PlayerFamilyZhenbaoge.OnPlayerLogin(curPlayer)
|
| | | PlayerFamilyTaofa.OnPlayerLogin(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerLogout(curPlayer):
|
| | |
| | | familyMgr = DBDataMgr.GetFamilyMgr()
|
| | | familyMgr.DelPlayerReqJoinFamilyIDAll(curPlayer.GetPlayerID())
|
| | | Sync_RequestAddFamilyInfo(curPlayer)
|
| | | PlayerFamilyTaofa.OnPlayerEnterFamily(curPlayer)
|
| | | return
|
| | |
|
| | | def __OnLeaveFamily(curPlayer, isVoluntarily, tick):
|
| | |
| | | delMoney = int(nowMoney * delMoneyPer / 100.0)
|
| | | GameWorld.DebugLog(" 扣除货币: delMoneyType=%s,delMoneyPer=%s,nowMoney=%s,delMoney=%s" % (delMoneyType, delMoneyPer, nowMoney, delMoney))
|
| | | PlayerControl.PayMoney(curPlayer, delMoneyType, delMoney, "LeaveFamily")
|
| | | |
| | | PlayerFamilyTaofa.OnPlayerLeaveFamily(curPlayer)
|
| | | FBLogic.OnLeaveFamily(curPlayer, tick)
|
| | | return
|
| | |
|
| | |
| | | #XW_JZ_LeaveFamily <n color="0,190,255">{%S1%}</n><n color="255,255,0">退出了家族!</n> 25 - -
|
| | | NotifyAllFamilyMemberMsg(familyID, "XW_JZ_LeaveFamily", [curPlayer.GetName()])
|
| | |
|
| | | __DoPlayerLeaveFamilyByID(family, playerID, curPlayer)
|
| | | MapServer_FamilyRefresh(curPlayer, 0, 1)
|
| | |
|
| | | if family.GetCount() == 0:
|
| | |
| | |
|
| | | #删除玩家
|
| | | tagPlayer = GameWorld.GetPlayerManager().FindPlayerByID(tagMemberID)
|
| | | __DoPlayerLeaveFamilyByID(family, tagPlayerID, tagPlayer)
|
| | | if tagPlayer:
|
| | | MapServer_FamilyRefresh(tagPlayer, 0)
|
| | |
|
| | | Broadcast_FamilyChange(familyID, FamilyChangeType_MemLeave)
|
| | | return
|
| | |
|
| | | def __DoPlayerLeaveFamilyByID(curFamily, leavePlayerID, tagPlayer=None):
|
| | | ## 有玩家离开家族处理,主要针对家族层级的,玩家个人的在 __OnLeaveFamily 处理
|
| | | PlayerFamilyTaofa.OnFamilyMemberLeave(curFamily, leavePlayerID, tagPlayer)
|
| | | return
|
| | |
|
| | | #// A6 11 家族改名 #tagCMRenameFamily
|
| | |
| | | def SendFamilyActionInfo(curPlayer, familyID, actionType):
|
| | | ## 发送家族行为
|
| | | # @param curPlayer: 为None时通知该仙盟所有成员
|
| | | |
| | | if not familyID:
|
| | | return
|
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, actionType)
|
| | |
|
| | | clientPack = ChPyNetSendPack.tagMCFamilyActionInfo()
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.PlayerFamilyTaofa
|
| | | #
|
| | | # @todo:公会讨伐
|
| | | # @author hxp
|
| | | # @date 2025-10-24
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 公会讨伐
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-10-24 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import IpyGameDataPY
|
| | | import NetPackCommon
|
| | | import ChPyNetSendPack
|
| | | import PlayerViewCache
|
| | | import ItemControler
|
| | | import PlayerControl
|
| | | import PlayerFamily
|
| | | import GameWorld
|
| | | import DBDataMgr
|
| | | import ObjPool
|
| | |
|
| | | import time
|
| | |
|
| | | ActionType = ShareDefine.Def_ActionType_Taofa
|
| | | ActionGlobalID = 1 # 全局记录ID
|
| | |
|
| | | # 全局记录
|
| | | #Time 重置时间戳,前端可用于判断是否变更了不同的讨伐,如GM命令(变更后,前端可重置功能相关缓存数据),后端默认OnDay变更
|
| | | #Value1 ActionGlobalID
|
| | | def GetFABuzhenEndTime(gActionData): return gActionData.GetValue2() # 布阵层级到期时间戳
|
| | | def SetFABuzhenEndTime(gActionData, gEndTime): return gActionData.SetValue2(gEndTime)
|
| | | def GetFABuzhenLayer(gActionData): return gActionData.GetValue3() # 当前有效布阵层级
|
| | | def SetFABuzhenLayer(gActionData, gLayer): return gActionData.SetValue3(gLayer)
|
| | |
|
| | | # 成员记录
|
| | | #Time 最后一次更新时间,可能是布阵或攻击,可用于宝箱记录的排序
|
| | | def SetFAAtkTime(actionData, atkTime): return actionData.SetTime(atkTime) # 最后一次攻击时间戳
|
| | | def GetFAPlayerID(actionData): return actionData.GetValue1() # 成员ID
|
| | | def SetFAPlayerID(actionData, playerID): return actionData.SetValue1(playerID)
|
| | | def GetFABuzhenTime(actionData): return actionData.GetValue2() # 玩家布阵时间戳,为0时仅代表没有在该公会布阵,不代表玩家未布阵
|
| | | def SetFABuzhenTime(actionData, bzTime): return actionData.SetValue2(bzTime)
|
| | | def GetFAAtkCount(actionData): return actionData.GetValue3() # 到本公会后攻击次数
|
| | | def SetFAAtkCount(actionData, faAtkCnt): return actionData.SetValue3(faAtkCnt)
|
| | | def GetFAHurtTotal(actionData): return actionData.GetValue4() # 到本公会后累计伤害,求余亿部分,可用于战绩排序
|
| | | def SetFAHurtTotal(actionData, faHurtTotal): return actionData.SetValue4(faHurtTotal)
|
| | | def GetFAHurtTotalEx(actionData): return actionData.GetValue5() # 到本公会后累计伤害,整除亿部分
|
| | | def SetFAHurtTotalEx(actionData, faHurtTotalEx): return actionData.SetValue5(faHurtTotalEx)
|
| | | def GetFAContribBoxCnt(actionData): return actionData.GetValue6() # 到本公会后贡献宝箱数
|
| | | def SetFAContribBoxCnt(actionData, faContribBoxCnt): return actionData.SetValue6(faContribBoxCnt)
|
| | | AtkIndexs = (
|
| | | AtkIndex_AtkTime,
|
| | | AtkIndex_ContribBoxCnt,
|
| | | AtkIndex_HurtValue,
|
| | | AtkIndex_AtkType,
|
| | | ) = range(4)
|
| | | #UserDict {"atkList":[[atkTime, 本次贡献箱子数, 本次总伤害, atkType], ...], ...}
|
| | | #atkList = actionData.GetUserDict().get("atkList", [])
|
| | | #actionData.GetUserDict().update({"atkList":atkList})
|
| | |
|
| | | AtkType_Normal = 0 # 常规斩杀
|
| | | AtkType_Anger = 1 # 怒气斩杀
|
| | |
|
| | | def OnDay(family):
|
| | | OnTaofaReset(family) |
| | | return
|
| | |
|
| | | def PlayerOnDay(curPlayer):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBuZhenState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxContribCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx, 0)
|
| | | SyncTaofaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | curFamily = DBDataMgr.GetFamilyMgr().FindFamily(familyID)
|
| | | RefreshPlayerAwardBoxCnt(curFamily, curPlayer, unSyncIDList=[curPlayer.GetPlayerID()])
|
| | | SyncTaofaInfo(curPlayer)
|
| | | PlayerFamily.SendFamilyActionInfo(curPlayer, familyID, ActionType)
|
| | | return
|
| | |
|
| | | def OnTaofaReset(family):
|
| | | familyID = family.GetID()
|
| | | actionMgr = DBDataMgr.GetFamilyActionMgr()
|
| | | actionMgr.DelFamilyAction(familyID, ActionType)
|
| | | |
| | | familyAction = actionMgr.GetFamilyAction(familyID, ActionType)
|
| | | gActionData = familyAction.AddAction()
|
| | | SetFAPlayerID(gActionData, ActionGlobalID)
|
| | | PlayerFamily.SendFamilyAction(gActionData)
|
| | | return
|
| | |
|
| | | def OnTaofaResetPlayer(curPlayer):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBuZhenState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxContribCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHis, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHisEx, 0)
|
| | | SyncTaofaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnFamilyMemberLeave(family, leavePlayerID, leavePlayer=None):
|
| | | ## 公会成员删除,针对公会的处理
|
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(family.GetID(), ActionType)
|
| | | actionData = familyAction.GetActionDataByValue1(leavePlayerID, False)
|
| | | if not actionData:
|
| | | return
|
| | | memInfo = PlayerViewCache.GetPlayerBaseViewInfo(leavePlayerID, leavePlayer)
|
| | | actionData.GetUserDict().update({"info":memInfo})
|
| | | PlayerFamily.SendFamilyAction([actionData])
|
| | | return
|
| | |
|
| | | def OnPlayerLeaveFamily(curPlayer):
|
| | | ## 玩家退出了公会,针对玩家个人的处理
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, 0)
|
| | | SyncTaofaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerEnterFamily(curPlayer):
|
| | | ## 玩家进入新公会
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | PlayerFamily.SendFamilyActionInfo(curPlayer, familyID, ActionType)
|
| | | return
|
| | |
|
| | | def RefreshFamilyBuZhenInfo(family):
|
| | | ## 刷新公会公共布阵信息
|
| | | familyID = family.GetID()
|
| | | curTime = int(time.time())
|
| | | bzDuration = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 4) * 60 # 有效时长秒
|
| | | maxLayer = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 3)
|
| | | |
| | | gLayer = 0
|
| | | gEndTime = 0
|
| | | gActionData = None
|
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ActionType)
|
| | | for index in range(0, familyAction.Count()):
|
| | | actionData = familyAction.At(index)
|
| | | dataID = GetFAPlayerID(actionData)
|
| | | if dataID == ActionGlobalID:
|
| | | gActionData = actionData
|
| | | continue
|
| | | bzTime = GetFABuzhenTime(actionData)
|
| | | if not bzTime:
|
| | | continue
|
| | | endTime = bzTime + bzDuration
|
| | | if endTime <= curTime:
|
| | | continue
|
| | | |
| | | if not maxLayer or gLayer < maxLayer:
|
| | | gLayer += 1
|
| | | |
| | | if gEndTime < endTime:
|
| | | gEndTime = endTime
|
| | | |
| | | GameWorld.DebugLog("刷新公会公共布阵信息: familyID=%s,gLayer=%s,gEndTime=%s" % (familyID, gLayer, GameWorld.ChangeTimeNumToStr(gEndTime)))
|
| | | if not gActionData:
|
| | | gActionData = familyAction.AddAction()
|
| | | SetFAPlayerID(gActionData, ActionGlobalID)
|
| | | |
| | | SetFABuzhenEndTime(gActionData, gEndTime)
|
| | | SetFABuzhenLayer(gActionData, gLayer)
|
| | | PlayerFamily.SendFamilyAction(gActionData)
|
| | | return
|
| | |
|
| | | def RefreshPlayerAwardBoxCnt(family, curPlayer=None, unSyncIDList=[]):
|
| | | ## 刷新玩家可领取的宝箱数
|
| | | # @param curPlayer: None时刷新所有成员
|
| | | if not family:
|
| | | return
|
| | | |
| | | familyID = family.GetID()
|
| | | memContribDict = {} |
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ActionType)
|
| | | for index in range(0, familyAction.Count()):
|
| | | actionData = familyAction.At(index)
|
| | | memID = GetFAPlayerID(actionData)
|
| | | if memID == ActionGlobalID:
|
| | | continue
|
| | | contribList = []
|
| | | atkList = actionData.GetUserDict().get("atkList", [])
|
| | | for atkInfo in atkList:
|
| | | atkTime = atkInfo[AtkIndex_AtkTime]
|
| | | contribBoxCnt = atkInfo[AtkIndex_ContribBoxCnt]
|
| | | if contribBoxCnt > 0:
|
| | | contribList.append([atkTime, contribBoxCnt])
|
| | | if contribList:
|
| | | memContribDict[memID] = contribList
|
| | | |
| | | awardBoxMax = IpyGameDataPY.GetFuncCfg("FamilyTaofaBox", 3)
|
| | | GameWorld.DebugLog("刷新公会成员可领取的宝箱数: familyID=%s,memContribDict=%s" % (familyID, memContribDict))
|
| | | if curPlayer:
|
| | | member = family.FindMember(curPlayer.GetPlayerID())
|
| | | if not member:
|
| | | return
|
| | | __doUpdPlayerAwardBoxCnt(curPlayer, member, memContribDict, awardBoxMax, unSyncIDList)
|
| | | return
|
| | | |
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for index in xrange(family.GetCount()):
|
| | | member = family.GetAt(index)
|
| | | playerID = member.GetPlayerID()
|
| | | curPlayer = playerManager.FindPlayerByID(playerID)
|
| | | if not curPlayer:
|
| | | continue
|
| | | __doUpdPlayerAwardBoxCnt(curPlayer, member, memContribDict, awardBoxMax, unSyncIDList)
|
| | | return
|
| | |
|
| | | def __doUpdPlayerAwardBoxCnt(curPlayer, member, memContribDict, awardBoxMax, unSyncIDList):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | joinTime = member.GetJoinTime()
|
| | | boxLastTime = max(curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime), joinTime) # 与加入时间取最大
|
| | | boxTotalGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt) # 已领取宝箱数
|
| | | boxUnGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt) # 未领取宝箱数
|
| | | canAddBoxMax = awardBoxMax - boxTotalGetCnt - boxUnGetCnt # 还可领取的箱子数
|
| | | if canAddBoxMax <= 0:
|
| | | GameWorld.DebugLog(" 成员可领取宝箱已达上限不刷新: playerID=%s,boxLastTime=%s,boxTotalGetCnt(%s)+boxUnGetCnt(%s) >= %s" |
| | | % (playerID, boxLastTime, boxTotalGetCnt, boxUnGetCnt, awardBoxMax))
|
| | | return
|
| | | |
| | | updBoxLastTime = boxLastTime
|
| | | addUnGetBox = 0
|
| | | for contribList in memContribDict.values():
|
| | | if addUnGetBox >= canAddBoxMax:
|
| | | break
|
| | | for atkTime, contribBoxCnt in contribList:
|
| | | if boxLastTime >= atkTime:
|
| | | continue
|
| | | updBoxLastTime = max(updBoxLastTime, atkTime)
|
| | | addUnGetBox += contribBoxCnt
|
| | | if addUnGetBox >= canAddBoxMax:
|
| | | break
|
| | | |
| | | if addUnGetBox <= 0:
|
| | | GameWorld.DebugLog(" 成员当前没有可领取的宝箱不刷新: playerID=%s,boxLastTime=%s,boxTotalGetCnt=%s,boxUnGetCnt=%s,awardBoxMax=%s,canAddBoxMax=%s" |
| | | % (playerID, boxLastTime, boxTotalGetCnt, boxUnGetCnt, awardBoxMax, canAddBoxMax))
|
| | | return
|
| | | updBoxUnGetCnt = boxUnGetCnt + addUnGetBox
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, updBoxUnGetCnt)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime, updBoxLastTime)
|
| | | GameWorld.DebugLog(" 成员可领取的宝箱数: playerID=%s,addUnGetBox=%s,updBoxUnGetCnt=%s,updBoxLastTime=%s,boxLastTime=%s,boxTotalGetCnt=%s,boxUnGetCnt=%s,awardBoxMax=%s,canAddBoxMax=%s" |
| | | % (playerID, addUnGetBox, updBoxUnGetCnt, updBoxLastTime, boxLastTime, boxTotalGetCnt, boxUnGetCnt, awardBoxMax, canAddBoxMax))
|
| | | if not unSyncIDList or playerID not in unSyncIDList:
|
| | | SyncTaofaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def AddTaofaCntByItem(curPlayer, addCnt):
|
| | | ## 物品增加副本次数
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt, itemAddCnt + addCnt)
|
| | | SyncTaofaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | #// A6 13 公会讨伐 #tagCSFamilyTaofaOP
|
| | | #
|
| | | #struct tagCSFamilyTaofaOP
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE OpType; // 操作:0-斩杀攻击;1-布阵
|
| | | #};
|
| | | def OnFamilyTaofaOP(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | opType = clientData.OpType
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | if not familyID:
|
| | | GameWorld.DebugLog("没有仙盟无法操作!", playerID)
|
| | | return |
| | | # 布阵
|
| | | if opType == 1:
|
| | | __doBuzhen(curPlayer)
|
| | | # նɱ
|
| | | else:
|
| | | __doZhanshaAtk(curPlayer)
|
| | | return
|
| | |
|
| | | def GetFamilyBuzhenLayer(familyID):
|
| | | ## 获取并刷新当前公会有效布阵层数
|
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ActionType)
|
| | | gActionData = familyAction.GetActionDataByValue1(ActionGlobalID, True)
|
| | | gEndTime = GetFABuzhenEndTime(gActionData)
|
| | | gLayer = GetFABuzhenLayer(gActionData)
|
| | | if (gEndTime or gLayer) and int(time.time()) > gEndTime:
|
| | | SetFABuzhenEndTime(gActionData, 0)
|
| | | SetFABuzhenLayer(gActionData, 0)
|
| | | #PlayerFamily.SendFamilyAction(gActionData) 失效不用同步,前端根据EndTime判断即可
|
| | | gEndTime = 0
|
| | | gLayer = 0
|
| | | return gLayer, gActionData
|
| | |
|
| | | def __doBuzhen(curPlayer):
|
| | | ## 布阵
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBuZhenState):
|
| | | GameWorld.DebugLog("已布阵过!", playerID)
|
| | | return
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | curFamily = DBDataMgr.GetFamilyMgr().FindFamily(familyID)
|
| | | if not curFamily:
|
| | | return
|
| | | gLayer, gActionData = GetFamilyBuzhenLayer(familyID)
|
| | | bzDuration = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 4) * 60 # 有效时长秒
|
| | | maxLayer = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 3)
|
| | | gEndTime = int(time.time()) + bzDuration # 直接覆盖更新
|
| | | if not maxLayer or gLayer < maxLayer:
|
| | | gLayer += 1
|
| | | |
| | | GameWorld.DebugLog("公会讨伐布阵: gLayer=%s,gEndTime=%s" % (gLayer, GameWorld.ChangeTimeNumToStr(gEndTime)), playerID)
|
| | | # 公共信息
|
| | | SetFABuzhenEndTime(gActionData, gEndTime)
|
| | | SetFABuzhenLayer(gActionData, gLayer)
|
| | | |
| | | # 成员信息
|
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ActionType)
|
| | | actionData = familyAction.GetActionDataByValue1(playerID, True)
|
| | | SetFABuzhenTime(actionData, int(time.time()))
|
| | | |
| | | PlayerFamily.SendFamilyAction([gActionData, actionData])
|
| | | |
| | | # 个人记录
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBuZhenState, 1)
|
| | | SyncTaofaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def __doZhanshaAtk(curPlayer):
|
| | | ## 斩杀攻击
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | curFamily = DBDataMgr.GetFamilyMgr().FindFamily(familyID)
|
| | | if not curFamily:
|
| | | return
|
| | | |
| | | atkCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaCnt)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt)
|
| | | freeCnt = IpyGameDataPY.GetFuncCfg("FamilyTaofaAtk", 1)
|
| | | canAtkCnt = freeCnt + itemAddCnt - atkCnt
|
| | | if canAtkCnt <= 0:
|
| | | GameWorld.DebugLog("公会讨伐没有斩杀次数: atkCnt=%s >= freeCnt(%s) + itemAddCnt(%s)" % (atkCnt, freeCnt, itemAddCnt), playerID)
|
| | | return
|
| | | |
| | | atkTime = int(time.time())
|
| | | |
| | | # 计算属性
|
| | | gLayer, _ = GetFamilyBuzhenLayer(familyID)
|
| | | fightPower = PlayerControl.GetFightPower(curPlayer)
|
| | | superRate = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 1)
|
| | | superRatio = IpyGameDataPY.GetFuncCfg("FamilyTaofaAtk", 3) # 暴击伤害倍值
|
| | | addSuperRatePerLayer, addDamPerLayer = IpyGameDataPY.GetFuncEvalCfg("FamilyTaofaBuzhen", 2)
|
| | | damRatio = 1 # 伤害加成
|
| | | if gLayer > 0:
|
| | | superRate += gLayer * addSuperRatePerLayer
|
| | | damRatio += gLayer * addDamPerLayer / 10000.0
|
| | | |
| | | commAddAnger, superAddAnger, maxAnger = IpyGameDataPY.GetFuncEvalCfg("FamilyTaofaAtk", 4)
|
| | | anger = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaAnger)
|
| | | |
| | | GameWorld.DebugLog("---公会讨伐斩杀: fightPower=%s,gLayer=%s,superRate=%s,superRatio=%s,damRatio=%s,anger=%s/%s" |
| | | % (fightPower, gLayer, superRate, superRatio, damRatio, anger, maxAnger), playerID)
|
| | | |
| | | familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ActionType)
|
| | | actionData = familyAction.GetActionDataByValue1(playerID, True)
|
| | | faAtkCnt = GetFAAtkCount(actionData)
|
| | | faContribBoxCnt = GetFAContribBoxCnt(actionData)
|
| | | faHurtTotal = GetFAHurtTotal(actionData) + GetFAHurtTotalEx(actionData) * ChConfig.Def_PerPointValue
|
| | | GameWorld.DebugLog("faAtkCnt=%s,faHurtTotal=%s,faContribBoxCnt=%s" % (faAtkCnt, faHurtTotal, faContribBoxCnt), playerID)
|
| | | |
| | | boxContribCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxContribCnt)
|
| | | boxHurt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt)
|
| | | boxHurtEx = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx)
|
| | | boxHurtTotal = boxHurt + boxHurtEx * ChConfig.Def_PerPointValue
|
| | | boxHurtHis = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHis)
|
| | | boxHurtHisEx = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHisEx)
|
| | | boxHurtTotalHis = boxHurtHis + boxHurtHisEx * ChConfig.Def_PerPointValue
|
| | | GameWorld.DebugLog("boxContribCnt=%s,boxHurtTotal=%s,boxHurtTotalHis=%s" % (boxContribCnt, boxHurtTotal, boxHurtTotalHis), playerID)
|
| | | |
| | | atkType = AtkType_Normal
|
| | | calcHurtCnt = 1 # 计算伤害次数
|
| | | if anger >= maxAnger:
|
| | | anger -= maxAnger
|
| | | atkType = AtkType_Anger # 怒气攻击
|
| | | calcHurtCnt = IpyGameDataPY.GetFuncCfg("FamilyTaofaAtk", 5)
|
| | | |
| | | hurtTotal = 0 # 本次总伤害
|
| | | hurtList = [] # 伤害列表 [伤害, 是否暴击]
|
| | | for i in range(calcHurtCnt):
|
| | | isSuper = GameWorld.CanHappen(superRate)
|
| | | # 【最终伤害】= 战力*(1+布阵增伤)* 暴击伤害倍值
|
| | | hurtValue = int(fightPower * (superRatio if isSuper else 1) * damRatio)
|
| | | hurtTotal += hurtValue
|
| | | if atkType == AtkType_Normal: # 仅常规斩杀加怒气
|
| | | anger += (superAddAnger if isSuper else commAddAnger)
|
| | | GameWorld.DebugLog("第%s次伤害: isSuper=%s,hurtValue=%s,hurtTotal=%s,anger=%s,atkType=%s" % (i + 1, isSuper, hurtValue, hurtTotal, anger, atkType), playerID)
|
| | | hurtList.append([hurtValue, isSuper])
|
| | | |
| | | faAtkCnt += calcHurtCnt
|
| | | faHurtTotal += hurtTotal
|
| | | boxHurtTotal += hurtTotal
|
| | | GameWorld.DebugLog("更新累计伤害: faAtkCnt=%s,faHurtTotal=%s,boxHurtTotal=%s" % (faAtkCnt, faHurtTotal, boxHurtTotal), playerID)
|
| | | |
| | | # 计算贡献盒子数
|
| | | updContribBoxCnt = 0
|
| | | boxAwardHurtList = IpyGameDataPY.GetFuncEvalCfg("FamilyTaofaBox", 1)
|
| | | contribBoxMax = min(IpyGameDataPY.GetFuncCfg("FamilyTaofaBox", 2), 1000) # 可贡献的最大箱子数
|
| | | for needHurt in boxAwardHurtList:
|
| | | if boxHurtTotal < needHurt:
|
| | | break
|
| | | updContribBoxCnt += 1
|
| | | finalAwardHurt = boxAwardHurtList[-1] # 最后一档最大伤害值
|
| | | loopNeedHurt = (finalAwardHurt - boxAwardHurtList[-2]) if len(boxAwardHurtList) > 1 else finalAwardHurt # 最后一档所需伤害值
|
| | | GameWorld.DebugLog("计算常规贡献宝箱: updContribBoxCnt=%s,boxHurtTotal=%s,finalAwardHurt=%s" % (updContribBoxCnt, boxHurtTotal, finalAwardHurt), playerID)
|
| | | if boxHurtTotal > finalAwardHurt:
|
| | | loopHurtTotal = boxHurtTotal - finalAwardHurt
|
| | | loopContribBoxCnt = loopHurtTotal / loopNeedHurt
|
| | | updContribBoxCnt = min(updContribBoxCnt + loopContribBoxCnt, contribBoxMax)
|
| | | GameWorld.DebugLog("计算循环贡献宝箱: updContribBoxCnt=%s,loopHurtTotal=%s,loopNeedHurt=%s,loopContribBoxCnt=%s,contribBoxMax=%s" |
| | | % (updContribBoxCnt, loopHurtTotal, loopNeedHurt, loopContribBoxCnt, contribBoxMax), playerID)
|
| | | addContribCnt = 0
|
| | | if updContribBoxCnt > boxContribCnt:
|
| | | addContribCnt = updContribBoxCnt - boxContribCnt
|
| | | faContribBoxCnt += addContribCnt
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxContribCnt, updContribBoxCnt)
|
| | | GameWorld.DebugLog("更新增加贡献宝箱: addContribCnt=%s,updContribBoxCnt=%s,faContribBoxCnt=%s" % (addContribCnt, updContribBoxCnt, faContribBoxCnt), playerID)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, anger)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt, boxHurtTotal % ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx, boxHurtTotal / ChConfig.Def_PerPointValue)
|
| | | if boxHurtTotal > boxHurtTotalHis:
|
| | | boxHurtTotalHis = boxHurtTotal
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHis, boxHurtTotalHis % ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHisEx, boxHurtTotalHis / ChConfig.Def_PerPointValue)
|
| | | |
| | | awardItemList = []
|
| | | # 常规攻击: 给斩杀攻击奖励,加次数
|
| | | if atkType == AtkType_Normal:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaCnt, atkCnt + 1)
|
| | | atkItemAwardList = IpyGameDataPY.GetFuncEvalCfg("FamilyTaofaAtk", 2) # 每次斩杀获得个人奖励列表 [[物品ID,个数], ...]
|
| | | awardItemList += atkItemAwardList
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["FamilyTaofa", False, {}], isNotifyAward=False)
|
| | | |
| | | # 更新Action记录
|
| | | SetFAAtkTime(actionData, atkTime)
|
| | | SetFAAtkCount(actionData, faAtkCnt)
|
| | | SetFAHurtTotal(actionData, faHurtTotal % ChConfig.Def_PerPointValue)
|
| | | SetFAHurtTotalEx(actionData, faHurtTotal / ChConfig.Def_PerPointValue)
|
| | | SetFAContribBoxCnt(actionData, faContribBoxCnt)
|
| | | atkList = actionData.GetUserDict().get("atkList", [])
|
| | | atkList.append([atkTime, addContribCnt, hurtTotal, atkType])
|
| | | actionData.GetUserDict().update({"atkList":atkList})
|
| | | PlayerFamily.SendFamilyAction([actionData])
|
| | | |
| | | # 同步: 攻击 -> 宝箱 -> 其他
|
| | | SyncTaofaAtkRet(curPlayer, atkType, hurtList, awardItemList)
|
| | | if addContribCnt:
|
| | | RefreshPlayerAwardBoxCnt(curFamily, unSyncIDList=[playerID])
|
| | | SyncTaofaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def GetTaofaBoxAward(curPlayer):
|
| | | boxUnGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt)
|
| | | if not boxUnGetCnt:
|
| | | GameWorld.DebugLog("当前没有可领取的讨伐宝箱!")
|
| | | return
|
| | | awardBoxMax = IpyGameDataPY.GetFuncCfg("FamilyTaofaBox", 3)
|
| | | boxTotalGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt)
|
| | | canGetBoxMax = max(awardBoxMax - boxTotalGetCnt, 0) # 还可领取的箱子数
|
| | | GameWorld.DebugLog("领取宝箱奖励: boxUnGetCnt=%s,canGetBoxMax=%s,boxTotalGetCnt=%s,awardBoxMax=%s" % (boxUnGetCnt, canGetBoxMax, boxTotalGetCnt, awardBoxMax))
|
| | | if boxUnGetCnt > canGetBoxMax:
|
| | | boxUnGetCnt = canGetBoxMax
|
| | | GameWorld.DebugLog("超过可领取上限,修正可领取宝箱数: boxUnGetCnt=%s" % (boxUnGetCnt))
|
| | | |
| | | awardItemDict = {}
|
| | | boxAwardWeightList = IpyGameDataPY.GetFuncEvalCfg("FamilyTaofaBox", 4)
|
| | | for _ in range(boxUnGetCnt):
|
| | | awardItem = GameWorld.GetResultByWeightList(boxAwardWeightList)
|
| | | if not awardItem:
|
| | | continue
|
| | | itemID, itemCount = awardItem
|
| | | awardItemDict[itemID] = awardItemDict.get(itemID, 0) + itemCount
|
| | | awardItemList = [[itemID, itemCount] for itemID, itemCount in awardItemDict.items()]
|
| | | |
| | | updTotalGetCnt = boxTotalGetCnt + boxUnGetCnt
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt, updTotalGetCnt)
|
| | | GameWorld.DebugLog("领取结果: updTotalGetCnt=%s,awardItemList=%s" % (updTotalGetCnt, awardItemList))
|
| | | SyncTaofaInfo(curPlayer)
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["FamilyTaofaBoxAward", False, {}])
|
| | | return
|
| | |
|
| | | def SyncTaofaInfo(curPlayer):
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFamilyTaofaInfo)
|
| | | clientPack.BuZhenState = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBuZhenState)
|
| | | clientPack.AtkCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaCnt)
|
| | | clientPack.ItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt)
|
| | | clientPack.Anger = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaAnger)
|
| | | clientPack.BoxUnGetCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt)
|
| | | clientPack.BoxHurt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt)
|
| | | clientPack.BoxHurtEx = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx)
|
| | | clientPack.BoxHurtHis = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHis)
|
| | | clientPack.BoxHurtHisEx = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtHisEx)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def SyncTaofaAtkRet(curPlayer, atkType, hurtList, awardItemList): |
| | | atkHurtList = []
|
| | | objPool = ObjPool.GetPoolMgr()
|
| | | for totalHurt, isSuper in hurtList:
|
| | | atkHurt = objPool.acquire(ChPyNetSendPack.tagSCFamilyTaofaAtkHurt)
|
| | | atkHurt.IsSuper = isSuper
|
| | | atkHurt.HurtValue = totalHurt % ChConfig.Def_PerPointValue
|
| | | atkHurt.HurtValueEx = totalHurt / ChConfig.Def_PerPointValue
|
| | | atkHurtList.append(atkHurt)
|
| | | |
| | | itemList = []
|
| | | for itemID, itemCount in awardItemList:
|
| | | item = objPool.acquire(ChPyNetSendPack.tagSCFamilyTaofaAtkItem)
|
| | | item.ItemID = itemID
|
| | | item.Count = itemCount
|
| | | itemList.append(item)
|
| | | |
| | | clientPack = objPool.acquire(ChPyNetSendPack.tagSCFamilyTaofaAtkRet)
|
| | | clientPack.AtkType = atkType
|
| | | clientPack.HurtList = atkHurtList
|
| | | clientPack.HurtCount = len(clientPack.HurtList)
|
| | | clientPack.ItemList = itemList
|
| | | clientPack.ItemCount = len(clientPack.ItemList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
| | | curCache.SetOffTime(GameWorld.ChangeTimeStrToNum(dbPlayer.LogoffTime) if dbPlayer.LogoffTime else 0)
|
| | | return curCache
|
| | |
|
| | | def GetPlayerBaseViewInfo(playerID, curPlayer=None):
|
| | | ## 获取玩家基础查看信息
|
| | | baseInfo = {}
|
| | | if not curPlayer:
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if curPlayer:
|
| | | baseInfo = {
|
| | | "Name":curPlayer.GetPlayerName(),
|
| | | "LV":curPlayer.GetLV(),
|
| | | "Job":curPlayer.GetJob(),
|
| | | "RealmLV":curPlayer.GetOfficialRank(),
|
| | | "Face":curPlayer.GetFace(),
|
| | | "FacePic":curPlayer.GetFacePic(),
|
| | | "TitleID":PlayerControl.GetTitleID(curPlayer),
|
| | | "ServerID":GameWorld.GetPlayerServerID(curPlayer),
|
| | | "FightPower":PlayerControl.GetFightPower(curPlayer),
|
| | | }
|
| | | else:
|
| | | viewCache = FindViewCache(playerID)
|
| | | if viewCache:
|
| | | baseInfo = {
|
| | | "Name":viewCache.GetPlayerName(),
|
| | | "LV":viewCache.GetLV(),
|
| | | "Job":viewCache.GetJob(),
|
| | | "RealmLV":viewCache.GetRealmLV(),
|
| | | "Face":viewCache.GetFace(),
|
| | | "FacePic":viewCache.GetFacePic(),
|
| | | "TitleID":viewCache.GetTitleID(),
|
| | | "ServerID":viewCache.GetServerID(),
|
| | | "FightPower":viewCache.GetFightPowerTotal(),
|
| | | }
|
| | | return baseInfo
|
| | |
|
| | | def GetRobotByViewCache(curCache):
|
| | | ## 根据缓存内容获取机器人数据
|
| | | if not curCache:
|
| | |
| | |
|
| | | #通用信息记录类型
|
| | | Def_UniversalGameRecTypeList = (
|
| | | Def_UniversalGameRecType_XMZZPKInfoRecord, # 仙魔之争信息记录0
|
| | | Def_UniversalGameRecType_0, # 仙魔之争信息记录0
|
| | | Def_UniversalGameRecType_1,
|
| | | Def_UniversalGameRecType_XMZZStageRecord, # 仙魔之争阶段记录2
|
| | | Def_UniversalGameRecType_2, # 仙魔之争阶段记录2
|
| | | Def_UniversalGameRecType_LVAwardRecord, #玩家等级奖励记录 3
|
| | | Def_UniversalGameRecType_LimitFBOpenRecord,#限时副本开启时间记录4
|
| | | Def_UniversalGameRecType_DujieHelpCntRecord, # 渡劫副本护法次数5
|
| | |
| | | Def_ActionType_FamilyEmblem, #仙盟时效徽章信息 15
|
| | | Def_ActionType_Zhenbaoge, #珍宝阁 16
|
| | | Def_ActionType_TalkCache, #聊天缓存 17,最大条数配置决定
|
| | | ) = range(0, 18)
|
| | | Def_ActionType_Taofa, #公会讨伐 18
|
| | | ) = range(0, 1 + 18)
|
| | |
|
| | | #家族某行为类型保存的条数
|
| | | ActionTypeSaveCnt = {
|