Ark Survival Random Loot Drop Generator Script

Hello,

I'm the server owner of a small 50 person Ark server called Paragon's Paradise 10x. I place random raidable bases around my server so people can have fun raiding with a low population at the moment. I'm super picky on what items went inside the creates i left and I wanted it to be as fair as possible. So I took every ark item decided what was worth getting and what wasn't in a random drop and assigned them a rarity 0-4 with 0 being not used and 4 being Ultra rare. The code was written in MatLab  but with a bit of tweaking its basic enough to get to work with python or C++. The code also Requires importing the cell data I included which has all the ID and BP's. The Code Outputs copy and paste cheats for the loot with varying quantity and quality.

ID DATATABLE ( NEED TO IMPORT THIS CELL DATA AS ArkIDBook ) - http://pastebin.com/8wgyrAgK

Paste Bin Code - http://pastebin.com/Gxrku2wh


%% 10 item Random Loot Drop Generator  Difficulty 1 - ( 6 Common items, 3 uncommon items, 1 rare, 0 Ultra rare )
%% Difficulty 2 -  ( 4 Common items, 3 uncommon items, 2 rare, 0 Ultra rare )
%% Difficulty 3 - (2 common 3 uncommon 3 rare 2 Ultra rare)
%% RNG controls amount of times it goes through the selection process before displaying one.

cell_count = 534;

Type = input('What is the difficulty #(1-3)?');
Times = input('RNG #(1-5)?');
Data = ArkIDBook;

common = {};
uncommon ={};
rare = {};
U_rare = {};
counter_1=1; 
counter_2=1;
counter_3=1;
counter_4=1;
for i = 1:534
    
    Rarity = cell2mat(Data(i,5));
    
    if Rarity == 1
        common(counter_1,:) = Data(i,:);
        counter_1 = counter_1 + 1;
    end
    if Rarity == 2
        uncommon(counter_2,:) = Data(i,:);
        counter_2 = counter_2 + 1;
    end
    if Rarity == 3
        rare(counter_3,:) = Data(i,:);
        counter_3 = counter_3 + 1;
    end
    if Rarity == 4
        U_rare(counter_4,:) = Data(i,:);
        counter_4 = counter_4 + 1;
    end  
end



for i = 1:Times
  if Type == 1
    h_common = 6;
    h_uncommon = 3;
    h_rare = 1;
    h_U_rare = 0;
end
if Type == 2
    h_common = 4;
    h_uncommon = 3;
    h_rare = 2;
    h_U_rare = 1;
end
if Type == 3
    h_common = 2;
    h_uncommon = 3;
    h_rare = 3;
    h_U_rare = 2;
end


com_len = length(common);
uncom_len = length(uncommon);
rare_len = length(rare);
U_rare_len = length(U_rare);

%Compile Common Stuff
Common_stuff = {};
cl1 = 1;
Id_c1 = zeros(1,length(h_common));


for k = 1:(h_common)
    
    
    
     next1 = randi(com_len,1);
     item = common(next1,:);
     tester = 0;
     
     while tester < 1    
     test_me = 0;
     id = cell2mat(item(1));
     
     for j = 1:cl1
         xtex = id == Id_c1(j);
        if xtex == 1
             test_me = 1;
        end
     end
     
    
     
     if test_me == 0
         Id_c1(cl1+1) = id;
         Common_stuff(cl1,:) = common(next1,:);
         cl1 = cl1+1;
         tester = 2;
      
     else
         next1 = randi(com_len,1);
         item = common(next1,:);
         
     end
  end
     
         
         
end

%Compile unCommon Stuff
unCommon_stuff = {};
cl1 = 1;
Id_c1 = zeros(1,length(h_uncommon));


for k = 1:(h_uncommon)
    
    
    
     next1 = randi(uncom_len,1);
     item = uncommon(next1,:);
     tester = 0;
     
     while tester < 1
      
         
     test_me = 0;
     id = cell2mat(item(1));
     
     for j = 1:cl1
         xtex = id == Id_c1(j);
        if xtex == 1
             test_me = 1;
        end
     end
     
  
     
     if test_me == 0
         Id_c1(cl1+1) = id;
         unCommon_stuff(cl1,:) = uncommon(next1,:);
         cl1 = cl1+1;
         tester = 2;
        
     else
         next1 = randi(uncom_len,1);
         item = uncommon(next1,:);
         
     end
     
  end
     
         
         
end


%Compile rare Stuff
rare_stuff = {};
cl1 = 1;
Id_c1 = zeros(1,length(h_rare));


