1445 lines
		
	
	
		
			57 KiB
		
	
	
	
		
			Lua
		
	
			
		
		
	
	
			1445 lines
		
	
	
		
			57 KiB
		
	
	
	
		
			Lua
		
	
BagManager = {}
 | 
						||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
 | 
						||
local equipConfig = ConfigManager.GetConfig(ConfigName.EquipConfig)
 | 
						||
local equipSign = ConfigManager.GetConfig(ConfigName.EquipSign)
 | 
						||
local this = BagManager
 | 
						||
this.bagDatas = {}
 | 
						||
--地图临时背包数据
 | 
						||
this.mapShotTimeItemData = {}
 | 
						||
--天赋材料消耗组
 | 
						||
this.tianFuMaterial = {}
 | 
						||
this.needEndingTime = 0
 | 
						||
 | 
						||
this.dropIsSHowEquipPrint = true--显示掉落时是否显示装备和魂印
 | 
						||
function this.Initialize()
 | 
						||
    this.isBagPanel = false
 | 
						||
end
 | 
						||
 | 
						||
--初始化背包数据
 | 
						||
function this.InitBagData(_msgItemList)
 | 
						||
    for i = 1, #_msgItemList do
 | 
						||
        this.UpdateBagData(_msgItemList[i], true)
 | 
						||
    end
 | 
						||
end
 | 
						||
 | 
						||
--更新背包数据
 | 
						||
function this.UpdateBagData(_itemData, isNoSendNewItemEvent)
 | 
						||
    isNoSendNewItemEvent = isNoSendNewItemEvent or false
 | 
						||
    local itemdata = {}
 | 
						||
    --LogGreen("_itemData.itemId   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-        ".._itemData.itemId.."    ".._itemData.itemNum)
 | 
						||
    local _itemCfgData = itemConfig[_itemData.itemId]
 | 
						||
    if _itemCfgData ~= nil then
 | 
						||
        -- 宝器数据不能通过背包,这里判断如果是宝器则舍弃这个数据,
 | 
						||
        if _itemCfgData.ItemType == ItemType.EquipTreasure then
 | 
						||
            return
 | 
						||
        end
 | 
						||
        -- 
 | 
						||
        itemdata.itembackData = _itemData
 | 
						||
        itemdata.itemConfig = _itemCfgData
 | 
						||
        itemdata.configData = _itemCfgData
 | 
						||
        itemdata.id = _itemCfgData.Id
 | 
						||
        itemdata.property = {}
 | 
						||
        if _itemCfgData.ResourceID and _itemCfgData.ResourceID > 0 then
 | 
						||
            itemdata.icon = GetResourcePath(_itemCfgData.ResourceID)
 | 
						||
        else
 | 
						||
            itemdata.icon = GetResourcePath(10002)
 | 
						||
        end
 | 
						||
        itemdata.quality = _itemCfgData.Quantity
 | 
						||
        itemdata.frame = GetQuantityImageByquality(_itemCfgData.Quantity)
 | 
						||
        if _itemCfgData.ItemType==34 then
 | 
						||
            itemdata.type = 10
 | 
						||
        else
 | 
						||
            itemdata.type = _itemCfgData.ItemBaseType
 | 
						||
        end
 | 
						||
 | 
						||
        itemdata.itemType = _itemCfgData.ItemType
 | 
						||
        itemdata.name=GetLanguageStrById(_itemCfgData.Name)
 | 
						||
        -- if _itemCfgData.ItemBaseType == ItemBaseType.Equip then
 | 
						||
        --     LogBlue( itemdata.id.."  ".. _itemData.itemNum)
 | 
						||
        -- end
 | 
						||
        itemdata.isBag = _itemCfgData.BackpackOrNot
 | 
						||
        itemdata.num = _itemData.itemNum
 | 
						||
        itemdata.endingTime = _itemData.endingTime
 | 
						||
        itemdata.nextFlushTime = _itemData.nextFlushTime
 | 
						||
        if (itemdata.id == 54) then
 | 
						||
            this.needEndingTime = itemdata.endingTime
 | 
						||
        end
 | 
						||
        if this.bagDatas[itemdata.id] == nil then
 | 
						||
            this.bagDatas[itemdata.id] = itemdata
 | 
						||
            if not isNoSendNewItemEvent then
 | 
						||
                Game.GlobalEvent:DispatchEvent(GameEvent.Bag.GetNewItem, itemdata.id)
 | 
						||
            end
 | 
						||
        else
 | 
						||
            this.bagDatas[itemdata.id].num = itemdata.num
 | 
						||
            this.bagDatas[itemdata.id].endingTime = itemdata.endingTime
 | 
						||
            this.bagDatas[itemdata.id].nextFlushTime = itemdata.nextFlushTime
 | 
						||
        end
 | 
						||
 | 
						||
        if itemdata.type == ItemBaseType.SoulPrint then
 | 
						||
            SoulPrintManager.UpdateAllHavedSoulPrint({itemdata.id})
 | 
						||
        end
 | 
						||
 | 
						||
        if itemdata.type == ItemBaseType.GodPrint then
 | 
						||
            GodPrintManager.UpdateAllHavedSoulPrint({itemdata.id})
 | 
						||
        end
 | 
						||
    end
 | 
						||
    
 | 
						||
    -- 货币数据
 | 
						||
    if itemdata.itemId == 14 or itemdata.itemId == 16 then
 | 
						||
        -- ThinkingAnalyticsManager.SetSuperProperties({
 | 
						||
        --     coins_amount = BagManager.GetItemCountById(14),
 | 
						||
        --     diamond_amount = BagManager.GetItemCountById(16),
 | 
						||
        -- })
 | 
						||
    end
 | 
						||
end
 | 
						||
 | 
						||
---英雄副本独用刷新
 | 
						||
function this.UpDataBagItemIdNumber(_itemData)
 | 
						||
    this.UpdateBagData(_itemData)
 | 
						||
    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
    CheckRedPointStatus(RedPointType.Recruit_Normal)
 | 
						||
    CheckRedPointStatus(RedPointType.Recruit_ShenJiang)
 | 
						||
    CheckRedPointStatus(RedPointType.Recruit_Friend)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_gold)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_red)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_whiteGold)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_blue)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_whiteBlue)
 | 
						||
    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.GetNewItemIncarnation)
 | 
						||
end
 | 
						||
 | 
						||
--后端刷新
 | 
						||
function this.BackDataRefreshEnerny(msgItemInfo)
 | 
						||
    if msgItemInfo and #msgItemInfo > 0 then
 | 
						||
        for i = 1, #msgItemInfo do
 | 
						||
            --存储
 | 
						||
            if this.bagDatas[msgItemInfo[i].templateId] then
 | 
						||
                this.bagDatas[msgItemInfo[i].templateId].num = msgItemInfo[i].overlap
 | 
						||
                this.bagDatas[msgItemInfo[i].templateId].nextFlushTime = msgItemInfo[i].nextRefreshTime
 | 
						||
            end
 | 
						||
        end
 | 
						||
        Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
        RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_Normal)
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_ShenJiang)
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_Friend)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_gold)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_red)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_whiteGold)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_blue)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_whiteBlue)
 | 
						||
        Game.GlobalEvent:DispatchEvent(GameEvent.Bag.GetNewItemIncarnation)
 | 
						||
    end  
 | 
						||
end
 | 
						||
 | 
						||
--通过物品ID返回下次刷新时间(幸运探宝用)
 | 
						||
function this.GetNextRefreshTime(_itemId)
 | 
						||
    if this.bagDatas[_itemId] then
 | 
						||
        return this.bagDatas[_itemId].nextFlushTime
 | 
						||
    end
 | 
						||
end
 | 
						||
 | 
						||
--通过物品id获取物品数量
 | 
						||
function this.GetItemCountById(_itemId)
 | 
						||
    local have = 0
 | 
						||
    if this.bagDatas[_itemId] then
 | 
						||
        have = this.bagDatas[_itemId].num
 | 
						||
    end
 | 
						||
    return have
 | 
						||
end
 | 
						||
 | 
						||
 | 
						||
function this.GetItemNameById(_itemId)
 | 
						||
    local name = ""
 | 
						||
    if this.bagDatas[_itemId] then
 | 
						||
        name = this.bagDatas[_itemId].name
 | 
						||
    else
 | 
						||
        name=itemConfig[_itemId].Name
 | 
						||
    end
 | 
						||
    return name
 | 
						||
end
 | 
						||
 | 
						||
--通过物品id获取物品数量
 | 
						||
function this.GetItemById(_itemId)
 | 
						||
    return this.bagDatas[_itemId]
 | 
						||
end
 | 
						||
 | 
						||
-- 通过物品ID获得临时背包物品
 | 
						||
