local wep_arr = {
'new_m4', 'glock_17', 'mp9', 'r870', 'glock_18c', 'amcar', 'm16', 'olympic', 'ak74', 'akm', 'akmsu', 'saiga', 'ak5', 'aug', 'g36', 'p90', 'new_m14', 'deagle', 'new_mp5', 'colt_1911', 'mac10', 'serbu', 'huntsman', 'b92fs', 'new_raging_bull', 'saw'
}
for i, name in ipairs(wep_arr) do
if not managers.upgrades:aquired(name) then
managers.upgrades:aquire(name)
end
end
for mod_id,_ in pairs(tweak_data.blackmarket.weapon_mods) do
tweak_data.blackmarket.weapon_mods[ mod_id ].unlocked = true
managers.blackmarket:add_to_inventory("normal", "weapon_mods", mod_id, false)
end
managers.blackmarket:_setup_masks()
for mask_id,_ in pairs(tweak_data.blackmarket.masks) do
Global.blackmarket_manager.masks[mask_id].unlocked = true
managers.blackmarket:add_to_inventory("normal", "masks", mask_id, false)
end
if managers.achievment then
for id,_ in pairs(managers.achievment.achievments) do
managers.achievment:award(id)
end
end
function giveitems( times, type )
for i=1, times do
for mat_id,_ in pairs(tweak_data.blackmarket[type]) do
if _.infamous then
managers.blackmarket:add_to_inventory("infamous", type, mat_id, false)
elseif _.dlc then
managers.blackmarket:add_to_inventory("preorder", type, mat_id, false)
else
managers.blackmarket:add_to_inventory("normal", type, mat_id, false)
end
end
managers.blackmarket:remove_item("normal", "materials", "plastic", false)
managers.blackmarket:remove_item("normal", "colors", "nothing", false)
end
end
giveitems(1, "masks")
giveitems(1, "materials")
giveitems(1, "textures")
giveitems(1, "colors")
giveitems(1, "weapon_mods")
for dlc_name, dlc_data in pairs( Global.dlc_manager.all_dlc_data ) do
dlc_name = { app_id = "218620", no_install = true }
dlc_data.verified = true
end
function GenericDLCManager:has_dlc( dlc )
if dlc == "cce" then
dlc = "career_criminal_edition"
end
return true
end
function GenericDLCManager:has_gage_pack()
return true
end
function GenericDLCManager:has_gage_pack_lmg()
return true
end
function GenericDLCManager:has_gage_pack_shotgun()
return true
end
function GenericDLCManager:has_armored_transport()
return true
end
function GenericDLCManager:has_pd2_clan()
return true
end
function GenericDLCManager:has_xmas_soundtrack()
return true
end
function BlackMarketManager:weapon_unlocked( weapon_id )
return true
end
for dlc_name, dlc_data in pairs( Global.dlc_manager.all_dlc_data ) do
dlc_name = { app_id = "218620", no_install = true }
end
function AssetsItem:_return_asset_info( i )
local asset_cost = nil
if self._asset_locked[i] then
local can_unlock = true
if( ( Network:is_server() or managers.assets.ALLOW_CLIENTS_UNLOCK ) and can_unlock ) then
asset_cost = managers.money:get_mission_asset_cost_by_id( self._assets_names[i][4] )
else
asset_cost = true
end
end
return i, asset_cost
end
managers.blackmarket.weapon_unlocked = BlackMarketManager.weapon_unlocked
setupitems = setupitems or function(thing, what, tbl)
for k,v in pairs(thing) do
if v.infamous == true then
tbl["infamous"][what][tostring(k)] = 2
else
if tostring(k) ~= "plastic" and not string.find(tostring(k), "no_color") then
tbl["normal"][what][tostring(k)] = 2
end
end
end
end
if not _allmaskstuff then
_allmaskstuff = { normal = {materials = {}, colors = {}, textures = {}, masks = {} }, infamous = {materials = {}, colors = {}, textures = {}, masks = {} } }
setupitems(tweak_data.blackmarket.materials, "materials", _allmaskstuff)
setupitems(tweak_data.blackmarke*****lors, "colors", _allmaskstuff)
setupitems(tweak_data.blackmarket.textures, "textures", _allmaskstuff)
setupitems(tweak_data.blackmarket.masks, "masks", _allmaskstuff)
end
orig_get_inv_cat = orig_get_inv_cat or managers.blackmarket.get_inventory_category
managers.blackmarket.get_inventory_category = function(self, category)
if category ~= "materials" and category ~= "colors" and category ~= "textures" and category ~= "masks" then
return orig_get_inv_cat(self, category)
end
local t = {}
for global_value,categories in pairs( _allmaskstuff ) do
if categories[ category ] then
for id,amount in pairs( categories[ category ] ) do
table.insert( t, { id = id, global_value = global_value, amount = amount } )
end
end
end
return t
end
function processMask(mask_id, mask)
if mask_id == "character_locked" then
return
end
if mask.infamy_lock then
mask.infamy_lock = nil
end
if not mask.pcs and not mask.pc then
mask.pcs = { 10, 20, 30, 40 }
end
if mask.dlc and not managers.dlc:has_dlc(mask.dlc) then
mask.dlc = nil
end
for key, dlc in ipairs(mask.dlcs or {}) do
if not managers.dlc:has_dlc(dlc) then
mask.dlcs[key] = nil
end
end
end
for mask_id, mask in pairs(tweak_data.blackmarket.masks) do
processMask(mask_id, mask)
end
for i, value in pairs(tweak_data.lootdrop.global_values) do
if value.hide_unavailable then
value.hide_unavailable = false
end
end
managers.blackmarket.get_item_amount = function(self, global_value, category, id, no_prints )
return 2
end
function inTable( table, value )
if table ~= nil then for i,x in pairs(table) do if x == value then return true end end end
return false
end
function unlockitems( itype )
local types = {"weapon_mods", "masks", "materials", "textures", "colors", "weapons"}
if not itype then itype = "all" end
if type(itype) == "table" then types = itype end
if itype == "all" or type(itype) == "table" then
for i = 1,
#types do unlockitems(types[i]) end
return
elseif not inTable(types, itype) then return end
if itype == "weapons" then
for wep_id,_ in pairs(tweak_data.upgrades.definitions) do
if _.category == "weapon" and not string.find(wep_id, "_primary") and not string.find(wep_id, "_secondary") then
if not managers.upgrades:aquired(wep_id) then managers.upgrades:aquire(wep_id) end
end
end
else
for mat_id,_ in pairs(tweak_data.blackmarket[itype]) do
if not _.unlocked then _.unlocked = true end
end
end
end
function unlockmaskslots()
for i = 1, 36 do
Global.blackmarket_manager.unlocked_mask_slots[i] = true
end
end
function unlockweaponslots()
for i = 1, 36 do
Global.blackmarket_manager.unlocked_weapon_slots.p rimaries[i] = true
Global.blackmarket_manager.unlocked_weapon_slots.s econdaries[i] = true
end
end
function giveitems( itype, times )
local types = {"weapon_mods", "masks", "materials", "textures", "colors"}
local skip = { masks = {"character_locked"}, materials = {"plastic"}, colors = {"nothing"}, textures = {"no_color_full_material","no_color_no_material "} }
if not itype then itype = "all" end
if not times then times = 5 end
if type(itype) == "table" then types = itype end
if itype == "all" or type(itype) == "table" then
for i = 1,
#types do giveitems(types[i], times) end
return
elseif not inTable(types, itype) then return end
for i=1, times do
for mat_id,_ in pairs(tweak_data.blackmarket[itype]) do
if not inTable(skip[itype], mat_id) then
local global_value = "normal"
if _.global_value then
global_value = _.global_value
elseif _.infamous then
global_value = "infamous"
elseif _.dlcs or _.dlc then
local dlcs = _.dlcs or {}
if _.dlc then table.insert( dlcs, _.dlc ) end
global_value = dlcs[ math.random(
#dlcs ) ]
end
if not _.unlocked then _.unlocked = true end
managers.blackmarket:add_to_inventory(global_value , itype, mat_id, false)
end
end
end
end
function giveitem( item, times , global_value)
local types = {"weapon_mods", "masks", "materials", "textures", "colors"}
if not times then times = 20 end
for t = 1,
#types do
local itype = types[t]
for mat_id,_ in pairs(tweak_data.blackmarket[itype]) do
if (type(item) == "table" and inTable(item, mat_id)) or (type(item) ~= "table" and mat_id == item) then
if not global_value then
local global_value = "normal"
if _.global_value then
global_value = _.global_value
elseif _.infamous then
global_value = "infamous"
elseif _.dlcs or _.dlc then
local dlcs = _.dlcs or {}
if _.dlc then table.insert( dlcs, _.dlc ) end
global_value = dlcs[ math.random(
#dlcs ) ]
end
end
if not _.unlocked then _.unlocked = true end
for i=1, times do managers.blackmarket:add_to_inventory(global_value , itype, mat_id, false) end
if type(item) ~= "table" then return end
end
end
end
end
unlockmaskslots()
unlockweaponslots()
unlockitems()
giveitems()
managers.infamy:_set_points(0)
-- MESSAGE
if managers.hud then
managers.hud:show_hint( { text = "UNLOCK - HACK LOADED!" } )
end
-- MESAGGE