| | |
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import PlayerWeekParty
|
| | | import PlayerActLogin
|
| | | import FamilyRobBoss
|
| | | import IpyGameDataPY
|
| | | import PlayerState
|
| | |
| | |
|
| | | if ItemCommon.GetIsEquip(itemData):
|
| | | for _ in xrange(itemCount):
|
| | | curItem = ItemControler.GetOutPutItemObj(itemID, isBind=isBind)
|
| | | curItem = ItemControler.GetOutPutItemObj(itemID)
|
| | | if curItem:
|
| | | needSpace += 1
|
| | | prizeItemList.append(curItem)
|
| | |
| | | index += 1
|
| | | if isinstance(curItem, list):
|
| | | itemID, itemCount, isBind = curItem
|
| | | curItem = ItemControler.GetOutPutItemObj(itemID, itemCount, isBind)
|
| | | curItem = ItemControler.GetOutPutItemObj(itemID, itemCount, False)
|
| | |
|
| | | if not curItem:
|
| | | continue
|
| | |
| | | for prizeItem in prizeItemList:
|
| | | if isinstance(prizeItem, list):
|
| | | itemID, itemCount, isBind = prizeItem
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem], |
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem], |
| | | event=event)
|
| | | else:
|
| | | ItemControler.DoLogic_PutItemInPack(curPlayer, prizeItem, event=event)
|
| | |
| | | GameWorld.DebugLog("Boss状态变更: bossID=%s,isAlive=%s,dataMapID=%s,realMapID=%s,copyMapID=%s"
|
| | | % (bossID, isAlive, dataMapID, realMapID, copyMapID))
|
| | | if not isAlive:
|
| | | if dataMapID in ChConfig.Def_CrossZoneTableName:
|
| | | tableName = ChConfig.Def_CrossZoneTableName[dataMapID]
|
| | | if dataMapID in ChConfig.Def_CrossZoneMapTableName:
|
| | | tableName = ChConfig.Def_CrossZoneMapTableName[dataMapID]
|
| | | realMapID = GameWorld.GetGameWorld().GetRealMapID()
|
| | | copyMapID = GameWorld.GetGameWorld().GetCopyMapID()
|
| | | zoneIpyData = IpyGameDataPY.GetIpyGameData(tableName, realMapID, dataMapID, copyMapID)
|
| | |
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_WorldBoss, 1)
|
| | | PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_WorldBoss, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_WorldBOSS, 1)
|
| | | PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_WorldBOSS, 1)
|
| | |
|
| | | if mapID == ChConfig.Def_FBMapID_BossHome:
|
| | | #BOSS之家
|
| | |
| | | # GameWorld.DebugLog("伤血玩家血量为0,清除该伤血!playerID=%s" % hurtID)
|
| | | # return True
|
| | |
|
| | | if not hurtPlayer.GetVisible():
|
| | | if hurtPlayer.GetInitOK() and not hurtPlayer.GetVisible():
|
| | | GameWorld.DebugLog("伤血玩家不可见,清除该伤血!playerID=%s" % hurtID)
|
| | | return True
|
| | |
|
| | |
| | | #GameWorld.DebugLog("队员不在本线路,不计!playerID=%s" % playerID)
|
| | | continue
|
| | |
|
| | | if not curTeamPlayer.GetVisible():
|
| | | if curTeamPlayer.GetInitOK() and not curTeamPlayer.GetVisible():
|
| | | #GameWorld.DebugLog("队员不可见,不计!playerID=%s" % playerID)
|
| | | continue
|
| | |
|
| | |
| | | teamHurtPlayerIDList.append(playerID)
|
| | |
|
| | | if not teamHurtPlayerIDList:
|
| | | GameWorld.DebugLog("伤血队伍没有活着的队员在boss区域内,清除该伤血!teamID=%s,mapTeamPlayerIDList=%s" % (teamID, mapTeamPlayerIDList))
|
| | | GameWorld.DebugLog("伤血队伍没有符合条件的队员在boss区域内,清除该伤血!teamID=%s,mapTeamPlayerIDList=%s" % (teamID, mapTeamPlayerIDList))
|
| | | return teamHurtPlayerIDList
|
| | |
|
| | | def RefreshHurtList(self, tick, refreshInterval=3000):
|
| | |
| | | index += 1
|
| | | itemCnt = moneyValue if itemID == moneyID else 1
|
| | | isBind = dropItemBindDict.get(itemID, 1)
|
| | | curItem = self.__CreateDropItem(curNPC, itemID, itemCnt, isBind)
|
| | | curItem = self.__CreateDropItem(curNPC, itemID, itemCnt, isBind, dropPlayer)
|
| | | if not curItem:
|
| | | continue
|
| | | self.__MapCreateItem(curItem, resultX, resultY, ChConfig.Def_NPCHurtTypePlayer, ownerID)
|
| | |
| | | itemCnt = moneyValue if itemID == moneyID else 1
|
| | | isBind = dropIDBindDict.get(itemID, 1)
|
| | |
|
| | | curItem = self.__CreateDropItem(curNPC, itemID, itemCnt, isBind)
|
| | | curItem = self.__CreateDropItem(curNPC, itemID, itemCnt, isBind, dropPlayer)
|
| | | if not curItem:
|
| | | continue
|
| | |
|
| | |
| | | curItem.SetUserAttr(ShareDefine.Def_IudetSource, ShareDefine.Item_Source_VirtualItemDrop)
|
| | | dropItemDataStr = ChItem.GetMapDropItemDataStr(curItem)
|
| | | #可以放入背包
|
| | | if ItemControler.DoLogic_PutItemInPack(ownerPlayer, curItem, True, True,
|
| | | event=["NPCDrop", False, {"npcID":npcID}]):
|
| | | if ItemControler.DoLogic_PutItemInPack(ownerPlayer, curItem, event=["NPCDrop", False, {"npcID":npcID}]):
|
| | | #通知客户端
|
| | | self.SendVirtualItemDrop(ownerPlayer, itemID, resultX, resultY, dropItemDataStr)
|
| | |
|
| | |
| | | #===========================================================================================
|
| | |
|
| | | # 在地上添加物品(统一接口)
|
| | | dropNPCID = 0 if not curNPC.GetIsBoss() else curNPCID
|
| | | dropNPCID = 0 if not ChConfig.IsGameBoss(curNPC) else curNPCID
|
| | | specOwnerIDList = self.__AllKillerDict.keys() if (len(self.__AllKillerDict) > 1 or dropType == ChConfig.Def_NPCHurtTypeSpecial) else []
|
| | | curMapItem = ChItem.AddMapDropItem(posX, posY, curItem, ownerInfo=[dropType, ownerID, specOwnerIDList], dropNPCID=dropNPCID)
|
| | |
|
| | |
| | | #self.__SetItemProtect(curMapItem, dropType, ownerID)
|
| | | return
|
| | |
|
| | | def __CreateDropItem(self, curNPC, itemID, count, isBind):
|
| | | def __CreateDropItem(self, curNPC, itemID, count, isBind, dropPlayer):
|
| | | ## 创建掉落的物品
|
| | | curItem = ItemControler.GetOutPutItemObj(itemID)
|
| | | if not isBind and not IpyGameDataPY.GetIpyGameDataNotLog("AuctionItem", itemID):
|
| | | isBind = 1
|
| | | isAuctionItem = not isBind
|
| | | curItem = ItemControler.GetOutPutItemObj(itemID, count, isAuctionItem, curPlayer=dropPlayer)
|
| | | if not curItem:
|
| | | return
|
| | | |
| | | curMapID = GameWorld.GetMap().GetMapID()
|
| | | curMapID = FBCommon.GetRecordMapID(curMapID)
|
| | | |
| | | # 掉落数量
|
| | | curItem.SetCount(count)
|
| | | curItem.SetIsBind(isBind)
|
| | | return curItem
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | giveItemList = collectNPCIpyData.GetCollectAward()
|
| | | if giveItemList:
|
| | | itemID, itemCount, isBind = giveItemList
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem])
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
|
| | |
|
| | | #采集成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_Collect, collectCnt, [npcID])
|