LootBox

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
The point is mod/leadership should be commenting in this thread and providing insight - not leaving it up to users to comb through.

Regardless if it truly was a problem the site is hosting the file for download - I guess legally the fault would fall on the site owner and person who uploaded it really.
There is no backdoor on it, if i dont answer is because i dont have time this days i have a life outside of ark. You have the source you can check them and you can compile it your self i made a video to show how.
He's been outcasted from the mod and dev community as a result of it. Nobody trust's him outside of his server.
Me too i love you <3 <3
 
If i want to add a lootbox to the point shop, how would i do this? and is this possible. So that players can buy a lootbox with points
 
well arkshop dont have a placeholder for steamid, so not sure if its possible! maybe im wrong!
 
could you go into a little more depth of what
"MinQuality": 100,
"MaxQuality": 100,

is? I'm assuming its for upgrading the gear ramshackle,aprent, etc but how would we determine these values easily without just "trial and error"
Threshholds for each that you happen to know of? If so I'd like to know the Min/Max for each quality of item.
 
could you go into a little more depth of what
"MinQuality": 100,
"MaxQuality": 100,

is? I'm assuming its for upgrading the gear ramshackle,aprent, etc but how would we determine these values easily without just "trial and error"
Threshholds for each that you happen to know of? If so I'd like to know the Min/Max for each quality of item.

https://ark.gamepedia.com/Item_Quality

It will roll somewhere between min and max and thats what your quality item/bp will be.
 
is there a way to sdet this up to give loot boxes based of certain dino killed and how many?
 
Works just fine with 2.9 api!

Dont think you can add them to ark shop!

Overview page has this as first item:
"- This plugin allowed you to create LootBox in ark and sell them in your shop"
 
Overview page has this as first item:
"- This plugin allowed you to create LootBox in ark and sell them in your shop"
By shop i mean your webstore not Arkshop otherwise i will write in you ingame shop or Arkshop
 
@Maticha I noticed that the min - max quality is not percentage wise. Everything above quality 10 is ascended.
How does the quality actually work? because in the default config, it's set to 100.
 
Also, is there a way to spawn in an entire armor set? or is it always piece by piece?
 
@Maticha I noticed that the min - max quality is not percentage wise. Everything above quality 10 is ascended.
How does the quality actually work? because in the default config, it's set to 100.
About the quality after the quality 10 the item will always be ascendent but the price will be higher ''price to craft it"
Also, is there a way to spawn in an entire armor set? or is it always piece by piece?
No its just item by item
 
Suggestion.
Make lootbox reward automatic for time expend in game just like Arkshop.

config adding this.
"General":{
"TimedboxReward":{
"Enabled":true,
"Interval":180,
"Groups":{
"Default":{
"Amount":5
},
"Premiums":{
"Amount":5
}
}
},
},
 
Ok I come with the solution of all 3 type Item, Dino and resource be setup on count =1.
And the system do a random choice.
But mu code is not working. It is compiling well be getting erro 1114.
Here is my solution
RandomRewards.cpp file I comment the random selection to get back to originals file. even so it compile fine but not working in game.

Code:
#include "API/ARK/Ark.h"
#include "RandomRewards.h"
#include <random>
#include <iostream>
#include "Public/Points.h"

#pragma comment(lib, "ArkShop.lib")

namespace RandomRewards {