function this.GetTempBagCountById(_itemId)
 | 
						||
    if this.mapShotTimeItemData[_itemId] then
 | 
						||
        return this.mapShotTimeItemData[_itemId].itemNum
 | 
						||
    end
 | 
						||
    return 0
 | 
						||
end
 | 
						||
--通过物品Id获得临时背包物品的恢复时间
 | 
						||
function this.GetItemRecoveryTime(_itemId)
 | 
						||
    if this.bagDatas[_itemId] then
 | 
						||
        return (AdventureManager.callAlianInvasionCountDownTime - (PlayerManager.serverTime - this.needEndingTime))
 | 
						||
    end
 | 
						||
end
 | 
						||
 | 
						||
--临时背包
 | 
						||
function this.DeleteTempBagCountById(_itemId, deleteNum)
 | 
						||
    --if this.mapShotTimeItemData[_itemId] then
 | 
						||
    --    if this.mapShotTimeItemData[_itemId].itemNum >= deleteNum then
 | 
						||
    --        this.mapShotTimeItemData[_itemId].itemNum = this.mapShotTimeItemData[_itemId].itemNum - deleteNum
 | 
						||
    --    else
 | 
						||
    --        this.mapShotTimeItemData[_itemId] = nil
 | 
						||
    --    end
 | 
						||
    --end
 | 
						||
    --Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged)
 | 
						||
end
 | 
						||
 | 
						||
--英雄升级专用通过物品id更新物品数量 0 时删除
 | 
						||
function this.HeroLvUpUpdateItemsNum(_itemId, deleteNum)
 | 
						||
    if this.bagDatas[_itemId] then
 | 
						||
        this.bagDatas[_itemId].num = this.bagDatas[_itemId].num - deleteNum
 | 
						||
        if this.bagDatas[_itemId].num < 0 then
 | 
						||
            this.bagDatas[_itemId].num = 0
 | 
						||
        end
 | 
						||
        Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
    else
 | 
						||
        LogError("扣了不存在的itemID:" .. _itemId .. "  数量" .. deleteNum)
 | 
						||
    end
 | 
						||
end
 | 
						||
 | 
						||
--通过物品id更新物品数量 0 时删除
 | 
						||
function this.UpdateItemsNum(_itemId, deleteNum)
 | 
						||
    --if _itemId == 2 then
 | 
						||
    --    PlayerManager.PromoteLevel(deleteNum)
 | 
						||
    --end
 | 
						||
    --改为后端刷新了  但是体力得从这减
 | 
						||
    --if this.bagDatas[_itemId] then
 | 
						||
    --    this.bagDatas[_itemId].num = this.bagDatas[_itemId].num - deleteNum
 | 
						||
    --    if _itemId == 2 then
 | 
						||
    --        PlayerManager.PromoteLevel(deleteNum)
 | 
						||
    --    end
 | 
						||
    --    Log("扣东西啦" .. _itemId .. "      " .. deleteNum)
 | 
						||
    --    if this.bagDatas[_itemId].num < 0 then
 | 
						||
    --        this.bagDatas[_itemId].num = 0
 | 
						||
    --        Log("东西扣多了啦" .. _itemId .. "      " .. deleteNum)
 | 
						||
    --    end
 | 
						||
    --    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
    --else
 | 
						||
    --    Log("扣了不存在的item" .. _itemId .. "      " .. deleteNum)
 | 
						||
    --end
 | 
						||
end
 | 
						||
 | 
						||
-- 消耗背包物品,先消耗临时背包,再消耗总背包
 | 
						||
function this.SpendBagItem(itemId, deleteNum)
 | 
						||
    -- 当前临时背包数据
 | 
						||
    --if this.mapShotTimeItemData[itemId] then
 | 
						||
    --    local tempBagNum = this.mapShotTimeItemData[itemId].itemNum
 | 
						||
    --    if tempBagNum >= deleteNum then
 | 
						||
    --        -- 临时背包数据充足
 | 
						||
    --        tempBagNum = tempBagNum - deleteNum
 | 
						||
    --        -- 道具刚好消耗完
 | 
						||
    --        if tempBagNum == 0 then
 | 
						||
    --            this.mapShotTimeItemData[itemId] = nil
 | 
						||
    --        else
 | 
						||
    --            this.mapShotTimeItemData[itemId].itemNum = tempBagNum
 | 
						||
    --        end
 | 
						||
    --    else
 | 
						||
    --        -- 临时背包数量不充足
 | 
						||
    --        local leftNeed = deleteNum - this.mapShotTimeItemData[itemId].itemNum
 | 
						||
    --        this.mapShotTimeItemData[itemId] = nil
 | 
						||
    --        this.UpdateItemsNum(itemId, leftNeed)
 | 
						||
    --    end
 | 
						||
    --else
 | 
						||
    --    -- 临时背包无此道具
 | 
						||
    --    this.UpdateItemsNum(itemId, deleteNum)
 | 
						||
    --end
 | 
						||
end
 | 
						||
 | 
						||
-- 获得临时背包和外部背包的总数量
 | 
						||
function this.GetTotalItemNum(itemId)
 | 
						||
    local totalnum = 0
 | 
						||
    if this.GetTempBagCountById(itemId) and this.GetItemCountById(itemId) then
 | 
						||
        totalnum = this.GetTempBagCountById(itemId) + this.GetItemCountById(itemId)
 | 
						||
    else
 | 
						||
        if not this.GetTempBagCountById(itemId) or this.GetTempBagCountById(itemId) == 0 then
 | 
						||
            totalnum = this.GetItemCountById(itemId)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return totalnum
 | 
						||
end
 | 
						||
 | 
						||
--增加体力
 | 
						||
function this.UpdateAddTiliNum(addNum)
 | 
						||
    if this.bagDatas[2] then
 | 
						||
        this.bagDatas[2].num = this.bagDatas[2].num + addNum
 | 
						||
    else
 | 
						||
        local itemData = {}
 | 
						||
        itemData.itemId = 2
 | 
						||
        itemData.itemNum = addNum
 | 
						||
        this.UpdateBagData(itemData)
 | 
						||
    end
 | 
						||
    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
end
 | 
						||
--获取所有背包物品
 | 
						||
function this.GetBagItemData()
 | 
						||
    local _index = 1
 | 
						||
    local _bagItemData = {}
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.isBag and v.num > 0 then
 | 
						||
            _bagItemData[_index] = v
 | 
						||
            _index = _index + 1
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return _bagItemData
 | 
						||
end
 | 
						||
 | 
						||
--通过背包物品品质获得物品list
 | 
						||
function this.GetBagItemDataByItemQuality(_itemQuality)
 | 
						||
    local _bagItemData = this.GetBagItemData()
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    for i, v in pairs(_bagItemData) do
 | 
						||
        if v.quality == _itemQuality and v.num > 0 then
 | 
						||
            items[index] = v
 | 
						||
            index = index + 1
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return items
 | 
						||
end
 | 
						||
--获得背包所有可携带入地图的物品list
 | 
						||
function this.GetBagItemDataByItemMapIsShow()
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.itemConfig.IsShow then
 | 
						||
            if v.itemConfig.IsShow == 1 then
 | 
						||
                local itemdata = {}
 | 
						||
                itemdata.itemType = 1 -- 物品道具
 | 
						||
                itemdata.backData = v.itembackData
 | 
						||
                itemdata.configData = v.itemConfig
 | 
						||
                itemdata.name = GetLanguageStrById(v.itemConfig.Name)
 | 
						||
                itemdata.frame = GetQuantityImageByquality(v.itemConfig.Quantity)
 | 
						||
                itemdata.icon = GetResourcePath(v.itemConfig.ResourceID)
 | 
						||
                itemdata.num = v.num
 | 
						||
                items[index] = itemdata
 | 
						||
                index = index + 1
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return items
 | 
						||
end
 | 
						||
--通过物品类型获得物品list
 | 
						||
function this.GetBagItemDataByItemType(_itemType)
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    --LogError("_itemType            ".._itemType)
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        --LogError(v.itemConfig.Name.."   ".._itemType.."     "..v.type.."       "..v.num)
 | 
						||
        if v.type == _itemType and v.num > 0 and v.itemConfig.BackpackOrNot then
 | 
						||
            items[index] = v
 | 
						||
            index = index + 1
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return items
 | 
						||
end
 | 
						||
 | 
						||
--通过物品类型获得物品list
 | 
						||
function this.GetBagItemDataByItemTypeV2(_itemType,_itemType1,_itemType2)
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    --LogError("_itemType            ".._itemType)
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        --LogError(v.itemConfig.Name.."   ".._itemType.."     "..v.type.."       "..v.num)
 | 
						||
        if (v.type == _itemType or v.type == _itemType1 or v.itemType == _itemType2) and v.num > 0 and v.itemConfig.BackpackOrNot then
 | 
						||
            items[index] = v
 | 
						||
            index = index + 1
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return items
 | 
						||
