6459 【后端】【2.0】缥缈仙域开发单(采集物表增加是否任务采集物)
| | |
| | | struct tagCollectNPC
|
| | | {
|
| | | DWORD _NPCID; //ID
|
| | | BYTE IsMissionCollectNPC; //是否任务采集物
|
| | | BYTE PrepareTime; //采集耗时,秒
|
| | | list LostHPPer; //采集掉血,[每X秒,掉血百分比]
|
| | | BYTE MaxCollectCount; //可采集次数,0无限制
|
| | |
| | |
|
| | | "CollectNPC":(
|
| | | ("DWORD", "NPCID", 1),
|
| | | ("BYTE", "IsMissionCollectNPC", 0),
|
| | | ("BYTE", "PrepareTime", 0),
|
| | | ("list", "LostHPPer", 0),
|
| | | ("BYTE", "MaxCollectCount", 0),
|
| | |
| | | |
| | | def __init__(self): |
| | | self.NPCID = 0
|
| | | self.IsMissionCollectNPC = 0
|
| | | self.PrepareTime = 0
|
| | | self.LostHPPer = []
|
| | | self.MaxCollectCount = 0
|
| | |
| | | return |
| | | |
| | | def GetNPCID(self): return self.NPCID # ID
|
| | | def GetIsMissionCollectNPC(self): return self.IsMissionCollectNPC # 是否任务采集物
|
| | | def GetPrepareTime(self): return self.PrepareTime # 采集耗时,秒
|
| | | def GetLostHPPer(self): return self.LostHPPer # 采集掉血,[每X秒,掉血百分比]
|
| | | def GetMaxCollectCount(self): return self.MaxCollectCount # 可采集次数,0无限制
|
| | |
| | | npcID = curNPC.GetNPCID()
|
| | | collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
|
| | | if not collectNPCIpyData:
|
| | | GameWorld.DebugLog("非特定采集NPC...")
|
| | | #GameWorld.DebugLog("非特定采集NPC...")
|
| | | return False
|
| | | |
| | | if collectNPCIpyData.GetIsMissionCollectNPC():
|
| | | #GameWorld.DebugLog("任务采集物暂不处理")
|
| | | return False
|
| | |
|
| | | if not CheckCanCollectByNPCID(curPlayer, npcID, collectNPCIpyData):
|
| | |
| | | GameWorld.DebugLog(" 非特定采集NPC...npcID=%s" % npcID)
|
| | | return
|
| | |
|
| | | if collectNPCIpyData.GetIsMissionCollectNPC():
|
| | | #GameWorld.DebugLog("任务采集物暂不处理")
|
| | | return
|
| | | |
| | | PlayerState.DoCollectingLostHP(curPlayer, collectNPCIpyData, tick, True)
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | |
| | | if collectCnt <= 0:
|
| | | return
|
| | |
|
| | | if collectNPCIpyData.GetIsMissionCollectNPC():
|
| | | #GameWorld.DebugLog("任务采集物暂不处理")
|
| | | return
|
| | | |
| | | isMaxTime = False # 是否达到了采集最大次数
|
| | | limitMaxTime = collectNPCIpyData.GetMaxCollectCount()
|
| | | if limitMaxTime > 0:
|