feat: give random item per req

This commit is contained in:
2026-04-07 01:33:02 -03:00
parent 9c83499f0f
commit afb4a9c157
+17 -1
View File
@@ -3,6 +3,7 @@
#include <fstream>
#include <algorithm>
#include <unordered_set>
#include <random>
#include <minwindef.h>
@@ -219,6 +220,21 @@ void Spoofer::modifyCharacterData(json& js)
if (js.contains("bloodWebData"))
{
static std::random_device rd;
static std::mt19937 rng(rd());
std::unordered_set<std::string> stackableIds;
stackableIds.insert(_camperItemIds.begin(), _camperItemIds.end());
stackableIds.insert(_camperOfferingIds.begin(), _camperOfferingIds.end());
stackableIds.insert(_camperAddonIds.begin(), _camperAddonIds.end());
stackableIds.insert(_slasherAddonIds.begin(), _slasherAddonIds.end());
stackableIds.insert(_slasherOfferingIds.begin(), _slasherOfferingIds.end());
std::string selectedContentId = "Spring2024Offering";
auto it = stackableIds.begin();
std::advance(it, std::uniform_int_distribution<>(0, static_cast<int>(_camperOfferingIds.size()) - 1)(rng));
selectedContentId = *it;
std::vector<std::string> paths;
json ringDataArray = json::array();
@@ -246,7 +262,7 @@ void Spoofer::modifyCharacterData(json& js)
paths.push_back(parentId + "_" + childId);
nodeDataArray.push_back(
{{"nodeId", childId}, {"state", "Collected"}, {"contentId", "ADDON_toolbox_socketswivels"}});
{{"nodeId", childId}, {"state", "Collected"}, {"contentId", selectedContentId}});
}
ringDataArray.push_back({{"nodeData", nodeDataArray}});