end
 | 
						||
--通过物品类型和品质获得物品list
 | 
						||
function this.GetBagItemDataByItemTypeV3(_itemType,_itemType2,_itemQuality )
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    --LogError("_itemType            ".._itemType)
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        --LogError(v.itemConfig.Name.."   ".._itemType.."     "..v.type.."       "..v.num)
 | 
						||
        if (v.type == _itemType and v.itemType == _itemType2)  and v.itemConfig.BackpackOrNot and v.quality == _itemQuality and v.num > 0 then
 | 
						||
            items[index] = v
 | 
						||
            index = index + 1
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return items
 | 
						||
end
 | 
						||
--通过物品类型获得物品list
 | 
						||
function this.GetItemDataByItemType(_itemType)
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    --LogError("_itemType            ".._itemType)
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.type == _itemType and v.num > 0 then
 | 
						||
            items[index] = v
 | 
						||
            index = index + 1
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return items
 | 
						||
end
 | 
						||
 | 
						||
--通过物品类型获得物品list
 | 
						||
function this.GetItemDataByTimeIsGold(_id)
 | 
						||
    --LogError("_itemType            ".._itemType)
 | 
						||
    local list={}
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.itemConfig.ItemType == ItemType.TimeIsGold and v.num > 0 and v.itemConfig.UseGain and v.itemConfig.UseGain[1][1]==_id  then
 | 
						||
           table.insert(list,v)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if #list>0 then
 | 
						||
       table.sort(list,function(a,b) 
 | 
						||
          return a.itemConfig.Quantity > b.itemConfig.Quantity
 | 
						||
       end)
 | 
						||
       return list[1]
 | 
						||
    end
 | 
						||
    return nil
 | 
						||
end
 | 
						||
 | 
						||
 | 
						||
 | 
						||
--通过物品类型获得物品list
 | 
						||
function this.GetDataByItemType(_itemType)
 | 
						||
    local items = {}
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.itemConfig.ItemType == _itemType and v.num > 0  then
 | 
						||
           table.insert(items,v)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return items
 | 
						||
end
 | 
						||
--获取所有的魂印
 | 
						||
function this.GetAllSoulPrintData(quality)
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.type == ItemBaseType.SoulPrint and v.num > 0 then
 | 
						||
            if not quality or quality == 0 then
 | 
						||
                for n = 1, v.num do
 | 
						||
                    local itemdata = {}
 | 
						||
                    itemdata.id = v.id
 | 
						||
                    itemdata.itemType = v.itemType -- 物品道具
 | 
						||
                    itemdata.itembackData = v.itembackData
 | 
						||
                    itemdata.itemConfig = v.itemConfig
 | 
						||
                    itemdata.quality = v.itemConfig.Quantity
 | 
						||
                    itemdata.frame = GetQuantityImageByquality(v.itemConfig.Quantity)
 | 
						||
                    itemdata.icon = v.icon
 | 
						||
                    itemdata.num = 1
 | 
						||
                    itemdata.isSelect = false
 | 
						||
                    items[index] = itemdata
 | 
						||
                    index = index + 1
 | 
						||
                end
 | 
						||
            elseif quality > 0 and v.quality == quality then
 | 
						||
                for n = 1, v.num do
 | 
						||
                    local itemdata = {}
 | 
						||
                    itemdata.id = v.id
 | 
						||
                    itemdata.itemType = v.itemType -- 物品道具
 | 
						||
                    itemdata.itembackData = v.itembackData
 | 
						||
                    itemdata.itemConfig = v.itemConfig
 | 
						||
                    itemdata.quality = v.itemConfig.Quantity
 | 
						||
                    itemdata.frame = GetQuantityImageByquality(v.itemConfig.Quantity)
 | 
						||
                    itemdata.icon = v.icon
 | 
						||
                    itemdata.num = 1
 | 
						||
                    itemdata.isSelect = false
 | 
						||
                    items[index] = itemdata
 | 
						||
                    index = index + 1
 | 
						||
                end
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    table.sort(
 | 
						||
        items,
 | 
						||
        function(a, b)
 | 
						||
            -- if a.quality > b.quality then
 | 
						||
            --     return true
 | 
						||
            -- elseif a.quality == b.quality then
 | 
						||
            --     return a.id > b.id
 | 
						||
            -- else
 | 
						||
            --     return false
 | 
						||
            -- end
 | 
						||
            if a.quality == b.quality then
 | 
						||
                return a.id > b.id
 | 
						||
            else
 | 
						||
                return a.quality > b.quality
 | 
						||
            end
 | 
						||
        end
 | 
						||
    )
 | 
						||
    return items
 | 
						||
end
 | 
						||
 | 
						||
--获取所有的魂印
 | 
						||
function this.GetAllGodPrintData(quality)
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.type == ItemBaseType.GodPrint and v.num > 0 then
 | 
						||
            if not quality or quality == 0 then
 | 
						||
                for n = 1, v.num do
 | 
						||
                    local itemdata = {}
 | 
						||
                    itemdata.id = v.id
 | 
						||
                    itemdata.itemType = v.itemType -- 物品道具
 | 
						||
                    itemdata.itembackData = v.itembackData
 | 
						||
                    itemdata.itemConfig = v.itemConfig
 | 
						||
                    itemdata.quality = v.itemConfig.Quantity
 | 
						||
                    itemdata.frame = GetQuantityImageByquality(v.itemConfig.Quantity)
 | 
						||
                    itemdata.icon = v.icon
 | 
						||
                    itemdata.num = 1
 | 
						||
                    itemdata.isSelect = false
 | 
						||
                    items[index] = itemdata
 | 
						||
                    index = index + 1
 | 
						||
                end
 | 
						||
            elseif quality > 0 and v.quality == quality then
 | 
						||
                for n = 1, v.num do
 | 
						||
                    local itemdata = {}
 | 
						||
                    itemdata.id = v.id
 | 
						||
                    itemdata.itemType = v.itemType -- 物品道具
 | 
						||
                    itemdata.itembackData = v.itembackData
 | 
						||
                    itemdata.itemConfig = v.itemConfig
 | 
						||
                    itemdata.quality = v.itemConfig.Quantity
 | 
						||
                    itemdata.frame = GetQuantityImageByquality(v.itemConfig.Quantity)
 | 
						||
                    itemdata.icon = v.icon
 | 
						||
                    itemdata.num = 1
 | 
						||
                    itemdata.isSelect = false
 | 
						||
                    items[index] = itemdata
 | 
						||
                    index = index + 1
 | 
						||
                end
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    table.sort(
 | 
						||
        items,
 | 
						||
        function(a, b)
 | 
						||
            -- if a.quality > b.quality then
 | 
						||
            --     return true
 | 
						||
            -- elseif a.quality == b.quality then
 | 
						||
            --     return a.id > b.id
 | 
						||
            -- else
 | 
						||
            --     return false
 | 
						||
            -- end
 | 
						||
            if a.quality == b.quality then
 | 
						||
                return a.id > b.id
 | 
						||
            else
 | 
						||
                return a.quality > b.quality
 | 
						||
            end
 | 
						||
        end
 | 
						||
    )
 | 
						||
    return items
 | 
						||
end
 | 
						||
 | 
						||
 | 
						||
 | 
						||
 | 
						||
--通过品质和星级获取装备列表
 | 
						||
function this.GetEquipDataByEquipQualityAndStar(qualityList,starList)
 | 
						||
    local equips = this.GetBagItemDataByItemType(ItemBaseType.Equip)   
 | 
						||
    if (not qualityList or LengthOfTable(qualityList) < 1) and (not starList or LengthOfTable(starList) < 1) then
 | 
						||
        return equips
 | 
						||
    end
 | 
						||
    local tempEquips = {}
 | 
						||
    local index = 1
 | 
						||
    if qualityList and LengthOfTable(qualityList) > 0 then
 | 
						||
        for n,v in ipairs(equips) do
 | 
						||
            if equipConfig[v.id] and qualityList[equipConfig[v.id].Quality] 
 | 
						||
            and qualityList[equipConfig[v.id].Quality] == equipConfig[v.id].Quality then
 | 
						||
                tempEquips[index] = v
 | 
						||
                index = index + 1
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    local finalEquips = {}
 | 
						||
    index = 1
 | 
						||
    if starList and LengthOfTable(starList) > 0 then
 | 
						||
        for n,v in ipairs(tempEquips) do           
 | 
						||
            if equipConfig[v.id] then
 | 
						||
                -- local equipstars = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,equipConfig[v.id].Star) 
 | 
						||
                -- if equipstars and starList[equipstars.Stars] and starList[equipstars.Stars] == equipstars.Stars then
 | 
						||
                --     finalEquips[index] = v
 | 
						||
                --     index = index + 1
 | 
						||
                -- end
 | 
						||
                if CheckListIsContainValue1(starList,equipConfig[v.id].Star) then
 | 
						||
                    finalEquips[index] = v
 | 
						||
                    index = index + 1
 | 
						||
                end
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return finalEquips
 | 
						||
