Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% 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
- %%Make Crate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement