LootBox 1.0

No permission to download

Maticha

Active member
Donators
Messages
109
Likes
27
Points
28
Website
matichapvp.com
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
 
Advertisement

Monetise Your Game Server

Want to monetise your ARK Server? Create your own webstore at tebex.io

missplooy

New member
Messages
8
Likes
0
Points
1
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
 
Messages
43
Likes
3
Points
8
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.
 

Haragon

Member
Plugin Developer
Donators
Messages
56
Likes
8
Points
8
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.
 

freekill

Member
Donators
Messages
53
Likes
3
Points
8
Website
discord.gg
@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.
 

Maticha

Active member
Donators
Messages
109
Likes
27
Points
28
Website
matichapvp.com
@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
 

nosborbr

New member
Messages
23
Likes
0
Points
1
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
}
}
},
},
 

nosborbr

New member
Messages
23
Likes
0
Points
1
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);          

        }
    }
}
Screenshot (24).png
 
Top