end
 | 
						||
 | 
						||
--通过职业和位置获得装备list
 | 
						||
function this.GetEquipDataByEquipPosition(_profession,_position)
 | 
						||
    local equips=this.GetEquipDataByEquipProfession(_profession)
 | 
						||
    if (_position and _position == 0) or not _position then
 | 
						||
        return equips
 | 
						||
    else
 | 
						||
        local equipsPosition = {}
 | 
						||
        local index = 1
 | 
						||
        for i, v in ipairs(equips) do
 | 
						||
            if equipConfig[v.id].Position == _position then
 | 
						||
                equipsPosition[index] = v
 | 
						||
                index = index + 1
 | 
						||
            end
 | 
						||
        end       
 | 
						||
        return equipsPosition
 | 
						||
    end
 | 
						||
    return nil
 | 
						||
end
 | 
						||
 | 
						||
function this.GetEquipDataByEquipProfession(_profession)
 | 
						||
    local equips = this.GetBagItemDataByItemType(ItemBaseType.Equip)   
 | 
						||
    if (_profession and _profession == 0) or not _profession then
 | 
						||
        return equips
 | 
						||
    else
 | 
						||
        local equipsPosition = {}
 | 
						||
        local index = 1
 | 
						||
        for i, v in ipairs(equips) do
 | 
						||
            if equipConfig[v.id] and  (equipConfig[v.id].ProfessionLimit == _profession or equipConfig[v.id].ProfessionLimit == 0) then
 | 
						||
                equipsPosition[index] = v
 | 
						||
                index = index + 1
 | 
						||
            end
 | 
						||
        end
 | 
						||
        return equipsPosition
 | 
						||
    end
 | 
						||
    return nil    
 | 
						||
end
 | 
						||
 | 
						||
--通过装备品质获得装备list
 | 
						||
function this.GetEquipDataByEquipQuality(_quality)
 | 
						||
    local equips = this.GetBagItemDataByItemType(ItemBaseType.Equip)
 | 
						||
    local equipsPosition = {}
 | 
						||
    if (_quality and _quality == 0) or not _quality then
 | 
						||
        equipsPosition = equips
 | 
						||
    else
 | 
						||
        for i, v in pairs(equips) do
 | 
						||
            if equipConfig[v.id].quality == _quality then
 | 
						||
                table.insert(equipsPosition, v)
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return equipsPosition
 | 
						||
end
 | 
						||
 | 
						||
--工坊 通过装备品质获得该品质所有符文list
 | 
						||
function this.GetBagItemDataByQuDownAll(_itemType, fuwenQuality)
 | 
						||
    local _bagItemData = BagManager.GetBagItemData()
 | 
						||
    local items = {}
 | 
						||
    local index = 1
 | 
						||
    for i, v in pairs(_bagItemData) do
 | 
						||
        if v.itemType == _itemType then
 | 
						||
            if v.quality == fuwenQuality then
 | 
						||
                items[index] = v
 | 
						||
                index = index + 1
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return items
 | 
						||
end
 | 
						||
 | 
						||
--地图临时背包数据存储
 | 
						||
function this.InitMapShotTimeBagData(_mapItem)
 | 
						||
    local singleitemdata = {}
 | 
						||
    local _itemCfgData = itemConfig[_mapItem.itemId]
 | 
						||
    if _itemCfgData ~= nil then
 | 
						||
        singleitemdata.backData = _mapItem
 | 
						||
        singleitemdata.itemId = _mapItem.itemId
 | 
						||
 | 
						||
        singleitemdata.itemNum = _mapItem.itemNum
 | 
						||
        singleitemdata.isSave = _itemCfgData.IsSave
 | 
						||
        if this.mapShotTimeItemData[singleitemdata.itemId] == nil then
 | 
						||
            this.mapShotTimeItemData[singleitemdata.itemId] = singleitemdata
 | 
						||
        else
 | 
						||
            this.mapShotTimeItemData[singleitemdata.itemId].itemNum = singleitemdata.itemNum
 | 
						||
         -- this.mapShotTimeItemData[singleitemdata.itemId].itemNum + singleitemdata.itemNum
 | 
						||
        end
 | 
						||
        if _mapItem.itemId == 43 then
 | 
						||
            -- 是炸弹
 | 
						||
            this.mapShotTimeItemData[singleitemdata.itemId].itemNum =
 | 
						||
                this.mapShotTimeItemData[singleitemdata.itemId].itemNum >= 3 and 3 or
 | 
						||
                this.mapShotTimeItemData[singleitemdata.itemId].itemNum
 | 
						||
        end
 | 
						||
    end
 | 
						||
 | 
						||
    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnTempBagChanged)
 | 
						||
end
 | 
						||
--通过物品id获取地图临时背包物品数量
 | 
						||
function this.GetMapBagItemCountById(_itemId)
 | 
						||
    --Log(_itemId)
 | 
						||
    if this.mapShotTimeItemData[_itemId] then
 | 
						||
        return this.mapShotTimeItemData[_itemId].itemNum
 | 
						||
    end
 | 
						||
    return 0
 | 
						||
end
 | 
						||
--把地图临时背包物品数量加成到背包中
 | 
						||
function this.InBagGetMapBag()
 | 
						||
    --for i, v in pairs(this.mapShotTimeItemData) do
 | 
						||
    --    if v.isSave then
 | 
						||
    --        if v.isSave == 1 then
 | 
						||
    --            this.UpdateBagData(v)
 | 
						||
    --        end
 | 
						||
    --    end
 | 
						||
    --end
 | 
						||
    for i, v in pairs(EquipManager.mapShotTimeItemData) do
 | 
						||
        EquipManager.UpdateEquipData(v)
 | 
						||
    end
 | 
						||
    for i, v in pairs(HeroManager.mapShotTimeItemData) do
 | 
						||
        HeroManager.UpdateHeroDatas(v)
 | 
						||
    end
 | 
						||
    for i, v in pairs(TalismanManager.mapShotTimeItemData) do
 | 
						||
        TalismanManager.InitUpdateSingleTalismanData(v)
 | 
						||
    end
 | 
						||
 | 
						||
    --SoulPrintManager.InitServerData(SoulPrintManager.mapShotTimeItemData)
 | 
						||
    EquipTreasureManager.InitAllEquipTreasure(SoulPrintManager.mapShotTimeItemData)
 | 
						||
    this.mapShotTimeItemData = {}
 | 
						||
    EquipManager.mapShotTimeItemData = {}
 | 
						||
    HeroManager.mapShotTimeItemData = {}
 | 
						||
    TalismanManager.mapShotTimeItemData = {}
 | 
						||
    SoulPrintManager.mapShotTimeItemData = {}
 | 
						||
    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
end
 | 
						||
function this.OnShowTipDropNumZero(drop)
 | 
						||
    local addMaxNumItemNameList = ""
 | 
						||
    if drop.itemlist ~= nil and #drop.itemlist > 0 then
 | 
						||
        for i = 1, #drop.itemlist do
 | 
						||
            if drop.itemlist[i].itemNum <= 0 then
 | 
						||
                --Log("后端穿数量为零  所以弹板提示    " .. GetLanguageStrById(itemConfig[drop.itemlist[i].itemId].Name))
 | 
						||
                if addMaxNumItemNameList == "" then
 | 
						||
                    addMaxNumItemNameList = GetLanguageStrById(itemConfig[drop.itemlist[i].itemId].Name)
 | 
						||
                else
 | 
						||
                    addMaxNumItemNameList = addMaxNumItemNameList .. "、" .. GetLanguageStrById(itemConfig[drop.itemlist[i].itemId].Name)
 | 
						||
                end
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if addMaxNumItemNameList and addMaxNumItemNameList ~= "" then
 | 
						||
        MsgPanel.ShowOne(Language[10168] .. addMaxNumItemNameList)
 | 
						||
    end
 | 
						||
end
 | 
						||
 | 
						||
--服务器掉落物品直接进背包
 | 
						||
