6459 【后端】【2.0】缥缈仙域开发单(草园采集相关)
| | |
| | | DWORD _NPCID; //ID
|
| | | BYTE PrepareTime; //采集耗时,秒
|
| | | list LostHPPer; //采集掉血,[每X秒,掉血百分比]
|
| | | BYTE MaxCollectCount; //每日可采集次数,0限制
|
| | | BYTE MaxCollectCount; //可采集次数,0无限制
|
| | | BYTE CollectResetType; //采集次数重置类型,0-不重置,1-每日5点重置
|
| | | char CollectCountLimitNotify; //无采集次数采集提示
|
| | | list CollectAward; //采集奖励物品, [物品ID,个数,是否绑定]
|
| | | list CollectAward; //采集奖励物品,权重列表 [[权重, [物品ID,个数,是否拍品]], ...]
|
| | | dict CollectAppointAward; //采集次数定制产出 {次数:[物品ID,个数,是否拍品], ...}
|
| | | BYTE AlchemyDiffLV; //过滤炼丹等级差,0-不过滤,>0过滤大于自身炼丹等级X级的物品
|
| | | BYTE NotifyCollectResult; //是否通知采集结果
|
| | | };
|
| | |
|
| | | //宝箱表开启
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 18 采集奖励物品通知 #tagMCCollectAwardItemInfo
|
| | |
|
| | | class tagMCCollectAwardItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), |
| | | ("Count", c_ubyte), |
| | | ("IsAuctionItem", c_ubyte), #是否拍品
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.ItemID = 0
|
| | | self.Count = 0
|
| | | self.IsAuctionItem = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCCollectAwardItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A7 18 采集奖励物品通知 //tagMCCollectAwardItemInfo:
|
| | | ItemID:%d,
|
| | | Count:%d,
|
| | | IsAuctionItem:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.Count,
|
| | | self.IsAuctionItem
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCCollectAwardItemInfo(Structure):
|
| | | Head = tagHead()
|
| | | CollectNPCID = 0 #(DWORD CollectNPCID)//采集的NPCID
|
| | | Count = 0 #(BYTE Count)
|
| | | AwardItemList = list() #(vector<tagMCCollectAwardItem> AwardItemList)//奖励物品信息列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x18
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.CollectNPCID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temAwardItemList = tagMCCollectAwardItem()
|
| | | _pos = temAwardItemList.ReadData(_lpData, _pos)
|
| | | self.AwardItemList.append(temAwardItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x18
|
| | | self.CollectNPCID = 0
|
| | | self.Count = 0
|
| | | self.AwardItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.AwardItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.CollectNPCID)
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | CollectNPCID:%d,
|
| | | Count:%d,
|
| | | AwardItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.CollectNPCID,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCCollectAwardItemInfo=tagMCCollectAwardItemInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCCollectAwardItemInfo.Head.Cmd,m_NAtagMCCollectAwardItemInfo.Head.SubCmd))] = m_NAtagMCCollectAwardItemInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 13 动态障碍物状态 #tagMCDynamicBarrierState
|
| | |
|
| | | class tagMCDynamicBarrier(Structure):
|
| | |
| | | PacketSubCMD_1=0x52
|
| | | PacketCallFunc_1=OnBuyCollectionCnt
|
| | |
|
| | | PacketCMD_2=
|
| | | PacketSubCMD_2=
|
| | | PacketCallFunc_2=
|
| | | PacketCMD_2=A2
|
| | | PacketSubCMD_2=34
|
| | | PacketCallFunc_2=OnGetCustomSceneCollectAward
|
| | |
|
| | | PacketCMD_3=0xA5
|
| | | PacketSubCMD_3=0x0A
|
| | |
| | | Def_PDict_KillPlayerAddActive = "KillPlayerAddActiveByDay" # 杀人每日获得活跃度
|
| | | Def_PDict_LoginDayCnt = "PLoginDayCnt" # 累计登陆天数
|
| | | Def_PDict_LoginDayAward = "PLoginDayAward" # 累计登陆领取情况
|
| | | Def_PDict_CollNpcIDCollTime = "CollNpcIDCollTime_%s" # 采集NPCID对应每日对应采集次数,%sNPCID
|
| | | Def_PDict_CollNpcIDCollTime = "NPCIDCollTime_%s" # 采集NPCID对应每日对应采集次数,%sNPCID
|
| | | Def_PDict_CollNpcIDCollTimeTotal = "NPCIDCollTimeTotal_%s" # 采集NPCID对应对应采集总次数,%sNPCID
|
| | | Def_PDict_ShopItemDayBuyCnt = "ShopItemDayBuyCnt_%s" # 商店NPC商品已购买次数,itemIndex
|
| | | Def_PDict_ShopItemStartTime = "ShopItemStartTime_%s" # 神秘限购商品开卖时间,itemIndex
|
| | | Def_PDict_MysticalShopGoods = "MysticalShopGoods_%s" # 神秘商店商品ID,索引
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 18 采集奖励物品通知 #tagMCCollectAwardItemInfo
|
| | |
|
| | | class tagMCCollectAwardItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), |
| | | ("Count", c_ubyte), |
| | | ("IsAuctionItem", c_ubyte), #是否拍品
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.ItemID = 0
|
| | | self.Count = 0
|
| | | self.IsAuctionItem = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCCollectAwardItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A7 18 采集奖励物品通知 //tagMCCollectAwardItemInfo:
|
| | | ItemID:%d,
|
| | | Count:%d,
|
| | | IsAuctionItem:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.Count,
|
| | | self.IsAuctionItem
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCCollectAwardItemInfo(Structure):
|
| | | Head = tagHead()
|
| | | CollectNPCID = 0 #(DWORD CollectNPCID)//采集的NPCID
|
| | | Count = 0 #(BYTE Count)
|
| | | AwardItemList = list() #(vector<tagMCCollectAwardItem> AwardItemList)//奖励物品信息列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x18
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.CollectNPCID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temAwardItemList = tagMCCollectAwardItem()
|
| | | _pos = temAwardItemList.ReadData(_lpData, _pos)
|
| | | self.AwardItemList.append(temAwardItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x18
|
| | | self.CollectNPCID = 0
|
| | | self.Count = 0
|
| | | self.AwardItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.AwardItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.CollectNPCID)
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.AwardItemList[i].GetLength(), self.AwardItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | CollectNPCID:%d,
|
| | | Count:%d,
|
| | | AwardItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.CollectNPCID,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCCollectAwardItemInfo=tagMCCollectAwardItemInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCCollectAwardItemInfo.Head.Cmd,m_NAtagMCCollectAwardItemInfo.Head.SubCmd))] = m_NAtagMCCollectAwardItemInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 13 动态障碍物状态 #tagMCDynamicBarrierState
|
| | |
|
| | | class tagMCDynamicBarrier(Structure):
|
| | |
| | | for index in xrange(ipyDataMgr.GetCollectNPCCount()):
|
| | | ipyData = ipyDataMgr.GetCollectNPCByIndex(index)
|
| | | npcID = ipyData.GetNPCID()
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CollNpcIDCollTimeTotal % npcID, 0)
|
| | | if not ipyData.GetMaxCollectCount():
|
| | | continue
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CollNpcIDCollTime % npcID):
|
| | |
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2019-04-15 16:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import GameWorldProcess
|
| | | import PlayerFairyDomain
|
| | | import NPCCustomRefresh
|
| | | import IpyGameDataPY
|
| | | import PyGameData
|
| | | import NPCCommon
|
| | |
|
| | | def DoResetCrossGrassland(curPlayer, eventType):
|
| | | ## 草园重置
|
| | | |
| | | resetCollectType = 10 + eventType
|
| | | NPCCommon.DoResetCollectNPCTimeByType(curPlayer, [resetCollectType])
|
| | | |
| | | # 宝箱怪次数重置
|
| | | |
| | | return
|
| | | |
| | | def __SetGrasslandVisitState(curPlayer, mapID, lineID, state):
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("FairyDomain", {"MapID":mapID, "LineID":lineID})
|
| | | if not ipyData:
|
| | | return False
|
| | | eventID = ipyData.GetID()
|
| | | if not PlayerFairyDomain.SetFairyDomainEventState(curPlayer, eventID, state):
|
| | | return False
|
| | | return True
|
| | |
|
| | | def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
|
| | | if not __SetGrasslandVisitState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visiting):
|
| | | return False
|
| | | return True
|
| | |
|
| | | ## 开启副本
|
| | |
| | |
|
| | | ## 副本总逻辑计时器
|
| | | def OnProcess(tick):
|
| | | #gameFB = GameWorld.GetGameFB()
|
| | | return
|
| | |
|
| | | ## 关闭副本
|
| | |
| | |
|
| | | return
|
| | |
|
| | | ## 客户端进入自定义场景
|
| | | def OnEnterCustomScene(curPlayer, mapID, lineID):
|
| | | __SetGrasslandVisitState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visiting)
|
| | | return
|
| | |
|
| | | ## 给自定义副本奖励后续处理
|
| | | ## @return: 返回结算副本over信息字典,不含jsonItem信息
|
| | | def OnGiveCustomFBPrizeOK(curPlayer, mapID, lineID):
|
| | | __SetGrasslandVisitState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visited)
|
| | | overDict = {}
|
| | | return overDict
|
| | |
|
| | |
| | | import ChPlayer
|
| | | import EventReport
|
| | | import ChNPC
|
| | | import ItemCommon
|
| | |
|
| | |
|
| | | FBPlayerDict_CurStep = 'FBPlayerDict_CurStep' # 当前阶段
|
| | |
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | return
|
| | | if curAlchemyLV < itemData.GetLV() - 1:
|
| | | if curAlchemyLV < ItemCommon.GetItemClassLV(itemData) - 1:
|
| | | #丹炉等级不足
|
| | | continue
|
| | |
|
| | |
| | | ("BYTE", "PrepareTime", 0),
|
| | | ("list", "LostHPPer", 0),
|
| | | ("BYTE", "MaxCollectCount", 0),
|
| | | ("BYTE", "CollectResetType", 0),
|
| | | ("char", "CollectCountLimitNotify", 0),
|
| | | ("list", "CollectAward", 0),
|
| | | ("dict", "CollectAppointAward", 0),
|
| | | ("BYTE", "AlchemyDiffLV", 0),
|
| | | ("BYTE", "NotifyCollectResult", 0),
|
| | | ),
|
| | |
|
| | | "Chests":(
|
| | |
| | | self.PrepareTime = 0
|
| | | self.LostHPPer = []
|
| | | self.MaxCollectCount = 0
|
| | | self.CollectResetType = 0
|
| | | self.CollectCountLimitNotify = ""
|
| | | self.CollectAward = [] |
| | | self.CollectAppointAward = {}
|
| | | self.AlchemyDiffLV = 0
|
| | | self.NotifyCollectResult = 0 |
| | | return |
| | | |
| | | def GetNPCID(self): return self.NPCID # ID
|
| | | def GetPrepareTime(self): return self.PrepareTime # 采集耗时,秒
|
| | | def GetLostHPPer(self): return self.LostHPPer # 采集掉血,[每X秒,掉血百分比]
|
| | | def GetMaxCollectCount(self): return self.MaxCollectCount # 每日可采集次数,0限制
|
| | | def GetMaxCollectCount(self): return self.MaxCollectCount # 可采集次数,0无限制
|
| | | def GetCollectResetType(self): return self.CollectResetType # 采集次数重置类型,0-不重置,1-每日5点重置
|
| | | def GetCollectCountLimitNotify(self): return self.CollectCountLimitNotify # 无采集次数采集提示
|
| | | def GetCollectAward(self): return self.CollectAward # 采集奖励物品, [物品ID,个数,是否绑定] |
| | | def GetCollectAward(self): return self.CollectAward # 采集奖励物品,权重列表 [[权重, [物品ID,个数,是否拍品]], ...]
|
| | | def GetCollectAppointAward(self): return self.CollectAppointAward # 采集次数定制产出 {次数:[物品ID,个数,是否拍品], ...}
|
| | | def GetAlchemyDiffLV(self): return self.AlchemyDiffLV # 过滤炼丹等级差,0-不过滤,>0过滤大于自身炼丹等级X级的物品
|
| | | def GetNotifyCollectResult(self): return self.NotifyCollectResult # 是否通知采集结果 |
| | | |
| | | # 宝箱表开启 |
| | | class IPY_Chests(): |
| | |
| | | classLV = GetItemClassLV(curItem)
|
| | | return maxStarDict[str(itemColor)].get(str(classLV), 0)
|
| | |
|
| | | ## 获取物品阶级
|
| | | ## 获取物品阶级或品级
|
| | | def GetItemClassLV(curItem):
|
| | | return curItem.GetLV()
|
| | |
|
| | |
| | | return max(value / pow(10, nlen), 1)
|
| | |
|
| | |
|
| | | Def_CollNPCCfg_Len = 10
|
| | | (
|
| | | Def_CollNPCCfg_CanTogether, # 是否允许同时采集
|
| | | Def_CollNPCCfg_SysMsgMark, # 不可同时采集提示
|
| | | Def_CollNPCCfg_CostItemInfo, # 采集消耗物品信息
|
| | | Def_CollNPCCfg_PrepareTime, # 采集时间毫秒
|
| | | Def_CollNPCCfg_ExpFormat, # 获得经验公式
|
| | | Def_CollNPCCfg_MoneyFormat, # 获得金币公式
|
| | | Def_CollNPCCfg_ZhenQi, # 获得的真气/魔魂
|
| | | Def_CollNPCCfg_GiveItemModeID, # 获得的物品信息模板编号
|
| | | Def_CollNPCCfg_NotCostItemNotify, # 消耗品不足提示
|
| | | Def_CollNPCCfg_LimitSysMsgMark, #采集上限提示
|
| | | ) = range(Def_CollNPCCfg_Len)
|
| | |
|
| | |
|
| | | def CheckCanCollectByNPCID(curPlayer, npcID, collectNPCIpyData):
|
| | | # 根据NPCID判断是否可以采集
|
| | |
|
| | |
| | | DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData)
|
| | | return
|
| | |
|
| | | #// A2 34 自定义场景中获取采集奖励 #tagCMGetCustomSceneCollectAward
|
| | | #
|
| | | #struct tagCMGetCustomSceneCollectAward
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD NPCID; //采集的NPCID
|
| | | #};
|
| | | def OnGetCustomSceneCollectAward(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | npcID = clientData.NPCID
|
| | | if not curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | GameWorld.DebugLog("非自定义场景中,无法获取定义采集奖励!")
|
| | | return
|
| | | collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
|
| | | if collectNPCIpyData:
|
| | | DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData)
|
| | | return
|
| | |
|
| | | def DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData, collectCnt=1):
|
| | | GameWorld.DebugLog("给采集奖励: npcID=%s,collectCnt=%s" % (npcID, collectCnt))
|
| | | if collectCnt <= 0:
|
| | |
| | | updCollTime = todayCollTime + collectCnt
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CollNpcIDCollTime % npcID, updCollTime)
|
| | | SyncCollNPCTime(curPlayer, [npcID])
|
| | | GameWorld.DebugLog(" 增加当日采集次数: todayCollTime=%s,updCollTime=%s" % (todayCollTime, updCollTime))
|
| | | GameWorld.DebugLog(" 增加采集次数: todayCollTime=%s,updCollTime=%s" % (todayCollTime, updCollTime))
|
| | |
|
| | | giveItemList = collectNPCIpyData.GetCollectAward()
|
| | | if giveItemList:
|
| | | itemID, itemCount, isAuctionItem = giveItemList
|
| | | awardIitemList = []
|
| | | collectAwardCfg = collectNPCIpyData.GetCollectAward()
|
| | | collectAppointAwardCfg = collectNPCIpyData.GetCollectAppointAward()
|
| | | if collectAppointAwardCfg:
|
| | | collTotalTime = min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CollNpcIDCollTimeTotal % npcID) + 1, ChConfig.Def_UpperLimit_DWord)
|
| | | if collTotalTime in collectAppointAwardCfg:
|
| | | awardIitemList.append(collectAppointAwardCfg[collTotalTime])
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CollNpcIDCollTimeTotal % npcID, collTotalTime)
|
| | | #GameWorld.DebugLog("采集次数定制奖励: collTotalTime=%s,awardIitemList=%s" % (collTotalTime, awardIitemList))
|
| | | |
| | | if not awardIitemList:
|
| | | alchemyDiffLV = collectNPCIpyData.GetAlchemyDiffLV()
|
| | | giveItemWeightList = []
|
| | | if alchemyDiffLV:
|
| | | curAlchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
|
| | | for itemInfo in collectAwardCfg:
|
| | | itemID = itemInfo[1][0]
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | if ItemCommon.GetItemClassLV(itemData) > curAlchemyLV + alchemyDiffLV:
|
| | | continue
|
| | | giveItemWeightList.append(itemInfo)
|
| | | else:
|
| | | giveItemWeightList = collectAwardCfg
|
| | | |
| | | giveItemInfo = GameWorld.GetResultByWeightList(giveItemWeightList)
|
| | | awardIitemList.append(giveItemInfo)
|
| | | |
| | | if awardIitemList:
|
| | | for itemID, itemCount, isAuctionItem in awardIitemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem])
|
| | | if collectNPCIpyData.GetNotifyCollectResult():
|
| | | awardPack = ChPyNetSendPack.tagMCCollectAwardItemInfo()
|
| | | awardPack.CollectNPCID = npcID
|
| | | for itemID, itemCount, isAuctionItem in awardIitemList:
|
| | | awardItem = ChPyNetSendPack.tagMCCollectAwardItem()
|
| | | awardItem.ItemID = itemID
|
| | | awardItem.Count = itemCount
|
| | | awardItem.IsAuctionItem = isAuctionItem
|
| | | awardPack.AwardItemList.append(awardItem)
|
| | | awardPack.Count = len(awardPack.AwardItemList)
|
| | | NetPackCommon.SendFakePack(curPlayer, awardPack)
|
| | |
|
| | | #采集成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_Collect, collectCnt, [npcID])
|
| | |
| | |
|
| | | def CollNPCTimeOnDay(curPlayer):
|
| | | ## 采集NPCOnDay处理
|
| | | DoResetCollectNPCTimeByType(curPlayer, 1)
|
| | | return
|
| | |
|
| | | def DoResetCollectNPCTimeByType(curPlayer, resetTypeList=[]):
|
| | | '''重置采集物采集次数
|
| | | 重置类型: 0-不重置,1-每日5点,12-灵草园重置,14-仙草园重置
|
| | | '''
|
| | | resetNPCIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetCollectNPCCount()):
|
| | | ipyData = ipyDataMgr.GetCollectNPCByIndex(index)
|
| | | npcID = ipyData.GetNPCID()
|
| | | if resetTypeList and ipyData.GetCollectResetType() not in resetTypeList:
|
| | | continue
|
| | | if not ipyData.GetMaxCollectCount():
|
| | | continue
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CollNpcIDCollTime % npcID):
|
| | |
| | | resetNPCIDList.append(npcID)
|
| | |
|
| | | if resetNPCIDList:
|
| | | #GameWorld.DebugLog("重置采集次数: resetTypeList=%s,resetNPCIDList=%s" % (resetTypeList, resetNPCIDList), curPlayer.GetPlayerID())
|
| | | SyncCollNPCTime(curPlayer, resetNPCIDList)
|
| | | return
|
| | |
|
| | |
| | | import NetPackCommon
|
| | | import ShareDefine
|
| | | import GameWorld
|
| | | import GameLogic_CrossGrassland
|
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import PlayerActivity
|
| | |
| | | (
|
| | | FDEventType0,
|
| | | FDEventType1,
|
| | | FDEventType2,
|
| | | FDEventType_GrasslandXian,
|
| | | FDEventType3,
|
| | | FDEventType4,
|
| | | FDEventType_GrasslandLing,
|
| | | ) = range(5)
|
| | |
|
| | | (
|
| | |
| | | GameWorld.Log('缥缈仙域事件状态设置,体力不足!,fdeventID=%s, costEnergy=%s, curEnergy=%s' % (fdeventID, costEnergy, curEnergy))
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEnergy, curEnergy - costEnergy)
|
| | | |
| | | # 草园重置
|
| | | if ipyData.GetEventType() in [FDEventType_GrasslandXian, FDEventType_GrasslandLing]:
|
| | | GameLogic_CrossGrassland.DoResetCrossGrassland(curPlayer, ipyData.GetEventType())
|
| | | |
| | | elif state == FDEventState_Visited:
|
| | | if curState != FDEventState_Visiting:
|
| | | GameWorld.Log('缥缈仙域事件状态设置错误,fdeventID=%s, state=%s, curState=%s' % (fdeventID, state, curState))
|