feat: give random item per req
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
#include <minwindef.h>
|
#include <minwindef.h>
|
||||||
|
|
||||||
@@ -219,6 +220,21 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
|
|
||||||
if (js.contains("bloodWebData"))
|
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;
|
std::vector<std::string> paths;
|
||||||
json ringDataArray = json::array();
|
json ringDataArray = json::array();
|
||||||
|
|
||||||
@@ -246,7 +262,7 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
paths.push_back(parentId + "_" + childId);
|
paths.push_back(parentId + "_" + childId);
|
||||||
|
|
||||||
nodeDataArray.push_back(
|
nodeDataArray.push_back(
|
||||||
{{"nodeId", childId}, {"state", "Collected"}, {"contentId", "ADDON_toolbox_socketswivels"}});
|
{{"nodeId", childId}, {"state", "Collected"}, {"contentId", selectedContentId}});
|
||||||
}
|
}
|
||||||
|
|
||||||
ringDataArray.push_back({{"nodeData", nodeDataArray}});
|
ringDataArray.push_back({{"nodeData", nodeDataArray}});
|
||||||
|
|||||||
Reference in New Issue
Block a user