From 9d6c209cf862eed79f75f3e7622e1dae738bded9 Mon Sep 17 00:00:00 2001 From: Jari van der Kaap Date: Tue, 29 Nov 2022 00:09:44 +0100 Subject: [PATCH] Added extra CaC slots, unlocked CWL camo's, paid specialist outfits and gobblegums --- src/client/component/loot.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/client/component/loot.cpp b/src/client/component/loot.cpp index c9d52a35..49cd010f 100644 --- a/src/client/component/loot.cpp +++ b/src/client/component/loot.cpp @@ -12,12 +12,32 @@ namespace loot namespace { utils::hook::detour loot_getitemquantity_hook; + utils::hook::detour liveinventory_getitemquantity_hook; + utils::hook::detour liveinventory_areextraslotspurchased_hook; int loot_getitemquantity_stub(const game::ControllerIndex_t controllerIndex, const game::eModes mode, const int itemId) { + if (mode == game::eModes::MODE_ZOMBIES) { + return 999; + } return 1; } + int liveinventory_getitemquantity_stub(const game::ControllerIndex_t controllerIndex, const int itemId) + { + // Item id's for extra CaC slots, CWL camo's and paid specialist outfits + if (itemId == 99003 || itemId >= 99018 && itemId <= 99021 || itemId == 99025 || itemId >= 90047 && itemId <= 90064) { + return 1; + } + + return liveinventory_getitemquantity_hook.invoke(controllerIndex, itemId); + } + + bool liveinventory_areextraslotspurchased_stub(const game::ControllerIndex_t controllerIndex) + { + return true; + } + void set_dvars_on_startup() { game::Dvar_SetFromStringByName("ui_enableAllHeroes", "1", true); @@ -32,6 +52,8 @@ namespace loot { scheduler::once(set_dvars_on_startup, scheduler::pipeline::main); loot_getitemquantity_hook.create(0x141E82C90_g, loot_getitemquantity_stub); + liveinventory_getitemquantity_hook.create(0x141E090C0_g, liveinventory_getitemquantity_stub); + liveinventory_areextraslotspurchased_hook.create(0x141E089E0_g, liveinventory_areextraslotspurchased_stub); } }; };