| | |
| | | import NPCCommon
|
| | | import FBCommon
|
| | |
|
| | | import random
|
| | | import json
|
| | | #---------------------------------------------------------------------
|
| | | #导入
|
| | |
| | | FBLogic.OnFBPickUpItem(curPlayer, singItem, tick)
|
| | |
|
| | | equipInfo = [singItem.GetEquipPlace(), ItemCommon.GetItemClassLV(singItem), singItem.GetItemColor(),
|
| | | singItem.GetItemQuality(), singItem.GetUserData()]
|
| | | singItem.GetSuiteID(), singItem.GetUserData()]
|
| | | if not itemControl.PutInItem(packIndex, singItem, event=[ChConfig.ItemGive_Pickup, False, {"NPCID":dropItemNPCID}]):
|
| | | #物品不能放入
|
| | | #PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [packIndex])
|
| | |
| | | return
|
| | |
|
| | | if dropItemNPCID:
|
| | | serverGroupID = PlayerControl.GetPlayerServerGroupID(curPlayer)
|
| | | mapID = GameWorld.GetGameWorld().GetMapID()
|
| | | NPCCommon.SendGameServerGoodItemRecord(mapID, dropItemNPCID, curPlayer.GetName(), |
| | | curPlayer.GetPlayerID(), curItemID, equipInfo, serverGroupID)
|
| | | lineID = 0 if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtNull else PlayerControl.GetFBFuncLineID(curPlayer)
|
| | | NPCCommon.SendGameServerGoodItemRecord(curPlayer, mapID, lineID, dropItemNPCID, curItemID, equipInfo)
|
| | |
|
| | | # 不需要队伍提示
|
| | | #=======================================================================
|
| | |
| | | ChConfig.Def_Effect_ChatBubbleBox:"Item_ChatBubbleBox", # 激活聊天气泡框
|
| | | ChConfig.Def_Effect_ItemGiveWeekPartyPoint:"Item_WeekPartyPoint", # 增加活动巡礼积分
|
| | | ChConfig.Def_Effect_ItemGiveWeekPartyPoint1:"Item_WeekPartyPoint", # 增加活动巡礼积分
|
| | | #ChConfig.Def_Effect_AddZhenQiByTimes:"Item_AddZhenQiByTimes", # 增加真气按一天使用次数减少
|
| | | #ChConfig.Def_Effect_AddPrestige:"Item_AddPrestige", # 给人物威望
|
| | | ChConfig.Def_Effect_AddRealmExpRate:"Item_AddRealmExpRate", # 增加聚灵效率
|
| | | ChConfig.Def_Effect_TouchMission:"Item_TouchMission", # 触发任务接口
|
| | | #ChConfig.Def_Effect_FamilyImpeach:"Item_FamilyImpeach", # 弹劾符
|
| | | #ChConfig.Def_Effect_ClothesCoatSkin:"Item_ClothesCoatSkin", #激活时装皮肤
|
| | | #ChConfig.Def_Effect_AddOfficialExp:"Item_AddOfficialExp", # 增加爵位经验
|
| | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | def DoMapDropItem(curPlayer, itemList, npcID, dropPosX, dropPosY, isOnlySelfSee=True, isDropDisperse=True):
|
| | | if not itemList:
|
| | | return
|
| | | if isDropDisperse:
|
| | | dropItemList = []
|
| | | for itemInfo in itemList:
|
| | | if isinstance(itemInfo, list):
|
| | | itemID, itemCount, isAuctionItem = itemInfo
|
| | | # 拍品不拆
|
| | | if isAuctionItem:
|
| | | dropItemList.append(itemInfo)
|
| | | continue
|
| | | for _ in xrange(itemCount):
|
| | | dropItemList.append([itemID, 1, isAuctionItem])
|
| | | else:
|
| | | dropItemList.append(itemInfo)
|
| | | else:
|
| | | dropItemList = itemList
|
| | | |
| | | random.shuffle(dropItemList) # 打乱顺序
|
| | | index = 0
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | gameMap = GameWorld.GetMap()
|
| | | 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
|
| | | |
| | | curItem = dropItemList[index]
|
| | | index += 1
|
| | | if isinstance(curItem, list):
|
| | | itemID, itemCount, isAuctionItem = curItem
|
| | | curItem = ItemControler.GetOutPutItemObj(itemID, itemCount, isAuctionItem, curPlayer=curPlayer)
|
| | | |
| | | if not curItem:
|
| | | continue
|
| | | |
| | | AddMapDropItem(resultX, resultY, curItem, ownerInfo=[ChConfig.Def_NPCHurtTypePlayer, playerID], |
| | | dropNPCID=npcID, isOnlySelfSee=isOnlySelfSee) |
| | | return
|
| | |
|
| | | ## 在地上添加物品(统一接口)
|
| | | # @param itemPosX 位置x
|
| | | # @param itemPosY 位置y
|
| | |
| | | for i in xrange(len(equipData.legendAttrIDList)):
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrID, equipData.legendAttrIDList[i])
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValue, equipData.legendAttrValueList[i])
|
| | | |
| | | #绝版属性
|
| | | if equipData.OutOfPrintAttrIDList and equipData.OutOfPrintAttrValueList:
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetOutOfPrintAttrID)
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetOutOfPrintAttrValue)
|
| | | for i in xrange(len(equipData.OutOfPrintAttrIDList)):
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetOutOfPrintAttrID, equipData.OutOfPrintAttrIDList[i])
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetOutOfPrintAttrValue, equipData.OutOfPrintAttrValueList[i])
|
| | |
|
| | | ItemCommon.MakeEquipGS(curItem)
|
| | | return
|