function this.GoIntoBackData(drop)
 | 
						||
    if (#drop.itemlist > 0) then
 | 
						||
    --BagManager.UpDataBagItemIdNumber(drop.itemlist)
 | 
						||
    --Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_Normal)
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_ShenJiang)
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_Friend)
 | 
						||
        CheckRedPointStatus(RedPointType.Sacred)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_gold)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_red)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_whiteGold)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_blue)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_whiteBlue)
 | 
						||
        Game.GlobalEvent:DispatchEvent(GameEvent.Bag.GetNewItemIncarnation)
 | 
						||
    end
 | 
						||
    if (#drop.equipId > 0) then
 | 
						||
        for i = 1, #drop.equipId do
 | 
						||
            EquipManager.UpdateEquipData(drop.equipId[i])
 | 
						||
        end
 | 
						||
        --在关卡界面获得装备 刷新下btview成员红点
 | 
						||
        Game.GlobalEvent:DispatchEvent(GameEvent.Equip.EquipChange)
 | 
						||
    end
 | 
						||
    if (#drop.Hero > 0) then
 | 
						||
        for i = 1, #drop.Hero do
 | 
						||
            HeroManager.UpdateHeroDatas(drop.Hero[i])
 | 
						||
        end
 | 
						||
        CheckRedPointStatus(RedPointType.PersonTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.BuddishTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.DemonTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.TaoistTrailHelp)
 | 
						||
    end
 | 
						||
    -- if (#drop.especialEquipId > 0) then
 | 
						||
    --     for i = 1, #drop.especialEquipId do
 | 
						||
    --         TalismanManager.InitUpdateSingleTalismanData(drop.especialEquipId[i])
 | 
						||
    --     end
 | 
						||
    -- end
 | 
						||
    LogBlue("drop.soulEquip:"..#drop.soulEquip)
 | 
						||
    if (#drop.soulEquip > 0) then
 | 
						||
        --SoulPrintManager.InitServerData(drop.soulEquip)
 | 
						||
        EquipTreasureManager.InitAllEquipTreasure(drop.soulEquip)
 | 
						||
    end
 | 
						||
    if (#drop.pokemon > 0) then
 | 
						||
        --SoulPrintManager.InitServerData(drop.soulEquip)
 | 
						||
        PokemonManager.InitPokemonsData(drop.pokemon)
 | 
						||
    end
 | 
						||
        CheckRedPointStatus(RedPointType.Huaxutan_CompoundHero)
 | 
						||
end
 | 
						||
 | 
						||
function this.GMCallBackData(drop)
 | 
						||
    --for i = 1, #drop.itemlist do
 | 
						||
    --    BagManager.UpdateBagData(drop.itemlist[i])
 | 
						||
    --end
 | 
						||
    if drop.equipId and #drop.equipId > 0 then
 | 
						||
        for i = 1, #drop.equipId do
 | 
						||
            EquipManager.UpdateEquipData(drop.equipId[i])
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.Hero and #drop.Hero > 0 then
 | 
						||
        for i = 1, #drop.Hero do
 | 
						||
            HeroManager.UpdateHeroDatas(drop.Hero[i])
 | 
						||
        end
 | 
						||
        CheckRedPointStatus(RedPointType.PersonTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.BuddishTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.DemonTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.TaoistTrailHelp)
 | 
						||
    end
 | 
						||
    -- if drop.especialEquipId and #drop.especialEquipId > 0 then
 | 
						||
    --     for i = 1, #drop.especialEquipId do
 | 
						||
    --         TalismanManager.InitUpdateSingleTalismanData(drop.especialEquipId[i])
 | 
						||
    --     end
 | 
						||
    -- end
 | 
						||
    -- LogBlue("drop.soulEquip:"..#drop.soulEquip)
 | 
						||
    if (#drop.soulEquip > 0) then
 | 
						||
        --SoulPrintManager.InitServerData(drop.soulEquip)
 | 
						||
        EquipTreasureManager.InitAllEquipTreasure(drop.soulEquip)
 | 
						||
    end
 | 
						||
    if (#drop.pokemon > 0) then
 | 
						||
        --SoulPrintManager.InitServerData(drop.soulEquip)
 | 
						||
        PokemonManager.InitPokemonsData(drop.pokemon)
 | 
						||
    end
 | 
						||
    CheckRedPointStatus(RedPointType.Sacred)
 | 
						||
end
 | 
						||
 | 
						||
--将后端drop转为前端table  只解析,不做任何其他操作
 | 
						||
function this.GetTableByBackDropDataNew(drop)
 | 
						||
    local itemDataList = {}
 | 
						||
    if drop.itemlist ~= nil and #drop.itemlist > 0 then
 | 
						||
        for i = 1, #drop.itemlist do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 1
 | 
						||
             --item
 | 
						||
            itemdata.sId = drop.itemlist[i].itemId
 | 
						||
            itemdata.backData = drop.itemlist[i]
 | 
						||
            itemdata.configData = itemConfig[drop.itemlist[i].itemId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            itemdata.frame = GetQuantityImageByquality(itemdata.configData.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.ResourceID)
 | 
						||
            itemdata.num = drop.itemlist[i].itemNum
 | 
						||
            table.insert(itemDataList, itemdata)           
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.equipId ~= nil and #drop.equipId > 0 then
 | 
						||
        for i = 1, #drop.equipId do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 2
 | 
						||
             --装备
 | 
						||
            itemdata.sId = drop.equipId[i].equipId
 | 
						||
            itemdata.backData = drop.equipId[i]
 | 
						||
            itemdata.configData = itemConfig[drop.equipId[i].equipId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            itemdata.frame = GetQuantityImageByquality(itemdata.configData.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.Hero ~= nil and #drop.Hero > 0 then
 | 
						||
        for i = 1, #drop.Hero do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 3
 | 
						||
             --英雄
 | 
						||
            itemdata.sId = drop.Hero[i].heroId
 | 
						||
            itemdata.backData = drop.Hero[i]
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.HeroConfig, drop.Hero[i].heroId)
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.ReadingName)
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemdata.configData.Quality,itemdata.configData.Star)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.Icon)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.soulEquip ~= nil and #drop.soulEquip > 0 then
 | 
						||
        for i = 1, #drop.soulEquip do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 5
 | 
						||
             --魂印
 | 
						||
            itemdata.sId = drop.soulEquip[i].equipId
 | 
						||
            itemdata.backData = drop.soulEquip[i]
 | 
						||
            itemdata.level = SoulPrintManager.soulPrintLevel[drop.soulEquip[i].equipId]
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.EquipSign, drop.soulEquip[i].id)
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            local itemConfig = itemConfig[drop.soulEquip[i].id]
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.pokemon ~= nil and #drop.pokemon > 0 then
 | 
						||
        for i = 1, #drop.pokemon do
 | 
						||
            local itemdata = {}            
 | 
						||
            itemdata.sId = drop.pokemon[i].tempId
 | 
						||
            itemdata.backData = drop.pokemon[i]           
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.SpiritAnimal, drop.pokemon[i].tempId)
 | 
						||
            local itemConfig = itemConfig[drop.pokemon[i].tempId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemConfig.ReadingName)
 | 
						||
            itemdata.config=itemConfig 
 | 
						||
            itemdata.itemType = itemConfig.ItemType          
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return itemDataList
 | 
						||
end
 | 
						||
 | 
						||
--将后端drop转为前端table
 | 
						||
function this.GetTableByBackDropData(drop)
 | 
						||
    local itemDataList = {}
 | 
						||
    if drop.itemlist ~= nil and #drop.itemlist > 0 then
 | 
						||
        for i = 1, #drop.itemlist do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 1
 | 
						||
             --item
 | 
						||
            itemdata.sId = drop.itemlist[i].itemId
 | 
						||
            itemdata.backData = drop.itemlist[i]
 | 
						||
            itemdata.configData = itemConfig[drop.itemlist[i].itemId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            itemdata.frame = GetQuantityImageByquality(itemdata.configData.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.ResourceID)
 | 
						||
            itemdata.num = drop.itemlist[i].itemNum
 | 
						||
            table.insert(itemDataList, itemdata)           
 | 
						||
        end
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_Normal)
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_ShenJiang)
 | 
						||
        CheckRedPointStatus(RedPointType.Recruit_Friend)
 | 
						||
        CheckRedPointStatus(RedPointType.Sacred)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_gold)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_red)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_whiteGold)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_blue)
 | 
						||
        CheckRedPointStatus(RedPointType.tailsmanSoul_whiteBlue)
 | 
						||
        Game.GlobalEvent:DispatchEvent(GameEvent.Bag.GetNewItemIncarnation)
 | 
						||
    end
 | 
						||
    if drop.equipId ~= nil and #drop.equipId > 0 then
 | 
						||
        for i = 1, #drop.equipId do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 2
 | 
						||
             --装备
 | 
						||
            itemdata.sId = drop.equipId[i].equipId
 | 
						||
            itemdata.backData = drop.equipId[i]
 | 
						||
            itemdata.configData = itemConfig[drop.equipId[i].equipId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            itemdata.frame = GetQuantityImageByquality(itemdata.configData.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            EquipManager.UpdateEquipData(itemdata.backData)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.Hero ~= nil and #drop.Hero > 0 then
 | 
						||
        for i = 1, #drop.Hero do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 3
 | 
						||
             --英雄
 | 
						||
            itemdata.sId = drop.Hero[i].heroId
 | 
						||
            itemdata.backData = drop.Hero[i]
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.HeroConfig, drop.Hero[i].heroId)
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.ReadingName)
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemdata.configData.Quality,itemdata.configData.Star)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.Icon)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            HeroManager.UpdateHeroDatas(itemdata.backData)
 | 
						||
        end
 | 
						||
        CheckRedPointStatus(RedPointType.PersonTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.BuddishTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.DemonTrailHelp)
 | 
						||
        CheckRedPointStatus(RedPointType.TaoistTrailHelp)
 | 
						||
    end
 | 
						||
        CheckRedPointStatus(RedPointType.Huaxutan_CompoundHero)
 | 
						||
    
 | 
						||
    LogError("drop.soulEquip:"..#drop.soulEquip)
 | 
						||
    if drop.soulEquip ~= nil and #drop.soulEquip > 0 then
 | 
						||
        for i = 1, #drop.soulEquip do
 | 
						||
            local itemdata = {}
 | 
						||
            
 | 
						||
             --魂印
 | 
						||
            itemdata.sId = drop.soulEquip[i].equipId
 | 
						||
            itemdata.backData = drop.soulEquip[i]
 | 
						||
            LogError("drop.soulEquip[i].equipId==============="..drop.soulEquip[i].equipId)
 | 
						||
            
 | 
						||
            local equipSign=ConfigManager.TryGetConfigData(ConfigName.EquipSign, drop.soulEquip[i].id)
 | 
						||
            if equipSign then
 | 
						||
                itemdata.configData = equipSign
 | 
						||
            else
 | 
						||
                itemdata.configData = itemConfig[drop.soulEquip[i].equipId]
 | 
						||
            end
 | 
						||
             
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            local itemConfig = itemConfig[drop.soulEquip[i].equipId]
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            if equipSign==nil then
 | 
						||
                itemdata.itemType = ItemType.Talisman
 | 
						||
                LogError("                                    ----------------------------------- 添加法灵")
 | 
						||
                FaLingManager.AddEquipToList(drop.soulEquip[i])
 | 
						||
            else
 | 
						||
                itemdata.itemType = 5
 | 
						||
                itemdata.level = SoulPrintManager.soulPrintLevel[drop.soulEquip[i].equipId]
 | 
						||
                SoulPrintManager.UpSoulPrintLevel(drop.soulEquip[i].equipId, drop.soulEquip[i].exp)
 | 
						||
                EquipTreasureManager.InitAllEquipTreasure(drop.soulEquip)
 | 
						||
            end
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            --SoulPrintManager.InitServerData(drop.soulEquip)
 | 
						||
            
 | 
						||
            
 | 
						||
            --TalismanManager.InitUpdateSingleTalismanData(itemdata.backData)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.pokemon ~= nil and #drop.pokemon > 0 then
 | 
						||
        for i = 1, #drop.pokemon do
 | 
						||
            local itemdata = {}            
 | 
						||
            itemdata.sId = drop.pokemon[i].tempId
 | 
						||
            itemdata.backData = drop.pokemon[i]           
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.SpiritAnimal, drop.pokemon[i].tempId)
 | 
						||
            local itemConfig = itemConfig[drop.pokemon[i].tempId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemConfig.ReadingName)
 | 
						||
            itemdata.config=itemConfig 
 | 
						||
            itemdata.itemType = itemConfig.ItemType          
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            PokemonManager.UpdatePokemonDatas(itemdata.backData,true)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.gemNew ~= nil and #drop.gemNew > 0 then
 | 
						||
        local isChange=false
 | 
						||
        for i = 1, #drop.gemNew do
 | 
						||
            local itemdata = {}            
 | 
						||
            itemdata.sId = drop.gemNew[i].id
 | 
						||
            itemdata.backData = drop.gemNew[i] 
 | 
						||
            local configData=ConfigManager.GetConfigData(ConfigName.GemConfigNew, drop.gemNew[i].id)          
 | 
						||
            itemdata.configData = configData
 | 
						||
            itemdata.configData.ItemType = 31
 | 
						||
            --local itemConfig = itemConfig[drop.pokemon[i].tempId]
 | 
						||
            itemdata.name = configData.Name
 | 
						||
           -- itemdata.config=itemConfig 
 | 
						||
            itemdata.ItemType = 31--itemConfig.ItemType    
 | 
						||
            itemdata.config=configData      
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(configData.Quality)
 | 
						||
            itemdata.icon = GetResourcePath(configData.Image)
 | 
						||
            itemdata.num = 1
 | 
						||
            if drop.gemNew[i].isReplace==1 then
 | 
						||
                itemdata.isReplace=true
 | 
						||
                isChange=true
 | 
						||
            else
 | 
						||
                itemdata.isReplace=false
 | 
						||
            end
 | 
						||
            
 | 
						||
            local pros={}
 | 
						||
            local proList=drop.gemNew[i].attr
 | 
						||
            for j=1,#proList do
 | 
						||
                --pros[proList[j].id]=proList[j].value
 | 
						||
                pros[j]={proList[j].id,proList[j].value}
 | 
						||
            end
 | 
						||
            itemdata.pro=pros
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            if isChange then
 | 
						||
                HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Gem)
 | 
						||
                --获取新战力
 | 
						||
                NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL)
 | 
						||
                local tempPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
 | 
						||
               -- LogError("oldwar===="..  .."     temppower=="..tempPower)
 | 
						||
                if GemNewManager.oldPower  ~= tempPower  then
 | 
						||
                    UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = GemNewManager.oldPower,newValue = tempPower})
 | 
						||
                    GemNewManager.oldPower=tempPower
 | 
						||
                end
 | 
						||
            end
 | 
						||
            
 | 
						||
            --PokemonManager.UpdatePokemonDatas(itemdata.backData,true)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
    RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
 | 
						||
    return itemDataList
 | 
						||
