Merge branch 'master' of http://mobile.173on.com:10010/r/SnxxServerCode
| | |
| | | char NotifyMark; //广播提示
|
| | | };
|
| | |
|
| | | //首充表
|
| | |
|
| | | struct tagFirstGold
|
| | | {
|
| | | BYTE _Day; //首充第几天
|
| | | dict JobItemInfo; //职业物品奖励 {"职业":[[物品ID,个数], ...], ...}
|
| | | list CommItemList; //通用物品奖励 [[物品ID,个数], ...]
|
| | | };
|
| | |
|
| | | //等级奖励表
|
| | |
|
| | | struct tagLVAward
|
| | |
| | | ShareDefine.Def_BT_Campaign_StarLV : 100, #升星等级(开服活动榜)
|
| | | ShareDefine.Def_BT_FCCostGold : 5, #消费排行榜(仙界盛典)
|
| | | ShareDefine.Def_BT_NewFCCostGold : 5, #消费排行榜(仙界盛典)
|
| | | ShareDefine.Def_BT_FBHelpBattle : 100, #助战次数榜
|
| | | }
|
| | |
|
| | | #排行榜保存类型(和BillboardType匹配), 默认保存, 如果不保存,可配置进去
|
| | |
| | | VIPPrivilege_BindJadeWheel, #30 绑玉转盘次数
|
| | | VIPPrivilege_PrayElixir, #31 丹药祈福次数
|
| | | VIPPrivilege_32, #32 封魔坛自动挑战
|
| | | VIPPrivilege_XianyuanCoinUpperAdd, #33 仙缘币上限加成
|
| | | VIPPrivilege_XianyuanCoinAddPer, #34 仙缘币获得倍率加成(万分比)
|
| | | VIPPrivilege_33, #33
|
| | | VIPPrivilege_34, #34
|
| | | ) = range(1, 35)
|
| | |
|
| | | #游戏货币来源类型定义
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B0 28 活跃放置快速完成 #tagCMActivityPlaceQuickFinish
|
| | |
|
| | | class tagCMActivityPlaceQuickFinish(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("FinishCount", c_ubyte), #完成次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB0
|
| | | self.SubCmd = 0x28
|
| | | 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 = 0xB0
|
| | | self.SubCmd = 0x28
|
| | | self.FinishCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMActivityPlaceQuickFinish)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B0 28 活跃放置快速完成 //tagCMActivityPlaceQuickFinish:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | FinishCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.FinishCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMActivityPlaceQuickFinish=tagCMActivityPlaceQuickFinish()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActivityPlaceQuickFinish.Cmd,m_NAtagCMActivityPlaceQuickFinish.SubCmd))] = m_NAtagCMActivityPlaceQuickFinish
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B0 27 活跃放置启动 #tagCMActivityPlaceStart
|
| | |
|
| | | class tagCMActivityPlaceStart(Structure):
|
| | |
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("RewardEndType", c_ubyte), #是否结算探索,后端处理奖励后自动启动下一次放置探索;0-无结算启动,1-倒计时结束结算,2-快速结算;
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | def Clear(self):
|
| | | self.Cmd = 0xB0
|
| | | self.SubCmd = 0x27
|
| | | self.RewardEndType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''// B0 27 活跃放置启动 //tagCMActivityPlaceStart:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | RewardEndType:%d
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.RewardEndType
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("FirstGoldRewardState", c_ubyte), #首充奖励是否已领奖
|
| | | ("FirstGoldRewardState", c_ubyte), #首充奖励领奖记录,按位记录首充第X天是否已领取,第1天为第0索引位
|
| | | ("FirstGoldTry", c_ubyte), #首充试用状态0-不可试用 1-可试用 2-已试用
|
| | | ("FirstGoldServerDay", c_ushort), #首充时是开服第几天,从1开始,0代表未记录充值
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.SubCmd = 0x02
|
| | | self.FirstGoldRewardState = 0
|
| | | self.FirstGoldTry = 0
|
| | | self.FirstGoldServerDay = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | FirstGoldRewardState:%d,
|
| | | FirstGoldTry:%d
|
| | | FirstGoldTry:%d,
|
| | | FirstGoldServerDay:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.FirstGoldRewardState,
|
| | | self.FirstGoldTry
|
| | | self.FirstGoldTry,
|
| | | self.FirstGoldServerDay
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | | class tagMCActivityPlaceInfo(Structure):
|
| | | Head = tagHead()
|
| | | PlaceState = 0 #(BYTE PlaceState)// 是否启动状态
|
| | | StartTime = 0 #(DWORD StartTime)// 开始探索time时间戳,完成一次探索会自动下一次探索并更新该时间
|
| | | PlaceCount = 0 #(BYTE PlaceCount)// 剩余未完成探索次数
|
| | | RewardCount = 0 #(BYTE RewardCount)// 累计未领取探索奖励次数
|
| | | RewardLen = 0 #(BYTE RewardLen)
|
| | | RewardInfo = "" #(String RewardInfo)//累计未领取探索奖励 [[itemID, count], ...]
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.PlaceState,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.StartTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PlaceCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RewardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RewardLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RewardInfo,_pos = CommFunc.ReadString(_lpData, _pos,self.RewardLen)
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB0
|
| | | self.Head.SubCmd = 0x27
|
| | | self.PlaceState = 0
|
| | | self.StartTime = 0
|
| | | self.PlaceCount = 0
|
| | | self.RewardCount = 0
|
| | | self.RewardLen = 0
|
| | | self.RewardInfo = ""
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 4
|
| | | length += 1
|
| | | length += 1
|
| | | length += 1
|
| | | length += len(self.RewardInfo)
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.PlaceState)
|
| | | data = CommFunc.WriteDWORD(data, self.StartTime)
|
| | | data = CommFunc.WriteBYTE(data, self.PlaceCount)
|
| | | data = CommFunc.WriteBYTE(data, self.RewardCount)
|
| | | data = CommFunc.WriteBYTE(data, self.RewardLen)
|
| | | data = CommFunc.WriteString(data, self.RewardLen, self.RewardInfo)
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | PlaceState:%d,
|
| | | StartTime:%d,
|
| | | PlaceCount:%d,
|
| | | RewardCount:%d,
|
| | | RewardLen:%d,
|
| | | RewardInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.PlaceState,
|
| | | self.StartTime,
|
| | | self.PlaceCount,
|
| | | self.RewardCount,
|
| | | self.RewardLen,
|
| | | self.RewardInfo
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B0 07 今日协助活跃令信息 #tagMCTodayAssistMoneyInfo
|
| | |
|
| | | class tagMCTodayAssistMoneyInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("TodayAssistMoney", c_ushort), #今日已获得活跃令,不含社交加成
|
| | | ("SocialMoney", c_ushort), #社交额外加成
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB0
|
| | | 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 = 0xB0
|
| | | self.SubCmd = 0x07
|
| | | self.TodayAssistMoney = 0
|
| | | self.SocialMoney = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCTodayAssistMoneyInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B0 07 今日协助活跃令信息 //tagMCTodayAssistMoneyInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | TodayAssistMoney:%d,
|
| | | SocialMoney:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.TodayAssistMoney,
|
| | | self.SocialMoney
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCTodayAssistMoneyInfo=tagMCTodayAssistMoneyInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTodayAssistMoneyInfo.Cmd,m_NAtagMCTodayAssistMoneyInfo.SubCmd))] = m_NAtagMCTodayAssistMoneyInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 02 玩家时装皮肤激活状态 #tagMCClothesCoatSkinState
|
| | |
|
| | | class tagMCClothesCoatLVInfo(Structure):
|
| | |
| | | assistThanksMgr = PyDataManager.GetPlayerAssistThanksPyManager()
|
| | | GameWorld.Log("---------- 未完结总感谢条数: %s" % len(assistThanksMgr.allAssistThanksList))
|
| | | for playerID, thanksList in assistThanksMgr.playerThanksDict.items():
|
| | | GameWorld.DebugLog("玩家未发送感谢数: %s, %s" % (playerID, len(thanksList)))
|
| | | GameWorld.DebugLog("--- 玩家未发送感谢数: %s, %s" % (playerID, len(thanksList)))
|
| | | for i, thanks in enumerate(thanksList):
|
| | | GameWorld.DebugLog(" i=%s, %s" % (i, thanks.outputString()))
|
| | | GameWorld.DebugLog(" %s" % thanks.AssistPlayerDict)
|
| | | GameWorld.DebugLog(" %s itemID=%s,map(%s,%s,%s), %s %s" % (i, thanks.ItemID, thanks.MapID, thanks.LineID, thanks.NPCID, thanks.TimeStr, thanks.GUID), thanks.PlayerID)
|
| | | GameWorld.DebugLog(" ThanksState=%s, %s" % (thanks.ThanksState, thanks.AssistPlayerDict), thanks.PlayerID)
|
| | |
|
| | | for playerID, thanksList in assistThanksMgr.assistPlayerThanksDict.items():
|
| | | GameWorld.DebugLog("玩家未接收感谢数: %s, %s" % (playerID, len(thanksList)))
|
| | | GameWorld.DebugLog("--- 玩家未接收感谢数: %s, %s" % (playerID, len(thanksList)))
|
| | | for i, thanks in enumerate(thanksList):
|
| | | GameWorld.DebugLog(" i=%s, %s" % (i, thanks.outputString()))
|
| | | GameWorld.DebugLog(" %s" % thanks.AssistPlayerDict)
|
| | | GameWorld.DebugLog(" %s itemID=%s,map(%s,%s,%s), %s %s" % (i, thanks.ItemID, thanks.MapID, thanks.LineID, thanks.NPCID, thanks.TimeStr, thanks.GUID), thanks.PlayerID)
|
| | | GameWorld.DebugLog(" ThanksState=%s, %s" % (thanks.ThanksState, thanks.AssistPlayerDict), thanks.PlayerID)
|
| | |
|
| | | GameWorld.DebugLog("-----------------------------------------")
|
| | | return
|
| | |
| | | Def_GMKey_PlayerName = 'playerName'
|
| | | Def_GMKey_PlayerAccID = 'accID'
|
| | | Def_GMKey_FamilyName = 'familyName'
|
| | | Def_GMKey_FamilyID = 'familyID'
|
| | | Def_GMKey_PackIndex = 'packIndex'
|
| | | Def_GMKey_IP = 'IP'
|
| | | Def_GMKey_QueryType = 'queryType'
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GM.Commands.GMT_AddAuctionItem
|
| | | #
|
| | | # @todo:上架拍品
|
| | | # @author hxp
|
| | | # @date 2019-12-27
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 上架拍品
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2019-12-27 19:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GMCommon
|
| | | import GameWorld
|
| | | import DataRecordPack
|
| | | import IpyGameDataPY
|
| | | import AuctionHouse
|
| | | import ChConfig
|
| | |
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 执行逻辑
|
| | | # @param curPlayer 当前玩家
|
| | | # @param gmCmdDict: 命令字典
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(orderId, gmCmdDict):
|
| | | |
| | | familyID = GameWorld.ToIntDef(gmCmdDict.get("familyID", 0))
|
| | | familyPlayerIDList = []
|
| | | if familyID:
|
| | | try:
|
| | | familyPlayerIDList = eval(gmCmdDict.get("playerIDList", "[]"))
|
| | | if not isinstance(familyPlayerIDList, list):
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr, "收益玩家ID列表格式非列表!")
|
| | | return
|
| | | except:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr, "收益玩家ID列表格式错误!")
|
| | | return
|
| | | |
| | | itemDict = {}
|
| | | for key, value in gmCmdDict.items():
|
| | | |
| | | if key.startswith("ItemID"):
|
| | | itemID = GameWorld.ToIntDef(value)
|
| | | if not itemID:
|
| | | continue
|
| | | itemNum = key[6:]
|
| | | info = {"ItemID":itemID}
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog("AuctionItem", itemID)
|
| | | if not ipyData:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr, "存在非拍品物品ID %s" % itemID)
|
| | | return
|
| | | elif key.startswith("ItemCnt"):
|
| | | itemCount = GameWorld.ToIntDef(value)
|
| | | itemNum = key[7:]
|
| | | info = {"ItemCount":itemCount}
|
| | | else:
|
| | | continue
|
| | | |
| | | if itemNum not in itemDict:
|
| | | itemDict[itemNum] = {}
|
| | | itemInfo = itemDict[itemNum]
|
| | | itemInfo.update(info)
|
| | | |
| | | auctionItemList = []
|
| | | for itemInfo in itemDict.values():
|
| | | itemID = itemInfo.get("ItemID", 0)
|
| | | itemCount = itemInfo.get("ItemCount", 0)
|
| | | if not itemID or not itemCount:
|
| | | continue
|
| | | auctionItemList.append([itemID, itemCount])
|
| | | if not auctionItemList:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr, "拍品ID或个数异常!")
|
| | | return
|
| | | |
| | | GameWorld.Log("GMT上架拍品: ")
|
| | | if familyID:
|
| | | curFamily = GameWorld.GetFamilyManager().FindFamily(familyID)
|
| | | if not curFamily:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr, "不存在该仙盟!")
|
| | | return
|
| | | notFamilyMemberIDList = []
|
| | | for menberID in familyPlayerIDList:
|
| | | curMember = curFamily.FindMember(menberID)
|
| | | if curMember == None:
|
| | | notFamilyMemberIDList.append(menberID)
|
| | | if notFamilyMemberIDList:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr, "以下玩家ID不是该仙盟成员%s" % notFamilyMemberIDList)
|
| | | return
|
| | | |
| | | familyAuctionItemDict = {} # {仙盟ID:[[享受收益的成员ID, ...], [[拍品ID,个数], [拍品ID,个数,是否拍品], ...]], ...}
|
| | | familyAuctionItemDict[familyID] = [familyPlayerIDList, auctionItemList]
|
| | | AuctionHouse.DoAddFamilyAuctionItem(ChConfig.Def_FBMapID_MainCity, familyAuctionItemDict)
|
| | | else:
|
| | | AuctionHouse.DoAddSystemAuctionItem(auctionItemList)
|
| | | |
| | | #执行成功
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success) |
| | | # 流向
|
| | | DataRecordPack.DR_ToolGMOperate(0, '', '', 'GMT_AddAuctionItem', str(gmCmdDict))
|
| | | return
|
| | |
|
| | |
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(orderId, gmCmdDict):
|
| | | strMsg = ""
|
| | | gmCmdDict = ClearEmptyFromDict(gmCmdDict)
|
| | | PlayerIDList = eval(gmCmdDict.get('PlayerIDList', '[]'))
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | | if queryType == GMCommon.Def_GMKey_FamilyID:
|
| | | sendFamilyIDList = []
|
| | | PlayerIDList = []
|
| | | familyIDList = gmCmdDict.get("playerList", "").split(",")
|
| | | GameWorld.Log("发送仙盟邮件: familyIDList=%s" % familyIDList)
|
| | | for familyID in familyIDList:
|
| | | familyID = GameWorld.ToIntDef(familyID)
|
| | | familyInfo = {"familyID":familyID}
|
| | | memberIDList = []
|
| | | family = GameWorld.GetFamilyManager().FindFamily(familyID)
|
| | | if not family:
|
| | | GameWorld.DebugLog(" not family %s" % familyID)
|
| | | continue
|
| | | for index in range(family.GetCount()):
|
| | | curMember = family.GetAt(index)
|
| | | curMemberID = curMember.GetPlayerID()
|
| | | if curMemberID:
|
| | | memberIDList.append(curMemberID)
|
| | | PlayerIDList += memberIDList
|
| | | familyInfo["PlayerIDList"] = memberIDList
|
| | | sendFamilyIDList.append(familyInfo)
|
| | | GameWorld.Log(" send FamilyIDList=%s" % sendFamilyIDList)
|
| | | GameWorld.Log(" send PlayerIDList=%s" % PlayerIDList)
|
| | | strMsg = str(sendFamilyIDList)
|
| | | else:
|
| | | PlayerIDList = eval(gmCmdDict.get('PlayerIDList', '[]'))
|
| | | if PlayerIDList == []:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr) |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
|
| | | return
|
| | |
|
| | | |
| | | LimitTime = gmCmdDict.get('EndTime', '2050-12-13 00:00:00')
|
| | |
|
| | | curServerTime = GameWorld.GetCurrentDataTimeStr()
|
| | |
| | | gold, goldPaper, silver, detail=detail)
|
| | |
|
| | | #执行成功
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success) |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, strMsg)
|
| | | # 流向
|
| | | DataRecordPack.DR_ToolGMOperate(0, '', '', 'GMT_AddPersonalCompensation', str(gmCmdDict))
|
| | | return
|
| | |
| | | GameWorld.DebugAnswer(curPlayer, "等级: %s, 境界: %s, VIP%s" % (helpBattlePlayer.playerLV, helpBattlePlayer.realmLV, helpBattlePlayer.vipLV))
|
| | | GameWorld.DebugAnswer(curPlayer, "战力: %s, 仙盟: %s" % (helpBattlePlayer.fightPower, helpBattlePlayer.familyID))
|
| | | GameWorld.DebugAnswer(curPlayer, "登记时间: %s, 次数: %s" % (GameWorld.ChangeTimeNumToStr(helpBattlePlayer.checkInTime), helpBattlePlayer.checkInCount))
|
| | | GameWorld.DebugAnswer(curPlayer, "今日仙缘币: %s" % (helpBattlePlayer.todayXianyuanCoin))
|
| | | GameWorld.DebugAnswer(curPlayer, "今天助战数: %s" % (helpBattlePlayer.todayHelpCountDict))
|
| | | GameWorld.DebugAnswer(curPlayer, "接受礼盒数: %s" % (helpBattlePlayer.getThanksGiftCountDict))
|
| | | return
|
| | |
|
| | | def __AddFakeHelpPlayer(curPlayer, addCount):
|
| | |
| | | helpBattlePlayer.vipLV = random.randint(0, 10)
|
| | | helpBattlePlayer.checkInCount = 100
|
| | | helpBattlePlayer.checkInTime = curTime
|
| | | helpBattlePlayer.todayXianyuanCoin = 0
|
| | | addFakeIDList.append(fakeID)
|
| | |
|
| | | GameWorld.DebugAnswer(curPlayer, "添加假助战登记 %s" % addFakeIDList)
|
| | |
| | | GameWorldAverageLv.OpenWorldAverageLv()
|
| | | #倒计时离队处理
|
| | | PlayerTeam.DoCountdownLeaveTeamLogic(tick)
|
| | | #副本助战
|
| | | PlayerFBHelpBattle.OnMinuteProcess()
|
| | | #红包
|
| | | PlayerFamilyRedPacket.OnRedPacketMinuteProcess()
|
| | | #拍卖行
|
| | |
| | | GameWorldActionControl.OnPlayerLogin(curPlayer)
|
| | | #玩家等级记录
|
| | | PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()
|
| | | #副本助战
|
| | | PlayerFBHelpBattle.OnHelpPlayerLogin(curPlayer)
|
| | | #跨服PK
|
| | | CrossRealmPK.OnPlayerLogin(curPlayer)
|
| | | #诛仙BOSS
|
| | |
| | |
|
| | | elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr10:
|
| | | PlayerControl.SetChatBubbleBox(curPlayer, packValue)
|
| | | |
| | | elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr11:
|
| | | PlayerControl.SetTodayXianyuanCoin(curPlayer, packValue)
|
| | |
|
| | | elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr13:
|
| | | PlayerControl.SetPlayerServerGroupID(curPlayer, packValue)
|
| | |
| | | import IpyGameDataPY
|
| | | import NetPackCommon
|
| | | import PyGameDataStruct
|
| | | import PlayerFBHelpBattle
|
| | | import ChPyNetSendPack
|
| | | import PlayerControl
|
| | | import PlayerFamily
|
| | |
| | | playerThanksList = thanksMgr.playerThanksDict[playerID]
|
| | | playerThanksList.append(dbData)
|
| | |
|
| | | # 已经感谢的
|
| | | else:
|
| | | for assistPlayerID, assistPlayerInfo in dbData.AssistPlayerDict.items():
|
| | | if "IsGet" in assistPlayerInfo:
|
| | | # 已经接受感谢奖励的不再处理
|
| | | continue
|
| | | |
| | | if assistPlayerID not in thanksMgr.assistPlayerThanksDict:
|
| | | thanksMgr.assistPlayerThanksDict[assistPlayerID] = []
|
| | | assistPlayerThanksList = thanksMgr.assistPlayerThanksDict[assistPlayerID]
|
| | | assistPlayerThanksList.append(dbData)
|
| | | for assistPlayerID, assistPlayerInfo in dbData.AssistPlayerDict.items():
|
| | | if "IsGet" in assistPlayerInfo:
|
| | | # 已经接受感谢奖励的不再处理
|
| | | continue
|
| | | |
| | | if assistPlayerID not in thanksMgr.assistPlayerThanksDict:
|
| | | thanksMgr.assistPlayerThanksDict[assistPlayerID] = []
|
| | | assistPlayerThanksList = thanksMgr.assistPlayerThanksDict[assistPlayerID]
|
| | | assistPlayerThanksList.append(dbData)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | curPlayer = playerMgr.FindPlayerByID(playerID)
|
| | | if not curPlayer:
|
| | | continue
|
| | | __AddAssistThanks(curPlayer, assistAwardItemID, mapID, lineID, assistPlayerDict, npcID)
|
| | | AddNewAssistThanks(curPlayer, assistAwardItemID, mapID, lineID, assistPlayerDict, npcID)
|
| | |
|
| | | return
|
| | |
|
| | | def __AddAssistThanks(curPlayer, itemID, mapID, lineID, assistPlayerDict, npcID=0, exData=""):
|
| | | def AddNewAssistThanks(curPlayer, itemID, mapID, lineID, assistPlayerDict, npcID=0, exData=""):
|
| | | ## 添加协助感谢数据
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
| | | assistThanksMgr = PyDataManager.GetPlayerAssistThanksPyManager()
|
| | | OnInitAssistThanksData(assistThanksMgr, newThanks)
|
| | |
|
| | | GameWorld.DebugLog("增加协助感谢: mapID=%s,lineID=%s,npcID=%s,exData=%s" % (mapID, lineID, npcID, exData), playerID)
|
| | | GameWorld.DebugLog("增加协助感谢: itemID=%s,mapID=%s,lineID=%s,npcID=%s,exData=%s" % (itemID, mapID, lineID, npcID, exData), playerID)
|
| | | return
|
| | |
|
| | | #// B0 14 使用协助感谢礼盒 #tagCGUseAssistThanksGift
|
| | |
| | | queryData = [itemID]
|
| | | QueryPlayerResult_PlayerAssist(curPlayer, "UseAssistThanksGift", queryData)
|
| | |
|
| | | # 加入协助玩家接收感谢列表
|
| | | # 通知协助玩家可接收的感谢个数
|
| | | playerMgr = GameWorld.GetPlayerManager()
|
| | | for assistPlayerID in useThanks.AssistPlayerDict.keys():
|
| | | if assistPlayerID not in assistThanksMgr.assistPlayerThanksDict:
|
| | | assistThanksMgr.assistPlayerThanksDict[assistPlayerID] = []
|
| | | assistPlayerThanksList = assistThanksMgr.assistPlayerThanksDict[assistPlayerID]
|
| | | assistPlayerThanksList.append(useThanks)
|
| | | assistPlayer = playerMgr.FindPlayerByID(assistPlayerID)
|
| | | if assistPlayer:
|
| | | SyncCanGetAssistThanksGiftCount(assistPlayer, len(assistPlayerThanksList))
|
| | | SyncCanGetAssistThanksGiftCount(assistPlayer)
|
| | | return
|
| | |
|
| | | #// B0 15 接收协助感谢礼物 #tagCGGetAssistThanksGift
|
| | |
| | | GameWorld.ErrLog("玩家没有可接收感谢的协助感谢礼盒!", playerID)
|
| | | return
|
| | | assistPlayerThanksList = assistThanksMgr.assistPlayerThanksDict[playerID]
|
| | | if not assistPlayerThanksList:
|
| | | getThanks = None
|
| | | for thanks in assistPlayerThanksList:
|
| | | if thanks.ThanksState:
|
| | | getThanks = thanks
|
| | | break
|
| | | if not getThanks:
|
| | | GameWorld.ErrLog("找不到玩家可接收感谢的协助感谢礼盒!", playerID)
|
| | | return
|
| | | getThanks = assistPlayerThanksList[0] # 默认接收第一个
|
| | | itemID = getThanks.ItemID
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("AssistThanksGift", itemID)
|
| | | if not ipyData:
|
| | |
| | | if getThanks in assistThanksMgr.allAssistThanksList:
|
| | | assistThanksMgr.allAssistThanksList.remove(getThanks)
|
| | |
|
| | | assistPlayerThanksList.pop(0) # 移除
|
| | | assistPlayerThanksList.remove(getThanks) # 移除
|
| | |
|
| | | updateTodayGiftCount = todayGiftCount + 1
|
| | | # 更新当天该礼盒ID已领取次数
|
| | |
| | | assistPlayerInfoDict = thanks.AssistPlayerDict[playerID]
|
| | | assistPlayerInfoDict["TodayGiftCount"] = updateTodayGiftCount
|
| | |
|
| | | SyncCanGetAssistThanksGiftCount(curPlayer, len(assistPlayerThanksList))
|
| | | SyncCanGetAssistThanksGiftCount(curPlayer, True)
|
| | |
|
| | | # 通知地图
|
| | | isCurDailyDate = getThanks.DailyDateStr == GameWorld.GetDailyDateStr()
|
| | | |
| | | # 如果是镜像协助的,更新今日接收感谢礼盒次数
|
| | | if isCurDailyDate:
|
| | | if IpyGameDataPY.GetIpyGameDataNotLog("FBHelpBattle", getThanks.MapID, getThanks.LineID):
|
| | | PlayerFBHelpBattle.UpdateGetThanksGiftCountDict(curPlayer, itemID, updateTodayGiftCount)
|
| | | |
| | | # 通知地图
|
| | | queryData = [itemID, isExtraAward, isCurDailyDate, updateTodayGiftCount]
|
| | | QueryPlayerResult_PlayerAssist(curPlayer, "GetAssistThanksGift", queryData)
|
| | | return
|
| | |
|
| | | def SyncCanGetAssistThanksGiftCount(curPlayer, canGetCount=None):
|
| | | def SyncCanGetAssistThanksGiftCount(curPlayer, isForce=False):
|
| | | ## 通知可接收协助感谢礼物个数
|
| | | if canGetCount == None:
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | assistThanksMgr = PyDataManager.GetPlayerAssistThanksPyManager()
|
| | | if playerID not in assistThanksMgr.assistPlayerThanksDict:
|
| | | return
|
| | | assistPlayerThanksList = assistThanksMgr.assistPlayerThanksDict[playerID]
|
| | | if not assistPlayerThanksList:
|
| | | return
|
| | | canGetCount = len(assistPlayerThanksList)
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | assistThanksMgr = PyDataManager.GetPlayerAssistThanksPyManager()
|
| | | if playerID not in assistThanksMgr.assistPlayerThanksDict:
|
| | | return
|
| | | assistPlayerThanksList = assistThanksMgr.assistPlayerThanksDict[playerID]
|
| | | canGetCount = 0
|
| | | for thanks in assistPlayerThanksList:
|
| | | if thanks.ThanksState:
|
| | | canGetCount += 1
|
| | | |
| | | if not canGetCount and not isForce:
|
| | | return
|
| | | |
| | | countPack = ChPyNetSendPack.tagGCCanGetAssistThanksGiftCount()
|
| | | countPack.CanGetCount = canGetCount
|
| | | NetPackCommon.SendFakePack(curPlayer, countPack)
|
| | |
| | | def GetChatBubbleBox(curPlayer): return curPlayer.GetExAttr10()
|
| | | def SetChatBubbleBox(curPlayer, value): return curPlayer.SetExAttr10(value)
|
| | |
|
| | | ##今日已获得仙缘币
|
| | | def GetTodayXianyuanCoin(curPlayer): return curPlayer.GetExAttr11()
|
| | | def SetTodayXianyuanCoin(curPlayer, value): return curPlayer.SetExAttr11(value)
|
| | |
|
| | | ##玩家主动退出仙盟时间(<100代表退出次数)
|
| | | def SetLeaveFamilyTime(curPlayer, value, isSyncMap=True):
|
| | | curPlayer.SetExAttr12(value)
|
| | |
| | | import IpyGameDataPY
|
| | | import PlayerViewCache
|
| | | import IPY_GameServer
|
| | | import PlayerControl
|
| | | import PlayerAssist
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | import random
|
| | | import time
|
| | |
| | | MaxRobotID = 100 # 最大机器人NPC定义ID
|
| | |
|
| | | Def_RecType_CheckInPlayer = ShareDefine.Def_UniversalGameRecType_FBHelpBattleCheckInPlayer
|
| | | Def_RecType_HelpRecord = ShareDefine.Def_UniversalGameRecType_FBHelpBattleRecord
|
| | |
|
| | | ## 助战玩家简要信息
|
| | | class HelpBattlePlayer():
|
| | |
| | | self.checkInCount = 0 # 累计登记次数
|
| | | self.checkInTime = 0
|
| | | self.todayHelpCountDict = {} # 今天已助战次数 {(mapID, lineID):count, ...}, 通用次数时lineID默认为0
|
| | | self.todayXianyuanCoin = 0 # 今日已获得仙缘币
|
| | | return
|
| | |
|
| | | ## 助战记录 - 目前只记录未通知玩家的助战信息
|
| | | class FBHelpBattleRecord():
|
| | | |
| | | def __init__(self):
|
| | | self.callPlayerID = 0 # 召唤他的玩家ID
|
| | | self.callPlayerName = ""
|
| | | self.mapID = 0
|
| | | self.funcLineID = 0
|
| | | self.xianyuanCoinAdd = 0 # 0代表到达上限
|
| | | self.relation = 0 # 当时的关系
|
| | | self.vipLV = 0 # 当时的VIP等级
|
| | | self.recordTime = 0 # 记录的时间
|
| | | self.getThanksGiftCountDict = {} # 协助方今日接收该感谢礼盒次数 {itemID:count, ...}
|
| | | return
|
| | |
|
| | | def OnServerStart():
|
| | |
| | | helpBattlePlayer.realmLV = int(str(value5)[-3:-1])
|
| | | helpBattlePlayer.job = value5 % 10
|
| | | helpBattlePlayer.playerName = recData.GetStrValue1()
|
| | | helpBattlePlayer.todayXianyuanCoin = int(recData.GetStrValue2())
|
| | | helpCountDictStr = recData.GetStrValue3()
|
| | | strValue3 = recData.GetStrValue3()
|
| | | strValue3List = strValue3.split("|")
|
| | | helpCountDictStr = strValue3List[0] if len(strValue3List) > 0 else "{}"
|
| | | getThanksGiftCountDictStr = strValue3List[1] if len(strValue3List) > 1 else "{}"
|
| | | |
| | | if helpCountDictStr.startswith("{") and helpCountDictStr.endswith("}"):
|
| | | helpBattlePlayer.todayHelpCountDict = eval(helpCountDictStr)
|
| | | else:
|
| | | GameWorld.ErrLog("LoadCheckInPlayerError: helpCountDictStr=%s" % helpCountDictStr, playerID)
|
| | | |
| | | if getThanksGiftCountDictStr.startswith("{") and getThanksGiftCountDictStr.endswith("}"):
|
| | | helpBattlePlayer.getThanksGiftCountDict = eval(getThanksGiftCountDictStr)
|
| | | else:
|
| | | GameWorld.ErrLog("LoadCheckInPlayerError: getThanksGiftCountDictStr=%s" % getThanksGiftCountDictStr, playerID)
|
| | | PyGameData.g_fbHelpBattleCheckInPlayerDict[playerID] = helpBattlePlayer
|
| | | GameWorld.Log("加载助战登记玩家记录: %s" % len(PyGameData.g_fbHelpBattleCheckInPlayerDict))
|
| | | |
| | | helpRecordRecList = universalRecMgr.GetTypeList(Def_RecType_HelpRecord)
|
| | | for index in xrange(helpRecordRecList.Count()):
|
| | | recData = helpRecordRecList.At(index)
|
| | | playerID = recData.GetValue1()
|
| | | |
| | | helpRecord = FBHelpBattleRecord()
|
| | | helpRecord.callPlayerID = int(recData.GetStrValue2())
|
| | | helpRecord.callPlayerName = recData.GetStrValue1()
|
| | | helpRecord.mapID = recData.GetValue2()
|
| | | helpRecord.funcLineID = recData.GetValue3()
|
| | | helpRecord.xianyuanCoinAdd = recData.GetValue4()
|
| | | helpRecord.relation = recData.GetValue5() % 10
|
| | | helpRecord.vipLV = recData.GetValue5() / 10
|
| | | helpRecord.recordTime = recData.GetTime()
|
| | | |
| | | unNotifyRecordList = PyGameData.g_fbHelpBattleRecord.get(playerID, [])
|
| | | unNotifyRecordList.append(helpRecord)
|
| | | PyGameData.g_fbHelpBattleRecord[playerID] = unNotifyRecordList
|
| | | |
| | | GameWorld.Log("加载玩家未同步助战: %s" % len(PyGameData.g_fbHelpBattleRecord))
|
| | | for playerID, helpList in PyGameData.g_fbHelpBattleRecord.items():
|
| | | GameWorld.Log("加载玩家未同步助战记录: %s" % (len(helpList)), playerID)
|
| | | return
|
| | |
|
| | | def OnServerClose():
|
| | | GameWorld.Log("关服保存助战相关信息...")
|
| | | universalRecMgr = GameWorld.GetUniversalRecMgr()
|
| | | universalRecMgr.Delete(Def_RecType_CheckInPlayer)
|
| | | universalRecMgr.Delete(Def_RecType_HelpRecord)
|
| | |
|
| | | GameWorld.Log("保存助战登记玩家记录: %s" % len(PyGameData.g_fbHelpBattleCheckInPlayerDict))
|
| | | checkInPlayerRecList = universalRecMgr.GetTypeList(Def_RecType_CheckInPlayer)
|
| | |
| | | recData.SetValue4(checkInPlayer.checkInCount)
|
| | | recData.SetValue5(int("%d%02d%02d%d" % (checkInPlayer.playerLV, checkInPlayer.vipLV, checkInPlayer.realmLV, checkInPlayer.job)))
|
| | | recData.SetStrValue1(checkInPlayer.playerName)
|
| | | recData.SetStrValue2(str(checkInPlayer.todayXianyuanCoin))
|
| | | recData.SetStrValue3(str(checkInPlayer.todayHelpCountDict).replace(" ", ""))
|
| | | strValue3 = "%s|%s" % (str(checkInPlayer.todayHelpCountDict).replace(" ", ""), |
| | | str(checkInPlayer.getThanksGiftCountDict).replace(" ", ""))
|
| | | recData.SetStrValue3(strValue3)
|
| | |
|
| | | GameWorld.Log("保存助战未同步记录: %s" % len(PyGameData.g_fbHelpBattleRecord))
|
| | | helpRecordRecList = universalRecMgr.GetTypeList(Def_RecType_HelpRecord)
|
| | | for playerID, helpList in PyGameData.g_fbHelpBattleRecord.items():
|
| | | GameWorld.Log("玩家未同步助战记录: %s" % (len(helpList)), playerID)
|
| | | for helpRecord in helpList:
|
| | | recData = helpRecordRecList.AddRec()
|
| | | recData.SetTime(helpRecord.recordTime)
|
| | | recData.SetValue1(playerID)
|
| | | recData.SetValue2(helpRecord.mapID)
|
| | | recData.SetValue3(helpRecord.funcLineID)
|
| | | recData.SetValue4(helpRecord.xianyuanCoinAdd)
|
| | | recData.SetValue5(helpRecord.vipLV*10+helpRecord.relation)
|
| | | recData.SetStrValue1(helpRecord.callPlayerName)
|
| | | recData.SetStrValue2(str(helpRecord.callPlayerID))
|
| | | return
|
| | |
|
| | | def HelpBattleOnDay():
|
| | |
| | | GameWorld.Log("清除超时助战登记玩家: curTime=%s,checkInTime=%s" % (curTime, checkInTime), playerID)
|
| | | continue
|
| | | checkInPlayer.todayHelpCountDict = {}
|
| | | checkInPlayer.todayXianyuanCoin = 0
|
| | | return
|
| | |
|
| | | def OnHelpPlayerLogin(curPlayer):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if playerID not in PyGameData.g_fbHelpBattleRecord:
|
| | | return
|
| | | unNotifyRecordList = PyGameData.g_fbHelpBattleRecord.pop(playerID)
|
| | | SendMapServer_FBHelpBattleRecord(curPlayer, unNotifyRecordList, True)
|
| | | return
|
| | |
|
| | | def OnMinuteProcess():
|
| | | ''' 每分钟处理
|
| | | 前X次登记后,分别在登记后的第X分钟赠送玩家宗门试炼一层的助战仙缘币,并伪造一份助战记录。
|
| | | 助战记录随机从助战登记库里随机挑选1名除自己外的玩家,如果没有玩家,该特殊逻辑不生效
|
| | | '''
|
| | | |
| | | if not PyGameData.g_fbHelpBattleCheckInPlayerDict:
|
| | | return
|
| | | helpPlayerIDList = PyGameData.g_fbHelpBattleCheckInPlayerDict.keys()
|
| | | |
| | | curTime = int(time.time())
|
| | | |
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | newbieCheckInCount = IpyGameDataPY.GetFuncCfg("HelpBattleCheckIn", 2) # 新手前X次登记特殊逻辑
|
| | | sysAutoCallHelpDict = IpyGameDataPY.GetFuncEvalCfg("HelpBattleCheckIn", 3) # 系统自动召唤助战,默认功能线路0, {登记多少分钟后:[随机地图ID, ...], ...}
|
| | | for playerID, checkInPlayer in PyGameData.g_fbHelpBattleCheckInPlayerDict.items():
|
| | | |
| | | curPlayer = playerManager.FindPlayerByID(playerID)
|
| | | |
| | | if not curPlayer or PlayerControl.GetIsTJG(curPlayer):
|
| | | #GameWorld.DebugLog(" 离线或脱机不处理, playerID=%s" % playerID)
|
| | | continue
|
| | | |
| | | checkInCount = checkInPlayer.checkInCount
|
| | | if checkInCount > newbieCheckInCount:
|
| | | #GameWorld.DebugLog(" 超过规定的登记次数,不处理, playerID=%s,checkInCount=%s > newbieCheckInCount=%s" |
| | | # % (playerID, checkInCount, newbieCheckInCount))
|
| | | continue
|
| | | |
| | | checkInTime = checkInPlayer.checkInTime
|
| | | checkInMinutes = (curTime - checkInTime) / 60 |
| | | if checkInMinutes not in sysAutoCallHelpDict:
|
| | | #GameWorld.DebugLog(" 签到时间不满足,不处理, playerID=%s,checkInMinutes=%s not in %s" |
| | | # % (playerID, checkInMinutes, sysAutoCallHelpDict))
|
| | | continue
|
| | | |
| | | randHelpMapList = sysAutoCallHelpDict[checkInMinutes]
|
| | | # 随机一个不是自己的登记玩家
|
| | | for _ in xrange(20):
|
| | | randPlayerID = random.choice(helpPlayerIDList)
|
| | | if randPlayerID != playerID:
|
| | | break
|
| | | |
| | | # 只有自己不处理
|
| | | if randPlayerID == playerID:
|
| | | #GameWorld.DebugLog(" 登记玩家只有自己,不处理, playerID=%s" % (playerID))
|
| | | continue
|
| | | |
| | | randHelpMapID = random.choice(randHelpMapList)
|
| | | lineID = 0 # 默认0
|
| | | |
| | | helpBattlePlayer = PyGameData.g_fbHelpBattleCheckInPlayerDict[randPlayerID]
|
| | | relation = __GetHelpBattleRelation(curPlayer, helpBattlePlayer)
|
| | | calledPlayerID = playerID # 因为这里是系统模拟玩家被召唤助战,所以被召唤玩家就是当前被处理的玩家ID
|
| | | GameWorld.DebugLog(" 系统模拟召唤新手登记玩家: checkInMinutes=%s,playerID=%s,callPlayerID=%s" % (checkInMinutes, playerID, randPlayerID))
|
| | | |
| | | calledPlayerDict = {calledPlayerID:relation}
|
| | | msgList = ["Call", randHelpMapID, lineID, calledPlayerDict]
|
| | | __DoFBHelpBattleCall(randPlayerID, helpBattlePlayer.playerName, msgList)
|
| | | |
| | | checkInPlayer.getThanksGiftCountDict = {}
|
| | | return
|
| | |
|
| | | ## 是否在助战登记列表里
|
| | |
| | | # 扫荡召唤
|
| | | elif cmd == "SweepCall":
|
| | | result = __DoFBHelpBattleSweepCall(curPlayer, msgList)
|
| | | |
| | | |
| | | # 协助完成
|
| | | elif cmd == "AssistFinish":
|
| | | __DoAssistFinish(curPlayer, msgList)
|
| | | return
|
| | | |
| | | if result == None:
|
| | | return
|
| | |
|
| | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | curCache = PlayerViewCache.FindViewCache(playerID)
|
| | | haveViewCache = 1 if curCache else 0
|
| | | todayXianyuanCoin = PlayerControl.GetTodayXianyuanCoin(curPlayer)
|
| | |
|
| | | helpBattlePlayer = PyGameData.g_fbHelpBattleCheckInPlayerDict.get(playerID)
|
| | | if not helpBattlePlayer:
|
| | |
| | | helpBattlePlayer.vipLV = curPlayer.GetVIPLv()
|
| | | helpBattlePlayer.checkInCount = checkInCount + 1
|
| | | helpBattlePlayer.checkInTime = curTime
|
| | | helpBattlePlayer.todayXianyuanCoin = todayXianyuanCoin
|
| | |
|
| | | isOK = 1 # 默认成功
|
| | | GameWorld.Log("玩家助战登记: playerLV=%s,fightPower=%s,familyID=%s,vipLV=%s,todayXianyuanCoin=%s,checkInCount=%s,haveViewCache=%s" |
| | | % (curPlayer.GetLV(), fightPower, curPlayer.GetFamilyID(), curPlayer.GetVIPLv(), todayXianyuanCoin, checkInCount + 1, haveViewCache), playerID)
|
| | | GameWorld.Log("玩家助战登记: playerLV=%s,fightPower=%s,familyID=%s,vipLV=%s,checkInCount=%s,haveViewCache=%s" |
| | | % (curPlayer.GetLV(), fightPower, curPlayer.GetFamilyID(), curPlayer.GetVIPLv(), checkInCount + 1, haveViewCache), playerID)
|
| | | return [isOK, haveViewCache]
|
| | |
|
| | | def UpdateCheckInPlayerInfo(playerID, fightPower, familyID, playerName):
|
| | |
| | | helpBattlePlayer = PyGameData.g_fbHelpBattleCheckInPlayerDict[playerID]
|
| | | if refreshType == IPY_GameServer.CDBPlayerRefresh_LV:
|
| | | helpBattlePlayer.playerLV = value
|
| | | elif refreshType == IPY_GameServer.CDBPlayerRefresh_ExAttr11:
|
| | | helpBattlePlayer.todayXianyuanCoin = value |
| | | elif refreshType == IPY_GameServer.CDBPlayerRefresh_VIPLv:
|
| | | helpBattlePlayer.vipLV = value
|
| | | else:
|
| | |
| | |
|
| | | def __DoFBHelpBattleSweepCall(curPlayer, msgList):
|
| | | ''' 扫荡助战列表刷新且直接召唤
|
| | | 随机选择免费的玩家、过滤仙缘币已达上限或溢出的玩家
|
| | | 随机选择免费的玩家
|
| | | '''
|
| | | mapID, funcLineID = msgList[1:]
|
| | |
|
| | |
| | | helpCountKey = (mapID, helpCountLineID)
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | tagPlayerID = playerID
|
| | | tagPlayerName = curPlayer.GetName()
|
| | | GameWorld.Log("扫荡刷新助战列表: mapID=%s,funcLineID=%s,helpCountLineID=%s" % (mapID, funcLineID, helpCountLineID), playerID)
|
| | |
|
| | | curTime = int(time.time())
|
| | |
| | | checkInValidHours = IpyGameDataPY.GetFuncCfg("HelpBattleCheckIn", 1) # 登记有效时长,小时
|
| | | checkInValidSeconds = checkInValidHours * 3600
|
| | |
|
| | | xianyuanCoinUpper = IpyGameDataPY.GetFuncCfg("HelpBattlePoint", 1) # 每日仙缘币上限
|
| | | baseHelpPoint = fbFuncIpyData.GetHelpPoint() # 助战 - 基础仙缘币
|
| | | relationCoinAddDict = IpyGameDataPY.GetFuncEvalCfg("HelpBattlePoint", 2, {}) # 社交关系加成 {"社交关系":[过关加成, 助战加成], ...} |
| | | |
| | | isSweep = True
|
| | | onlyFree = True
|
| | | checkInPlayerIDList = PyGameData.g_fbHelpBattleCheckInPlayerDict.keys()
|
| | | random.shuffle(checkInPlayerIDList) # 刷新纯随机
|
| | |
| | | checkInValidSeconds, curTime, helpCountKey, dayFreeHelpCount, onlyFree)
|
| | | if not canHelp:
|
| | | continue
|
| | | |
| | | helpBattlePlayer.todayHelpCountDict[helpCountKey] = helpBattlePlayer.todayHelpCountDict.get(helpCountKey, 0) + 1
|
| | | relation = __GetHelpBattleRelation(curPlayer, helpBattlePlayer)
|
| | | if not __DoCallHelpPlayer(tagPlayerID, tagPlayerName, helpBattlePlayer, relation, mapID, funcLineID, helpCountKey, isSweep, |
| | | curTime, xianyuanCoinUpper, relationCoinAddDict, baseHelpPoint):
|
| | | continue
|
| | | |
| | | helpBattlePlayerDict[checkInPlayerID] = __GetNotifyMapServerHelpPlayerInfoDict(helpBattlePlayer, needGoldCall, helpBattlePlayer.job, relation)
|
| | |
|
| | | # 不足的机器人NPC补足
|
| | |
| | |
|
| | | GameWorld.Log(" helpBattlePlayerDict=%s" % (helpBattlePlayerDict), playerID)
|
| | | return [helpBattlePlayerDict]
|
| | |
|
| | | def __DoCallHelpPlayer(callPlayerID, callPlayerName, helpBattlePlayer, relation, mapID, funcLineID, helpCountKey, isSweep, curTime, |
| | | xianyuanCoinUpper, relationCoinAddDict, baseHelpPoint):
|
| | | |
| | | calledPlayerID = helpBattlePlayer.playerID
|
| | | addCoinRate = 10000 # 基础倍率
|
| | | playerXianyuanCoinUpper = xianyuanCoinUpper
|
| | | relationAddList = relationCoinAddDict.get(str(relation), [])
|
| | | relationAdd = relationAddList[1] if len(relationAddList) == 2 else 0
|
| | | |
| | | todayXianyuanCoin = helpBattlePlayer.todayXianyuanCoin # 今日已获得仙缘币
|
| | | vipLV = helpBattlePlayer.vipLV
|
| | | if vipLV:
|
| | | xianyuanCoinUpperAdd = PlayerControl.GetPrivilegeValue(vipLV, ChConfig.VIPPrivilege_XianyuanCoinUpperAdd)
|
| | | xianyuanCoinAddPer = PlayerControl.GetPrivilegeValue(vipLV, ChConfig.VIPPrivilege_XianyuanCoinAddPer)
|
| | | |
| | | playerXianyuanCoinUpper += xianyuanCoinUpperAdd
|
| | | addCoinRate += xianyuanCoinAddPer
|
| | | |
| | | # 仙缘币公式=(通关仙缘币或助战仙缘币+社交关系加成)*VIP倍数
|
| | | coinAdd = int((baseHelpPoint + relationAdd) * addCoinRate / 10000.0)
|
| | | canAddMax = max(playerXianyuanCoinUpper - todayXianyuanCoin, 0)
|
| | | |
| | | # 扫荡不可溢出
|
| | | if isSweep and coinAdd > canAddMax:
|
| | | GameWorld.DebugLog(" 今日仙缘币已达上限, calledPlayerID=%s,coinAdd=%s > canAddMax=%s" % (calledPlayerID, coinAdd, canAddMax))
|
| | | return
|
| | | coinAddReal = min(coinAdd, canAddMax) # 实际加仙缘币
|
| | | |
| | | todayMapHelpCount = helpBattlePlayer.todayHelpCountDict.get(helpCountKey, 0) + 1
|
| | | helpBattlePlayer.todayHelpCountDict[helpCountKey] = todayMapHelpCount
|
| | | GameWorld.DebugLog(" 助战增加仙缘币: todayXianyuanCoin=%s,coinUpper=%s,canAddMax=%s,coinAdd=%s,coinAddReal=%s,todayMapHelpCount=%s" |
| | | % (todayXianyuanCoin, playerXianyuanCoinUpper, canAddMax, coinAdd, coinAddReal, todayMapHelpCount), calledPlayerID)
|
| | | |
| | | # GameServer 直接先加
|
| | | helpBattlePlayer.todayXianyuanCoin += coinAddReal
|
| | | |
| | | helpRecord = FBHelpBattleRecord()
|
| | | helpRecord.callPlayerID = callPlayerID # 召唤他的玩家ID
|
| | | helpRecord.callPlayerName = callPlayerName
|
| | | helpRecord.mapID = mapID
|
| | | helpRecord.funcLineID = funcLineID
|
| | | helpRecord.xianyuanCoinAdd = coinAddReal
|
| | | helpRecord.relation = relation
|
| | | helpRecord.vipLV = vipLV
|
| | | helpRecord.recordTime = curTime
|
| | | |
| | | calledPlayer = GameWorld.GetPlayerManager().FindPlayerByID(calledPlayerID)
|
| | | # 非脱机在线直接通知地图
|
| | | if calledPlayer and not PlayerControl.GetIsTJG(calledPlayer):
|
| | | SendMapServer_FBHelpBattleRecord(calledPlayer, [helpRecord])
|
| | | else:
|
| | | unNotifyRecordList = PyGameData.g_fbHelpBattleRecord.get(calledPlayerID, [])
|
| | | unNotifyRecordList.append(helpRecord)
|
| | | PyGameData.g_fbHelpBattleRecord[calledPlayerID] = unNotifyRecordList
|
| | | return True
|
| | |
|
| | | def __DoFBHelpBattleCall(callPlayerID, callPlayerName, msgList):
|
| | | ''' 助战召唤,不管最终过关与否,被召唤方都直接算助战成功,这里处理被召唤的,主动方在地图直接处理
|
| | |
| | | helpCountLineID = 0
|
| | | helpCountKey = (mapID, helpCountLineID)
|
| | |
|
| | | curTime = int(time.time())
|
| | | xianyuanCoinUpper = IpyGameDataPY.GetFuncCfg("HelpBattlePoint", 1) # 每日仙缘币上限
|
| | | baseHelpPoint = fbFuncIpyData.GetHelpPoint() # 助战 - 基础仙缘币
|
| | | relationCoinAddDict = IpyGameDataPY.GetFuncEvalCfg("HelpBattlePoint", 2, {}) # 社交关系加成 {"社交关系":[过关加成, 助战加成], ...} |
| | | GameWorld.DebugLog("召唤助战: mapID=%s, funcLineID=%s, helpCountKey=%s, calledPlayerDict=%s" % (mapID, funcLineID, helpCountKey, calledPlayerDict), callPlayerID)
|
| | | isSweep = False
|
| | | for calledPlayerID, relation in calledPlayerDict.items():
|
| | | for calledPlayerID in calledPlayerDict.keys():
|
| | | if calledPlayerID not in PyGameData.g_fbHelpBattleCheckInPlayerDict:
|
| | | continue
|
| | | helpBattlePlayer = PyGameData.g_fbHelpBattleCheckInPlayerDict[calledPlayerID]
|
| | | __DoCallHelpPlayer(callPlayerID, callPlayerName, helpBattlePlayer, relation, mapID, funcLineID, helpCountKey, isSweep, |
| | | curTime, xianyuanCoinUpper, relationCoinAddDict, baseHelpPoint)
|
| | | helpBattlePlayer.todayHelpCountDict[helpCountKey] = helpBattlePlayer.todayHelpCountDict.get(helpCountKey, 0) + 1
|
| | | return
|
| | |
|
| | | def SendMapServer_FBHelpBattleRecord(curPlayer, syncHelpRecordList, isLogin=False):
|
| | | if not syncHelpRecordList:
|
| | | return
|
| | | def __DoAssistFinish(curPlayer, msgList):
|
| | | ## 协助完成
|
| | |
|
| | | helpRecordList = []
|
| | | for record in syncHelpRecordList:
|
| | | helpRecordList.append([record.callPlayerID, record.callPlayerName, record.mapID, record.funcLineID, |
| | | record.xianyuanCoinAdd, record.relation, record.vipLV, record.recordTime])
|
| | | addXianyuanCoinMsg = str(["HelpRecord", helpRecordList, isLogin])
|
| | | curPlayer.MapServer_QueryPlayerResult(0, 0, 'FBHelpBattle', addXianyuanCoinMsg, len(addXianyuanCoinMsg))
|
| | | GameWorld.DebugLog(" MapServer_QueryPlayerResult %s" % addXianyuanCoinMsg, curPlayer.GetPlayerID())
|
| | | liheItemID, mapID, lineID, assistPlayerIDList = msgList[1:]
|
| | | |
| | | assistPlayerDict = {}
|
| | | for assistPlayerID in assistPlayerIDList:
|
| | | if assistPlayerID not in PyGameData.g_fbHelpBattleCheckInPlayerDict:
|
| | | continue
|
| | | helpBattlePlayer = PyGameData.g_fbHelpBattleCheckInPlayerDict[assistPlayerID]
|
| | | assistPlayerDict[assistPlayerID] = {"PlayerName":helpBattlePlayer.playerName, "Job":helpBattlePlayer.job, |
| | | "LV":helpBattlePlayer.playerLV, "RealmLV":helpBattlePlayer.realmLV,
|
| | | "TodayGiftCount":helpBattlePlayer.getThanksGiftCountDict.get(liheItemID, 0)}
|
| | | |
| | | # 插入新协助感谢
|
| | | PlayerAssist.AddNewAssistThanks(curPlayer, liheItemID, mapID, lineID, assistPlayerDict)
|
| | | return
|
| | |
|
| | | def UpdateGetThanksGiftCountDict(curPlayer, itemID, updateTodayGiftCount):
|
| | | ## 更新今日接收感谢礼盒次数
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | if playerID not in PyGameData.g_fbHelpBattleCheckInPlayerDict:
|
| | | return
|
| | | helpBattlePlayer = PyGameData.g_fbHelpBattleCheckInPlayerDict[playerID]
|
| | | helpBattlePlayer.getThanksGiftCountDict[itemID] = updateTodayGiftCount
|
| | | GameWorld.DebugLog(" 更新镜像协助今日接收感谢礼盒次数: itemID=%s,updateTodayGiftCount=%s" % (itemID, updateTodayGiftCount), playerID)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | g_bourseItemTradingTimeDict = {} # 物品开始交易的时间记录 {guid:tick}
|
| | |
|
| | | g_fbHelpBattleCheckInPlayerDict = {} # 副本助战玩家登记缓存 {playerID:HelpBattlePlayer, ...}
|
| | | g_fbHelpBattleRecord = {} # 未同步的副本助战记录 {playerID:[FBHelpBattleRecord, ...], ...}
|
| | |
|
| | | g_autoViceleaderDict = {}#自动安排副盟主的玩家记录{familyID:[]}
|
| | | g_forbidAutoViceleaderFamily = [] #禁止自动安排副盟主的仙盟[familyID,..]
|
| | |
| | |
|
| | | Def_BT_FCCostGold, #消费排行榜(仙界盛典)
|
| | | Def_BT_Campaign_RuneLV, #符印等级(开服活动榜)
|
| | | Def_BT_FBHelpBattle, #助战次数排行榜
|
| | | Def_BT_19,
|
| | | Def_BT_Campaign_GodWeaponLV, #神兵等级(开服活动榜) 20
|
| | | Def_BT_Campaign_Recharge, #累计充值(开服活动榜)
|
| | | Def_BT_Campaign_PetLV, #灵宠等级(开服活动榜)
|
| | |
| | | #排行榜Value1存储境界信息的榜单列表
|
| | | BTValue1_OfficialRankList = [Def_BT_FightPower, Def_BT_FightPower_Warrior, Def_BT_FightPower_Wizard, Def_BT_FightPower_Assassin,
|
| | | Def_BT_LV, Def_BT_FightPower_Horse, Def_BT_FightPower_Pet, Def_BT_TrialTower, Def_BT_OffLineEfficient,
|
| | | Def_BT_FBHelpBattle,
|
| | | ]
|
| | |
|
| | | ##---比率---
|
| | |
| | | CDBPlayerRefresh_RealmPoint, # 境界修炼点
|
| | | CDBPlayerRefresh_Ysog, # 魔精
|
| | | CDBPlayerRefresh_FamilyActivity, # 仙盟活跃令
|
| | | CDBPlayerRefresh_Xianyuancoin, # 仙缘币
|
| | | CDBPlayerRefresh_174,
|
| | | CDBPlayerRefresh_PKState, # 战斗状态 175
|
| | | CDBPlayerRefresh_BossState, # boss״̬
|
| | | CDBPlayerRefresh_BaseAtkMin, # 基础最小攻击
|
| | |
| | | TYPE_Price_Ysog = 14 # 魔精
|
| | | TYPE_Price_FamilyActivity = 15 # 仙盟活跃令
|
| | | TYPE_Price_FBHelpPoint = 16 # 副本助战积分, 废弃
|
| | | TYPE_Price_XianyuanCoin = 17 # 仙缘币
|
| | | TYPE_Price_Honor = 18 # 荣誉
|
| | | TYPE_Price_Rune = 23 # 符印精华点
|
| | | TYPE_Price_RuneSplinters = 24 # 符印碎片
|
| | |
| | | TYPE_Price_RealmPoint:CDBPlayerRefresh_RealmPoint,
|
| | | TYPE_Price_Ysog:CDBPlayerRefresh_Ysog,
|
| | | TYPE_Price_FamilyActivity:CDBPlayerRefresh_FamilyActivity,
|
| | | TYPE_Price_XianyuanCoin:CDBPlayerRefresh_Xianyuancoin,
|
| | | TYPE_Price_Danjing:CDBPlayerRefresh_Danjing,
|
| | | TYPE_Price_SoulDust:CDBPlayerRefresh_SoulDust,
|
| | | TYPE_Price_SoulSplinters:CDBPlayerRefresh_SoulSplinters,
|
| | |
| | | Def_UniversalGameRecType_YesterdayPlayerLVInfo,#昨日活跃玩家等级信息7
|
| | | Def_UniversalGameRecType_StoreServerCntRecord, #商店全服购买记录 8,
|
| | | Def_UniversalGameRecType_FBHelpBattleCheckInPlayer, #助战玩家登记记录9
|
| | | Def_UniversalGameRecType_FBHelpBattleRecord, #助战未同步记录10
|
| | | Def_UniversalGameRecType_10,
|
| | | Def_UniversalGameRecType_ZhuXianBossRecord, #诛仙BOSS结算记录11
|
| | | Def_UniversalGameRecType_LuckyTreasure, #幸运鉴宝大奖记录12
|
| | | Def_UniversalGameRecType_FairyDomain, #缥缈仙域事件次数记录13
|
| | |
| | | Writer = xdh
|
| | | Releaser = xdh
|
| | | RegType = 0
|
| | | RegisterPackCount = 2
|
| | | RegisterPackCount = 3
|
| | |
|
| | | PacketCMD_1=0xA5
|
| | | PacketSubCMD_1=0x25
|
| | |
| | | PacketSubCMD_2=0x27
|
| | | PacketCallFunc_2=OnActivityPlaceStart
|
| | |
|
| | | PacketCMD_3=0xB0
|
| | | PacketSubCMD_3=0x28
|
| | | PacketCallFunc_3=OnActivityPlaceQuickFinish
|
| | |
|
| | | ;协助
|
| | | [PlayerAssist]
|
| | | ScriptName = Player\PlayerAssist.py
|
| | |
| | | Def_ItemID_SoulSplinters = 701 # 直接给聚魂碎片
|
| | | Def_ItemID_SoulCore = 702 # 直接给核心环
|
| | | Def_ItemID_Honor = 2141 # 直接给荣誉
|
| | | Def_ItemID_XianyuanCoin = 2138 # 直接给仙缘币
|
| | | Def_TransformItemIDList = [Def_ItemID_FamilyContribution, Def_ItemID_FamilyActive, Def_ItemID_SP, Def_ItemID_GoldPaper,
|
| | | Def_ItemID_RealmPoint, Def_ItemID_SilverMoney, Def_ItemID_BossReborn, Def_ItemID_Ysog,
|
| | | Def_ItemID_SoulDust, Def_ItemID_SoulSplinters, Def_ItemID_SoulCore, Def_ItemID_Honor, Def_ItemID_GoldMoney,
|
| | | Def_ItemID_XianyuanCoin]
|
| | | Def_ItemID_SoulDust, Def_ItemID_SoulSplinters, Def_ItemID_SoulCore, Def_ItemID_Honor, Def_ItemID_GoldMoney]
|
| | | #---------------------------------------------------------------------
|
| | | #写死的物品类型都放这边
|
| | | Def_ItemType_All = -1 #所有类型
|
| | |
| | | Def_PDict_EquipTotalBaseDef = "EquipTotalBaseDef" # 装备累计基础防御
|
| | | Def_PDict_EquipTotalBaseHP = "EquipTotalBaseHP" # 装备累计基础生命
|
| | |
|
| | | Def_PDict_TodayXianyuanCoinOnLogin = "TodayXianyuanCoinOnLogin" # 登录时触发过天后今日还需要增加的仙缘币
|
| | | Def_PDict_LoginAddTodayXianyuanCoinTime = "LoginAddTodayXianyuanCoinTime" # 登录时记录当天增加仙缘币的time值
|
| | |
|
| | | #---玩家字典KEY,存于数据库---
|
| | | #===========================================================================
|
| | | # //玩家通用字典 RoleNomalDict
|
| | |
| | | Def_PDict_TodayCTGCount = "TodayCTGCount_%s" # 当日充值次数,参数(CTG对应的商品记录ID)
|
| | | Def_PDict_CTGGoodsBuyCount = "CTGGoodsBuyCount_%s" # 对应充值商品已购买次数,参数(CTG对应的商品记录ID)
|
| | | Def_PDict_DayFreeGoldGiftState = "DayFreeGoldGiftState" # 每日免费直购礼包领取记录
|
| | | Def_PDict_GoldGiftFirstRecord = "GoldGiftFirstRecord" # 首充领取记录,0-未领取;1-已领取
|
| | | Def_PDict_GoldGiftFirstRecord = "GoldGiftFirstRecord" # 首充领取记录,按位记录首充第x天是否已领取
|
| | | Def_PDict_FirstGoldServerDay = "FirstGoldServerDay" # 首充时的开服天
|
| | | Def_PDict_FirstGoldRemainTime = "FirstGoldRemainTime" # 首充提示剩余时间
|
| | | Def_PDict_FirstGoldTipStartTime = "FirstGoldTipStartTime" # 首充提示开始时间
|
| | | Def_PDict_FirstGoldTry = "FirstGoldTry" # 首充试用状态 0-不可试用 1-可试用 2-已试用
|
| | | Def_PDict_DailyChargeState = "DailyChargeState" # 当日是否已充值
|
| | | Def_PDict_SuperGiftStartTime = "SuperGiftStartTime" # 超值礼包开始时间
|
| | | Def_PDict_DailyGoldChargeCnt = "DailyGoldChargeCnt" # 当日已充值数
|
| | | Def_PDict_IsReBorn = "Def_PDict_IsReBorn" # 是否回城复活
|
| | | Def_PDict_FamilyWarDailyReward = "FamilyWarDailyReward" # 王者仙盟每日俸禄领取状态
|
| | | Def_PDict_Family_Contribution = "FamilyContribution" #战盟贡献度
|
| | |
| | |
|
| | | #助战
|
| | | Def_PDict_HelpBattleCheckInCount = "HelpBattleCheckInCount" #助战登记次数, 登记次数*10+今日是否登记过
|
| | | Def_PDict_HelpBattleTotalCount = "HelpBattleTotalCount" #累计助战次数
|
| | | Def_PDict_FBRealHelpCount = "FBRealHelpCount_%s" #副本真实助战次数,仅针对真实进去打的副本,参数mapID
|
| | |
|
| | | #周狂欢
|
| | |
| | |
|
| | | # 活跃放置
|
| | | Def_PDict_ActivityCanCostTotalPoint = "ActivityCanCostTotalPoint" # 当前总活跃值(可消耗)
|
| | | Def_PDict_ActivityPlaceState = "ActivityPlaceState" # 活跃放置是否探索中
|
| | | Def_PDict_ActivityPlaceStartTime = "ActivityPlaceStartTime" # 活跃放置开始time值
|
| | | Def_PDict_ActivityPlaceRewardTotalCount = "ActivityPlaceRewardTotalCount" # 活跃放置总共累计奖励次数
|
| | | Def_PDict_ActivityPlaceRewardCount = "ActivityPlaceRewardCount" # 活跃放置累计奖励次数
|
| | | Def_PDict_ActivityPlaceRemainCount = "ActivityPlaceRemainCount" # 活跃放置剩余进行次数
|
| | | Def_PDict_ActivityPlaceRewardCount = "ActivityPlaceRewardCount" # 活跃放置本次启动已累计奖励次数
|
| | | Def_PDict_ActivityPlaceRewardTotalCount = "ActivityPlaceRewardTotalCount" # 活跃放置历史总共累计奖励次数
|
| | | Def_PDict_ActivityPlaceRewardItem = "ActivityPlaceItem" # 奖励物品个数
|
| | | Def_PDict_ActivityPlaceRewardItemID = "ActivityPlaceItemID_%s" # 奖励物品ID,参数(index)
|
| | | Def_PDict_ActivityPlaceRewardItemCount = "ActivityPlaceItemCount_%s" # 奖励物品个数,参数(index)
|
| | |
| | |
|
| | | #协助
|
| | | Def_PDict_GetThanksGiftCount = "GetThanksGiftCount_%s" # 协助方今日接收该感谢礼盒次数,参数(礼盒物品ID)
|
| | | Def_PDict_TodayAssistMoney = "TodayAssistMoney" # 今日已获得协助货币奖励
|
| | | Def_PDict_TodayAssistMoneySocial = "TodayAssistMoneySocial" # 今日已获得协助货币 社交关系额外加成
|
| | |
|
| | | #-------------------------------------------------------------------------------
|
| | | #可以从07 41封包购买的背包类型,和对应字典{背包类型:[字典key, 默认格子数]}
|
| | |
| | | VIPPrivilege_BindJadeWheel, #30 绑玉转盘次数
|
| | | VIPPrivilege_PrayElixir, #31 丹药祈福次数
|
| | | VIPPrivilege_32, #32 封魔坛自动挑战
|
| | | VIPPrivilege_XianyuanCoinUpperAdd, #33 仙缘币上限加成
|
| | | VIPPrivilege_XianyuanCoinAddPer, #34 仙缘币获得倍率加成(万分比)
|
| | | VIPPrivilege_33, #33
|
| | | VIPPrivilege_34, #34
|
| | | VIPPrivilege_35, #35 诛仙BOSS购买次数 - 副本总表统一处理
|
| | | VIPPrivilege_36, #36 仙丹批量炼制
|
| | | VIPPrivilege_BossHomeBuy, #37 BOSS之家购买次数
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B0 28 活跃放置快速完成 #tagCMActivityPlaceQuickFinish
|
| | |
|
| | | class tagCMActivityPlaceQuickFinish(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("FinishCount", c_ubyte), #完成次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB0
|
| | | self.SubCmd = 0x28
|
| | | 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 = 0xB0
|
| | | self.SubCmd = 0x28
|
| | | self.FinishCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMActivityPlaceQuickFinish)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B0 28 活跃放置快速完成 //tagCMActivityPlaceQuickFinish:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | FinishCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.FinishCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMActivityPlaceQuickFinish=tagCMActivityPlaceQuickFinish()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActivityPlaceQuickFinish.Cmd,m_NAtagCMActivityPlaceQuickFinish.SubCmd))] = m_NAtagCMActivityPlaceQuickFinish
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B0 27 活跃放置启动 #tagCMActivityPlaceStart
|
| | |
|
| | | class tagCMActivityPlaceStart(Structure):
|
| | |
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("RewardEndType", c_ubyte), #是否结算探索,后端处理奖励后自动启动下一次放置探索;0-无结算启动,1-倒计时结束结算,2-快速结算;
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | def Clear(self):
|
| | | self.Cmd = 0xB0
|
| | | self.SubCmd = 0x27
|
| | | self.RewardEndType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''// B0 27 活跃放置启动 //tagCMActivityPlaceStart:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | RewardEndType:%d
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.RewardEndType
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("FirstGoldRewardState", c_ubyte), #首充奖励是否已领奖
|
| | | ("FirstGoldRewardState", c_ubyte), #首充奖励领奖记录,按位记录首充第X天是否已领取,第1天为第0索引位
|
| | | ("FirstGoldTry", c_ubyte), #首充试用状态0-不可试用 1-可试用 2-已试用
|
| | | ("FirstGoldServerDay", c_ushort), #首充时是开服第几天,从1开始,0代表未记录充值
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.SubCmd = 0x02
|
| | | self.FirstGoldRewardState = 0
|
| | | self.FirstGoldTry = 0
|
| | | self.FirstGoldServerDay = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | FirstGoldRewardState:%d,
|
| | | FirstGoldTry:%d
|
| | | FirstGoldTry:%d,
|
| | | FirstGoldServerDay:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.FirstGoldRewardState,
|
| | | self.FirstGoldTry
|
| | | self.FirstGoldTry,
|
| | | self.FirstGoldServerDay
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | | class tagMCActivityPlaceInfo(Structure):
|
| | | Head = tagHead()
|
| | | PlaceState = 0 #(BYTE PlaceState)// 是否启动状态
|
| | | StartTime = 0 #(DWORD StartTime)// 开始探索time时间戳,完成一次探索会自动下一次探索并更新该时间
|
| | | PlaceCount = 0 #(BYTE PlaceCount)// 剩余未完成探索次数
|
| | | RewardCount = 0 #(BYTE RewardCount)// 累计未领取探索奖励次数
|
| | | RewardLen = 0 #(BYTE RewardLen)
|
| | | RewardInfo = "" #(String RewardInfo)//累计未领取探索奖励 [[itemID, count], ...]
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.PlaceState,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.StartTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PlaceCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RewardCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RewardLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RewardInfo,_pos = CommFunc.ReadString(_lpData, _pos,self.RewardLen)
|
| | |
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB0
|
| | | self.Head.SubCmd = 0x27
|
| | | self.PlaceState = 0
|
| | | self.StartTime = 0
|
| | | self.PlaceCount = 0
|
| | | self.RewardCount = 0
|
| | | self.RewardLen = 0
|
| | | self.RewardInfo = ""
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 4
|
| | | length += 1
|
| | | length += 1
|
| | | length += 1
|
| | | length += len(self.RewardInfo)
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.PlaceState)
|
| | | data = CommFunc.WriteDWORD(data, self.StartTime)
|
| | | data = CommFunc.WriteBYTE(data, self.PlaceCount)
|
| | | data = CommFunc.WriteBYTE(data, self.RewardCount)
|
| | | data = CommFunc.WriteBYTE(data, self.RewardLen)
|
| | | data = CommFunc.WriteString(data, self.RewardLen, self.RewardInfo)
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | PlaceState:%d,
|
| | | StartTime:%d,
|
| | | PlaceCount:%d,
|
| | | RewardCount:%d,
|
| | | RewardLen:%d,
|
| | | RewardInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.PlaceState,
|
| | | self.StartTime,
|
| | | self.PlaceCount,
|
| | | self.RewardCount,
|
| | | self.RewardLen,
|
| | | self.RewardInfo
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B0 07 今日协助活跃令信息 #tagMCTodayAssistMoneyInfo
|
| | |
|
| | | class tagMCTodayAssistMoneyInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("TodayAssistMoney", c_ushort), #今日已获得活跃令,不含社交加成
|
| | | ("SocialMoney", c_ushort), #社交额外加成
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB0
|
| | | 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 = 0xB0
|
| | | self.SubCmd = 0x07
|
| | | self.TodayAssistMoney = 0
|
| | | self.SocialMoney = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCTodayAssistMoneyInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B0 07 今日协助活跃令信息 //tagMCTodayAssistMoneyInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | TodayAssistMoney:%d,
|
| | | SocialMoney:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.TodayAssistMoney,
|
| | | self.SocialMoney
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCTodayAssistMoneyInfo=tagMCTodayAssistMoneyInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTodayAssistMoneyInfo.Cmd,m_NAtagMCTodayAssistMoneyInfo.SubCmd))] = m_NAtagMCTodayAssistMoneyInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 02 玩家时装皮肤激活状态 #tagMCClothesCoatSkinState
|
| | |
|
| | | class tagMCClothesCoatLVInfo(Structure):
|
| | |
| | | return
|
| | |
|
| | | if len(msgList) == 1 and not msgList[0]:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardTotalCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRemainCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardTotalCount, 0)
|
| | |
|
| | | rewardItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItem)
|
| | | for i in xrange(rewardItemCount):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemID % i, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemCount % i, 0)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItem, 0)
|
| | | |
| | | GameWorld.DebugAnswer(curPlayer, "重置活跃放置成功!")
|
| | | PlayerActivity.Sync_ActivityPlaceInfo(curPlayer)
|
| | | return
|
| | |
| | | def OnExec(curPlayer, msgList):
|
| | | curPlayer.SetChangeCoinPointTotal(0, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GoldGiftFirstRecord, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldServerDay, 0)
|
| | | PlayerGoldGift.Sync_FirstGoldInfo(curPlayer)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldTry, 0)
|
| | | # 重置今日已充值数
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DailyGoldChargeCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, 0)
|
| | | # 重置充值次数信息
|
| | | syncRecordIDList = []
|
| | |
| | | return callFunc(curPlayer, mapID, lineID, cnt, isFinish, dataEx)
|
| | |
|
| | | ## 副本助战扫荡结果
|
| | | def OnPlayerFBHelpBattleSweepResult(curPlayer, mapID, lineID, helpBattlePlayerDict, addXianyuanCoin, reason):
|
| | | def OnPlayerFBHelpBattleSweepResult(curPlayer, mapID, lineID, helpBattlePlayerDict):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnPlayerFBHelpBattleSweepResult"))
|
| | |
| | | if callFunc == None:
|
| | | return False
|
| | |
|
| | | return callFunc(curPlayer, mapID, lineID, helpBattlePlayerDict, addXianyuanCoin, reason)
|
| | | return callFunc(curPlayer, mapID, lineID, helpBattlePlayerDict)
|
| | |
|
| | | ## 开始公共CD副本扫荡
|
| | | def OnStartPubCDFBSweep(curPlayer, mapID, lineID, cnt, dataEx):
|
| | |
| | | Over_extrScore = 'extrScore' #已获得额外积分
|
| | | Over_enterLV = 'enterLV' #进入时等级
|
| | | Over_leaderID = 'leaderID' #渡劫玩家ID
|
| | | Over_xianyuanCoin = 'xianyuanCoin' #获得仙缘币信息 [获得仙缘币数, 没有获得的原因] 原因: 1-达到助战次数上限,2-达到每日获得仙缘币上限
|
| | | Over_helpPlayer = 'helpPlayer' #助战玩家信息 {"玩家ID":{玩家信息key:value, ...}, ...}
|
| | | Over_ownerID = 'ownerID' #归属玩家ID
|
| | | Over_ownerName = 'ownerName' #归属玩家名
|
| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | | import PlayerControl
|
| | | import PlayerBillboard
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import PlayerViewCacheTube
|
| | |
| | | import GameMap
|
| | | import NPCCommon
|
| | | import FBLogic
|
| | | import PlayerVip
|
| | | import IPY_GameWorld
|
| | | import PlayerActivity
|
| | | import ItemControler
|
| | |
|
| | | import time
|
| | | MaxRobotID = 100 # 最大机器人NPC定义ID
|
| | |
|
| | | def DoPlayerOnDay(curPlayer):
|
| | | checkInInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HelpBattleCheckInCount)
|
| | |
| | | checkInInfo = checkInCount * 10 + 0
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HelpBattleCheckInCount, checkInInfo)
|
| | | SyncCheckInState(curPlayer, 0, False)
|
| | | |
| | | # 重置每日已获得仙缘币
|
| | | ondaySetXianyuanCoin = 0
|
| | | ondayLoginSetXianyuanCoin = curPlayer.GetDictByKey(ChConfig.Def_PDict_TodayXianyuanCoinOnLogin)
|
| | | if ondayLoginSetXianyuanCoin:
|
| | | # 这里做时间比较,预防玩家登录后就没有再切换地图,再次在该地图过天会导致设置值错误问题
|
| | | loginAddCoinTime = curPlayer.GetDictByKey(ChConfig.Def_PDict_LoginAddTodayXianyuanCoinTime)
|
| | | if GameWorld.CheckTimeIsSameServerDayEx(loginAddCoinTime):
|
| | | ondaySetXianyuanCoin = ondayLoginSetXianyuanCoin
|
| | | GameWorld.DebugLog("玩家过天时,登录增加仙缘币有值,仍然是同一天,仙缘币重置为登录时增加的仙缘币!ondayLoginSetXianyuanCoin=%s" % ondayLoginSetXianyuanCoin)
|
| | | else:
|
| | | GameWorld.DebugLog("玩家过天时,登录增加仙缘币有值,但是不是同一天了,仙缘币重置为0!")
|
| | | PlayerControl.SetTodayXianyuanCoin(curPlayer, ondaySetXianyuanCoin)
|
| | | GameWorld.DebugLog("玩家过天设置今日已获得仙缘币: ondaySetXianyuanCoin=%s,ondayLoginSetXianyuanCoin=%s" |
| | | % (ondaySetXianyuanCoin, ondayLoginSetXianyuanCoin))
|
| | | return
|
| | |
|
| | | def DoPlayerLogin(curPlayer):
|
| | |
| | | # 刷新
|
| | | elif cmd == "Refresh":
|
| | | __OnHelpBattleRefreshResult(curPlayer, msgList, tick)
|
| | | |
| | | # 助战记录
|
| | | elif cmd == "HelpRecord":
|
| | | __OnHelpBattleRecord(curPlayer, msgList, tick)
|
| | |
|
| | | # 扫荡召唤
|
| | | elif cmd == "SweepCall":
|
| | |
| | | if not fbFuncIpyData:
|
| | | return
|
| | |
|
| | | reason = 0
|
| | | addCoinRate = 10000 # 基础倍率
|
| | | baseFBPoint = fbFuncIpyData.GetFBPoint() # 过关 - 基础仙缘币
|
| | | |
| | | xianyuanCoinUpper = IpyGameDataPY.GetFuncCfg("HelpBattlePoint", 1) # 每日仙缘币上限
|
| | | relationCoinAddDict = IpyGameDataPY.GetFuncEvalCfg("HelpBattlePoint", 2, {}) # 社交关系加成 {"社交关系":[过关加成, 助战加成], ...} |
| | | todayXianyuanCoin = PlayerControl.GetTodayXianyuanCoin(curPlayer) # 今日已获得仙缘币
|
| | | playerXianyuanCoinUpper = xianyuanCoinUpper
|
| | | if curPlayer.GetVIPLv():
|
| | | playerXianyuanCoinUpper += PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_XianyuanCoinUpperAdd)
|
| | | addCoinRate += PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_XianyuanCoinAddPer)
|
| | | |
| | | relation, relationAdd = 0, 0
|
| | | for helpPlayerInfoDict in helpBattlePlayerDict.values():
|
| | | relation = helpPlayerInfoDict.get("Relation", 0)
|
| | | if not relation:
|
| | | assistPlayerIDList = []
|
| | | for helpPlayerID in helpBattlePlayerDict.keys():
|
| | | if helpPlayerID <= MaxRobotID:
|
| | | continue
|
| | | relationAddList = relationCoinAddDict.get(str(relation), [])
|
| | | relationAdd += relationAddList[0] if len(relationAddList) == 2 else 0
|
| | | |
| | | coinAdd = 0
|
| | | if baseFBPoint:
|
| | | coinAdd = int((baseFBPoint + relationAdd) * addCoinRate / 10000.0)
|
| | | canAddMax = max(playerXianyuanCoinUpper - todayXianyuanCoin, 0)
|
| | | coinAddReal = min(coinAdd, canAddMax) # 实际加仙缘币
|
| | | if canAddMax == 0 and not reason:
|
| | | reason = 2
|
| | | |
| | | GameWorld.DebugLog("扫荡副本增加仙缘币: baseFBPoint=%s,relationAdd=%s,addCoinRate=%s,coinAdd=%s,canAddMax=%s,coinAddReal=%s" |
| | | % (baseFBPoint, relationAdd, addCoinRate, coinAdd, canAddMax, coinAddReal), playerID)
|
| | | if coinAddReal:
|
| | | addDataDict = {"MapID":mapID, "FuncLineID":funcLineID, "IsSweep":1}
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_XianyuanCoin, coinAddReal, addDataDict=addDataDict)
|
| | | PlayerControl.AddTodayXianyuanCoin(curPlayer, coinAddReal)
|
| | | |
| | | assistPlayerIDList.append(helpPlayerID)
|
| | | __DoGivePlayerAssistLihe(curPlayer, mapID, funcLineID, assistPlayerIDList)
|
| | | |
| | | #扫荡结果给奖励等
|
| | | FBLogic.OnPlayerFBHelpBattleSweepResult(curPlayer, mapID, funcLineID, helpBattlePlayerDict, coinAddReal, reason)
|
| | | |
| | | # 通知自己获得仙缘币
|
| | | msgPack = ChPyNetSendPack.tagMCAddXianyuanCoinMsg()
|
| | | msgPack.MapID = mapID
|
| | | msgPack.FuncLineID = funcLineID
|
| | | msgPack.Relation = relation
|
| | | msgPack.RelationCoinAdd = relationAdd
|
| | | msgPack.XianyuanCoinAdd = coinAddReal
|
| | | msgPack.Reason = reason
|
| | | #msgPack.CallPlayerID = relationPlayerID
|
| | | #msgPack.CallPlayerName = relationPlayerName
|
| | | msgPack.NameLen = len(msgPack.CallPlayerName)
|
| | | msgPack.IsSweep = 1
|
| | | NetPackCommon.SendFakePack(curPlayer, msgPack)
|
| | | FBLogic.OnPlayerFBHelpBattleSweepResult(curPlayer, mapID, funcLineID, helpBattlePlayerDict)
|
| | | return
|
| | |
|
| | | def __OnHelpBattleRecord(curPlayer, msgList, tick):
|
| | | ## 助战记录同步
|
| | | cmd, helpRecordList, isLogin = msgList
|
| | | def DoFBHelpBattleFinish(curPlayer, mapID, lineID):
|
| | | ## 副本助战完成
|
| | | |
| | | assistPlayerIDList = []
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | GameWorld.DebugLog("__OnHelpBattleRecord %s,helpRecordList=%s" % (cmd, helpRecordList), playerID)
|
| | | helpBattlePlayerDict = PyGameData.g_fbHelpBattlePlayerDict.get(playerID, {})
|
| | | for helpPlayerID in helpBattlePlayerDict.keys():
|
| | | objID = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_HelpBattleFBObjID % helpPlayerID)
|
| | | if not objID:
|
| | | continue
|
| | | if helpPlayerID <= MaxRobotID:
|
| | | continue
|
| | | assistPlayerIDList.append(helpPlayerID)
|
| | | __DoGivePlayerAssistLihe(curPlayer, mapID, lineID, assistPlayerIDList)
|
| | |
|
| | | addXianyuanCoinTotal = 0 # 累计需要增加的仙缘币
|
| | | addXianyuanCoinTotalTotay = 0 # 累计需要增加的今日仙缘币
|
| | | drList = []
|
| | | |
| | | totalHelpCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HelpBattleTotalCount)
|
| | | recordPack = ChPyNetSendPack.tagMCHelpBattleRecordList()
|
| | | recordPack.RecordList = []
|
| | | for recordInfo in helpRecordList:
|
| | | callPlayerID, callPlayerName, mapID, funcLineID, xianyuanCoinAdd, relation, vipLV, recordTime = recordInfo
|
| | | timeStr = GameWorld.ChangeTimeNumToStr(recordTime)
|
| | | isSameDay = GameWorld.CheckTimeIsSameServerDayEx(recordTime)
|
| | | |
| | | record = ChPyNetSendPack.tagMCHelpBattleRecord()
|
| | | record.CallPlayerID = callPlayerID
|
| | | record.CallPlayerName = callPlayerName
|
| | | record.NameLen = len(record.CallPlayerName)
|
| | | record.MapID = mapID
|
| | | record.FuncLineID = funcLineID
|
| | | record.XianyuanCoinAdd = xianyuanCoinAdd
|
| | | record.Relation = relation
|
| | | record.VIPLV = vipLV
|
| | | record.HelpTime = timeStr
|
| | | recordPack.RecordList.append(record)
|
| | | drList.append({"CallPlayerID":callPlayerID, "MapID":mapID, "FuncLineID":funcLineID, "XianyuanCoinAdd":xianyuanCoinAdd, |
| | | "Relation":relation, "VIPLV":vipLV, "HelpTime":timeStr, "IsSameDay":isSameDay})
|
| | | addXianyuanCoinTotal += xianyuanCoinAdd
|
| | | if isSameDay:
|
| | | addXianyuanCoinTotalTotay += xianyuanCoinAdd
|
| | | totalHelpCount += 1
|
| | | |
| | | recordPack.RecordCount = len(recordPack.RecordList)
|
| | | NetPackCommon.SendFakePack(curPlayer, recordPack)
|
| | | |
| | | addDataDict = {"HelpList":drList}
|
| | | GameWorld.DebugLog(" addXianyuanCoinTotal=%s,addXianyuanCoinTotalTotay=%s,totalHelpCount=%s,isLogin=%s" |
| | | % (addXianyuanCoinTotal, addXianyuanCoinTotalTotay, totalHelpCount, isLogin), playerID)
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_XianyuanCoin, addXianyuanCoinTotal, addDataDict=addDataDict, isSysHint=False)
|
| | | if addXianyuanCoinTotalTotay:
|
| | | PlayerControl.AddTodayXianyuanCoin(curPlayer, addXianyuanCoinTotalTotay)
|
| | | if isLogin:
|
| | | curPlayer.SetDict(ChConfig.Def_PDict_TodayXianyuanCoinOnLogin, addXianyuanCoinTotalTotay)
|
| | | curPlayer.SetDict(ChConfig.Def_PDict_LoginAddTodayXianyuanCoinTime, int(time.time()))
|
| | | GameWorld.Log(" 登录时今日助战信息: addXianyuanCoinTotalTotay=%s" % (addXianyuanCoinTotalTotay), playerID)
|
| | | |
| | | # 更新总助战次数,更新排行榜
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HelpBattleTotalCount, totalHelpCount)
|
| | | if totalHelpCount >= IpyGameDataPY.GetFuncCfg("HelpBattleRefresh", 4):
|
| | | PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_FBHelpBattle, totalHelpCount)
|
| | | return
|
| | |
|
| | | def DoFBAddXianyuanCoin(curPlayer, mapID, lineID, isHelp=False):
|
| | | '''真人挑战副本增加仙缘币,包含过关或助战(不含镜像助战)
|
| | | @param isHelp: 是否助战的
|
| | | @return: 获得的仙缘币, 无法获得仙缘币原因(1-达到助战次数上限,2-达到每日获得仙缘币上限)
|
| | | '''
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | fbFuncIpyData = IpyGameDataPY.GetIpyGameData("FBFunc", mapID)
|
| | | if not fbFuncIpyData:
|
| | | return 0, 0
|
| | | def __DoGivePlayerAssistLihe(curPlayer, mapID, lineID, assistPlayerIDList):
|
| | | ## 给玩家协助礼盒奖励
|
| | |
|
| | | reason = 0
|
| | | addCoinRate = 10000 # 基础倍率
|
| | | if not isHelp:
|
| | | baseFBPoint = fbFuncIpyData.GetFBPoint() # 过关 - 基础仙缘币
|
| | | else:
|
| | | baseFBPoint = fbFuncIpyData.GetHelpPoint() # 助战
|
| | | dayHelpCountMax = fbFuncIpyData.GetDayHelpCountMax() # 真实助战每日可获得仙缘币次数
|
| | | if dayHelpCountMax:
|
| | | todayHelpCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FBRealHelpCount % mapID)
|
| | | if todayHelpCount >= dayHelpCountMax:
|
| | | baseFBPoint = 0
|
| | | reason = 1
|
| | | GameWorld.DebugLog("达到每日助战可获得仙缘币次数上限!无法再获得!mapID=%s" % (mapID), playerID)
|
| | | else:
|
| | | todayHelpCount += 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FBRealHelpCount % mapID, todayHelpCount)
|
| | | GameWorld.DebugLog("增加每日助战可获得仙缘币次数!mapID=%s,todayHelpCount=%s" % (mapID, todayHelpCount), playerID)
|
| | | |
| | | xianyuanCoinUpper = IpyGameDataPY.GetFuncCfg("HelpBattlePoint", 1) # 每日仙缘币上限
|
| | | relationCoinAddDict = IpyGameDataPY.GetFuncEvalCfg("HelpBattlePoint", 2, {}) # 社交关系加成 {"社交关系":[过关加成, 助战加成], ...} |
| | | todayXianyuanCoin = PlayerControl.GetTodayXianyuanCoin(curPlayer) # 今日已获得仙缘币
|
| | | playerXianyuanCoinUpper = xianyuanCoinUpper
|
| | | if curPlayer.GetVIPLv():
|
| | | playerXianyuanCoinUpper += PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_XianyuanCoinUpperAdd)
|
| | | addCoinRate += PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_XianyuanCoinAddPer)
|
| | | |
| | | #达到上限也需要记录,所以这里暂不限制
|
| | | #if todayXianyuanCoin >= playerXianyuanCoinUpper:
|
| | | # GameWorld.DebugLog("玩家今日仙缘币已达上限!todayXianyuanCoin=%s,playerXianyuanCoinUpper=%s" |
| | | # % (todayXianyuanCoin, playerXianyuanCoinUpper), playerID)
|
| | | # return
|
| | | if not assistPlayerIDList:
|
| | | return
|
| | |
|
| | | relation, relationAdd, relationPlayerID, relationPlayerName = 0, 0, 0, ""
|
| | | liheItemID = 0
|
| | | mapAssistGiftDict = IpyGameDataPY.GetFuncEvalCfg("AssistAward", 2, {})
|
| | | mapID = FBCommon.GetRecordMapID(mapID)
|
| | | if str(mapID) in mapAssistGiftDict:
|
| | | liheItemID = mapAssistGiftDict[str(mapID)][0]
|
| | | if not liheItemID:
|
| | | return
|
| | |
|
| | | fbType = GameWorld.GetMap().GetMapFBType()
|
| | | if fbType == IPY_GameWorld.fbtSingle:
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | helpBattlePlayerDict = PyGameData.g_fbHelpBattlePlayerDict.get(playerID, {})
|
| | | for helpPlayerID, helpPlayerInfoDict in helpBattlePlayerDict.items():
|
| | | objID = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_HelpBattleFBObjID % helpPlayerID)
|
| | | if not objID:
|
| | | continue
|
| | | relation = helpPlayerInfoDict.get("Relation", 0)
|
| | | if not relation:
|
| | | continue
|
| | | relationAddList = relationCoinAddDict.get(str(relation), [])
|
| | | relationAdd += relationAddList[0] if len(relationAddList) == 2 else 0
|
| | | elif fbType == IPY_GameWorld.fbtTeam:
|
| | | if playerID in PyGameData.g_teamFBMemRelationAddDict:
|
| | | relation, relationAdd, relationPlayerID, relationPlayerName = PyGameData.g_teamFBMemRelationAddDict.pop(playerID)
|
| | | |
| | | coinAdd = 0
|
| | | if baseFBPoint:
|
| | | coinAdd = int((baseFBPoint + relationAdd) * addCoinRate / 10000.0)
|
| | | canAddMax = max(playerXianyuanCoinUpper - todayXianyuanCoin, 0)
|
| | | coinAddReal = min(coinAdd, canAddMax) # 实际加仙缘币
|
| | | if canAddMax == 0 and not reason:
|
| | | reason = 2
|
| | | |
| | | if isHelp and not relationPlayerID:
|
| | | relationPlayerID = 1
|
| | | #GameWorld.DebugLog("没有助战目标则设置relationPlayerID为1,标记是助战的!")
|
| | | |
| | | GameWorld.DebugLog("挑战副本增加仙缘币: baseFBPoint=%s,relationAdd=%s,addCoinRate=%s,coinAdd=%s,canAddMax=%s,coinAddReal=%s,relationPlayerID=%s" |
| | | % (baseFBPoint, relationAdd, addCoinRate, coinAdd, canAddMax, coinAddReal, relationPlayerID), playerID)
|
| | | if coinAddReal:
|
| | | addDataDict = {"MapID":mapID, "FuncLineID":lineID}
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_XianyuanCoin, coinAddReal, addDataDict=addDataDict)
|
| | | PlayerControl.AddTodayXianyuanCoin(curPlayer, coinAddReal)
|
| | | |
| | | # 通知自己获得仙缘币
|
| | | msgPack = ChPyNetSendPack.tagMCAddXianyuanCoinMsg()
|
| | | msgPack.MapID = mapID
|
| | | msgPack.FuncLineID = lineID
|
| | | msgPack.Relation = relation
|
| | | msgPack.RelationCoinAdd = relationAdd
|
| | | msgPack.XianyuanCoinAdd = coinAddReal
|
| | | msgPack.Reason = reason
|
| | | msgPack.CallPlayerID = relationPlayerID
|
| | | msgPack.CallPlayerName = relationPlayerName
|
| | | msgPack.NameLen = len(msgPack.CallPlayerName)
|
| | | NetPackCommon.SendFakePack(curPlayer, msgPack)
|
| | | return coinAddReal, reason
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, [[liheItemID, 1, 0]])
|
| | | |
| | | msgInfo = str(["AssistFinish", liheItemID, mapID, lineID, assistPlayerIDList])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, "FBHelpBattle", msgInfo, len(msgInfo))
|
| | | return
|
| | |
|
| | |
|
| | | def __GetTeamFBMemRelationInfo(curPlayer, isHelp, leavePlayerID):
|
| | | ## 计算队员间相互加成信息,离线玩家不算
|
| | |
| | | expPoint = addExp / ChConfig.Def_PerPointValue
|
| | | overDict[FBCommon.Over_exp] = exp
|
| | | overDict[FBCommon.Over_expPoint] = expPoint
|
| | | |
| | | addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, mapID, 0, isHelp)
|
| | | overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
|
| | |
|
| | | FBCommon.Notify_FB_Over(curPlayer, overDict)
|
| | | #成就
|
| | |
| | | import PlayerSuccess
|
| | | import EventShell
|
| | | import EventReport
|
| | | import FBHelpBattle
|
| | |
|
| | | import math
|
| | | import time
|
| | |
| | | # if gameFB.GetFBStep() == FB_Step_Fighting:
|
| | | # __OnDuJieFBStart(tick)
|
| | | fbStep = gameFB.GetFBStep()
|
| | | |
| | | # if lineID !=0 and fbStep == FB_Step_CallHelp:
|
| | | # FBHelpBattle.SendGameServer_RefreshHelpBattlePlayer(curPlayer, ChConfig.Def_FBMapID_DuJie)
|
| | | # return
|
| | |
|
| | | if fbStep == FB_Step_MapPrepare:
|
| | | #初始化并通知等待倒计时
|
| | |
| | | #清除CD
|
| | | FBCommon.SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % ChConfig.Def_FBMapID_DuJie, 0)
|
| | | FBCommon.SyncFBEnterTick(curPlayer)
|
| | | if lineID:
|
| | | addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, ChConfig.Def_FBMapID_DuJie, FBPropertyMark)
|
| | | overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
|
| | |
|
| | |
|
| | | FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_DuJie, lineID, isPass, overDict)
|
| | |
| | | import NPCCommon
|
| | | import FBHelpBattle
|
| | | import PlayerActLogin
|
| | | import PlayerPet
|
| | | import PlayerHorse
|
| | |
|
| | | import math
|
| | |
|
| | |
| | | if historyStar < needStar:
|
| | | GameWorld.DebugLog(' 上一层评级未达到%s,无法挑战本层!' % needStar)
|
| | | return False
|
| | | #坐骑与灵宠总等级
|
| | | needSumLV = IpyGameDataPY.GetFuncEvalCfg('MunekadoLockLimit', 2, {}).get(lineID, 0)
|
| | | if PlayerPet.GetTotalPetLV(curPlayer) + PlayerHorse.GetHorseSumLV(curPlayer) < needSumLV:
|
| | | GameWorld.DebugLog(' 坐骑与灵宠总等级未达到%s,无法挑战本层!' % needSumLV)
|
| | | return False
|
| | | return True
|
| | |
|
| | |
|
| | |
| | | # 如果在副本中过天,则只给物品奖励,不变更过关信息
|
| | | if not isInFBOnDay:
|
| | | FBCommon.AddEnterFBCount(curPlayer, mapID, 1)
|
| | | addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, mapID, lineID)
|
| | | overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
|
| | | needSyncFBData = False
|
| | | else:
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_IsInFBOnDay, 0)
|
| | | FBHelpBattle.DoFBHelpBattleFinish(curPlayer, mapID, lineID)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_MunekadoTrialEx, 1)
|
| | | PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_MunekadoTrial, 1)
|
| | | #=======================================================================================
|
| | |
| | | return True
|
| | |
|
| | | ## 助战扫荡结果
|
| | | def OnPlayerFBHelpBattleSweepResult(curPlayer, mapID, lineID, helpBattlePlayerDict, addXianyuanCoin, reason):
|
| | | def OnPlayerFBHelpBattleSweepResult(curPlayer, mapID, lineID, helpBattlePlayerDict):
|
| | | #扣门票要在公共逻辑中完成
|
| | |
|
| | | refreshNPCList = __GetZMSLnpcCfg(lineID, mapID)[0]
|
| | |
| | | if not lastNPCList:
|
| | | return
|
| | | killNPCID = lastNPCList[0][0] # 默认最后一波的NPCID为通关boss奖励ID
|
| | | GameWorld.DebugLog("扫荡宗门试炼: killNPCID=%s,addXianyuanCoin=%s,reason=%s,helpBattlePlayerDict=%s" |
| | | % (killNPCID, addXianyuanCoin, reason, helpBattlePlayerDict))
|
| | | GameWorld.DebugLog("扫荡宗门试炼: killNPCID=%s,helpBattlePlayerDict=%s" |
| | | % (killNPCID, helpBattlePlayerDict))
|
| | |
|
| | | star = 5
|
| | | EventReport.WriteEvent_FB(curPlayer, mapID, lineID, ChConfig.CME_Log_End, 0, 1)
|
| | |
| | | # 通知结果
|
| | | overDict = {FBCommon.Over_grade:star,FBCommon.Over_dataMapID:mapID,FBCommon.Over_isPass:1, FBCommon.Over_isSweep:1}
|
| | | overDict[FBCommon.Over_helpPlayer] = helpBattlePlayerDict
|
| | | overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
|
| | | overDict[FBCommon.Over_itemInfo] = jsonItemList
|
| | | FBCommon.Notify_FB_Over(curPlayer, overDict)
|
| | | return True
|
| | |
| | | GameWorld.DebugLog("首次结算奖励,增加挑战次数!", playerID)
|
| | | needSyncFBData = False
|
| | | FBCommon.AddEnterFBCount(curPlayer, dataMapID)
|
| | | addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, mapID, lineID)
|
| | | overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
|
| | | else:
|
| | | GameWorld.DebugLog("副本中过天,不增加挑战次数!", playerID)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_QueenRelicsEx, 1)
|
| | |
| | | ("char", "NotifyMark", 0),
|
| | | ),
|
| | |
|
| | | "FirstGold":(
|
| | | ("BYTE", "Day", 1),
|
| | | ("dict", "JobItemInfo", 0),
|
| | | ("list", "CommItemList", 0),
|
| | | ),
|
| | |
|
| | | "LVAward":(
|
| | | ("BYTE", "AwardID", 1),
|
| | | ("WORD", "LV", 0),
|
| | |
| | | def GetGainItemList(self): return self.GainItemList # 获得物品列表[[物品ID,个数,是否绑定], ...]
|
| | | def GetNotifyMark(self): return self.NotifyMark # 广播提示 |
| | | |
| | | # 首充表 |
| | | class IPY_FirstGold(): |
| | | |
| | | def __init__(self): |
| | | self.Day = 0
|
| | | self.JobItemInfo = {}
|
| | | self.CommItemList = [] |
| | | return |
| | | |
| | | def GetDay(self): return self.Day # 首充第几天
|
| | | def GetJobItemInfo(self): return self.JobItemInfo # 职业物品奖励 {"职业":[[物品ID,个数], ...], ...}
|
| | | def GetCommItemList(self): return self.CommItemList # 通用物品奖励 [[物品ID,个数], ...] |
| | | |
| | | # 等级奖励表 |
| | | class IPY_LVAward(): |
| | | |
| | |
| | | self.ipyOrderInfoLen = len(self.ipyOrderInfoCache)
|
| | | self.ipyCTGCache = self.__LoadFileData("CTG", IPY_CTG)
|
| | | self.ipyCTGLen = len(self.ipyCTGCache)
|
| | | self.ipyFirstGoldCache = self.__LoadFileData("FirstGold", IPY_FirstGold)
|
| | | self.ipyFirstGoldLen = len(self.ipyFirstGoldCache)
|
| | | self.ipyLVAwardCache = self.__LoadFileData("LVAward", IPY_LVAward)
|
| | | self.ipyLVAwardLen = len(self.ipyLVAwardCache)
|
| | | self.ipyInvestCache = self.__LoadFileData("Invest", IPY_Invest)
|
| | |
| | | def GetOrderInfoByIndex(self, index): return self.ipyOrderInfoCache[index]
|
| | | def GetCTGCount(self): return self.ipyCTGLen
|
| | | def GetCTGByIndex(self, index): return self.ipyCTGCache[index]
|
| | | def GetFirstGoldCount(self): return self.ipyFirstGoldLen
|
| | | def GetFirstGoldByIndex(self, index): return self.ipyFirstGoldCache[index]
|
| | | def GetLVAwardCount(self): return self.ipyLVAwardLen
|
| | | def GetLVAwardByIndex(self, index): return self.ipyLVAwardCache[index]
|
| | | def GetInvestCount(self): return self.ipyInvestLen
|
| | |
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_Honor, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_GoldMoney:
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, itemCount)
|
| | | #elif itemID == ChConfig.Def_ItemID_XianyuanCoin:
|
| | | # PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_XianyuanCoin, itemCount)
|
| | | return True
|
| | |
|
| | | def __CrossServerPutInItem(self, packIndex, tagItem, event=["", False, {}]):
|
| | |
| | |
|
| | | elif ownerType == ChConfig.Def_NPCHurtTypeTeam:
|
| | | curTeam = GameWorld.GetTeamManager().FindTeam(ownerID)
|
| | | if not curTeam:
|
| | | return
|
| | | |
| | | # 因为有击杀次数限制,所以不是所有的队员都可以获得归属,所以这里设置为特殊指定玩家掉落
|
| | | hurtType, hurtID = ChConfig.Def_NPCHurtTypeSpecial, 0
|
| | | if isDead:
|
| | | GameWorld.Log("队伍成员数: %s" % (curTeam.GetMemberCount()))
|
| | | refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
|
| | | for i in xrange(curTeam.GetMemberCount()):
|
| | | curTeamPlayer = curTeam.GetMember(i)
|
| | | if curTeamPlayer == None or curTeamPlayer.GetPlayerID() == 0:
|
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 成员不存在!" % (i))
|
| | | continue
|
| | | |
| | | if curTeamPlayer.GetCopyMapID() == GameWorld.GetGameWorld().GetCopyMapID() \
|
| | | and (not hurtList or hurtList.HaveHurtValue(curTeamPlayer.GetPlayerID()))\
|
| | | and self.GetIsInRefreshPoint(curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), refreshPoint) \
|
| | | and AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False) and curTeamPlayer.GetVisible():
|
| | | self.__AddDropOwnerPlayerBuff(curTeamPlayer, tick)
|
| | | killerDict[curTeamPlayer.GetPlayerID()] = curTeamPlayer
|
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 成员有归属权! memPlayerID=%s,背包剩余空格=%s" |
| | | % (i, curTeamPlayer.GetPlayerID(), ItemCommon.GetItemPackSpace(curTeamPlayer, IPY_GameWorld.rptItem)))
|
| | | |
| | | # 不同线、或者距离超出boss范围的队员不加归属buff
|
| | | else:
|
| | | isOk = BuffSkill.DelBuffBySkillID(curTeamPlayer, ChConfig.Def_SkillID_DropOwnerBuff, tick, buffOwner=curNPC)
|
| | | if isOk:
|
| | | GameWorld.DebugLog("删除归属队员buff: teamID=%s,playerID=%s" % (ownerID, curTeamPlayer.GetPlayerID()))
|
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 成员无归属权! memPlayerID=%s,copyMapID=%s,pos(%s,%s),CheckKillNPCByCnt=%s" |
| | | % (i, curTeamPlayer.GetPlayerID(), curTeamPlayer.GetCopyMapID(), |
| | | curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), |
| | | AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False)))
|
| | | if curTeam:
|
| | | # 因为有击杀次数限制,所以不是所有的队员都可以获得归属,所以这里设置为特殊指定玩家掉落
|
| | | hurtType, hurtID = ChConfig.Def_NPCHurtTypeSpecial, 0
|
| | | if isDead:
|
| | | GameWorld.Log("队伍成员数: %s" % (curTeam.GetMemberCount()))
|
| | | refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
|
| | | for i in xrange(curTeam.GetMemberCount()):
|
| | | curTeamPlayer = curTeam.GetMember(i)
|
| | | if curTeamPlayer == None or curTeamPlayer.GetPlayerID() == 0:
|
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 成员不存在!" % (i))
|
| | | continue
|
| | | |
| | | if curTeamPlayer.GetCopyMapID() == GameWorld.GetGameWorld().GetCopyMapID() \
|
| | | and (not hurtList or hurtList.HaveHurtValue(curTeamPlayer.GetPlayerID()))\
|
| | | and AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False) and curTeamPlayer.GetVisible():
|
| | | self.__AddDropOwnerPlayerBuff(curTeamPlayer, tick)
|
| | | killerDict[curTeamPlayer.GetPlayerID()] = curTeamPlayer
|
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 成员有归属权! memPlayerID=%s,背包剩余空格=%s" |
| | | % (i, curTeamPlayer.GetPlayerID(), ItemCommon.GetItemPackSpace(curTeamPlayer, IPY_GameWorld.rptItem)))
|
| | | |
| | | # 不同线、或者距离超出boss范围的队员不加归属buff
|
| | | else:
|
| | | isOk = BuffSkill.DelBuffBySkillID(curTeamPlayer, ChConfig.Def_SkillID_DropOwnerBuff, tick, buffOwner=curNPC)
|
| | | if isOk:
|
| | | GameWorld.DebugLog("删除归属队员buff: teamID=%s,playerID=%s" % (ownerID, curTeamPlayer.GetPlayerID()))
|
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 成员无归属权! memPlayerID=%s,copyMapID=%s,pos(%s,%s),CheckKillNPCByCnt=%s" |
| | | % (i, curTeamPlayer.GetPlayerID(), curTeamPlayer.GetCopyMapID(), |
| | | curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), |
| | | AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False)))
|
| | |
|
| | | elif ownerType == ChConfig.Def_NPCHurtTypeFamily:
|
| | |
|
| | |
| | | if isDead:
|
| | | #key = (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), npcID)
|
| | | teamID = curTeam.GetTeamID() if curTeam else 0
|
| | | if killerDict:
|
| | | PyGameData.g_npcKillerInfo[key] = killerDict, curTeam, hurtType, hurtID
|
| | | # 伤血归属的强制记录,即使空的也记录,因为有助战,伤血第一团队伤害可能还在但是归属玩家可能离线
|
| | | if dropOwnerType == ChConfig.DropOwnerType_MaxHurt:
|
| | | PyGameData.g_npcKillerInfo[key] = killerDict, None, hurtType, hurtID
|
| | | if not killerDict:
|
| | | GameWorld.Log("伤血归属boss没有归属玩家!")
|
| | | elif ownerType == ChConfig.Def_NPCHurtTypeFamily:
|
| | | PyGameData.g_npcKillerInfo[key] = {}, None, hurtType, hurtID
|
| | |
|
| | |
| | | # @return: atkPlayer, hurtID, hurtType
|
| | |
|
| | | curNPC = self.curNPC
|
| | | if not self.__hurtDict:
|
| | | return
|
| | |
|
| | | if not isDead:
|
| | | if refreshInterval and tick - curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_LastRefreshHurtTick) < refreshInterval:
|
| | |
| | | self.__assistAwardItemID = liheItemID
|
| | |
|
| | | fbType = GameWorld.GetMap().GetMapFBTypeByMapID(mapID)
|
| | | friendAddAssistMoneyPer = IpyGameDataPY.GetFuncCfg("AssistAward", 3)
|
| | | GameWorld.DebugLog("执行协助奖励逻辑", self.npcID, self.lineID)
|
| | | copyPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for playerID, assistPlayerIDList in self.__noAssitPlayerIDDict.items():
|
| | |
| | | GameWorld.DebugLog("协助方离线或不在本地图,不给活跃令奖励: assistPlayerID=%s" % assistPlayerID, self.npcID, self.lineID)
|
| | | continue
|
| | | isFriend = assistHurtPlayer.GetIsFriend()
|
| | | addAssistMoney = assistMoney
|
| | | if isFriend and friendAddAssistMoneyPer:
|
| | | addAssistMoney += int(assistMoney * friendAddAssistMoneyPer / 100.0)
|
| | | assistMoneyType = ShareDefine.TYPE_Price_FamilyActivity
|
| | | addAssistMoney = PlayerAssist.AddTodayAssistMoney(assistPlayer, assistMoneyType, assistMoney, isFriend)
|
| | | GameWorld.DebugLog("协助方给活跃令奖励: assistPlayerID=%s,assistMoney=%s,isFriend=%s,addAssistMoney=%s"
|
| | | % (assistPlayerID, assistMoney, isFriend, addAssistMoney), self.npcID, self.lineID)
|
| | | PlayerControl.GiveMoney(assistPlayer, ShareDefine.TYPE_Price_FamilyActivity, addAssistMoney) # 给活跃令无视发布方是否在线
|
| | | if fbType == IPY_GameWorld.fbtNull:
|
| | | PlayerControl.NotifyCode(assistPlayer, "AssistSuccess")
|
| | | else:
|
| | | overDict = {FBCommon.Over_isAssist:1, FBCommon.Over_money:FBCommon.GetJsonMoneyList({ShareDefine.TYPE_Price_FamilyActivity:addAssistMoney}),
|
| | | overDict = {FBCommon.Over_isAssist:1, FBCommon.Over_money:FBCommon.GetJsonMoneyList({assistMoneyType:addAssistMoney}),
|
| | | FBCommon.Over_itemInfo:[]}
|
| | | FBCommon.NotifyFBOver(assistPlayer, mapID, PlayerControl.GetFBFuncLineID(assistPlayer), 1, overDict)
|
| | |
|
| | |
| | | assistAwardPlayerDict[assistPlayerID] = {"PlayerName":assistPlayer.GetPlayerName(), "Job":assistPlayer.GetJob(),
|
| | | "LV":assistPlayer.GetLV(), "RealmLV":assistPlayer.GetOfficialRank(),
|
| | | "TodayGiftCount":todayGiftCount}
|
| | | |
| | | notifyParam = [assistPlayer.GetPlayerName(), noAssistPlayer.GetPlayerName(), mapID, self.curNPC.GetLV(), self.npcID]
|
| | | PlayerControl.FamilyNotify(assistPlayer.GetFamilyID(), "AssistBossFinish", notifyParam)
|
| | |
|
| | | if not noAssistPlayer or not assistAwardPlayerDict:
|
| | | GameWorld.DebugLog("发布方离线或无有效协助玩家在线,不给感谢礼盒奖励: playerID=%s" % playerID, self.npcID, self.lineID)
|
| | |
| | | bossHurtInfoPack.HurtValueList = hurtValueList
|
| | | bossHurtInfoPack.HurtCount = len(hurtValueList)
|
| | |
|
| | | curNPC = self.curNPC
|
| | | assistHurtValueListDict = {}
|
| | | copyPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for playerID in syncPlayerIDList:
|
| | | player = copyPlayerManager.FindPlayerByID(playerID)
|
| | | if not player:
|
| | | continue
|
| | | |
| | | if not player.CanSeeOther(curNPC):
|
| | | continue
|
| | | if playerID in self.__noAssitPlayerIDDict:
|
| | | assTagPlayerID = playerID
|
| | | elif playerID in self.__assistPlayerIDDict:
|
| | |
| | | PlayerMagicWeapon.OnGetXBXZAward(curPlayer, dataEx)
|
| | | # 首充礼包奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_GoldGiftFirst:
|
| | | PlayerGoldGift.GetPlayerGoldGiftFirst(curPlayer)
|
| | | PlayerGoldGift.GetPlayerGoldGiftFirst(curPlayer, dataEx)
|
| | | # 领取极品白拿
|
| | | elif rewardType == ChConfig.Def_RewardType_FreeGoods:
|
| | | PlayerFreeGoods.OnGetFreeGoods(curPlayer, dataEx)
|
| | |
| | | import PyGameData
|
| | | import GameFuncComm
|
| | | import EventShell
|
| | | import PlayerTJG
|
| | | import PlayerPet
|
| | | import datetime
|
| | | import time
|
| | |
| | | #struct tagCMActivityPlaceStart
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE RewardEndType; //是否结算探索,后端处理奖励后自动启动下一次放置探索;0-无结算启动,1-倒计时结束结算,2-快速结算;
|
| | | #};
|
| | | def OnActivityPlaceStart(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | rewardEndType = clientData.RewardEndType
|
| | |
|
| | | maxRewardCount = IpyGameDataPY.GetFuncCfg("ActivityPlace", 4) # 最大累计放置奖励次数 |
| | | remainCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRemainCount)
|
| | | rewardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount)
|
| | | maxRewardCount = IpyGameDataPY.GetFuncCfg("ActivityPlace", 4) # 最大累计放置奖励次数
|
| | | if rewardCount >= maxRewardCount:
|
| | | GameWorld.ErrLog("活跃放置奖励累计次数已达上限,无法启动")
|
| | | |
| | | maxCanStartCount = maxRewardCount - remainCount - rewardCount
|
| | | if maxCanStartCount <= 0:
|
| | | GameWorld.DebugLog("活跃放置奖励累计次数已达上限,无法启动!remainCount=%s + rewardCount=%s >= maxRewardCount=%s" |
| | | % (remainCount, rewardCount, maxRewardCount))
|
| | | return
|
| | | |
| | | costPoint = IpyGameDataPY.GetFuncCfg("ActivityPlace", 2) # 单次放置消耗的活跃点数
|
| | | canUseActivityPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityCanCostTotalPoint)
|
| | | pointCanUseCount = canUseActivityPoint / costPoint
|
| | | startCount = min(maxCanStartCount, pointCanUseCount)
|
| | | if startCount <= 0:
|
| | | GameWorld.DebugLog("可用活跃不足,无法添加次数启动!canUseActivityPoint=%s,costPoint=%s" % (canUseActivityPoint, costPoint))
|
| | | return
|
| | |
|
| | | placeState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceState)
|
| | | updRemainCount = remainCount + startCount
|
| | | GameWorld.DebugLog("添加活跃放置次数: startCount=%s,rewardCount=%s,remainCount=%s,updRemainCount=%s" |
| | | % (startCount, rewardCount, remainCount, updRemainCount))
|
| | |
|
| | | endCount, nextStartReduceSeconds = 1, 0
|
| | | costPointTotal = costPoint * startCount
|
| | | CostActivityPoint(curPlayer, costPointTotal)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRemainCount, updRemainCount)
|
| | |
|
| | | # 无结算启动
|
| | | if rewardEndType == 0:
|
| | | if placeState:
|
| | | GameWorld.DebugLog("已在放置探索中!")
|
| | | return
|
| | | __DoActivityPlaceStart(curPlayer)
|
| | | |
| | | # 倒计时结束结算
|
| | | elif rewardEndType == 1:
|
| | | if not placeState:
|
| | | GameWorld.DebugLog("非放置探索中,无法结算!")
|
| | | return
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceStartTime)
|
| | | if not startTime:
|
| | | return
|
| | | needSeconds = IpyGameDataPY.GetFuncCfg("ActivityPlace", 3) # 单次放置奖励持续时间,秒
|
| | | if not remainCount:
|
| | | curTime = int(time.time())
|
| | | passTime = curTime - startTime
|
| | | if passTime < needSeconds:
|
| | | GameWorld.DebugLog("探索时间未到,无法结算! curTime=%s,startTime=%s,passTime=%s < %s" % (curTime, startTime, passTime, needSeconds))
|
| | | return
|
| | | endCount = passTime / needSeconds
|
| | | nextStartReduceSeconds = passTime % needSeconds
|
| | | __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds)
|
| | | |
| | | # 快速结算
|
| | | elif rewardEndType == 2:
|
| | | if not placeState:
|
| | | GameWorld.DebugLog("非放置探索中,无法快速结算!")
|
| | | return
|
| | | |
| | | costItemID, costGoldParper = IpyGameDataPY.GetFuncEvalCfg("ActivityPlace", 5)
|
| | | costItemCount = 1
|
| | | |
| | | costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID, costItemCount)
|
| | | lackCnt = costItemCount - bindCnt - unBindCnt
|
| | | if lackCnt > 0:
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, costGoldParper, ChConfig.Def_Cost_ActivityPlace):
|
| | | return
|
| | | else:
|
| | | ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, ChConfig.ItemDel_ActivityPlace)
|
| | | |
| | | __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, curTime)
|
| | | GameWorld.DebugLog(" 没有剩余次数,更新启动时间: %s" % curTime)
|
| | |
|
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds):
|
| | | #// B0 28 活跃放置快速完成 #tagCMActivityPlaceQuickFinish
|
| | | #
|
| | | #struct tagCMActivityPlaceQuickFinish
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE FinishCount; //完成次数
|
| | | #};
|
| | | def OnActivityPlaceQuickFinish(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | finishCount = clientData.FinishCount
|
| | | remainCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRemainCount)
|
| | | if not remainCount:
|
| | | GameWorld.DebugLog("没有剩余活跃放置次数,无法快速完成!")
|
| | | return
|
| | | finishCount = min(finishCount, remainCount)
|
| | | if not finishCount:
|
| | | return
|
| | | |
| | | costItemID, costGoldParper = IpyGameDataPY.GetFuncEvalCfg("ActivityPlace", 5)
|
| | | costItemCount = finishCount # 每次扣一个
|
| | | |
| | | costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID, costItemCount)
|
| | | lackCnt = costItemCount - bindCnt - unBindCnt
|
| | | delItemCount = costItemCount
|
| | | if lackCnt > 0:
|
| | | costGoldParperTotal = costGoldParper * lackCnt
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, costGoldParperTotal, ChConfig.Def_Cost_ActivityPlace):
|
| | | return
|
| | | delItemCount -= lackCnt
|
| | | |
| | | if delItemCount > 0:
|
| | | ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, delItemCount, ChConfig.ItemDel_ActivityPlace)
|
| | | |
| | | __DoActivityPlaceRewardEnd(curPlayer, finishCount)
|
| | | return
|
| | |
|
| | | def ProcessActivityPlace(curPlayer):
|
| | | ## 活跃放置定时处理
|
| | | |
| | | remainCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRemainCount)
|
| | | if remainCount <= 0:
|
| | | #GameWorld.DebugLog("没有剩余放置次数不处理!")
|
| | | return
|
| | | |
| | | curTime = int(time.time())
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceStartTime)
|
| | | if not startTime:
|
| | | startTime = curTime
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, curTime)
|
| | | |
| | | needSeconds = IpyGameDataPY.GetFuncCfg("ActivityPlace", 3) # 单次放置奖励持续时间,秒
|
| | | passTime = curTime - startTime
|
| | | if passTime < needSeconds:
|
| | | #GameWorld.DebugLog("探索时间未到,不结算! curTime=%s,startTime=%s,passTime=%s < %s" % (curTime, startTime, passTime, needSeconds))
|
| | | return
|
| | | endCount = passTime / needSeconds
|
| | | nextStartReduceSeconds = passTime % needSeconds
|
| | | __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds)
|
| | | return
|
| | |
|
| | | def __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds=0):
|
| | | ## 放置活跃奖励结算
|
| | |
|
| | | if not endCount:
|
| | | remainCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRemainCount)
|
| | | endCount = min(endCount, remainCount)
|
| | | if endCount <= 0:
|
| | | return
|
| | | |
| | | if PlayerTJG.GetIsTJG(curPlayer):
|
| | | return
|
| | | |
| | | countDataDict = {}
|
| | | lvDataDict = {}
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | |
| | | if not lvRewardIpyData:
|
| | | lvRewardIpyData = lvDataDict[lvList[-1]]
|
| | |
|
| | | costPoint = IpyGameDataPY.GetFuncCfg("ActivityPlace", 2) # 单次放置消耗的活跃点数
|
| | | maxRewardCount = IpyGameDataPY.GetFuncCfg("ActivityPlace", 4) # 最大累计放置奖励次数
|
| | | maxAppointCount = max(countDataDict) # 最大定制奖励次数
|
| | | rewardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount)
|
| | | rewardTotalCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardTotalCount)
|
| | |
|
| | | isStop = False
|
| | | rewardItemDict = {}
|
| | | GameWorld.DebugLog("结算放置活跃奖励: rewardCount=%s,endCount=%s,maxRewardCount=%s,maxAppointCount=%s" % (rewardCount, endCount, maxRewardCount, maxAppointCount))
|
| | | for endIndex in xrange(endCount):
|
| | | #GameWorld.DebugLog("endIndex=%s" % endIndex)
|
| | | GameWorld.DebugLog("结算放置活跃奖励: remainCount=%s,rewardCount=%s,endCount=%s,maxAppointCount=%s" % (remainCount, rewardCount, endCount, maxAppointCount))
|
| | | for _ in xrange(endCount):
|
| | |
|
| | | # 超过1次的需要补扣活跃消耗
|
| | | if endCount > 1 and endIndex != 0:
|
| | | if not CostActivityPoint(curPlayer, costPoint):
|
| | | isStop = True
|
| | | GameWorld.DebugLog(" 可消耗的活跃不足,无法继续结算奖励!")
|
| | | break
|
| | | |
| | | rewardIpyData = None
|
| | | rewardTotalCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardTotalCount)
|
| | |
|
| | | # 加奖励次数
|
| | | remainCount -= 1
|
| | | rewardCount += 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardCount, rewardCount)
|
| | | if rewardTotalCount < maxAppointCount:
|
| | | rewardTotalCount += 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardTotalCount, rewardTotalCount)
|
| | | if rewardTotalCount in countDataDict:
|
| | | rewardIpyData = countDataDict[rewardTotalCount]
|
| | | #GameWorld.DebugLog(" 取定制次数奖励")
|
| | | #GameWorld.DebugLog(" 取定制次数奖励: rewardTotalCount=%s" % rewardTotalCount)
|
| | |
|
| | | if not rewardIpyData:
|
| | | rewardIpyData = lvRewardIpyData
|
| | |
| | | if itemID:
|
| | | rewardItemDict[itemID] = rewardItemDict.get(itemID, 0) + 1
|
| | |
|
| | | GameWorld.DebugLog(" rewardCount=%s,rewardTotalCount=%s, %s" % (rewardCount, rewardTotalCount, rewardItemDict))
|
| | |
|
| | | if rewardCount >= maxRewardCount:
|
| | | isStop = True
|
| | | GameWorld.DebugLog(" 放置活跃奖励次数已达上限!rewardCount=%s" % rewardCount)
|
| | | break
|
| | | |
| | | GameWorld.DebugLog(" remainCount=%s,rewardCount=%s,rewardTotalCount=%s, %s" % (remainCount, rewardCount, rewardTotalCount, rewardItemDict))
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRemainCount, remainCount)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardCount, rewardCount)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardTotalCount, rewardTotalCount)
|
| | | |
| | | if remainCount > 0:
|
| | | nextStartTime = int(time.time()) - nextStartReduceSeconds
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, nextStartTime)
|
| | | GameWorld.DebugLog(" 还有剩余次数,更新启动时间: %s, nextStartReduceSeconds=%s" % (nextStartTime, nextStartReduceSeconds))
|
| | | |
| | | # 存储奖励
|
| | | rewardItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItem)
|
| | | for i in xrange(rewardItemCount):
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItem, rewardItemCount)
|
| | | #GameWorld.DebugLog(" 新增探索奖励: itemID=%s,itemCount=%s,rewardItemCount=%s" % (itemID, itemCount, rewardItemCount))
|
| | |
|
| | | if isStop:
|
| | | GameWorld.DebugLog(" 停止探索!")
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceState, 0)
|
| | | else:
|
| | | __DoActivityPlaceStart(curPlayer, nextStartReduceSeconds)
|
| | | |
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def __DoActivityPlaceStart(curPlayer, reduceSeconds=0):
|
| | | |
| | | costPoint = IpyGameDataPY.GetFuncCfg("ActivityPlace", 2) # 单次放置消耗的活跃点数
|
| | | canUseActivityPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityCanCostTotalPoint)
|
| | | if canUseActivityPoint < costPoint:
|
| | | GameWorld.DebugLog("活跃度不足,无法启动放置探索!canUseActivityPoint=%s" % canUseActivityPoint)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceState, 0)
|
| | | return
|
| | | startTime = int(time.time()) - reduceSeconds
|
| | | GameWorld.DebugLog(" 启动新一轮放置探索!reduceSeconds=%s" % reduceSeconds)
|
| | | CostActivityPoint(curPlayer, costPoint)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceState, 1)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, startTime)
|
| | | return True
|
| | |
|
| | | def GetActivityPlaceReward(curPlayer):
|
| | | ## 领取活跃放置奖励
|
| | |
| | | itemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItemCount % i)
|
| | | rewardItemInfo.append([itemID, itemCount])
|
| | | placeInfo = ChPyNetSendPack.tagMCActivityPlaceInfo()
|
| | | placeInfo.PlaceState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceState)
|
| | | placeInfo.StartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceStartTime)
|
| | | placeInfo.PlaceCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRemainCount)
|
| | | placeInfo.RewardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount)
|
| | | placeInfo.RewardInfo = str(rewardItemInfo)
|
| | | placeInfo.RewardLen = len(placeInfo.RewardInfo)
|
| | |
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import NPCHurtManager
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import IPY_GameWorld
|
| | | import ItemControler
|
| | | import ItemCommon
|
| | |
| | | ipyData = ipyDataMgr.GetAssistThanksGiftByIndex(index)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GetThanksGiftCount % ipyData.GetGiftID(), 0)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoney, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoneySocial, 0)
|
| | | Sync_TodayAssistMoneyInfo(curPlayer)
|
| | | return
|
| | |
|
| | | #// B0 10 请求协助Boss #tagCMRequestAssistBoss
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def AddTodayAssistMoney(curPlayer, moneyType, addMoney, isSocialEx):
|
| | | ''' 增加今日协助货币奖励 |
| | | @param moneyType: 货币类型
|
| | | @param addMoney: 常规增加,有每日上限
|
| | | @param isSocialEx: 是否社交加成,不计入常规上限
|
| | | '''
|
| | | |
| | | todayAssistMoney = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayAssistMoney)
|
| | | socialMoney = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayAssistMoneySocial)
|
| | | todayAssistMoneyMax = IpyGameDataPY.GetFuncCfg("AssistAward", 4)
|
| | | if todayAssistMoney >= todayAssistMoneyMax:
|
| | | return 0
|
| | | |
| | | addValue = min(addMoney, todayAssistMoneyMax - todayAssistMoney)
|
| | | socialEx = 0
|
| | | if isSocialEx:
|
| | | friendAddAssistMoneyPer = IpyGameDataPY.GetFuncCfg("AssistAward", 3)
|
| | | socialEx = int(addValue * friendAddAssistMoneyPer / 100.0)
|
| | | |
| | | realAdd = addValue + socialEx
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, realAdd)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoney, todayAssistMoney + addValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoneySocial, socialMoney + socialEx)
|
| | | |
| | | Sync_TodayAssistMoneyInfo(curPlayer)
|
| | | return realAdd
|
| | |
|
| | | def Sync_TodayAssistMoneyInfo(curPlayer):
|
| | | ## 通知今日已获得协助货币信息
|
| | | infoPack = ChPyNetSendPack.tagMCTodayAssistMoneyInfo()
|
| | | infoPack.TodayAssistMoney = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayAssistMoney)
|
| | | infoPack.SocialMoney = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayAssistMoneySocial)
|
| | | NetPackCommon.SendFakePack(curPlayer, infoPack)
|
| | | return
|
| | |
|
| | |
| | | '''
|
| | | GameWorld.Log("上架系统拍品: %s" % sysAuctionItemList)
|
| | |
|
| | | itemCount = 1 # 系统拍品,默认上架一个
|
| | | isAuctionItem = True
|
| | | auctionItemList = []
|
| | | for sysAuctionItemInfo in sysAuctionItemList:
|
| | | itemCount = 1 # 系统拍品,默认上架一个
|
| | | if type(sysAuctionItemInfo) == int:
|
| | | itemID = sysAuctionItemInfo
|
| | | elif type(sysAuctionItemInfo) == list and len(sysAuctionItemInfo) == 2:
|
| | | itemID, itemCount = sysAuctionItemInfo
|
| | | elif type(sysAuctionItemInfo) == list and len(sysAuctionItemInfo) >= 5:
|
| | | classLV, color, placeList, isSuit, star = sysAuctionItemInfo[:5]
|
| | | if star:
|
| | |
| | | #仙界盛典-充值大礼
|
| | | PlayerFairyCeremony.OnFCRecharge(curPlayer)
|
| | | PlayerNewFairyCeremony.OnFCRecharge(curPlayer)
|
| | | PlayerGoldGift.DayChargeRedPackAward(curPlayer)
|
| | | PlayerGoldGift.OnPlayerChargeGold(curPlayer, addGold)
|
| | | #累积充值X元
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin/100)
|
| | | PlayerFairyCeremony.AddFCCTGRMB(curPlayer, orderCoin/100)
|
| | |
| | | msgInfo = {"PlayerID":curPlayer.GetPlayerID(), "MoneyType":priceType, "Value":value, "GiveType":giveType, "AddDataDict":addDataDict}
|
| | | GameWorld.SendMsgToClientServer(ShareDefine.CrossServerMsg_GiveMoney, msgInfo, [serverGroupID])
|
| | | return True
|
| | | |
| | | ## 恺英版去除了仙缘币,改为获得仙盟活跃令
|
| | | if priceType == ShareDefine.TYPE_Price_XianyuanCoin:
|
| | | priceType = ShareDefine.TYPE_Price_FamilyActivity
|
| | |
|
| | | if priceType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | | if curPlayer.GetGold() + value > ChConfig.Def_PlayerTotalMoney_Gold:
|
| | |
| | | if silverPoint != curPlayer.GetExAttr6():
|
| | | curPlayer.SetExAttr6(silverPoint)
|
| | | return
|
| | |
|
| | | ## 玩家今日已获得仙缘币
|
| | | def GetTodayXianyuanCoin(curPlayer): return curPlayer.GetExAttr11()
|
| | | def SetTodayXianyuanCoin(curPlayer, value): return curPlayer.SetExAttr11(value, False, True)
|
| | | def AddTodayXianyuanCoin(curPlayer, addValue): return curPlayer.SetExAttr11(curPlayer.GetExAttr11() + addValue, False, True)
|
| | |
|
| | | ##VIP到期时间, 需要同步GameServer
|
| | | def GetVIPExpireTime(curPlayer): return curPlayer.GetExAttr9()
|
| | |
| | | return
|
| | |
|
| | |
|
| | | def GetPlayerGoldGiftFirst(curPlayer):
|
| | | def GetPlayerGoldGiftFirst(curPlayer, giftDay):
|
| | | '''领取玩家首充奖励
|
| | | @param dayIndex: 首充第几天奖励
|
| | | '''
|
| | |
|
| | | isGet = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
|
| | | if isGet:
|
| | | GameWorld.DebugLog("已经领取过首充奖励!", curPlayer.GetPlayerID())
|
| | | if not giftDay:
|
| | | return
|
| | | |
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | firstGoldServerDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldServerDay)
|
| | | if not firstGoldServerDay:
|
| | | GameWorld.DebugLog("还未充值过!firstGoldServerDay=%s" % firstGoldServerDay)
|
| | | return
|
| | | canGetMaxDay = openServerDay - firstGoldServerDay + 1
|
| | | if giftDay > canGetMaxDay:
|
| | | GameWorld.DebugLog("还未到可领取的首充天,无法领取!openServerDay=%s,firstGoldServerDay=%s,canGetMaxDay=%s < giftDay=%s" |
| | | % (openServerDay, firstGoldServerDay, canGetMaxDay, giftDay))
|
| | | return
|
| | | dayIndex = giftDay - 1
|
| | | getRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
|
| | | if getRecord & pow(2, dayIndex):
|
| | | GameWorld.DebugLog("已经领取过首充奖励!giftDay=%s" % giftDay, curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | if not curPlayer.GetChangeCoinPointTotal():
|
| | | GameWorld.DebugLog("没有充值过,无法领取首充奖励!", curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | firstGoldRewardDict = IpyGameDataPY.GetFuncEvalCfg("FirstGold", 1)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("FirstGold", giftDay)
|
| | | if not ipyData:
|
| | | return |
| | | jobItemInfoDict = ipyData.GetJobItemInfo()
|
| | | commItemList = ipyData.GetCommItemList()
|
| | | |
| | | rewardItemList = []
|
| | | jobStr = str(curPlayer.GetJob())
|
| | | if jobStr not in firstGoldRewardDict:
|
| | | GameWorld.ErrLog("没有配置该职业对应的首充奖励!job=%s" % jobStr, curPlayer.GetPlayerID())
|
| | | return
|
| | | rewardItemList = firstGoldRewardDict[jobStr]
|
| | | if jobStr in jobItemInfoDict:
|
| | | rewardItemList += jobItemInfoDict[jobStr]
|
| | | rewardItemList += commItemList
|
| | | |
| | | if not rewardItemList:
|
| | | return
|
| | | needSpace = len(rewardItemList)
|
| | |
| | | return
|
| | |
|
| | | # 更新已领取成功标记
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GoldGiftFirstRecord, 1)
|
| | | updGetRecord = getRecord | pow(2, dayIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GoldGiftFirstRecord, updGetRecord)
|
| | | GameWorld.DebugLog("领取首充奖励: giftDay=%s,getRecord=%s,updGetRecord=%s, %s" % (giftDay, getRecord, updGetRecord, rewardItemList))
|
| | |
|
| | | # 给物品
|
| | | for itemID, itemCount, isBind in rewardItemList: |
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
|
| | | isAuctionItem = False
|
| | | for itemID, itemCount in rewardItemList: |
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem])
|
| | |
|
| | | # 全服提示
|
| | | if len(rewardItemList) >= 2:
|
| | | PlayerControl.WorldNotify(0, "FirstPayReward1", [curPlayer.GetPlayerName(), rewardItemList[0][0], rewardItemList[1][0]])
|
| | | PlayerControl.WorldNotify(0, "FirstPayReward1", [curPlayer.GetPlayerName(), rewardItemList[0][0], rewardItemList[1][0], giftDay])
|
| | | |
| | | # 记录领取事件
|
| | | DataRecordPack.DR_GoldGiftGiveItem(curPlayer, "FirstGoldGift")
|
| | | infoDict = {"GiftDay":giftDay, "ItemList":rewardItemList}
|
| | | DataRecordPack.DR_GoldGiftGiveItem(curPlayer, "FirstGoldGift", infoDict)
|
| | |
|
| | | # 通知客户端
|
| | | Sync_FirstGoldInfo(curPlayer)
|
| | |
| | | # @param addGold: 充元宝数
|
| | | # @return: None
|
| | | def OnPlayerChargeGold(curPlayer, addGold):
|
| | | DayChargeRedPackAward(curPlayer)
|
| | |
|
| | | # 更新今日已充值数
|
| | | dailyGoldCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyGoldChargeCnt)
|
| | | updDailyGoldCnt = dailyGoldCnt + addGold
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DailyGoldChargeCnt, updDailyGoldCnt)
|
| | | #PlayerControl.NotifyPlayerDictValue(curPlayer, ChConfig.Def_PDict_DailyGoldChargeCnt)
|
| | | |
| | | firstGoldServerDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldServerDay)
|
| | | if not firstGoldServerDay:
|
| | | recordServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldServerDay, recordServerDay)
|
| | | GameWorld.DebugLog("记录首充开服天: recordServerDay=%s" % recordServerDay)
|
| | | Sync_FirstGoldInfo(curPlayer)
|
| | | |
| | | return
|
| | |
|
| | | def Sync_FirstGoldInfo(curPlayer):
|
| | |
| | | sendPack.Clear()
|
| | | sendPack.FirstGoldRewardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
|
| | | sendPack.FirstGoldTry = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldTry)
|
| | | sendPack.FirstGoldServerDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldServerDay)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
|
| | |
| | | import PlayerWing
|
| | | import ChEquip
|
| | | import PlayerYinji
|
| | | import PlayerActivity
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #---------------------------------------------------------------------
|
| | |
| | | ProcessAreaExp(curPlayer, tick)
|
| | | #神秘商店刷新
|
| | | FunctionNPCCommon.CheckMysticalShopRefresh(curPlayer, tick)
|
| | | #活跃放置
|
| | | PlayerActivity.ProcessActivityPlace(curPlayer)
|
| | | #跨服数据同步,放最后
|
| | | CrossPlayerData.ProcessCrossPlayer(curPlayer, tick)
|
| | | return
|
| | |
| | |
|
| | | Def_BT_FCCostGold, #消费排行榜(仙界盛典)
|
| | | Def_BT_Campaign_RuneLV, #符印等级(开服活动榜)
|
| | | Def_BT_FBHelpBattle, #助战次数排行榜
|
| | | Def_BT_19,
|
| | | Def_BT_Campaign_GodWeaponLV, #神兵等级(开服活动榜) 20
|
| | | Def_BT_Campaign_Recharge, #累计充值(开服活动榜)
|
| | | Def_BT_Campaign_PetLV, #灵宠等级(开服活动榜)
|
| | |
| | | #排行榜Value1存储境界信息的榜单列表
|
| | | BTValue1_OfficialRankList = [Def_BT_FightPower, Def_BT_FightPower_Warrior, Def_BT_FightPower_Wizard, Def_BT_FightPower_Assassin,
|
| | | Def_BT_LV, Def_BT_FightPower_Horse, Def_BT_FightPower_Pet, Def_BT_TrialTower, Def_BT_OffLineEfficient,
|
| | | Def_BT_FBHelpBattle,
|
| | | ]
|
| | |
|
| | | ##---比率---
|
| | |
| | | CDBPlayerRefresh_RealmPoint, # 境界修炼点
|
| | | CDBPlayerRefresh_Ysog, # 魔精
|
| | | CDBPlayerRefresh_FamilyActivity, # 仙盟活跃令
|
| | | CDBPlayerRefresh_Xianyuancoin, # 仙缘币
|
| | | CDBPlayerRefresh_174,
|
| | | CDBPlayerRefresh_PKState, # 战斗状态 175
|
| | | CDBPlayerRefresh_BossState, # boss״̬
|
| | | CDBPlayerRefresh_BaseAtkMin, # 基础最小攻击
|
| | |
| | | TYPE_Price_Ysog = 14 # 魔精
|
| | | TYPE_Price_FamilyActivity = 15 # 仙盟活跃令
|
| | | TYPE_Price_FBHelpPoint = 16 # 副本助战积分, 废弃
|
| | | TYPE_Price_XianyuanCoin = 17 # 仙缘币
|
| | | TYPE_Price_Honor = 18 # 荣誉
|
| | | TYPE_Price_Rune = 23 # 符印精华点
|
| | | TYPE_Price_RuneSplinters = 24 # 符印碎片
|
| | |
| | | TYPE_Price_RealmPoint:CDBPlayerRefresh_RealmPoint,
|
| | | TYPE_Price_Ysog:CDBPlayerRefresh_Ysog,
|
| | | TYPE_Price_FamilyActivity:CDBPlayerRefresh_FamilyActivity,
|
| | | TYPE_Price_XianyuanCoin:CDBPlayerRefresh_Xianyuancoin,
|
| | | TYPE_Price_Danjing:CDBPlayerRefresh_Danjing,
|
| | | TYPE_Price_SoulDust:CDBPlayerRefresh_SoulDust,
|
| | | TYPE_Price_SoulSplinters:CDBPlayerRefresh_SoulSplinters,
|
| | |
| | | Def_UniversalGameRecType_YesterdayPlayerLVInfo,#昨日活跃玩家等级信息7
|
| | | Def_UniversalGameRecType_StoreServerCntRecord, #商店全服购买记录 8,
|
| | | Def_UniversalGameRecType_FBHelpBattleCheckInPlayer, #助战玩家登记记录9
|
| | | Def_UniversalGameRecType_FBHelpBattleRecord, #助战未同步记录10
|
| | | Def_UniversalGameRecType_10,
|
| | | Def_UniversalGameRecType_ZhuXianBossRecord, #诛仙BOSS结算记录11
|
| | | Def_UniversalGameRecType_LuckyTreasure, #幸运鉴宝大奖记录12
|
| | | Def_UniversalGameRecType_FairyDomain, #缥缈仙域事件次数记录13
|
| | |
| | |
|
| | | # 2013-1-3,去除npc攻击造成的伤血记录
|
| | | if attackerOwner != None and attackerOwner.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | AttackCommon.NPCAddObjInHurtList(attackerOwner, curObj, curObjHP_BeforeAttack, lostValue) |
| | | #CheckAddPoisonAtkBuff(skillTypeID, attackerOwner, curObj, tick)
|
| | |
|
| | | if curObjType == IPY_GameWorld.gotPlayer:
|
| | | AttackCommon.OnPVPDamage(attackerOwner, lostValue, curObj, "SkillLostHP")
|
| | |
|
| | | elif curObjType == IPY_GameWorld.gotNPC:
|
| | | AttackCommon.NPCAddObjInHurtList(attackerOwner, curObj, curObjHP_BeforeAttack, lostValue)
|
| | | |
| | | #统一调用攻击结束动作
|
| | | if isDoAttackResult:
|
| | | BaseAttack.DoLogic_AttackResult(buffOwner, curObj, None, tick)
|
| | |
| | | Def_GMKey_PlayerName = 'playerName'
|
| | | Def_GMKey_PlayerAccID = 'accID'
|
| | | Def_GMKey_FamilyName = 'familyName'
|
| | | Def_GMKey_FamilyID = 'familyID'
|
| | | Def_GMKey_PackIndex = 'packIndex'
|
| | | Def_GMKey_IP = 'IP'
|
| | | Def_GMKey_QueryType = 'queryType'
|
| | |
| | |
|
| | | playerIDList = []
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | | if queryType == GMCommon.Def_GMKey_FamilyID:
|
| | | # 根据家族ID的不处理,直接推
|
| | | return GMCommon.Def_SendToGameServer, ""
|
| | | |
| | | playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')
|
| | |
|
| | | for playerFind in playerList:
|