| | |
| | | list AwardItemList; //奖励物品列表[[物品ID,个数,是否拍品], ...]
|
| | | };
|
| | |
|
| | | //仙盟阵法表
|
| | |
|
| | | struct tagFamilyZhenfa
|
| | | {
|
| | | BYTE _ZhenfaType; // 阵法类型
|
| | | WORD _ZhenfaLV; // 阵法等级
|
| | | DWORD LVUpNeedExp; //升下一级所需经验
|
| | | };
|
| | |
|
| | | //集市查询表
|
| | |
|
| | | struct tagMarketQuery
|
| | |
| | | DWORD CftJobAAtkReducePer; //战士攻击伤害减免
|
| | | DWORD CftJobBAtkReducePer; //法师攻击伤害减免
|
| | | DWORD CftJobCAtkReducePer; //弓箭攻击伤害减免
|
| | | DWORD CftAffairSpeedPer; //仙盟事务速度加成
|
| | | DWORD CftFamilyBossHurtPer; //仙盟BOSS伤害加成
|
| | | DWORD CftFamilyWarHPPer; //仙盟联赛生命加成
|
| | | DWORD CftFamilyWarAtkPer; //仙盟联赛攻击加成
|
| | | DWORD CftFamilySitExpPer; //仙盟打坐经验加成
|
| | | };
|
| | |
|
| | | //NPC掉落表
|
| | |
| | | list AwardItemList; //奖励物品列表[[物品ID,个数,是否拍品], ...]
|
| | | };
|
| | |
|
| | | //仙盟阵法表
|
| | |
|
| | | struct tagFamilyZhenfa
|
| | | {
|
| | | BYTE _ZhenfaType; // 阵法类型
|
| | | WORD _ZhenfaLV; // 阵法等级
|
| | | DWORD LVUpNeedExp; //升下一级所需经验
|
| | | list LVAttrType; //累计总属性类型
|
| | | list LVAttrValue; //累计总属性值
|
| | | };
|
| | |
|
| | | //装备洗练等级上限
|
| | |
|
| | | struct tagItemWashMax
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 14 家族阵法升级 #tagCMFamilyZhenfaLVUP
|
| | |
|
| | | class tagCMFamilyZhenfaLVUP(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ZhenfaType", c_ubyte), # 阵法类型
|
| | | ("ItemID", c_int), # 消耗的物品ID
|
| | | ("ItemCount", c_ushort), # 消耗个数,默认1
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA6
|
| | | self.SubCmd = 0x14
|
| | | 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 = 0x14
|
| | | self.ZhenfaType = 0
|
| | | self.ItemID = 0
|
| | | self.ItemCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMFamilyZhenfaLVUP)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A6 14 家族阵法升级 //tagCMFamilyZhenfaLVUP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ZhenfaType:%d,
|
| | | ItemID:%d,
|
| | | ItemCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ZhenfaType,
|
| | | self.ItemID,
|
| | | self.ItemCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMFamilyZhenfaLVUP=tagCMFamilyZhenfaLVUP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFamilyZhenfaLVUP.Cmd,m_NAtagCMFamilyZhenfaLVUP.SubCmd))] = m_NAtagCMFamilyZhenfaLVUP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A6 02 申请加入家族#tagCGRequesJoinFamily
|
| | |
|
| | | class tagCGRequesJoinFamily(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 09 仙盟阵法信息 #tagMCFamilyZhenfaInfo
|
| | |
|
| | | class tagMCFamilyZhenfa(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ZhenfaType", c_ubyte), # 阵法类型
|
| | | ("ZhenfaLV", c_ushort), # 阵法等级
|
| | | ("ZhenfaExp", 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.ZhenfaType = 0
|
| | | self.ZhenfaLV = 0
|
| | | self.ZhenfaExp = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFamilyZhenfa)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 09 仙盟阵法信息 //tagMCFamilyZhenfaInfo:
|
| | | ZhenfaType:%d,
|
| | | ZhenfaLV:%d,
|
| | | ZhenfaExp:%d
|
| | | '''\
|
| | | %(
|
| | | self.ZhenfaType,
|
| | | self.ZhenfaLV,
|
| | | self.ZhenfaExp
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFamilyZhenfaInfo(Structure):
|
| | | Head = tagHead()
|
| | | PlayerID = 0 #(DWORD PlayerID)// 当前培养阵法的玩家ID,如果有做自动捐献,需等收到的玩家ID为自己的时候才发送下一个捐献包
|
| | | Count = 0 #(BYTE Count)
|
| | | ZhenfaInfoList = list() #(vector<tagMCFamilyZhenfa> ZhenfaInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x09
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temZhenfaInfoList = tagMCFamilyZhenfa()
|
| | | _pos = temZhenfaInfoList.ReadData(_lpData, _pos)
|
| | | self.ZhenfaInfoList.append(temZhenfaInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x09
|
| | | self.PlayerID = 0
|
| | | self.Count = 0
|
| | | self.ZhenfaInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.ZhenfaInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.PlayerID)
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.ZhenfaInfoList[i].GetLength(), self.ZhenfaInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | PlayerID:%d,
|
| | | Count:%d,
|
| | | ZhenfaInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.PlayerID,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFamilyZhenfaInfo=tagMCFamilyZhenfaInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyZhenfaInfo.Head.Cmd,m_NAtagMCFamilyZhenfaInfo.Head.SubCmd))] = m_NAtagMCFamilyZhenfaInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A5 01 查看已申请加入的家族信息 #tagMCNotifyRequestJoinFamilyInfo
|
| | |
|
| | | class tagRequestJoinFamily(Structure):
|
New file |
| | |
| | | #!/usr/bin/python |
| | | # -*- coding: GBK -*- |
| | | #------------------------------------------------------------------------------- |
| | | # |
| | | ##@package GM.Commands.FamilyZhenfa |
| | | # |
| | | # @todo:仙盟阵法 |
| | | # @author hxp |
| | | # @date 2023-10-11 |
| | | # @version 1.0 |
| | | # |
| | | # 详细描述: 仙盟阵法 |
| | | # |
| | | #------------------------------------------------------------------------------- |
| | | #"""Version = 2023-10-11 16:30""" |
| | | #------------------------------------------------------------------------------- |
| | | |
| | | import GameWorld |
| | | import ShareDefine |
| | | import PlayerFamilyZhenfa |
| | | import IpyGameDataPY |
| | | |
| | | ## 执行逻辑 |
| | | # @param curPlayer 当前玩家 |
| | | # @param cmdList 参数列表 |
| | | # @return None |
| | | # @remarks 函数详细说明. |
| | | def OnExec(curPlayer, cmdList): |
| | | if not cmdList: |
| | | GameWorld.DebugAnswer(curPlayer, "重置阵法: FamilyZhenfa 0") |
| | | GameWorld.DebugAnswer(curPlayer, "设置阵法: FamilyZhenfa 类型 等级 经验 可选仙盟ID") |
| | | return |
| | | |
| | | playerID = curPlayer.GetPlayerID() |
| | | familyID = curPlayer.GetFamilyID() |
| | | if not familyID: |
| | | GameWorld.DebugAnswer(curPlayer, "没有仙盟") |
| | | return |
| | | |
| | | value1 = cmdList[0] |
| | | if len(cmdList) == 1 and value1 == 0: |
| | | GameWorld.GetFamilyActionManager().DelFamilyAction(familyID, ShareDefine.Def_ActionType_FamilyZhenfa) |
| | | PlayerFamilyZhenfa.SyncMap_AllFamilyZhenfaInfo() |
| | | return |
| | | |
| | | if len(cmdList) == 3: |
| | | zhenfaType = value1 |
| | | zhenfaLV = cmdList[1] if len(cmdList) > 1 else 0 |
| | | zhenfaExp = cmdList[2] if len(cmdList) > 2 else 0 |
| | | ipyData = IpyGameDataPY.GetIpyGameData("FamilyZhenfa", zhenfaType, zhenfaLV) |
| | | if not ipyData: |
| | | GameWorld.DebugAnswer(curPlayer, "不存在该阵法类型: %s, LV:%s" % (zhenfaType, zhenfaLV)) |
| | | return |
| | | actionData = PlayerFamilyZhenfa.GetFamilyZhenfaData(familyID, zhenfaType) |
| | | PlayerFamilyZhenfa.SetZhenfaLV(actionData, zhenfaLV) |
| | | PlayerFamilyZhenfa.SetZhenfaExp(actionData, zhenfaExp) |
| | | PlayerFamilyZhenfa.SyncMap_FamilyZhenfaInfo(familyID, "GM", {"playerID":playerID, "refreshAttr":True}) |
| | | GameWorld.DebugAnswer(curPlayer, "设置阵法类型: %s, LV:%s, Exp:%s" % (zhenfaType, zhenfaLV, zhenfaExp)) |
| | | |
| | | return |
| | |
| | | import PlayerFairyDomain
|
| | | import IpyGameDataPY
|
| | | import PlayerFamilyParty
|
| | | import PlayerFamilyZhenfa
|
| | | import GameWorldFamilyWar
|
| | | import GameWorldArena
|
| | | import CrossLuckyCloudBuy
|
| | |
| | | SendMapCommMapLinePlayerCount(True) # 同步一次普通地图线路人数信息
|
| | | #随机假仙盟
|
| | | PlayerFamily.RandomFakeFamily()
|
| | | #仙盟阵法
|
| | | PlayerFamilyZhenfa.OnMapServerInitOK()
|
| | | #缥缈仙域
|
| | | PlayerFairyDomain.OnMapServerInitOK()
|
| | | #情侣信息
|
| | |
| | | ("list", "AwardItemList", 0),
|
| | | ),
|
| | |
|
| | | "FamilyZhenfa":(
|
| | | ("BYTE", "ZhenfaType", 1),
|
| | | ("WORD", "ZhenfaLV", 1),
|
| | | ("DWORD", "LVUpNeedExp", 0),
|
| | | ),
|
| | |
|
| | | "MarketQuery":(
|
| | | ("WORD", "QueryType", 1),
|
| | | ("dict", "LimitInfo", 0),
|
| | |
| | | def GetRecordIndex(self): return self.RecordIndex # 奖励记录索引,同奖励类型时记录索引不可重复
|
| | | def GetNeedHurtTotal(self): return self.NeedHurtTotal # 所需总伤血
|
| | | def GetAwardItemList(self): return self.AwardItemList # 奖励物品列表[[物品ID,个数,是否拍品], ...] |
| | | |
| | | # 仙盟阵法表 |
| | | class IPY_FamilyZhenfa(): |
| | | |
| | | def __init__(self): |
| | | self.ZhenfaType = 0
|
| | | self.ZhenfaLV = 0
|
| | | self.LVUpNeedExp = 0 |
| | | return |
| | | |
| | | def GetZhenfaType(self): return self.ZhenfaType # 阵法类型
|
| | | def GetZhenfaLV(self): return self.ZhenfaLV # 阵法等级
|
| | | def GetLVUpNeedExp(self): return self.LVUpNeedExp # 升下一级所需经验 |
| | | |
| | | # 集市查询表 |
| | | class IPY_MarketQuery(): |
| | |
| | | self.ipyFamilyLen = len(self.ipyFamilyCache)
|
| | | self.ipyFamilyBossHurtAwardCache = self.__LoadFileData("FamilyBossHurtAward", IPY_FamilyBossHurtAward)
|
| | | self.ipyFamilyBossHurtAwardLen = len(self.ipyFamilyBossHurtAwardCache)
|
| | | self.ipyFamilyZhenfaCache = self.__LoadFileData("FamilyZhenfa", IPY_FamilyZhenfa)
|
| | | self.ipyFamilyZhenfaLen = len(self.ipyFamilyZhenfaCache)
|
| | | self.ipyMarketQueryCache = self.__LoadFileData("MarketQuery", IPY_MarketQuery)
|
| | | self.ipyMarketQueryLen = len(self.ipyMarketQueryCache)
|
| | | self.ipyAuctionItemCache = self.__LoadFileData("AuctionItem", IPY_AuctionItem)
|
| | |
| | | def GetFamilyByIndex(self, index): return self.ipyFamilyCache[index]
|
| | | def GetFamilyBossHurtAwardCount(self): return self.ipyFamilyBossHurtAwardLen
|
| | | def GetFamilyBossHurtAwardByIndex(self, index): return self.ipyFamilyBossHurtAwardCache[index]
|
| | | def GetFamilyZhenfaCount(self): return self.ipyFamilyZhenfaLen
|
| | | def GetFamilyZhenfaByIndex(self, index): return self.ipyFamilyZhenfaCache[index]
|
| | | def GetMarketQueryCount(self): return self.ipyMarketQueryLen
|
| | | def GetMarketQueryByIndex(self, index): return self.ipyMarketQueryCache[index]
|
| | | def GetAuctionItemCount(self): return self.ipyAuctionItemLen
|
| | |
| | | # @param leavePlayerID 离开的玩家ID
|
| | | # @return None
|
| | | def __DoPlayerLeaveFamilyByID(curFamily, leavePlayerID, tagPlayer=None):
|
| | | PlayerCompensation.SendMailByKey("LeaveFamilyNotice", [leavePlayerID], [])
|
| | | PlayerFamilyAction.DelFamilyOfficerModelEquip(curFamily.GetID(), leavePlayerID)
|
| | | # 玩家战盟名变更处理
|
| | | __OnFamilyNameChange(leavePlayerID, '')
|
New file |
| | |
| | | #!/usr/bin/python |
| | | # -*- coding: GBK -*- |
| | | #------------------------------------------------------------------------------- |
| | | # |
| | | ##@package PlayerFamilyZhenfa |
| | | # |
| | | # @todo:仙盟阵法 |
| | | # @author hxp |
| | | # @date 2023-10-11 |
| | | # @version 1.0 |
| | | # |
| | | # 详细描述: 仙盟阵法 |
| | | # |
| | | #------------------------------------------------------------------------------- |
| | | #"""Version = 2023-10-11 16:30""" |
| | | #------------------------------------------------------------------------------- |
| | | |
| | | import ShareDefine |
| | | import IpyGameDataPY |
| | | import GameWorld |
| | | |
| | | ActionType_FamilyZhenfa = ShareDefine.Def_ActionType_FamilyZhenfa |
| | | |
| | | def GetZhenfaType(actionData): return actionData.GetValue1() |
| | | def SetZhenfaType(actionData, zhenfaType): actionData.SetValue1(zhenfaType) |
| | | def GetZhenfaLV(actionData): return actionData.GetValue2() |
| | | def SetZhenfaLV(actionData, lv): actionData.SetValue2(lv) |
| | | def GetZhenfaExp(actionData): return actionData.GetValue3() |
| | | def SetZhenfaExp(actionData, exp): actionData.SetValue3(exp) |
| | | |
| | | ## 玩家登录 |
| | | # @param None |
| | | # @return None |
| | | def OnPlayerLogin(curPlayer): |
| | | return |
| | | |
| | | def GetFamilyZhenfaData(familyID, zhenfaType): |
| | | ## 获取仙盟阵法数据 |
| | | findActionData = None |
| | | zhenfaAction = GameWorld.GetFamilyActionManager().GetFamilyAction(familyID, ActionType_FamilyZhenfa) |
| | | for index in range(zhenfaAction.Count()): |
| | | actionData = zhenfaAction.At(index) |
| | | if zhenfaType == GetZhenfaType(actionData): |
| | | findActionData = actionData |
| | | break |
| | | if not findActionData: |
| | | findActionData = zhenfaAction.AddAction() |
| | | findActionData.SetFamilyId(familyID) |
| | | findActionData.SetActionType(ActionType_FamilyZhenfa) |
| | | SetZhenfaType(findActionData, zhenfaType) |
| | | return findActionData |
| | | |
| | | def MapServer_FamilyZhenfa(curPlayer, msgList): |
| | | familyID, playerID, msgType, msgData = msgList |
| | | |
| | | # 加经验 |
| | | if msgType == "AddExp": |
| | | __DoFamilyZhenfa_AddExp(familyID, playerID, msgType, msgData) |
| | | |
| | | return |
| | | |
| | | def __DoFamilyZhenfa_AddExp(familyID, playerID, msgType, msgData): |
| | | zhenfaType, addTotalExp = msgData |
| | | |
| | | actionData = GetFamilyZhenfaData(familyID, zhenfaType) |
| | | zhenfaLV = GetZhenfaLV(actionData) |
| | | zhenfaExp = GetZhenfaExp(actionData) |
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("FamilyZhenfa", zhenfaType, zhenfaLV) |
| | | if not ipyData: |
| | | return |
| | | LVUpNeedExp = ipyData.GetLVUpNeedExp() |
| | | if not LVUpNeedExp: |
| | | GameWorld.DebugLog("该阵法已满级:familyID=%s,zhenfaType=%s,zhenfaLV=%s" % (familyID, zhenfaType, zhenfaLV), playerID) |
| | | return |
| | | |
| | | curExp = zhenfaExp + addTotalExp |
| | | GameWorld.DebugLog("执行阵法升级: familyID=%s,zhenfaType=%s,zhenfaLV=%s,zhenfaExp=%s,addTotalExp=%s,curExp=%s" |
| | | % (familyID, zhenfaType, zhenfaLV, zhenfaExp, addTotalExp, curExp), playerID) |
| | | |
| | | isLVUP = False |
| | | # 安全为主不用while |
| | | for _ in xrange(100): |
| | | if not LVUpNeedExp or curExp < LVUpNeedExp: |
| | | break |
| | | ipyData = IpyGameDataPY.GetIpyGameData("FamilyZhenfa", zhenfaType, zhenfaLV + 1) |
| | | if not ipyData: |
| | | break |
| | | |
| | | curExp = curExp - LVUpNeedExp |
| | | zhenfaLV += 1 |
| | | isLVUP = True |
| | | GameWorld.DebugLog(" 阵法升级: LVUpNeedExp=%s,zhenfaLV=%s,curExp=%s" % (LVUpNeedExp, zhenfaLV, curExp), playerID) |
| | | |
| | | LVUpNeedExp = ipyData.GetLVUpNeedExp() |
| | | |
| | | SetZhenfaLV(actionData, zhenfaLV) |
| | | SetZhenfaExp(actionData, curExp) |
| | | GameWorld.DebugLog(" 更新阵法: familyID=%s,zhenfaType=%s,zhenfaLV=%s,curExp=%s" % (familyID, zhenfaType, zhenfaLV, curExp), playerID) |
| | | |
| | | # 同步地图 |
| | | SyncMap_FamilyZhenfaInfo(familyID, msgType, {"playerID":playerID, "refreshAttr":isLVUP}) |
| | | return |
| | | |
| | | def GetSyncMapFamilyZhenfaInfo(familyID): |
| | | info = {} |
| | | zhenfaAction = GameWorld.GetFamilyActionManager().GetFamilyAction(familyID, ActionType_FamilyZhenfa) |
| | | for index in range(zhenfaAction.Count()): |
| | | actionData = zhenfaAction.At(index) |
| | | zhenfaType = GetZhenfaType(actionData) |
| | | info[zhenfaType] = {"LV":GetZhenfaLV(actionData), "Exp":GetZhenfaExp(actionData)} |
| | | return info |
| | | |
| | | def SyncMap_FamilyZhenfaInfo(familyID, msgType, dataEx={}): |
| | | ## 同步单个仙盟所有阵法信息到地图 |
| | | zhenfaInfo = {familyID:GetSyncMapFamilyZhenfaInfo(familyID)} |
| | | syncDict = {"zhenfaInfo":zhenfaInfo, "msgType":msgType, "familyID":familyID} |
| | | syncDict.update(dataEx) |
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FamilyZhenfaInfo, syncDict) |
| | | return |
| | | |
| | | def SyncMap_AllFamilyZhenfaInfo(): |
| | | ## 同步所有仙盟阵法信息到地图 |
| | | zhenfaInfo = {} |
| | | familyManager = GameWorld.GetFamilyManager() |
| | | for i in range(familyManager.GetCount()): |
| | | family = familyManager.GetAt(i) |
| | | familyID = family.GetID() |
| | | if not familyID: |
| | | continue |
| | | info = GetSyncMapFamilyZhenfaInfo(familyID) |
| | | if info: |
| | | zhenfaInfo[familyID] = info |
| | | syncDict = {"zhenfaInfo":zhenfaInfo, "msgType":"allFamily"} |
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FamilyZhenfaInfo, syncDict) |
| | | return |
| | | |
| | | def OnMapServerInitOK(): |
| | | SyncMap_AllFamilyZhenfaInfo() |
| | | return |
| | |
| | | import GameWorldBoss
|
| | | import GameWorldFamilyWar
|
| | | #import PlayerFamilyTech
|
| | | import PlayerFamilyZhenfa
|
| | | import PlayerFamilyRedPacket
|
| | | import PlayerFBHelpBattle
|
| | | import PlayerHorsePetBoss
|
| | |
| | | if callName =="AllFamilyBossOver":
|
| | | PlayerFamilyBoss.AllFamilyBossKilled()
|
| | | return
|
| | | #仙盟阵法
|
| | | if callName =="FamilyZhenfa":
|
| | | curPlayer = None
|
| | | if srcPlayerID:
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | if not curPlayer:
|
| | | return
|
| | | PlayerFamilyZhenfa.MapServer_FamilyZhenfa(curPlayer, eval(resultName))
|
| | | return
|
| | | #骑宠BOSS结束
|
| | | if callName =="HorsePetBossOver":
|
| | | PlayerHorsePetBoss.HorsePetBossKilled(int(resultName))
|
| | |
| | |
|
| | | Def_Notify_WorldKey_FamilyPartyInfo = "FamilyPartyInfo" # 仙盟宴会数据
|
| | | Def_Notify_WorldKey_FamilyPartyAddFamilyActivity = "FamilyPartyAddFamilyActivity" # 仙盟宴会地图成员增加仙盟活跃令
|
| | | Def_Notify_WorldKey_FamilyZhenfaInfo = "FamilyZhenfaInfo" # 仙盟阵法数据
|
| | |
|
| | | Def_Notify_WorldKey_AddFamilyAuctionItem = "AddFamilyAuctionItem" # 添加仙盟拍品
|
| | | Def_Notify_WorldKey_AddSystemAuctionItem = "AddSystemAuctionItem" # 添加系统拍品
|
| | |
| | | Def_Effect_PeerlessWeaponTrainAttrPer = 158 # 灭世培养属性加成(攻防血)
|
| | | Def_Effect_PeerlessWeapon2TrainAttrPer = 159 # 弑神培养属性加成(攻防血)
|
| | | Def_Effect_LianTiAttrPer = 160 # 炼体属性百分比(攻防血)
|
| | |
|
| | | Def_Effect_AffairSpeedPer = 161 # 仙盟事务速度加成
|
| | | Def_Effect_FamilyBossHurtPer = 162 # 仙盟BOSS伤害加成
|
| | | Def_Effect_FamilyWarHPPer = 163 # 仙盟联赛生命加成
|
| | | Def_Effect_FamilyWarAtkPer = 164 # 仙盟联赛攻击加成
|
| | | Def_Effect_FamilySitExpPer = 165 # 仙盟打坐经验加成
|
| | |
|
| | | #增加%d物理伤害值,其中a值为伤害值
|
| | | Def_Effect_AddAtk = 1005
|
| | |
| | | Def_ActionType_LeaderImpeachTime, # 族长下线了多久5
|
| | | Def_ActionType_FamilyBossFB, #记录家族boss副本信息6
|
| | | Def_ActionType_FamilyStore, #记录战盟仓库操作记录7
|
| | | Def_ActionType_XXX8, #8
|
| | | Def_ActionType_FamilyZhenfa, #仙盟阵法8
|
| | | Def_ActionType_XXX9, #9
|
| | | Def_ActionType_XXX10, #10
|
| | | Def_ActionType_OfficerModelEquip, #记录家族有职位的成员模型装备信息11
|
| | |
| | | )=range(5)
|
| | |
|
| | | # 战斗力模块类型
|
| | | Def_MFPType_Max = 32
|
| | | Def_MFPType_Max = 33
|
| | | ModuleFightPowerTypeList = (
|
| | | Def_MFPType_Role, # 角色 0
|
| | | Def_MFPType_Equip, # 装备(装备本身) 1
|
| | |
| | | Def_MFPType_Enchant, # 附魔 28
|
| | | Def_MFPType_Gubao, # 古宝 29
|
| | | Def_MFPType_Shentong, # 神通 30
|
| | | Def_MFPType_FamilyZhenfa, # 阵法 31
|
| | | Def_MFPType_Other, # 其他
|
| | | ) = range(Def_MFPType_Max)
|
| | |
|
| | |
| | | SuccType_EquipStarTotal, # 全身升星总星数X星 174
|
| | | SuccType_EquipWashTotal, # 全身洗炼总等级X级 175
|
| | | SuccType_CrossPK, # 跨服PK x次 176
|
| | | ) = range(1, 177)
|
| | | SuccType_FamilyZhenfaExp, # 仙盟阵法捐献累计经验 177
|
| | | ) = range(1, 178)
|
| | |
|
| | | # 节日红包成就类型
|
| | | FeastRedPackSuccessTypeList = range(SuccType_FeastRedPack_TalkWorld, SuccType_FeastRedPack_FBSweep + 1)
|
| | |
| | | PacketSubCMD_1=0x07
|
| | | PacketCallFunc_1=OnPlayerFamilyTechLVUP
|
| | |
|
| | | ;家族阵法
|
| | | [PlayerFamilyZhenfa]
|
| | | ScriptName = Player\PlayerFamilyZhenfa.py
|
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 1
|
| | |
|
| | | PacketCMD_1=0xA6
|
| | | PacketSubCMD_1=0x14
|
| | | PacketCallFunc_1=OnFamilyZhenfaLVUP
|
| | |
|
| | | ;宠物
|
| | | [PlayerPet]
|
| | | ScriptName = Player\PlayerPet.py
|
| | |
| | | if findBuff:
|
| | | reduceFinalHurtPer = findBuff.GetSkill().GetEffect(0).GetEffectValue(0)
|
| | | aFinalHurtPer -= reduceFinalHurtPer
|
| | | |
| | | |
| | | # 仙盟boss最终伤害加成
|
| | | if atkObjType == IPY_GameWorld.gotPlayer and mapID == ChConfig.Def_FBMapID_FamilyBossMap:
|
| | | aFinalHurtPer += PlayerControl.GetFamilyBossHurtPer(atkObj)
|
| | | |
| | | atkStateMark = GetObjAtkStateMark(atkObj)
|
| | | defStateMark = GetObjAtkStateMark(defObj)
|
| | | hurtFormulaKey = "%sV%s_%s" % (atkStateMark, defStateMark, atkType)
|
| | |
| | | Def_BuffValue_Count = 3 # buff记录的value个数
|
| | |
|
| | | #游戏对象属性--------------------------------------------
|
| | | Def_Calc_AllAttrType_MAX = 160
|
| | | Def_Calc_AllAttrType_MAX = 166
|
| | | #基本属性BUFF计算,顺序与 ObjProperty_AttrByIndex 对应,同时也为buff效果ID同步通知策划
|
| | | TYPE_Calc_AttrList = (
|
| | | TYPE_Calc_Metal, # 金 1
|
| | |
| | | TYPE_Calc_WingTrainAttrPer, # 翅膀培养属性加成(攻防血)
|
| | | TYPE_Calc_PeerlessWeaponTrainAttrPer, # 灭世培养属性加成(攻防血)
|
| | | TYPE_Calc_PeerlessWeapon2TrainAttrPer, # 弑神培养属性加成(攻防血)
|
| | | TYPE_Calc_LianTiAttrPer, # 坐骑培养属性加成(攻防血) 159
|
| | | TYPE_Calc_LianTiAttrPer, # 炼体属性百分比(攻防血) 159
|
| | | TYPE_Calc_160, # 160
|
| | | TYPE_Calc_AffairSpeedPer, # 仙盟事务速度加成
|
| | | TYPE_Calc_FamilyBossHurtPer, # 仙盟BOSS伤害加成
|
| | | TYPE_Calc_FamilyWarHPPer, # 仙盟联赛生命加成
|
| | | TYPE_Calc_FamilyWarAtkPer, # 仙盟联赛攻击加成
|
| | | TYPE_Calc_FamilySitExpPer, # 仙盟打坐经验加成 165
|
| | | ) = range(1, Def_Calc_AllAttrType_MAX)
|
| | |
|
| | | ## 支持大数值属性,超过20E
|
| | |
| | | 1000 * 10, # 幸运云购
|
| | | 1000 * 10, # 跨服排位
|
| | | 1000 * 10, # 跨服妖魔boss
|
| | | 1000 * 10, # 仙盟阵法
|
| | | ]
|
| | | TYPE_Player_Tick_Count = len(TYPE_Player_Tick_Time)
|
| | |
|
| | |
| | | TYPE_Player_Tick_LuckyCloudBuy, #幸运云购
|
| | | TYPE_Player_Tick_Championship, #跨服排位
|
| | | TYPE_Player_Tick_CrossYaomoBoss, #跨服妖魔boss
|
| | | TYPE_Player_Tick_FamilyZhenfa, #仙盟阵法
|
| | | ) = range(0, TYPE_Player_Tick_Count)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | Def_PlayerKey_PeerlessWeaponTrainAttrPer = "PeerlessWeaponTrainAttrPer" # 灭世培养属性加成
|
| | | Def_PlayerKey_PeerlessWeapon2TrainAttrPer = "PeerlessWeapon2TrainAttrPer" # 弑神培养属性加成
|
| | | Def_PlayerKey_LianTiAttrPer = "LianTiAttrPer" # 炼体属性属性加成
|
| | | Def_PlayerKey_AffairSpeedPer = "AffairSpeedPer" # 仙盟事务速度加成
|
| | | Def_PlayerKey_FamilyBossHurtPer = "FamilyBossHurtPer" # 仙盟BOSS伤害加成
|
| | | Def_PlayerKey_FamilyWarHPPer = "FamilyWarHPPer" # 仙盟联赛生命加成
|
| | | Def_PlayerKey_FamilyWarAtkPer = "FamilyWarAtkPer" # 仙盟联赛攻击加成
|
| | | Def_PlayerKey_FamilySitExpPer = "FamilySitExpPer" # 仙盟打坐经验加成
|
| | | Def_PlayerKey_StoneBasePer = "StoneBasePer" # 宝石基础属性百分比
|
| | | Def_PlayerKey_RealmBasePer = "RealmBasePer" # 境界基础属性百分比
|
| | | Def_PlayerKey_WingHPPer = "WingHPPer" # 翅膀生命百分比
|
| | |
| | | ShareDefine.Def_Effect_SkillReducePer5:[[TYPE_Calc_SkillReducePer5], False, TYPE_Linear], # 受到技能伤害减少5
|
| | | ShareDefine.Def_Effect_SkillReducePer6:[[TYPE_Calc_SkillReducePer6], False, TYPE_Linear], # 受到技能伤害减少6
|
| | | ShareDefine.Def_Effect_SkillReducePer7:[[TYPE_Calc_SkillReducePer7], False, TYPE_Linear], # 受到技能伤害减少7
|
| | | ShareDefine.Def_Effect_AffairSpeedPer:[[TYPE_Calc_AffairSpeedPer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_FamilyBossHurtPer:[[TYPE_Calc_FamilyBossHurtPer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_FamilyWarHPPer:[[TYPE_Calc_FamilyWarHPPer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_FamilyWarAtkPer:[[TYPE_Calc_FamilyWarAtkPer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_FamilySitExpPer:[[TYPE_Calc_FamilySitExpPer], False, TYPE_Linear],
|
| | |
|
| | | #战斗非线性
|
| | | ShareDefine.Def_Effect_SuperHitPer:[[TYPE_Calc_SuperHit], False, TYPE_NoLinear],
|
| | |
| | | ShareDefine.Def_Effect_JadeAddPer: [ShareDefine.retJade, [ShareDefine.Def_Effect_Atk, ShareDefine.Def_Effect_MinAtk, ShareDefine.Def_Effect_MaxAtk, ShareDefine.Def_Effect_MaxHP]],
|
| | | }
|
| | |
|
| | | # 指定地图生效的非线性属性配置
|
| | | MapAttrInfoDict_Noline = {
|
| | | Def_FBMapID_FamilyWar:{
|
| | | TYPE_Calc_FamilyWarAtkPer:[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax],
|
| | | TYPE_Calc_FamilyWarHPPer:[TYPE_Calc_AttrMaxHP],
|
| | | }
|
| | | }
|
| | |
|
| | | #属性线性索引
|
| | | CalcAttrIndexList = (
|
| | | CalcAttr_Base,
|
| | |
| | | Def_CalcAttrFunc_HorseStar, # 坐骑星级 57
|
| | | Def_CalcAttrFunc_PetStar, # 灵宠星级 58
|
| | | Def_CalcAttrFunc_TitleStar, # 称号星级 59
|
| | | ) = range(60)
|
| | | Def_CalcAttrFunc_FamilyZhenfa, # 仙盟阵法 60
|
| | | ) = range(61)
|
| | |
|
| | | # 技能功能点列表 - 默认不算战力,不享受百分比加成,技能功能点暂时配置,之后优化技能属性逻辑后可去掉
|
| | | CalcAttrFuncSkillList = [Def_CalcAttrFunc_HorseSkill, Def_CalcAttrFunc_PetSkill, Def_CalcAttrFunc_DogzBattleSkill]
|
| | |
| | | ShareDefine.Def_MFPType_GatherSoul:[Def_CalcAttrFunc_GatherSoul],
|
| | | ShareDefine.Def_MFPType_Coat:[Def_CalcAttrFunc_Coat],
|
| | | ShareDefine.Def_MFPType_Dogz:[Def_CalcAttrFunc_Dogz, Def_CalcAttrFunc_DogzEquip, Def_CalcAttrFunc_DogzEquipPlus, Def_CalcAttrFunc_DogzBattleSkill],
|
| | | ShareDefine.Def_MFPType_FamilyZhenfa:[Def_CalcAttrFunc_FamilyZhenfa],
|
| | | ShareDefine.Def_MFPType_Other:[Def_CalcAttrFunc_Success, Def_CalcAttrFunc_FamilyTech, Def_CalcAttrFunc_EquipDecompose],
|
| | | }
|
| | |
|
| | |
| | | ShareDefine.Def_MFPType_MagicWeapon1:"人族", ShareDefine.Def_MFPType_MagicWeapon2:"魔族", ShareDefine.Def_MFPType_MagicWeapon3:"仙族", ShareDefine.Def_MFPType_MagicWeapon4:"王者",
|
| | | ShareDefine.Def_MFPType_PetSoul:"宠魂", ShareDefine.Def_MFPType_HorseSoul:"骑魂", ShareDefine.Def_MFPType_FaQi:"法器", ShareDefine.Def_MFPType_Dogz:"神兽",
|
| | | ShareDefine.Def_MFPType_Coat:"时装", ShareDefine.Def_MFPType_Love:"情缘", ShareDefine.Def_MFPType_Charm:"魅力", ShareDefine.Def_MFPType_LianTi:"炼体",
|
| | | ShareDefine.Def_MFPType_Enchant:"附魔", ShareDefine.Def_MFPType_Gubao:"古宝", ShareDefine.Def_MFPType_Shentong:"神通", |
| | | ShareDefine.Def_MFPType_Enchant:"附魔", ShareDefine.Def_MFPType_Gubao:"古宝", ShareDefine.Def_MFPType_Shentong:"神通", ShareDefine.Def_MFPType_FamilyZhenfa:"阵法", |
| | | ShareDefine.Def_MFPType_Other:"其他",
|
| | | }
|
| | |
|
| | |
| | | Def_CalcAttrFunc_WingTarin:"翅膀培养", Def_CalcAttrFunc_PeerlessWeaponTrain:"灭世培养", Def_CalcAttrFunc_PeerlessWeapon2Train:"噬魂培养", Def_CalcAttrFunc_FaQi:"法器",
|
| | | Def_CalcAttrFunc_LoveRing:"情戒基础", Def_CalcAttrFunc_LoveRingCouple:"情戒仙侣", Def_CalcAttrFunc_Charm:"魅力", Def_CalcAttrFunc_LianTi:"炼体",
|
| | | Def_CalcAttrFunc_Enchant:"附魔", Def_CalcAttrFunc_LingQiEnchant:"灵器附魔", Def_CalcAttrFunc_Gubao:"古宝", Def_CalcAttrFunc_Shentong:"神通",
|
| | | Def_CalcAttrFunc_HorseStar:"坐骑星级", Def_CalcAttrFunc_PetStar:"宠物星级", Def_CalcAttrFunc_TitleStar:"称号星级",
|
| | | Def_CalcAttrFunc_HorseStar:"坐骑星级", Def_CalcAttrFunc_PetStar:"宠物星级", Def_CalcAttrFunc_TitleStar:"称号星级", Def_CalcAttrFunc_FamilyZhenfa:"阵法",
|
| | | }
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 14 家族阵法升级 #tagCMFamilyZhenfaLVUP
|
| | |
|
| | | class tagCMFamilyZhenfaLVUP(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ZhenfaType", c_ubyte), # 阵法类型
|
| | | ("ItemID", c_int), # 消耗的物品ID
|
| | | ("ItemCount", c_ushort), # 消耗个数,默认1
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA6
|
| | | self.SubCmd = 0x14
|
| | | 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 = 0x14
|
| | | self.ZhenfaType = 0
|
| | | self.ItemID = 0
|
| | | self.ItemCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMFamilyZhenfaLVUP)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A6 14 家族阵法升级 //tagCMFamilyZhenfaLVUP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ZhenfaType:%d,
|
| | | ItemID:%d,
|
| | | ItemCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ZhenfaType,
|
| | | self.ItemID,
|
| | | self.ItemCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMFamilyZhenfaLVUP=tagCMFamilyZhenfaLVUP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFamilyZhenfaLVUP.Cmd,m_NAtagCMFamilyZhenfaLVUP.SubCmd))] = m_NAtagCMFamilyZhenfaLVUP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A6 02 申请加入家族#tagCGRequesJoinFamily
|
| | |
|
| | | class tagCGRequesJoinFamily(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 09 仙盟阵法信息 #tagMCFamilyZhenfaInfo
|
| | |
|
| | | class tagMCFamilyZhenfa(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ZhenfaType", c_ubyte), # 阵法类型
|
| | | ("ZhenfaLV", c_ushort), # 阵法等级
|
| | | ("ZhenfaExp", 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.ZhenfaType = 0
|
| | | self.ZhenfaLV = 0
|
| | | self.ZhenfaExp = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFamilyZhenfa)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 09 仙盟阵法信息 //tagMCFamilyZhenfaInfo:
|
| | | ZhenfaType:%d,
|
| | | ZhenfaLV:%d,
|
| | | ZhenfaExp:%d
|
| | | '''\
|
| | | %(
|
| | | self.ZhenfaType,
|
| | | self.ZhenfaLV,
|
| | | self.ZhenfaExp
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFamilyZhenfaInfo(Structure):
|
| | | Head = tagHead()
|
| | | PlayerID = 0 #(DWORD PlayerID)// 当前培养阵法的玩家ID,如果有做自动捐献,需等收到的玩家ID为自己的时候才发送下一个捐献包
|
| | | Count = 0 #(BYTE Count)
|
| | | ZhenfaInfoList = list() #(vector<tagMCFamilyZhenfa> ZhenfaInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x09
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temZhenfaInfoList = tagMCFamilyZhenfa()
|
| | | _pos = temZhenfaInfoList.ReadData(_lpData, _pos)
|
| | | self.ZhenfaInfoList.append(temZhenfaInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x09
|
| | | self.PlayerID = 0
|
| | | self.Count = 0
|
| | | self.ZhenfaInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.ZhenfaInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.PlayerID)
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.ZhenfaInfoList[i].GetLength(), self.ZhenfaInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | PlayerID:%d,
|
| | | Count:%d,
|
| | | ZhenfaInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.PlayerID,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFamilyZhenfaInfo=tagMCFamilyZhenfaInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyZhenfaInfo.Head.Cmd,m_NAtagMCFamilyZhenfaInfo.Head.SubCmd))] = m_NAtagMCFamilyZhenfaInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A5 01 查看已申请加入的家族信息 #tagMCNotifyRequestJoinFamilyInfo
|
| | |
|
| | | class tagRequestJoinFamily(Structure):
|
| | |
| | | ("DWORD", "CftJobAAtkReducePer", 0),
|
| | | ("DWORD", "CftJobBAtkReducePer", 0),
|
| | | ("DWORD", "CftJobCAtkReducePer", 0),
|
| | | ("DWORD", "CftAffairSpeedPer", 0),
|
| | | ("DWORD", "CftFamilyBossHurtPer", 0),
|
| | | ("DWORD", "CftFamilyWarHPPer", 0),
|
| | | ("DWORD", "CftFamilyWarAtkPer", 0),
|
| | | ("DWORD", "CftFamilySitExpPer", 0),
|
| | | ),
|
| | |
|
| | | "NPCDropItem":(
|
| | |
| | | ("list", "AwardItemList", 0),
|
| | | ),
|
| | |
|
| | | "FamilyZhenfa":(
|
| | | ("BYTE", "ZhenfaType", 1),
|
| | | ("WORD", "ZhenfaLV", 1),
|
| | | ("DWORD", "LVUpNeedExp", 0),
|
| | | ("list", "LVAttrType", 0),
|
| | | ("list", "LVAttrValue", 0),
|
| | | ),
|
| | |
|
| | | "ItemWashMax":(
|
| | | ("BYTE", "Type", 1),
|
| | | ("BYTE", "Star", 1),
|
| | |
| | | self.CftJobCHurtAddPer = 0
|
| | | self.CftJobAAtkReducePer = 0
|
| | | self.CftJobBAtkReducePer = 0
|
| | | self.CftJobCAtkReducePer = 0 |
| | | self.CftJobCAtkReducePer = 0
|
| | | self.CftAffairSpeedPer = 0
|
| | | self.CftFamilyBossHurtPer = 0
|
| | | self.CftFamilyWarHPPer = 0
|
| | | self.CftFamilyWarAtkPer = 0
|
| | | self.CftFamilySitExpPer = 0 |
| | | return |
| | | |
| | | def GetLV(self): return self.LV # 等级
|
| | |
| | | def GetCftJobCHurtAddPer(self): return self.CftJobCHurtAddPer # 对目标弓箭伤害加成
|
| | | def GetCftJobAAtkReducePer(self): return self.CftJobAAtkReducePer # 战士攻击伤害减免
|
| | | def GetCftJobBAtkReducePer(self): return self.CftJobBAtkReducePer # 法师攻击伤害减免
|
| | | def GetCftJobCAtkReducePer(self): return self.CftJobCAtkReducePer # 弓箭攻击伤害减免 |
| | | def GetCftJobCAtkReducePer(self): return self.CftJobCAtkReducePer # 弓箭攻击伤害减免
|
| | | def GetCftAffairSpeedPer(self): return self.CftAffairSpeedPer # 仙盟事务速度加成
|
| | | def GetCftFamilyBossHurtPer(self): return self.CftFamilyBossHurtPer # 仙盟BOSS伤害加成
|
| | | def GetCftFamilyWarHPPer(self): return self.CftFamilyWarHPPer # 仙盟联赛生命加成
|
| | | def GetCftFamilyWarAtkPer(self): return self.CftFamilyWarAtkPer # 仙盟联赛攻击加成
|
| | | def GetCftFamilySitExpPer(self): return self.CftFamilySitExpPer # 仙盟打坐经验加成 |
| | | |
| | | # NPC掉落表 |
| | | class IPY_NPCDropItem(): |
| | |
| | | def GetNeedHurtTotal(self): return self.NeedHurtTotal # 所需总伤血
|
| | | def GetAwardItemList(self): return self.AwardItemList # 奖励物品列表[[物品ID,个数,是否拍品], ...] |
| | | |
| | | # 仙盟阵法表 |
| | | class IPY_FamilyZhenfa(): |
| | | |
| | | def __init__(self): |
| | | self.ZhenfaType = 0
|
| | | self.ZhenfaLV = 0
|
| | | self.LVUpNeedExp = 0
|
| | | self.LVAttrType = []
|
| | | self.LVAttrValue = [] |
| | | return |
| | | |
| | | def GetZhenfaType(self): return self.ZhenfaType # 阵法类型
|
| | | def GetZhenfaLV(self): return self.ZhenfaLV # 阵法等级
|
| | | def GetLVUpNeedExp(self): return self.LVUpNeedExp # 升下一级所需经验
|
| | | def GetLVAttrType(self): return self.LVAttrType # 累计总属性类型
|
| | | def GetLVAttrValue(self): return self.LVAttrValue # 累计总属性值 |
| | | |
| | | # 装备洗练等级上限 |
| | | class IPY_ItemWashMax(): |
| | | |
| | |
| | | self.ipyFamilyBossAwardLen = len(self.ipyFamilyBossAwardCache)
|
| | | self.ipyFamilyBossHurtAwardCache = self.__LoadFileData("FamilyBossHurtAward", IPY_FamilyBossHurtAward)
|
| | | self.ipyFamilyBossHurtAwardLen = len(self.ipyFamilyBossHurtAwardCache)
|
| | | self.ipyFamilyZhenfaCache = self.__LoadFileData("FamilyZhenfa", IPY_FamilyZhenfa)
|
| | | self.ipyFamilyZhenfaLen = len(self.ipyFamilyZhenfaCache)
|
| | | self.ipyItemWashMaxCache = self.__LoadFileData("ItemWashMax", IPY_ItemWashMax)
|
| | | self.ipyItemWashMaxLen = len(self.ipyItemWashMaxCache)
|
| | | self.ipyHorsePetBossAwardCache = self.__LoadFileData("HorsePetBossAward", IPY_HorsePetBossAward)
|
| | |
| | | def GetFamilyBossAwardByIndex(self, index): return self.ipyFamilyBossAwardCache[index]
|
| | | def GetFamilyBossHurtAwardCount(self): return self.ipyFamilyBossHurtAwardLen
|
| | | def GetFamilyBossHurtAwardByIndex(self, index): return self.ipyFamilyBossHurtAwardCache[index]
|
| | | def GetFamilyZhenfaCount(self): return self.ipyFamilyZhenfaLen
|
| | | def GetFamilyZhenfaByIndex(self, index): return self.ipyFamilyZhenfaCache[index]
|
| | | def GetItemWashMaxCount(self): return self.ipyItemWashMaxLen
|
| | | def GetItemWashMaxByIndex(self, index): return self.ipyItemWashMaxCache[index]
|
| | | def GetHorsePetBossAwardCount(self): return self.ipyHorsePetBossAwardLen
|
| | |
| | | import PlayerVip
|
| | | import PlayerRefineStove
|
| | | import PlayerFamilyTech
|
| | | import PlayerFamilyZhenfa
|
| | | import PlayerCostRebate
|
| | | import PlayerActGarbageSorting
|
| | | import GY_Query_CrossRealmReg
|
| | |
| | | JobAAtkReducePer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_JobAAtkReducePer) * fpParam.GetCftJobAAtkReducePer() # 战士攻击伤害减免
|
| | | JobBAtkReducePer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_JobBAtkReducePer) * fpParam.GetCftJobBAtkReducePer() # 法师攻击伤害减免
|
| | | JobCAtkReducePer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_JobCAtkReducePer) * fpParam.GetCftJobCAtkReducePer() # 弓箭攻击伤害减免
|
| | | AffairSpeedPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AffairSpeedPer) * fpParam.GetCftAffairSpeedPer() # 仙盟事务速度加成
|
| | | FamilyBossHurtPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FamilyBossHurtPer) * fpParam.GetCftFamilyBossHurtPer() # 仙盟BOSS伤害加成
|
| | | FamilyWarHPPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FamilyWarHPPer) * fpParam.GetCftFamilyWarHPPer() # 仙盟联赛生命加成
|
| | | FamilyWarAtkPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FamilyWarAtkPer) * fpParam.GetCftFamilyWarAtkPer() # 仙盟联赛攻击加成
|
| | | FamilySitExpPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FamilySitExpPer) * fpParam.GetCftFamilySitExpPer() # 仙盟打坐经验加成
|
| | |
|
| | | NormalHurt = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_NormalHurt)
|
| | | NormalHurtPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_NormalHurtPer) * fpParam.GetCftNormalHurtPer() # 普通附加伤害加成
|
| | |
| | | PlayerCharm.CalcCharmAttr(curPlayer)
|
| | | PlayerLianTi.CalcLianTiAttr(curPlayer)
|
| | | PlayerShentong.CalcShentongAttr(curPlayer)
|
| | | PlayerFamilyZhenfa.CalcZhenfaAttr(curPlayer)
|
| | | self.RefreshAllState(isForce=True)
|
| | | GameWorld.DebugLog("End ReCalcAllState!!!")
|
| | | return
|
| | |
| | |
|
| | | # 层非线性战斗属性累加
|
| | | battleNolineAttrBuff = allAttrListBuffs[ChConfig.CalcAttr_BattleNoline]
|
| | | CalcNoLineEffect.AddPlayerMapAttrNolineEffect(curPlayer, battleNolineAttrBuff)
|
| | | CalcNoLineEffect.ChangePlayerAttrInNoLineEffectList(curPlayer, battleNolineAttrBuff, isBuffAttr=True)
|
| | |
|
| | | battleAttrBuff = allAttrListBuffs[ChConfig.CalcAttr_Battle]
|
| | |
| | | def GetLianTiAttrPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_LianTiAttrPer)
|
| | | def SetLianTiAttrPer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_LianTiAttrPer, value)
|
| | |
|
| | | def GetAttr160(curPlayer): return 0
|
| | | def SetAttr160(curPlayer, value): pass
|
| | |
|
| | | # 仙盟事务速度加成
|
| | | def GetAffairSpeedPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AffairSpeedPer)
|
| | | def SetAffairSpeedPer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_AffairSpeedPer, value)
|
| | |
|
| | | # 仙盟BOSS伤害加成
|
| | | def GetFamilyBossHurtPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FamilyBossHurtPer)
|
| | | def SetFamilyBossHurtPer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_FamilyBossHurtPer, value)
|
| | |
|
| | | # 仙盟联赛生命加成
|
| | | def GetFamilyWarHPPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FamilyWarHPPer)
|
| | | def SetFamilyWarHPPer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_FamilyWarHPPer, value)
|
| | |
|
| | | # 仙盟联赛攻击加成
|
| | | def GetFamilyWarAtkPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FamilyWarAtkPer)
|
| | | def SetFamilyWarAtkPer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_FamilyWarAtkPer, value)
|
| | |
|
| | | # 仙盟打坐经验加成
|
| | | def GetFamilySitExpPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FamilySitExpPer)
|
| | | def SetFamilySitExpPer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_FamilySitExpPer, value)
|
| | |
|
| | | # 宝石基础属性百分比
|
| | | def GetStoneBasePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_StoneBasePer)
|
| | | def SetStoneBasePer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_StoneBasePer, value)
|
| | |
| | | import PlayerControl
|
| | | import PlayerWorldAverageLv
|
| | | import PlayerFamily
|
| | | import PlayerFamilyZhenfa
|
| | | import PlayerOnlinePrize
|
| | | import NPCCustomRefresh
|
| | | import PlayerLoginDayAward
|
| | |
| | | GameLogic_FamilyParty.DoAddFamilyMemberFamilyActivity(familyID, addFamilyActivity)
|
| | | return
|
| | |
|
| | | if key == ShareDefine.Def_Notify_WorldKey_FamilyZhenfaInfo:
|
| | | PlayerFamilyZhenfa.GameServer_FamilyZhenfa(eval(msgValue))
|
| | | return
|
| | | |
| | | if key == ShareDefine.Def_Notify_WorldKey_AssistBoss:
|
| | | assistData = eval(msgValue)
|
| | | if GameWorld.GetMap().GetMapID() == assistData[0]:
|
| | |
| | | import ChMapToGamePyPack
|
| | | import PlayerFamilyTech
|
| | | import PlayerFamilyRedPacket
|
| | | import PlayerFamilyZhenfa
|
| | | import SkillCommon
|
| | | import BuffSkill
|
| | | import ItemCommon
|
| | |
| | | GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
|
| | | GameLogic_FamilyBoss.OnEnterFamily(curPlayer)
|
| | | PlayerFamilyRedPacket.CreatCacheRedPacktet(curPlayer)
|
| | | PlayerFamilyZhenfa.OnEnterFamily(curPlayer)
|
| | | return
|
| | |
|
| | | ## 退出家族触发事件
|
| | |
| | | #清空仓库积分
|
| | | PlayerControl.SetPlayerCurrency(curPlayer, ShareDefine.TYPE_Price_FamilyStoreScore, 0)
|
| | | GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
|
| | | PlayerFamilyZhenfa.OnLeaveFamily(curPlayer)
|
| | | return
|
| | |
|
| | | ## 家族等级加持buff变更处理(进、退家族时 及 家族等级变更时)
|
| | |
| | | SyncFamilyActivityInfo(curPlayer)
|
| | | Sync_FamilyDayRewardState(curPlayer)
|
| | | __FamilyAffair_CheckReset(curPlayer)
|
| | | PlayerFamilyZhenfa.OnPlayerLogin(curPlayer)
|
| | | return
|
| | |
|
| | | def FamilyPlayerOnLoginCross(curPlayer):
|
| | |
| | | starInfo = affairStarDict.get(str(star), [])
|
| | | needDuration = starInfo[1] if len(starInfo) > 1 else 0
|
| | | # 可扩展减时长属性
|
| | | speedPer = PlayerControl.GetAffairSpeedPer(curPlayer)
|
| | | if speedPer:
|
| | | needDuration = int(needDuration * max(10000 - speedPer, 0) / 10000.0)
|
| | | #GameWorld.DebugLog("事务加速: needDuration=%s,speedPer=%s" % (needDuration, speedPer), curPlayer.GetPlayerID())
|
| | | |
| | | remainDuration = max(needDuration - (curTime - startTime), 0)
|
| | | return remainDuration
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python |
| | | # -*- coding: GBK -*- |
| | | #------------------------------------------------------------------------------- |
| | | # |
| | | ##@package Player.PlayerFamilyZhenfa |
| | | # |
| | | # @todo:仙盟阵法 |
| | | # @author hxp |
| | | # @date 2023-10-11 |
| | | # @version 1.0 |
| | | # |
| | | # 详细描述: 仙盟阵法 |
| | | # |
| | | #------------------------------------------------------------------------------- |
| | | #"""Version = 2023-10-11 16:30""" |
| | | #------------------------------------------------------------------------------- |
| | | |
| | | import GameWorld |
| | | import ItemCommon |
| | | import ShareDefine |
| | | import PlayerControl |
| | | import NetPackCommon |
| | | import ChPyNetSendPack |
| | | import IpyGameDataPY |
| | | import PlayerSuccess |
| | | import IPY_GameWorld |
| | | import PyGameData |
| | | import ChConfig |
| | | |
| | | ZhenfaKey_LV = "LV" |
| | | ZhenfaKey_Exp = "Exp" |
| | | |
| | | def OnPlayerLogin(curPlayer): |
| | | Sync_FamilyZhenfaInfo(curPlayer) |
| | | return |
| | | |
| | | def OnLeaveFamily(curPlayer): |
| | | #Sync_FamilyZhenfaInfo(curPlayer) |
| | | RefreshZhenfaAttr(curPlayer) |
| | | return |
| | | |
| | | def OnEnterFamily(curPlayer): |
| | | Sync_FamilyZhenfaInfo(curPlayer) |
| | | RefreshZhenfaAttr(curPlayer) |
| | | return |
| | | |
| | | def GetFamilyZhenfaInfo(familyID, zhenfaType, key, defValue=0): |
| | | ## 获取家族阵法信息 |
| | | zhenfaInfo = PyGameData.g_familyZhenfaInfo.get(familyID, {}) |
| | | info = zhenfaInfo.get(zhenfaType, {}) |
| | | return info.get(key, defValue) |
| | | |
| | | def GameServer_FamilyZhenfa(msgDict): |
| | | zhenfaInfo = msgDict.get("zhenfaInfo", {}) # {familyID:{zhenfaType:{k:v, }, ...}, ...} |
| | | msgType = msgDict.get("msgType", "") |
| | | familyID = msgDict.get("familyID", 0) # 指定更新的仙盟 |
| | | playerID = msgDict.get("playerID", 0) # 触发更新的玩家ID |
| | | refreshAttr = msgDict.get("refreshAttr", 1) |
| | | |
| | | # 所有仙盟,直接替换 |
| | | if msgType == "allFamily": |
| | | PyGameData.g_familyZhenfaInfo = zhenfaInfo |
| | | # 单个仙盟更新 |
| | | else: |
| | | PyGameData.g_familyZhenfaInfo.update(zhenfaInfo) |
| | | |
| | | #GameWorld.DebugLog("更新阵法信息: %s" % PyGameData.g_familyZhenfaInfo) |
| | | playerManager = GameWorld.GetPlayerManager() |
| | | for index in xrange(playerManager.GetPlayerCount()): |
| | | curPlayer = playerManager.GetPlayerByIndex(index) |
| | | if curPlayer.GetID() == 0: |
| | | continue |
| | | |
| | | if familyID and curPlayer.GetFamilyID() != familyID: |
| | | continue |
| | | |
| | | OnFamilyZhenfaRefresh(curPlayer, refreshAttr, playerID) |
| | | |
| | | return |
| | | |
| | | def SendGameServer_FamilyZhenfa(curPlayer, familyID, playerID, msgType, msgData): |
| | | GameWorld.DebugLog("仙盟阵法同步GameServer: familyID=%s,msgType=%s,%s" % (familyID, msgType, msgData), playerID) |
| | | msgInfo = str([familyID, playerID, msgType, msgData]) |
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(playerID, 0, 0, "FamilyZhenfa", msgInfo, len(msgInfo)) |
| | | return |
| | | |
| | | #// A6 14 家族阵法升级 #tagCMFamilyZhenfaLVUP |
| | | # |
| | | #struct tagCMFamilyZhenfaLVUP |
| | | #{ |
| | | # tagHead Head; |
| | | # BYTE ZhenfaType; // 阵法类型 |
| | | # DWORD ItemID; // 消耗的物品ID |
| | | # WORD ItemCount; // 消耗个数,默认1 |
| | | #}; |
| | | def OnFamilyZhenfaLVUP(index, clientData, tick): |
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) |
| | | playerID = curPlayer.GetPlayerID() |
| | | familyID = curPlayer.GetFamilyID() |
| | | zhenfaType = clientData.ZhenfaType |
| | | useItemID = clientData.ItemID |
| | | useItemCount = clientData.ItemCount |
| | | if not familyID: |
| | | GameWorld.DebugLog("没有仙盟,无法升级阵法", playerID) |
| | | return |
| | | if not useItemID or useItemCount <= 0: |
| | | GameWorld.DebugLog("没有指定升级阵法物品: useItemID=%s,useItemCount=%s" % (useItemID, useItemCount), playerID) |
| | | return |
| | | zhenfaLV = GetFamilyZhenfaInfo(familyID, zhenfaType, ZhenfaKey_LV) |
| | | ipyData = IpyGameDataPY.GetIpyGameData("FamilyZhenfa", zhenfaType, zhenfaLV) |
| | | if not ipyData: |
| | | return |
| | | LVUpNeedExp = ipyData.GetLVUpNeedExp() |
| | | if not LVUpNeedExp: |
| | | GameWorld.DebugLog("该阵法已满级:zhenfaType=%s,zhenfaLV=%s" % (zhenfaType, zhenfaLV), playerID) |
| | | return |
| | | expItemDict = IpyGameDataPY.GetFuncEvalCfg("FamilyZhenfa", 1) |
| | | if str(zhenfaType) not in expItemDict: |
| | | GameWorld.DebugLog("不存在该阵法类型: zhenfaType=%s" % zhenfaType, playerID) |
| | | return |
| | | expItemList = expItemDict[str(zhenfaType)] |
| | | |
| | | if useItemID not in expItemList: |
| | | GameWorld.DebugLog("该物品不能升级该阵法:zhenfaType=%s,useItemID=%s not in %s" % (zhenfaType, useItemID, expItemList), playerID) |
| | | return |
| | | |
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(useItemID) |
| | | if not itemData: |
| | | return |
| | | itemExp = itemData.GetEffectByIndex(0).GetEffectValue(0) # 默认效果1 A值为可加经验 |
| | | if not itemExp: |
| | | GameWorld.DebugLog("该物品没有阵法经验:useItemID=%s" % useItemID, playerID) |
| | | return |
| | | |
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem) |
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList({useItemID:useItemCount}, itemPack) |
| | | if lackItemDict: |
| | | GameWorld.DebugLog("阵法升级物品不足:useItemID=%s,useItemCount=%s,lackItemDict=%s" % (useItemID, useItemCount, lackItemDict), playerID) |
| | | return |
| | | |
| | | if not GameWorld.SetPlayerTickTime(curPlayer, ChConfig.TYPE_Player_Tick_FamilyZhenfa, tick): |
| | | GameWorld.DebugLog("阵法升级操作CD中...", playerID) |
| | | PlayerControl.NotifyCode(curPlayer, "RequestLater") |
| | | return |
| | | |
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "FamilyZhenfaLVUP") |
| | | |
| | | addTotalExp = itemExp * useItemCount |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FamilyZhenfaExp, addTotalExp) |
| | | |
| | | SendGameServer_FamilyZhenfa(curPlayer, familyID, playerID, "AddExp", [zhenfaType, addTotalExp]) |
| | | return |
| | | |
| | | def OnFamilyZhenfaRefresh(curPlayer, refreshAttr, opPlayerID): |
| | | if curPlayer.GetPlayerID() == opPlayerID: |
| | | curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_FamilyZhenfa, 0) |
| | | |
| | | Sync_FamilyZhenfaInfo(curPlayer, opPlayerID) |
| | | |
| | | if refreshAttr: |
| | | RefreshZhenfaAttr(curPlayer) |
| | | return |
| | | |
| | | def RefreshZhenfaAttr(curPlayer): |
| | | CalcZhenfaAttr(curPlayer) |
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState() |
| | | return |
| | | |
| | | def CalcZhenfaAttr(curPlayer): |
| | | |
| | | allAttrList = [{} for i in range(4)] |
| | | |
| | | familyID = curPlayer.GetFamilyID() |
| | | if familyID: |
| | | expItemDict = IpyGameDataPY.GetFuncEvalCfg("FamilyZhenfa", 1) |
| | | zhenfaInfo = PyGameData.g_familyZhenfaInfo.get(familyID, {}) |
| | | for zhenfaTypeStr in expItemDict.keys(): |
| | | zhenfaType = int(zhenfaTypeStr) |
| | | info = zhenfaInfo.get(zhenfaType, {}) |
| | | zhenfaLV = info.get(ZhenfaKey_LV, 0) |
| | | ipyData = IpyGameDataPY.GetIpyGameData("FamilyZhenfa", zhenfaType, zhenfaLV) |
| | | if not ipyData: |
| | | continue |
| | | attrTypeList, attrValueList = ipyData.GetLVAttrType(), ipyData.GetLVAttrValue() |
| | | for i, attrID in enumerate(attrTypeList): |
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValueList[i], allAttrList) |
| | | |
| | | # 保存计算值 |
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_FamilyZhenfa, allAttrList) |
| | | return |
| | | |
| | | def Sync_FamilyZhenfaInfo(curPlayer, playerID=0): |
| | | familyID = curPlayer.GetFamilyID() |
| | | if not familyID: |
| | | return |
| | | |
| | | zhenfaInfoList = [] |
| | | zhenfaInfo = PyGameData.g_familyZhenfaInfo.get(familyID, {}) |
| | | for zhenfaType, info in zhenfaInfo.items(): |
| | | zhenfa = ChPyNetSendPack.tagMCFamilyZhenfa() |
| | | zhenfa.Clear() |
| | | zhenfa.ZhenfaType = zhenfaType |
| | | zhenfa.ZhenfaLV = info.get(ZhenfaKey_LV, 0) |
| | | zhenfa.ZhenfaExp = info.get(ZhenfaKey_Exp, 0) |
| | | zhenfaInfoList.append(zhenfa) |
| | | |
| | | clientPack = ChPyNetSendPack.tagMCFamilyZhenfaInfo() |
| | | clientPack.Clear() |
| | | clientPack.PlayerID = playerID |
| | | clientPack.ZhenfaInfoList = zhenfaInfoList |
| | | clientPack.Count = len(clientPack.ZhenfaInfoList) |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack) |
| | | return |
| | |
| | | g_coupleInfo = {} # {playerID:[coupleID, coupleName], ...}
|
| | |
|
| | | g_playerPriWoodPileNPCDict = {} # {playerID:[npcObj, ...], ...}
|
| | |
|
| | | g_familyZhenfaInfo = {} # 仙盟阵法信息{familyID:{zhenfaType:{k:v, }, ...}, ...}
|
| | |
|
| | |
| | |
|
| | | Def_Notify_WorldKey_FamilyPartyInfo = "FamilyPartyInfo" # 仙盟宴会数据
|
| | | Def_Notify_WorldKey_FamilyPartyAddFamilyActivity = "FamilyPartyAddFamilyActivity" # 仙盟宴会地图成员增加仙盟活跃令
|
| | | Def_Notify_WorldKey_FamilyZhenfaInfo = "FamilyZhenfaInfo" # 仙盟阵法数据
|
| | |
|
| | | Def_Notify_WorldKey_AddFamilyAuctionItem = "AddFamilyAuctionItem" # 添加仙盟拍品
|
| | | Def_Notify_WorldKey_AddSystemAuctionItem = "AddSystemAuctionItem" # 添加系统拍品
|
| | |
| | | Def_Effect_PeerlessWeaponTrainAttrPer = 158 # 灭世培养属性加成(攻防血)
|
| | | Def_Effect_PeerlessWeapon2TrainAttrPer = 159 # 弑神培养属性加成(攻防血)
|
| | | Def_Effect_LianTiAttrPer = 160 # 炼体属性百分比(攻防血)
|
| | |
|
| | | Def_Effect_AffairSpeedPer = 161 # 仙盟事务速度加成
|
| | | Def_Effect_FamilyBossHurtPer = 162 # 仙盟BOSS伤害加成
|
| | | Def_Effect_FamilyWarHPPer = 163 # 仙盟联赛生命加成
|
| | | Def_Effect_FamilyWarAtkPer = 164 # 仙盟联赛攻击加成
|
| | | Def_Effect_FamilySitExpPer = 165 # 仙盟打坐经验加成
|
| | |
|
| | | #增加%d物理伤害值,其中a值为伤害值
|
| | | Def_Effect_AddAtk = 1005
|
| | |
| | | Def_ActionType_LeaderImpeachTime, # 族长下线了多久5
|
| | | Def_ActionType_FamilyBossFB, #记录家族boss副本信息6
|
| | | Def_ActionType_FamilyStore, #记录战盟仓库操作记录7
|
| | | Def_ActionType_XXX8, #8
|
| | | Def_ActionType_FamilyZhenfa, #仙盟阵法8
|
| | | Def_ActionType_XXX9, #9
|
| | | Def_ActionType_XXX10, #10
|
| | | Def_ActionType_OfficerModelEquip, #记录家族有职位的成员模型装备信息11
|
| | |
| | | )=range(5)
|
| | |
|
| | | # 战斗力模块类型
|
| | | Def_MFPType_Max = 32
|
| | | Def_MFPType_Max = 33
|
| | | ModuleFightPowerTypeList = (
|
| | | Def_MFPType_Role, # 角色 0
|
| | | Def_MFPType_Equip, # 装备(装备本身) 1
|
| | |
| | | Def_MFPType_Enchant, # 附魔 28
|
| | | Def_MFPType_Gubao, # 古宝 29
|
| | | Def_MFPType_Shentong, # 神通 30
|
| | | Def_MFPType_FamilyZhenfa, # 阵法 31
|
| | | Def_MFPType_Other, # 其他
|
| | | ) = range(Def_MFPType_Max)
|
| | |
|
| | |
| | | SuccType_EquipStarTotal, # 全身升星总星数X星 174
|
| | | SuccType_EquipWashTotal, # 全身洗炼总等级X级 175
|
| | | SuccType_CrossPK, # 跨服PK x次 176
|
| | | ) = range(1, 177)
|
| | | SuccType_FamilyZhenfaExp, # 仙盟阵法捐献累计经验 177
|
| | | ) = range(1, 178)
|
| | |
|
| | | # 节日红包成就类型
|
| | | FeastRedPackSuccessTypeList = range(SuccType_FeastRedPack_TalkWorld, SuccType_FeastRedPack_FBSweep + 1)
|
| | |
| | | import ChConfig
|
| | | import EffGetSet
|
| | | import GameWorld
|
| | | import FBCommon
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | def AddPlayerMapAttrNolineEffect(curPlayer, effectDict):
|
| | | ## 根据玩家当前属性给玩家添加非线性效果加成 - 某些地图才生效的
|
| | | mapID = FBCommon.GetRecordMapID(curPlayer.GetMapID())
|
| | | mapAttrNolineInfo = ChConfig.MapAttrInfoDict_Noline.get(mapID, {})
|
| | | for attrIndex, effAttrIndexList in mapAttrNolineInfo.items():
|
| | | curValue = EffGetSet.GetValueByEffIndex(curPlayer, attrIndex)
|
| | | if not curValue:
|
| | | #GameWorld.DebugLog(" 没有该类属性: attrIndex=%s" % attrIndex)
|
| | | continue
|
| | | for effAttrIndex in effAttrIndexList:
|
| | | effectDict[effAttrIndex] = effectDict.get(effAttrIndex, 0) + curValue
|
| | | return
|
| | |
|
| | | ## 给玩家添加非线性Buff效果
|
| | | # @param curPlayer 当前玩家
|
| | | # @param effectDict 效果列表
|
| | |
| | | [lambda curObj:PlayerControl.GetPeerlessWeaponTrainAttrPer(curObj), lambda curObj, value:PlayerControl.SetPeerlessWeaponTrainAttrPer(curObj, value), 0, 0, 0], # 灭世培养属性加成
|
| | | [lambda curObj:PlayerControl.GetPeerlessWeapon2TrainAttrPer(curObj), lambda curObj, value:PlayerControl.SetPeerlessWeapon2TrainAttrPer(curObj, value), 0, 0, 0], # 弑神培养属性加成
|
| | | [lambda curObj:PlayerControl.GetLianTiAttrPer(curObj), lambda curObj, value:PlayerControl.SetLianTiAttrPer(curObj, value), 0, 0, 0], # 炼体属性属性加成
|
| | | [lambda curObj:PlayerControl.GetAttr160(curObj), lambda curObj, value:PlayerControl.SetAttr160(curObj, value), 0, 0, 0], # 160
|
| | | [lambda curObj:PlayerControl.GetAffairSpeedPer(curObj), lambda curObj, value:PlayerControl.SetAffairSpeedPer(curObj, value), 0, 0, 0], # 仙盟事务速度加成
|
| | | [lambda curObj:PlayerControl.GetFamilyBossHurtPer(curObj), lambda curObj, value:PlayerControl.SetFamilyBossHurtPer(curObj, value), 0, 0, 0], # 仙盟BOSS伤害加成
|
| | | [lambda curObj:PlayerControl.GetFamilyWarHPPer(curObj), lambda curObj, value:PlayerControl.SetFamilyWarHPPer(curObj, value), 0, 0, 0], # 仙盟联赛生命加成
|
| | | [lambda curObj:PlayerControl.GetFamilyWarAtkPer(curObj), lambda curObj, value:PlayerControl.SetFamilyWarAtkPer(curObj, value), 0, 0, 0], # 仙盟联赛攻击加成
|
| | | [lambda curObj:PlayerControl.GetFamilySitExpPer(curObj), lambda curObj, value:PlayerControl.SetFamilySitExpPer(curObj, value), 0, 0, 0], # 仙盟打坐经验加成
|
| | | ]
|
| | |
|
| | | ## 通过索引获得属性值
|