end
 | 
						||
 | 
						||
-- 将drop的数据解析存进临时背包, isSave 为true 为保存进临时背包
 | 
						||
function this.GetItemListFromTempBag(drop, isSave)
 | 
						||
    local itemDataList = {}
 | 
						||
    if drop.itemlist ~= nil and #drop.itemlist > 0 then
 | 
						||
        for i = 1, #drop.itemlist do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 1
 | 
						||
             --item
 | 
						||
            itemdata.sId = drop.itemlist[i].itemId
 | 
						||
            itemdata.backData = drop.itemlist[i]
 | 
						||
            itemdata.configData = itemConfig[drop.itemlist[i].itemId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            itemdata.frame = GetQuantityImageByquality(itemdata.configData.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.ResourceID)
 | 
						||
            itemdata.num = drop.itemlist[i].itemNum
 | 
						||
            --LogGreen("itemdata.configData.ItemType        "..itemdata.configData.ItemType.."    this.dropIsSHowEquipPrint     "..tostring(this.dropIsSHowEquipPrint))
 | 
						||
            if itemdata.configData.ItemType ~= ItemType.Equip and itemdata.configData.ItemType ~= ItemType.HunYin then
 | 
						||
                table.insert(itemDataList, itemdata)
 | 
						||
            elseif  this.dropIsSHowEquipPrint then--献祭  升星吞卡 掉落身上装备和魂印 但是不显示  前端做处理
 | 
						||
                table.insert(itemDataList, itemdata)
 | 
						||
            end    
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.equipId ~= nil and #drop.equipId > 0 then
 | 
						||
        --LogError("获取宝物的数量:".. LengthOfTable(drop.equipId))
 | 
						||
        for i = 1, #drop.equipId do
 | 
						||
            local itemdata = {}
 | 
						||
            local equipId = drop.equipId[i].equipId
 | 
						||
            local equip = ConfigManager.TryGetConfigData(ConfigName.JewelConfig, equipId)
 | 
						||
            local faxiang ConfigManager.TryGetConfigData(ConfigName.FaxiangConfig, equipId)
 | 
						||
            if equip then
 | 
						||
                itemdata.itemType = 5
 | 
						||
             --宝物
 | 
						||
            elseif faxiang then
 | 
						||
                itemdata.itemType=51
 | 
						||
            else
 | 
						||
                itemdata.itemType = 2
 | 
						||
             --装备
 | 
						||
            end
 | 
						||
            itemdata.sId = equipId
 | 
						||
            itemdata.backData = drop.equipId[i]
 | 
						||
            itemdata.configData = itemConfig[equipId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            itemdata.frame = GetQuantityImageByquality(itemdata.configData.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            if isSave then
 | 
						||
                --判断获取是否是宝物
 | 
						||
                if equip then
 | 
						||
                    EquipTreasureManager.InitSingleTreasureData(itemdata.backData)
 | 
						||
                else
 | 
						||
                    if itemdata.configData.ItemType==ItemType.Talisman then
 | 
						||
                        LogError("                                    ----------------------------------- 添加法灵")
 | 
						||
                        FaLingManager.AddEquipToList(drop)
 | 
						||
                    else
 | 
						||
                        EquipManager.InitMapShotTimeEquipBagData(itemdata.backData)
 | 
						||
                    end
 | 
						||
                    
 | 
						||
                end
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.Hero ~= nil and #drop.Hero > 0 then
 | 
						||
        for i = 1, #drop.Hero do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 3
 | 
						||
             --英雄
 | 
						||
            itemdata.sId = drop.Hero[i].heroId
 | 
						||
            itemdata.backData = drop.Hero[i]
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.HeroConfig, drop.Hero[i].heroId)
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.ReadingName)
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemdata.configData.Quality,itemdata.configData.Star)
 | 
						||
            itemdata.icon = GetResourcePath(itemdata.configData.Icon)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            if isSave then
 | 
						||
                HeroManager.InitMapShotTimeHeroBagData(itemdata.backData)
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
 | 
						||
    if drop.soulEquip ~= nil and #drop.soulEquip > 0 then
 | 
						||
        for i = 1, #drop.soulEquip do
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.sId = drop.soulEquip[i].equipId
 | 
						||
            itemdata.backData = drop.soulEquip[i]
 | 
						||
            itemdata.data = drop.soulEquip
 | 
						||
            itemdata.lv = drop.soulEquip[i].exp
 | 
						||
            itemdata.refineLv = drop.soulEquip[i].rebuildLevel
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.ItemConfig, itemdata.sId)
 | 
						||
            itemdata.itemType = 5
 | 
						||
            local faxiang=ConfigManager.TryGetConfigData(ConfigName.FaxiangConfig,drop.soulEquip[i].equipId)
 | 
						||
            if faxiang then
 | 
						||
                itemdata.itemType=51
 | 
						||
            elseif itemdata.configData.ItemType==ItemType.Talisman then
 | 
						||
                itemdata.itemType=ItemType.Talisman
 | 
						||
            end
 | 
						||
             --宝物
 | 
						||
            
 | 
						||
            LogError("item33333333333333333  itemid=="..itemdata.sId)
 | 
						||
            itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
            local itemConfig = itemConfig[drop.soulEquip[i].equipId]
 | 
						||
            itemdata.itemConfig = itemConfig
 | 
						||
            itemdata.frame = GetQuantityImageByquality(itemConfig.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            itemdata.id = drop.soulEquip[i].id
 | 
						||
            
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            if isSave then
 | 
						||
                if faxiang then
 | 
						||
                    FaXiangManager.InitSingleTreasureData(itemdata.backData)
 | 
						||
                elseif itemdata.configData.ItemType==ItemType.Talisman then
 | 
						||
                    FaLingManager.AddEquipToList(drop)
 | 
						||
                    LogError("                                    ----------------------------------- 添加法灵")
 | 
						||
                else
 | 
						||
                    EquipTreasureManager.InitSingleTreasureData(itemdata.backData)
 | 
						||
                end
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.pokemon ~= nil and #drop.pokemon > 0 then
 | 
						||
        for i = 1, #drop.pokemon do
 | 
						||
            LogError("item44444444444444")
 | 
						||
            local itemdata = {}
 | 
						||
            itemdata.itemType = 6
 | 
						||
            itemdata.sId = drop.pokemon[i].tempId
 | 
						||
            itemdata.backData = drop.pokemon[i]
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.SpiritAnimal, drop.pokemon[i].tempId)
 | 
						||
            local itemConfig = itemConfig[drop.pokemon[i].tempId]
 | 
						||
            itemdata.name = GetLanguageStrById(itemConfig.ReadingName)
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
            if isSave then
 | 
						||
                PokemonManager.UpdatePokemonDatas(itemdata.backData,true)
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    if drop.magicSoldier ~= nil and #drop.magicSoldier > 0 then
 | 
						||
        for i = 1, #drop.magicSoldier do
 | 
						||
            local itemdata = {}
 | 
						||
             
 | 
						||
            LogError("获取神兵----------------------------------------")
 | 
						||
            itemdata.sId = drop.magicSoldier[i].tmpId
 | 
						||
            itemdata.backData = drop.magicSoldier[i]
 | 
						||
            itemdata.configData = ConfigManager.GetConfigData(ConfigName.ShenBing, drop.magicSoldier[i].tmpId)
 | 
						||
            local itemConfig = itemConfig[drop.magicSoldier[i].tmpId]
 | 
						||
            itemdata.itemType =itemConfig.ItemType
 | 
						||
            itemdata.name = GetLanguageStrById(itemConfig.ReadingName)
 | 
						||
            itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
 | 
						||
            itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
            itemdata.num = 1
 | 
						||
            --GodWeaponManager.AddHandBook(itemdata.sId)
 | 
						||
            table.insert(itemDataList, itemdata)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return itemDataList
 | 
						||
