| | |
| | | #GameWorld.DebugLog("私有物品掉落: dropItemID=%s" % dropItemID, ownerPlayer.GetPlayerID())
|
| | |
|
| | | return specDropItemList
|
| | |
|
| | | def __NPCDropItemByPlayers(self, dropPlayerList, mapID, ipyDrop):
|
| | | '''NPC掉落物品, 多玩家每人一份, 混合掉落'''
|
| | | curNPC = self.__Instance
|
| | | npcID = curNPC.GetNPCID()
|
| | | if not dropPlayerList:
|
| | | return
|
| | | |
| | | #GameWorld.DebugLog("NPC多玩家混合掉落: dropPlayerCount=%s" % len(dropPlayerList))
|
| | | auctionItemIDList = []
|
| | | dropItemList = []
|
| | | for dropPlayer in dropPlayerList:
|
| | | dropInfo = GetNPCDropInfo(dropPlayer, mapID, npcID, ipyDrop=ipyDrop)
|
| | | if not dropInfo:
|
| | | continue
|
| | | dropIDList, auctionIDList, dropMoneyCnt, moneyValue = dropInfo
|
| | | moneyID = self.__GetDropMoneyModelID(moneyValue)
|
| | | if dropMoneyCnt:
|
| | | dropIDList += [moneyID] * dropMoneyCnt
|
| | | |
| | | dropPlayerID = dropPlayer.GetPlayerID()
|
| | | #GameWorld.DebugLog(" dropPlayerID=%s,dropIDList=%s" % (dropPlayerID, dropIDList))
|
| | | for dropID in dropIDList:
|
| | | dropItemList.append([dropID, dropPlayerID])
|
| | | auctionItemIDList += auctionIDList
|
| | | |
| | | #打乱物品顺序
|
| | | random.shuffle(dropItemList)
|
| | | |
| | | gameMap = GameWorld.GetMap()
|
| | | dropPosX, dropPosY = curNPC.GetPosX(), curNPC.GetPosY() # 以NPC为中心点开始掉落
|
| | | index = 0
|
| | | for posX, posY in ChConfig.Def_DropItemAreaMatrix:
|
| | | resultX = dropPosX + posX
|
| | | resultY = dropPosY + posY
|
| | | |
| | | if not gameMap.CanMove(resultX, resultY):
|
| | | #玩家不可移动这个点
|
| | | continue
|
| | | |
| | | if index > len(dropItemList) - 1:
|
| | | break |
| | | itemID, ownerID = dropItemList[index]
|
| | | index += 1
|
| | | itemCnt = moneyValue if itemID == moneyID else 1
|
| | | iaAuctionItem = itemID in auctionItemIDList
|
| | | curItem = self.__CreateDropItem(curNPC, itemID, itemCnt, iaAuctionItem, dropPlayer)
|
| | | if not curItem:
|
| | | continue
|
| | | self.__MapCreateItem(curItem, resultX, resultY, ChConfig.Def_NPCHurtTypePlayer, ownerID)
|
| | | |
| | | return
|
| | |
|
| | | ## 物品掉落
|
| | | # @param self 类实例
|
| | |
| | | curWorldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | GameWorld.ErrLog("取不到NPC掉落信息!npcID=%s,curWorldLV=%s" % (npcID, curWorldLV))
|
| | | return
|
| | | |
| | | #if mapID == ChConfig.Def_FBMapID_MunekadoTrial:
|
| | | # dropPlayerList = GameLogic_MunekadoTrial.GetCanDropPlayerList()
|
| | | # return self.__NPCDropItemByPlayers(dropPlayerList, mapID, ipyDrop)
|
| | |
|
| | | dropIDList, auctionIDList, dropMoneyCnt, moneyValue = [], [], 0, 0
|
| | | dropInfo = GetNPCDropInfo(dropPlayer, mapID, npcID, ownerPlayerList, ipyDrop, False)
|
| | |
| | | self.__KillNPCFuncEx(curPlayer, curNPC, maxHurtID, True)
|
| | | self.__ownerPlayerList = ownerPlayerList
|
| | |
|
| | | fbOwnerInfo = FBLogic.GetFBEveryoneDropInfo(curNPC)
|
| | | if fbOwnerInfo != None:
|
| | | ownerPlayerList, isOnlySelfSee = fbOwnerInfo |
| | | for curPlayer in ownerPlayerList:
|
| | | self.__NPCDropItem(curPlayer, ChConfig.Def_NPCHurtTypePlayer, curPlayer.GetPlayerID(), [curPlayer], isOnlySelfSee=isOnlySelfSee)
|
| | | #调用物品掉落,boss一人一份
|
| | | if isGameBoss and hurtType in [ChConfig.Def_NPCHurtTypePlayer, ChConfig.Def_NPCHurtTypeTeam, ChConfig.Def_NPCHurtTypeSpecial]:
|
| | | elif isGameBoss and hurtType in [ChConfig.Def_NPCHurtTypePlayer, ChConfig.Def_NPCHurtTypeTeam, ChConfig.Def_NPCHurtTypeSpecial]:
|
| | | isOnlySelfSee = len(ownerPlayerList) > 1
|
| | | for curPlayer in ownerPlayerList:
|
| | | self.__NPCDropItem(curPlayer, ChConfig.Def_NPCHurtTypePlayer, curPlayer.GetPlayerID(), [curPlayer], isOnlySelfSee=isOnlySelfSee)
|