    void generateAndGiveRewards(AShooterPlayerController* sender, FString* lootbox)
    {
//      Random choices of 3 type Items Dinos and Resources
//        int result = rand() % 3;
//        chosed 0
//        if (result == 0) {
            // Items
            uint64 itemRolls = LootBoxes::config["LootBoxes"][lootbox->ToString()]["Items"]["Count"];
            for (int i = 0; i < itemRolls; i++) {

                const nlohmann::json itemArray = LootBoxes::config["LootBoxes"][lootbox->ToString()];
                auto itemIter = itemArray.find("Items");
                const nlohmann::basic_json<> item = itemIter.value();
                auto possibleItems = item.value("PossibleItems", nlohmann::json::array());


                // Selecting Random Item from Itemlist in config.json

                int size = possibleItems.size();
                std::random_device rd;
                std::mt19937 eng(rd());
                std::uniform_int_distribution<> rand(0, size - 1);

                nlohmann::json selectedItem = possibleItems.at(rand(eng));

                // Get the Data from the random item

                int Amount = selectedItem["Amount"];
                int MinQuality = selectedItem["MinQuality"];
                int MaxQuality = selectedItem["MaxQuality"];
                int BlueprintChance = selectedItem["BlueprintChance"];

                std::string BlueprintPath = selectedItem["BlueprintPath"];
                FString FBlueprintPath(BlueprintPath.c_str());

                bool isBlueprint = false;
                std::uniform_int_distribution<> blueprint(1, 100);
                if (blueprint(eng) <= BlueprintChance) isBlueprint = true;
                std::uniform_int_distribution<> quality(MinQuality, MaxQuality);
                int RandomQuality = quality(eng);

                UShooterCheatManager* cheatManager = static_cast<UShooterCheatManager*>(sender->CheatManagerField());
                if (cheatManager) cheatManager->GiveItemToPlayer((int)sender->LinkedPlayerIDField(), &FBlueprintPath, Amount, (float)RandomQuality, isBlueprint);
            }
//        }
//        chosed 1
//        else if (result == 1) {
                // Dinos
                int dinoRolls = LootBoxes::config["LootBoxes"][lootbox->ToString()]["Dinos"]["Count"];
                for (int i = 0; i < dinoRolls; i++) {
                    const nlohmann::json itemArray = LootBoxes::config["LootBoxes"][lootbox->ToString()];
                    auto itemIter = itemArray.find("Dinos");
                    const nlohmann::basic_json<> item = itemIter.value();
                    auto possibleItems = item.value("PossibleDinos", nlohmann::json::array());


                    // Selecting Random Dinos from DinoList in config.json

                    int size = possibleItems.size();
                    std::random_device rd;
                    std::mt19937 eng(rd());
                    std::uniform_int_distribution<> rand(0, size - 1);

                    nlohmann::json selectedItem = possibleItems.at(rand(eng));

                    // Get the Data from the random dino

                    int level = selectedItem["Level"];
                    std::string BlueprintPath = selectedItem["BlueprintPath"];
                    FString FBlueprintPath(BlueprintPath.c_str());
                    ArkApi::GetApiUtils().SpawnDino(sender, FBlueprintPath, nullptr, level, true, false);
                }
//            }
//        chosed 2
//        else {
                // Resources
                int resourcesRolls = LootBoxes::config["LootBoxes"][lootbox->ToString()]["Resources"]["Count"];
                for (int i = 0; i < resourcesRolls; i++) {
                    const nlohmann::json itemArray = LootBoxes::config["LootBoxes"][lootbox->ToString()];
                    auto itemIter = itemArray.find("Resources");
                    const nlohmann::basic_json<> item = itemIter.value();
                    auto possibleItems = item.value("PossibleResources", nlohmann::json::array());


                    // Selecting Random Resources from ResourceList in config.json

                    int size = possibleItems.size();
                    std::random_device rd;
                    std::mt19937 eng(rd());
                    std::uniform_int_distribution<> rand(0, size - 1);

                    nlohmann::json selectedItem = possibleItems.at(rand(eng));

                    // Get the Data from the random resource

                    int Amount = selectedItem["Amount"];
                    std::string BlueprintPath = selectedItem["BlueprintPath"];
                    FString FBlueprintPath(BlueprintPath.c_str());

                    UShooterCheatManager* cheatManager = static_cast<UShooterCheatManager*>(sender->CheatManagerField());
                    if (cheatManager) cheatManager->GiveItemToPlayer((int)sender->LinkedPlayerIDField(), &FBlueprintPath, Amount, (float)1, false);
                }
//            }

        // RCONCommand
        int RCONRolls = LootBoxes::config["LootBoxes"][lootbox->ToString()]["RCONCommands"]["Count"];
        for (int i = 0; i < RCONRolls; i++) {
            const nlohmann::json itemArray = LootBoxes::config["LootBoxes"][lootbox->ToString()];
            auto itemIter = itemArray.find("RCONCommands");
            const nlohmann::basic_json<> item = itemIter.value();
            auto possibleCommands = item.value("PossibleCommands", nlohmann::json::array());

            int size = possibleCommands.size();
            std::random_device rd;
            std::mt19937 eng(rd());
            std::uniform_int_distribution<> rand(0, size - 1);

            nlohmann::json selectedCommand = possibleCommands.at(rand(eng));

            std::string command = selectedCommand["Command"];
            int MinPointsShop = selectedCommand["MinPointShop"];
            int MaxPointsShop = selectedCommand["MaxPointShop"];

            std::uniform_int_distribution<> points(MinPointsShop, MaxPointsShop);

            int shoppoints = points(eng);
            uint64 steamId = ArkApi::GetApiUtils().GetSteamIdFromController(sender);

            // Use the ArkShop API to add points
            ArkShop::Points::AddPoints(shoppoints, steamId);          

        }
    }
}
View attachment 937
 
Monetize your ARK server
Rogue Vikings Discord Server - Rogue Vikings Gaming Servers - Minecraft Prison Servers - Minecraft Creative Servers
Tempest Dedicated Servers
Tebex
Back
Top