end
 | 
						||
 | 
						||
-- 返回所有临时背包的数据
 | 
						||
function this.GetAllTempBagData()
 | 
						||
    local mapItemList = {} --  临时背包所有显示用的道具
 | 
						||
    local itemList = BagManager.mapShotTimeItemData
 | 
						||
    local equipList = EquipManager.mapShotTimeItemData
 | 
						||
    local heroList = HeroManager.mapShotTimeItemData
 | 
						||
    local talismanList = TalismanManager.mapShotTimeItemData
 | 
						||
    local soulPrintList = SoulPrintManager.mapShotTimeItemData
 | 
						||
    for i, v in pairs(itemList) do
 | 
						||
        local itemdata = {}
 | 
						||
        itemdata.itemType = 1 -- 物品道具
 | 
						||
        itemdata.sId = v.itemId
 | 
						||
        itemdata.backData = v
 | 
						||
        itemdata.configData = itemConfig[v.itemId]
 | 
						||
        itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
        itemdata.frame = GetQuantityImageByquality(itemdata.configData.Quantity)
 | 
						||
        itemdata.Quantity = itemdata.configData.Quantity
 | 
						||
        itemdata.icon = GetResourcePath(itemdata.configData.ResourceID)
 | 
						||
        itemdata.num = v.itemNum
 | 
						||
        mapItemList[#mapItemList + 1] = itemdata
 | 
						||
    end
 | 
						||
 | 
						||
    for i, v in pairs(equipList) do
 | 
						||
        local itemdata = {}
 | 
						||
        itemdata.itemType = 2
 | 
						||
         --装备
 | 
						||
        itemdata.sId = v.equipId
 | 
						||
        itemdata.backData = v
 | 
						||
        itemdata.configData = itemConfig[v.equipId]
 | 
						||
        itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
        itemdata.frame = GetQuantityImageByquality(itemdata.configData.Quantity)
 | 
						||
        itemdata.Quantity = itemdata.configData.Quantity
 | 
						||
        itemdata.icon = GetResourcePath(itemdata.configData.ResourceID)
 | 
						||
        itemdata.num = 1
 | 
						||
        mapItemList[#mapItemList + 1] = itemdata
 | 
						||
    end
 | 
						||
 | 
						||
    for i, v in pairs(heroList) do
 | 
						||
        local itemdata = {}
 | 
						||
        itemdata.itemType = 3
 | 
						||
         --英雄
 | 
						||
        itemdata.sId = v.heroId
 | 
						||
        itemdata.backData = v
 | 
						||
        itemdata.configData = ConfigManager.GetConfigData(ConfigName.HeroConfig, v.heroId)
 | 
						||
        itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
        itemdata.frame = GetHeroQuantityImageByquality(itemdata.configData.Quality,itemdata.configData.Star)
 | 
						||
        itemdata.Quantity = itemdata.configData.Star
 | 
						||
        itemdata.icon = GetResourcePath(itemdata.configData.Icon)
 | 
						||
        itemdata.num = 1
 | 
						||
        mapItemList[#mapItemList + 1] = itemdata
 | 
						||
    end
 | 
						||
    for i, v in pairs(talismanList) do
 | 
						||
        local itemdata = {}
 | 
						||
        itemdata.itemType = 4
 | 
						||
         --法宝
 | 
						||
        itemdata.sId = v.equipId
 | 
						||
        itemdata.backData = v
 | 
						||
        itemdata.configData =
 | 
						||
            ConfigManager.GetConfigDataByDoubleKey(
 | 
						||
            ConfigName.EquipTalismana,
 | 
						||
            "TalismanaId",
 | 
						||
            v.equipId,
 | 
						||
            "Level",
 | 
						||
            v.rebuildLevel
 | 
						||
        )
 | 
						||
        itemdata.name = GetLanguageStrById(itemdata.configData.ReadingName)
 | 
						||
        local itemConfig = itemConfig[v.equipId]
 | 
						||
        itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
 | 
						||
        itemdata.Quantity = itemConfig.Quantity
 | 
						||
        itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
        itemdata.num = 1
 | 
						||
        mapItemList[#mapItemList + 1] = itemdata
 | 
						||
    end
 | 
						||
    for i, v in pairs(soulPrintList) do
 | 
						||
        local itemdata = {}
 | 
						||
        itemdata.itemType = 5
 | 
						||
         --魂印
 | 
						||
        itemdata.sId = v.equipId
 | 
						||
        itemdata.backData = v
 | 
						||
        SoulPrintManager.UpSoulPrintLevel(v.equipId, v.exp)
 | 
						||
        itemdata.level = SoulPrintManager.soulPrintLevel[v.equipId]
 | 
						||
        local id = SoulPrintManager.GetSoulPrintId(v.equipId, itemdata.level)
 | 
						||
        itemdata.configData = ConfigManager.GetConfigData(ConfigName.EquipSign, id)
 | 
						||
        itemdata.name = GetLanguageStrById(itemdata.configData.Name)
 | 
						||
        local itemConfig = itemConfig[v.equipId]
 | 
						||
        itemdata.frame = GetHeroQuantityImageByquality(itemConfig.Quantity)
 | 
						||
        itemdata.Quantity = itemConfig.Quantity
 | 
						||
        itemdata.icon = GetResourcePath(itemConfig.ResourceID)
 | 
						||
        itemdata.num = 1
 | 
						||
        mapItemList[#mapItemList + 1] = itemdata
 | 
						||
        --SoulPrintManager.InitServerData(soulPrintList.soulEquip)
 | 
						||
        --TalismanManager.InitUpdateSingleTalismanData(itemdata.backData)
 | 
						||
    end
 | 
						||
 | 
						||
    -- 先类型后品质
 | 
						||
    if #mapItemList > 1 then
 | 
						||
        table.sort(
 | 
						||
            mapItemList,
 | 
						||
            function(a, b)
 | 
						||
                if a.itemType == b.itemType then
 | 
						||
                    return a.Quantity > b.Quantity
 | 
						||
                else
 | 
						||
                    return a.itemType < b.itemType
 | 
						||
                end
 | 
						||
            end
 | 
						||
        )
 | 
						||
    end
 | 
						||
 | 
						||
    return mapItemList
 | 
						||
end
 | 
						||
--设置背包物品红点
 | 
						||
function this.SetItemNewRewPooint()
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.isNewRewPoint then
 | 
						||
            v.isNewRewPoint = false
 | 
						||
            RedPointManager.PlayerPrefsSetStrItemId(v.id, 1)
 | 
						||
        end
 | 
						||
    end
 | 
						||
end
 | 
						||
--是否有可合成碎片
 | 
						||
function this.GetBagRedPointIsCanCompoundDebris()
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.itemType == ItemType.HeroDebris or v.itemType == ItemType.EquipChip or v.itemType == ItemType.likeabilityItemChip then
 | 
						||
            local curExpVal = BagManager.GetItemCountById(v.id) / v.itemConfig.UsePerCount
 | 
						||
            if curExpVal >= 1 then
 | 
						||
                return true
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return false
 | 
						||
end
 | 
						||
--是否有宝箱 和 可使用蓝图
 | 
						||
function this.GetBagRedPointIsCanOpenBoxAndBlueprint()
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.itemType == ItemType.Box and v.num > 0 and v.itemConfig.BackpackOrNot then
 | 
						||
            --宝箱
 | 
						||
            return true
 | 
						||
        end
 | 
						||
        if v.itemType == ItemType.Blueprint then
 | 
						||
            --蓝图
 | 
						||
            local lanTuData = WorkShopManager.GetLanTuIsOpenLock(v.id)
 | 
						||
            if lanTuData and v.num > 0 and lanTuData[1] == false then
 | 
						||
                return true
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return false
 | 
						||
end
 | 
						||
 | 
						||
--获取该类型的所有背包数据
 | 
						||
function this.GetBagAllDataByItemType(ItemType)
 | 
						||
    local thisItemTypeAllDatas = {}
 | 
						||
    for i, v in pairs(this.bagDatas) do
 | 
						||
        if v.itemType == ItemType then
 | 
						||
            table.insert(thisItemTypeAllDatas, v)
 | 
						||
        end
 | 
						||
    end
 | 
						||
    return thisItemTypeAllDatas
 | 
						||
end
 | 
						||
 | 
						||
function this.BagIndicationRefresh(msg)
 | 
						||
    for i, v in pairs(msg.item) do
 | 
						||
        if v and v.itemId then
 | 
						||
            --背包存储
 | 
						||
            if BagManager.bagDatas[v.itemId] == nil then
 | 
						||
                BagManager.UpdateBagData(v)
 | 
						||
            else
 | 
						||
                BagManager.bagDatas[v.itemId].num = v.itemNum
 | 
						||
                BagManager.bagDatas[v.itemId].endingTime = v.endingTime
 | 
						||
                BagManager.bagDatas[v.itemId].nextFlushTime = v.nextFlushTime
 | 
						||
            end
 | 
						||
            --公会贡献刷新公会技能红点
 | 
						||
            if v.itemId == 65 then
 | 
						||
                if BagManager.bagDatas[v.itemId].num < v.itemNum then
 | 
						||
                    GuildSkillManager.SetAllGuildSkillRedPlayers()
 | 
						||
                end
 | 
						||
                CheckRedPointStatus(RedPointType.Guild_Skill)
 | 
						||
            end
 | 
						||
            if itemConfig[v.itemId].ItemType == ItemType.LingShouChip then--灵兽碎片获得刷新红点
 | 
						||
                Game.GlobalEvent:DispatchEvent(GameEvent.Pokemon.PokemonChipRefresh)
 | 
						||
            end
 | 
						||
            --刷新身外化身红点
 | 
						||
            if v.itemId == 1295 or itemConfig[v.itemId].ItemType == ItemType.Incarnation then
 | 
						||
                CheckRedPointStatus(RedPointType.incarnation_people)
 | 
						||
                CheckRedPointStatus(RedPointType.incarnation_buddish)
 | 
						||
                CheckRedPointStatus(RedPointType.incarnation_demon)
 | 
						||
                CheckRedPointStatus(RedPointType.incarnation_taoist)
 | 
						||
                CheckRedPointStatus(RedPointType.incarnation_Kong)
 | 
						||
            end
 | 
						||
            if v.itemId == 1351 then
 | 
						||
                DynamicActivityManager.ChangeMingWangLv()
 | 
						||
            end
 | 
						||
        end
 | 
						||
    end
 | 
						||
 | 
						||
    RedpotManager.CheckRedPointStatus(RedPointType.LuckyTurn)
 | 
						||
    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
 | 
						||
    --检测背包红点
 | 
						||
    CheckRedPointStatus(RedPointType.Bag_HeroDebris)
 | 
						||
    CheckRedPointStatus(RedPointType.Bag_BoxAndBlueprint)
 | 
						||
    CheckRedPointStatus(RedPointType.Recruit_Normal)
 | 
						||
    CheckRedPointStatus(RedPointType.Recruit_ShenJiang)
 | 
						||
    CheckRedPointStatus(RedPointType.Recruit_Friend)
 | 
						||
    CheckRedPointStatus(RedPointType.Sacred)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_gold)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_red)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_whiteGold)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_blue)
 | 
						||
    CheckRedPointStatus(RedPointType.tailsmanSoul_whiteBlue)
 | 
						||
    Game.GlobalEvent:DispatchEvent(GameEvent.Bag.GetNewItemIncarnation)
 | 
						||
    -- 超出最大数量限制提示
 | 
						||
    if msg.isMax and msg.isMax == 1 then
 | 
						||
        PopupTipPanel.ShowTip(Language[10169])
 | 
						||
    end
 | 
						||
end
 | 
						||
 | 
						||
function this.SetDropIsSHowEquipPrint(dropIsSHowEquipPrint)
 | 
						||
     this.dropIsSHowEquipPrint = dropIsSHowEquipPrint
 | 
						||
end
 | 
						||
return this |