for k = 1:(h_rare)
    
    
    
     next1 = randi(rare_len,1);
     item = rare(next1,:);
     tester = 0;
     
     while tester < 1
      
         
     test_me = 0;
     id = cell2mat(item(1));
     
     for j = 1:cl1
         xtex = id == Id_c1(j);
        if xtex == 1
             test_me = 1;
        end
     end
     
  
     
     if test_me == 0
         Id_c1(cl1+1) = id;
         rare_stuff(cl1,:) = rare(next1,:);
         cl1 = cl1+1;
         tester = 2;
        
     else
         next1 = randi(rare_len,1);
         item = rare(next1,:);
     end    
  end       
end

%Compile Ultra_rare Stuff
U_rare_stuff = {};
cl1 = 1;
Id_c1 = zeros(1,length(h_rare));


for k = 1:(h_U_rare)
    
    
    
     next1 = randi(U_rare_len,1);
     item = U_rare(next1,:);
     tester = 0;
     
     while tester < 1
      
         
     test_me = 0;
     id = cell2mat(item(1));
     
     for j = 1:cl1
         xtex = id == Id_c1(j);
        if xtex == 1
             test_me = 1;
        end
     end
     
  
     
     if test_me == 0
         Id_c1(cl1+1) = id;
         U_rare_stuff(cl1,:) = U_rare(next1,:);
         cl1 = cl1+1;
         tester = 2;
        
     else
         next1 = randi(U_rare_len,1);
         item = U_rare(next1,:);
         
     end
     
  end
     
         
         
end

Create_gear = {};
gear_c = 1;

for b=1:h_common
    Create_gear(gear_c,:) = Common_stuff(b,:);
    gear_c = gear_c +1;
end

for c=1:h_uncommon
    Create_gear(gear_c,:) = unCommon_stuff(c,:);
    gear_c = gear_c +1;
end

for d=1:h_rare
    Create_gear(gear_c,:) = rare_stuff(d,:);
    gear_c = gear_c +1;
end

if Type == 2||3
    for e=1:h_U_rare
        Create_gear(gear_c,:) = U_rare_stuff(e,:);
        gear_c = gear_c +1;
    end
end

end
  gear = Create_gear;
  Final_set = {};
  s2 = 'Armor';
  s3 = 'Saddle';
  s4 = 'Weapons';
  
  for i = 1:10
      Final_set(i,1:2) = gear(i,1:2);
      Test = strcmp(char(gear(i,3)),s2)||strcmp(char(gear(i,3)),s3)||strcmp(char(gear(i,3)),s4);
      if Test
          Quality = randi(7,1);
      else
          Quality = 1;
      end
      if strcmp(char(gear(i,3)),s2) == 1
          Quantity = num2cell(randi(3,1));
      else
          Quantity = num2cell(randi(cell2mat(gear(i,4)),1));
      end
      Final_set(i,3) = Quantity;    
      Final_set(i,4) = num2cell(Quality);
     
  end
 %Compile Final Set for Print
 
 Final_gear = {};
 
 for i = 1:10
     id_is = cell2mat(Final_set(i,1));
     quan = cell2mat(Final_set(i,3));
     qual = cell2mat(Final_set(i,4));
     if  cell2mat(Final_set(i,1)) <= 437
         Final_gear{i} = sprintf('cheat GiveItemNum %d %d %d 0',id_is,quan,qual);
     else
         set_id = char(Data(id_is,6));
         Final_gear{i} = sprintf('cheat GiveItem %s %d %d 0',set_id,quan,qual);
     end
    
 end
      
          
for i = 1:10
    disp(Final_gear{i})
end
  



Output after running the program



cheat GiveItemNum 35 2 1 0
cheat GiveItemNum 434 1 4 0
cheat GiveItemNum 435 2 1 0
cheat GiveItemNum 431 2 2 0
cheat GiveItemNum 168 84 1 0
cheat GiveItem "Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/BuildingBases/PrimalItemStructure_ElevatorPlatformSmall.PrimalItemStructure_ElevatorPlatformSmall'" 3 1 0
cheat GiveItemNum 413 7 1 0
cheat GiveItem "Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Misc/PrimalItemStructure_Bed_Modern.PrimalItemStructure_Bed_Modern'" 2 1 0
cheat GiveItem "Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Misc/PrimalItemStructure_TurretRocket.PrimalItemStructure_TurretRocket'" 2 1 0
cheat GiveItem "Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Misc/PrimalItemStructure_IndustrialForge.PrimalItemStructure_IndustrialForge'" 1 1 0