6332 【后端】【2.0】主要是拍品相关规则调整及背包优化(去除旧版设置绑定逻辑)
| | |
| | | curPlayer.SetMP(curPlayer.GetMaxMP())
|
| | |
|
| | | #---给予玩家新手物品---
|
| | | itemControler = ItemControler.PlayerItemControler(curPlayer)
|
| | | |
| | | firstLoginGiveItemList = ReadChConfig.GetEvalChConfig("FirstLogin_GiveItem")
|
| | | for itemID, itemCount, itemBind in firstLoginGiveItemList:
|
| | | if itemID == 0:
|
| | | continue
|
| | | giveItem = ItemCommon.CreateSingleItem(itemID)
|
| | | |
| | | if not giveItem:
|
| | | GameWorld.ErrLog('__FirstLoginOnEnter giveItemErr = %s'%(itemID), playerID)
|
| | | continue
|
| | | |
| | | if itemCount > 0:
|
| | | ItemControler.SetItemCount(giveItem, itemCount, curPlayer.GetPlayerID(), curPlayer.GetAccID(), |
| | | curPlayer.GetPlayerName())
|
| | | |
| | | ItemControler.SetItemIsBind(giveItem, itemBind)
|
| | | |
| | | if not itemControler.PutInItem(IPY_GameWorld.rptItem, giveItem):
|
| | | GameWorld.ErrLog('__FirstLoginOnEnter packFull, giveItemErr = %s'%(itemID), playerID)
|
| | | giveItem.Clear()
|
| | | continue
|
| | |
|
| | | #---初始化装备显隐 第1套*10+没有套装
|
| | | curPlayer.SetEquipShowSwitch(10)
|
| | |
| | | # @return 返回值无意义
|
| | | # @remarks 客户端封包响应 //0D 0C 材料加工#tagCMaterialCompound
|
| | | def StuffMachining(index, tick):
|
| | | # curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | # |
| | | # materialCompoundPack = IPY_GameWorld.IPY_CMaterialCompound()
|
| | | # itemIndex = materialCompoundPack.GetItemIndex()
|
| | | # |
| | | # curItemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | # curItem = curItemPack.GetAt(itemIndex)
|
| | | #
|
| | | # #类型不符合
|
| | | # if not ItemCommon.CheckItemByType(curItem, ChConfig.Def_Type_Machining_Stuff):
|
| | | # PlayerControl.NotifyCode(curPlayer, "GeRen_jin_287294")
|
| | | # return
|
| | | # |
| | | # #[金钱,金钱类型]
|
| | | # curEffMoney = curItem.GetEffectByIndex(1)
|
| | | # useMoney = curEffMoney.GetEffectValue(0)
|
| | | # useMoneyType = curEffMoney.GetEffectValue(1)
|
| | | # |
| | | # #判断金钱
|
| | | # if not PlayerControl.HaveMoney(curPlayer, useMoneyType, useMoney):
|
| | | # return
|
| | | #
|
| | | # #[等级,数量]
|
| | | # curEffInfo = curItem.GetEffectByIndex(0)
|
| | | # curEffectID = curEffInfo.GetEffectID()
|
| | | # curItemLv = curEffInfo.GetEffectValue(0)
|
| | | # useCount = curEffInfo.GetEffectValue(1)
|
| | | # |
| | | # #---数量验证---
|
| | | # hasCount = curItem.GetCount()
|
| | | # if useCount > hasCount:
|
| | | # PlayerControl.NotifyCode(curPlayer , "GeRen_jin_293296")
|
| | | # return
|
| | | # |
| | | # #查找更高一级的材料
|
| | | # findItemData = ItemCommon.FindItemFromDataByEffValue(ChConfig.Def_Type_Machining_Stuff, curEffectID, curItemLv+1)
|
| | | # |
| | | # #已经是顶级材料
|
| | | # if findItemData == None:
|
| | | # PlayerControl.NotifyCode(curPlayer, "GeRen_jin_708106")
|
| | | # return
|
| | | # |
| | | # #---创建物品,放入背包,失败则要删除物品---
|
| | | # newItem = ItemCommon.CreateSingleItem(findItemData.GetItemTypeID())
|
| | | # ItemControler.SetItemIsBind(newItem, curItem.GetIsBind())
|
| | | # |
| | | # isBind = newItem.GetIsBind()
|
| | | # |
| | | # newItemTypeID = newItem.GetItemTypeID()
|
| | | # newItemCount = newItem.GetCount()
|
| | | # |
| | | # #是否成功放入背包
|
| | | # itemControl = ItemControler.PlayerItemControler(curPlayer)
|
| | | # if not itemControl.PutInItem(IPY_GameWorld.rptItem, newItem):
|
| | | # PlayerControl.NotifyCode(curPlayer, "GeRen_jin_650657")
|
| | | # newItem.Clear()
|
| | | # return
|
| | | # |
| | | # curItemID = curItem.GetItemTypeID() #合成材料ID
|
| | | # |
| | | # #---扣钱物品并记录---
|
| | | # PlayerControl.PayMoney(curPlayer, useMoneyType, useMoney)
|
| | | # |
| | | # ItemCommon.DelItem(curPlayer, curItem, useCount, True, 'ComposeChip')
|
| | | # |
| | | # #生成物品
|
| | | # PlayerControl.NotifyCode(curPlayer, 'GeRen_jin_557507', [newItemTypeID, newItemCount])
|
| | | # |
| | | # #手续费流向记录
|
| | | # PlayerControl.DataServerMoneyLog(curPlayer, useMoneyType, 650, par = useMoney, msg = "poundage")
|
| | | # |
| | | # |
| | | # DataRecordPack.DR_StuffMachining(curPlayer, newItemTypeID, newItemCount, isBind)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | priceType = IPY_GameWorld.TYPE_Price_Silver_Money
|
| | | curItemPrice = curItem.GetSilverPrice()
|
| | | return curItemPrice, priceType
|
| | | #绑定价格售价为0, 2011.4.27
|
| | | # if curItem.GetIsBind():
|
| | | # itrmPrice_bind = eval(ReadChConfig.GetChConfig("ItemSellPrice_Bind"))
|
| | | # return itrmPrice_bind, priceType
|
| | | # |
| | | # #无耐久物品
|
| | | # if curItemEndure == 0 :
|
| | | # return curItemPrice * 0.5, priceType
|
| | | # |
| | | # itrmPrice_notBind = eval(ReadChConfig.GetChConfig("ItemSellPrice_NotBind"))
|
| | | # return itrmPrice_notBind, priceType
|
| | | #===============================================================================
|
| | | # 2010.11.25 绑定售价和非绑定一致
|
| | | # #绑定的
|
| | | # if curItem.GetIsBind():
|
| | | # return curItemPrice * 0.5 * 0.5, curItemType
|
| | | # #非绑定的
|
| | | # return curItemPrice * 0.5, curItemType
|
| | | #===============================================================================
|
| | | #===============================================================================
|
| | | # |
| | | # #绑定正常物品出售价格
|
| | | # if curItem.GetIsBind() :
|
| | | # return eval(ChConfig.Def_Formula_ItemSellPrice) * 0.5, curItemType
|
| | | # |
| | | # #未绑定正常物品出售价格
|
| | | # return eval(ChConfig.Def_Formula_ItemSellPrice), curItemType
|
| | | #===============================================================================
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ##检查玩家可否开始NPC事件
|
| | | # @param curPlayer 玩家实例
|
| | | # @return 返回值真, 检查通过
|
| | |
| | | GameWorld.Log('###创造任务物品失败, itemID = %s' % (itemID))
|
| | | return
|
| | |
|
| | | tmpEquipData = ItemControler.SingleEquipTmpData()
|
| | | tmpEquipData.starLV = starLV
|
| | | tmpEquipData.holeCnt = holeCount
|
| | | tmpEquipData.isSuite = isSuite
|
| | | tmpEquipData.isBind = bind
|
| | | #tmpEquipData = ItemControler.SingleEquipTmpData()
|
| | | #tmpEquipData.starLV = starLV
|
| | | #tmpEquipData.holeCnt = holeCount
|
| | | #tmpEquipData.isSuite = isSuite
|
| | | #tmpEquipData.isBind = bind
|
| | |
|
| | | ChItem.EquipAddAdditionEx(curSingleItem, tmpEquipData)
|
| | | #ChItem.EquipAddAdditionEx(curSingleItem, tmpEquipData)
|
| | |
|
| | | #设置数量
|
| | | ItemControler.SetItemCount(curSingleItem, itemCount)
|
| | |
| | |
|
| | | # 使用拍品
|
| | | if curItem.GetIsBind():
|
| | | DoLogic_PlayerUseAuctionItem(curPlayer, curItem)
|
| | | GameWorld.DebugLog("玩家使用拍品: itemID=%s" % (curItem.GetItemTypeID()), curPlayer.GetPlayerID())
|
| | | ItemControler.SetIsAuctionItem(curItem, False, curPlayer)
|
| | | return
|
| | |
|
| | | if useCnt <= 0:
|
| | |
| | |
|
| | | __DoLogic_PlayerUseItemSelf(curPlayer, itemIndex, tick, useCnt, exData)
|
| | |
|
| | | return
|
| | |
|
| | | def DoLogic_PlayerUseAuctionItem(curPlayer, curItem):
|
| | | ## 玩家使用拍品
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | itemID = curItem.GetItemTypeID()
|
| | | |
| | | curItem.SetIsBind(0) # 设置为非拍品
|
| | | GameWorld.DebugLog("玩家使用拍品: itemID=%s" % (itemID), playerID)
|
| | | |
| | | if ItemCommon.GetIsEquip(curItem):
|
| | | # 生成传奇属性
|
| | | legendAttrInfo = ItemControler.GetAddEquipLegendAttr(curItem, curPlayer)
|
| | | if not legendAttrInfo:
|
| | | GameWorld.ErrLog("使用装备拍品没有传奇属性!itemID=%s" % (itemID), playerID)
|
| | | return
|
| | | attrIDList, attrValueList = legendAttrInfo
|
| | | updateDict = {ShareDefine.Def_IudetLegendAttrID:attrIDList, ShareDefine.Def_IudetLegendAttrValue:attrValueList}
|
| | | delKeyList = [ShareDefine.Def_IudetAuctionItemCreateTime]
|
| | | ItemCommon.UpdateItemUserData(curItem, updateDict, delKeyList, isUpdateGS=True)
|
| | | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # @return
|
| | | def EquipAddAdditionEx(curItem, equipData):
|
| | | # 绑定
|
| | | if equipData.isBind:
|
| | | ItemControler.SetItemIsBind(curItem, equipData.isBind)
|
| | | #if equipData.isBind:
|
| | | # ItemControler.SetItemIsBind(curItem, equipData.isBind)
|
| | |
|
| | | if not ItemCommon.CheckItemIsEquip(curItem):
|
| | | return
|
| | |
| | | import ChEquip
|
| | |
|
| | | import math
|
| | | import time
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 获得背包的一个空格子
|
| | |
| | | SetItemCount(srcItem, srcItem.GetCount() - realPutCount)
|
| | | SetItemCount(destItem, destItem.GetCount() + realPutCount)
|
| | |
|
| | | SetItemIsBind(destItem, True)
|
| | | #SetItemIsBind(destItem, True)
|
| | | return True
|
| | | #2. 目标位置有东西, 并且可以堆叠
|
| | | if (CanPackItem(srcItem, destItem) and maxPackCount > destItem.GetCount()):
|
| | |
| | | equipItem = equipPack.GetAt(equipPackIndex)
|
| | | desItemID, desUserData = [0, ''] if equipItem.IsEmpty() else [equipItem.GetItemTypeID(), equipItem.GetUserData()]
|
| | | srcItemID, srcUserData = curItem.GetItemTypeID(), curItem.GetUserData()
|
| | | # 装备绑定处理 在 DoLogic_ItemBindType函数有处理,此处注释掉
|
| | | # if not curItem.GetIsBind():
|
| | | # SetItemIsBind(curItem, True)
|
| | |
|
| | | #--其他装备物品---
|
| | | #itemColor = curItem.GetItemColor()
|
| | |
| | | GameWorld.ErrLog('DoLogic_PutItemInPack Error 物品无法放入背包')
|
| | | return False
|
| | |
|
| | | ## 设置物品是否绑定
|
| | | # @param curGiveItem 物品实例
|
| | | # @param isBind 是否绑定
|
| | | # @return None
|
| | | # @remarks |
| | | def SetItemIsBind(curGiveItem, isBind):
|
| | | #isBind = False
|
| | | curGiveItem.SetIsBind(isBind)
|
| | | ## 是否拍品
|
| | | def GetIsAuctionItem(curItem): return curItem.GetIsBind()
|
| | | def SetIsAuctionItem(curItem, isAuctionItem, curPlayer=None):
|
| | | curItem.SetIsBind(isAuctionItem)
|
| | | |
| | | if isAuctionItem:
|
| | | curItem.SetUserAttr(ShareDefine.Def_IudetAuctionItemCreateTime, int(time.time()))
|
| | | return
|
| | | |
| | | if not curPlayer:
|
| | | return
|
| | | |
| | | if ItemCommon.GetIsEquip(curItem):
|
| | | # 生成传奇属性
|
| | | legendAttrInfo = GetAddEquipLegendAttr(curItem, curPlayer)
|
| | | if not legendAttrInfo:
|
| | | return
|
| | | attrIDList, attrValueList = legendAttrInfo
|
| | | updateDict = {ShareDefine.Def_IudetLegendAttrID:attrIDList, ShareDefine.Def_IudetLegendAttrValue:attrValueList}
|
| | | delKeyList = [ShareDefine.Def_IudetAuctionItemCreateTime]
|
| | | ItemCommon.UpdateItemUserData(curItem, updateDict, delKeyList, isUpdateGS=True)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | ## 设置物品数量
|
| | | # @param item 物品实例
|
| | |
| | |
|
| | | if isAuctionItem:
|
| | | if IpyGameDataPY.GetIpyGameDataNotLog("AuctionItem", itemID):
|
| | | curSingleItem.SetUserAttr(ShareDefine.Def_IudetAuctionItemCreateTime, int(time.time()))
|
| | | curSingleItem.SetIsBind(1)
|
| | | ItemControler.SetIsAuctionItem(curSingleItem, isAuctionItem)
|
| | | else:
|
| | | GameWorld.ErrLog("拍卖物品表不存在该ID!创建拍品失败,默认转为非拍品!itemID=%s" % itemID)
|
| | |
|
| | |
| | | if isUpdateGS:
|
| | | MakeEquipGS(curItem)
|
| | | elif isRoleItem:
|
| | | curItem.SetIsBind(curItem.GetIsBind()) # 为了触发物品同步
|
| | | curItem.SetCount(curItem.GetCount()) # 为了触发物品同步
|
| | | return
|
| | |
|
| | | def MakeEquipGS(curItem):
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def DoLogic_ItemBindType(curPlayer, curItem, bindType):
|
| | | #固定不绑定
|
| | | if bindType == ChConfig.Def_BindType_NoBind:
|
| | | return
|
| | | |
| | | #不处理已经绑定的物品
|
| | | if curItem.GetIsBind():
|
| | | return
|
| | | #不是这个功能的绑定类型
|
| | | if curItem.GetBindType() != bindType:
|
| | | return
|
| | | if curItem.GetBindType() == ChConfig.Def_BindType_DoEquipBind:
|
| | | pass
|
| | | |
| | | ItemControler.SetItemIsBind(curItem, True)
|
| | | #拍品去除绑定逻辑,暂屏蔽
|
| | | # if bindType == ChConfig.Def_BindType_NoBind:
|
| | | # return
|
| | | # |
| | | # #不处理已经绑定的物品
|
| | | # if curItem.GetIsBind():
|
| | | # return
|
| | | # #不是这个功能的绑定类型
|
| | | # if curItem.GetBindType() != bindType:
|
| | | # return
|
| | | # if curItem.GetBindType() == ChConfig.Def_BindType_DoEquipBind:
|
| | | # pass
|
| | | # |
| | | # ItemControler.SetItemIsBind(curItem, True)
|
| | | return True
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | if itemInfo.GetUserData():
|
| | | itemDict["UserData"] = itemInfo.GetUserData()
|
| | | return itemDict
|
| | |
|
| | | ## 将物品列表重复物品堆叠起来返回整理后的列表
|
| | | # @param itemlist
|
| | | # @return 整理后的物品列表
|
| | | def GetSimpleItemList(itemlist):
|
| | | sItemList = []
|
| | | sItemDict = {}
|
| | | for item in itemlist:
|
| | | maxPackCount = item.GetPackCount()
|
| | | if maxPackCount == 0:
|
| | | return itemlist
|
| | | itemCnt = item.GetCount()
|
| | | if itemCnt > maxPackCount:
|
| | | return itemlist
|
| | | itemid = item.GetItemTypeID()
|
| | | isBind = item.GetIsBind()
|
| | | key = (itemid,isBind)
|
| | | if key in sItemDict:
|
| | | for sitem in sItemDict[key]:
|
| | | if sitem.GetCount() >= maxPackCount:
|
| | | continue
|
| | | totalCnt = item.GetCount()+ sitem.GetCount()
|
| | | |
| | | if totalCnt > maxPackCount:
|
| | | ItemControler.SetItemCount(sitem, maxPackCount)
|
| | | ItemControler.SetItemCount(item, totalCnt - maxPackCount)
|
| | | sItemList.append(item)
|
| | | sItemDict[key].append(item)
|
| | | break
|
| | | ItemControler.SetItemCount(sitem, totalCnt)
|
| | | item.Clear()
|
| | | else:
|
| | | sItemList.append(item)
|
| | | sItemDict[key] = [item]
|
| | | |
| | | |
| | | return sItemList
|
| | |
|
| | | ## =======================================================================================
|
| | | ##根据活动类型配置随机装备品质
|
| | | # @param itemType |
| | | # @return 品质
|
| | | def GetRandEquipQualityByTable(itemType, tableName):
|
| | | qualityRandDict = ReadChConfig.GetEvalChConfig(tableName)
|
| | | qualityRandList = qualityRandDict.get(itemType, [])
|
| | | if qualityRandList == []:
|
| | | qualityRandList = qualityRandDict[-1]
|
| | | |
| | | return GameWorld.GetResultByRandomList(qualityRandList, 0)
|
| | |
|
| | | ## 随机卓越装备,根据规则从数据库中筛选出,等级职业
|
| | | # @param equipType 装备类型
|
| | | # @return 抽奖是否成功 |
| | | def RandGreateEquip(curPlayer, equipType, isBind, tableName, quality=1):
|
| | | equipList = GameDataControl.GetItemDataListByType(equipType)
|
| | | equipLVRandList, lvFormulaStr, lvRange, jobRand, luckyShotRand, greateNumRand, \
|
| | | broadcastList, plusRand, addAttrRand = ReadChConfig.GetEvalChConfig(tableName)
|
| | | |
| | | playerLV = curPlayer.GetLV()
|
| | | step = GameWorld.GetResultByRandomList(equipLVRandList, 0)
|
| | | getLVMin = eval(lvFormulaStr)
|
| | | getLVMax = getLVMin + lvRange
|
| | | checkJob = GameWorld.CanHappen(jobRand)
|
| | | |
| | | randList = []
|
| | | findItem = None
|
| | | |
| | | for item in equipList:
|
| | | if item.GetUseLV() < getLVMin or item.GetUseLV() > getLVMax:
|
| | | continue
|
| | | |
| | | if item.GetItemQuality() != quality:
|
| | | continue
|
| | | |
| | | if checkJob:
|
| | | if JobUseable(curPlayer, item):
|
| | | findItem = item
|
| | | break
|
| | | continue
|
| | | |
| | | randList.append(item)
|
| | | |
| | | if randList:
|
| | | findItem = random.choice(randList)
|
| | | |
| | | if findItem == None:
|
| | | return None, False
|
| | | |
| | | return CreateGreateItem(findItem, luckyShotRand, greateNumRand, broadcastList,
|
| | | plusRand, addAttrRand, isBind)
|
| | |
|
| | |
|
| | | ## 生成抽奖的卓越装备
|
| | | # @param 各属性
|
| | | # @return 生成的物品,是否广播 |
| | | def CreateGreateItem(findItem, luckyShotRand, greateNumRand, broadcastList,
|
| | | plusRand, addAttrRand, isBind):
|
| | | itemID = findItem.GetItemTypeID()
|
| | | equipItem = CreateSingleItem(itemID)
|
| | | |
| | | tmpEquipData = ItemControler.SingleEquipTmpData()
|
| | | |
| | | tmpEquipData.starLV = random.randint(plusRand[0], plusRand[1])
|
| | | tmpEquipData.holeCnt = 3
|
| | | tmpEquipData.isBind = isBind
|
| | | tmpEquipData.isSuite = 0
|
| | | |
| | | # 装备附加属性
|
| | | ChItem.EquipAddAdditionEx(equipItem, tmpEquipData)
|
| | | |
| | | broadcast = False
|
| | | |
| | | return equipItem, broadcast
|
| | |
|
| | |
|
| | | ## 随机普通装备,根据规则从数据库中筛选出,等级职业
|
| | | # @param equipType 装备类型
|
| | | # @return 抽奖是否成功 |
| | | def RandNormalEquip(curPlayer, equipType, isBind, tableName):
|
| | | equipList = GameDataControl.GetItemDataListByType(equipType)
|
| | | equipLVRandList, lvFormulaStr, lvRange, jobRand, luckyShotRand, \
|
| | | plusRand, addAttrRand, skillRand = ReadChConfig.GetEvalChConfig(tableName)
|
| | | |
| | | playerLV = curPlayer.GetLV()
|
| | | step = GameWorld.GetResultByRandomList(equipLVRandList, 0)
|
| | | getLVMin = eval(lvFormulaStr)
|
| | | getLVMax = getLVMin + lvRange
|
| | | checkJob = GameWorld.CanHappen(jobRand)
|
| | | |
| | | randList = []
|
| | | findItem = None
|
| | | |
| | | for item in equipList:
|
| | | if item.GetUseLV() < getLVMin or item.GetUseLV() > getLVMax:
|
| | | continue
|
| | | |
| | | if item.GetItemQuality() != 0:
|
| | | continue
|
| | | |
| | | if checkJob:
|
| | | if JobUseable(curPlayer, item):
|
| | | findItem = item
|
| | | break
|
| | | continue
|
| | | |
| | | randList.append(item)
|
| | | |
| | | if randList:
|
| | | findItem = random.choice(randList)
|
| | | |
| | | if findItem == None:
|
| | | return None
|
| | | |
| | | return CreateNormalItem(findItem, luckyShotRand, plusRand, addAttrRand, isBind, skillRand)
|
| | |
|
| | |
|
| | | ## 生成抽奖的卓越装备
|
| | | # @param 各属性
|
| | | # @return 生成的物品
|
| | | def CreateNormalItem(findItem, luckyShotRand, plusRand, addAttrRand, isBind, skillRand):
|
| | | itemID = findItem.GetItemTypeID()
|
| | | equipItem = CreateSingleItem(itemID)
|
| | | |
| | | tmpEquipData = ItemControler.SingleEquipTmpData()
|
| | | |
| | | tmpEquipData.starLV = random.randint(plusRand[0], plusRand[1])
|
| | | tmpEquipData.holeCnt = 3
|
| | | tmpEquipData.isBind = isBind
|
| | | tmpEquipData.isSuite = 0
|
| | | |
| | | # 装备附加属性
|
| | | ChItem.EquipAddAdditionEx(equipItem, tmpEquipData)
|
| | | |
| | | return equipItem
|
| | |
|
| | | ## =======================================================================================
|
| | |
|
| | |
| | | if not giveItem:
|
| | | GameWorld.ErrLog('__DoPlayerGetActionAward giveItemErr=%s' % (itemID), playerID)
|
| | | return
|
| | |
|
| | | ItemControler.SetItemIsBind(giveItem, itemInfo[Def_ItemInfo_IsBind])
|
| | | |
| | | itemControler = ItemControler.PlayerItemControler(curPlayer)
|
| | | if not itemControler.PutInItem(IPY_GameWorld.rptItem, giveItem):
|
| | | giveItem.Clear()
|
| | |
| | | import ItemCommon
|
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import ChItem
|
| | |
|
| | | import time
|
| | |
|
| | |
| | | curTime = int(time.time())
|
| | | if curTime - auctionItemCreateTime > IpyGameDataPY.GetFuncCfg("AuctionItem", 1) * 3600:
|
| | | GameWorld.DebugLog("拍品已过期,无法上架!auctionItemCreateTime=%s" % (GameWorld.ChangeTimeNumToStr(auctionItemCreateTime)), playerID)
|
| | | ChItem.DoLogic_PlayerUseAuctionItem(curPlayer, curItem)
|
| | | ItemControler.SetIsAuctionItem(curItem, False, curPlayer)
|
| | | return
|
| | |
|
| | | QueryGameServer_AuctionHouse(playerID, "AddAuctionItemQuery", [itemIndex, itemGUID, itemID])
|
| | |
| | | ItemControler.SetItemCount(curCreateItem, curPackData.Count)
|
| | |
|
| | | if curCreateItem.GetPackCount() == 1:
|
| | | ItemControler.SetItemIsBind(curCreateItem, False)
|
| | | ItemCommon.SetEquipGearScore(curCreateItem, curPackData.EquipGS)
|
| | | curCreateItem.SetUserData(curPackData.UserData, curPackData.UserDataLen)
|
| | |
|
| | |
| | | if not newPetItem:
|
| | | return
|
| | |
|
| | | newPetItem.SetIsBind(True)
|
| | | newPetItem.SetUserAttr(ShareDefine.Def_IudetPet_NPCID, petNPCID)
|
| | | newPetItem.SetUserAttr(ShareDefine.Def_IudetPet_State, ShareDefine.Def_PetState_Null)
|
| | |
|
| | |
| | | #添加家族活跃度
|
| | | addFamilyValue = SMShoppingByGoldAddFamilyVale(curPlayer, priceType, storeItemPrice)
|
| | |
|
| | | #设置物品属性
|
| | | ItemControler.SetItemIsBind(curItemTag, isBind)
|
| | | ItemControler.SetItemCount(curItemTag, itemCount,
|
| | | curPlayer.GetPlayerID(), curPlayer.GetAccID(), curPlayer.GetPlayerName())
|
| | |
|
| | |
| | |
|
| | | # if useGold:
|
| | | # PlayerActivity.AddActivityFinishCnt(curPlayer, ShareDefine.ActivityNum_SuperMarketGold)
|
| | | |
| | | #设置物品属性
|
| | | ItemControler.SetItemIsBind(curItemTag, isBind)
|
| | | |
| | | ItemControler.SetItemCount(curItemTag, buyCnt, curPlayer.GetPlayerID(), curPlayer.GetAccID(), curPlayer.GetPlayerName())
|
| | | itemName = curItemTag.GetName()
|
| | | GUID = curItemTag.GetGUID()
|