Platform = {} local this = Platform; PLATFORMSYSDATA = "R$platform_sys_data" local MonthCardType = 40 local PlatformType = { KaiYing = "kaiying" } function Platform.init() local data = {} data.channel = ConfigDataManager.getTableValue("cfg_global", "value", "id", 500) setsysvar(PLATFORMSYSDATA, data) end function Platform.putIntoBag(actor, itemId) local data = getsysvar(PLATFORMSYSDATA) if data == nil then return end -- if data.channel == PlatformType.KaiYing then if PrivilegeMonth.hasPrivilegeType(actor, MonthCardType) ~= true then Platform.setItemBind(actor, itemId, 1) else local item = getbagiteminfo(actor, itemId, 1) if item == nil then return end local lockItem = ConfigDataManager.getTableValue("cfg_item", "lockItem", "id", item.cfgid) if lockItem ~= "" and lockItem == "1" then Platform.setItemBind(actor, itemId, 0) end end -- end end function Platform.monthPrivilegeActivation(actor, p_type) -- 解锁了月卡.道具也不能恢复到绑定状态 -- -- 月卡激活 -- if p_type == 72 then -- -- 降低消耗 -- local data = getsysvar(PLATFORMSYSDATA) -- if data == nil then -- return -- end -- -- if data.channel ~= PlatformType.KaiYing then -- -- return -- -- end -- -- 把玩家穿戴.背包.仓库的东西.变为可交易状态 -- local equips = getallbagiteminfo(actor) -- for k, v in pairs(equips) do -- local lockItem = ConfigDataManager.getTableValue("cfg_item", "lockItem", "id", v.cfgid) -- if lockItem ~= nil and lockItem == "1" then -- Platform.setItemBind(actor, v.id, 0) -- end -- end -- for i = 1, 10 do -- local equips = getalliteminfoinstore(actor, i) -- for k, v in pairs(equips) do -- local lockItem = ConfigDataManager.getTableValue("cfg_item", "lockItem", "id", v.cfgid) -- if lockItem ~= nil and lockItem == "1" then -- local isbind = API.GetItemData(actor, v.id, "isbind") -- if isbind ~= 1 then -- -- 没办法修改仓库中物品的数据.只能打上标签.让他显示为可交易状态 -- API.SetItemData(actor, v.id, "isbind", 0) -- end -- -- Platform.setItemBind(actor, v.id, 0) -- end -- end -- end -- local equips = getputonequipinfo(actor) -- for k, v in pairs(equips) do -- local lockItem = ConfigDataManager.getTableValue("cfg_item", "lockItem", "id", v.cfgid) -- if lockItem ~= nil and lockItem == "1" then -- Platform.setItemBind(actor, v.id, 0) -- end -- end -- end end function Platform.setItemBind(actor, itemId, bind) local isbind = API.GetItemData(actor, itemId, "isbind") if isbind == 1 then return end changeitembindstate(actor, itemId, bind) local res = { itemId = itemId, bindId = bind == 1 and true or false } sendluamsg(actor, LuaMessageIdToClient.RES_EQUIP_BIND_DATA_CHANGE, res) end function Platform.isLimitPick(actor) if PrivilegeMonth.hasPrivilegeType(actor, MonthCardType) ~= true then return true end return false end function Platform.pickUpItem(actor, items) local allow = {} local rid = getbaseinfo(actor, "rid") local tip = false for k, v in pairs(items) do if v.luaextdata ~= nil and v.luaextdata.onlypick ~= nil and v.luaextdata.onlypick ~= tonumber(rid) then tip = true allow[v.id] = { allow = false, } else allow[v.id] = { allow = true, } end end if tip then messagebox(actor, "该物品归属为无公爵特权玩家,其他玩家无法拾取!") end return allow end function Platform.resetPick(actor, items, allow) local rid = getbaseinfo(actor, "rid") local tip = false for k, v in pairs(allow) do local index, item = table.findByCondi(items, function(a) return a.id == k end) if item and item.luaextdata and item.luaextdata.onlypick ~= nil and item.luaextdata.onlypick ~= tonumber(rid) then tip = true allow[k].allow = false end end if tip then messagebox(actor, "该物品归属为无公爵特权玩家,其他玩家无法拾取!") end return allow end